migrate from github

This commit is contained in:
2026-07-15 22:51:56 +08:00
commit a1cccc8068
215 changed files with 38318 additions and 0 deletions
@@ -0,0 +1,16 @@
/**
* Extract all unique mentioned user external IDs from the Tiptap editor state.
*
* @param {import('@tiptap/vue-3').Editor} editor
* @returns {string[]}
*/
export function extractMentionIds(editor) {
if (!editor) return [];
const ids = [];
editor.state.doc.descendants((node) => {
if (node.type.name === 'mention' && node.attrs.id) {
ids.push(node.attrs.id);
}
});
return [...new Set(ids)];
}