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,67 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { defineProps, PropType } from 'vue'
|
|
3
|
-
import * as mdi from '@mdi/js'
|
|
4
|
-
|
|
5
|
-
import { ToolbarItem } from "@tiptapify/components/Toolbar/items";
|
|
6
|
-
|
|
7
|
-
defineProps({
|
|
8
|
-
variant: { type: String, default () { return 'flat' }},
|
|
9
|
-
nested: { type: Boolean, default () { return false }},
|
|
10
|
-
toolbarItem: { type: Object as PropType<ToolbarItem>, default() { return {} }}
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<VMenu v-model="toolbarItem.modelValue" v-bind="toolbarItem.props">
|
|
17
|
-
<template v-if="!nested" #activator="{ props: menuProps }">
|
|
18
|
-
<VBtn v-bind="{ ...menuProps, ...toolbarItem.props }" size="32">
|
|
19
|
-
<VTooltip :text="toolbarItem.tooltip" location="top" activator="parent" />
|
|
20
|
-
|
|
21
|
-
<VIcon :icon="toolbarItem.icon || `mdiSvg:${mdi.mdiImageBrokenVariant}`" size="small" />
|
|
22
|
-
</VBtn>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<VList v-model="toolbarItem.modelValue" max-height="430px">
|
|
26
|
-
<VListItem
|
|
27
|
-
v-for="(item, menuItemKey) in toolbarItem.children"
|
|
28
|
-
:key="menuItemKey"
|
|
29
|
-
:value="item.name"
|
|
30
|
-
density="compact"
|
|
31
|
-
class="pa-0"
|
|
32
|
-
>
|
|
33
|
-
<VBtn
|
|
34
|
-
variant="text"
|
|
35
|
-
block
|
|
36
|
-
class="justify-start"
|
|
37
|
-
rounded="0"
|
|
38
|
-
v-bind="item.props ?? {}"
|
|
39
|
-
v-on="item?.attrs ?? {}"
|
|
40
|
-
>
|
|
41
|
-
<VTooltip v-if="item.tooltip" :text="item.tooltip" location="top" activator="parent" />
|
|
42
|
-
|
|
43
|
-
<VIcon :icon="item.icon || `mdiSvg:${mdi.mdiImageBrokenVariant}`" size="small" />
|
|
44
|
-
|
|
45
|
-
<VMenu
|
|
46
|
-
v-if="item.component"
|
|
47
|
-
v-bind="item.props"
|
|
48
|
-
>
|
|
49
|
-
<VList>
|
|
50
|
-
<VListItem density="compact">
|
|
51
|
-
<component :is="item.component" @close="toolbarItem.modelValue = false" />
|
|
52
|
-
</VListItem>
|
|
53
|
-
</VList>
|
|
54
|
-
</VMenu>
|
|
55
|
-
|
|
56
|
-
<template v-if="item.children?.length">
|
|
57
|
-
<GroupDropdown :toolbar-item="item" variant="outline" :nested="true" />
|
|
58
|
-
</template>
|
|
59
|
-
</VBtn>
|
|
60
|
-
</VListItem>
|
|
61
|
-
</VList>
|
|
62
|
-
</VMenu>
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<style lang="scss" scoped>
|
|
66
|
-
|
|
67
|
-
</style>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useImage } from "@tiptapify/composables/Toolbar/Media/useImage";
|
|
2
|
-
import { useLink } from "@tiptapify/composables/Toolbar/Media/useLink";
|
|
3
|
-
import { useVideo } from "@tiptapify/composables/Toolbar/Media/useVideo";
|
|
4
|
-
import { usePreview } from "@tiptapify/composables/Toolbar/Misc/usePreview";
|
|
5
|
-
import { useSource } from "@tiptapify/composables/Toolbar/Misc/useSource";
|
|
6
|
-
import ImageDialog from "@tiptapify/extensions/components/ImageDialog.vue";
|
|
7
|
-
import LinkDialog from "@tiptapify/extensions/components/LinkDialog.vue";
|
|
8
|
-
import PreviewDialog from "@tiptapify/extensions/components/PreviewDialog.vue";
|
|
9
|
-
import ShowSourceDialog from "@tiptapify/extensions/components/ShowSourceDialog.vue";
|
|
10
|
-
import VideoDialog from "@tiptapify/extensions/components/VideoDialog.vue";
|
|
11
|
-
import { extensionComponents } from "@tiptapify/types/extensionComponents";
|
|
12
|
-
import { ToolbarSections } from "@tiptapify/types/toolbarSections";
|
|
13
|
-
import { computed, markRaw } from "vue";
|
|
14
|
-
|
|
15
|
-
export function getDefaultComponents(variantField: string): extensionComponents {
|
|
16
|
-
return {
|
|
17
|
-
image: {
|
|
18
|
-
component: markRaw(ImageDialog),
|
|
19
|
-
componentProps: {
|
|
20
|
-
variantField: computed(() => variantField).value,
|
|
21
|
-
},
|
|
22
|
-
section: ToolbarSections.media,
|
|
23
|
-
name: useImage().name,
|
|
24
|
-
tooltip: useImage().tooltip,
|
|
25
|
-
icon: useImage().icon,
|
|
26
|
-
},
|
|
27
|
-
link: {
|
|
28
|
-
component: markRaw(LinkDialog),
|
|
29
|
-
componentProps: {
|
|
30
|
-
variantField: computed(() => variantField).value,
|
|
31
|
-
},
|
|
32
|
-
section: ToolbarSections.media,
|
|
33
|
-
name: useLink().name,
|
|
34
|
-
tooltip: useLink().tooltip,
|
|
35
|
-
icon: useLink().icon,
|
|
36
|
-
},
|
|
37
|
-
preview: {
|
|
38
|
-
component: markRaw(PreviewDialog),
|
|
39
|
-
section: ToolbarSections.misc,
|
|
40
|
-
name: usePreview().name,
|
|
41
|
-
tooltip: usePreview().tooltip,
|
|
42
|
-
icon: usePreview().icon,
|
|
43
|
-
},
|
|
44
|
-
showSource: {
|
|
45
|
-
component: markRaw(ShowSourceDialog),
|
|
46
|
-
componentProps: {
|
|
47
|
-
variantField: computed(() => variantField).value,
|
|
48
|
-
},
|
|
49
|
-
section: ToolbarSections.misc,
|
|
50
|
-
name: useSource().name,
|
|
51
|
-
tooltip: useSource().tooltip,
|
|
52
|
-
icon: useSource().icon,
|
|
53
|
-
},
|
|
54
|
-
video: {
|
|
55
|
-
component: markRaw(VideoDialog),
|
|
56
|
-
componentProps: {
|
|
57
|
-
variantField: computed(() => variantField).value,
|
|
58
|
-
},
|
|
59
|
-
section: ToolbarSections.media,
|
|
60
|
-
name: useVideo().name,
|
|
61
|
-
tooltip: useVideo().tooltip,
|
|
62
|
-
icon: useVideo().icon,
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useRedo() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'redo',
|
|
12
|
-
tooltip: computed(() => t('action.redo')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiRedo}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().redo().run()),
|
|
17
|
-
},
|
|
18
|
-
attrs: {
|
|
19
|
-
click: () => editor.value.chain().focus().redo().run()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useUndo() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'undo',
|
|
12
|
-
tooltip: computed(() => t('action.undo')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiUndo}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().undo().run()),
|
|
17
|
-
},
|
|
18
|
-
attrs: {
|
|
19
|
-
click: () => editor.value.chain().focus().undo().run()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useAlignmentCenter() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('alignments.center')),
|
|
12
|
-
tooltip: computed(() => t('alignments.center')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatAlignCenter}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
active: false,
|
|
17
|
-
color: computed(() => editor.value.isActive({ textAlign: 'center' }) ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleTextAlign('center').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useAlignmentJustify() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('alignments.justify')),
|
|
12
|
-
tooltip: computed(() => t('alignments.justify')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatAlignJustify}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
active: false,
|
|
17
|
-
color: computed(() => editor.value.isActive({ textAlign: 'justify' }) ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleTextAlign('justify').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useAlignmentLeft() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('alignments.left')),
|
|
12
|
-
tooltip: computed(() => t('alignments.left')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatAlignLeft}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
active: false,
|
|
17
|
-
color: computed(() => editor.value.isActive({ textAlign: 'left' }) ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleTextAlign('left').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useAlignmentRight() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('alignments.right')),
|
|
12
|
-
tooltip: computed(() => t('alignments.right')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatAlignRight}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
active: false,
|
|
17
|
-
color: computed(() => editor.value.isActive({ textAlign: 'right' }) ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleTextAlign('right').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useBold() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'bold',
|
|
12
|
-
tooltip: computed(() => t('format.bold')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatBold}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleBold().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('bold') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleBold().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useItalic() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'italic',
|
|
12
|
-
tooltip: computed(() => t('format.italic')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatItalic}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleItalic().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('italic') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleItalic().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useStrike() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'strike',
|
|
12
|
-
tooltip: computed(() => t('format.strike')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatStrikethroughVariant}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleStrike().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('strike') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleStrike().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useUnderline() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'underline',
|
|
12
|
-
tooltip: computed(() => t('format.underline')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatUnderline}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleUnderline().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('underline') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleUnderline().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useBlockquote() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'blockquote',
|
|
12
|
-
tooltip: computed(() => t('format.blockquote')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiCommentQuote}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleBlockquote().run() || editor.value.isActive('codeBlock') || editor.value.isActive('code')),
|
|
17
|
-
color: computed(() => editor.value.isActive('blockquote') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleBlockquote().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useCode() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'code',
|
|
12
|
-
tooltip: computed(() => t('format.code')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiXml}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleCode().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('code') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleCode().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useCodeBlock() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'codeblock',
|
|
12
|
-
tooltip: computed(() => t('format.codeblock')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiCodeBlockTags}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleCodeBlock().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('codeBlock') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleCodeBlock().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useSub() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'sub',
|
|
12
|
-
tooltip: computed(() => t('format.sub')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatSubscript}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleSubscript().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('subscript') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleSubscript().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useSup() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'sup',
|
|
12
|
-
tooltip: computed(() => t('format.sup')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatSuperscript}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().chain().focus().toggleSuperscript().run()),
|
|
17
|
-
color: computed(() => editor.value.isActive('superscript') ? 'primary' : ''),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().toggleSuperscript().run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useBullet() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('lists.bullet')),
|
|
12
|
-
tooltip: computed(() => t('lists.bullet')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatListBulleted}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
color: computed(() => editor.value.isActive('bulletList') ? 'primary' : ''),
|
|
17
|
-
},
|
|
18
|
-
attrs: {
|
|
19
|
-
click: () => editor.value.chain().focus().toggleBulletList().run()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useIndent() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('lists.indent')),
|
|
12
|
-
tooltip: computed(() => t('lists.indent')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatIndentIncrease}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().sinkListItem('listItem')),
|
|
17
|
-
active: false,
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().sinkListItem('listItem').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useNumbered() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('lists.numbered')),
|
|
12
|
-
tooltip: computed(() => t('lists.numbered')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatListNumbered}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
color: computed(() => editor.value.isActive('orderedList') ? 'primary' : ''),
|
|
17
|
-
},
|
|
18
|
-
attrs: {
|
|
19
|
-
click: () => editor.value.chain().focus().toggleOrderedList().run()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useOutdent() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('lists.outdent')),
|
|
12
|
-
tooltip: computed(() => t('lists.outdent')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatIndentDecrease}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
disabled: computed(() => !editor.value.can().liftListItem('listItem')),
|
|
17
|
-
active: false,
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.chain().focus().liftListItem('listItem').run()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useTask() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('lists.task')),
|
|
12
|
-
tooltip: computed(() => t('lists.task')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiFormatListChecks}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
color: computed(() => editor.value.isActive('taskList') ? 'primary' : ''),
|
|
17
|
-
},
|
|
18
|
-
attrs: {
|
|
19
|
-
click: () => editor.value.chain().focus().toggleTaskList().run()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import Emoji from "@tiptapify/extensions/components/Emoji.vue";
|
|
3
|
-
import { computed, inject, markRaw } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useEmoji() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
name: computed(() => t('media.emoji.title')),
|
|
10
|
-
tooltip: computed(() => t('media.emoji.title')),
|
|
11
|
-
icon: `mdiSvg:${mdi.mdiEmoticon}`,
|
|
12
|
-
enabled: true,
|
|
13
|
-
component: markRaw(Emoji),
|
|
14
|
-
props: {
|
|
15
|
-
persistent: false,
|
|
16
|
-
closeOnContentClick: false,
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { computed, inject, Ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export function useImage() {
|
|
6
|
-
const { t } = inject('tiptapifyI18n') as any
|
|
7
|
-
|
|
8
|
-
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: computed(() => t('media.image')),
|
|
12
|
-
tooltip: computed(() => t('media.image')),
|
|
13
|
-
icon: `mdiSvg:${mdi.mdiImage}`,
|
|
14
|
-
enabled: true,
|
|
15
|
-
props: {
|
|
16
|
-
color: computed(() => editor.value.isActive('image') ? 'primary' : ''),
|
|
17
|
-
disabled: computed(() => editor.value.isActive('code') || editor.value.isActive('codeBlock')),
|
|
18
|
-
},
|
|
19
|
-
attrs: {
|
|
20
|
-
click: () => editor.value.commands.showTiptapifyImage()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|