tiptapify 0.0.22 → 0.0.25
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 +39 -3
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +22765 -22309
- package/dist/tiptapify.umd.js +53 -38
- package/index.d.ts +2 -2
- package/package.json +45 -47
- package/src/components/Tiptapify.vue +27 -8
- package/src/components/Toolbar/Index.vue +113 -9
- package/src/components/Toolbar/Items.vue +11 -5
- package/src/components/Toolbar/items.ts +14 -2
- package/src/components/Toolbar/style.ts +1 -1
- package/src/components/editorExtensions.ts +1 -1
- package/src/components/index.ts +6 -5
- 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 +7 -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/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
|
@@ -7,6 +7,12 @@ import FontFamily from "@tiptapify/extensions/components/style/fontFamily/FontFa
|
|
|
7
7
|
import { fonts } from "@tiptapify/constants/style";
|
|
8
8
|
import { computed, inject, Ref } from "vue";
|
|
9
9
|
|
|
10
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
11
|
+
|
|
12
|
+
defineProps({
|
|
13
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
14
|
+
})
|
|
15
|
+
|
|
10
16
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
11
17
|
|
|
12
18
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -42,6 +48,7 @@ function getColor() {
|
|
|
42
48
|
:id="`tiptapify-font-family-button-${editor.instanceId}`"
|
|
43
49
|
:disabled="!editor.can().chain().focus().unsetFontFamily().run()"
|
|
44
50
|
:color="getColor()"
|
|
51
|
+
:variant="variantBtn"
|
|
45
52
|
size="32"
|
|
46
53
|
>
|
|
47
54
|
<VTooltip activator="parent">
|
|
@@ -7,8 +7,11 @@ import FontSize from "@tiptapify/extensions/components/style/fontSize/FontSize.v
|
|
|
7
7
|
import { fontSizes } from "@tiptapify/constants/style";
|
|
8
8
|
import { computed, inject, Ref } from "vue";
|
|
9
9
|
|
|
10
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
11
|
+
|
|
10
12
|
const props = defineProps({
|
|
11
|
-
fontMeasure: { type: String, default () { return 'px' }}
|
|
13
|
+
fontMeasure: { type: String, default () { return 'px' }},
|
|
14
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
15
|
})
|
|
13
16
|
|
|
14
17
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
@@ -46,6 +49,7 @@ function getColor() {
|
|
|
46
49
|
:id="`tiptapify-font-size-button-${editor.instanceId}`"
|
|
47
50
|
:disabled="!editor.can().chain().focus().unsetFontSize().run()"
|
|
48
51
|
:color="getColor()"
|
|
52
|
+
:variant="variantBtn"
|
|
49
53
|
size="32"
|
|
50
54
|
>
|
|
51
55
|
<VTooltip activator="parent">
|
|
@@ -5,13 +5,15 @@ 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
|
+
|
|
8
10
|
const props = defineProps({
|
|
9
|
-
customHeadingLevels: { type: Array<number>, default: () => [] }
|
|
11
|
+
customHeadingLevels: { type: Array<number>, default: () => [] },
|
|
12
|
+
withParagraph: { type: Boolean, default: () => true },
|
|
13
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
10
14
|
})
|
|
11
15
|
|
|
12
|
-
interface MDIIcons {
|
|
13
|
-
[key: string]: string
|
|
14
|
-
}
|
|
16
|
+
interface MDIIcons { [key: string]: string }
|
|
15
17
|
const mdiIcons = mdi as MDIIcons
|
|
16
18
|
|
|
17
19
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
@@ -27,6 +29,7 @@ setHeadingLevels(props.customHeadingLevels)
|
|
|
27
29
|
<VBtn
|
|
28
30
|
:id="`tiptapify-heading-button-${editor.instanceId}`"
|
|
29
31
|
:color="editor.isActive('heading') ? 'primary' : ''"
|
|
32
|
+
:variant="variantBtn"
|
|
30
33
|
@click="editor.chain().focus().redo().run()"
|
|
31
34
|
size="32"
|
|
32
35
|
>
|
|
@@ -38,14 +41,19 @@ setHeadingLevels(props.customHeadingLevels)
|
|
|
38
41
|
|
|
39
42
|
<VMenu :activator="`#tiptapify-heading-button-${editor.instanceId}`">
|
|
40
43
|
<VList density="compact">
|
|
41
|
-
<VListItem
|
|
44
|
+
<VListItem
|
|
45
|
+
v-if="withParagraph"
|
|
46
|
+
link
|
|
47
|
+
:color="editor.isActive('paragraph') ? 'primary' : ''"
|
|
48
|
+
@click="editor.chain().focus().setParagraph().run()"
|
|
49
|
+
>
|
|
42
50
|
<VListItemTitle class="d-flex justify-center align-center">
|
|
43
51
|
<BtnIcon :icon="`mdiSvg:${mdiIcons['mdiFormatParagraph']}`" />
|
|
44
52
|
</VListItemTitle>
|
|
45
53
|
</VListItem>
|
|
46
54
|
<VListItem
|
|
47
55
|
v-for="headingLevel in headingLevels" :key="headingLevel"
|
|
48
|
-
:color="editor.isActive('heading', {level: headingLevel}) ? 'primary' : ''"
|
|
56
|
+
:color="editor.isActive('heading', { level: headingLevel }) ? 'primary' : ''"
|
|
49
57
|
@click="editor.chain().focus().toggleHeading({ level: headingLevel }).run()"
|
|
50
58
|
>
|
|
51
59
|
<VListItemTitle class="d-flex justify-center align-center">
|
|
@@ -7,8 +7,10 @@ import StyleColor from "@tiptapify/extensions/components/style/StyleColor.vue";
|
|
|
7
7
|
import { computed, inject, Ref } from "vue";
|
|
8
8
|
import { useTheme } from "vuetify/framework";
|
|
9
9
|
|
|
10
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
11
|
+
|
|
10
12
|
defineProps({
|
|
11
|
-
|
|
13
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
12
14
|
})
|
|
13
15
|
|
|
14
16
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
@@ -30,6 +32,7 @@ const selectedColor = computed(() => editor.value.getAttributes('highlight').col
|
|
|
30
32
|
<VBtn
|
|
31
33
|
:id="`tiptapify-highlight-button-${editor.instanceId}`"
|
|
32
34
|
:disabled="!editor.can().chain().focus().toggleHighlight().run()"
|
|
35
|
+
:variant="variantBtn"
|
|
33
36
|
@click="editor.chain().focus().redo().run()"
|
|
34
37
|
size="32"
|
|
35
38
|
>
|
|
@@ -7,6 +7,12 @@ import LineHeight from "@tiptapify/extensions/components/style/lineHeight/LineHe
|
|
|
7
7
|
import { lineHeights } from "@tiptapify/constants/style";
|
|
8
8
|
import { computed, inject, Ref } from "vue";
|
|
9
9
|
|
|
10
|
+
import defaults from '@tiptapify/constants/defaults'
|
|
11
|
+
|
|
12
|
+
defineProps({
|
|
13
|
+
variantBtn: { type: String, default: defaults.variantBtn }
|
|
14
|
+
})
|
|
15
|
+
|
|
10
16
|
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
11
17
|
|
|
12
18
|
const { t } = inject('tiptapifyI18n') as any
|
|
@@ -42,6 +48,7 @@ function getColor() {
|
|
|
42
48
|
:id="`tiptapify-line-height-button-${editor.instanceId}`"
|
|
43
49
|
:disabled="!editor.can().chain().focus().unsetLineHeight().run()"
|
|
44
50
|
:color="getColor()"
|
|
51
|
+
:variant="variantBtn"
|
|
45
52
|
size="32"
|
|
46
53
|
>
|
|
47
54
|
<VTooltip activator="parent">
|
|
@@ -13,6 +13,7 @@ export enum ToolbarSectionsEnum {
|
|
|
13
13
|
export type sectionComponent = {
|
|
14
14
|
name: string,
|
|
15
15
|
component: any,
|
|
16
|
+
props?: { [key: string]: any }
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export type section = {
|
|
@@ -22,4 +23,6 @@ export type section = {
|
|
|
22
23
|
extensions?: Array<any>,
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
export type toolbarSections = Array<section>
|
|
26
|
+
export type toolbarSections = Array<section>
|
|
27
|
+
|
|
28
|
+
export type itemsPropType = { [key: string]: Array<string> } | Array<string>
|