mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Added TipTap Mention
This commit is contained in:
parent
a645d76b10
commit
e2e358c748
31
package-lock.json
generated
31
package-lock.json
generated
@ -16,6 +16,7 @@
|
|||||||
"@tiptap/core": "2.0.4",
|
"@tiptap/core": "2.0.4",
|
||||||
"@tiptap/extension-highlight": "2.0.4",
|
"@tiptap/extension-highlight": "2.0.4",
|
||||||
"@tiptap/extension-image": "2.0.4",
|
"@tiptap/extension-image": "2.0.4",
|
||||||
|
"@tiptap/extension-mention": "2.0.0",
|
||||||
"@tiptap/extension-placeholder": "2.0.4",
|
"@tiptap/extension-placeholder": "2.0.4",
|
||||||
"@tiptap/extension-underline": "2.0.4",
|
"@tiptap/extension-underline": "2.0.4",
|
||||||
"@tiptap/html": "2.0.4",
|
"@tiptap/html": "2.0.4",
|
||||||
@ -3398,6 +3399,21 @@
|
|||||||
"@tiptap/core": "^2.0.0"
|
"@tiptap/core": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@tiptap/extension-mention": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-mention/-/extension-mention-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-HN+MqyRA9E6pfO1Yck8qCINaXJh5+ypET4Iahp+6JGNih7coQ4oqeY+rsPJ2ksVv2VXWUpUWZblvBrluxjmLng==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/core": "^2.0.0",
|
||||||
|
"@tiptap/pm": "^2.0.0",
|
||||||
|
"@tiptap/suggestion": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@tiptap/extension-placeholder": {
|
"node_modules/@tiptap/extension-placeholder": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-2.0.4.tgz",
|
||||||
@ -3812,6 +3828,21 @@
|
|||||||
"prosemirror-view": "^1.33.8"
|
"prosemirror-view": "^1.33.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@tiptap/suggestion": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/suggestion/-/suggestion-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-U4POIQXKOJu/1a81W2A0COVx0ncAh9VxyMx3DkSZd/gPxjXbWIq1EKcb+TJOo+317fA9WVtWYKRCkFRMv5f24g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/core": "^2.0.0",
|
||||||
|
"@tiptap/pm": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@tootallnate/once": {
|
"node_modules/@tootallnate/once": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
"@tiptap/core": "2.0.4",
|
"@tiptap/core": "2.0.4",
|
||||||
"@tiptap/extension-highlight": "2.0.4",
|
"@tiptap/extension-highlight": "2.0.4",
|
||||||
"@tiptap/extension-image": "2.0.4",
|
"@tiptap/extension-image": "2.0.4",
|
||||||
|
"@tiptap/extension-mention": "2.0.0",
|
||||||
"@tiptap/extension-placeholder": "2.0.4",
|
"@tiptap/extension-placeholder": "2.0.4",
|
||||||
"@tiptap/extension-underline": "2.0.4",
|
"@tiptap/extension-underline": "2.0.4",
|
||||||
"@tiptap/html": "2.0.4",
|
"@tiptap/html": "2.0.4",
|
||||||
|
@ -15,6 +15,7 @@ import StarterKit from '@tiptap/starter-kit'
|
|||||||
import Underline from '@tiptap/extension-underline'
|
import Underline from '@tiptap/extension-underline'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import WebWorker from 'web-worker:./computePowWorker.js'
|
import WebWorker from 'web-worker:./computePowWorker.js'
|
||||||
import WebWorkerFile from 'web-worker:./computePowWorkerFile.js'
|
import WebWorkerFile from 'web-worker:./computePowWorkerFile.js'
|
||||||
import WebWorkerSortMessages from 'web-worker:./webworkerSortMessages.js'
|
import WebWorkerSortMessages from 'web-worker:./webworkerSortMessages.js'
|
||||||
@ -344,7 +345,7 @@ class ChatPage extends LitElement {
|
|||||||
}
|
}
|
||||||
${+this.repliedToMessageObj.version > 1 ?
|
${+this.repliedToMessageObj.version > 1 ?
|
||||||
html`
|
html`
|
||||||
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.repliedToMessageObj.message, [StarterKit, Underline, Highlight]))}</span>
|
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.repliedToMessageObj.message, [StarterKit, Underline, Highlight, Mention]))}</span>
|
||||||
`
|
`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
@ -361,7 +362,7 @@ class ChatPage extends LitElement {
|
|||||||
<vaadin-icon class="reply-icon" icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
<vaadin-icon class="reply-icon" icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
||||||
<div class="repliedTo-message">
|
<div class="repliedTo-message">
|
||||||
<p class="senderName">${translate("chatpage.cchange25")}</p>
|
<p class="senderName">${translate("chatpage.cchange25")}</p>
|
||||||
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.editedMessageObj.message, [StarterKit, Underline, Highlight]))}</span>
|
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.editedMessageObj.message, [StarterKit, Underline, Highlight, Mention]))}</span>
|
||||||
</div>
|
</div>
|
||||||
<vaadin-icon class="close-icon" icon="vaadin:close-big" slot="icon" @click=${() => this.closeEditMessageContainer()}></vaadin-icon>
|
<vaadin-icon class="close-icon" icon="vaadin:close-big" slot="icon" @click=${() => this.closeEditMessageContainer()}></vaadin-icon>
|
||||||
</div>
|
</div>
|
||||||
@ -1070,6 +1071,7 @@ class ChatPage extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: `${placeholderString}`
|
placeholder: `${placeholderString}`
|
||||||
}),
|
}),
|
||||||
@ -1108,6 +1110,7 @@ class ChatPage extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: `${placeholderString}`
|
placeholder: `${placeholderString}`
|
||||||
}),
|
}),
|
||||||
@ -1143,6 +1146,7 @@ class ChatPage extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: `${placeholderString}`
|
placeholder: `${placeholderString}`
|
||||||
}),
|
}),
|
||||||
@ -1178,6 +1182,7 @@ class ChatPage extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: `${placeholderString}`
|
placeholder: `${placeholderString}`
|
||||||
}),
|
}),
|
||||||
@ -1213,6 +1218,7 @@ class ChatPage extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: `${placeholderString}`
|
placeholder: `${placeholderString}`
|
||||||
}),
|
}),
|
||||||
|
@ -9,6 +9,7 @@ import { chatStyles } from './plugins-css'
|
|||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import ShortUniqueId from 'short-unique-id'
|
import ShortUniqueId from 'short-unique-id'
|
||||||
import StarterKit from '@tiptap/starter-kit'
|
import StarterKit from '@tiptap/starter-kit'
|
||||||
import Underline from '@tiptap/extension-underline'
|
import Underline from '@tiptap/extension-underline'
|
||||||
@ -1086,7 +1087,7 @@ class MessageTemplate extends LitElement {
|
|||||||
const parsedMessageObj = JSON.parse(this.messageObj.decodedMessage)
|
const parsedMessageObj = JSON.parse(this.messageObj.decodedMessage)
|
||||||
|
|
||||||
if (+parsedMessageObj.version > 1 && parsedMessageObj.messageText) {
|
if (+parsedMessageObj.version > 1 && parsedMessageObj.messageText) {
|
||||||
messageVersion2 = generateHTML(parsedMessageObj.messageText, [StarterKit, Underline, Highlight])
|
messageVersion2 = generateHTML(parsedMessageObj.messageText, [StarterKit, Underline, Highlight, Mention])
|
||||||
messageVersion2WithLink = processText(messageVersion2)
|
messageVersion2WithLink = processText(messageVersion2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1256,7 +1257,7 @@ class MessageTemplate extends LitElement {
|
|||||||
|
|
||||||
if (repliedToData && repliedToData.decodedMessage && repliedToData.decodedMessage.messageText) {
|
if (repliedToData && repliedToData.decodedMessage && repliedToData.decodedMessage.messageText) {
|
||||||
try {
|
try {
|
||||||
repliedToMessageText = generateHTML(repliedToData.decodedMessage.messageText, [StarterKit, Underline, Highlight])
|
repliedToMessageText = generateHTML(repliedToData.decodedMessage.messageText, [StarterKit, Underline, Highlight, Mention])
|
||||||
} catch (error) { /* empty */ }
|
} catch (error) { /* empty */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,7 +480,8 @@ class NodeManagement extends LitElement {
|
|||||||
updateMintingAccounts() {
|
updateMintingAccounts() {
|
||||||
this.mintingAccounts = []
|
this.mintingAccounts = []
|
||||||
parentEpml.request('apiCall', {
|
parentEpml.request('apiCall', {
|
||||||
url: `/admin/mintingaccounts`
|
url: `/admin/mintingaccounts?apiKey=${this.getApiKey()}`,
|
||||||
|
method: 'GET'
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.mintingAccounts = res
|
this.mintingAccounts = res
|
||||||
})
|
})
|
||||||
|
@ -19,6 +19,7 @@ import StarterKit from '@tiptap/starter-kit'
|
|||||||
import Underline from '@tiptap/extension-underline'
|
import Underline from '@tiptap/extension-underline'
|
||||||
import Placeholder from '@tiptap/extension-placeholder'
|
import Placeholder from '@tiptap/extension-placeholder'
|
||||||
import Highlight from '@tiptap/extension-highlight'
|
import Highlight from '@tiptap/extension-highlight'
|
||||||
|
import Mention from '@tiptap/extension-mention'
|
||||||
import ShortUniqueId from 'short-unique-id'
|
import ShortUniqueId from 'short-unique-id'
|
||||||
import snackbar from '../components/snackbar'
|
import snackbar from '../components/snackbar'
|
||||||
import '../components/ChatWelcomePage'
|
import '../components/ChatWelcomePage'
|
||||||
@ -577,6 +578,7 @@ class Chat extends LitElement {
|
|||||||
StarterKit,
|
StarterKit,
|
||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
|
Mention,
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: 'Write something …'
|
placeholder: 'Write something …'
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user