From d75df7a5c8ab365a4ef0de6c81c707e706433383 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Wed, 27 Mar 2024 19:32:33 +0100 Subject: [PATCH] fix: ensure heading-analyzer updates when content changes --- apps/demo/tsconfig.json | 1 + packages/plugin-heading-analyzer/package.json | 3 ++- packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/demo/tsconfig.json b/apps/demo/tsconfig.json index f9ece367c9..5820fe1849 100644 --- a/apps/demo/tsconfig.json +++ b/apps/demo/tsconfig.json @@ -5,6 +5,7 @@ "paths": { "@/core": ["../../packages/core"], "@/core/*": ["../../packages/core/*"], + "@measured/puck": ["../../packages/core"], "@/plugin-heading-analyzer": ["../../packages/plugin-heading-analyzer"], "@/plugin-heading-analyzer/*": [ "../../packages/plugin-heading-analyzer/*" diff --git a/packages/plugin-heading-analyzer/package.json b/packages/plugin-heading-analyzer/package.json index 30f7f8705d..1ba63bed0f 100644 --- a/packages/plugin-heading-analyzer/package.json +++ b/packages/plugin-heading-analyzer/package.json @@ -18,7 +18,7 @@ "dist" ], "devDependencies": { - "@measured/puck": "^0.13.1", + "@measured/puck": "*", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", "eslint": "^7.32.0", @@ -32,6 +32,7 @@ "react-from-json": "^0.8.0" }, "peerDependencies": { + "@measured/puck": "^0.13.1", "react": "^17.0.0 || ^18.0.0" } } diff --git a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx index af96174248..23e75c7dff 100644 --- a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx +++ b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx @@ -1,6 +1,6 @@ import { ReactElement, useEffect, useState } from "react"; -import { usePuck } from "@/core/lib/use-puck"; +import { usePuck } from "@measured/puck"; import { Plugin } from "@/core/types/Plugin"; import { SidebarSection } from "@/core/components/SidebarSection"; import { OutlineList } from "@/core/components/OutlineList"; @@ -107,7 +107,7 @@ export const HeadingAnalyzer = () => { } else { setHierarchy(buildHierarchy(frame)); } - }, [appState.data.content]); + }, [appState.data]); return ( <>