diff --git a/package-lock.json b/package-lock.json index e953bc91d..650e76cf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@mediapipe/tasks-vision": "^0.10.17", "@pyscript/core": "^0.4.32", "@sveltejs/adapter-node": "^2.0.0", + "@sveltejs/svelte-virtual-list": "^3.0.1", "@tiptap/core": "^2.10.0", "@tiptap/extension-code-block-lowlight": "^2.10.0", "@tiptap/extension-highlight": "^2.10.0", @@ -2291,6 +2292,12 @@ "vite": "^5.0.3 || ^6.0.0" } }, + "node_modules/@sveltejs/svelte-virtual-list": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/svelte-virtual-list/-/svelte-virtual-list-3.0.1.tgz", + "integrity": "sha512-aF9TptS7NKKS7/TqpsxQBSDJ9Q0XBYzBehCeIC5DzdMEgrJZpIYao9LRLnyyo6SVodpapm2B7FE/Lj+FSA5/SQ==", + "license": "LIL" + }, "node_modules/@sveltejs/vite-plugin-svelte": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.1.tgz", diff --git a/package.json b/package.json index 71de337da..63ac8800c 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@mediapipe/tasks-vision": "^0.10.17", "@pyscript/core": "^0.4.32", "@sveltejs/adapter-node": "^2.0.0", + "@sveltejs/svelte-virtual-list": "^3.0.1", "@tiptap/core": "^2.10.0", "@tiptap/extension-code-block-lowlight": "^2.10.0", "@tiptap/extension-highlight": "^2.10.0", diff --git a/src/lib/components/channel/Messages/Message/ReactionPicker.svelte b/src/lib/components/channel/Messages/Message/ReactionPicker.svelte index 2af7c6409..2453b2dbf 100644 --- a/src/lib/components/channel/Messages/Message/ReactionPicker.svelte +++ b/src/lib/components/channel/Messages/Message/ReactionPicker.svelte @@ -1,63 +1,97 @@ - - - - - -
- -
-
- {#if show} -
- {#if Object.keys(emojis).length === 0} -
No results
- {:else} - {#each Object.keys(emojiGroups) as group (group)} - {@const groupEmojis = emojiGroups[group].filter((emoji) => emojis[emoji])} - {#if groupEmojis.length > 0} -
-
- {group} -
- -
- {#each groupEmojis as emoji (emoji)} - `:${code}:`) - .join(', ')} - placement="top" - > - - - {/each} -
-
- {/if} - {/each} - {/if} -
- {/if} -
-
-
+ +
+ +
+ +
+ {#if emojiRows.length === 0} +
No results
+ {:else} +
+ +
+ {#if item.length === 1 && item[0].type === 'group'} + +
+ {item[0].label} +
+ {:else} + +
+ {#each item as emojiItem} + `:${code}:`).join(', ')} + placement="top" + > + + + {/each} +
+ {/if} +
+
+
+ {/if} +
+