tiptapify 0.0.16 → 0.0.17
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/README.md +2 -2
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +24078 -25377
- package/dist/tiptapify.umd.js +38 -38
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/Tiptapify.vue +3 -3
- package/src/components/Toolbar/Index.vue +9 -30
- package/src/components/Toolbar/Items.vue +14 -29
- package/src/components/Toolbar/actions.ts +18 -0
- package/src/components/Toolbar/alignment.ts +28 -0
- package/src/components/Toolbar/format.ts +28 -0
- package/src/components/Toolbar/formatExtra.ts +33 -0
- package/src/components/Toolbar/items.ts +19 -114
- package/src/components/Toolbar/list.ts +33 -0
- package/src/components/Toolbar/media.ts +33 -0
- package/src/components/Toolbar/misc.ts +38 -0
- package/src/components/Toolbar/style.ts +38 -0
- package/src/components/editorExtensions.ts +4 -4
- package/src/components/index.ts +2 -2
- package/src/extensions/components/actions/redo/Button.vue +29 -0
- package/src/extensions/components/actions/undo/Button.vue +29 -0
- package/src/extensions/components/alignment/center/Button.vue +29 -0
- package/src/extensions/components/alignment/justify/Button.vue +29 -0
- package/src/extensions/components/alignment/left/Button.vue +29 -0
- package/src/extensions/components/alignment/right/Button.vue +29 -0
- package/src/extensions/components/format/bold/Button.vue +30 -0
- package/src/extensions/components/format/italic/Button.vue +30 -0
- package/src/extensions/components/format/strike/Button.vue +30 -0
- package/src/extensions/components/format/underline/Button.vue +30 -0
- package/src/extensions/components/formatExtra/code/Button.vue +30 -0
- package/src/extensions/components/formatExtra/codeBlock/Button.vue +30 -0
- package/src/extensions/components/formatExtra/quote/Button.vue +30 -0
- package/src/extensions/components/formatExtra/sub/Button.vue +30 -0
- package/src/extensions/components/formatExtra/sup/Button.vue +30 -0
- package/src/extensions/components/list/bullet/Button.vue +30 -0
- package/src/extensions/components/list/indent/Button.vue +30 -0
- package/src/extensions/components/list/numbered/Button.vue +30 -0
- package/src/extensions/components/list/outdent/Button.vue +30 -0
- package/src/extensions/components/list/task/Button.vue +30 -0
- package/src/extensions/components/{Emoji.vue → media/emoji/Button.vue} +63 -60
- package/src/extensions/components/media/image/Button.vue +29 -0
- package/src/extensions/components/media/link/Button.vue +31 -0
- package/src/extensions/components/media/table/Button.vue +119 -0
- package/src/extensions/components/media/table/ColumnActions.vue +52 -0
- package/src/extensions/components/media/table/RowActions.vue +52 -0
- package/src/extensions/components/media/video/Button.vue +29 -0
- package/src/extensions/components/misc/break/Button.vue +25 -0
- package/src/extensions/components/misc/formatClear/Button.vue +29 -0
- package/src/extensions/components/misc/invisibleChar/Button.vue +30 -0
- package/src/extensions/components/misc/line/Button.vue +25 -0
- package/src/extensions/components/misc/preview/Button.vue +36 -0
- package/src/extensions/components/misc/source/Button.vue +31 -0
- package/src/extensions/components/{ShowSourceDialog.vue → misc/source/ShowSourceDialog.vue} +5 -14
- package/src/extensions/components/{StyleColor.vue → style/StyleColor.vue} +5 -8
- package/src/extensions/components/style/color/Button.vue +57 -0
- package/src/extensions/components/style/fontFamily/Button.vue +60 -0
- package/src/extensions/components/style/fontFamily/FontFamily.vue +76 -0
- package/src/extensions/components/style/fontSize/Button.vue +64 -0
- package/src/extensions/components/{FontSize.vue → style/fontSize/FontSize.vue} +0 -5
- package/src/extensions/components/style/heading/Button.vue +61 -0
- package/src/extensions/components/style/highlight/Button.vue +57 -0
- package/src/extensions/components/style/lineHeight/Button.vue +60 -0
- package/src/extensions/components/{LineHeight.vue → style/lineHeight/LineHeight.vue} +0 -4
- package/src/types/toolbarSections.ts +16 -2
- package/src/components/Toolbar/Group.vue +0 -42
- package/src/components/Toolbar/GroupBtn.vue +0 -32
- package/src/components/Toolbar/GroupDropdown.vue +0 -67
- package/src/components/Toolbar/defaultExtensionComponents.ts +0 -65
- package/src/composables/Toolbar/Actions/useRedo.ts +0 -22
- package/src/composables/Toolbar/Actions/useUndo.ts +0 -22
- package/src/composables/Toolbar/Alignment/useAlignmentCenter.ts +0 -23
- package/src/composables/Toolbar/Alignment/useAlignmentJustify.ts +0 -23
- package/src/composables/Toolbar/Alignment/useAlignmentLeft.ts +0 -23
- package/src/composables/Toolbar/Alignment/useAlignmentRight.ts +0 -23
- package/src/composables/Toolbar/Format/useBold.ts +0 -23
- package/src/composables/Toolbar/Format/useItalic.ts +0 -23
- package/src/composables/Toolbar/Format/useStrike.ts +0 -23
- package/src/composables/Toolbar/Format/useUnderline.ts +0 -23
- package/src/composables/Toolbar/FormatExtra/useBlockquote.ts +0 -23
- package/src/composables/Toolbar/FormatExtra/useCode.ts +0 -23
- package/src/composables/Toolbar/FormatExtra/useCodeBlock.ts +0 -23
- package/src/composables/Toolbar/FormatExtra/useSub.ts +0 -23
- package/src/composables/Toolbar/FormatExtra/useSup.ts +0 -23
- package/src/composables/Toolbar/List/useBullet.ts +0 -22
- package/src/composables/Toolbar/List/useIndent.ts +0 -23
- package/src/composables/Toolbar/List/useNumbered.ts +0 -22
- package/src/composables/Toolbar/List/useOutdent.ts +0 -23
- package/src/composables/Toolbar/List/useTask.ts +0 -22
- package/src/composables/Toolbar/Media/useEmoji.ts +0 -19
- package/src/composables/Toolbar/Media/useImage.ts +0 -23
- package/src/composables/Toolbar/Media/useLink.ts +0 -23
- package/src/composables/Toolbar/Media/useTable.ts +0 -187
- package/src/composables/Toolbar/Media/useVideo.ts +0 -22
- package/src/composables/Toolbar/Misc/useBreak.ts +0 -20
- package/src/composables/Toolbar/Misc/useFormatClear.ts +0 -22
- package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +0 -22
- package/src/composables/Toolbar/Misc/useLine.ts +0 -20
- package/src/composables/Toolbar/Misc/usePreview.ts +0 -19
- package/src/composables/Toolbar/Misc/useSource.ts +0 -20
- package/src/composables/Toolbar/Style/useColor.ts +0 -35
- package/src/composables/Toolbar/Style/useFontFamily.ts +0 -48
- package/src/composables/Toolbar/Style/useFontSize.ts +0 -49
- package/src/composables/Toolbar/Style/useHeading.ts +0 -63
- package/src/composables/Toolbar/Style/useHighlight.ts +0 -35
- package/src/composables/Toolbar/Style/useLineHeight.ts +0 -48
- package/src/composables/Toolbar/useActionsItems.ts +0 -9
- package/src/composables/Toolbar/useAlignmentItems.ts +0 -13
- package/src/composables/Toolbar/useFormatExtraItems.ts +0 -15
- package/src/composables/Toolbar/useFormatItems.ts +0 -13
- package/src/composables/Toolbar/useListItems.ts +0 -15
- package/src/composables/Toolbar/useMediaItems.ts +0 -15
- package/src/composables/Toolbar/useMiscItems.ts +0 -17
- package/src/composables/Toolbar/useStyleItems.ts +0 -17
- package/src/extensions/components/PreviewDialog.vue +0 -43
- package/src/types/extensionComponents.ts +0 -22
- package/src/types/toolbarItems.ts +0 -41
- /package/src/extensions/components/{ImageDialog.vue → media/image/ImageDialog.vue} +0 -0
- /package/src/extensions/{image.ts → components/media/image/image.ts} +0 -0
- /package/src/extensions/components/{LinkDialog.vue → media/link/LinkDialog.vue} +0 -0
- /package/src/extensions/{link.ts → components/media/link/link.ts} +0 -0
- /package/src/extensions/components/{TableBuilder.vue → media/table/TableBuilder.vue} +0 -0
- /package/src/extensions/components/{VideoDialog.vue → media/video/VideoDialog.vue} +0 -0
- /package/src/extensions/components/{FontFamily.vue → style/lineHeight/FontFamily.vue} +0 -0
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
import * as mdi from "@mdi/js";
|
|
1
|
+
<script lang="ts" setup>
|
|
4
2
|
|
|
3
|
+
import * as mdi from '@mdi/js'
|
|
5
4
|
import { Editor } from "@tiptap/vue-3";
|
|
6
|
-
|
|
7
5
|
import tiptapifyEmojis from "@tiptapify/extensions/emoji"
|
|
8
|
-
|
|
9
6
|
import { computed, inject, Ref, ref, watch } from 'vue'
|
|
10
|
-
|
|
11
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
12
|
-
|
|
13
|
-
defineExpose({ open, close })
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits(['close'])
|
|
7
|
+
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
16
8
|
|
|
17
9
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
18
10
|
|
|
11
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
12
|
+
|
|
19
13
|
const filter = ref(null)
|
|
20
14
|
const tab = ref('smileys_and_emotion')
|
|
21
15
|
const sorted = tiptapifyEmojis.sort((previous, current) => {
|
|
@@ -33,7 +27,6 @@ const emojisRef = ref(JSON.parse(JSON.stringify(emojis.value)))
|
|
|
33
27
|
|
|
34
28
|
const handleEmojiClick = (emoji: any) => {
|
|
35
29
|
editor.value.chain().focus().insertContent(emoji.char).run()
|
|
36
|
-
close()
|
|
37
30
|
}
|
|
38
31
|
|
|
39
32
|
const filterEmoji = (filterValue: string) => {
|
|
@@ -60,67 +53,77 @@ const resetFilter = () => {
|
|
|
60
53
|
emojisRef.value = JSON.parse(JSON.stringify(emojis.value))
|
|
61
54
|
}
|
|
62
55
|
|
|
63
|
-
function close() {
|
|
64
|
-
emit('close')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
56
|
watch(() => tab.value, () => {
|
|
68
57
|
resetFilter()
|
|
69
58
|
filter.value = null
|
|
70
59
|
})
|
|
60
|
+
|
|
71
61
|
</script>
|
|
72
62
|
|
|
73
63
|
<template>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
64
|
+
<VBtn
|
|
65
|
+
id="tiptapify-emoji-button"
|
|
66
|
+
:color="editor.isActive('image') ? 'primary' : ''"
|
|
67
|
+
size="32"
|
|
68
|
+
>
|
|
69
|
+
<VTooltip activator="parent">
|
|
70
|
+
{{ t('media.emoji.title') }}
|
|
71
|
+
</VTooltip>
|
|
72
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiEmoticon}`" />
|
|
73
|
+
</VBtn>
|
|
74
|
+
|
|
75
|
+
<VMenu activator="#tiptapify-emoji-button" :close-on-content-click="false">
|
|
76
|
+
<VSheet class="pa-2" max-width="570">
|
|
77
|
+
<div class="d-flex flex-row">
|
|
78
|
+
<VTabs v-model="tab" mandatory direction="vertical" color="primary" density="compact">
|
|
79
|
+
<VTab
|
|
80
|
+
v-for="item of emojisRef"
|
|
81
|
+
:text="item.group"
|
|
82
|
+
:value="item.group"
|
|
83
|
+
:key="item.group"
|
|
84
|
+
density="compact"
|
|
85
|
+
rounded
|
|
86
|
+
size="small"
|
|
87
|
+
>
|
|
88
|
+
{{ t(`media.emoji.${item.group}`) }}
|
|
89
|
+
</VTab>
|
|
90
|
+
</VTabs>
|
|
91
|
+
|
|
92
|
+
<div>
|
|
93
|
+
<VTextField
|
|
94
|
+
v-model="filter"
|
|
95
|
+
label="Filter emoji"
|
|
96
|
+
density="compact"
|
|
97
|
+
variant="solo"
|
|
98
|
+
:prepend-inner-icon="`mdiSvg:${mdi.mdiMagnify}`"
|
|
99
|
+
class="mb-2"
|
|
100
|
+
hide-details
|
|
101
|
+
clearable
|
|
102
|
+
@input="filterEmoji($event.target.value)"
|
|
103
|
+
@click:clear="resetFilter"
|
|
104
|
+
/>
|
|
105
|
+
<div class="tiptapify-emoji-container">
|
|
106
|
+
<VWindow v-model="tab" direction="vertical">
|
|
107
|
+
<VWindowItem v-for="item of emojisRef" :value="item.group">
|
|
108
|
+
<div
|
|
109
|
+
v-for="emojiItem in item.emojis"
|
|
110
|
+
class="tiptapify-emoji-container-item"
|
|
111
|
+
@click="handleEmojiClick(emojiItem)"
|
|
112
|
+
:title="emojiItem.name"
|
|
113
|
+
>
|
|
114
|
+
<div class="tiptapify-emoji-container-item__overlay">
|
|
113
115
|
<span>
|
|
114
116
|
{{ emojiItem.char }}
|
|
115
117
|
</span>
|
|
118
|
+
</div>
|
|
116
119
|
</div>
|
|
117
|
-
</
|
|
118
|
-
</
|
|
119
|
-
</
|
|
120
|
+
</VWindowItem>
|
|
121
|
+
</VWindow>
|
|
122
|
+
</div>
|
|
120
123
|
</div>
|
|
121
124
|
</div>
|
|
122
|
-
</
|
|
123
|
-
</
|
|
125
|
+
</VSheet>
|
|
126
|
+
</VMenu>
|
|
124
127
|
</template>
|
|
125
128
|
|
|
126
129
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VBtn
|
|
16
|
+
:color="editor.isActive('image') ? 'primary' : ''"
|
|
17
|
+
@click="editor.commands.showTiptapifyImage()"
|
|
18
|
+
size="32"
|
|
19
|
+
>
|
|
20
|
+
<VTooltip activator="parent">
|
|
21
|
+
{{ t('media.image') }}
|
|
22
|
+
</VTooltip>
|
|
23
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiImage}`" />
|
|
24
|
+
</VBtn>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
const icon = computed(() => editor.value.isActive('tiptapifyLink') ? `mdiSvg:${mdi.mdiLinkOff}` : `mdiSvg:${mdi.mdiLink}`)
|
|
13
|
+
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<VBtn
|
|
18
|
+
:color="editor.isActive('link') ? 'primary' : ''"
|
|
19
|
+
@click="editor.commands.showLink()"
|
|
20
|
+
size="32"
|
|
21
|
+
>
|
|
22
|
+
<VTooltip activator="parent">
|
|
23
|
+
{{ t('media.link') }}
|
|
24
|
+
</VTooltip>
|
|
25
|
+
<BtnIcon :icon="icon" />
|
|
26
|
+
</VBtn>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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 ColumnActions from "@tiptapify/extensions/components/media/table/ColumnActions.vue";
|
|
7
|
+
import RowActions from "@tiptapify/extensions/components/media/table/RowActions.vue";
|
|
8
|
+
import TableBuilder from "@tiptapify/extensions/components/media/table/TableBuilder.vue";
|
|
9
|
+
import { inject, Ref } from "vue";
|
|
10
|
+
|
|
11
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
12
|
+
|
|
13
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const rowActionsDisabled = () => {
|
|
17
|
+
return !editor.value.can().chain().focus().addRowBefore().run() &&
|
|
18
|
+
!editor.value.can().chain().focus().addRowAfter().run() &&
|
|
19
|
+
!editor.value.can().chain().focus().deleteRow().run()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const columnActionsDisabled = () => {
|
|
23
|
+
return !editor.value.can().chain().focus().addColumnBefore().run() &&
|
|
24
|
+
!editor.value.can().chain().focus().addColumnAfter().run() &&
|
|
25
|
+
!editor.value.can().chain().focus().deleteColumn().run()
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<VBtn
|
|
31
|
+
id="tiptapify-table-button"
|
|
32
|
+
:color="editor.isActive('table') ? 'primary' : ''"
|
|
33
|
+
:disabled="!editor.can().chain().focus().insertTable().run()"
|
|
34
|
+
size="32"
|
|
35
|
+
>
|
|
36
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTable}`" />
|
|
37
|
+
</VBtn>
|
|
38
|
+
|
|
39
|
+
<VMenu activator="#tiptapify-table-button" :close-on-content-click="false">
|
|
40
|
+
<VList density="compact">
|
|
41
|
+
<VListItem link>
|
|
42
|
+
<VTooltip activator="parent">
|
|
43
|
+
{{ t('media.tables.insertTable') }}
|
|
44
|
+
</VTooltip>
|
|
45
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
46
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTablePlus}`" />
|
|
47
|
+
</VListItemTitle>
|
|
48
|
+
|
|
49
|
+
<VMenu
|
|
50
|
+
submenu
|
|
51
|
+
activator="parent"
|
|
52
|
+
:open-on-hover="false"
|
|
53
|
+
open-on-click
|
|
54
|
+
:close-on-content-click="false"
|
|
55
|
+
:disabled="!editor.can().chain().focus().insertTable().run()"
|
|
56
|
+
>
|
|
57
|
+
<TableBuilder />
|
|
58
|
+
</VMenu>
|
|
59
|
+
</VListItem>
|
|
60
|
+
|
|
61
|
+
<VListItem link :disabled="!editor.can().chain().focus().deleteTable().run()" @click="editor.chain().focus().deleteTable().run()">
|
|
62
|
+
<VTooltip activator="parent">
|
|
63
|
+
{{ t('media.tables.deleteTable') }}
|
|
64
|
+
</VTooltip>
|
|
65
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
66
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableMinus}`" />
|
|
67
|
+
</VListItemTitle>
|
|
68
|
+
</VListItem>
|
|
69
|
+
|
|
70
|
+
<VListItem link :disabled="rowActionsDisabled()">
|
|
71
|
+
<VTooltip activator="parent">
|
|
72
|
+
{{ t('media.tables.row') }}
|
|
73
|
+
</VTooltip>
|
|
74
|
+
|
|
75
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
76
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableRow}`" />
|
|
77
|
+
</VListItemTitle>
|
|
78
|
+
|
|
79
|
+
<RowActions />
|
|
80
|
+
</VListItem>
|
|
81
|
+
|
|
82
|
+
<VListItem link :disabled="columnActionsDisabled()">
|
|
83
|
+
<VTooltip activator="parent">
|
|
84
|
+
{{ t('media.tables.col') }}
|
|
85
|
+
</VTooltip>
|
|
86
|
+
|
|
87
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
88
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableColumn}`" />
|
|
89
|
+
</VListItemTitle>
|
|
90
|
+
|
|
91
|
+
<ColumnActions />
|
|
92
|
+
</VListItem>
|
|
93
|
+
|
|
94
|
+
<VListItem link :disabled="!editor.can().chain().focus().mergeCells().run()" @click="editor.chain().focus().mergeCells().run()">
|
|
95
|
+
<VTooltip activator="parent">
|
|
96
|
+
{{ t('media.tables.mergeCells') }}
|
|
97
|
+
</VTooltip>
|
|
98
|
+
|
|
99
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
100
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableMergeCells}`" />
|
|
101
|
+
</VListItemTitle>
|
|
102
|
+
</VListItem>
|
|
103
|
+
|
|
104
|
+
<VListItem link :disabled="!editor.can().chain().focus().splitCell().run()" @click="editor.chain().focus().splitCell().run()">
|
|
105
|
+
<VTooltip activator="parent">
|
|
106
|
+
{{ t('media.tables.splitCell') }}
|
|
107
|
+
</VTooltip>
|
|
108
|
+
|
|
109
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
110
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableSplitCell}`" />
|
|
111
|
+
</VListItemTitle>
|
|
112
|
+
</VListItem>
|
|
113
|
+
</VList>
|
|
114
|
+
</VMenu>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<style lang="scss" scoped>
|
|
118
|
+
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
const columnCanAddBefore = () => {
|
|
13
|
+
return editor.value.can().chain().focus().addColumnBefore().run()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const columnCanAddAfter = () => {
|
|
17
|
+
return editor.value.can().chain().focus().addColumnAfter().run()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const columnCanDelete = () => {
|
|
21
|
+
return editor.value.can().chain().focus().deleteColumn().run()
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<VMenu submenu activator="parent" open-on-hover open-on-click>
|
|
27
|
+
<VList>
|
|
28
|
+
<VListItem link :disabled="!columnCanAddBefore()" @click="editor.chain().focus().addColumnBefore().run()">
|
|
29
|
+
<VTooltip activator="parent">
|
|
30
|
+
{{ t('media.tables.insertColBefore') }}
|
|
31
|
+
</VTooltip>
|
|
32
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableColumnPlusBefore}`" />
|
|
33
|
+
</VListItem>
|
|
34
|
+
<VListItem link :disabled="!columnCanAddAfter()" @click="editor.chain().focus().addColumnAfter().run()">
|
|
35
|
+
<VTooltip activator="parent">
|
|
36
|
+
{{ t('media.tables.insertColAfter') }}
|
|
37
|
+
</VTooltip>
|
|
38
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableColumnPlusAfter}`" />
|
|
39
|
+
</VListItem>
|
|
40
|
+
<VListItem link :disabled="!columnCanDelete()" @click="editor.chain().focus().deleteColumn().run()">
|
|
41
|
+
<VTooltip activator="parent">
|
|
42
|
+
{{ t('media.tables.deleteCol') }}
|
|
43
|
+
</VTooltip>
|
|
44
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableColumnRemove}`" />
|
|
45
|
+
</VListItem>
|
|
46
|
+
</VList>
|
|
47
|
+
</VMenu>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style lang="scss" scoped>
|
|
51
|
+
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
const rowCanAddBefore = () => {
|
|
13
|
+
return editor.value.can().chain().focus().addRowBefore().run()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const rowCanAddAfter = () => {
|
|
17
|
+
return editor.value.can().chain().focus().addRowAfter().run()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const rowCanDelete = () => {
|
|
21
|
+
return editor.value.can().chain().focus().deleteRow().run()
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<VMenu submenu activator="parent" open-on-hover open-on-click>
|
|
27
|
+
<VList>
|
|
28
|
+
<VListItem link :disabled="!rowCanAddBefore()" @click="editor.chain().focus().addRowBefore().run()">
|
|
29
|
+
<VTooltip activator="parent">
|
|
30
|
+
{{ t('media.tables.insertRowBefore') }}
|
|
31
|
+
</VTooltip>
|
|
32
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableRowPlusBefore}`" />
|
|
33
|
+
</VListItem>
|
|
34
|
+
<VListItem link :disabled="!rowCanAddAfter()" @click="editor.chain().focus().addRowAfter().run()">
|
|
35
|
+
<VTooltip activator="parent">
|
|
36
|
+
{{ t('media.tables.insertRowAfter') }}
|
|
37
|
+
</VTooltip>
|
|
38
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableRowPlusAfter}`" />
|
|
39
|
+
</VListItem>
|
|
40
|
+
<VListItem link :disabled="!rowCanDelete()" @click="editor.chain().focus().deleteRow().run()">
|
|
41
|
+
<VTooltip activator="parent">
|
|
42
|
+
{{ t('media.tables.deleteRow') }}
|
|
43
|
+
</VTooltip>
|
|
44
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiTableRowRemove}`" />
|
|
45
|
+
</VListItem>
|
|
46
|
+
</VList>
|
|
47
|
+
</VMenu>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style lang="scss" scoped>
|
|
51
|
+
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
3
|
+
import { Editor } from "@tiptap/vue-3";
|
|
4
|
+
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
5
|
+
import { inject, Ref } from "vue";
|
|
6
|
+
|
|
7
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
8
|
+
|
|
9
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
10
|
+
|
|
11
|
+
const icon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 6H2v14a2 2 0 0 0 2 2h14v-2H4zm16-4H8a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2m-8 12.5v-9l6 4.5z"/></svg>'
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VBtn
|
|
16
|
+
:color="editor.isActive('video') ? 'primary' : ''"
|
|
17
|
+
@click="editor.commands.showTiptapifyVideo()"
|
|
18
|
+
size="32"
|
|
19
|
+
>
|
|
20
|
+
<VTooltip activator="parent">
|
|
21
|
+
{{ t('media.video') }}
|
|
22
|
+
</VTooltip>
|
|
23
|
+
<BtnIcon :icon="icon" />
|
|
24
|
+
</VBtn>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VBtn @click="editor.chain().focus().setHardBreak().run()" size="32">
|
|
16
|
+
<VTooltip activator="parent">
|
|
17
|
+
{{ t('format.break') }}
|
|
18
|
+
</VTooltip>
|
|
19
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiFormatPageBreak}`" />
|
|
20
|
+
</VBtn>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VBtn
|
|
16
|
+
:disabled="!editor.can().chain().focus().unsetAllMarks().run()"
|
|
17
|
+
@click="editor.chain().focus().unsetAllMarks().clearNodes().run()"
|
|
18
|
+
size="32"
|
|
19
|
+
>
|
|
20
|
+
<VTooltip activator="parent">
|
|
21
|
+
{{ t('format.formatClear') }}
|
|
22
|
+
</VTooltip>
|
|
23
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiFormatClear}`" />
|
|
24
|
+
</VBtn>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
3
|
+
import { Editor } from "@tiptap/vue-3";
|
|
4
|
+
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
5
|
+
import { inject, Ref } from "vue";
|
|
6
|
+
|
|
7
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
8
|
+
|
|
9
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
10
|
+
|
|
11
|
+
const icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path fill="currentColor" d="M256 64L512 64C529.7 64 544 78.3 544 96C544 113.7 529.7 128 512 128L480 128L480 544C480 561.7 465.7 576 448 576C430.3 576 416 561.7 416 544L416 128L368 128L368 544C368 561.7 353.7 576 336 576C318.3 576 304 561.7 304 544L304 384L256 384C167.6 384 96 312.4 96 224C96 135.6 167.6 64 256 64z"/></svg>'
|
|
12
|
+
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<VBtn
|
|
17
|
+
:color="editor.storage.invisibleCharacters.visibility() ? 'primary' : ''"
|
|
18
|
+
@click="editor.commands.toggleInvisibleCharacters()"
|
|
19
|
+
size="32"
|
|
20
|
+
>
|
|
21
|
+
<VTooltip activator="parent">
|
|
22
|
+
{{ t('misc.toggleInvisibleCharacters') }}
|
|
23
|
+
</VTooltip>
|
|
24
|
+
<BtnIcon :icon="icon" />
|
|
25
|
+
</VBtn>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style lang="scss" scoped>
|
|
29
|
+
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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";
|
|
7
|
+
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
10
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VBtn @click="editor.chain().focus().setHorizontalRule().run()" size="32">
|
|
16
|
+
<VTooltip activator="parent">
|
|
17
|
+
{{ t('format.line') }}
|
|
18
|
+
</VTooltip>
|
|
19
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiMinus}`" />
|
|
20
|
+
</VBtn>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
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 TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
7
|
+
import { inject, ref, Ref } from "vue";
|
|
8
|
+
|
|
9
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
10
|
+
|
|
11
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
12
|
+
|
|
13
|
+
const dialog = ref(null)
|
|
14
|
+
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<VBtn @click="dialog.open()" size="32">
|
|
19
|
+
<VTooltip activator="parent">
|
|
20
|
+
{{ t('misc.preview') }}
|
|
21
|
+
</VTooltip>
|
|
22
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiFileEyeOutline}`" />
|
|
23
|
+
</VBtn>
|
|
24
|
+
|
|
25
|
+
<TiptapifyDialog ref="dialog" module="preview" fullscreen>
|
|
26
|
+
<template #content>
|
|
27
|
+
<VCardItem>
|
|
28
|
+
<div class="tiptap" v-html="editor.getHTML()"></div>
|
|
29
|
+
</VCardItem>
|
|
30
|
+
</template>
|
|
31
|
+
</TiptapifyDialog>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
|
|
3
|
+
import * as mdi from '@mdi/js'
|
|
4
|
+
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
5
|
+
import ShowSourceDialog from "@tiptapify/extensions/components/misc/source/ShowSourceDialog.vue";
|
|
6
|
+
import { inject, ref, Ref } from "vue";
|
|
7
|
+
|
|
8
|
+
const { t } = inject('tiptapifyI18n') as any
|
|
9
|
+
|
|
10
|
+
const dialog = ref(null)
|
|
11
|
+
|
|
12
|
+
function showDialog() {
|
|
13
|
+
dialog.value.showDialog()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<VBtn @click="showDialog()" size="32">
|
|
20
|
+
<VTooltip activator="parent">
|
|
21
|
+
{{ t('misc.source') }}
|
|
22
|
+
</VTooltip>
|
|
23
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiCodeTags}`" />
|
|
24
|
+
</VBtn>
|
|
25
|
+
|
|
26
|
+
<ShowSourceDialog ref="dialog" />
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
|
|
31
|
+
</style>
|