@anthusai/papyrus 1.4.0-next.2 → 1.4.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ import { PresentationFooter } from "../../components/presentation-footer";
13
13
  import { PresentationHeader } from "../../components/presentation-header";
14
14
  import { useBlogHeaderObstacles } from "../../components/use-blog-header-obstacles";
15
15
  import { useRhythmOverlay } from "../../components/use-rhythm-overlay";
16
+ import { useMeasuredWidth } from "./presentation-shared";
16
17
  import { BLOG_RHYTHM, getFeaturedLayoutStyle, getRhythmShellStyle } from "./rhythm-shell-style";
17
18
 
18
19
  const BlogPageBackground = SITE_BRAND.components?.BlogPageBackground ?? GenericBlogPageBackground;
@@ -135,24 +136,6 @@ export function RhythmArticlePage({
135
136
  );
136
137
  }
137
138
 
138
- function useMeasuredWidth(ref: RefObject<HTMLElement | null>): number {
139
- const [width, setWidth] = useState(0);
140
- useEffect(() => {
141
- const node = ref.current;
142
- if (!node) return;
143
- const update = () => setWidth(Math.max(1, Math.floor(node.getBoundingClientRect().width)));
144
- update();
145
- const observer = new ResizeObserver(update);
146
- observer.observe(node);
147
- window.addEventListener("resize", update);
148
- return () => {
149
- observer.disconnect();
150
- window.removeEventListener("resize", update);
151
- };
152
- }, [ref]);
153
- return width;
154
- }
155
-
156
139
  function useViewportWidth(): number {
157
140
  const [width, setWidth] = useState(0);
158
141
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.0-next.2",
2
+ "version": "1.4.0-next.4",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",