tiptapify 0.0.28 → 0.0.29

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tiptapify",
3
3
  "types": "./index.d.ts",
4
- "version": "0.0.28",
4
+ "version": "0.0.29",
5
5
  "description": "Tiptap3 editor with Vuetify3 menu implementation",
6
6
  "exports": {
7
7
  ".": {
@@ -54,9 +54,9 @@ checkButtonOrMenu()
54
54
 
55
55
  function toggleList(listType: string) {
56
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;
57
+ case 'bulletList': editor.value.commands.toggleBulletList(); break;
58
+ case 'bulletListCircle': editor.value.commands.toggleBulletListCircle(); break;
59
+ case 'bulletListSquare': editor.value.commands.toggleBulletListSquare(); break;
60
60
  }
61
61
  }
62
62
 
@@ -68,8 +68,10 @@ const buttonActive = computed(() => {
68
68
 
69
69
  const buttonDisabled = computed(() => {
70
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()
71
+ !editor.value.can().chain().focus().toggleBulletListCircle().run() &&
72
+ !editor.value.can().chain().focus().toggleBulletListSquare().run() &&
73
+ !editor.value.can().chain().focus().toggleOrderedList().run() &&
74
+ !editor.value.can().chain().focus().toggleTaskList().run()
73
75
  })
74
76
 
75
77
  watch(() => bulletLists.value, () => {
@@ -100,7 +102,7 @@ watch(() => bulletLists.value, () => {
100
102
  :key="key"
101
103
  link
102
104
  :active="editor.isActive(bulletList.name)"
103
- @click="toggleList(key)"
105
+ @click="toggleList(bulletList.name)"
104
106
  >
105
107
  <VTooltip activator="parent">
106
108
  {{ t('lists.bullet') }}
@@ -3,7 +3,7 @@
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 } from "vue";
7
7
 
8
8
  import defaults from '@tiptapify/constants/defaults'
9
9
 
@@ -15,12 +15,19 @@ const editor = inject('tiptapifyEditor') as Ref<Editor>
15
15
 
16
16
  const { t } = inject('tiptapifyI18n') as any
17
17
 
18
+ const buttonDisabled = computed(() => {
19
+ return !editor.value.can().chain().focus().toggleBulletList().run() &&
20
+ !editor.value.can().chain().focus().toggleBulletListCircle().run() &&
21
+ !editor.value.can().chain().focus().toggleBulletListSquare().run() &&
22
+ !editor.value.can().chain().focus().toggleOrderedList().run() &&
23
+ !editor.value.can().chain().focus().toggleTaskList().run()
24
+ })
18
25
  </script>
19
26
 
20
27
  <template>
21
28
  <VBtn
22
29
  :color="editor.isActive('orderedList') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleOrderedList().run()"
30
+ :disabled="buttonDisabled"
24
31
  :variant="variantBtn"
25
32
  @click="editor.commands.toggleOrderedList()"
26
33
  size="32"
@@ -3,7 +3,7 @@
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 } from "vue";
7
7
 
8
8
  import defaults from '@tiptapify/constants/defaults'
9
9
 
@@ -15,12 +15,19 @@ const editor = inject('tiptapifyEditor') as Ref<Editor>
15
15
 
16
16
  const { t } = inject('tiptapifyI18n') as any
17
17
 
18
+ const buttonDisabled = computed(() => {
19
+ return !editor.value.can().chain().focus().toggleBulletList().run() &&
20
+ !editor.value.can().chain().focus().toggleBulletListCircle().run() &&
21
+ !editor.value.can().chain().focus().toggleBulletListSquare().run() &&
22
+ !editor.value.can().chain().focus().toggleOrderedList().run() &&
23
+ !editor.value.can().chain().focus().toggleTaskList().run()
24
+ })
18
25
  </script>
19
26
 
20
27
  <template>
21
28
  <VBtn
22
29
  :color="editor.isActive('taskList') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleTaskList().run()"
30
+ :disabled="buttonDisabled"
24
31
  :variant="variantBtn"
25
32
  @click="editor.commands.toggleTaskList()"
26
33
  size="32"