tiptapify 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +2 -2
  2. package/dist/tiptapify.css +1 -1
  3. package/dist/tiptapify.mjs +25493 -25148
  4. package/dist/tiptapify.umd.js +38 -38
  5. package/index.d.ts +2 -2
  6. package/package.json +1 -1
  7. package/src/components/Tiptapify.vue +3 -3
  8. package/src/components/Toolbar/Index.vue +9 -30
  9. package/src/components/Toolbar/Items.vue +14 -29
  10. package/src/components/Toolbar/actions.ts +18 -0
  11. package/src/components/Toolbar/alignment.ts +28 -0
  12. package/src/components/Toolbar/format.ts +28 -0
  13. package/src/components/Toolbar/formatExtra.ts +33 -0
  14. package/src/components/Toolbar/items.ts +19 -114
  15. package/src/components/Toolbar/list.ts +33 -0
  16. package/src/components/Toolbar/media.ts +33 -0
  17. package/src/components/Toolbar/misc.ts +38 -0
  18. package/src/components/Toolbar/style.ts +38 -0
  19. package/src/components/editorExtensions.ts +8 -6
  20. package/src/components/index.ts +2 -2
  21. package/src/extensions/components/actions/redo/Button.vue +29 -0
  22. package/src/extensions/components/actions/undo/Button.vue +29 -0
  23. package/src/extensions/components/alignment/center/Button.vue +29 -0
  24. package/src/extensions/components/alignment/justify/Button.vue +29 -0
  25. package/src/extensions/components/alignment/left/Button.vue +29 -0
  26. package/src/extensions/components/alignment/right/Button.vue +29 -0
  27. package/src/extensions/components/format/bold/Button.vue +30 -0
  28. package/src/extensions/components/format/italic/Button.vue +30 -0
  29. package/src/extensions/components/format/strike/Button.vue +30 -0
  30. package/src/extensions/components/format/underline/Button.vue +30 -0
  31. package/src/extensions/components/formatExtra/code/Button.vue +30 -0
  32. package/src/extensions/components/formatExtra/codeBlock/Button.vue +30 -0
  33. package/src/extensions/components/formatExtra/quote/Button.vue +30 -0
  34. package/src/extensions/components/formatExtra/sub/Button.vue +30 -0
  35. package/src/extensions/components/formatExtra/sup/Button.vue +30 -0
  36. package/src/extensions/components/list/bullet/Button.vue +30 -0
  37. package/src/extensions/components/list/indent/Button.vue +30 -0
  38. package/src/extensions/components/list/numbered/Button.vue +30 -0
  39. package/src/extensions/components/list/outdent/Button.vue +30 -0
  40. package/src/extensions/components/list/task/Button.vue +30 -0
  41. package/src/extensions/components/{Emoji.vue → media/emoji/Button.vue} +65 -62
  42. package/src/extensions/components/media/image/Button.vue +32 -0
  43. package/src/extensions/components/media/link/Button.vue +34 -0
  44. package/src/extensions/components/media/table/Button.vue +119 -0
  45. package/src/extensions/components/media/table/ColumnActions.vue +52 -0
  46. package/src/extensions/components/media/table/RowActions.vue +52 -0
  47. package/src/extensions/components/media/video/Button.vue +32 -0
  48. package/src/extensions/components/media/video/index.ts +32 -0
  49. package/src/extensions/components/misc/break/Button.vue +25 -0
  50. package/src/extensions/components/misc/formatClear/Button.vue +29 -0
  51. package/src/extensions/components/misc/invisibleChar/Button.vue +30 -0
  52. package/src/extensions/components/misc/line/Button.vue +25 -0
  53. package/src/extensions/components/misc/preview/Button.vue +36 -0
  54. package/src/extensions/components/misc/source/Button.vue +31 -0
  55. package/src/extensions/components/{ShowSourceDialog.vue → misc/source/ShowSourceDialog.vue} +5 -14
  56. package/src/extensions/components/{StyleColor.vue → style/StyleColor.vue} +5 -8
  57. package/src/extensions/components/style/color/Button.vue +57 -0
  58. package/src/extensions/components/style/fontFamily/Button.vue +60 -0
  59. package/src/extensions/components/style/fontFamily/FontFamily.vue +76 -0
  60. package/src/extensions/components/style/fontSize/Button.vue +64 -0
  61. package/src/extensions/components/{FontSize.vue → style/fontSize/FontSize.vue} +0 -5
  62. package/src/extensions/components/style/heading/Button.vue +61 -0
  63. package/src/extensions/components/style/highlight/Button.vue +57 -0
  64. package/src/extensions/components/style/lineHeight/Button.vue +60 -0
  65. package/src/extensions/components/{LineHeight.vue → style/lineHeight/LineHeight.vue} +0 -4
  66. package/src/types/toolbarSections.ts +16 -2
  67. package/src/components/Toolbar/Group.vue +0 -42
  68. package/src/components/Toolbar/GroupBtn.vue +0 -32
  69. package/src/components/Toolbar/GroupDropdown.vue +0 -67
  70. package/src/components/Toolbar/defaultExtensionComponents.ts +0 -65
  71. package/src/composables/Toolbar/Actions/useRedo.ts +0 -22
  72. package/src/composables/Toolbar/Actions/useUndo.ts +0 -22
  73. package/src/composables/Toolbar/Alignment/useAlignmentCenter.ts +0 -23
  74. package/src/composables/Toolbar/Alignment/useAlignmentJustify.ts +0 -23
  75. package/src/composables/Toolbar/Alignment/useAlignmentLeft.ts +0 -23
  76. package/src/composables/Toolbar/Alignment/useAlignmentRight.ts +0 -23
  77. package/src/composables/Toolbar/Format/useBold.ts +0 -23
  78. package/src/composables/Toolbar/Format/useItalic.ts +0 -23
  79. package/src/composables/Toolbar/Format/useStrike.ts +0 -23
  80. package/src/composables/Toolbar/Format/useUnderline.ts +0 -23
  81. package/src/composables/Toolbar/FormatExtra/useBlockquote.ts +0 -23
  82. package/src/composables/Toolbar/FormatExtra/useCode.ts +0 -23
  83. package/src/composables/Toolbar/FormatExtra/useCodeBlock.ts +0 -23
  84. package/src/composables/Toolbar/FormatExtra/useSub.ts +0 -23
  85. package/src/composables/Toolbar/FormatExtra/useSup.ts +0 -23
  86. package/src/composables/Toolbar/List/useBullet.ts +0 -22
  87. package/src/composables/Toolbar/List/useIndent.ts +0 -23
  88. package/src/composables/Toolbar/List/useNumbered.ts +0 -22
  89. package/src/composables/Toolbar/List/useOutdent.ts +0 -23
  90. package/src/composables/Toolbar/List/useTask.ts +0 -22
  91. package/src/composables/Toolbar/Media/useEmoji.ts +0 -19
  92. package/src/composables/Toolbar/Media/useImage.ts +0 -23
  93. package/src/composables/Toolbar/Media/useLink.ts +0 -23
  94. package/src/composables/Toolbar/Media/useTable.ts +0 -187
  95. package/src/composables/Toolbar/Media/useVideo.ts +0 -22
  96. package/src/composables/Toolbar/Misc/useBreak.ts +0 -20
  97. package/src/composables/Toolbar/Misc/useFormatClear.ts +0 -22
  98. package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +0 -22
  99. package/src/composables/Toolbar/Misc/useLine.ts +0 -20
  100. package/src/composables/Toolbar/Misc/usePreview.ts +0 -19
  101. package/src/composables/Toolbar/Misc/useSource.ts +0 -20
  102. package/src/composables/Toolbar/Style/useColor.ts +0 -35
  103. package/src/composables/Toolbar/Style/useFontFamily.ts +0 -48
  104. package/src/composables/Toolbar/Style/useFontSize.ts +0 -49
  105. package/src/composables/Toolbar/Style/useHeading.ts +0 -63
  106. package/src/composables/Toolbar/Style/useHighlight.ts +0 -35
  107. package/src/composables/Toolbar/Style/useLineHeight.ts +0 -48
  108. package/src/composables/Toolbar/useActionsItems.ts +0 -9
  109. package/src/composables/Toolbar/useAlignmentItems.ts +0 -13
  110. package/src/composables/Toolbar/useFormatExtraItems.ts +0 -15
  111. package/src/composables/Toolbar/useFormatItems.ts +0 -13
  112. package/src/composables/Toolbar/useListItems.ts +0 -15
  113. package/src/composables/Toolbar/useMediaItems.ts +0 -15
  114. package/src/composables/Toolbar/useMiscItems.ts +0 -17
  115. package/src/composables/Toolbar/useStyleItems.ts +0 -17
  116. package/src/extensions/components/PreviewDialog.vue +0 -43
  117. package/src/types/extensionComponents.ts +0 -22
  118. package/src/types/toolbarItems.ts +0 -41
  119. /package/src/extensions/components/{ImageDialog.vue → media/image/ImageDialog.vue} +0 -0
  120. /package/src/extensions/{image.ts → components/media/image/index.ts} +0 -0
  121. /package/src/extensions/components/{LinkDialog.vue → media/link/LinkDialog.vue} +0 -0
  122. /package/src/extensions/{link.ts → components/media/link/index.ts} +0 -0
  123. /package/src/extensions/components/{TableBuilder.vue → media/table/TableBuilder.vue} +0 -0
  124. /package/src/extensions/components/{VideoDialog.vue → media/video/VideoDialog.vue} +0 -0
  125. /package/src/extensions/{preview.ts → components/misc/preview/index.ts} +0 -0
  126. /package/src/extensions/{view-source.ts → components/misc/source/index.ts} +0 -0
  127. /package/src/extensions/components/{FontFamily.vue → style/lineHeight/FontFamily.vue} +0 -0
@@ -1,42 +0,0 @@
1
- <script setup lang="ts">
2
- import GroupBtn from "@tiptapify/components/Toolbar/GroupBtn.vue";
3
- import GroupDropdown from "@tiptapify/components/Toolbar/GroupDropdown.vue";
4
- import { defineProps, PropType } from 'vue'
5
-
6
- import { ToolbarItemSection } from "@tiptapify/types/toolbarItems";
7
-
8
- defineProps({
9
- variant: { type: String, default () { return 'flat' }},
10
- section: { type: String, default() { return '' }},
11
- toolbarSection: { type: Object as PropType<ToolbarItemSection>, default() { return {} }}
12
- })
13
-
14
- </script>
15
-
16
- <template>
17
- <VBtnGroup :variant="variant" elevation="4">
18
- <template v-for="(toolbarItem, toolbarItemKey) in toolbarSection.items" :key="toolbarItemKey">
19
- <template v-if="toolbarItem.children">
20
- <GroupDropdown :toolbar-item="toolbarItem" :variant="variant" />
21
- </template>
22
-
23
- <VMenu v-else-if="toolbarItem?.component" v-model="toolbarItem.modelValue" :close-on-content-click="false" v-bind="toolbarItem.props">
24
- <template #activator="{ props: menuProps }">
25
- <GroupBtn v-bind="menuProps" :toolbar-item="toolbarItem" :variant="variant" />
26
- </template>
27
-
28
- <component
29
- :is="toolbarItem.component"
30
- v-bind="toolbarItem?.componentProps ?? {}"
31
- @close="toolbarItem.modelValue = false"
32
- />
33
- </VMenu>
34
-
35
- <GroupBtn v-else :toolbar-item="toolbarItem" :variant="variant" />
36
- </template>
37
- </VBtnGroup>
38
- </template>
39
-
40
- <style lang="scss" scoped>
41
-
42
- </style>
@@ -1,32 +0,0 @@
1
- <script setup lang="ts">
2
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
3
- import { defineProps, PropType } from 'vue'
4
-
5
- import { ToolbarItem } from '@tiptapify/types/toolbarItems'
6
-
7
- defineProps({
8
- variant: { type: String, default () { return 'flat' }},
9
- toolbarItem: { type: Object as PropType<ToolbarItem>, default() { return {} }}
10
- })
11
-
12
- </script>
13
-
14
- <template>
15
- <VBtn v-bind="toolbarItem?.props ?? {}" v-on="toolbarItem?.attrs ?? {}" size="32">
16
- <VTooltip :text="toolbarItem.tooltip" location="top" activator="parent" />
17
-
18
- <BtnIcon :icon="toolbarItem.icon" />
19
-
20
- <VIcon
21
- v-if="toolbarItem.icon2"
22
- v-bind="toolbarItem?.icon2Props ?? {}"
23
- :icon="toolbarItem.icon2"
24
- size="small"
25
- style="position: absolute;"
26
- />
27
- </VBtn>
28
- </template>
29
-
30
- <style lang="scss" scoped>
31
-
32
- </style>
@@ -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
- }