feat: package updates (#2300)

* package updates
* update tiptap
* fix editor crash
* fix
* update list
* fix(theme): size badges to their content
* fix mantine avatar color regression
This commit is contained in:
Philip Okugbe
2026-06-20 18:11:14 +01:00
committed by GitHub
parent d7fdcdec80
commit 4f202e4ab5
26 changed files with 993 additions and 1199 deletions
@@ -50,6 +50,7 @@ export const TableOfContents: FC<TableOfContentsProps> = (props) => {
const headerPaddingRef = useRef<HTMLDivElement | null>(null);
const handleScrollToHeading = (position: number) => {
if (!props.editor || props.editor.isDestroyed) return;
const { view } = props.editor;
const headerOffset = parseInt(
@@ -73,16 +74,21 @@ export const TableOfContents: FC<TableOfContentsProps> = (props) => {
};
const handleUpdate = () => {
const result = recalculateLinks(props.editor?.$nodes("heading"));
if (!props.editor || props.editor.isDestroyed) return;
const result = recalculateLinks(props.editor.$nodes("heading"));
setLinks(result.links);
setHeadingDOMNodes(result.nodes);
};
useEffect(() => {
// "create" repopulates once the editor view mounts after this component
props.editor?.on("create", handleUpdate);
props.editor?.on("update", handleUpdate);
return () => {
props.editor?.off("create", handleUpdate);
props.editor?.off("update", handleUpdate);
};
}, [props.editor]);