Skip to content

Commit 5ca3efe

Browse files
committed
fix: types
1 parent 9d8d2b9 commit 5ca3efe

File tree

5 files changed

+0
-94
lines changed

5 files changed

+0
-94
lines changed

components/command/CommandPanel.vue

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const searchResult = computed<QueryResult>(() => {
4545
const accountList = accounts.value.map(toSearchQueryResultItem)
4646
4747
const grouped: QueryResult['grouped'] = new Map()
48-
grouped.set('Hashtags', hashtagList)
4948
grouped.set('Users', accountList)
5049
5150
let index = 0

components/publish/PublishEmojiPicker.client.vue

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async function openEmojiPicker() {
1717
if (picker.value) {
1818
picker.value.update({
1919
theme: colorMode,
20-
custom: customEmojisData.value,
2120
})
2221
}
2322
else {
@@ -37,7 +36,6 @@ async function openEmojiPicker() {
3736
},
3837
set: 'twitter',
3938
theme: colorMode,
40-
custom: customEmojisData.value,
4139
i18n,
4240
})
4341
}

composables/content-parse.ts

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export function parseMastodonHTML(
140140
/**
141141
* Converts raw HTML form Mastodon server to HTML for Tiptap editor
142142
* @param html The content to parse
143-
* @param customEmojis The custom emojis to use
144143
*/
145144
export function convertMastodonHTML(html: string) {
146145
const tree = parseMastodonHTML(html, {

composables/tiptap.ts

-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Text from '@tiptap/extension-text'
1313
import { Extension, useEditor } from '@tiptap/vue-3'
1414

1515
import { Plugin } from 'prosemirror-state'
16-
// import { TiptapPluginCustomEmoji } from './tiptap/custom-emoji'
1716
import { TiptapPluginEmoji } from './tiptap/emoji'
1817
import { TiptapPluginCodeBlockShiki } from './tiptap/shiki'
1918
import { TiptapEmojiSuggestion, TiptapHashtagSuggestion, TiptapMentionSuggestion } from './tiptap/suggestion'
@@ -48,14 +47,6 @@ export function useTiptap(options: UseTiptapOptions) {
4847
Code,
4948
Text,
5049
TiptapPluginEmoji,
51-
/*
52-
TiptapPluginCustomEmoji.configure({
53-
inline: true,
54-
HTMLAttributes: {
55-
class: 'custom-emoji',
56-
},
57-
}),
58-
*/
5950
Mention.configure({
6051
renderHTML({ options, node }) {
6152
return ['span', { 'data-type': 'mention', 'data-id': node.attrs.id }, `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`]

composables/tiptap/custom-emoji.ts

-81
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import {
2-
mergeAttributes,
3-
Node,
4-
nodeInputRule,
5-
} from '@tiptap/core'
6-
71
export interface EmojiOptions {
82
inline: boolean
93
allowBase64: boolean
@@ -20,78 +14,3 @@ declare module '@tiptap/core' {
2014
}
2115
}
2216
}
23-
24-
const inputRegex = /(?:^|\s)(!\[(.+|:?)\]\((\S+)(?:\s+["'](\S+)["'])?\))$/
25-
26-
export const TiptapPluginCustomEmoji = Node.create<EmojiOptions>({
27-
name: 'custom-emoji',
28-
29-
addOptions() {
30-
return {
31-
inline: false,
32-
allowBase64: false,
33-
HTMLAttributes: {},
34-
}
35-
},
36-
37-
inline() {
38-
return this.options.inline
39-
},
40-
41-
group() {
42-
return this.options.inline ? 'inline' : 'block'
43-
},
44-
45-
draggable: false,
46-
47-
addAttributes() {
48-
return {
49-
'src': {
50-
default: null,
51-
},
52-
'alt': {
53-
default: null,
54-
},
55-
'title': {
56-
default: null,
57-
},
58-
'width': {
59-
default: null,
60-
},
61-
'height': {
62-
default: null,
63-
},
64-
'data-emoji-id': {
65-
default: null,
66-
},
67-
}
68-
},
69-
70-
parseHTML() {
71-
return [
72-
{
73-
tag: this.options.allowBase64
74-
? 'img[src]'
75-
: 'img[src]:not([src^="data:"])',
76-
},
77-
]
78-
},
79-
80-
renderHTML({ HTMLAttributes }) {
81-
return ['img', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]
82-
},
83-
84-
addInputRules() {
85-
return [
86-
nodeInputRule({
87-
find: inputRegex,
88-
type: this.type,
89-
getAttributes: (match) => {
90-
const [,, alt, src, title] = match
91-
92-
return { src, alt, title }
93-
},
94-
}),
95-
]
96-
},
97-
})

0 commit comments

Comments
 (0)