tiptapify 0.1.4 → 0.1.5
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/dist/tiptapify.css +2 -1
- package/dist/tiptapify.mjs +64289 -50740
- package/dist/tiptapify.umd.js +88 -78
- package/index.d.ts +97 -40
- package/package.json +65 -66
- package/src/components/Footer.vue +4 -3
- package/src/components/MenuBubble.vue +16 -16
- package/src/components/MenuFloating.vue +13 -13
- package/src/components/Tiptapify.vue +19 -9
- package/src/components/Toolbar/Index.vue +21 -17
- package/src/components/Toolbar/Items.vue +2 -1
- package/src/components/Toolbar/actions.ts +3 -3
- package/src/components/Toolbar/alignment.ts +5 -5
- package/src/components/Toolbar/format.ts +5 -5
- package/src/components/Toolbar/formatExtra.ts +6 -6
- package/src/components/Toolbar/items.ts +8 -8
- package/src/components/Toolbar/list.ts +6 -6
- package/src/components/Toolbar/media.ts +8 -8
- package/src/components/Toolbar/misc.ts +8 -8
- package/src/components/Toolbar/style.ts +7 -7
- package/src/components/UI/TiptapifyDialog.vue +14 -13
- package/src/components/editorExtensions.ts +2 -2
- package/src/components/index.ts +6 -6
- package/src/constants/style.ts +4 -3
- package/src/extensions/charmap/arrows.ts +700 -700
- package/src/extensions/charmap/box_drawing.ts +184 -184
- package/src/extensions/charmap/currency.ts +93 -93
- package/src/extensions/charmap/cyrillic.ts +368 -368
- package/src/extensions/charmap/diacritics.ts +60 -60
- package/src/extensions/charmap/extended_letters.ts +748 -748
- package/src/extensions/charmap/greek.ts +252 -252
- package/src/extensions/charmap/hebrew.ts +105 -105
- package/src/extensions/charmap/math.ts +1684 -1684
- package/src/extensions/charmap/punctuation.ts +68 -68
- package/src/extensions/charmap/symbols.ts +288 -288
- package/src/extensions/charmap/typography.ts +284 -284
- package/src/extensions/components/CodeBlockComponent.vue +2 -2
- package/src/extensions/components/actions/redo/Button.vue +12 -10
- package/src/extensions/components/actions/undo/Button.vue +12 -10
- package/src/extensions/components/alignment/center/Button.vue +11 -9
- package/src/extensions/components/alignment/justify/Button.vue +11 -9
- package/src/extensions/components/alignment/left/Button.vue +11 -9
- package/src/extensions/components/alignment/right/Button.vue +11 -9
- package/src/extensions/components/format/bold/Button.vue +12 -10
- package/src/extensions/components/format/italic/Button.vue +12 -10
- package/src/extensions/components/format/strike/Button.vue +12 -10
- package/src/extensions/components/format/underline/Button.vue +5 -3
- package/src/extensions/components/formatExtra/code/Button.vue +12 -10
- package/src/extensions/components/formatExtra/codeBlock/Button.vue +12 -10
- package/src/extensions/components/formatExtra/quote/Button.vue +12 -10
- package/src/extensions/components/formatExtra/sub/Button.vue +12 -10
- package/src/extensions/components/formatExtra/sup/Button.vue +12 -10
- package/src/extensions/components/list/bullet/Button.vue +21 -19
- package/src/extensions/components/list/bullet/index.ts +1 -1
- package/src/extensions/components/list/indent/Button.vue +13 -11
- package/src/extensions/components/list/numbered/Button.vue +12 -10
- package/src/extensions/components/list/outdent/Button.vue +13 -11
- package/src/extensions/components/list/task/Button.vue +12 -10
- package/src/extensions/components/media/charmap/Button.vue +8 -5
- package/src/extensions/components/media/charmap/Picker.vue +20 -18
- package/src/extensions/components/media/emoji/Button.vue +8 -6
- package/src/extensions/components/media/emoji/Picker.vue +20 -18
- package/src/extensions/components/media/iframe/Button.vue +13 -11
- package/src/extensions/components/media/iframe/IframeDialog.vue +27 -25
- package/src/extensions/components/media/image/Button.vue +12 -10
- package/src/extensions/components/media/image/ImageDialog.vue +46 -42
- package/src/extensions/components/media/link/Button.vue +12 -11
- package/src/extensions/components/media/link/LinkDialog.vue +34 -32
- package/src/extensions/components/media/link/index.ts +6 -7
- package/src/extensions/components/media/table/Button.vue +21 -19
- package/src/extensions/components/media/table/ColumnActions.vue +5 -4
- package/src/extensions/components/media/table/RowActions.vue +5 -4
- package/src/extensions/components/media/table/TableBuilder.vue +15 -13
- package/src/extensions/components/media/video/Button.vue +12 -10
- package/src/extensions/components/media/video/VideoDialog.vue +33 -15
- package/src/extensions/components/misc/break/Button.vue +8 -6
- package/src/extensions/components/misc/formatClear/Button.vue +12 -10
- package/src/extensions/components/misc/fullscreen/Button.vue +20 -18
- package/src/extensions/components/misc/invisibleChar/Button.vue +11 -9
- package/src/extensions/components/misc/line/Button.vue +11 -9
- package/src/extensions/components/misc/preview/Button.vue +11 -9
- package/src/extensions/components/misc/source/Button.vue +9 -7
- package/src/extensions/components/misc/source/ShowSourceDialog.vue +27 -25
- package/src/extensions/components/slashCommands/CommandsList.vue +3 -1
- package/src/extensions/components/style/StyleColor.vue +26 -22
- package/src/extensions/components/style/color/Button.vue +19 -17
- package/src/extensions/components/style/fontFamily/Button.vue +16 -14
- package/src/extensions/components/style/fontFamily/FontFamily.vue +3 -2
- package/src/extensions/components/style/fontSize/Button.vue +17 -15
- package/src/extensions/components/style/fontSize/FontSize.vue +4 -3
- package/src/extensions/components/style/heading/Button.vue +19 -16
- package/src/extensions/components/style/highlight/Button.vue +19 -17
- package/src/extensions/components/style/lineHeight/Button.vue +16 -14
- package/src/extensions/components/style/lineHeight/FontFamily.vue +3 -2
- package/src/extensions/components/style/lineHeight/LineHeight.vue +3 -2
- package/src/extensions/emoji/activities.ts +534 -534
- package/src/extensions/emoji/animals_and_nature.ts +978 -978
- package/src/extensions/emoji/component.ts +54 -54
- package/src/extensions/emoji/flags.ts +1644 -1644
- package/src/extensions/emoji/food_and_drink.ts +810 -810
- package/src/extensions/emoji/objects.ts +1608 -1608
- package/src/extensions/emoji/people_and_body.ts +2022 -2022
- package/src/extensions/emoji/smileys_and_emotion.ts +1038 -1038
- package/src/extensions/emoji/symbols.ts +1290 -1290
- package/src/extensions/emoji/travel_and_places.ts +1332 -1332
- package/src/index.ts +15 -5
- package/src/types/editor.ts +10 -0
- package/src/types/slashCommandsTypes.ts +1 -1
- package/src/types/toolbarTypes.ts +3 -1
- package/src/utils/helpers.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { default as BoldButton } from
|
|
2
|
-
import { default as ItalicButton } from
|
|
3
|
-
import { default as UnderlineButton } from
|
|
4
|
-
import { default as StrikeButton } from
|
|
5
|
-
import { markRaw } from
|
|
1
|
+
import { default as BoldButton } from '@tiptapify/extensions/components/format/bold/Button.vue'
|
|
2
|
+
import { default as ItalicButton } from '@tiptapify/extensions/components/format/italic/Button.vue'
|
|
3
|
+
import { default as UnderlineButton } from '@tiptapify/extensions/components/format/underline/Button.vue'
|
|
4
|
+
import { default as StrikeButton } from '@tiptapify/extensions/components/format/strike/Button.vue'
|
|
5
|
+
import { markRaw } from 'vue'
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
section: 'format',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { default as SupButton } from
|
|
2
|
-
import { default as SubButton } from
|
|
3
|
-
import { default as CodeButton } from
|
|
4
|
-
import { default as CodeBlockButton } from
|
|
5
|
-
import { default as BlockquoteButton } from
|
|
6
|
-
import { markRaw } from
|
|
1
|
+
import { default as SupButton } from '@tiptapify/extensions/components/formatExtra/sup/Button.vue'
|
|
2
|
+
import { default as SubButton } from '@tiptapify/extensions/components/formatExtra/sub/Button.vue'
|
|
3
|
+
import { default as CodeButton } from '@tiptapify/extensions/components/formatExtra/code/Button.vue'
|
|
4
|
+
import { default as CodeBlockButton } from '@tiptapify/extensions/components/formatExtra/codeBlock/Button.vue'
|
|
5
|
+
import { default as BlockquoteButton } from '@tiptapify/extensions/components/formatExtra/quote/Button.vue'
|
|
6
|
+
import { markRaw } from 'vue'
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
section: 'formatExtra',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import actions from
|
|
2
|
-
import alignment from
|
|
3
|
-
import format from
|
|
4
|
-
import formatExtra from
|
|
5
|
-
import style from
|
|
6
|
-
import list from
|
|
7
|
-
import media from
|
|
8
|
-
import misc from
|
|
1
|
+
import actions from '@tiptapify/components/Toolbar/actions'
|
|
2
|
+
import alignment from '@tiptapify/components/Toolbar/alignment'
|
|
3
|
+
import format from '@tiptapify/components/Toolbar/format'
|
|
4
|
+
import formatExtra from '@tiptapify/components/Toolbar/formatExtra'
|
|
5
|
+
import style from '@tiptapify/components/Toolbar/style'
|
|
6
|
+
import list from '@tiptapify/components/Toolbar/list'
|
|
7
|
+
import media from '@tiptapify/components/Toolbar/media'
|
|
8
|
+
import misc from '@tiptapify/components/Toolbar/misc'
|
|
9
9
|
|
|
10
10
|
const items = {
|
|
11
11
|
style,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { default as BulletListButton } from
|
|
2
|
-
import { default as NumberedListButton } from
|
|
3
|
-
import { default as TaskListButton } from
|
|
4
|
-
import { default as IndentListButton } from
|
|
5
|
-
import { default as OutdentListButton } from
|
|
6
|
-
import { markRaw } from
|
|
1
|
+
import { default as BulletListButton } from '@tiptapify/extensions/components/list/bullet/Button.vue'
|
|
2
|
+
import { default as NumberedListButton } from '@tiptapify/extensions/components/list/numbered/Button.vue'
|
|
3
|
+
import { default as TaskListButton } from '@tiptapify/extensions/components/list/task/Button.vue'
|
|
4
|
+
import { default as IndentListButton } from '@tiptapify/extensions/components/list/indent/Button.vue'
|
|
5
|
+
import { default as OutdentListButton } from '@tiptapify/extensions/components/list/outdent/Button.vue'
|
|
6
|
+
import { markRaw } from 'vue'
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
section: 'list',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { default as EmojiButton } from
|
|
2
|
-
import { default as CharmapButton } from
|
|
3
|
-
import { default as LinkButton } from
|
|
4
|
-
import { default as ImageButton } from
|
|
5
|
-
import { default as IframeButton } from
|
|
6
|
-
import { default as TableButton } from
|
|
7
|
-
import { default as VideoButton } from
|
|
8
|
-
import { markRaw } from
|
|
1
|
+
import { default as EmojiButton } from '@tiptapify/extensions/components/media/emoji/Button.vue'
|
|
2
|
+
import { default as CharmapButton } from '@tiptapify/extensions/components/media/charmap/Button.vue'
|
|
3
|
+
import { default as LinkButton } from '@tiptapify/extensions/components/media/link/Button.vue'
|
|
4
|
+
import { default as ImageButton } from '@tiptapify/extensions/components/media/image/Button.vue'
|
|
5
|
+
import { default as IframeButton } from '@tiptapify/extensions/components/media/iframe/Button.vue'
|
|
6
|
+
import { default as TableButton } from '@tiptapify/extensions/components/media/table/Button.vue'
|
|
7
|
+
import { default as VideoButton } from '@tiptapify/extensions/components/media/video/Button.vue'
|
|
8
|
+
import { markRaw } from 'vue'
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
section: 'media',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { default as LineButton } from
|
|
2
|
-
import { default as BreakButton } from
|
|
3
|
-
import { default as PreviewButton } from
|
|
4
|
-
import { default as FullscreenButton } from
|
|
5
|
-
import { default as SourceButton } from
|
|
6
|
-
import { default as InvisibleCharButton } from
|
|
7
|
-
import { default as FormatClearButton } from
|
|
8
|
-
import { markRaw } from
|
|
1
|
+
import { default as LineButton } from '@tiptapify/extensions/components/misc/line/Button.vue'
|
|
2
|
+
import { default as BreakButton } from '@tiptapify/extensions/components/misc/break/Button.vue'
|
|
3
|
+
import { default as PreviewButton } from '@tiptapify/extensions/components/misc/preview/Button.vue'
|
|
4
|
+
import { default as FullscreenButton } from '@tiptapify/extensions/components/misc/fullscreen/Button.vue'
|
|
5
|
+
import { default as SourceButton } from '@tiptapify/extensions/components/misc/source/Button.vue'
|
|
6
|
+
import { default as InvisibleCharButton } from '@tiptapify/extensions/components/misc/invisibleChar/Button.vue'
|
|
7
|
+
import { default as FormatClearButton } from '@tiptapify/extensions/components/misc/formatClear/Button.vue'
|
|
8
|
+
import { markRaw } from 'vue'
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
section: 'misc',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { default as HeadingButton } from
|
|
2
|
-
import { default as FontFamilyButton } from
|
|
3
|
-
import { default as FontSizeButton } from
|
|
4
|
-
import { default as LineHeightButton } from
|
|
5
|
-
import { default as ColorButton } from
|
|
6
|
-
import { default as HighlightButton } from
|
|
7
|
-
import { markRaw } from
|
|
1
|
+
import { default as HeadingButton } from '@tiptapify/extensions/components/style/heading/Button.vue'
|
|
2
|
+
import { default as FontFamilyButton } from '@tiptapify/extensions/components/style/fontFamily/Button.vue'
|
|
3
|
+
import { default as FontSizeButton } from '@tiptapify/extensions/components/style/fontSize/Button.vue'
|
|
4
|
+
import { default as LineHeightButton } from '@tiptapify/extensions/components/style/lineHeight/Button.vue'
|
|
5
|
+
import { default as ColorButton } from '@tiptapify/extensions/components/style/color/Button.vue'
|
|
6
|
+
import { default as HighlightButton } from '@tiptapify/extensions/components/style/highlight/Button.vue'
|
|
7
|
+
import { markRaw } from 'vue'
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
section: 'style',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
|
|
3
|
-
import * as mdi from
|
|
4
|
-
import { inject, nextTick, onBeforeUnmount, onMounted, ref, watch } from
|
|
3
|
+
import * as mdi from '@mdi/js'
|
|
4
|
+
import { inject, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
5
|
+
import { ComposerTranslation } from 'vue-i18n'
|
|
5
6
|
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
module: String,
|
|
@@ -10,20 +11,20 @@ const props = defineProps({
|
|
|
10
11
|
maxWidth: { type: Number, default () { return 800 } },
|
|
11
12
|
})
|
|
12
13
|
|
|
13
|
-
const { t } = inject('tiptapifyI18n') as
|
|
14
|
+
const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
|
|
14
15
|
|
|
15
16
|
defineExpose({ open, close })
|
|
16
17
|
const emits = defineEmits(['closeDialog'])
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
+
const showDialog = ref<boolean>(false)
|
|
19
20
|
const movableHandler = ref(null)
|
|
20
21
|
|
|
21
22
|
function open() {
|
|
22
|
-
|
|
23
|
+
showDialog.value = true
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
function close() {
|
|
26
|
-
|
|
27
|
+
showDialog.value = false
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
function emitClose() {
|
|
@@ -53,7 +54,7 @@ function dragElement(trigger: HTMLElement, container: HTMLElement) {
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
function elementDrag(e: MouseEvent) {
|
|
56
|
-
e.preventDefault()
|
|
57
|
+
e.preventDefault()
|
|
57
58
|
|
|
58
59
|
coordinates.moveX = coordinates.cursorX - e.clientX
|
|
59
60
|
coordinates.moveY = coordinates.cursorY - e.clientY
|
|
@@ -89,26 +90,26 @@ function dragElement(trigger: HTMLElement, container: HTMLElement) {
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
watch(() =>
|
|
93
|
+
watch(() => showDialog.value, async () => {
|
|
93
94
|
await nextTick()
|
|
94
95
|
|
|
95
96
|
if (!movableHandler.value) {
|
|
96
97
|
return
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
if (
|
|
100
|
+
if (showDialog.value && !props.fullscreen) {
|
|
100
101
|
dragElement(movableHandler.value.$el as HTMLElement, movableHandler.value.$el.parentNode as HTMLElement)
|
|
101
102
|
}
|
|
102
103
|
})
|
|
103
104
|
|
|
104
105
|
function resizeListener() {
|
|
105
|
-
if (!
|
|
106
|
+
if (!showDialog.value) {
|
|
106
107
|
return
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
const dialogCoordinates = movableHandler.value.$el.parentNode.getBoundingClientRect()
|
|
110
|
+
const dialogCoordinates = movableHandler.value.$el.parentNode.getBoundingClientRect()
|
|
110
111
|
|
|
111
|
-
function checkBoundLeftTop(type) {
|
|
112
|
+
function checkBoundLeftTop(type: string) {
|
|
112
113
|
if (dialogCoordinates[type] < 0) {
|
|
113
114
|
const dialogOffset = movableHandler.value.$el.parentNode.style[type]
|
|
114
115
|
const newOffset = parseInt(dialogOffset) - dialogCoordinates[type]
|
|
@@ -139,7 +140,7 @@ onBeforeUnmount(() => {
|
|
|
139
140
|
</script>
|
|
140
141
|
|
|
141
142
|
<template>
|
|
142
|
-
<VDialog v-model="
|
|
143
|
+
<VDialog v-model="showDialog" :max-width="maxWidth" :fullscreen="fullscreen" @click:outside="emitClose">
|
|
143
144
|
<VCard>
|
|
144
145
|
<VCardTitle
|
|
145
146
|
ref="movableHandler"
|
|
@@ -32,8 +32,8 @@ import { TiptapifyLink } from '@tiptapify/extensions/components/media/link'
|
|
|
32
32
|
import { TiptapifyVideo } from '@tiptapify/extensions/components/media/video'
|
|
33
33
|
import CodeBlockComponent from '@tiptapify/extensions/components/CodeBlockComponent.vue'
|
|
34
34
|
import SlashCommands, { SlashCommandsExtensionOptions } from '@tiptapify/extensions/slash-commands'
|
|
35
|
-
import { SlashCommandsConfig
|
|
36
|
-
import { toolbarSections } from
|
|
35
|
+
import { SlashCommandsConfig } from '@tiptapify/types/slashCommandsTypes'
|
|
36
|
+
import { toolbarSections } from '@tiptapify/types/toolbarTypes'
|
|
37
37
|
|
|
38
38
|
// load all languages with "all" or common languages with "common"
|
|
39
39
|
import { common, createLowlight } from 'lowlight'
|
package/src/components/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Editor, useEditor } from
|
|
2
|
-
import { editorExtensions } from
|
|
3
|
-
import { toolbarSections } from
|
|
4
|
-
import { SlashCommandsConfig } from
|
|
5
|
-
import { ShallowRef } from
|
|
1
|
+
import { Editor, useEditor } from '@tiptap/vue-3'
|
|
2
|
+
import { editorExtensions } from '@tiptapify/components/editorExtensions'
|
|
3
|
+
import { toolbarSections } from '@tiptapify/types/toolbarTypes'
|
|
4
|
+
import { SlashCommandsConfig } from '@tiptapify/types/slashCommandsTypes'
|
|
5
|
+
import { ShallowRef } from 'vue'
|
|
6
6
|
|
|
7
7
|
export function getTiptapEditor (
|
|
8
|
-
content:
|
|
8
|
+
content: string|object,
|
|
9
9
|
placeholder: string,
|
|
10
10
|
slashCommands: SlashCommandsConfig = true,
|
|
11
11
|
customExtensions: toolbarSections,
|
package/src/constants/style.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Level } from '@tiptap/extension-heading'
|
|
2
|
+
import { Ref, ref } from 'vue'
|
|
2
3
|
|
|
3
4
|
export const defaultFontSize = 12
|
|
4
5
|
export const fontSizes = [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 32, 48, 64, 96]
|
|
@@ -6,8 +7,8 @@ export const fontSizes = [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 32, 48, 64, 96]
|
|
|
6
7
|
export const defaultLineHeight = 1
|
|
7
8
|
export const lineHeights = [1, 1.5, 2, 3, 4]
|
|
8
9
|
|
|
9
|
-
export const headingLevels = ref([1, 2, 3, 4, 5, 6])
|
|
10
|
-
export function setHeadingLevels(customHeadingLevels:
|
|
10
|
+
export const headingLevels: Ref<Level[]> = ref([1, 2, 3, 4, 5, 6])
|
|
11
|
+
export function setHeadingLevels(customHeadingLevels: Level[]) {
|
|
11
12
|
if (customHeadingLevels.length) {
|
|
12
13
|
customHeadingLevels.forEach(level => {
|
|
13
14
|
if (level < 1 || level > 6) {
|