Files
huly-platform/packages/presentation/src/components/MessageViewer.svelte
T
Anton AlexeyevandGitHub ab0ee7388d Emoji improvements (#9730)
* Add Noto Color emojis

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Fix custom emojis in the new chat

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Rollback unnecessary changes

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Fix return type

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Load emoji function in the top level component

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Fix detection of messages with emojis only

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Fix formatting

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

* Move parseEmojisFunction to the plugin

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>

---------

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
2025-09-09 12:34:38 +07:00

42 lines
1.4 KiB
Svelte

<!--
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021, 2024 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { isEmptyMarkup, markupToJSON } from '@hcengineering/text'
import Node from './markup/Node.svelte'
import { loadParseEmojisFunction, ParsedTextWithEmojis } from '@hcengineering/emoji'
import { onMount } from 'svelte'
export let message: string
export let preview = false
$: node = markupToJSON(message)
$: empty = isEmptyMarkup(message)
let parseEmojisFunction: ((text: string) => ParsedTextWithEmojis) | undefined = undefined
onMount(async () => {
parseEmojisFunction = await loadParseEmojisFunction()
})
export function isEmpty (): boolean {
return empty
}
</script>
<div class="text-markup-view">
<Node {parseEmojisFunction} {node} {preview} />
</div>