p.type === "doc" && p.id === props.pageId,
- );
+ let isOpen = openPages.some((p) => p.type === "doc" && p.id === props.pageId);
return (
{
e.preventDefault();
e.stopPropagation();
openPage(
- props.parentPageId ? { type: "doc", id: props.parentPageId } : undefined,
+ props.parentPageId
+ ? { type: "doc", id: props.parentPageId }
+ : undefined,
{ type: "doc", id: props.pageId },
{ scrollIntoView: false },
);
@@ -239,7 +241,9 @@ const Interactions = (props: { pageId: string; parentPageId?: string }) => {
e.preventDefault();
e.stopPropagation();
openPage(
- props.parentPageId ? { type: "doc", id: props.parentPageId } : undefined,
+ props.parentPageId
+ ? { type: "doc", id: props.parentPageId }
+ : undefined,
{ type: "doc", id: props.pageId },
{ scrollIntoView: false },
);
diff --git a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx b/app/lish/[did]/[publication]/[rkey]/Blocks/PublishedPollBlock.tsx
similarity index 98%
rename from app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx
rename to app/lish/[did]/[publication]/[rkey]/Blocks/PublishedPollBlock.tsx
index cab8f0f5..c552375b 100644
--- a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Blocks/PublishedPollBlock.tsx
@@ -9,12 +9,12 @@ import { useState, useEffect } from "react";
import { ButtonPrimary, ButtonSecondary } from "components/Buttons";
import { useIdentityData } from "components/IdentityProvider";
import { AtpAgent } from "@atproto/api";
-import { voteOnPublishedPoll } from "./voteOnPublishedPoll";
-import { PollData } from "./fetchPollData";
+import { voteOnPublishedPoll } from "../voteOnPublishedPoll";
+import { PollData } from "../fetchPollData";
import { Popover } from "components/Popover";
import LoginForm from "app/login/LoginForm";
import { BlueskyTiny } from "components/Icons/BlueskyTiny";
-import { getVoterIdentities, VoterIdentity } from "./getVoterIdentities";
+import { getVoterIdentities, VoterIdentity } from "../getVoterIdentities";
import { Json } from "supabase/database.types";
import { InfoSmall } from "components/Icons/InfoSmall";
diff --git a/app/lish/[did]/[publication]/[rkey]/StaticMathBlock.tsx b/app/lish/[did]/[publication]/[rkey]/Blocks/StaticMathBlock.tsx
similarity index 100%
rename from app/lish/[did]/[publication]/[rkey]/StaticMathBlock.tsx
rename to app/lish/[did]/[publication]/[rkey]/Blocks/StaticMathBlock.tsx
diff --git a/app/lish/[did]/[publication]/[rkey]/TextBlock.tsx b/app/lish/[did]/[publication]/[rkey]/Blocks/TextBlock.tsx
similarity index 94%
rename from app/lish/[did]/[publication]/[rkey]/TextBlock.tsx
rename to app/lish/[did]/[publication]/[rkey]/Blocks/TextBlock.tsx
index 20c765a1..56d28c64 100644
--- a/app/lish/[did]/[publication]/[rkey]/TextBlock.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Blocks/TextBlock.tsx
@@ -1,13 +1,14 @@
"use client";
import { UnicodeString } from "@atproto/api";
-import { PubLeafletRichtextFacet } from "lexicons/api";
+import { PubLeafletRichtextFacet, PubLeafletBlocksText } from "lexicons/api";
import { useMemo } from "react";
-import { useHighlight } from "./useHighlight";
+import { useHighlight } from "../useHighlight";
import { BaseTextBlock } from "./BaseTextBlock";
type Facet = PubLeafletRichtextFacet.Main;
export function TextBlock(props: {
plaintext: string;
+ textSize?: PubLeafletBlocksText.Main["textSize"];
facets?: Facet[];
index: number[];
preview?: boolean;
diff --git a/app/lish/[did]/[publication]/[rkey]/TextBlockCore.tsx b/app/lish/[did]/[publication]/[rkey]/Blocks/TextBlockCore.tsx
similarity index 100%
rename from app/lish/[did]/[publication]/[rkey]/TextBlockCore.tsx
rename to app/lish/[did]/[publication]/[rkey]/Blocks/TextBlockCore.tsx
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
index b848aa3f..4e27693e 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
@@ -5,7 +5,7 @@ import { useIdentityData } from "components/IdentityProvider";
import { CommentBox } from "./CommentBox";
import { Json } from "supabase/database.types";
import { PubLeafletComment } from "lexicons/api";
-import { BaseTextBlock } from "../../BaseTextBlock";
+import { BaseTextBlock } from "../../Blocks/BaseTextBlock";
import { useMemo, useState } from "react";
import { CommentTiny } from "components/Icons/CommentTiny";
import { Separator } from "components/Layout";
diff --git a/app/lish/[did]/[publication]/[rkey]/PostContent.tsx b/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
index 40a341c8..06beadd0 100644
--- a/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
@@ -20,18 +20,18 @@ import {
} from "lexicons/api";
import { blobRefToSrc } from "src/utils/blobRefToSrc";
-import { TextBlock } from "./TextBlock";
+import { TextBlock } from "./Blocks/TextBlock";
import { Popover } from "components/Popover";
import { theme } from "tailwind.config";
import { ImageAltSmall } from "components/Icons/ImageAlt";
-import { StaticMathBlock } from "./StaticMathBlock";
-import { PubCodeBlock } from "./PubCodeBlock";
+import { StaticMathBlock } from "./Blocks/StaticMathBlock";
+import { PubCodeBlock } from "./Blocks/PubCodeBlock";
import { AppBskyFeedDefs } from "@atproto/api";
-import { PubBlueskyPostBlock } from "./PublishBskyPostBlock";
+import { PubBlueskyPostBlock } from "./Blocks/PublishBskyPostBlock";
import { openPage } from "./PostPages";
import { PageLinkBlock } from "components/Blocks/PageLinkBlock";
-import { PublishedPageLinkBlock } from "./PublishedPageBlock";
-import { PublishedPollBlock } from "./PublishedPollBlock";
+import { PublishedPageLinkBlock } from "./Blocks/PublishedPageBlock";
+import { PublishedPollBlock } from "./Blocks/PublishedPollBlock";
import { PollData } from "./fetchPollData";
import { ButtonPrimary } from "components/Buttons";
@@ -173,7 +173,13 @@ export let Block = ({
let uri = b.block.postRef.uri;
let post = bskyPostData.find((p) => p.uri === uri);
if (!post) return
no prefetched post rip
;
- return
;
+ return (
+
+ );
}
case PubLeafletBlocksIframe.isMain(b.block): {
return (
diff --git a/app/lish/[did]/[publication]/[rkey]/StaticPostContent.tsx b/app/lish/[did]/[publication]/[rkey]/StaticPostContent.tsx
index 009ac855..1f25bbba 100644
--- a/app/lish/[did]/[publication]/[rkey]/StaticPostContent.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/StaticPostContent.tsx
@@ -12,8 +12,8 @@ import {
PubLeafletPagesLinearDocument,
} from "lexicons/api";
import { blobRefToSrc } from "src/utils/blobRefToSrc";
-import { TextBlockCore, TextBlockCoreProps } from "./TextBlockCore";
-import { StaticMathBlock } from "./StaticMathBlock";
+import { TextBlockCore, TextBlockCoreProps } from "./Blocks/TextBlockCore";
+import { StaticMathBlock } from "./Blocks/StaticMathBlock";
import { codeToHtml, bundledLanguagesInfo, bundledThemesInfo } from "shiki";
function StaticBaseTextBlock(props: Omit
) {
diff --git a/components/Toolbar/TextBlockTypeToolbar.tsx b/components/Toolbar/TextBlockTypeToolbar.tsx
index c3af36ee..931edc6a 100644
--- a/components/Toolbar/TextBlockTypeToolbar.tsx
+++ b/components/Toolbar/TextBlockTypeToolbar.tsx
@@ -114,7 +114,7 @@ export const TextBlockTypeToolbar = (props: {
>
-
+
{