I managed to get the mention feature working in the editor (typing @ to mention someone). However, I canāt find a way to retrieve that mention data on the Bubble side.
Is there a plugin state, an exposed event, or some other way to detect āa mention was just createdā and get the mentioned userās data (ID/name) from it? I couldnāt find this documented anywhere.
The id and label correspond to the ID and label fields you configured for the mention list.
You can react to the editorās Content updated event and parse Content (JSON) on the Bubble side. That lets you retrieve all mentions, but detecting that a specific mention was just added currently requires comparing the new JSON with the previous value.
So the short answer is: the data is accessible today. For a clean dedicated event plus states for the newly created mention I would need to add that to the plugin.
I was actually trying to trigger a Bubble workflow whenever any mention got created, but Iāll go with comparing the Content (JSON) as you suggested instead.
While I have you, I have another question about the table of contents⦠It displays correctly on initial load, but when I dynamically switch the tiptap to different content, the table of contents disappears. Any idea why that might be happening, or how to get it to refresh when the content changes?
Thanks for the report. Would you mind sharing how youāve wired the Tiptap editor and the ToC? Is it autobinding or using a Collab provider? You can drop it here or a DM ā a video of you walking through it is best.
To answer your question: Iām not using autobinding or a Collab provider. My setup is simpler ā the Tiptap elementās Content field is directly bound to a dynamic data source where the search is filtered using a URL parameter : its just a live dynamic expression on the parent group, refreshed automatically whenever that URL parameter changes.
The ToC is wired directly to that same Tiptap elementās Table of Content (JSON), so in theory it should recompute whenever the Content changes(?)
That said, Iām wondering if this might just not be the intended way to feed dynamic content into the plugin ā happy to switch to a different pattern (e.g. an explicit workflow action to set/refresh the content) if thatās the recommended approach.
Your setup is supported. Initial content should react when its dynamic expression changes, provided auto-binding and collaboration are disabled.
The TOC was not being refreshed correctly after that programmatic content change. Iāve fixed this in v4.10.5. Please update the plugin and try it again.