tiptapify 0.0.11 → 0.0.13
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 +9 -4
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +47819 -28736
- package/dist/tiptapify.umd.js +78 -38
- package/index.d.ts +2 -2
- package/package.json +49 -45
- package/src/components/MenuBubble.vue +8 -8
- package/src/components/Tiptapify.vue +4 -5
- package/src/components/Toolbar/Group.vue +2 -2
- package/src/components/Toolbar/GroupBtn.vue +11 -8
- package/src/components/Toolbar/GroupDropdown.vue +3 -17
- package/src/components/Toolbar/Index.vue +13 -10
- package/src/components/Toolbar/Items.vue +3 -6
- package/src/components/Toolbar/Toggle.vue +2 -4
- package/src/components/Toolbar/defaultExtensionComponents.ts +34 -13
- package/src/components/Toolbar/items.ts +43 -60
- package/src/components/UI/BtnIcon.vue +24 -0
- package/src/components/UI/{Dialog.vue → TiptapifyDialog.vue} +4 -3
- package/src/components/editorExtensions.ts +16 -1
- package/src/components/index.ts +8 -2
- package/src/composables/Toolbar/Actions/useRedo.ts +23 -0
- package/src/composables/Toolbar/Actions/useUndo.ts +23 -0
- package/src/composables/Toolbar/Alignment/useAlignmentCenter.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentJustify.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentLeft.ts +24 -0
- package/src/composables/Toolbar/Alignment/useAlignmentRight.ts +24 -0
- package/src/composables/Toolbar/Format/useBold.ts +24 -0
- package/src/composables/Toolbar/Format/useItalic.ts +24 -0
- package/src/composables/Toolbar/Format/useStrike.ts +24 -0
- package/src/composables/Toolbar/Format/useUnderline.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useBlockquote.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useCode.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useCodeBlock.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useSub.ts +24 -0
- package/src/composables/Toolbar/FormatExtra/useSup.ts +24 -0
- package/src/composables/Toolbar/List/useBullet.ts +23 -0
- package/src/composables/Toolbar/List/useIndent.ts +24 -0
- package/src/composables/Toolbar/List/useNumbered.ts +23 -0
- package/src/composables/Toolbar/List/useOutdent.ts +24 -0
- package/src/composables/Toolbar/List/useTask.ts +23 -0
- package/src/composables/Toolbar/Media/useEmoji.ts +20 -0
- package/src/composables/Toolbar/Media/useImage.ts +24 -0
- package/src/composables/Toolbar/Media/useLink.ts +24 -0
- package/src/composables/Toolbar/Media/useTable.ts +188 -0
- package/src/composables/Toolbar/Misc/useBreak.ts +21 -0
- package/src/composables/Toolbar/Misc/useFormatClear.ts +23 -0
- package/src/composables/Toolbar/Misc/useInvisibleCharacters.ts +23 -0
- package/src/composables/Toolbar/Misc/useLine.ts +21 -0
- package/src/composables/Toolbar/Misc/usePreview.ts +20 -0
- package/src/composables/Toolbar/Misc/useSource.ts +21 -0
- package/src/composables/Toolbar/Style/useColor.ts +36 -0
- package/src/composables/Toolbar/Style/useFontFamily.ts +49 -0
- package/src/composables/Toolbar/Style/useFontSize.ts +50 -0
- package/src/composables/Toolbar/Style/useHeading.ts +64 -0
- package/src/composables/Toolbar/Style/useHighlight.ts +36 -0
- package/src/composables/Toolbar/Style/useLineHeight.ts +49 -0
- package/src/composables/Toolbar/useActionsItems.ts +5 -31
- package/src/composables/Toolbar/useAlignmentItems.ts +9 -59
- package/src/composables/Toolbar/useFormatExtraItems.ts +11 -72
- package/src/composables/Toolbar/useFormatItems.ts +9 -59
- package/src/composables/Toolbar/useListItems.ts +11 -69
- package/src/composables/Toolbar/useMediaItems.ts +9 -209
- package/src/composables/Toolbar/useMiscItems.ts +13 -58
- package/src/composables/Toolbar/useStyleItems.ts +14 -228
- package/src/extensions/components/Emoji.vue +109 -0
- package/src/extensions/components/ImageDialog.vue +7 -3
- package/src/extensions/components/LinkDialog.vue +7 -3
- package/src/extensions/components/PreviewDialog.vue +11 -4
- package/src/extensions/components/ShowSourceDialog.vue +7 -4
- package/src/extensions/components/StyleColor.vue +2 -2
- package/src/extensions/components/slashCommands/CommandsList.vue +1 -4
- package/src/extensions/emoji/activities.ts +770 -0
- package/src/extensions/emoji/animals_and_nature.ts +1330 -0
- package/src/extensions/emoji/component.ts +74 -0
- package/src/extensions/emoji/flags.ts +2210 -0
- package/src/extensions/emoji/food_and_drink.ts +1066 -0
- package/src/extensions/emoji/index.ts +63 -0
- package/src/extensions/emoji/objects.ts +2514 -0
- package/src/extensions/emoji/people_and_body.ts +3986 -0
- package/src/extensions/emoji/smileys_and_emotion.ts +1482 -0
- package/src/extensions/emoji/symbols.ts +2242 -0
- package/src/extensions/emoji/travel_and_places.ts +2138 -0
- package/src/extensions/image.ts +2 -1
- package/src/extensions/link.ts +2 -1
- package/src/extensions/preview.ts +2 -1
- package/src/extensions/view-source.ts +2 -1
- package/src/i18n/index.ts +1 -0
- package/src/i18n/locales/ch.json +14 -1
- package/src/i18n/locales/cz.json +14 -1
- package/src/i18n/locales/de.json +14 -1
- package/src/i18n/locales/en.json +14 -1
- package/src/i18n/locales/es.json +14 -1
- package/src/i18n/locales/fr.json +14 -1
- package/src/i18n/locales/it.json +14 -1
- package/src/i18n/locales/la.json +14 -1
- package/src/i18n/locales/lt.json +14 -1
- package/src/i18n/locales/nl.json +14 -1
- package/src/i18n/locales/pl.json +14 -1
- package/src/i18n/locales/pt.json +14 -1
- package/src/i18n/locales/ru.json +14 -1
- package/src/i18n/locales/se.json +14 -1
- package/src/i18n/locales/ua.json +14 -1
- package/src/index.ts +3 -1
- package/src/types/extensionComponents.ts +22 -0
- package/src/types/toolbarItems.ts +43 -0
- package/src/types/toolbarSections.ts +11 -0
- package/src/types/overridable-extensions.ts +0 -6
|
@@ -5,7 +5,7 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
import { useI18n } from 'vue-i18n'
|
|
6
6
|
import { computed, inject, onMounted, onUnmounted, Ref, ref, watch } from 'vue'
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue"
|
|
9
9
|
|
|
10
10
|
defineProps({
|
|
11
11
|
variantBtn: { type: String, default() { return 'elevated' }},
|
|
@@ -63,6 +63,10 @@ function close() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const showLink = (event: CustomEvent) => {
|
|
66
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
|
|
66
70
|
attrs.value.href = event.detail.link?.href ?? ''
|
|
67
71
|
attrs.value.target = targetAttrs.value.find(item => item.value === event.detail.link?.target) ?? targetAttrs[0]
|
|
68
72
|
attrs.value.rel = event.detail.link?.rel?.split(' ')
|
|
@@ -103,7 +107,7 @@ watch(() => attrs.value.href, () => {
|
|
|
103
107
|
</script>
|
|
104
108
|
|
|
105
109
|
<template>
|
|
106
|
-
<
|
|
110
|
+
<TiptapifyDialog ref="dialog" module="link">
|
|
107
111
|
<template #content>
|
|
108
112
|
<VCardText>
|
|
109
113
|
<VRow>
|
|
@@ -169,5 +173,5 @@ watch(() => attrs.value.href, () => {
|
|
|
169
173
|
</VRow>
|
|
170
174
|
</VCardActions>
|
|
171
175
|
</template>
|
|
172
|
-
</
|
|
176
|
+
</TiptapifyDialog>
|
|
173
177
|
</template>
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { Editor } from "@tiptap/vue-3";
|
|
3
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
4
|
+
import { ref, onMounted, onUnmounted, inject, Ref } from 'vue'
|
|
4
5
|
|
|
5
6
|
const content = ref()
|
|
6
7
|
|
|
8
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
9
|
+
|
|
7
10
|
const dialog = ref(null)
|
|
8
11
|
|
|
9
12
|
const showDialog = (event: CustomEvent) => {
|
|
13
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
content.value = event.detail.html
|
|
11
18
|
|
|
12
19
|
dialog.value.open()
|
|
@@ -22,13 +29,13 @@ onUnmounted(() => {
|
|
|
22
29
|
</script>
|
|
23
30
|
|
|
24
31
|
<template>
|
|
25
|
-
<
|
|
32
|
+
<TiptapifyDialog ref="dialog" module="preview" fullscreen>
|
|
26
33
|
<template #content>
|
|
27
34
|
<VCardItem>
|
|
28
35
|
<div class="tiptap" v-html="content"></div>
|
|
29
36
|
</VCardItem>
|
|
30
37
|
</template>
|
|
31
|
-
</
|
|
38
|
+
</TiptapifyDialog>
|
|
32
39
|
</template>
|
|
33
40
|
|
|
34
41
|
<style lang="scss">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import
|
|
3
|
+
import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
|
|
4
4
|
import { ref, onMounted, onUnmounted, watch, inject, Ref } from 'vue'
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
6
6
|
|
|
@@ -54,6 +54,9 @@ const unformatHtml = (html: string): string => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const showDialog = (event: CustomEvent) => {
|
|
57
|
+
if (event.detail.editorId !== editor.value.instanceId) {
|
|
58
|
+
return
|
|
59
|
+
}
|
|
57
60
|
sourceCode.value = event.detail.html
|
|
58
61
|
|
|
59
62
|
dialog.value.open()
|
|
@@ -79,7 +82,7 @@ watch(() => formatted.value, () => {
|
|
|
79
82
|
</script>
|
|
80
83
|
|
|
81
84
|
<template>
|
|
82
|
-
<
|
|
85
|
+
<TiptapifyDialog ref="dialog" module="source" :max-width="1500">
|
|
83
86
|
<template #content>
|
|
84
87
|
<VCardText>
|
|
85
88
|
<VContainer fluid class="pt-0 pl-0 pr-0">
|
|
@@ -105,7 +108,7 @@ watch(() => formatted.value, () => {
|
|
|
105
108
|
<template #actions>
|
|
106
109
|
<VCardActions>
|
|
107
110
|
<VSpacer></VSpacer>
|
|
108
|
-
<VBtn :variant="variantBtn" @click="dialog
|
|
111
|
+
<VBtn :variant="variantBtn" @click="dialog.close()">
|
|
109
112
|
{{ t('dialog.close') }}
|
|
110
113
|
</VBtn>
|
|
111
114
|
<VBtn :variant="variantBtn" color="primary" @click="saveChanges">
|
|
@@ -113,7 +116,7 @@ watch(() => formatted.value, () => {
|
|
|
113
116
|
</VBtn>
|
|
114
117
|
</VCardActions>
|
|
115
118
|
</template>
|
|
116
|
-
</
|
|
119
|
+
</TiptapifyDialog>
|
|
117
120
|
</template>
|
|
118
121
|
|
|
119
122
|
<style scoped lang="scss">
|
|
@@ -170,7 +170,7 @@ function isColorActive(color: string): boolean {
|
|
|
170
170
|
|
|
171
171
|
<VMenu v-model="colorPicker" :close-on-content-click="false">
|
|
172
172
|
<template #activator="{ props: menuProps }">
|
|
173
|
-
<VBtn v-bind="menuProps" variant="flat" block>
|
|
173
|
+
<VBtn v-bind="menuProps" color="default" variant="flat" block>
|
|
174
174
|
<template #prepend>
|
|
175
175
|
<div
|
|
176
176
|
class="tiptapify-style-color-picker"
|
|
@@ -198,7 +198,7 @@ function isColorActive(color: string): boolean {
|
|
|
198
198
|
|
|
199
199
|
<VDivider class="mt-2 mb-2" />
|
|
200
200
|
|
|
201
|
-
<VBtn @click="unsetColor" block variant="flat">
|
|
201
|
+
<VBtn @click="unsetColor" color="default" block variant="flat">
|
|
202
202
|
{{ t('style.color.unset') }}
|
|
203
203
|
</VBtn>
|
|
204
204
|
</VSheet>
|
|
@@ -77,10 +77,7 @@ defineExpose({
|
|
|
77
77
|
@click="selectItem(index)"
|
|
78
78
|
size="small"
|
|
79
79
|
>
|
|
80
|
-
<VIcon
|
|
81
|
-
<span v-else>
|
|
82
|
-
{{ item.title }}
|
|
83
|
-
</span>
|
|
80
|
+
<VIcon :icon="`mdiSvg:${mdi[`mdi${item.icon}`]}` || `mdiSvg:${mdi.mdiImageBrokenVariant}`" size="16" />
|
|
84
81
|
</VBtn>
|
|
85
82
|
</template>
|
|
86
83
|
<div class="item" v-else>No result</div>
|