tiptapify 0.0.23 → 0.0.26
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 +40 -3
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +22762 -22314
- package/dist/tiptapify.umd.js +53 -38
- package/index.d.ts +2 -2
- package/package.json +45 -47
- package/src/components/Tiptapify.vue +52 -27
- package/src/components/Toolbar/Index.vue +127 -9
- package/src/components/Toolbar/Items.vue +11 -5
- package/src/components/Toolbar/items.ts +14 -2
- package/src/components/Toolbar/misc.ts +5 -0
- package/src/components/Toolbar/style.ts +1 -1
- package/src/components/UI/BtnIcon.vue +3 -3
- package/src/components/UI/TiptapifyDialog.vue +5 -1
- package/src/components/editorExtensions.ts +4 -5
- package/src/components/index.ts +3 -4
- package/src/constants/defaults.ts +4 -0
- package/src/extensions/components/actions/redo/Button.vue +7 -0
- package/src/extensions/components/actions/undo/Button.vue +7 -0
- package/src/extensions/components/alignment/center/Button.vue +7 -0
- package/src/extensions/components/alignment/justify/Button.vue +7 -0
- package/src/extensions/components/alignment/left/Button.vue +7 -0
- package/src/extensions/components/alignment/right/Button.vue +7 -0
- package/src/extensions/components/format/bold/Button.vue +7 -0
- package/src/extensions/components/format/italic/Button.vue +7 -0
- package/src/extensions/components/format/strike/Button.vue +7 -0
- package/src/extensions/components/format/underline/Button.vue +7 -0
- package/src/extensions/components/formatExtra/code/Button.vue +7 -0
- package/src/extensions/components/formatExtra/codeBlock/Button.vue +7 -0
- package/src/extensions/components/formatExtra/quote/Button.vue +7 -0
- package/src/extensions/components/formatExtra/sub/Button.vue +7 -0
- package/src/extensions/components/formatExtra/sup/Button.vue +7 -0
- package/src/extensions/components/list/bullet/Button.vue +103 -1
- package/src/extensions/components/list/bullet/index.ts +101 -0
- package/src/extensions/components/list/indent/Button.vue +7 -0
- package/src/extensions/components/list/numbered/Button.vue +7 -0
- package/src/extensions/components/list/outdent/Button.vue +7 -0
- package/src/extensions/components/list/task/Button.vue +7 -0
- package/src/extensions/components/media/emoji/Button.vue +8 -2
- package/src/extensions/components/media/image/Button.vue +7 -0
- package/src/extensions/components/media/image/ImageDialog.vue +3 -2
- package/src/extensions/components/media/link/Button.vue +7 -0
- package/src/extensions/components/media/link/LinkDialog.vue +2 -1
- package/src/extensions/components/media/table/Button.vue +7 -0
- package/src/extensions/components/media/video/Button.vue +7 -0
- package/src/extensions/components/media/video/VideoDialog.vue +3 -2
- package/src/extensions/components/misc/break/Button.vue +7 -1
- package/src/extensions/components/misc/formatClear/Button.vue +7 -0
- package/src/extensions/components/misc/fullscreen/Button.vue +61 -0
- package/src/extensions/components/misc/invisibleChar/Button.vue +7 -0
- package/src/extensions/components/misc/line/Button.vue +7 -1
- package/src/extensions/components/misc/preview/Button.vue +7 -1
- package/src/extensions/components/misc/source/Button.vue +8 -2
- package/src/extensions/components/misc/source/ShowSourceDialog.vue +2 -1
- package/src/extensions/components/style/StyleColor.vue +4 -2
- package/src/extensions/components/style/color/Button.vue +4 -1
- package/src/extensions/components/style/fontFamily/Button.vue +7 -0
- package/src/extensions/components/style/fontSize/Button.vue +5 -1
- package/src/extensions/components/style/heading/Button.vue +14 -6
- package/src/extensions/components/style/highlight/Button.vue +4 -1
- package/src/extensions/components/style/lineHeight/Button.vue +7 -0
- package/src/types/{toolbarSections.ts → toolbarTypes.ts} +4 -1
- package/src/extensions/components/misc/preview/index.ts +0 -41
- package/src/extensions/components/misc/source/index.ts +0 -49
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -14,6 +20,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
14
20
|
<template>
|
|
15
21
|
<VBtn
|
|
16
22
|
:disabled="!editor.can().chain().focus().undo().run()"
|
|
23
|
+
:variant="variantBtn"
|
|
17
24
|
@click="editor.chain().focus().undo().run()"
|
|
18
25
|
size="32"
|
|
19
26
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -14,6 +20,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
14
20
|
<template>
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive({ textAlign: 'center' }) ? 'primary' : ''"
|
|
23
|
+
:variant="variantBtn"
|
|
17
24
|
@click="editor.chain().focus().toggleTextAlign('center').run()"
|
|
18
25
|
size="32"
|
|
19
26
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -14,6 +20,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
14
20
|
<template>
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive({ textAlign: 'justify' }) ? 'primary' : ''"
|
|
23
|
+
:variant="variantBtn"
|
|
17
24
|
@click="editor.chain().focus().toggleTextAlign('justify').run()"
|
|
18
25
|
size="32"
|
|
19
26
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -14,6 +20,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
14
20
|
<template>
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive({ textAlign: 'left' }) ? 'primary' : ''"
|
|
23
|
+
:variant="variantBtn"
|
|
17
24
|
@click="editor.chain().focus().toggleTextAlign('left').run()"
|
|
18
25
|
size="32"
|
|
19
26
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -14,6 +20,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
14
20
|
<template>
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive({ textAlign: 'right' }) ? 'primary' : ''"
|
|
23
|
+
:variant="variantBtn"
|
|
17
24
|
@click="editor.chain().focus().toggleTextAlign('right').run()"
|
|
18
25
|
size="32"
|
|
19
26
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('bold') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleBold().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleBold()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('italic') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleItalic().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleItalic()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('strike') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleStrike().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleStrike()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('underline') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleUnderline().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleUnderline()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('code') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleCode().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleCode()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('codeBlock') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleCodeBlock().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleCodeBlock()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('blockquote') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleBlockquote().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleBlockquote()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('sub') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleSubscript().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleSubscript()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('sup') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleSuperscript().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleSuperscript()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -3,18 +3,120 @@
|
|
|
3
3
|
import * as mdi from '@mdi/js'
|
|
4
4
|
import { Editor } from "@tiptap/vue-3";
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
|
-
import { inject, Ref } from "vue";
|
|
6
|
+
import { computed, inject, ref, Ref, watch } from "vue";
|
|
7
|
+
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn },
|
|
12
|
+
withDisc: { type: Boolean, default: true },
|
|
13
|
+
withCircle: { type: Boolean, default: true },
|
|
14
|
+
withSquare: { type: Boolean, default: true }
|
|
15
|
+
})
|
|
7
16
|
|
|
8
17
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
18
|
|
|
10
19
|
const { t } = inject('tiptapifyI18n') as any
|
|
11
20
|
|
|
21
|
+
const disc = computed(() => props.withDisc)
|
|
22
|
+
const circle = computed(() => props.withCircle)
|
|
23
|
+
const square = computed(() => props.withSquare)
|
|
24
|
+
|
|
25
|
+
const iconDisc = '<svg width="48" height="48" focusable="false" viewBox="5 5 32 32"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"></circle><circle cx="11" cy="24" r="3"></circle><circle cx="11" cy="34" r="3"></circle><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"></path></g></svg>'
|
|
26
|
+
const iconCircle = '<svg width="48" height="48" focusable="false" viewBox="5 5 32 32"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"></path><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"></path></g></svg>'
|
|
27
|
+
const iconSquare = '<svg width="48" height="48" focusable="false" viewBox="5 5 32 32"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"></path><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"></path>'
|
|
28
|
+
|
|
29
|
+
const bulletLists = ref({
|
|
30
|
+
disc: {
|
|
31
|
+
name: 'bulletList',
|
|
32
|
+
enabled: disc.value,
|
|
33
|
+
icon: iconDisc
|
|
34
|
+
},
|
|
35
|
+
circle: {
|
|
36
|
+
name: 'bulletListCircle',
|
|
37
|
+
enabled: circle.value,
|
|
38
|
+
icon: iconCircle
|
|
39
|
+
},
|
|
40
|
+
square: {
|
|
41
|
+
name: 'bulletListSquare',
|
|
42
|
+
enabled: square.value,
|
|
43
|
+
icon: iconSquare
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
const menuItems = ref({})
|
|
47
|
+
const isMenu = ref(false)
|
|
48
|
+
|
|
49
|
+
function checkButtonOrMenu() {
|
|
50
|
+
menuItems.value = Object.values(bulletLists.value).filter(item => item.enabled)
|
|
51
|
+
isMenu.value = menuItems.value.length > 1
|
|
52
|
+
}
|
|
53
|
+
checkButtonOrMenu()
|
|
54
|
+
|
|
55
|
+
function toggleList(listType: string) {
|
|
56
|
+
switch(listType) {
|
|
57
|
+
case 'disc': editor.value.commands.toggleBulletList(); break;
|
|
58
|
+
case 'circle': editor.value.commands.toggleBulletListCircle(); break;
|
|
59
|
+
case 'square': editor.value.commands.toggleBulletListSquare(); break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const buttonActive = computed(() => {
|
|
64
|
+
return editor.value.isActive('bulletList') ||
|
|
65
|
+
editor.value.isActive('bulletListCircle') ||
|
|
66
|
+
editor.value.isActive('bulletListSquare')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const buttonDisabled = computed(() => {
|
|
70
|
+
return !editor.value.can().chain().focus().toggleBulletList().run() &&
|
|
71
|
+
!editor.value.can().chain().focus().toggleBulletListCircle().run() &&
|
|
72
|
+
!editor.value.can().chain().focus().toggleBulletListSquare().run()
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
watch(() => bulletLists.value, () => {
|
|
76
|
+
checkButtonOrMenu()
|
|
77
|
+
}, { deep: true, immediate: true })
|
|
12
78
|
</script>
|
|
13
79
|
|
|
14
80
|
<template>
|
|
81
|
+
<VMenu v-if="isMenu">
|
|
82
|
+
<template #activator="{ props: menuProps }">
|
|
83
|
+
<VBtn
|
|
84
|
+
:color="buttonActive ? 'primary' : ''"
|
|
85
|
+
:disabled="buttonDisabled"
|
|
86
|
+
:variant="variantBtn"
|
|
87
|
+
v-bind="menuProps"
|
|
88
|
+
size="32"
|
|
89
|
+
>
|
|
90
|
+
<VTooltip activator="parent">
|
|
91
|
+
{{ t('lists.bullet') }}
|
|
92
|
+
</VTooltip>
|
|
93
|
+
<BtnIcon :icon="`mdiSvg:${mdi.mdiFormatListBulleted}`" />
|
|
94
|
+
</VBtn>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<VList>
|
|
98
|
+
<VListItem
|
|
99
|
+
v-for="(bulletList, key) in menuItems"
|
|
100
|
+
:key="key"
|
|
101
|
+
link
|
|
102
|
+
:active="editor.isActive(bulletList.name)"
|
|
103
|
+
@click="toggleList(key)"
|
|
104
|
+
>
|
|
105
|
+
<VTooltip activator="parent">
|
|
106
|
+
{{ t('lists.bullet') }}
|
|
107
|
+
</VTooltip>
|
|
108
|
+
<VListItemTitle class="d-flex justify-center align-center">
|
|
109
|
+
<BtnIcon :icon="bulletList.icon" />
|
|
110
|
+
</VListItemTitle>
|
|
111
|
+
</VListItem>
|
|
112
|
+
</VList>
|
|
113
|
+
</VMenu>
|
|
114
|
+
|
|
15
115
|
<VBtn
|
|
116
|
+
v-else
|
|
16
117
|
:color="editor.isActive('bulletList') ? 'primary' : ''"
|
|
17
118
|
:disabled="!editor.can().chain().focus().toggleBulletList().run()"
|
|
119
|
+
:variant="variantBtn"
|
|
18
120
|
@click="editor.commands.toggleBulletList()"
|
|
19
121
|
size="32"
|
|
20
122
|
>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BulletList } from "@tiptap/extension-list"
|
|
2
|
+
|
|
3
|
+
export const BulletListCircle = BulletList.extend({
|
|
4
|
+
name: 'bulletListCircle',
|
|
5
|
+
|
|
6
|
+
addAttributes() {
|
|
7
|
+
return {
|
|
8
|
+
class: {
|
|
9
|
+
default: null,
|
|
10
|
+
renderHTML: (attributes: any) => {
|
|
11
|
+
return {
|
|
12
|
+
class: `${attributes.class}`,
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
parseHTML: (element: any) => element.getAttribute('class'),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
addOptions() {
|
|
21
|
+
return {
|
|
22
|
+
itemTypeName: 'listItem',
|
|
23
|
+
HTMLAttributes: {
|
|
24
|
+
class: 'list-style-circle',
|
|
25
|
+
},
|
|
26
|
+
keepMarks: false,
|
|
27
|
+
keepAttributes: false,
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
parseHTML() {
|
|
32
|
+
return [
|
|
33
|
+
{ tag: 'ul', class: 'list-style-circle' }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
addCommands() {
|
|
38
|
+
return {
|
|
39
|
+
toggleBulletListCircle: () =>
|
|
40
|
+
({ commands, chain }) => {
|
|
41
|
+
if (this.options.keepAttributes) {
|
|
42
|
+
return chain()
|
|
43
|
+
.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
44
|
+
.updateAttributes('listItem', this.editor.getAttributes('textStyle'))
|
|
45
|
+
.run()
|
|
46
|
+
}
|
|
47
|
+
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const BulletListSquare = BulletList.extend({
|
|
54
|
+
name: 'bulletListSquare',
|
|
55
|
+
|
|
56
|
+
addAttributes() {
|
|
57
|
+
return {
|
|
58
|
+
class: {
|
|
59
|
+
default: null,
|
|
60
|
+
renderHTML: (attributes: any) => {
|
|
61
|
+
return {
|
|
62
|
+
class: `${attributes.class}`,
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
parseHTML: (element: any) => element.getAttribute('class'),
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
addOptions() {
|
|
71
|
+
return {
|
|
72
|
+
itemTypeName: 'listItem',
|
|
73
|
+
HTMLAttributes: {
|
|
74
|
+
class: 'list-style-square',
|
|
75
|
+
},
|
|
76
|
+
keepMarks: false,
|
|
77
|
+
keepAttributes: false,
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
parseHTML() {
|
|
82
|
+
return [
|
|
83
|
+
{ tag: 'ul', class: 'list-style-square' }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
addCommands() {
|
|
88
|
+
return {
|
|
89
|
+
toggleBulletListSquare: () =>
|
|
90
|
+
({ commands, chain }) => {
|
|
91
|
+
if (this.options.keepAttributes) {
|
|
92
|
+
return chain()
|
|
93
|
+
.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
94
|
+
.updateAttributes('listItem', this.editor.getAttributes('textStyle'))
|
|
95
|
+
.run()
|
|
96
|
+
}
|
|
97
|
+
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
})
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:active="false"
|
|
17
23
|
:disabled="!editor.can().sinkListItem('listItem')"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.chain().focus().sinkListItem('listItem').run()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('orderedList') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleOrderedList().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleOrderedList()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:active="false"
|
|
17
23
|
:disabled="!editor.can().liftListItem('listItem')"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.chain().focus().liftListItem('listItem').run()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -5,6 +5,12 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
6
6
|
import { inject, Ref } from "vue";
|
|
7
7
|
|
|
8
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
9
|
+
|
|
10
|
+
defineProps({
|
|
11
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
|
+
})
|
|
13
|
+
|
|
8
14
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
15
|
|
|
10
16
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<VBtn
|
|
16
22
|
:color="editor.isActive('taskList') ? 'primary' : ''"
|
|
17
23
|
:disabled="!editor.can().chain().focus().toggleTaskList().run()"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.toggleTaskList()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|
|
@@ -6,6 +6,12 @@ import tiptapifyEmojis from "@tiptapify/extensions/emoji"
|
|
|
6
6
|
import { computed, inject, Ref, ref, watch } from 'vue'
|
|
7
7
|
import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
8
8
|
|
|
9
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
10
|
+
|
|
11
|
+
defineProps({
|
|
12
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
13
|
+
})
|
|
14
|
+
|
|
9
15
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
10
16
|
|
|
11
17
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -64,6 +70,7 @@ watch(() => tab.value, () => {
|
|
|
64
70
|
<VBtn
|
|
65
71
|
:id="`tiptapify-emoji-button-${editor.instanceId}`"
|
|
66
72
|
:color="editor.isActive('image') ? 'primary' : ''"
|
|
73
|
+
:variant="variantBtn"
|
|
67
74
|
size="32"
|
|
68
75
|
>
|
|
69
76
|
<VTooltip activator="parent">
|
|
@@ -104,7 +111,7 @@ watch(() => tab.value, () => {
|
|
|
104
111
|
/>
|
|
105
112
|
<div class="tiptapify-emoji-container">
|
|
106
113
|
<VWindow v-model="tab" direction="vertical">
|
|
107
|
-
<VWindowItem v-for="item of emojisRef" :value="item.group">
|
|
114
|
+
<VWindowItem v-for="item of emojisRef" :value="item.group" :transition="false" :reverse-transition="false">
|
|
108
115
|
<div
|
|
109
116
|
v-for="emojiItem in item.emojis"
|
|
110
117
|
class="tiptapify-emoji-container-item"
|
|
@@ -155,7 +162,6 @@ watch(() => tab.value, () => {
|
|
|
155
162
|
cursor: pointer;
|
|
156
163
|
width: 32px;
|
|
157
164
|
height: 32px;
|
|
158
|
-
filter: drop-shadow(1px 2px 3px #777);
|
|
159
165
|
transition: background-color 0.2s ease-in-out;
|
|
160
166
|
}
|
|
161
167
|
|
|
@@ -6,6 +6,12 @@ import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
|
|
|
6
6
|
import ImageDialog from "@tiptapify/extensions/components/media/image/ImageDialog.vue";
|
|
7
7
|
import { inject, Ref } from "vue";
|
|
8
8
|
|
|
9
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
10
|
+
|
|
11
|
+
defineProps({
|
|
12
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
13
|
+
})
|
|
14
|
+
|
|
9
15
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
10
16
|
|
|
11
17
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -15,6 +21,7 @@ const { t } = inject('tiptapifyI18n') as any
|
|
|
15
21
|
<template>
|
|
16
22
|
<VBtn
|
|
17
23
|
:color="editor.isActive('image') ? 'primary' : ''"
|
|
24
|
+
:variant="variantBtn"
|
|
18
25
|
@click="editor.commands.showTiptapifyImage()"
|
|
19
26
|
size="32"
|
|
20
27
|
>
|