tiptapify 0.0.12 → 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 +3 -2
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +47044 -28344
- package/dist/tiptapify.umd.js +39 -39
- package/package.json +49 -46
- package/src/composables/Toolbar/Media/useEmoji.ts +20 -0
- package/src/composables/Toolbar/useMediaItems.ts +2 -0
- package/src/extensions/components/Emoji.vue +109 -0
- 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/i18n/locales/ch.json +12 -0
- package/src/i18n/locales/cz.json +12 -0
- package/src/i18n/locales/de.json +12 -0
- package/src/i18n/locales/en.json +12 -0
- package/src/i18n/locales/es.json +12 -0
- package/src/i18n/locales/fr.json +12 -0
- package/src/i18n/locales/it.json +12 -0
- package/src/i18n/locales/la.json +12 -0
- package/src/i18n/locales/lt.json +12 -0
- package/src/i18n/locales/nl.json +12 -0
- package/src/i18n/locales/pl.json +12 -0
- package/src/i18n/locales/pt.json +12 -0
- package/src/i18n/locales/ru.json +12 -0
- package/src/i18n/locales/se.json +12 -0
- package/src/i18n/locales/ua.json +12 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiptapify",
|
|
3
3
|
"types": "./index.d.ts",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "Tiptap3 editor with Vuetify3 menu implementation",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"dev": "vite",
|
|
31
31
|
"build": "vite build",
|
|
32
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
|
+
"build:emojis": "tsx build-emojis.ts"
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|
|
35
36
|
"vue",
|
|
@@ -53,49 +54,50 @@
|
|
|
53
54
|
"repository": "https://github.com/IVoyt/tiptapify",
|
|
54
55
|
"packageManager": "pnpm@10.12.1",
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@tiptap/core": "^3.0.
|
|
57
|
-
"@tiptap/extension-blockquote": "^3.0.
|
|
58
|
-
"@tiptap/extension-bold": "^3.0.
|
|
59
|
-
"@tiptap/extension-bubble-menu": "^3.0.
|
|
60
|
-
"@tiptap/extension-code": "^3.0.
|
|
61
|
-
"@tiptap/extension-code-block": "^3.0.
|
|
62
|
-
"@tiptap/extension-code-block-lowlight": "^3.0.
|
|
63
|
-
"@tiptap/extension-color": "^3.0.
|
|
64
|
-
"@tiptap/extension-document": "^3.0.
|
|
65
|
-
"@tiptap/extension-floating-menu": "^3.0.
|
|
66
|
-
"@tiptap/extension-font-family": "^3.0.
|
|
67
|
-
"@tiptap/extension-hard-break": "^3.0.
|
|
68
|
-
"@tiptap/extension-heading": "^3.0.
|
|
69
|
-
"@tiptap/extension-highlight": "^3.0.
|
|
70
|
-
"@tiptap/extension-horizontal-rule": "^3.0.
|
|
71
|
-
"@tiptap/extension-image": "^3.0.
|
|
72
|
-
"@tiptap/extension-invisible-characters": "^3.0.
|
|
73
|
-
"@tiptap/extension-italic": "^3.0.
|
|
74
|
-
"@tiptap/extension-link": "^3.0.
|
|
75
|
-
"@tiptap/extension-list": "^3.0.
|
|
76
|
-
"@tiptap/extension-list-item": "^3.0.
|
|
77
|
-
"@tiptap/extension-paragraph": "^3.0.
|
|
78
|
-
"@tiptap/extension-placeholder": "^3.0.
|
|
79
|
-
"@tiptap/extension-strike": "^3.0.
|
|
80
|
-
"@tiptap/extension-subscript": "^3.0.
|
|
81
|
-
"@tiptap/extension-superscript": "^3.0.
|
|
82
|
-
"@tiptap/extension-table": "^3.0.
|
|
83
|
-
"@tiptap/extension-task-item": "^3.0.
|
|
84
|
-
"@tiptap/extension-task-list": "^3.0.
|
|
85
|
-
"@tiptap/extension-text": "^3.0.
|
|
86
|
-
"@tiptap/extension-text-align": "^3.0.
|
|
87
|
-
"@tiptap/extension-text-style": "^3.0.
|
|
88
|
-
"@tiptap/extension-typography": "^3.0.
|
|
89
|
-
"@tiptap/extension-underline": "^3.0.
|
|
90
|
-
"@tiptap/extensions": "^3.0.
|
|
91
|
-
"@tiptap/pm": "^3.0.
|
|
92
|
-
"@tiptap/starter-kit": "^3.0.
|
|
93
|
-
"@tiptap/suggestion": "^3.0.
|
|
94
|
-
"@tiptap/vue-3": "^3.0.
|
|
57
|
+
"@tiptap/core": "^3.0.8",
|
|
58
|
+
"@tiptap/extension-blockquote": "^3.0.8",
|
|
59
|
+
"@tiptap/extension-bold": "^3.0.8",
|
|
60
|
+
"@tiptap/extension-bubble-menu": "^3.0.8",
|
|
61
|
+
"@tiptap/extension-code": "^3.0.8",
|
|
62
|
+
"@tiptap/extension-code-block": "^3.0.8",
|
|
63
|
+
"@tiptap/extension-code-block-lowlight": "^3.0.8",
|
|
64
|
+
"@tiptap/extension-color": "^3.0.8",
|
|
65
|
+
"@tiptap/extension-document": "^3.0.8",
|
|
66
|
+
"@tiptap/extension-floating-menu": "^3.0.8",
|
|
67
|
+
"@tiptap/extension-font-family": "^3.0.8",
|
|
68
|
+
"@tiptap/extension-hard-break": "^3.0.8",
|
|
69
|
+
"@tiptap/extension-heading": "^3.0.8",
|
|
70
|
+
"@tiptap/extension-highlight": "^3.0.8",
|
|
71
|
+
"@tiptap/extension-horizontal-rule": "^3.0.8",
|
|
72
|
+
"@tiptap/extension-image": "^3.0.8",
|
|
73
|
+
"@tiptap/extension-invisible-characters": "^3.0.8",
|
|
74
|
+
"@tiptap/extension-italic": "^3.0.8",
|
|
75
|
+
"@tiptap/extension-link": "^3.0.8",
|
|
76
|
+
"@tiptap/extension-list": "^3.0.8",
|
|
77
|
+
"@tiptap/extension-list-item": "^3.0.8",
|
|
78
|
+
"@tiptap/extension-paragraph": "^3.0.8",
|
|
79
|
+
"@tiptap/extension-placeholder": "^3.0.8",
|
|
80
|
+
"@tiptap/extension-strike": "^3.0.8",
|
|
81
|
+
"@tiptap/extension-subscript": "^3.0.8",
|
|
82
|
+
"@tiptap/extension-superscript": "^3.0.8",
|
|
83
|
+
"@tiptap/extension-table": "^3.0.8",
|
|
84
|
+
"@tiptap/extension-task-item": "^3.0.8",
|
|
85
|
+
"@tiptap/extension-task-list": "^3.0.8",
|
|
86
|
+
"@tiptap/extension-text": "^3.0.8",
|
|
87
|
+
"@tiptap/extension-text-align": "^3.0.8",
|
|
88
|
+
"@tiptap/extension-text-style": "^3.0.8",
|
|
89
|
+
"@tiptap/extension-typography": "^3.0.8",
|
|
90
|
+
"@tiptap/extension-underline": "^3.0.8",
|
|
91
|
+
"@tiptap/extensions": "^3.0.8",
|
|
92
|
+
"@tiptap/pm": "^3.0.8",
|
|
93
|
+
"@tiptap/starter-kit": "^3.0.8",
|
|
94
|
+
"@tiptap/suggestion": "^3.0.8",
|
|
95
|
+
"@tiptap/vue-3": "^3.0.8",
|
|
96
|
+
"emoji.json": "^16.0.0",
|
|
95
97
|
"highlight.js": "^11.11.1",
|
|
96
|
-
"linkifyjs": "^4.3.
|
|
98
|
+
"linkifyjs": "^4.3.2",
|
|
97
99
|
"lowlight": "^3.3.0",
|
|
98
|
-
"vue-i18n": "^11.1.
|
|
100
|
+
"vue-i18n": "^11.1.11"
|
|
99
101
|
},
|
|
100
102
|
"peerDependencies": {
|
|
101
103
|
"@mdi/js": "^7.4.47",
|
|
@@ -105,15 +107,16 @@
|
|
|
105
107
|
"devDependencies": {
|
|
106
108
|
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
107
109
|
"@rollup/plugin-alias": "^5.1.1",
|
|
108
|
-
"@types/node": "^22.
|
|
110
|
+
"@types/node": "^22.17.0",
|
|
109
111
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
110
112
|
"@vitejs/plugin-vue-jsx": "^4.2.0",
|
|
111
113
|
"rollup-plugin-tsconfig-paths": "^1.5.2",
|
|
112
114
|
"sass-embedded": "^1.89.2",
|
|
113
|
-
"
|
|
115
|
+
"tsx": "^4.20.3",
|
|
116
|
+
"typescript": "^5.9.2",
|
|
114
117
|
"unplugin-vue-components": "^28.8.0",
|
|
115
118
|
"vite": "^6.3.5",
|
|
116
|
-
"vite-plugin-vuetify": "^2.1.
|
|
119
|
+
"vite-plugin-vuetify": "^2.1.2",
|
|
117
120
|
"vite-svg-loader": "^5.1.0",
|
|
118
121
|
"vite-tsconfig-paths": "^5.1.4",
|
|
119
122
|
"vue-tsc": "^2.2.12"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as mdi from "@mdi/js";
|
|
2
|
+
import Emoji from "@tiptapify/extensions/components/Emoji.vue";
|
|
3
|
+
import { computed, markRaw } from "vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
|
|
6
|
+
export function useEmoji() {
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
name: computed(() => t('media.emoji')),
|
|
11
|
+
tooltip: computed(() => t('media.emoji')),
|
|
12
|
+
icon: `mdiSvg:${mdi.mdiEmoticon}`,
|
|
13
|
+
enabled: true,
|
|
14
|
+
component: markRaw(Emoji),
|
|
15
|
+
props: {
|
|
16
|
+
persistent: false,
|
|
17
|
+
closeOnContentClick: false,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useImage } from "@tiptapify/composables/Toolbar/Media/useImage";
|
|
2
|
+
import { useEmoji } from "@tiptapify/composables/Toolbar/Media/useEmoji";
|
|
2
3
|
import { useLink } from "@tiptapify/composables/Toolbar/Media/useLink";
|
|
3
4
|
import { useTable } from "@tiptapify/composables/Toolbar/Media/useTable";
|
|
4
5
|
|
|
@@ -6,6 +7,7 @@ export function useMediaItems() {
|
|
|
6
7
|
return {
|
|
7
8
|
link: useLink(),
|
|
8
9
|
image: useImage(),
|
|
10
|
+
emoji: useEmoji(),
|
|
9
11
|
table: useTable()
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
import { Editor } from "@tiptap/vue-3";
|
|
4
|
+
import { useI18n } from 'vue-i18n'
|
|
5
|
+
|
|
6
|
+
import tiptapifyEmojis from "@tiptapify/extensions/emoji"
|
|
7
|
+
|
|
8
|
+
import { computed, inject, Ref, ref } from 'vue'
|
|
9
|
+
|
|
10
|
+
const { t } = useI18n()
|
|
11
|
+
|
|
12
|
+
defineExpose({ open, close })
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['close'])
|
|
15
|
+
|
|
16
|
+
const editor = inject('tiptapifyEditor') as Ref<Editor>
|
|
17
|
+
|
|
18
|
+
const tab = ref('smileys_and_emotion')
|
|
19
|
+
const sorted = tiptapifyEmojis.sort((previous, current) => {
|
|
20
|
+
if (previous.order < current.order) {
|
|
21
|
+
return -1
|
|
22
|
+
}
|
|
23
|
+
if (previous.order > current.order) {
|
|
24
|
+
return 1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return 0
|
|
28
|
+
})
|
|
29
|
+
const emojis = computed(() => sorted.map(item => { return { group: item.name, emojis: item.items } }))
|
|
30
|
+
|
|
31
|
+
const handleEmojiClick = (emoji: any) => {
|
|
32
|
+
editor.value.chain().focus().insertContent(emoji.char).run()
|
|
33
|
+
close()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function close() {
|
|
37
|
+
emit('close')
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<VSheet class="pa-2" max-width="570">
|
|
43
|
+
<div class="d-flex flex-row">
|
|
44
|
+
<VTabs v-model="tab" mandatory direction="vertical" color="primary" density="compact">
|
|
45
|
+
<VTab
|
|
46
|
+
v-for="item of emojis"
|
|
47
|
+
:text="item.group"
|
|
48
|
+
:value="item.group"
|
|
49
|
+
:key="item.group"
|
|
50
|
+
density="compact"
|
|
51
|
+
rounded
|
|
52
|
+
size="small"
|
|
53
|
+
>
|
|
54
|
+
{{ t(`media.emoji.${item.group}`) }}
|
|
55
|
+
</VTab>
|
|
56
|
+
</VTabs>
|
|
57
|
+
|
|
58
|
+
<VWindow v-model="tab" direction="vertical">
|
|
59
|
+
<VWindowItem v-for="item of emojis" :value="item.group">
|
|
60
|
+
<div class="tiptapify-emoji-container">
|
|
61
|
+
<div v-for="emojiItem in item.emojis" class="tiptapify-emoji-container-item" @click="handleEmojiClick(emojiItem)" :title="emojiItem.name">
|
|
62
|
+
<div class="tiptapify-emoji-container-item__overlay">
|
|
63
|
+
<span>
|
|
64
|
+
{{ emojiItem.char }}
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</VWindowItem>
|
|
70
|
+
</VWindow>
|
|
71
|
+
</div>
|
|
72
|
+
</VSheet>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.tiptapify-emoji-container {
|
|
77
|
+
max-height: 500px;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
|
|
80
|
+
border: 1px solid #ddd;
|
|
81
|
+
border-radius: 8px;
|
|
82
|
+
filter: drop-shadow(1px 2px 3px #777);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tiptapify-emoji-container-item__overlay {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
align-items: center;
|
|
89
|
+
width: 32px;
|
|
90
|
+
height: 32px;
|
|
91
|
+
border-radius: 5px;
|
|
92
|
+
z-index: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.tiptapify-emoji-container-item {
|
|
96
|
+
position: relative;
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
width: 32px;
|
|
102
|
+
height: 32px;
|
|
103
|
+
transition: background-color 0.2s ease-in-out;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.tiptapify-emoji-container-item:hover .tiptapify-emoji-container-item__overlay {
|
|
107
|
+
background-color: rgba(var(--v-theme-on-background), calc(var(--v-hover-opacity) * var(--v-theme-overlay-multiplier)));
|
|
108
|
+
}
|
|
109
|
+
</style>
|