fix: prevent user from subscribing to own publication #1

Changed files
+3339 -6441
actions
app
appview
components
feeds
lexicons
api
types
pub
leaflet
pub
leaflet
src
src
supabase
-6
actions/createPublicationDraft.ts
···
redirectUser: false,
firstBlockType: "text",
});
-
let { data: publication } = await supabaseServerClient
-
.from("publications")
-
.select("*")
-
.eq("uri", publication_uri)
-
.single();
-
if (publication?.identity_did !== identity.atp_did) return;
await supabaseServerClient
.from("leaflets_in_publications")
-71
actions/deleteLeaflet.ts
···
"use server";
-
import { refresh } from "next/cache";
import { drizzle } from "drizzle-orm/node-postgres";
import {
···
import { eq } from "drizzle-orm";
import { PermissionToken } from "src/replicache";
import { pool } from "supabase/pool";
-
import { getIdentityData } from "./getIdentityData";
-
import { supabaseServerClient } from "supabase/serverClient";
export async function deleteLeaflet(permission_token: PermissionToken) {
const client = await pool.connect();
···
.where(eq(permission_tokens.id, permission_token.id));
});
client.release();
-
-
refresh();
-
return;
-
}
-
-
export async function archivePost(token: string) {
-
let identity = await getIdentityData();
-
if (!identity) throw new Error("No Identity");
-
-
// Archive on homepage
-
await supabaseServerClient
-
.from("permission_token_on_homepage")
-
.update({ archived: true })
-
.eq("token", token)
-
.eq("identity", identity.id);
-
-
// Check if leaflet is in any publications where user is the creator
-
let { data: leafletInPubs } = await supabaseServerClient
-
.from("leaflets_in_publications")
-
.select("publication, publications!inner(identity_did)")
-
.eq("leaflet", token);
-
-
if (leafletInPubs) {
-
for (let pub of leafletInPubs) {
-
if (pub.publications.identity_did === identity.atp_did) {
-
await supabaseServerClient
-
.from("leaflets_in_publications")
-
.update({ archived: true })
-
.eq("leaflet", token)
-
.eq("publication", pub.publication);
-
}
-
}
-
}
-
-
refresh();
-
return;
-
}
-
-
export async function unarchivePost(token: string) {
-
let identity = await getIdentityData();
-
if (!identity) throw new Error("No Identity");
-
-
// Unarchive on homepage
-
await supabaseServerClient
-
.from("permission_token_on_homepage")
-
.update({ archived: false })
-
.eq("token", token)
-
.eq("identity", identity.id);
-
-
// Check if leaflet is in any publications where user is the creator
-
let { data: leafletInPubs } = await supabaseServerClient
-
.from("leaflets_in_publications")
-
.select("publication, publications!inner(identity_did)")
-
.eq("leaflet", token);
-
-
if (leafletInPubs) {
-
for (let pub of leafletInPubs) {
-
if (pub.publications.identity_did === identity.atp_did) {
-
await supabaseServerClient
-
.from("leaflets_in_publications")
-
.update({ archived: false })
-
.eq("leaflet", token)
-
.eq("publication", pub.publication);
-
}
-
}
-
}
-
-
refresh();
return;
}
-2
actions/getIdentityData.ts
···
entity_sets(entities(facts(*)))
)),
permission_token_on_homepage(
-
archived,
created_at,
permission_tokens!inner(
id,
root_entity,
permission_token_rights(*),
-
leaflets_to_documents(*, documents(*)),
leaflets_in_publications(*, publications(*), documents(*))
)
)
-33
actions/publications/moveLeafletToPublication.ts
···
-
"use server";
-
-
import { getIdentityData } from "actions/getIdentityData";
-
import { supabaseServerClient } from "supabase/serverClient";
-
-
export async function moveLeafletToPublication(
-
leaflet_id: string,
-
publication_uri: string,
-
metadata: { title: string; description: string },
-
entitiesToDelete: string[],
-
) {
-
let identity = await getIdentityData();
-
if (!identity || !identity.atp_did) return null;
-
let { data: publication } = await supabaseServerClient
-
.from("publications")
-
.select("*")
-
.eq("uri", publication_uri)
-
.single();
-
if (publication?.identity_did !== identity.atp_did) return;
-
-
await supabaseServerClient.from("leaflets_in_publications").insert({
-
publication: publication_uri,
-
leaflet: leaflet_id,
-
doc: null,
-
title: metadata.title,
-
description: metadata.description,
-
});
-
-
await supabaseServerClient
-
.from("entities")
-
.delete()
-
.in("id", entitiesToDelete);
-
}
+26
actions/publications/updateLeafletDraftMetadata.ts
···
+
"use server";
+
+
import { getIdentityData } from "actions/getIdentityData";
+
import { supabaseServerClient } from "supabase/serverClient";
+
+
export async function updateLeafletDraftMetadata(
+
leafletID: string,
+
publication_uri: string,
+
title: string,
+
description: string,
+
) {
+
let identity = await getIdentityData();
+
if (!identity?.atp_did) return null;
+
let { data: publication } = await supabaseServerClient
+
.from("publications")
+
.select()
+
.eq("uri", publication_uri)
+
.single();
+
if (!publication || publication.identity_did !== identity.atp_did)
+
return null;
+
await supabaseServerClient
+
.from("leaflets_in_publications")
+
.update({ title, description })
+
.eq("leaflet", leafletID)
+
.eq("publication", publication_uri);
+
}
+51 -204
actions/publishToPublication.ts
···
import { List, parseBlocksToList } from "src/utils/parseBlocksToList";
import { getBlocksWithTypeLocal } from "src/hooks/queries/useBlocks";
import { Lock } from "src/utils/lock";
-
import type { PubLeafletPublication } from "lexicons/api";
-
import {
-
ColorToRGB,
-
ColorToRGBA,
-
} from "components/ThemeManager/colorToLexicons";
-
import { parseColor } from "@react-stately/color";
export async function publishToPublication({
root_entity,
···
leaflet_id,
title,
description,
-
entitiesToDelete,
}: {
root_entity: string;
-
publication_uri?: string;
+
publication_uri: string;
leaflet_id: string;
title?: string;
description?: string;
-
entitiesToDelete?: string[];
}) {
const oauthClient = await createOauthClient();
let identity = await getIdentityData();
···
let agent = new AtpBaseClient(
credentialSession.fetchHandler.bind(credentialSession),
);
-
-
// Check if we're publishing to a publication or standalone
-
let draft: any = null;
-
let existingDocUri: string | null = null;
-
-
if (publication_uri) {
-
// Publishing to a publication - use leaflets_in_publications
-
let { data, error } = await supabaseServerClient
-
.from("publications")
-
.select("*, leaflets_in_publications(*, documents(*))")
-
.eq("uri", publication_uri)
-
.eq("leaflets_in_publications.leaflet", leaflet_id)
-
.single();
-
console.log(error);
-
-
if (!data || identity.atp_did !== data?.identity_did)
-
throw new Error("No draft or not publisher");
-
draft = data.leaflets_in_publications[0];
-
existingDocUri = draft?.doc;
-
} else {
-
// Publishing standalone - use leaflets_to_documents
-
let { data } = await supabaseServerClient
-
.from("leaflets_to_documents")
-
.select("*, documents(*)")
-
.eq("leaflet", leaflet_id)
-
.single();
-
draft = data;
-
existingDocUri = draft?.document;
-
}
-
-
// Heuristic: Remove title entities if this is the first time publishing
-
// (when coming from a standalone leaflet with entitiesToDelete passed in)
-
if (entitiesToDelete && entitiesToDelete.length > 0 && !existingDocUri) {
-
await supabaseServerClient
-
.from("entities")
-
.delete()
-
.in("id", entitiesToDelete);
-
}
-
+
let { data: draft } = await supabaseServerClient
+
.from("leaflets_in_publications")
+
.select("*, publications(*), documents(*)")
+
.eq("publication", publication_uri)
+
.eq("leaflet", leaflet_id)
+
.single();
+
if (!draft || identity.atp_did !== draft?.publications?.identity_did)
+
throw new Error("No draft or not publisher");
let { data } = await supabaseServerClient.rpc("get_facts", {
root: root_entity,
});
let facts = (data as unknown as Fact<Attribute>[]) || [];
-
let { pages } = await processBlocksToPages(
+
let { firstPageBlocks, pages } = await processBlocksToPages(
facts,
agent,
root_entity,
···
let existingRecord =
(draft?.documents?.data as PubLeafletDocument.Record | undefined) || {};
-
-
// Extract theme for standalone documents (not for publications)
-
let theme: PubLeafletPublication.Theme | undefined;
-
if (!publication_uri) {
-
theme = await extractThemeFromFacts(facts, root_entity, agent);
-
}
-
let record: PubLeafletDocument.Record = {
-
publishedAt: new Date().toISOString(),
-
...existingRecord,
$type: "pub.leaflet.document",
author: credentialSession.did!,
-
...(publication_uri && { publication: publication_uri }),
-
...(theme && { theme }),
+
publication: publication_uri,
+
publishedAt: new Date().toISOString(),
+
...existingRecord,
title: title || "Untitled",
description: description || "",
-
pages: pages.map((p) => {
-
if (p.type === "canvas") {
-
return {
-
$type: "pub.leaflet.pages.canvas" as const,
-
id: p.id,
-
blocks: p.blocks as PubLeafletPagesCanvas.Block[],
-
};
-
} else {
-
return {
-
$type: "pub.leaflet.pages.linearDocument" as const,
-
id: p.id,
-
blocks: p.blocks as PubLeafletPagesLinearDocument.Block[],
-
};
-
}
-
}),
+
pages: [
+
{
+
$type: "pub.leaflet.pages.linearDocument",
+
blocks: firstPageBlocks,
+
},
+
...pages.map((p) => {
+
if (p.type === "canvas") {
+
return {
+
$type: "pub.leaflet.pages.canvas" as const,
+
id: p.id,
+
blocks: p.blocks as PubLeafletPagesCanvas.Block[],
+
};
+
} else {
+
return {
+
$type: "pub.leaflet.pages.linearDocument" as const,
+
id: p.id,
+
blocks: p.blocks as PubLeafletPagesLinearDocument.Block[],
+
};
+
}
+
}),
+
],
};
-
-
// Keep the same rkey if updating an existing document
-
let rkey = existingDocUri ? new AtUri(existingDocUri).rkey : TID.nextStr();
+
let rkey = draft?.doc ? new AtUri(draft.doc).rkey : TID.nextStr();
let { data: result } = await agent.com.atproto.repo.putRecord({
rkey,
repo: credentialSession.did!,
···
validate: false, //TODO publish the lexicon so we can validate!
});
-
// Optimistically create database entries
await supabaseServerClient.from("documents").upsert({
uri: result.uri,
data: record as Json,
});
-
-
if (publication_uri) {
-
// Publishing to a publication - update both tables
-
await Promise.all([
-
supabaseServerClient.from("documents_in_publications").upsert({
-
publication: publication_uri,
-
document: result.uri,
-
}),
-
supabaseServerClient.from("leaflets_in_publications").upsert({
+
await Promise.all([
+
//Optimistically put these in!
+
supabaseServerClient.from("documents_in_publications").upsert({
+
publication: record.publication,
+
document: result.uri,
+
}),
+
supabaseServerClient
+
.from("leaflets_in_publications")
+
.update({
doc: result.uri,
-
leaflet: leaflet_id,
-
publication: publication_uri,
-
title: title,
-
description: description,
-
}),
-
]);
-
} else {
-
// Publishing standalone - update leaflets_to_documents
-
await supabaseServerClient.from("leaflets_to_documents").upsert({
-
leaflet: leaflet_id,
-
document: result.uri,
-
title: title || "Untitled",
-
description: description || "",
-
});
-
-
// Heuristic: Remove title entities if this is the first time publishing standalone
-
// (when entitiesToDelete is provided and there's no existing document)
-
if (entitiesToDelete && entitiesToDelete.length > 0 && !existingDocUri) {
-
await supabaseServerClient
-
.from("entities")
-
.delete()
-
.in("id", entitiesToDelete);
-
}
-
}
+
})
+
.eq("leaflet", leaflet_id)
+
.eq("publication", publication_uri),
+
]);
return { rkey, record: JSON.parse(JSON.stringify(record)) };
}
···
let firstEntity = scan.eav(root_entity, "root/page")?.[0];
if (!firstEntity) throw new Error("No root page");
-
-
// Check if the first page is a canvas or linear document
-
let [pageType] = scan.eav(firstEntity.data.value, "page/type");
-
-
if (pageType?.data.value === "canvas") {
-
// First page is a canvas
-
let canvasBlocks = await canvasBlocksToRecord(firstEntity.data.value, did);
-
pages.unshift({
-
id: firstEntity.data.value,
-
blocks: canvasBlocks,
-
type: "canvas",
-
});
-
} else {
-
// First page is a linear document
-
let blocks = getBlocksWithTypeLocal(facts, firstEntity?.data.value);
-
let b = await blocksToRecord(blocks, did);
-
pages.unshift({
-
id: firstEntity.data.value,
-
blocks: b,
-
type: "doc",
-
});
-
}
-
-
return { pages };
+
let blocks = getBlocksWithTypeLocal(facts, firstEntity?.data.value);
+
let b = await blocksToRecord(blocks, did);
+
return { firstPageBlocks: b, pages };
async function uploadImage(src: string) {
let data = await fetch(src);
···
? never
: T /* maybe literal, not the whole `string` */
: T; /* not a string */
-
-
async function extractThemeFromFacts(
-
facts: Fact<any>[],
-
root_entity: string,
-
agent: AtpBaseClient,
-
): Promise<PubLeafletPublication.Theme | undefined> {
-
let scan = scanIndexLocal(facts);
-
let pageBackground = scan.eav(root_entity, "theme/page-background")?.[0]?.data
-
.value;
-
let cardBackground = scan.eav(root_entity, "theme/card-background")?.[0]?.data
-
.value;
-
let primary = scan.eav(root_entity, "theme/primary")?.[0]?.data.value;
-
let accentBackground = scan.eav(root_entity, "theme/accent-background")?.[0]
-
?.data.value;
-
let accentText = scan.eav(root_entity, "theme/accent-text")?.[0]?.data.value;
-
let showPageBackground = !scan.eav(
-
root_entity,
-
"theme/card-border-hidden",
-
)?.[0]?.data.value;
-
let backgroundImage = scan.eav(root_entity, "theme/background-image")?.[0];
-
let backgroundImageRepeat = scan.eav(
-
root_entity,
-
"theme/background-image-repeat",
-
)?.[0];
-
-
let theme: PubLeafletPublication.Theme = {
-
showPageBackground: showPageBackground ?? true,
-
};
-
-
if (pageBackground)
-
theme.backgroundColor = ColorToRGBA(parseColor(`hsba(${pageBackground})`));
-
if (cardBackground)
-
theme.pageBackground = ColorToRGBA(parseColor(`hsba(${cardBackground})`));
-
if (primary) theme.primary = ColorToRGB(parseColor(`hsba(${primary})`));
-
if (accentBackground)
-
theme.accentBackground = ColorToRGB(
-
parseColor(`hsba(${accentBackground})`),
-
);
-
if (accentText)
-
theme.accentText = ColorToRGB(parseColor(`hsba(${accentText})`));
-
-
// Upload background image if present
-
if (backgroundImage?.data) {
-
let imageData = await fetch(backgroundImage.data.src);
-
if (imageData.status === 200) {
-
let binary = await imageData.blob();
-
let blob = await agent.com.atproto.repo.uploadBlob(binary, {
-
headers: { "Content-Type": binary.type },
-
});
-
-
theme.backgroundImage = {
-
$type: "pub.leaflet.theme.backgroundImage",
-
image: blob.data.blob,
-
repeat: backgroundImageRepeat?.data.value ? true : false,
-
...(backgroundImageRepeat?.data.value && {
-
width: backgroundImageRepeat.data.value,
-
}),
-
};
-
}
-
}
-
-
// Only return theme if at least one property is set
-
if (Object.keys(theme).length > 1 || theme.showPageBackground !== true) {
-
return theme;
-
}
-
-
return undefined;
-
}
+1 -1
actions/subscriptions/sendPostToSubscribers.ts
···
) {
return;
}
-
let domain = await getCurrentDeploymentDomain();
+
let domain = getCurrentDeploymentDomain();
let res = await fetch("https://api.postmarkapp.com/email/batch", {
method: "POST",
headers: {
+1 -1
app/(home-pages)/discover/PubListing.tsx
···
},
) => {
let record = props.record as PubLeafletPublication.Record;
-
let theme = usePubTheme(record.theme);
+
let theme = usePubTheme(record);
let backgroundImage = record?.theme?.backgroundImage?.image?.ref
? blobRefToSrc(
record?.theme?.backgroundImage?.image?.ref,
+2 -1
app/(home-pages)/home/Actions/Actions.tsx
···
"use client";
import { ThemePopover } from "components/ThemeManager/ThemeSetter";
import { CreateNewLeafletButton } from "./CreateNewButton";
-
import { HelpButton } from "app/[leaflet_id]/actions/HelpButton";
+
import { HelpPopover } from "components/HelpPopover";
import { AccountSettings } from "./AccountSettings";
import { useIdentityData } from "components/IdentityProvider";
import { useReplicache } from "src/replicache";
···
) : (
<LoginActionButton />
)}
+
<HelpPopover />
</>
);
};
+48
app/(home-pages)/home/Actions/CreateNewButton.tsx
···
"use client";
import { createNewLeaflet } from "actions/createNewLeaflet";
+
import { createNewLeafletFromTemplate } from "actions/createNewLeafletFromTemplate";
import { ActionButton } from "components/ActionBar/ActionButton";
import { AddTiny } from "components/Icons/AddTiny";
import { BlockCanvasPageSmall } from "components/Icons/BlockCanvasPageSmall";
import { BlockDocPageSmall } from "components/Icons/BlockDocPageSmall";
+
import { TemplateSmall } from "components/Icons/TemplateSmall";
import { Menu, MenuItem } from "components/Layout";
import { useIsMobile } from "src/hooks/isMobile";
+
import { create } from "zustand";
+
import { combine, createJSONStorage, persist } from "zustand/middleware";
+
export const useTemplateState = create(
+
persist(
+
combine(
+
{
+
templates: [] as { id: string; name: string }[],
+
},
+
(set) => ({
+
removeTemplate: (template: { id: string }) =>
+
set((state) => {
+
return {
+
templates: state.templates.filter((t) => t.id !== template.id),
+
};
+
}),
+
addTemplate: (template: { id: string; name: string }) =>
+
set((state) => {
+
if (state.templates.find((t) => t.id === template.id)) return state;
+
return { templates: [...state.templates, template] };
+
}),
+
}),
+
),
+
{
+
name: "home-templates",
+
storage: createJSONStorage(() => localStorage),
+
},
+
),
+
);
export const CreateNewLeafletButton = (props: {}) => {
let isMobile = useIsMobile();
+
let templates = useTemplateState((s) => s.templates);
let openNewLeaflet = (id: string) => {
if (isMobile) {
window.location.href = `/${id}?focusFirstBlock`;
···
</div>
</div>
</MenuItem>
+
{templates.length > 0 && (
+
<hr className="border-border-light mx-2 mb-0.5" />
+
)}
+
{templates.map((t) => {
+
return (
+
<MenuItem
+
key={t.id}
+
onSelect={async () => {
+
let id = await createNewLeafletFromTemplate(t.id, false);
+
if (!id.error) openNewLeaflet(id.id);
+
}}
+
>
+
<TemplateSmall />
+
New {t.name}
+
</MenuItem>
+
);
+
})}
</Menu>
);
};
+42 -47
app/(home-pages)/home/HomeLayout.tsx
···
} from "components/PageLayouts/DashboardLayout";
import { Actions } from "./Actions/Actions";
import { useCardBorderHidden } from "components/Pages/useCardBorderHidden";
+
import { useTemplateState } from "./Actions/CreateNewButton";
import { GetLeafletDataReturnType } from "app/api/rpc/[command]/get_leaflet_data";
import { useState } from "react";
import { useDebouncedEffect } from "src/hooks/useDebouncedEffect";
···
PublicationBanner,
} from "./HomeEmpty/HomeEmpty";
-
export type Leaflet = {
+
type Leaflet = {
added_at: string;
-
archived?: boolean | null;
token: PermissionToken & {
leaflets_in_publications?: Exclude<
GetLeafletDataReturnType["result"]["data"],
null
>["leaflets_in_publications"];
-
leaflets_to_documents?: Exclude<
-
GetLeafletDataReturnType["result"]["data"],
-
null
-
>["leaflets_to_documents"];
};
};
···
let { identity } = useIdentityData();
let hasPubs = !identity || identity.publications.length === 0 ? false : true;
-
let hasArchived =
-
identity &&
-
identity.permission_token_on_homepage.filter(
-
(leaflet) => leaflet.archived === true,
-
).length > 0;
+
let hasTemplates =
+
useTemplateState((s) => s.templates).length === 0 ? false : true;
return (
<DashboardLayout
···
setSearchValueAction={setSearchValue}
hasBackgroundImage={hasBackgroundImage}
hasPubs={hasPubs}
-
hasArchived={!!hasArchived}
+
hasTemplates={hasTemplates}
/>
),
content: (
···
...identity.permission_token_on_homepage.reduce(
(acc, tok) => {
let title =
-
tok.permission_tokens.leaflets_in_publications[0]?.title ||
-
tok.permission_tokens.leaflets_to_documents[0]?.title;
+
tok.permission_tokens.leaflets_in_publications[0]?.title;
if (title) acc[tok.permission_tokens.root_entity] = title;
return acc;
},
···
? identity.permission_token_on_homepage.map((ptoh) => ({
added_at: ptoh.created_at,
token: ptoh.permission_tokens as PermissionToken,
-
archived: ptoh.archived,
}))
: localLeaflets
.sort((a, b) => (a.added_at > b.added_at ? -1 : 1))
···
w-full
${display === "grid" ? "grid auto-rows-max md:grid-cols-4 sm:grid-cols-3 grid-cols-2 gap-y-4 gap-x-4 sm:gap-x-6 sm:gap-y-5 grow" : "flex flex-col gap-2 pt-2"} `}
>
-
{props.leaflets.map(({ token: leaflet, added_at, archived }, index) => (
+
{props.leaflets.map(({ token: leaflet, added_at }, index) => (
<ReplicacheProvider
disablePull
initialFactsOnly={!!identity}
···
value={{
...leaflet,
leaflets_in_publications: leaflet.leaflets_in_publications || [],
-
leaflets_to_documents: leaflet.leaflets_to_documents || [],
blocked_by_admin: null,
custom_domain_routes: [],
}}
>
<LeafletListItem
-
title={props?.titles?.[leaflet.root_entity]}
-
archived={archived}
+
title={props?.titles?.[leaflet.root_entity] || "Untitled"}
+
token={leaflet}
+
draft={!!leaflet.leaflets_in_publications?.length}
+
published={!!leaflet.leaflets_in_publications?.find((l) => l.doc)}
+
publishedAt={
+
leaflet.leaflets_in_publications?.find((l) => l.doc)?.documents
+
?.indexed_at
+
}
+
leaflet_id={leaflet.root_entity}
loggedIn={!!identity}
display={display}
added_at={added_at}
···
let sortedLeaflets = leaflets.sort((a, b) => {
if (sort === "alphabetical") {
-
let titleA = titles[a.token.root_entity] ?? "Untitled";
-
let titleB = titles[b.token.root_entity] ?? "Untitled";
-
-
if (titleA === titleB) {
+
if (titles[a.token.root_entity] === titles[b.token.root_entity]) {
return a.added_at > b.added_at ? -1 : 1;
} else {
-
return titleA.toLocaleLowerCase() > titleB.toLocaleLowerCase() ? 1 : -1;
+
return titles[a.token.root_entity].toLocaleLowerCase() >
+
titles[b.token.root_entity].toLocaleLowerCase()
+
? 1
+
: -1;
}
} else {
return a.added_at === b.added_at
···
}
});
-
let filteredLeaflets = sortedLeaflets.filter(
-
({ token: leaflet, archived: archived }) => {
-
let published =
-
!!leaflet.leaflets_in_publications?.find((l) => l.doc) ||
-
!!leaflet.leaflets_to_documents?.find((l) => l.document);
-
let drafts = !!leaflet.leaflets_in_publications?.length && !published;
-
let docs = !leaflet.leaflets_in_publications?.length && !archived;
-
// If no filters are active, show all
-
if (
-
!filter.drafts &&
-
!filter.published &&
-
!filter.docs &&
-
!filter.archived
-
)
-
return archived === false || archived === null || archived == undefined;
+
let allTemplates = useTemplateState((s) => s.templates);
+
let filteredLeaflets = sortedLeaflets.filter(({ token: leaflet }) => {
+
let published = !!leaflet.leaflets_in_publications?.find((l) => l.doc);
+
let drafts = !!leaflet.leaflets_in_publications?.length && !published;
+
let docs = !leaflet.leaflets_in_publications?.length;
+
let templates = !!allTemplates.find((t) => t.id === leaflet.id);
+
// If no filters are active, show all
+
if (
+
!filter.drafts &&
+
!filter.published &&
+
!filter.docs &&
+
!filter.templates
+
)
+
return true;
-
return (
-
(filter.drafts && drafts) ||
-
(filter.published && published) ||
-
(filter.docs && docs) ||
-
(filter.archived && archived)
-
);
-
},
-
);
+
return (
+
(filter.drafts && drafts) ||
+
(filter.published && published) ||
+
(filter.docs && docs) ||
+
(filter.templates && templates)
+
);
+
});
if (searchValue === "") return filteredLeaflets;
let searchedLeaflets = filteredLeaflets.filter(({ token: leaflet }) => {
return titles[leaflet.root_entity]
+57 -29
app/(home-pages)/home/LeafletList/LeafletInfo.tsx
···
"use client";
-
import { useEntity } from "src/replicache";
+
import { PermissionToken } from "src/replicache";
import { LeafletOptions } from "./LeafletOptions";
+
import Link from "next/link";
+
import { useState } from "react";
+
import { theme } from "tailwind.config";
+
import { TemplateSmall } from "components/Icons/TemplateSmall";
import { timeAgo } from "src/utils/timeAgo";
-
import { usePageTitle } from "components/utils/UpdateLeafletTitle";
-
import { useLeafletPublicationStatus } from "components/PageSWRDataProvider";
export const LeafletInfo = (props: {
title?: string;
+
draft?: boolean;
+
published?: boolean;
+
token: PermissionToken;
+
leaflet_id: string;
+
loggedIn: boolean;
+
isTemplate: boolean;
className?: string;
display: "grid" | "list";
added_at: string;
-
archived?: boolean | null;
-
loggedIn: boolean;
+
publishedAt?: string;
}) => {
-
const pubStatus = useLeafletPublicationStatus();
+
let [prefetch, setPrefetch] = useState(false);
let prettyCreatedAt = props.added_at ? timeAgo(props.added_at) : "";
-
let prettyPublishedAt = pubStatus?.publishedAt
-
? timeAgo(pubStatus.publishedAt)
-
: "";
-
// Look up root page first, like UpdateLeafletTitle does
-
let firstPage = useEntity(pubStatus?.leafletId ?? "", "root/page")[0];
-
let entityID = firstPage?.data.value || pubStatus?.leafletId || "";
-
let titleFromDb = usePageTitle(entityID);
-
-
let title = props.title ?? titleFromDb ?? "Untitled";
+
let prettyPublishedAt = props.publishedAt ? timeAgo(props.publishedAt) : "";
return (
<div
className={`leafletInfo w-full min-w-0 flex flex-col ${props.className}`}
>
<div className="flex justify-between items-center shrink-0 max-w-full gap-2 leading-tight overflow-hidden">
-
<h3 className="sm:text-lg text-base truncate w-full min-w-0">
-
{title}
-
</h3>
+
<Link
+
onMouseEnter={() => setPrefetch(true)}
+
onPointerDown={() => setPrefetch(true)}
+
prefetch={prefetch}
+
href={`/${props.token.id}`}
+
className="no-underline sm:hover:no-underline text-primary grow min-w-0"
+
>
+
<h3 className="sm:text-lg text-base truncate w-full min-w-0">
+
{props.title}
+
</h3>
+
</Link>
<div className="flex gap-1 shrink-0">
-
<LeafletOptions archived={props.archived} loggedIn={props.loggedIn} />
+
{props.isTemplate && props.display === "list" ? (
+
<TemplateSmall
+
fill={theme.colors["bg-page"]}
+
className="text-tertiary"
+
/>
+
) : null}
+
<LeafletOptions
+
leaflet={props.token}
+
isTemplate={props.isTemplate}
+
loggedIn={props.loggedIn}
+
added_at={props.added_at}
+
/>
</div>
</div>
-
<div className="flex gap-2 items-center">
-
{props.archived ? (
-
<div className="text-xs text-tertiary truncate">Archived</div>
-
) : pubStatus?.draftInPublication || pubStatus?.isPublished ? (
+
<Link
+
onMouseEnter={() => setPrefetch(true)}
+
onPointerDown={() => setPrefetch(true)}
+
prefetch={prefetch}
+
href={`/${props.token.id}`}
+
className="no-underline sm:hover:no-underline text-primary w-full"
+
>
+
{props.draft || props.published ? (
<div
-
className={`text-xs w-max grow truncate ${pubStatus?.isPublished ? "font-bold text-tertiary" : "text-tertiary"}`}
+
className={`text-xs ${props.published ? "font-bold text-tertiary" : "text-tertiary"}`}
>
-
{pubStatus?.isPublished
+
{props.published
? `Published ${prettyPublishedAt}`
: `Draft ${prettyCreatedAt}`}
</div>
) : (
-
<div className="text-xs text-tertiary grow w-max truncate">
-
{prettyCreatedAt}
-
</div>
+
<div className="text-xs text-tertiary">{prettyCreatedAt}</div>
)}
-
</div>
+
</Link>
+
{props.isTemplate && props.display === "grid" ? (
+
<div className="absolute -top-2 right-1">
+
<TemplateSmall
+
className="text-tertiary"
+
fill={theme.colors["bg-page"]}
+
/>
+
</div>
+
) : null}
</div>
);
};
+26 -45
app/(home-pages)/home/LeafletList/LeafletListItem.tsx
···
"use client";
+
import { PermissionToken } from "src/replicache";
+
import { useTemplateState } from "../Actions/CreateNewButton";
import { LeafletListPreview, LeafletGridPreview } from "./LeafletPreview";
import { LeafletInfo } from "./LeafletInfo";
import { useState, useRef, useEffect } from "react";
-
import { SpeedyLink } from "components/SpeedyLink";
-
import { useLeafletPublicationStatus } from "components/PageSWRDataProvider";
export const LeafletListItem = (props: {
-
archived?: boolean | null;
+
token: PermissionToken;
+
leaflet_id: string;
loggedIn: boolean;
display: "list" | "grid";
cardBorderHidden: boolean;
added_at: string;
-
title?: string;
+
title: string;
+
draft?: boolean;
+
published?: boolean;
+
publishedAt?: string;
index: number;
isHidden: boolean;
showPreview?: boolean;
}) => {
-
const pubStatus = useLeafletPublicationStatus();
+
let isTemplate = useTemplateState(
+
(s) => !!s.templates.find((t) => t.id === props.token.id),
+
);
+
let [isOnScreen, setIsOnScreen] = useState(props.index < 16 ? true : false);
let previewRef = useRef<HTMLDivElement | null>(null);
···
return () => observer.disconnect();
}, [previewRef]);
-
const tokenId = pubStatus?.shareLink ?? "";
-
if (props.display === "list")
return (
<>
<div
ref={previewRef}
-
className={`relative flex gap-3 w-full
-
${props.isHidden ? "hidden" : "flex"}
-
${props.cardBorderHidden ? "" : "px-2 py-1 block-border hover:outline-border relative"}`}
+
className={`gap-3 w-full ${props.cardBorderHidden ? "" : "px-2 py-1 block-border hover:outline-border"}`}
style={{
backgroundColor: props.cardBorderHidden
? "transparent"
: "rgba(var(--bg-page), var(--bg-page-alpha))",
+
+
display: props.isHidden ? "none" : "flex",
}}
>
-
<SpeedyLink
-
href={`/${tokenId}`}
-
className={`absolute w-full h-full top-0 left-0 no-underline hover:no-underline! text-primary`}
-
/>
-
{props.showPreview && <LeafletListPreview isVisible={isOnScreen} />}
-
<LeafletInfo
-
title={props.title}
-
display={props.display}
-
added_at={props.added_at}
-
archived={props.archived}
-
loggedIn={props.loggedIn}
-
/>
+
{props.showPreview && (
+
<LeafletListPreview isVisible={isOnScreen} {...props} />
+
)}
+
<LeafletInfo isTemplate={isTemplate} {...props} />
</div>
{props.cardBorderHidden && (
<hr
···
return (
<div
ref={previewRef}
-
className={`
-
relative
-
flex flex-col gap-1 p-1 h-52 w-full
+
className={`leafletGridListItem relative
+
flex flex-col gap-1 p-1 h-52
block-border border-border! hover:outline-border
-
${props.isHidden ? "hidden" : "flex"}
`}
style={{
backgroundColor: props.cardBorderHidden
? "transparent"
: "rgba(var(--bg-page), var(--bg-page-alpha))",
+
+
display: props.isHidden ? "none" : "flex",
}}
>
-
<SpeedyLink
-
href={`/${tokenId}`}
-
className={`absolute w-full h-full top-0 left-0 no-underline hover:no-underline! text-primary`}
-
/>
<div className="grow">
-
<LeafletGridPreview isVisible={isOnScreen} />
+
<LeafletGridPreview {...props} isVisible={isOnScreen} />
</div>
<LeafletInfo
+
isTemplate={isTemplate}
className="px-1 pb-0.5 shrink-0"
-
title={props.title}
-
display={props.display}
-
added_at={props.added_at}
-
archived={props.archived}
-
loggedIn={props.loggedIn}
+
{...props}
/>
</div>
);
};
-
-
const LeafletLink = (props: { id: string; className: string }) => {
-
return (
-
<SpeedyLink
-
href={`/${props.id}`}
-
className={`no-underline hover:no-underline! text-primary ${props.className}`}
-
/>
-
);
-
};
+170 -293
app/(home-pages)/home/LeafletList/LeafletOptions.tsx
···
"use client";
import { Menu, MenuItem } from "components/Layout";
+
import { useReplicache, type PermissionToken } from "src/replicache";
+
import { hideDoc } from "../storage";
import { useState } from "react";
-
import { ButtonPrimary, ButtonTertiary } from "components/Buttons";
-
import { useToaster } from "components/Toast";
-
import { MoreOptionsVerticalTiny } from "components/Icons/MoreOptionsVerticalTiny";
-
import { DeleteSmall } from "components/Icons/DeleteSmall";
-
import {
-
archivePost,
-
deleteLeaflet,
-
unarchivePost,
-
} from "actions/deleteLeaflet";
-
import { ArchiveSmall } from "components/Icons/ArchiveSmall";
-
import { UnpublishSmall } from "components/Icons/UnpublishSmall";
-
import {
-
deletePost,
-
unpublishPost,
-
} from "app/lish/[did]/[publication]/dashboard/deletePost";
-
import { ShareSmall } from "components/Icons/ShareSmall";
+
import { ButtonPrimary } from "components/Buttons";
+
import { useTemplateState } from "../Actions/CreateNewButton";
+
import { useSmoker, useToaster } from "components/Toast";
+
import { removeLeafletFromHome } from "actions/removeLeafletFromHome";
+
import { useIdentityData } from "components/IdentityProvider";
import { HideSmall } from "components/Icons/HideSmall";
-
import { hideDoc } from "../storage";
-
-
import {
-
useIdentityData,
-
mutateIdentityData,
-
} from "components/IdentityProvider";
-
import {
-
usePublicationData,
-
mutatePublicationData,
-
} from "app/lish/[did]/[publication]/dashboard/PublicationSWRProvider";
-
import { ShareButton } from "app/[leaflet_id]/actions/ShareOptions";
-
import { useLeafletPublicationStatus } from "components/PageSWRDataProvider";
+
import { MoreOptionsTiny } from "components/Icons/MoreOptionsTiny";
+
import { TemplateRemoveSmall } from "components/Icons/TemplateRemoveSmall";
+
import { TemplateSmall } from "components/Icons/TemplateSmall";
+
import { MoreOptionsVerticalTiny } from "components/Icons/MoreOptionsVerticalTiny";
+
import { addLeafletToHome } from "actions/addLeafletToHome";
export const LeafletOptions = (props: {
-
archived?: boolean | null;
-
loggedIn?: boolean;
+
leaflet: PermissionToken;
+
isTemplate: boolean;
+
loggedIn: boolean;
+
added_at: string;
}) => {
-
const pubStatus = useLeafletPublicationStatus();
-
let [state, setState] = useState<"normal" | "areYouSure">("normal");
+
let { mutate: mutateIdentity } = useIdentityData();
+
let [state, setState] = useState<"normal" | "template">("normal");
let [open, setOpen] = useState(false);
-
let { identity } = useIdentityData();
-
let isPublicationOwner =
-
!!identity?.atp_did && !!pubStatus?.documentUri?.includes(identity.atp_did);
+
let smoker = useSmoker();
+
let toaster = useToaster();
return (
<>
<Menu
···
}}
trigger={
<div
-
className="text-secondary shrink-0 relative"
+
className="text-secondary shrink-0"
onClick={(e) => {
e.preventDefault;
e.stopPropagation;
···
}
>
{state === "normal" ? (
-
!props.loggedIn ? (
-
<LoggedOutOptions setState={setState} />
-
) : pubStatus?.documentUri && isPublicationOwner ? (
-
<PublishedPostOptions setState={setState} />
-
) : (
-
<DefaultOptions setState={setState} archived={props.archived} />
-
)
-
) : state === "areYouSure" ? (
-
<DeleteAreYouSureForm backToMenu={() => setState("normal")} />
+
<>
+
{!props.isTemplate ? (
+
<MenuItem
+
onSelect={(e) => {
+
e.preventDefault();
+
setState("template");
+
}}
+
>
+
<TemplateSmall /> Add as Template
+
</MenuItem>
+
) : (
+
<MenuItem
+
onSelect={(e) => {
+
useTemplateState.getState().removeTemplate(props.leaflet);
+
let newLeafletButton =
+
document.getElementById("new-leaflet-button");
+
if (!newLeafletButton) return;
+
let rect = newLeafletButton.getBoundingClientRect();
+
smoker({
+
static: true,
+
text: <strong>Removed template!</strong>,
+
position: {
+
y: rect.top,
+
x: rect.right + 5,
+
},
+
});
+
}}
+
>
+
<TemplateRemoveSmall /> Remove from Templates
+
</MenuItem>
+
)}
+
<MenuItem
+
onSelect={async () => {
+
if (props.loggedIn) {
+
mutateIdentity(
+
(s) => {
+
if (!s) return s;
+
return {
+
...s,
+
permission_token_on_homepage:
+
s.permission_token_on_homepage.filter(
+
(ptrh) =>
+
ptrh.permission_tokens.id !== props.leaflet.id,
+
),
+
};
+
},
+
{ revalidate: false },
+
);
+
await removeLeafletFromHome([props.leaflet.id]);
+
mutateIdentity();
+
} else {
+
hideDoc(props.leaflet);
+
}
+
toaster({
+
content: (
+
<div className="font-bold">
+
Doc removed!{" "}
+
<UndoRemoveFromHomeButton
+
leaflet={props.leaflet}
+
added_at={props.added_at}
+
/>
+
</div>
+
),
+
type: "success",
+
});
+
}}
+
>
+
<HideSmall />
+
Remove from Home
+
</MenuItem>
+
</>
+
) : state === "template" ? (
+
<AddTemplateForm
+
leaflet={props.leaflet}
+
close={() => setOpen(false)}
+
/>
) : null}
</Menu>
</>
);
};
-
const DefaultOptions = (props: {
-
setState: (s: "areYouSure") => void;
-
archived?: boolean | null;
+
const UndoRemoveFromHomeButton = (props: {
+
leaflet: PermissionToken;
+
added_at: string | undefined;
}) => {
-
const pubStatus = useLeafletPublicationStatus();
-
const toaster = useToaster();
-
const { setArchived } = useArchiveMutations();
-
const tokenId = pubStatus?.token.id;
-
const itemType = pubStatus?.draftInPublication ? "Draft" : "Leaflet";
-
+
let toaster = useToaster();
+
let { mutate } = useIdentityData();
return (
-
<>
-
<EditLinkShareButton link={pubStatus?.shareLink ?? ""} />
-
<hr className="border-border-light" />
-
<MenuItem
-
onSelect={async () => {
-
if (!tokenId) return;
-
setArchived(tokenId, !props.archived);
+
<button
+
onClick={async (e) => {
+
await mutate(
+
(identity) => {
+
if (!identity) return;
+
return {
+
...identity,
+
permission_token_on_homepage: [
+
...identity.permission_token_on_homepage,
+
{
+
created_at: props.added_at || new Date().toISOString(),
+
permission_tokens: {
+
...props.leaflet,
+
leaflets_in_publications: [],
+
},
+
},
+
],
+
};
+
},
+
{ revalidate: false },
+
);
+
await addLeafletToHome(props.leaflet.id);
+
await mutate();
-
if (!props.archived) {
-
await archivePost(tokenId);
-
toaster({
-
content: (
-
<div className="font-bold flex gap-2">
-
Archived {itemType}!
-
<ButtonTertiary
-
className="underline text-accent-2!"
-
onClick={async () => {
-
setArchived(tokenId, false);
-
await unarchivePost(tokenId);
-
toaster({
-
content: <div className="font-bold">Unarchived!</div>,
-
type: "success",
-
});
-
}}
-
>
-
Undo?
-
</ButtonTertiary>
-
</div>
-
),
-
type: "success",
-
});
-
} else {
-
await unarchivePost(tokenId);
-
toaster({
-
content: <div className="font-bold">Unarchived!</div>,
-
type: "success",
-
});
-
}
-
}}
-
>
-
<ArchiveSmall />
-
{!props.archived ? " Archive" : "Unarchive"} {itemType}
-
</MenuItem>
-
<DeleteForeverMenuItem
-
onSelect={(e) => {
-
e.preventDefault();
-
props.setState("areYouSure");
-
}}
-
/>
-
</>
+
toaster({
+
content: <div className="font-bold">Recovered Doc!</div>,
+
type: "success",
+
});
+
}}
+
className="underline"
+
>
+
Undo?
+
</button>
);
};
-
const LoggedOutOptions = (props: { setState: (s: "areYouSure") => void }) => {
-
const pubStatus = useLeafletPublicationStatus();
-
const toaster = useToaster();
-
-
return (
-
<>
-
<EditLinkShareButton link={`/${pubStatus?.shareLink ?? ""}`} />
-
<hr className="border-border-light" />
-
<MenuItem
-
onSelect={() => {
-
if (pubStatus?.token) hideDoc(pubStatus.token);
-
toaster({
-
content: <div className="font-bold">Removed from Home!</div>,
-
type: "success",
-
});
-
}}
-
>
-
<HideSmall />
-
Remove from Home
-
</MenuItem>
-
<DeleteForeverMenuItem
-
onSelect={(e) => {
-
e.preventDefault();
-
props.setState("areYouSure");
-
}}
-
/>
-
</>
-
);
-
};
-
-
const PublishedPostOptions = (props: {
-
setState: (s: "areYouSure") => void;
+
const AddTemplateForm = (props: {
+
leaflet: PermissionToken;
+
close: () => void;
}) => {
-
const pubStatus = useLeafletPublicationStatus();
-
const toaster = useToaster();
-
const postLink = pubStatus?.postShareLink ?? "";
-
const isFullUrl = postLink.includes("http");
-
+
let [name, setName] = useState("");
+
let smoker = useSmoker();
return (
-
<>
-
<ShareButton
-
text={
-
<div className="flex gap-2">
-
<ShareSmall />
-
Copy Post Link
-
</div>
-
}
-
smokerText="Link copied!"
-
id="get-link"
-
link={postLink}
-
fullLink={isFullUrl ? postLink : undefined}
-
/>
-
<hr className="border-border-light" />
-
<MenuItem
-
onSelect={async () => {
-
if (pubStatus?.documentUri) {
-
await unpublishPost(pubStatus.documentUri);
-
}
-
toaster({
-
content: <div className="font-bold">Unpublished Post!</div>,
-
type: "success",
+
<div className="flex flex-col gap-2 px-3 py-1">
+
<label className="font-bold flex flex-col gap-1 text-secondary">
+
Template Name
+
<input
+
value={name}
+
onChange={(e) => setName(e.target.value)}
+
type="text"
+
className=" text-primary font-normal border border-border rounded-md outline-hidden px-2 py-1 w-64"
+
/>
+
</label>
+
+
<ButtonPrimary
+
onClick={() => {
+
useTemplateState.getState().addTemplate({
+
name,
+
id: props.leaflet.id,
});
+
let newLeafletButton = document.getElementById("new-leaflet-button");
+
if (!newLeafletButton) return;
+
let rect = newLeafletButton.getBoundingClientRect();
+
smoker({
+
static: true,
+
text: <strong>Added {name}!</strong>,
+
position: {
+
y: rect.top,
+
x: rect.right + 5,
+
},
+
});
+
props.close();
}}
+
className="place-self-end"
>
-
<UnpublishSmall />
-
<div className="flex flex-col">
-
Unpublish Post
-
<div className="text-tertiary text-sm font-normal!">
-
Move this post back into drafts
-
</div>
-
</div>
-
</MenuItem>
-
<DeleteForeverMenuItem
-
onSelect={(e) => {
-
e.preventDefault();
-
props.setState("areYouSure");
-
}}
-
subtext="Post"
-
/>
-
</>
-
);
-
};
-
-
const DeleteAreYouSureForm = (props: { backToMenu: () => void }) => {
-
const pubStatus = useLeafletPublicationStatus();
-
const toaster = useToaster();
-
const { removeFromLists } = useArchiveMutations();
-
const tokenId = pubStatus?.token.id;
-
-
const itemType = pubStatus?.documentUri
-
? "Post"
-
: pubStatus?.draftInPublication
-
? "Draft"
-
: "Leaflet";
-
-
return (
-
<div className="flex flex-col justify-center p-2 text-center">
-
<div className="text-primary font-bold"> Are you sure?</div>
-
<div className="text-sm text-secondary">
-
This will delete it forever for everyone!
-
</div>
-
<div className="flex gap-2 mx-auto items-center mt-2">
-
<ButtonTertiary onClick={() => props.backToMenu()}>
-
Nevermind
-
</ButtonTertiary>
-
<ButtonPrimary
-
onClick={async () => {
-
if (tokenId) removeFromLists(tokenId);
-
if (pubStatus?.documentUri) {
-
await deletePost(pubStatus.documentUri);
-
}
-
if (pubStatus?.token) deleteLeaflet(pubStatus.token);
-
-
toaster({
-
content: <div className="font-bold">Deleted {itemType}!</div>,
-
type: "success",
-
});
-
}}
-
>
-
Delete it!
-
</ButtonPrimary>
-
</div>
+
Add Template
+
</ButtonPrimary>
</div>
);
};
-
-
// Shared menu items
-
const EditLinkShareButton = (props: { link: string }) => (
-
<ShareButton
-
text={
-
<div className="flex gap-2">
-
<ShareSmall />
-
Copy Edit Link
-
</div>
-
}
-
subtext=""
-
smokerText="Link copied!"
-
id="get-link"
-
link={props.link}
-
/>
-
);
-
-
const DeleteForeverMenuItem = (props: {
-
onSelect: (e: Event) => void;
-
subtext?: string;
-
}) => (
-
<MenuItem onSelect={props.onSelect}>
-
<DeleteSmall />
-
{props.subtext ? (
-
<div className="flex flex-col">
-
Delete {props.subtext}
-
<div className="text-tertiary text-sm font-normal!">
-
Unpublish AND delete
-
</div>
-
</div>
-
) : (
-
"Delete Forever"
-
)}
-
</MenuItem>
-
);
-
-
// Helper to update archived state in both identity and publication data
-
function useArchiveMutations() {
-
const { mutate: mutatePub } = usePublicationData();
-
const { mutate: mutateIdentity } = useIdentityData();
-
-
return {
-
setArchived: (tokenId: string, archived: boolean) => {
-
mutateIdentityData(mutateIdentity, (data) => {
-
const item = data.permission_token_on_homepage.find(
-
(p) => p.permission_tokens?.id === tokenId,
-
);
-
if (item) item.archived = archived;
-
});
-
mutatePublicationData(mutatePub, (data) => {
-
const item = data.publication?.leaflets_in_publications.find(
-
(l) => l.permission_tokens?.id === tokenId,
-
);
-
if (item) item.archived = archived;
-
});
-
},
-
removeFromLists: (tokenId: string) => {
-
mutateIdentityData(mutateIdentity, (data) => {
-
data.permission_token_on_homepage =
-
data.permission_token_on_homepage.filter(
-
(p) => p.permission_tokens?.id !== tokenId,
-
);
-
});
-
mutatePublicationData(mutatePub, (data) => {
-
if (!data.publication) return;
-
data.publication.leaflets_in_publications =
-
data.publication.leaflets_in_publications.filter(
-
(l) => l.permission_tokens?.id !== tokenId,
-
);
-
});
-
},
-
};
-
}
+112 -49
app/(home-pages)/home/LeafletList/LeafletPreview.tsx
···
ThemeBackgroundProvider,
ThemeProvider,
} from "components/ThemeManager/ThemeProvider";
-
import { useEntity, useReferenceToEntity } from "src/replicache";
+
import {
+
PermissionToken,
+
useEntity,
+
useReferenceToEntity,
+
} from "src/replicache";
+
import { useTemplateState } from "../Actions/CreateNewButton";
import { useCardBorderHidden } from "components/Pages/useCardBorderHidden";
import { LeafletContent } from "./LeafletContent";
import { Tooltip } from "components/Tooltip";
-
import { useLeafletPublicationStatus } from "components/PageSWRDataProvider";
-
import { CSSProperties } from "react";
+
import { useState } from "react";
+
import Link from "next/link";
+
import { SpeedyLink } from "components/SpeedyLink";
-
function useLeafletPreviewData() {
-
const pubStatus = useLeafletPublicationStatus();
-
const leafletId = pubStatus?.leafletId ?? "";
-
const root =
-
useReferenceToEntity("root/page", leafletId)[0]?.entity || leafletId;
-
const firstPage = useEntity(root, "root/page")[0];
-
const page = firstPage?.data.value || root;
+
export const LeafletListPreview = (props: {
+
draft?: boolean;
+
published?: boolean;
+
isVisible: boolean;
+
token: PermissionToken;
+
leaflet_id: string;
+
loggedIn: boolean;
+
}) => {
+
let root =
+
useReferenceToEntity("root/page", props.leaflet_id)[0]?.entity ||
+
props.leaflet_id;
+
let firstPage = useEntity(root, "root/page")[0];
+
let page = firstPage?.data.value || root;
-
const cardBorderHidden = useCardBorderHidden(root);
-
const rootBackgroundImage = useEntity(root, "theme/card-background-image");
-
const rootBackgroundRepeat = useEntity(
+
let cardBorderHidden = useCardBorderHidden(root);
+
let rootBackgroundImage = useEntity(root, "theme/card-background-image");
+
let rootBackgroundRepeat = useEntity(
root,
"theme/card-background-image-repeat",
);
-
const rootBackgroundOpacity = useEntity(
+
let rootBackgroundOpacity = useEntity(
root,
"theme/card-background-image-opacity",
);
-
const contentWrapperStyle: CSSProperties = cardBorderHidden
-
? {}
-
: {
-
backgroundImage: rootBackgroundImage
-
? `url(${rootBackgroundImage.data.src}), url(${rootBackgroundImage.data.fallback})`
-
: undefined,
-
backgroundRepeat: rootBackgroundRepeat ? "repeat" : "no-repeat",
-
backgroundPosition: "center",
-
backgroundSize: !rootBackgroundRepeat
-
? "cover"
-
: rootBackgroundRepeat?.data.value / 3,
-
opacity:
-
rootBackgroundImage?.data.src && rootBackgroundOpacity
-
? rootBackgroundOpacity.data.value
-
: 1,
-
backgroundColor: "rgba(var(--bg-page), var(--bg-page-alpha))",
-
};
-
-
const contentWrapperClass = `leafletContentWrapper h-full sm:w-48 w-40 mx-auto overflow-clip ${!cardBorderHidden && "border border-border-light border-b-0 rounded-t-md"}`;
-
-
return { root, page, cardBorderHidden, contentWrapperStyle, contentWrapperClass };
-
}
-
-
export const LeafletListPreview = (props: { isVisible: boolean }) => {
-
const { root, page, cardBorderHidden, contentWrapperStyle, contentWrapperClass } =
-
useLeafletPreviewData();
-
return (
<Tooltip
open={true}
···
<ThemeProvider local entityID={root} className="rounded-sm">
<ThemeBackgroundProvider entityID={root}>
<div className="leafletPreview grow shrink-0 h-44 w-64 px-2 pt-2 sm:px-3 sm:pt-3 flex items-end pointer-events-none rounded-[2px] ">
-
<div className={contentWrapperClass} style={contentWrapperStyle}>
+
<div
+
className={`leafletContentWrapper h-full sm:w-48 w-40 mx-auto overflow-clip ${!cardBorderHidden && "border border-border-light border-b-0 rounded-t-md"}`}
+
style={
+
cardBorderHidden
+
? {}
+
: {
+
backgroundImage: rootBackgroundImage
+
? `url(${rootBackgroundImage.data.src}), url(${rootBackgroundImage.data.fallback})`
+
: undefined,
+
backgroundRepeat: rootBackgroundRepeat
+
? "repeat"
+
: "no-repeat",
+
backgroundPosition: "center",
+
backgroundSize: !rootBackgroundRepeat
+
? "cover"
+
: rootBackgroundRepeat?.data.value / 3,
+
opacity:
+
rootBackgroundImage?.data.src && rootBackgroundOpacity
+
? rootBackgroundOpacity.data.value
+
: 1,
+
backgroundColor:
+
"rgba(var(--bg-page), var(--bg-page-alpha))",
+
}
+
}
+
>
<LeafletContent entityID={page} isOnScreen={props.isVisible} />
</div>
</div>
···
);
};
-
export const LeafletGridPreview = (props: { isVisible: boolean }) => {
-
const { root, page, contentWrapperStyle, contentWrapperClass } =
-
useLeafletPreviewData();
+
export const LeafletGridPreview = (props: {
+
draft?: boolean;
+
published?: boolean;
+
token: PermissionToken;
+
leaflet_id: string;
+
loggedIn: boolean;
+
isVisible: boolean;
+
}) => {
+
let root =
+
useReferenceToEntity("root/page", props.leaflet_id)[0]?.entity ||
+
props.leaflet_id;
+
let firstPage = useEntity(root, "root/page")[0];
+
let page = firstPage?.data.value || root;
+
let cardBorderHidden = useCardBorderHidden(root);
+
let rootBackgroundImage = useEntity(root, "theme/card-background-image");
+
let rootBackgroundRepeat = useEntity(
+
root,
+
"theme/card-background-image-repeat",
+
);
+
let rootBackgroundOpacity = useEntity(
+
root,
+
"theme/card-background-image-opacity",
+
);
return (
<ThemeProvider local entityID={root} className="w-full!">
-
<div className="border border-border-light rounded-md w-full h-full overflow-hidden ">
-
<div className="w-full h-full">
+
<div className="border border-border-light rounded-md w-full h-full overflow-hidden relative">
+
<div className="relative w-full h-full">
<ThemeBackgroundProvider entityID={root}>
<div
inert
-
className="leafletPreview grow shrink-0 h-full w-full px-2 pt-2 sm:px-3 sm:pt-3 flex items-end pointer-events-none"
+
className="leafletPreview relative grow shrink-0 h-full w-full px-2 pt-2 sm:px-3 sm:pt-3 flex items-end pointer-events-none"
>
-
<div className={contentWrapperClass} style={contentWrapperStyle}>
+
<div
+
className={`leafletContentWrapper h-full sm:w-48 w-40 mx-auto overflow-clip ${!cardBorderHidden && "border border-border-light border-b-0 rounded-t-md"}`}
+
style={
+
cardBorderHidden
+
? {}
+
: {
+
backgroundImage: rootBackgroundImage
+
? `url(${rootBackgroundImage.data.src}), url(${rootBackgroundImage.data.fallback})`
+
: undefined,
+
backgroundRepeat: rootBackgroundRepeat
+
? "repeat"
+
: "no-repeat",
+
backgroundPosition: "center",
+
backgroundSize: !rootBackgroundRepeat
+
? "cover"
+
: rootBackgroundRepeat?.data.value / 3,
+
opacity:
+
rootBackgroundImage?.data.src && rootBackgroundOpacity
+
? rootBackgroundOpacity.data.value
+
: 1,
+
backgroundColor:
+
"rgba(var(--bg-page), var(--bg-page-alpha))",
+
}
+
}
+
>
<LeafletContent entityID={page} isOnScreen={props.isVisible} />
</div>
</div>
</ThemeBackgroundProvider>
</div>
+
<LeafletPreviewLink id={props.token.id} />
</div>
</ThemeProvider>
);
};
+
+
const LeafletPreviewLink = (props: { id: string }) => {
+
return (
+
<SpeedyLink
+
href={`/${props.id}`}
+
className={`hello no-underline sm:hover:no-underline text-primary absolute inset-0 w-full h-full bg-bg-test`}
+
/>
+
);
+
};
+1 -2
app/(home-pages)/home/page.tsx
···
...auth_res?.permission_token_on_homepage.reduce(
(acc, tok) => {
let title =
-
tok.permission_tokens.leaflets_in_publications[0]?.title ||
-
tok.permission_tokens.leaflets_to_documents[0]?.title;
+
tok.permission_tokens.leaflets_in_publications[0]?.title;
if (title) acc[tok.permission_tokens.root_entity] = title;
return acc;
},
-116
app/(home-pages)/looseleafs/LooseleafsLayout.tsx
···
-
"use client";
-
import { DashboardLayout } from "components/PageLayouts/DashboardLayout";
-
import { useCardBorderHidden } from "components/Pages/useCardBorderHidden";
-
import { useState } from "react";
-
import { useDebouncedEffect } from "src/hooks/useDebouncedEffect";
-
import { Fact, PermissionToken } from "src/replicache";
-
import { Attribute } from "src/replicache/attributes";
-
import { Actions } from "../home/Actions/Actions";
-
import { callRPC } from "app/api/rpc/client";
-
import { useIdentityData } from "components/IdentityProvider";
-
import useSWR from "swr";
-
import { getHomeDocs } from "../home/storage";
-
import { Leaflet, LeafletList } from "../home/HomeLayout";
-
-
export const LooseleafsLayout = (props: {
-
entityID: string | null;
-
titles: { [root_entity: string]: string };
-
initialFacts: {
-
[root_entity: string]: Fact<Attribute>[];
-
};
-
}) => {
-
let [searchValue, setSearchValue] = useState("");
-
let [debouncedSearchValue, setDebouncedSearchValue] = useState("");
-
-
useDebouncedEffect(
-
() => {
-
setDebouncedSearchValue(searchValue);
-
},
-
200,
-
[searchValue],
-
);
-
-
let cardBorderHidden = !!useCardBorderHidden(props.entityID);
-
return (
-
<DashboardLayout
-
id="looseleafs"
-
cardBorderHidden={cardBorderHidden}
-
currentPage="looseleafs"
-
defaultTab="home"
-
actions={<Actions />}
-
tabs={{
-
home: {
-
controls: null,
-
content: (
-
<LooseleafList
-
titles={props.titles}
-
initialFacts={props.initialFacts}
-
cardBorderHidden={cardBorderHidden}
-
searchValue={debouncedSearchValue}
-
/>
-
),
-
},
-
}}
-
/>
-
);
-
};
-
-
export const LooseleafList = (props: {
-
titles: { [root_entity: string]: string };
-
initialFacts: {
-
[root_entity: string]: Fact<Attribute>[];
-
};
-
searchValue: string;
-
cardBorderHidden: boolean;
-
}) => {
-
let { identity } = useIdentityData();
-
let { data: initialFacts } = useSWR(
-
"home-leaflet-data",
-
async () => {
-
if (identity) {
-
let { result } = await callRPC("getFactsFromHomeLeaflets", {
-
tokens: identity.permission_token_on_homepage.map(
-
(ptrh) => ptrh.permission_tokens.root_entity,
-
),
-
});
-
let titles = {
-
...result.titles,
-
...identity.permission_token_on_homepage.reduce(
-
(acc, tok) => {
-
let title =
-
tok.permission_tokens.leaflets_in_publications[0]?.title ||
-
tok.permission_tokens.leaflets_to_documents[0]?.title;
-
if (title) acc[tok.permission_tokens.root_entity] = title;
-
return acc;
-
},
-
{} as { [k: string]: string },
-
),
-
};
-
return { ...result, titles };
-
}
-
},
-
{ fallbackData: { facts: props.initialFacts, titles: props.titles } },
-
);
-
-
let leaflets: Leaflet[] = identity
-
? identity.permission_token_on_homepage
-
.filter(
-
(ptoh) => ptoh.permission_tokens.leaflets_to_documents.length > 0,
-
)
-
.map((ptoh) => ({
-
added_at: ptoh.created_at,
-
token: ptoh.permission_tokens as PermissionToken,
-
}))
-
: [];
-
return (
-
<LeafletList
-
defaultDisplay="list"
-
searchValue={props.searchValue}
-
leaflets={leaflets}
-
titles={initialFacts?.titles || {}}
-
cardBorderHidden={props.cardBorderHidden}
-
initialFacts={initialFacts?.facts || {}}
-
showPreview
-
/>
-
);
-
};
-47
app/(home-pages)/looseleafs/page.tsx
···
-
import { getIdentityData } from "actions/getIdentityData";
-
import { DashboardLayout } from "components/PageLayouts/DashboardLayout";
-
import { Actions } from "../home/Actions/Actions";
-
import { Fact } from "src/replicache";
-
import { Attribute } from "src/replicache/attributes";
-
import { getFactsFromHomeLeaflets } from "app/api/rpc/[command]/getFactsFromHomeLeaflets";
-
import { supabaseServerClient } from "supabase/serverClient";
-
import { LooseleafsLayout } from "./LooseleafsLayout";
-
-
export default async function Home() {
-
let auth_res = await getIdentityData();
-
-
let [allLeafletFacts] = await Promise.all([
-
auth_res
-
? getFactsFromHomeLeaflets.handler(
-
{
-
tokens: auth_res.permission_token_on_homepage.map(
-
(r) => r.permission_tokens.root_entity,
-
),
-
},
-
{ supabase: supabaseServerClient },
-
)
-
: undefined,
-
]);
-
-
let home_docs_initialFacts = allLeafletFacts?.result || {};
-
-
return (
-
<LooseleafsLayout
-
entityID={auth_res?.home_leaflet?.root_entity || null}
-
titles={{
-
...home_docs_initialFacts.titles,
-
...auth_res?.permission_token_on_homepage.reduce(
-
(acc, tok) => {
-
let title =
-
tok.permission_tokens.leaflets_in_publications[0]?.title ||
-
tok.permission_tokens.leaflets_to_documents[0]?.title;
-
if (title) acc[tok.permission_tokens.root_entity] = title;
-
return acc;
-
},
-
{} as { [k: string]: string },
-
),
-
}}
-
initialFacts={home_docs_initialFacts.facts || {}}
-
/>
-
);
-
}
+3 -9
app/(home-pages)/notifications/CommentNotication.tsx
···
props.commentData.bsky_profiles?.handle ||
"Someone";
const pubRecord = props.commentData.documents?.documents_in_publications[0]
-
?.publications?.record as PubLeafletPublication.Record | undefined;
-
let docUri = new AtUri(props.commentData.documents?.uri!);
-
let rkey = docUri.rkey;
-
let did = docUri.host;
-
-
const href = pubRecord
-
? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`
-
: `/p/${did}/${rkey}?interactionDrawer=comments`;
+
?.publications?.record as PubLeafletPublication.Record;
+
let rkey = new AtUri(props.commentData.documents?.uri!).rkey;
return (
<Notification
timestamp={props.commentData.indexed_at}
-
href={href}
+
href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`}
icon={<CommentTiny />}
actionText={<>{displayName} commented on your post</>}
content={
+41 -36
app/(home-pages)/notifications/MentionNotification.tsx
···
-
import { QuoteTiny } from "components/Icons/QuoteTiny";
+
import { MentionTiny } from "components/Icons/MentionTiny";
import { ContentLayout, Notification } from "./Notification";
-
import { HydratedQuoteNotification } from "src/notifications";
-
import { PubLeafletDocument, PubLeafletPublication } from "lexicons/api";
-
import { AtUri } from "@atproto/api";
-
import { Avatar } from "components/Avatar";
-
export const QuoteNotification = (props: HydratedQuoteNotification) => {
-
const postView = props.bskyPost.post_view as any;
-
const author = postView.author;
-
const displayName = author.displayName || author.handle || "Someone";
-
const docRecord = props.document.data as PubLeafletDocument.Record;
-
const pubRecord = props.document.documents_in_publications[0]?.publications
-
?.record as PubLeafletPublication.Record | undefined;
-
const docUri = new AtUri(props.document.uri);
-
const rkey = docUri.rkey;
-
const did = docUri.host;
-
const postText = postView.record?.text || "";
+
export const DummyPostMentionNotification = (props: {}) => {
+
return (
+
<Notification
+
timestamp={""}
+
href="/"
+
icon={<MentionTiny />}
+
actionText={<>celine mentioned your post</>}
+
content={
+
<ContentLayout
+
postTitle={"Post Title Here"}
+
pubRecord={{ name: "My Publication" } as any}
+
>
+
I'm just gonna put the description here. The surrounding context is
+
just sort of a pain to figure out
+
<div className="border border-border-light rounded-md p-1 my-1 text-xs text-secondary">
+
<div className="font-bold">Title of the Mentioned Post</div>
+
<div className="text-tertiary">
+
And here is the description that follows it
+
</div>
+
</div>
+
</ContentLayout>
+
}
+
/>
+
);
+
};
-
const href = pubRecord
-
? `https://${pubRecord.base_path}/${rkey}`
-
: `/p/${did}/${rkey}`;
-
+
export const DummyUserMentionNotification = (props: {
+
cardBorderHidden: boolean;
+
}) => {
return (
<Notification
-
timestamp={props.created_at}
-
href={href}
-
icon={<QuoteTiny />}
-
actionText={<>{displayName} quoted your post</>}
+
timestamp={""}
+
href="/"
+
icon={<MentionTiny />}
+
actionText={<>celine mentioned you</>}
content={
-
<ContentLayout postTitle={docRecord.title} pubRecord={pubRecord}>
-
<div className="flex gap-2 text-sm w-full">
-
<Avatar
-
src={author.avatar}
-
displayName={displayName}
-
/>
-
<pre
-
style={{ wordBreak: "break-word" }}
-
className="whitespace-pre-wrap text-secondary line-clamp-3 sm:line-clamp-6"
-
>
-
{postText}
-
</pre>
+
<ContentLayout
+
postTitle={"Post Title Here"}
+
pubRecord={{ name: "My Publication" } as any}
+
>
+
<div>
+
...llo this is the content of a post or whatever here it comes{" "}
+
<span className="text-accent-contrast">@celine </span> and here it
+
was! ooooh heck yeah the high is unre...
</div>
</ContentLayout>
}
-4
app/(home-pages)/notifications/NotificationList.tsx
···
import { ReplyNotification } from "./ReplyNotification";
import { useIdentityData } from "components/IdentityProvider";
import { FollowNotification } from "./FollowNotification";
-
import { QuoteNotification } from "./MentionNotification";
export function NotificationList({
notifications,
···
}
if (n.type === "subscribe") {
return <FollowNotification key={n.id} {...n} />;
-
}
-
if (n.type === "quote") {
-
return <QuoteNotification key={n.id} {...n} />;
}
})}
</div>
+3 -9
app/(home-pages)/notifications/ReplyNotification.tsx
···
props.parentData?.bsky_profiles?.handle ||
"Someone";
-
let docUri = new AtUri(props.commentData.documents?.uri!);
-
let rkey = docUri.rkey;
-
let did = docUri.host;
+
let rkey = new AtUri(props.commentData.documents?.uri!).rkey;
const pubRecord = props.commentData.documents?.documents_in_publications[0]
-
?.publications?.record as PubLeafletPublication.Record | undefined;
-
-
const href = pubRecord
-
? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`
-
: `/p/${did}/${rkey}?interactionDrawer=comments`;
+
?.publications?.record as PubLeafletPublication.Record;
return (
<Notification
timestamp={props.commentData.indexed_at}
-
href={href}
+
href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`}
icon={<ReplyTiny />}
actionText={`${displayName} replied to your comment`}
content={
+1 -1
app/(home-pages)/reader/ReaderContent.tsx
···
let postRecord = props.documents.data as PubLeafletDocument.Record;
let postUri = new AtUri(props.documents.uri);
-
let theme = usePubTheme(pubRecord?.theme);
+
let theme = usePubTheme(pubRecord);
let backgroundImage = pubRecord?.theme?.backgroundImage?.image?.ref
? blobRefToSrc(
pubRecord?.theme?.backgroundImage?.image?.ref,
+98
app/[leaflet_id]/Actions.tsx
···
+
import { publishToPublication } from "actions/publishToPublication";
+
import {
+
getBasePublicationURL,
+
getPublicationURL,
+
} from "app/lish/createPub/getPublicationURL";
+
import { ActionButton } from "components/ActionBar/ActionButton";
+
import { GoBackSmall } from "components/Icons/GoBackSmall";
+
import { PublishSmall } from "components/Icons/PublishSmall";
+
import { useLeafletPublicationData } from "components/PageSWRDataProvider";
+
import { SpeedyLink } from "components/SpeedyLink";
+
import { useToaster } from "components/Toast";
+
import { DotLoader } from "components/utils/DotLoader";
+
import { useParams, useRouter } from "next/navigation";
+
import { useState } from "react";
+
import { useReplicache } from "src/replicache";
+
import { Json } from "supabase/database.types";
+
+
export const BackToPubButton = (props: {
+
publication: {
+
identity_did: string;
+
indexed_at: string;
+
name: string;
+
record: Json;
+
uri: string;
+
};
+
}) => {
+
return (
+
<SpeedyLink
+
href={`${getBasePublicationURL(props.publication)}/dashboard`}
+
className="hover:no-underline!"
+
>
+
<ActionButton
+
icon={<GoBackSmall className="shrink-0" />}
+
label="To Pub"
+
/>
+
</SpeedyLink>
+
);
+
};
+
+
export const PublishButton = () => {
+
let { data: pub } = useLeafletPublicationData();
+
let params = useParams();
+
let router = useRouter();
+
if (!pub?.doc)
+
return (
+
<ActionButton
+
primary
+
icon={<PublishSmall className="shrink-0" />}
+
label={"Publish!"}
+
onClick={() => {
+
router.push(`/${params.leaflet_id}/publish`);
+
}}
+
/>
+
);
+
+
return <UpdateButton />;
+
};
+
+
const UpdateButton = () => {
+
let [isLoading, setIsLoading] = useState(false);
+
let { data: pub, mutate } = useLeafletPublicationData();
+
let { permission_token, rootEntity } = useReplicache();
+
let toaster = useToaster();
+
+
return (
+
<ActionButton
+
primary
+
icon={<PublishSmall className="shrink-0" />}
+
label={isLoading ? <DotLoader /> : "Update!"}
+
onClick={async () => {
+
if (!pub || !pub.publications) return;
+
setIsLoading(true);
+
let doc = await publishToPublication({
+
root_entity: rootEntity,
+
publication_uri: pub.publications.uri,
+
leaflet_id: permission_token.id,
+
title: pub.title,
+
description: pub.description,
+
});
+
setIsLoading(false);
+
mutate();
+
toaster({
+
content: (
+
<div>
+
{pub.doc ? "Updated! " : "Published! "}
+
<SpeedyLink
+
href={`${getPublicationURL(pub.publications)}/${doc?.rkey}`}
+
>
+
link
+
</SpeedyLink>
+
</div>
+
),
+
type: "success",
+
});
+
}}
+
/>
+
);
+
};
+20 -16
app/[leaflet_id]/Footer.tsx
···
import { Media } from "components/Media";
import { ThemePopover } from "components/ThemeManager/ThemeSetter";
import { Toolbar } from "components/Toolbar";
-
import { ShareOptions } from "app/[leaflet_id]/actions/ShareOptions";
-
import { HomeButton } from "app/[leaflet_id]/actions/HomeButton";
-
import { PublishButton } from "./actions/PublishButton";
+
import { ShareOptions } from "components/ShareOptions";
+
import { HomeButton } from "components/HomeButton";
import { useEntitySetContext } from "components/EntitySetProvider";
-
import { HelpButton } from "app/[leaflet_id]/actions/HelpButton";
+
import { HelpPopover } from "components/HelpPopover";
import { Watermark } from "components/Watermark";
-
import { BackToPubButton } from "./actions/BackToPubButton";
+
import { BackToPubButton, PublishButton } from "./Actions";
import { useLeafletPublicationData } from "components/PageSWRDataProvider";
import { useIdentityData } from "components/IdentityProvider";
···
/>
</div>
) : entity_set.permissions.write ? (
-
<ActionFooter>
-
{pub?.publications &&
-
identity?.atp_did &&
-
pub.publications.identity_did === identity.atp_did ? (
+
pub?.publications &&
+
identity?.atp_did &&
+
pub.publications.identity_did === identity.atp_did ? (
+
<ActionFooter>
<BackToPubButton publication={pub.publications} />
-
) : (
+
<PublishButton />
+
<ShareOptions />
+
<HelpPopover />
+
<ThemePopover entityID={props.entityID} />
+
</ActionFooter>
+
) : (
+
<ActionFooter>
<HomeButton />
-
)}
-
-
<PublishButton entityID={props.entityID} />
-
<ShareOptions />
-
<ThemePopover entityID={props.entityID} />
-
</ActionFooter>
+
<ShareOptions />
+
<HelpPopover />
+
<ThemePopover entityID={props.entityID} />
+
</ActionFooter>
+
)
) : (
<div className="pb-2 px-2 z-10 flex justify-end">
<Watermark mobile />
+28 -12
app/[leaflet_id]/Sidebar.tsx
···
"use client";
+
import { ActionButton } from "components/ActionBar/ActionButton";
import { Sidebar } from "components/ActionBar/Sidebar";
import { useEntitySetContext } from "components/EntitySetProvider";
-
import { HelpButton } from "app/[leaflet_id]/actions/HelpButton";
-
import { HomeButton } from "app/[leaflet_id]/actions/HomeButton";
+
import { HelpPopover } from "components/HelpPopover";
+
import { HomeButton } from "components/HomeButton";
import { Media } from "components/Media";
import { useLeafletPublicationData } from "components/PageSWRDataProvider";
-
import { ShareOptions } from "app/[leaflet_id]/actions/ShareOptions";
+
import { ShareOptions } from "components/ShareOptions";
import { ThemePopover } from "components/ThemeManager/ThemeSetter";
-
import { PublishButton } from "./actions/PublishButton";
import { Watermark } from "components/Watermark";
-
import { BackToPubButton } from "./actions/BackToPubButton";
+
import { useUIState } from "src/useUIState";
+
import { BackToPubButton, PublishButton } from "./Actions";
import { useIdentityData } from "components/IdentityProvider";
import { useReplicache } from "src/replicache";
···
<div className="sidebarContainer flex flex-col justify-end h-full w-16 relative">
{entity_set.permissions.write && (
<Sidebar>
-
<PublishButton entityID={rootEntity} />
-
<ShareOptions />
-
<ThemePopover entityID={rootEntity} />
-
<HelpButton />
-
<hr className="text-border" />
{pub?.publications &&
identity?.atp_did &&
pub.publications.identity_did === identity.atp_did ? (
-
<BackToPubButton publication={pub.publications} />
+
<>
+
<PublishButton />
+
<ShareOptions />
+
<ThemePopover entityID={rootEntity} />
+
<HelpPopover />
+
<hr className="text-border" />
+
<BackToPubButton publication={pub.publications} />
+
</>
) : (
-
<HomeButton />
+
<>
+
<ShareOptions />
+
<ThemePopover entityID={rootEntity} />
+
<HelpPopover />
+
<hr className="text-border" />
+
<HomeButton />
+
</>
)}
</Sidebar>
)}
···
</Media>
);
}
+
+
const blurPage = () => {
+
useUIState.setState(() => ({
+
focusedEntity: null,
+
selectedBlocks: [],
+
}));
+
};
-27
app/[leaflet_id]/actions/BackToPubButton.tsx
···
-
import { getBasePublicationURL } from "app/lish/createPub/getPublicationURL";
-
import { ActionButton } from "components/ActionBar/ActionButton";
-
import { GoBackSmall } from "components/Icons/GoBackSmall";
-
import { SpeedyLink } from "components/SpeedyLink";
-
import { Json } from "supabase/database.types";
-
-
export const BackToPubButton = (props: {
-
publication: {
-
identity_did: string;
-
indexed_at: string;
-
name: string;
-
record: Json;
-
uri: string;
-
};
-
}) => {
-
return (
-
<SpeedyLink
-
href={`${getBasePublicationURL(props.publication)}/dashboard`}
-
className="hover:no-underline!"
-
>
-
<ActionButton
-
icon={<GoBackSmall className="shrink-0" />}
-
label="To Pub"
-
/>
-
</SpeedyLink>
-
);
-
};
-173
app/[leaflet_id]/actions/HelpButton.tsx
···
-
"use client";
-
import { ShortcutKey } from "../../../components/Layout";
-
import { Media } from "../../../components/Media";
-
import { Popover } from "../../../components/Popover";
-
import { metaKey } from "src/utils/metaKey";
-
import { useEntitySetContext } from "../../../components/EntitySetProvider";
-
import { useState } from "react";
-
import { ActionButton } from "components/ActionBar/ActionButton";
-
import { HelpSmall } from "../../../components/Icons/HelpSmall";
-
import { isMac } from "src/utils/isDevice";
-
import { useIsMobile } from "src/hooks/isMobile";
-
-
export const HelpButton = (props: { noShortcuts?: boolean }) => {
-
let entity_set = useEntitySetContext();
-
let isMobile = useIsMobile();
-
-
return entity_set.permissions.write ? (
-
<Popover
-
side={isMobile ? "top" : "right"}
-
align={isMobile ? "center" : "start"}
-
asChild
-
className="max-w-xs w-full"
-
trigger={<ActionButton icon={<HelpSmall />} label="About" />}
-
>
-
<div className="flex flex-col text-sm gap-2 text-secondary">
-
{/* about links */}
-
<HelpLink text="📖 Leaflet Manual" url="https://about.leaflet.pub" />
-
<HelpLink text="💡 Make with Leaflet" url="https://make.leaflet.pub" />
-
<HelpLink
-
text="✨ Explore Publications"
-
url="https://leaflet.pub/discover"
-
/>
-
<HelpLink text="📣 Newsletter" url="https://buttondown.com/leaflet" />
-
{/* contact links */}
-
<div className="columns-2 gap-2">
-
<HelpLink
-
text="🦋 Bluesky"
-
url="https://bsky.app/profile/leaflet.pub"
-
/>
-
<HelpLink text="💌 Email" url="mailto:contact@leaflet.pub" />
-
</div>
-
{/* keyboard shortcuts: desktop only */}
-
<Media mobile={false}>
-
{!props.noShortcuts && (
-
<>
-
<hr className="text-border my-1" />
-
<div className="flex flex-col gap-1">
-
<Label>Text Shortcuts</Label>
-
<KeyboardShortcut name="Bold" keys={[metaKey(), "B"]} />
-
<KeyboardShortcut name="Italic" keys={[metaKey(), "I"]} />
-
<KeyboardShortcut name="Underline" keys={[metaKey(), "U"]} />
-
<KeyboardShortcut
-
name="Highlight"
-
keys={[metaKey(), isMac() ? "Ctrl" : "Meta", "H"]}
-
/>
-
<KeyboardShortcut
-
name="Strikethrough"
-
keys={[metaKey(), isMac() ? "Ctrl" : "Meta", "X"]}
-
/>
-
<KeyboardShortcut name="Inline Link" keys={[metaKey(), "K"]} />
-
-
<Label>Block Shortcuts</Label>
-
{/* shift + up/down arrows (or click + drag): select multiple blocks */}
-
<KeyboardShortcut
-
name="Move Block Up"
-
keys={["Shift", metaKey(), "↑"]}
-
/>
-
<KeyboardShortcut
-
name="Move Block Down"
-
keys={["Shift", metaKey(), "↓"]}
-
/>
-
{/* cmd/ctrl-a: first selects all text in a block; again selects all blocks on page */}
-
{/* cmd/ctrl + up/down arrows: go to beginning / end of doc */}
-
-
<Label>Canvas Shortcuts</Label>
-
<OtherShortcut name="Add Block" description="Double click" />
-
<OtherShortcut name="Select Block" description="Long press" />
-
-
<Label>Outliner Shortcuts</Label>
-
<KeyboardShortcut
-
name="Make List"
-
keys={[metaKey(), isMac() ? "Opt" : "Alt", "L"]}
-
/>
-
{/* tab / shift + tab: indent / outdent */}
-
<KeyboardShortcut
-
name="Toggle Checkbox"
-
keys={[metaKey(), "Enter"]}
-
/>
-
<KeyboardShortcut
-
name="Toggle Fold"
-
keys={[metaKey(), "Shift", "Enter"]}
-
/>
-
<KeyboardShortcut
-
name="Fold All"
-
keys={[metaKey(), isMac() ? "Opt" : "Alt", "Shift", "↑"]}
-
/>
-
<KeyboardShortcut
-
name="Unfold All"
-
keys={[metaKey(), isMac() ? "Opt" : "Alt", "Shift", "↓"]}
-
/>
-
</div>
-
</>
-
)}
-
</Media>
-
{/* links: terms and privacy */}
-
<hr className="text-border my-1" />
-
{/* <HelpLink
-
text="Terms and Privacy Policy"
-
url="https://leaflet.pub/legal"
-
/> */}
-
<div>
-
<a href="https://leaflet.pub/legal" target="_blank">
-
Terms and Privacy Policy
-
</a>
-
</div>
-
</div>
-
</Popover>
-
) : null;
-
};
-
-
const KeyboardShortcut = (props: { name: string; keys: string[] }) => {
-
return (
-
<div className="flex gap-2 justify-between items-center">
-
{props.name}
-
<div className="flex gap-1 items-center font-bold">
-
{props.keys.map((key, index) => {
-
return <ShortcutKey key={index}>{key}</ShortcutKey>;
-
})}
-
</div>
-
</div>
-
);
-
};
-
-
const OtherShortcut = (props: { name: string; description: string }) => {
-
return (
-
<div className="flex justify-between items-center">
-
<span>{props.name}</span>
-
<span>
-
<strong>{props.description}</strong>
-
</span>
-
</div>
-
);
-
};
-
-
const Label = (props: { children: React.ReactNode }) => {
-
return <div className="text-tertiary font-bold pt-2 ">{props.children}</div>;
-
};
-
-
const HelpLink = (props: { url: string; text: string }) => {
-
const [isHovered, setIsHovered] = useState(false);
-
const handleMouseEnter = () => {
-
setIsHovered(true);
-
};
-
const handleMouseLeave = () => {
-
setIsHovered(false);
-
};
-
return (
-
<a
-
href={props.url}
-
target="_blank"
-
className="py-2 px-2 rounded-md flex flex-col gap-1 bg-border-light hover:bg-border hover:no-underline"
-
style={{
-
backgroundColor: isHovered
-
? "color-mix(in oklab, rgb(var(--accent-contrast)), rgb(var(--bg-page)) 85%)"
-
: "color-mix(in oklab, rgb(var(--accent-contrast)), rgb(var(--bg-page)) 75%)",
-
}}
-
onMouseEnter={handleMouseEnter}
-
onMouseLeave={handleMouseLeave}
-
>
-
<strong>{props.text}</strong>
-
</a>
-
);
-
};
-74
app/[leaflet_id]/actions/HomeButton.tsx
···
-
"use client";
-
import Link from "next/link";
-
import { useEntitySetContext } from "../../../components/EntitySetProvider";
-
import { ActionButton } from "components/ActionBar/ActionButton";
-
import { useSearchParams } from "next/navigation";
-
import { useIdentityData } from "../../../components/IdentityProvider";
-
import { useReplicache } from "src/replicache";
-
import { addLeafletToHome } from "actions/addLeafletToHome";
-
import { useSmoker } from "../../../components/Toast";
-
import { AddToHomeSmall } from "../../../components/Icons/AddToHomeSmall";
-
import { HomeSmall } from "../../../components/Icons/HomeSmall";
-
import { produce } from "immer";
-
-
export function HomeButton() {
-
let { permissions } = useEntitySetContext();
-
let searchParams = useSearchParams();
-
-
return (
-
<>
-
<Link
-
href="/home"
-
prefetch
-
className="hover:no-underline"
-
style={{ textDecorationLine: "none !important" }}
-
>
-
<ActionButton icon={<HomeSmall />} label="Go Home" />
-
</Link>
-
{<AddToHomeButton />}
-
</>
-
);
-
}
-
-
const AddToHomeButton = (props: {}) => {
-
let { permission_token } = useReplicache();
-
let { identity, mutate } = useIdentityData();
-
let smoker = useSmoker();
-
if (
-
identity?.permission_token_on_homepage.find(
-
(pth) => pth.permission_tokens.id === permission_token.id,
-
) ||
-
!identity
-
)
-
return null;
-
return (
-
<ActionButton
-
onClick={async (e) => {
-
await addLeafletToHome(permission_token.id);
-
mutate((identity) => {
-
if (!identity) return;
-
return produce<typeof identity>((draft) => {
-
draft.permission_token_on_homepage.push({
-
created_at: new Date().toISOString(),
-
archived: null,
-
permission_tokens: {
-
...permission_token,
-
leaflets_to_documents: [],
-
leaflets_in_publications: [],
-
},
-
});
-
})(identity);
-
});
-
smoker({
-
position: {
-
x: e.clientX + 64,
-
y: e.clientY,
-
},
-
text: "Leaflet added to your home!",
-
});
-
}}
-
icon={<AddToHomeSmall />}
-
label="Add to Home"
-
/>
-
);
-
};
-427
app/[leaflet_id]/actions/PublishButton.tsx
···
-
"use client";
-
import { publishToPublication } from "actions/publishToPublication";
-
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
-
import { ActionButton } from "components/ActionBar/ActionButton";
-
import {
-
PubIcon,
-
PubListEmptyContent,
-
PubListEmptyIllo,
-
} from "components/ActionBar/Publications";
-
import { ButtonPrimary, ButtonTertiary } from "components/Buttons";
-
import { AddSmall } from "components/Icons/AddSmall";
-
import { LooseLeafSmall } from "components/Icons/LooseleafSmall";
-
import { PublishSmall } from "components/Icons/PublishSmall";
-
import { useIdentityData } from "components/IdentityProvider";
-
import { InputWithLabel } from "components/Input";
-
import { Menu, MenuItem } from "components/Layout";
-
import {
-
useLeafletDomains,
-
useLeafletPublicationData,
-
} from "components/PageSWRDataProvider";
-
import { Popover } from "components/Popover";
-
import { SpeedyLink } from "components/SpeedyLink";
-
import { useToaster } from "components/Toast";
-
import { DotLoader } from "components/utils/DotLoader";
-
import { PubLeafletPublication } from "lexicons/api";
-
import { useParams, useRouter, useSearchParams } from "next/navigation";
-
import { useState, useMemo } from "react";
-
import { useIsMobile } from "src/hooks/isMobile";
-
import { useReplicache, useEntity } from "src/replicache";
-
import { Json } from "supabase/database.types";
-
import {
-
useBlocks,
-
useCanvasBlocksWithType,
-
} from "src/hooks/queries/useBlocks";
-
import * as Y from "yjs";
-
import * as base64 from "base64-js";
-
import { YJSFragmentToString } from "components/Blocks/TextBlock/RenderYJSFragment";
-
import { BlueskyLogin } from "app/login/LoginForm";
-
import { moveLeafletToPublication } from "actions/publications/moveLeafletToPublication";
-
import { AddTiny } from "components/Icons/AddTiny";
-
-
export const PublishButton = (props: { entityID: string }) => {
-
let { data: pub } = useLeafletPublicationData();
-
let params = useParams();
-
let router = useRouter();
-
-
if (!pub) return <PublishToPublicationButton entityID={props.entityID} />;
-
if (!pub?.doc)
-
return (
-
<ActionButton
-
primary
-
icon={<PublishSmall className="shrink-0" />}
-
label={"Publish!"}
-
onClick={() => {
-
router.push(`/${params.leaflet_id}/publish`);
-
}}
-
/>
-
);
-
-
return <UpdateButton />;
-
};
-
-
const UpdateButton = () => {
-
let [isLoading, setIsLoading] = useState(false);
-
let { data: pub, mutate } = useLeafletPublicationData();
-
let { permission_token, rootEntity } = useReplicache();
-
let { identity } = useIdentityData();
-
let toaster = useToaster();
-
-
return (
-
<ActionButton
-
primary
-
icon={<PublishSmall className="shrink-0" />}
-
label={isLoading ? <DotLoader /> : "Update!"}
-
onClick={async () => {
-
if (!pub) return;
-
setIsLoading(true);
-
let doc = await publishToPublication({
-
root_entity: rootEntity,
-
publication_uri: pub.publications?.uri,
-
leaflet_id: permission_token.id,
-
title: pub.title,
-
description: pub.description,
-
});
-
setIsLoading(false);
-
mutate();
-
-
// Generate URL based on whether it's in a publication or standalone
-
let docUrl = pub.publications
-
? `${getPublicationURL(pub.publications)}/${doc?.rkey}`
-
: `https://leaflet.pub/p/${identity?.atp_did}/${doc?.rkey}`;
-
-
toaster({
-
content: (
-
<div>
-
{pub.doc ? "Updated! " : "Published! "}
-
<SpeedyLink href={docUrl}>link</SpeedyLink>
-
</div>
-
),
-
type: "success",
-
});
-
}}
-
/>
-
);
-
};
-
-
const PublishToPublicationButton = (props: { entityID: string }) => {
-
let { identity } = useIdentityData();
-
let { permission_token } = useReplicache();
-
let query = useSearchParams();
-
console.log(query.get("publish"));
-
let [open, setOpen] = useState(query.get("publish") !== null);
-
-
let isMobile = useIsMobile();
-
identity && identity.atp_did && identity.publications.length > 0;
-
let [selectedPub, setSelectedPub] = useState<string | undefined>(undefined);
-
let router = useRouter();
-
let { title, entitiesToDelete } = useTitle(props.entityID);
-
let [description, setDescription] = useState("");
-
-
return (
-
<Popover
-
asChild
-
open={open}
-
onOpenChange={(o) => setOpen(o)}
-
side={isMobile ? "top" : "right"}
-
align={isMobile ? "center" : "start"}
-
className="sm:max-w-sm w-[1000px]"
-
trigger={
-
<ActionButton
-
primary
-
icon={<PublishSmall className="shrink-0" />}
-
label={"Publish on ATP"}
-
/>
-
}
-
>
-
{!identity || !identity.atp_did ? (
-
<div className="-mx-2 -my-1">
-
<div
-
className={`bg-[var(--accent-light)] w-full rounded-md flex flex-col text-center justify-center p-2 pb-4 text-sm`}
-
>
-
<div className="mx-auto pt-2 scale-90">
-
<PubListEmptyIllo />
-
</div>
-
<div className="pt-1 font-bold">Publish on AT Proto</div>
-
{
-
<>
-
<div className="pb-2 text-secondary text-xs">
-
Link a Bluesky account to start <br /> a publishing on AT
-
Proto
-
</div>
-
-
<BlueskyLogin
-
compact
-
redirectRoute={`/${permission_token.id}?publish`}
-
/>
-
</>
-
}
-
</div>
-
</div>
-
) : (
-
<div className="flex flex-col">
-
<PostDetailsForm
-
title={title}
-
description={description}
-
setDescription={setDescription}
-
/>
-
<hr className="border-border-light my-3" />
-
<div>
-
<PubSelector
-
publications={identity.publications}
-
selectedPub={selectedPub}
-
setSelectedPub={setSelectedPub}
-
/>
-
</div>
-
<hr className="border-border-light mt-3 mb-2" />
-
-
<div className="flex gap-2 items-center place-self-end">
-
{selectedPub !== "looseleaf" && selectedPub && (
-
<SaveAsDraftButton
-
selectedPub={selectedPub}
-
leafletId={permission_token.id}
-
metadata={{ title: title, description }}
-
entitiesToDelete={entitiesToDelete}
-
/>
-
)}
-
<ButtonPrimary
-
disabled={selectedPub === undefined}
-
onClick={async (e) => {
-
if (!selectedPub) return;
-
e.preventDefault();
-
if (selectedPub === "create") return;
-
-
// For looseleaf, navigate without publication_uri
-
if (selectedPub === "looseleaf") {
-
router.push(
-
`${permission_token.id}/publish?title=${encodeURIComponent(title)}&description=${encodeURIComponent(description)}&entitiesToDelete=${encodeURIComponent(JSON.stringify(entitiesToDelete))}`,
-
);
-
} else {
-
router.push(
-
`${permission_token.id}/publish?publication_uri=${encodeURIComponent(selectedPub)}&title=${encodeURIComponent(title)}&description=${encodeURIComponent(description)}&entitiesToDelete=${encodeURIComponent(JSON.stringify(entitiesToDelete))}`,
-
);
-
}
-
}}
-
>
-
Next{selectedPub === "create" && ": Create Pub!"}
-
</ButtonPrimary>
-
</div>
-
</div>
-
)}
-
</Popover>
-
);
-
};
-
-
const SaveAsDraftButton = (props: {
-
selectedPub: string | undefined;
-
leafletId: string;
-
metadata: { title: string; description: string };
-
entitiesToDelete: string[];
-
}) => {
-
let { mutate } = useLeafletPublicationData();
-
let { rep } = useReplicache();
-
let [isLoading, setIsLoading] = useState(false);
-
-
return (
-
<ButtonTertiary
-
onClick={async (e) => {
-
if (!props.selectedPub) return;
-
if (props.selectedPub === "create") return;
-
e.preventDefault();
-
setIsLoading(true);
-
await moveLeafletToPublication(
-
props.leafletId,
-
props.selectedPub,
-
props.metadata,
-
props.entitiesToDelete,
-
);
-
await Promise.all([rep?.pull(), mutate()]);
-
setIsLoading(false);
-
}}
-
>
-
{isLoading ? <DotLoader /> : "Save as Draft"}
-
</ButtonTertiary>
-
);
-
};
-
-
const PostDetailsForm = (props: {
-
title: string;
-
description: string;
-
setDescription: (d: string) => void;
-
}) => {
-
return (
-
<div className=" flex flex-col gap-1">
-
<div className="text-sm text-tertiary">Post Details</div>
-
<div className="flex flex-col gap-2">
-
<InputWithLabel label="Title" value={props.title} disabled />
-
<InputWithLabel
-
label="Description (optional)"
-
textarea
-
value={props.description}
-
className="h-[4lh]"
-
onChange={(e) => props.setDescription(e.currentTarget.value)}
-
/>
-
</div>
-
</div>
-
);
-
};
-
-
const PubSelector = (props: {
-
selectedPub: string | undefined;
-
setSelectedPub: (s: string) => void;
-
publications: {
-
identity_did: string;
-
indexed_at: string;
-
name: string;
-
record: Json | null;
-
uri: string;
-
}[];
-
}) => {
-
// HEY STILL TO DO
-
// test out logged out, logged in but no pubs, and pubbed up flows
-
-
return (
-
<div className="flex flex-col gap-1">
-
<div className="text-sm text-tertiary">Publish to…</div>
-
{props.publications.length === 0 || props.publications === undefined ? (
-
<div className="flex flex-col gap-1">
-
<div className="flex gap-2 menuItem">
-
<LooseLeafSmall className="shrink-0" />
-
<div className="flex flex-col leading-snug">
-
<div className="text-secondary font-bold">
-
Publish as Looseleaf
-
</div>
-
<div className="text-tertiary text-sm font-normal">
-
Publish this as a one off doc to AT Proto
-
</div>
-
</div>
-
</div>
-
<div className="flex gap-2 px-2 py-1 ">
-
<PublishSmall className="shrink-0 text-border" />
-
<div className="flex flex-col leading-snug">
-
<div className="text-border font-bold">
-
Publish to Publication
-
</div>
-
<div className="text-border text-sm font-normal">
-
Publish your writing to a blog on AT Proto
-
</div>
-
<hr className="my-2 drashed border-border-light border-dashed" />
-
<div className="text-tertiary text-sm font-normal ">
-
You don't have any Publications yet.{" "}
-
<a target="_blank" href="/lish/createPub">
-
Create one
-
</a>{" "}
-
to get started!
-
</div>
-
</div>
-
</div>
-
</div>
-
) : (
-
<div className="flex flex-col gap-1">
-
<PubOption
-
selected={props.selectedPub === "looseleaf"}
-
onSelect={() => props.setSelectedPub("looseleaf")}
-
>
-
<LooseLeafSmall />
-
Publish as Looseleaf
-
</PubOption>
-
<hr className="border-border-light border-dashed " />
-
{props.publications.map((p) => {
-
let pubRecord = p.record as PubLeafletPublication.Record;
-
return (
-
<PubOption
-
key={p.uri}
-
selected={props.selectedPub === p.uri}
-
onSelect={() => props.setSelectedPub(p.uri)}
-
>
-
<>
-
<PubIcon record={pubRecord} uri={p.uri} />
-
{p.name}
-
</>
-
</PubOption>
-
);
-
})}
-
<div className="flex items-center px-2 py-1 text-accent-contrast gap-2">
-
<AddTiny className="m-1 shrink-0" />
-
-
<a target="_blank" href="/lish/createPub">
-
Start a new Publication
-
</a>
-
</div>
-
</div>
-
)}
-
</div>
-
);
-
};
-
-
const PubOption = (props: {
-
selected: boolean;
-
onSelect: () => void;
-
children: React.ReactNode;
-
}) => {
-
return (
-
<button
-
className={`flex gap-2 menuItem font-bold text-secondary ${props.selected && "bg-[var(--accent-light)]! outline! outline-offset-1! outline-accent-contrast!"}`}
-
onClick={() => {
-
props.onSelect();
-
}}
-
>
-
{props.children}
-
</button>
-
);
-
};
-
-
let useTitle = (entityID: string) => {
-
let rootPage = useEntity(entityID, "root/page")[0].data.value;
-
let canvasBlocks = useCanvasBlocksWithType(rootPage).filter(
-
(b) => b.type === "text" || b.type === "heading",
-
);
-
let blocks = useBlocks(rootPage).filter(
-
(b) => b.type === "text" || b.type === "heading",
-
);
-
let firstBlock = canvasBlocks[0] || blocks[0];
-
-
let firstBlockText = useEntity(firstBlock?.value, "block/text")?.data.value;
-
-
const leafletTitle = useMemo(() => {
-
if (!firstBlockText) return "Untitled";
-
let doc = new Y.Doc();
-
const update = base64.toByteArray(firstBlockText);
-
Y.applyUpdate(doc, update);
-
let nodes = doc.getXmlElement("prosemirror").toArray();
-
return YJSFragmentToString(nodes[0]) || "Untitled";
-
}, [firstBlockText]);
-
-
// Only handle second block logic for linear documents, not canvas
-
let isCanvas = canvasBlocks.length > 0;
-
let secondBlock = !isCanvas ? blocks[1] : undefined;
-
let secondBlockTextValue = useEntity(secondBlock?.value || null, "block/text")
-
?.data.value;
-
const secondBlockText = useMemo(() => {
-
if (!secondBlockTextValue) return "";
-
let doc = new Y.Doc();
-
const update = base64.toByteArray(secondBlockTextValue);
-
Y.applyUpdate(doc, update);
-
let nodes = doc.getXmlElement("prosemirror").toArray();
-
return YJSFragmentToString(nodes[0]) || "";
-
}, [secondBlockTextValue]);
-
-
let entitiesToDelete = useMemo(() => {
-
let etod: string[] = [];
-
// Only delete first block if it's a heading type
-
if (firstBlock?.type === "heading") {
-
etod.push(firstBlock.value);
-
}
-
// Delete second block if it's empty text (only for linear documents)
-
if (
-
!isCanvas &&
-
secondBlockText.trim() === "" &&
-
secondBlock?.type === "text"
-
) {
-
etod.push(secondBlock.value);
-
}
-
return etod;
-
}, [firstBlock, secondBlockText, secondBlock, isCanvas]);
-
-
return { title: leafletTitle, entitiesToDelete };
-
};
-394
app/[leaflet_id]/actions/ShareOptions/DomainOptions.tsx
···
-
import { useState } from "react";
-
import { ButtonPrimary } from "components/Buttons";
-
-
import { useSmoker, useToaster } from "components/Toast";
-
import { Input, InputWithLabel } from "components/Input";
-
import useSWR from "swr";
-
import { useIdentityData } from "components/IdentityProvider";
-
import { addDomain } from "actions/domains/addDomain";
-
import { callRPC } from "app/api/rpc/client";
-
import { useLeafletDomains } from "components/PageSWRDataProvider";
-
import { useReadOnlyShareLink } from ".";
-
import { addDomainPath } from "actions/domains/addDomainPath";
-
import { useReplicache } from "src/replicache";
-
import { deleteDomain } from "actions/domains/deleteDomain";
-
import { AddTiny } from "components/Icons/AddTiny";
-
-
type DomainMenuState =
-
| {
-
state: "default";
-
}
-
| {
-
state: "domain-settings";
-
domain: string;
-
}
-
| {
-
state: "add-domain";
-
}
-
| {
-
state: "has-domain";
-
domain: string;
-
};
-
export function CustomDomainMenu(props: {
-
setShareMenuState: (s: "default") => void;
-
}) {
-
let { data: domains } = useLeafletDomains();
-
let [state, setState] = useState<DomainMenuState>(
-
domains?.[0]
-
? { state: "has-domain", domain: domains[0].domain }
-
: { state: "default" },
-
);
-
switch (state.state) {
-
case "has-domain":
-
case "default":
-
return (
-
<DomainOptions
-
setDomainMenuState={setState}
-
domainConnected={false}
-
setShareMenuState={props.setShareMenuState}
-
/>
-
);
-
case "domain-settings":
-
return (
-
<DomainSettings domain={state.domain} setDomainMenuState={setState} />
-
);
-
case "add-domain":
-
return <AddDomain setDomainMenuState={setState} />;
-
}
-
}
-
-
export const DomainOptions = (props: {
-
setShareMenuState: (s: "default") => void;
-
setDomainMenuState: (state: DomainMenuState) => void;
-
domainConnected: boolean;
-
}) => {
-
let { data: domains, mutate: mutateDomains } = useLeafletDomains();
-
let [selectedDomain, setSelectedDomain] = useState<string | undefined>(
-
domains?.[0]?.domain,
-
);
-
let [selectedRoute, setSelectedRoute] = useState(
-
domains?.[0]?.route.slice(1) || "",
-
);
-
let { identity } = useIdentityData();
-
let { permission_token } = useReplicache();
-
-
let toaster = useToaster();
-
let smoker = useSmoker();
-
let publishLink = useReadOnlyShareLink();
-
-
return (
-
<div className="px-3 py-1 flex flex-col gap-3 max-w-full w-[600px]">
-
<h3 className="text-secondary">Choose a Domain</h3>
-
<div className="flex flex-col gap-1 text-secondary">
-
{identity?.custom_domains
-
.filter((d) => !d.publication_domains.length)
-
.map((domain) => {
-
return (
-
<DomainOption
-
selectedRoute={selectedRoute}
-
setSelectedRoute={setSelectedRoute}
-
key={domain.domain}
-
domain={domain.domain}
-
checked={selectedDomain === domain.domain}
-
setChecked={setSelectedDomain}
-
setDomainMenuState={props.setDomainMenuState}
-
/>
-
);
-
})}
-
<button
-
onMouseDown={() => {
-
props.setDomainMenuState({ state: "add-domain" });
-
}}
-
className="text-accent-contrast flex gap-2 items-center px-1 py-0.5"
-
>
-
<AddTiny /> Add a New Domain
-
</button>
-
</div>
-
-
{/* ONLY SHOW IF A DOMAIN IS CURRENTLY CONNECTED */}
-
<div className="flex gap-3 items-center justify-end">
-
{props.domainConnected && (
-
<button
-
onMouseDown={() => {
-
props.setShareMenuState("default");
-
toaster({
-
content: (
-
<div className="font-bold">
-
Unpublished from custom domain!
-
</div>
-
),
-
type: "error",
-
});
-
}}
-
>
-
Unpublish
-
</button>
-
)}
-
-
<ButtonPrimary
-
id="publish-to-domain"
-
disabled={
-
domains?.[0]
-
? domains[0].domain === selectedDomain &&
-
domains[0].route.slice(1) === selectedRoute
-
: !selectedDomain
-
}
-
onClick={async () => {
-
// let rect = document
-
// .getElementById("publish-to-domain")
-
// ?.getBoundingClientRect();
-
// smoker({
-
// error: true,
-
// text: "url already in use!",
-
// position: {
-
// x: rect ? rect.left : 0,
-
// y: rect ? rect.top + 26 : 0,
-
// },
-
// });
-
if (!selectedDomain || !publishLink) return;
-
await addDomainPath({
-
domain: selectedDomain,
-
route: "/" + selectedRoute,
-
view_permission_token: publishLink,
-
edit_permission_token: permission_token.id,
-
});
-
-
toaster({
-
content: (
-
<div className="font-bold">
-
Published to custom domain!{" "}
-
<a
-
className="underline text-accent-2"
-
href={`https://${selectedDomain}/${selectedRoute}`}
-
target="_blank"
-
>
-
View
-
</a>
-
</div>
-
),
-
type: "success",
-
});
-
mutateDomains();
-
props.setShareMenuState("default");
-
}}
-
>
-
Publish!
-
</ButtonPrimary>
-
</div>
-
</div>
-
);
-
};
-
-
const DomainOption = (props: {
-
selectedRoute: string;
-
setSelectedRoute: (s: string) => void;
-
checked: boolean;
-
setChecked: (checked: string) => void;
-
domain: string;
-
setDomainMenuState: (state: DomainMenuState) => void;
-
}) => {
-
let [value, setValue] = useState("");
-
let { data } = useSWR(props.domain, async (domain) => {
-
return await callRPC("get_domain_status", { domain });
-
});
-
let pending = data?.config?.misconfigured || data?.error;
-
return (
-
<label htmlFor={props.domain}>
-
<input
-
type="radio"
-
name={props.domain}
-
id={props.domain}
-
value={props.domain}
-
checked={props.checked}
-
className="hidden appearance-none"
-
onChange={() => {
-
if (pending) return;
-
props.setChecked(props.domain);
-
}}
-
/>
-
<div
-
className={`
-
px-[6px] py-1
-
flex
-
border rounded-md
-
${
-
pending
-
? "border-border-light text-secondary justify-between gap-2 items-center "
-
: !props.checked
-
? "flex-wrap border-border-light"
-
: "flex-wrap border-accent-1 bg-accent-1 text-accent-2 font-bold"
-
} `}
-
>
-
<div className={`w-max truncate ${pending && "animate-pulse"}`}>
-
{props.domain}
-
</div>
-
{props.checked && (
-
<div className="flex gap-0 w-full">
-
<span
-
className="font-normal"
-
style={value === "" ? { opacity: "0.5" } : {}}
-
>
-
/
-
</span>
-
-
<Input
-
type="text"
-
autoFocus
-
className="appearance-none focus:outline-hidden font-normal text-accent-2 w-full bg-transparent placeholder:text-accent-2 placeholder:opacity-50"
-
placeholder="add-optional-path"
-
onChange={(e) => props.setSelectedRoute(e.target.value)}
-
value={props.selectedRoute}
-
/>
-
</div>
-
)}
-
{pending && (
-
<button
-
className="text-accent-contrast text-sm"
-
onMouseDown={() => {
-
props.setDomainMenuState({
-
state: "domain-settings",
-
domain: props.domain,
-
});
-
}}
-
>
-
pending
-
</button>
-
)}
-
</div>
-
</label>
-
);
-
};
-
-
export const AddDomain = (props: {
-
setDomainMenuState: (state: DomainMenuState) => void;
-
}) => {
-
let [value, setValue] = useState("");
-
let { mutate } = useIdentityData();
-
let smoker = useSmoker();
-
return (
-
<div className="flex flex-col gap-1 px-3 py-1 max-w-full w-[600px]">
-
<div>
-
<h3 className="text-secondary">Add a New Domain</h3>
-
<div className="text-xs italic text-secondary">
-
Don't include the protocol or path, just the base domain name for now
-
</div>
-
</div>
-
-
<Input
-
className="input-with-border text-primary"
-
placeholder="www.example.com"
-
value={value}
-
onChange={(e) => setValue(e.target.value)}
-
/>
-
-
<ButtonPrimary
-
disabled={!value}
-
className="place-self-end mt-2"
-
onMouseDown={async (e) => {
-
// call the vercel api, set the thing...
-
let { error } = await addDomain(value);
-
if (error) {
-
smoker({
-
error: true,
-
text:
-
error === "invalid_domain"
-
? "Invalid domain! Use just the base domain"
-
: error === "domain_already_in_use"
-
? "That domain is already in use!"
-
: "An unknown error occured",
-
position: {
-
y: e.clientY,
-
x: e.clientX - 5,
-
},
-
});
-
return;
-
}
-
mutate();
-
props.setDomainMenuState({ state: "domain-settings", domain: value });
-
}}
-
>
-
Verify Domain
-
</ButtonPrimary>
-
</div>
-
);
-
};
-
-
const DomainSettings = (props: {
-
domain: string;
-
setDomainMenuState: (s: DomainMenuState) => void;
-
}) => {
-
let isSubdomain = props.domain.split(".").length > 2;
-
return (
-
<div className="flex flex-col gap-1 px-3 py-1 max-w-full w-[600px]">
-
<h3 className="text-secondary">Verify Domain</h3>
-
-
<div className="text-secondary text-sm flex flex-col gap-3">
-
<div className="flex flex-col gap-[6px]">
-
<div>
-
To verify this domain, add the following record to your DNS provider
-
for <strong>{props.domain}</strong>.
-
</div>
-
-
{isSubdomain ? (
-
<div className="flex gap-3 p-1 border border-border-light rounded-md py-1">
-
<div className="flex flex-col ">
-
<div className="text-tertiary">Type</div>
-
<div>CNAME</div>
-
</div>
-
<div className="flex flex-col">
-
<div className="text-tertiary">Name</div>
-
<div style={{ wordBreak: "break-word" }}>
-
{props.domain.split(".").slice(0, -2).join(".")}
-
</div>
-
</div>
-
<div className="flex flex-col">
-
<div className="text-tertiary">Value</div>
-
<div style={{ wordBreak: "break-word" }}>
-
cname.vercel-dns.com
-
</div>
-
</div>
-
</div>
-
) : (
-
<div className="flex gap-3 p-1 border border-border-light rounded-md py-1">
-
<div className="flex flex-col ">
-
<div className="text-tertiary">Type</div>
-
<div>A</div>
-
</div>
-
<div className="flex flex-col">
-
<div className="text-tertiary">Name</div>
-
<div>@</div>
-
</div>
-
<div className="flex flex-col">
-
<div className="text-tertiary">Value</div>
-
<div>76.76.21.21</div>
-
</div>
-
</div>
-
)}
-
</div>
-
<div>
-
Once you do this, the status may be pending for up to a few hours.
-
</div>
-
<div>Check back later to see if verification was successful.</div>
-
</div>
-
-
<div className="flex gap-3 justify-between items-center mt-2">
-
<button
-
className="text-accent-contrast font-bold "
-
onMouseDown={async () => {
-
await deleteDomain({ domain: props.domain });
-
props.setDomainMenuState({ state: "default" });
-
}}
-
>
-
Delete Domain
-
</button>
-
<ButtonPrimary
-
onMouseDown={() => {
-
props.setDomainMenuState({ state: "default" });
-
}}
-
>
-
Back to Domains
-
</ButtonPrimary>
-
</div>
-
</div>
-
);
-
};
-70
app/[leaflet_id]/actions/ShareOptions/getShareLink.ts
···
-
"use server";
-
-
import { eq, and } from "drizzle-orm";
-
import { drizzle } from "drizzle-orm/node-postgres";
-
import { permission_token_rights, permission_tokens } from "drizzle/schema";
-
import { pool } from "supabase/pool";
-
export async function getShareLink(
-
token: { id: string; entity_set: string },
-
rootEntity: string,
-
) {
-
const client = await pool.connect();
-
const db = drizzle(client);
-
let link = await db.transaction(async (tx) => {
-
// This will likely error out when if we have multiple permission
-
// token rights associated with a single token
-
let [tokenW] = await tx
-
.select()
-
.from(permission_tokens)
-
.leftJoin(
-
permission_token_rights,
-
eq(permission_token_rights.token, permission_tokens.id),
-
)
-
.where(eq(permission_tokens.id, token.id));
-
if (
-
!tokenW.permission_token_rights ||
-
tokenW.permission_token_rights.create_token !== true ||
-
tokenW.permission_tokens.root_entity !== rootEntity ||
-
tokenW.permission_token_rights.entity_set !== token.entity_set
-
) {
-
return null;
-
}
-
-
let [existingToken] = await tx
-
.select()
-
.from(permission_tokens)
-
.rightJoin(
-
permission_token_rights,
-
eq(permission_token_rights.token, permission_tokens.id),
-
)
-
.where(
-
and(
-
eq(permission_token_rights.read, true),
-
eq(permission_token_rights.write, false),
-
eq(permission_token_rights.create_token, false),
-
eq(permission_token_rights.change_entity_set, false),
-
eq(permission_token_rights.entity_set, token.entity_set),
-
eq(permission_tokens.root_entity, rootEntity),
-
),
-
);
-
if (existingToken) {
-
return existingToken.permission_tokens;
-
}
-
let [newToken] = await tx
-
.insert(permission_tokens)
-
.values({ root_entity: rootEntity })
-
.returning();
-
await tx.insert(permission_token_rights).values({
-
entity_set: token.entity_set,
-
token: newToken.id,
-
read: true,
-
write: false,
-
create_token: false,
-
change_entity_set: false,
-
});
-
return newToken;
-
});
-
-
client.release();
-
return link;
-
}
-257
app/[leaflet_id]/actions/ShareOptions/index.tsx
···
-
import { useReplicache } from "src/replicache";
-
import React, { useEffect, useState } from "react";
-
import { getShareLink } from "./getShareLink";
-
import { useEntitySetContext } from "components/EntitySetProvider";
-
import { useSmoker } from "components/Toast";
-
import { Menu, MenuItem } from "components/Layout";
-
import { ActionButton } from "components/ActionBar/ActionButton";
-
import useSWR from "swr";
-
import LoginForm from "app/login/LoginForm";
-
import { CustomDomainMenu } from "./DomainOptions";
-
import { useIdentityData } from "components/IdentityProvider";
-
import {
-
useLeafletDomains,
-
useLeafletPublicationData,
-
} from "components/PageSWRDataProvider";
-
import { ShareSmall } from "components/Icons/ShareSmall";
-
import { PubLeafletDocument } from "lexicons/api";
-
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
-
import { AtUri } from "@atproto/syntax";
-
import { useIsMobile } from "src/hooks/isMobile";
-
-
export type ShareMenuStates = "default" | "login" | "domain";
-
-
export let useReadOnlyShareLink = () => {
-
let { permission_token, rootEntity } = useReplicache();
-
let entity_set = useEntitySetContext();
-
let { data: publishLink } = useSWR(
-
"publishLink-" + permission_token.id,
-
async () => {
-
if (
-
!permission_token.permission_token_rights.find(
-
(s) => s.entity_set === entity_set.set && s.create_token,
-
)
-
)
-
return;
-
let shareLink = await getShareLink(
-
{ id: permission_token.id, entity_set: entity_set.set },
-
rootEntity,
-
);
-
return shareLink?.id;
-
},
-
);
-
return publishLink;
-
};
-
-
export function ShareOptions() {
-
let [menuState, setMenuState] = useState<ShareMenuStates>("default");
-
let { data: pub } = useLeafletPublicationData();
-
let isMobile = useIsMobile();
-
-
return (
-
<Menu
-
asChild
-
side={isMobile ? "top" : "right"}
-
align={isMobile ? "center" : "start"}
-
className="max-w-xs"
-
onOpenChange={() => {
-
setMenuState("default");
-
}}
-
trigger={
-
<ActionButton
-
icon=<ShareSmall />
-
secondary
-
label={`Share ${pub ? "Draft" : ""}`}
-
/>
-
}
-
>
-
{menuState === "login" ? (
-
<div className="px-3 py-1">
-
<LoginForm text="Save your Leaflets and access them on multiple devices!" />
-
</div>
-
) : menuState === "domain" ? (
-
<CustomDomainMenu setShareMenuState={setMenuState} />
-
) : (
-
<ShareMenu
-
setMenuState={setMenuState}
-
domainConnected={false}
-
isPub={!!pub}
-
/>
-
)}
-
</Menu>
-
);
-
}
-
-
const ShareMenu = (props: {
-
setMenuState: (state: ShareMenuStates) => void;
-
domainConnected: boolean;
-
isPub?: boolean;
-
}) => {
-
let { permission_token } = useReplicache();
-
let { data: pub } = useLeafletPublicationData();
-
-
let record = pub?.documents?.data as PubLeafletDocument.Record | null;
-
-
let docURI = pub?.documents ? new AtUri(pub?.documents.uri) : null;
-
let postLink = !docURI
-
? null
-
: pub?.publications
-
? `${getPublicationURL(pub.publications)}/${docURI.rkey}`
-
: `p/${docURI.host}/${docURI.rkey}`;
-
let publishLink = useReadOnlyShareLink();
-
let [collabLink, setCollabLink] = useState<null | string>(null);
-
useEffect(() => {
-
// strip leading '/' character from pathname
-
setCollabLink(window.location.pathname.slice(1));
-
}, []);
-
let { data: domains } = useLeafletDomains();
-
-
return (
-
<>
-
<ShareButton
-
text={`Share ${postLink ? "Draft" : ""} Edit Link`}
-
subtext=""
-
smokerText="Edit link copied!"
-
id="get-edit-link"
-
link={collabLink}
-
/>
-
<ShareButton
-
text={`Share ${postLink ? "Draft" : ""} View Link`}
-
subtext=<>
-
{domains?.[0] ? (
-
<>
-
This Leaflet is published on{" "}
-
<span className="italic underline">
-
{domains[0].domain}
-
{domains[0].route}
-
</span>
-
</>
-
) : (
-
""
-
)}
-
</>
-
smokerText="View link copied!"
-
id="get-view-link"
-
fullLink={
-
domains?.[0]
-
? `https://${domains[0].domain}${domains[0].route}`
-
: undefined
-
}
-
link={publishLink || ""}
-
/>
-
{postLink && (
-
<>
-
<hr className="border-border-light" />
-
-
<ShareButton
-
text="Share Published Link"
-
subtext=""
-
smokerText="Post link copied!"
-
id="get-post-link"
-
fullLink={postLink.includes("http") ? postLink : undefined}
-
link={postLink}
-
/>
-
</>
-
)}
-
{!props.isPub && (
-
<>
-
<hr className="border-border mt-1" />
-
<DomainMenuItem setMenuState={props.setMenuState} />
-
</>
-
)}
-
</>
-
);
-
};
-
-
export const ShareButton = (props: {
-
text: React.ReactNode;
-
subtext?: React.ReactNode;
-
smokerText: string;
-
id: string;
-
link: null | string;
-
fullLink?: string;
-
className?: string;
-
}) => {
-
let smoker = useSmoker();
-
-
return (
-
<MenuItem
-
id={props.id}
-
onSelect={(e) => {
-
e.preventDefault();
-
let rect = document.getElementById(props.id)?.getBoundingClientRect();
-
if (props.link || props.fullLink) {
-
navigator.clipboard.writeText(
-
props.fullLink
-
? props.fullLink
-
: `${location.protocol}//${location.host}/${props.link}`,
-
);
-
smoker({
-
position: {
-
x: rect ? rect.left + (rect.right - rect.left) / 2 : 0,
-
y: rect ? rect.top + 26 : 0,
-
},
-
text: props.smokerText,
-
});
-
}
-
}}
-
>
-
<div className={`group/${props.id} ${props.className} leading-snug`}>
-
{props.text}
-
-
{props.subtext && (
-
<div className={`text-sm font-normal text-tertiary`}>
-
{props.subtext}
-
</div>
-
)}
-
</div>
-
</MenuItem>
-
);
-
};
-
-
const DomainMenuItem = (props: {
-
setMenuState: (state: ShareMenuStates) => void;
-
}) => {
-
let { identity } = useIdentityData();
-
let { data: domains } = useLeafletDomains();
-
-
if (identity === null)
-
return (
-
<div className="text-tertiary font-normal text-sm px-3 py-1">
-
<button
-
className="text-accent-contrast hover:font-bold"
-
onClick={() => {
-
props.setMenuState("login");
-
}}
-
>
-
Log In
-
</button>{" "}
-
to publish on a custom domain!
-
</div>
-
);
-
else
-
return (
-
<>
-
{domains?.[0] ? (
-
<button
-
className="px-3 py-1 text-accent-contrast text-sm hover:font-bold w-fit text-left"
-
onMouseDown={() => {
-
props.setMenuState("domain");
-
}}
-
>
-
Edit custom domain
-
</button>
-
) : (
-
<MenuItem
-
className="font-normal text-tertiary text-sm"
-
onSelect={(e) => {
-
e.preventDefault();
-
props.setMenuState("domain");
-
}}
-
>
-
Publish on a custom domain
-
</MenuItem>
-
)}
-
</>
-
);
-
};
+2 -4
app/[leaflet_id]/icon.tsx
···
process.env.SUPABASE_SERVICE_ROLE_KEY as string,
{ cookies: {} },
);
-
export default async function Icon(props: {
-
params: Promise<{ leaflet_id: string }>;
-
}) {
+
export default async function Icon(props: { params: { leaflet_id: string } }) {
let res = await supabase
.from("permission_tokens")
.select("*, permission_token_rights(*)")
-
.eq("id", (await props.params).leaflet_id)
+
.eq("id", props.params.leaflet_id)
.single();
let rootEntity = res.data?.root_entity;
let outlineColor, fillColor;
+2 -3
app/[leaflet_id]/opengraph-image.tsx
···
export const revalidate = 60;
export default async function OpenGraphImage(props: {
-
params: Promise<{ leaflet_id: string }>;
+
params: { leaflet_id: string };
}) {
-
let params = await props.params;
-
return getMicroLinkOgImage(`/${params.leaflet_id}`);
+
return getMicroLinkOgImage(`/${props.params.leaflet_id}`);
}
+5 -2
app/[leaflet_id]/page.tsx
···
import { supabaseServerClient } from "supabase/serverClient";
import { get_leaflet_data } from "app/api/rpc/[command]/get_leaflet_data";
import { NotFoundLayout } from "components/PageLayouts/NotFoundLayout";
-
import { getPublicationMetadataFromLeafletData } from "src/utils/getPublicationMetadataFromLeafletData";
export const preferredRegion = ["sfo1"];
export const dynamic = "force-dynamic";
···
);
let rootEntity = res.data?.root_entity;
if (!rootEntity || !res.data) return { title: "Leaflet not found" };
-
let publication_data = getPublicationMetadataFromLeafletData(res.data);
+
let publication_data =
+
res.data?.leaflets_in_publications?.[0] ||
+
res.data?.permission_token_rights[0].entity_sets?.permission_tokens?.find(
+
(p) => p.leaflets_in_publications.length,
+
)?.leaflets_in_publications?.[0];
if (publication_data) {
return {
title: publication_data.title || "Untitled",
+1 -3
app/[leaflet_id]/publish/BskyPostEditorProsemirror.tsx
···
view.updateState(newState);
setEditorState(newState);
props.editorStateRef.current = newState;
-
props.onCharCountChange?.(
-
newState.doc.textContent.length + newState.doc.children.length - 1,
-
);
+
props.onCharCountChange?.(newState.doc.textContent.length);
},
},
);
+17 -68
app/[leaflet_id]/publish/PublishPost.tsx
···
editorStateToFacetedText,
} from "./BskyPostEditorProsemirror";
import { EditorState } from "prosemirror-state";
-
import { LooseLeafSmall } from "components/Icons/LooseleafSmall";
-
import { PubIcon } from "components/ActionBar/Publications";
type Props = {
title: string;
···
root_entity: string;
profile: ProfileViewDetailed;
description: string;
-
publication_uri?: string;
+
publication_uri: string;
record?: PubLeafletPublication.Record;
posts_in_pub?: number;
-
entitiesToDelete?: string[];
};
export function PublishPost(props: Props) {
···
leaflet_id: props.leaflet_id,
title: props.title,
description: props.description,
-
entitiesToDelete: props.entitiesToDelete,
});
if (!doc) return;
-
// Generate post URL based on whether it's in a publication or standalone
-
let post_url = props.record?.base_path
-
? `https://${props.record.base_path}/${doc.rkey}`
-
: `https://leaflet.pub/p/${props.profile.did}/${doc.rkey}`;
-
+
let post_url = `https://${props.record?.base_path}/${doc.rkey}`;
let [text, facets] = editorStateRef.current
? editorStateToFacetedText(editorStateRef.current)
: [];
···
}
return (
-
<div className="flex flex-col gap-4 w-[640px] max-w-full sm:px-4 px-3 text-primary">
+
<div className="flex flex-col gap-4 w-[640px] max-w-full sm:px-4 px-3">
+
<h3>Publish Options</h3>
<form
onSubmit={(e) => {
e.preventDefault();
···
}}
>
<div className="container flex flex-col gap-2 sm:p-3 p-4">
-
<PublishingTo
-
publication_uri={props.publication_uri}
-
record={props.record}
-
/>
-
<hr className="border-border-light my-1" />
<Radio
checked={shareOption === "quiet"}
onChange={(e) => {
···
/>
</div>
<div className="opaque-container overflow-hidden flex flex-col mt-4 w-full">
+
{/* <div className="h-[260px] w-full bg-test" /> */}
<div className="flex flex-col p-2">
<div className="font-bold">{props.title}</div>
<div className="text-tertiary">{props.description}</div>
-
{props.record && (
-
<>
-
<hr className="border-border-light mt-2 mb-1" />
-
<p className="text-xs text-tertiary">
-
{props.record?.base_path}
-
</p>
-
</>
-
)}
+
<hr className="border-border-light mt-2 mb-1" />
+
<p className="text-xs text-tertiary">
+
{props.record?.base_path}
+
</p>
</div>
</div>
<div className="text-xs text-secondary italic place-self-end pt-2">
···
);
};
-
const PublishingTo = (props: {
-
publication_uri?: string;
-
record?: PubLeafletPublication.Record;
-
}) => {
-
if (props.publication_uri && props.record) {
-
return (
-
<div className="flex flex-col gap-1">
-
<h3>Publishing to</h3>
-
<div className="flex gap-2 items-center p-2 rounded-md bg-[var(--accent-light)]">
-
<PubIcon record={props.record} uri={props.publication_uri} />
-
<div className="font-bold text-secondary">{props.record.name}</div>
-
</div>
-
</div>
-
);
-
}
-
-
return (
-
<div className="flex flex-col gap-1">
-
<h3>Publishing as</h3>
-
<div className="flex gap-2 items-center p-2 rounded-md bg-[var(--accent-light)]">
-
<LooseLeafSmall className="shrink-0" />
-
<div className="font-bold text-secondary">Looseleaf</div>
-
</div>
-
</div>
-
);
-
};
-
const PublishPostSuccess = (props: {
post_url: string;
-
publication_uri?: string;
+
publication_uri: string;
record: Props["record"];
posts_in_pub: number;
}) => {
-
let uri = props.publication_uri ? new AtUri(props.publication_uri) : null;
+
let uri = new AtUri(props.publication_uri);
return (
<div className="container p-4 m-3 sm:m-4 flex flex-col gap-1 justify-center text-center w-fit h-fit mx-auto">
<PublishIllustration posts_in_pub={props.posts_in_pub} />
<h2 className="pt-2">Published!</h2>
-
{uri && props.record ? (
-
<Link
-
className="hover:no-underline! font-bold place-self-center pt-2"
-
href={`/lish/${uri.host}/${encodeURIComponent(props.record.name || "")}/dashboard`}
-
>
-
<ButtonPrimary>Back to Dashboard</ButtonPrimary>
-
</Link>
-
) : (
-
<Link
-
className="hover:no-underline! font-bold place-self-center pt-2"
-
href="/"
-
>
-
<ButtonPrimary>Back to Home</ButtonPrimary>
-
</Link>
-
)}
+
<Link
+
className="hover:no-underline! font-bold place-self-center pt-2"
+
href={`/lish/${uri.host}/${encodeURIComponent(props.record?.name || "")}/dashboard`}
+
>
+
<ButtonPrimary>Back to Dashboard</ButtonPrimary>
+
</Link>
<a href={props.post_url}>See published post</a>
</div>
);
+9 -63
app/[leaflet_id]/publish/page.tsx
···
type Props = {
// this is now a token id not leaflet! Should probs rename
params: Promise<{ leaflet_id: string }>;
-
searchParams: Promise<{
-
publication_uri: string;
-
title: string;
-
description: string;
-
entitiesToDelete: string;
-
}>;
};
export default async function PublishLeafletPage(props: Props) {
let leaflet_id = (await props.params).leaflet_id;
···
*,
documents_in_publications(count)
),
-
documents(*)),
-
leaflets_to_documents(
-
*,
-
documents(*)
-
)`,
+
documents(*))`,
)
.eq("id", leaflet_id)
.single();
let rootEntity = data?.root_entity;
-
-
// Try to find publication from leaflets_in_publications first
-
let publication = data?.leaflets_in_publications[0]?.publications;
-
-
// If not found, check if publication_uri is in searchParams
-
if (!publication) {
-
let pub_uri = (await props.searchParams).publication_uri;
-
if (pub_uri) {
-
console.log(decodeURIComponent(pub_uri));
-
let { data: pubData, error } = await supabaseServerClient
-
.from("publications")
-
.select("*, documents_in_publications(count)")
-
.eq("uri", decodeURIComponent(pub_uri))
-
.single();
-
console.log(error);
-
publication = pubData;
-
}
-
}
-
-
// Check basic data requirements
-
if (!data || !rootEntity)
+
if (!data || !rootEntity || !data.leaflets_in_publications[0])
return (
<div>
missin something
···
let identity = await getIdentityData();
if (!identity || !identity.atp_did) return null;
-
-
// Get title and description from either source
-
let title =
-
data.leaflets_in_publications[0]?.title ||
-
data.leaflets_to_documents[0]?.title ||
-
decodeURIComponent((await props.searchParams).title || "");
-
let description =
-
data.leaflets_in_publications[0]?.description ||
-
data.leaflets_to_documents[0]?.description ||
-
decodeURIComponent((await props.searchParams).description || "");
-
+
let pub = data.leaflets_in_publications[0];
let agent = new AtpAgent({ service: "https://public.api.bsky.app" });
-
let profile = await agent.getProfile({ actor: identity.atp_did });
-
// Parse entitiesToDelete from URL params
-
let searchParams = await props.searchParams;
-
let entitiesToDelete: string[] = [];
-
try {
-
if (searchParams.entitiesToDelete) {
-
entitiesToDelete = JSON.parse(
-
decodeURIComponent(searchParams.entitiesToDelete),
-
);
-
}
-
} catch (e) {
-
// If parsing fails, just use empty array
-
}
-
+
let profile = await agent.getProfile({ actor: identity.atp_did });
return (
<ReplicacheProvider
rootEntity={rootEntity}
···
leaflet_id={leaflet_id}
root_entity={rootEntity}
profile={profile.data}
-
title={title}
-
description={description}
-
publication_uri={publication?.uri}
-
record={publication?.record as PubLeafletPublication.Record | undefined}
-
posts_in_pub={publication?.documents_in_publications[0]?.count}
-
entitiesToDelete={entitiesToDelete}
+
title={pub.title}
+
publication_uri={pub.publication}
+
description={pub.description}
+
record={pub.publications?.record as PubLeafletPublication.Record}
+
posts_in_pub={pub.publications?.documents_in_publications[0].count}
/>
</ReplicacheProvider>
);
+17 -80
app/api/inngest/functions/index_post_mention.ts
···
import { AtpAgent, AtUri } from "@atproto/api";
import { Json } from "supabase/database.types";
import { ids } from "lexicons/api/lexicons";
-
import { Notification, pingIdentityToUpdateNotification } from "src/notifications";
-
import { v7 } from "uuid";
-
import { idResolver } from "app/(home-pages)/reader/idResolver";
export const index_post_mention = inngest.createFunction(
{ id: "index_post_mention" },
···
let url = new URL(event.data.document_link);
let path = url.pathname.split("/").filter(Boolean);
-
// Check if this is a standalone document URL (/p/didOrHandle/rkey/...)
-
const isStandaloneDoc = path[0] === "p" && path.length >= 3;
+
let { data: pub, error } = await supabaseServerClient
+
.from("publications")
+
.select("*")
+
.eq("record->>base_path", url.host)
+
.single();
-
let documentUri: string;
-
let authorDid: string;
-
-
if (isStandaloneDoc) {
-
// Standalone doc: /p/didOrHandle/rkey/l-quote/...
-
const didOrHandle = decodeURIComponent(path[1]);
-
const rkey = path[2];
-
-
// Resolve handle to DID if necessary
-
let did = didOrHandle;
-
if (!didOrHandle.startsWith("did:")) {
-
const resolved = await step.run("resolve-handle", async () => {
-
return idResolver.handle.resolve(didOrHandle);
-
});
-
if (!resolved) {
-
return { message: `Could not resolve handle: ${didOrHandle}` };
-
}
-
did = resolved;
-
}
-
-
documentUri = AtUri.make(did, ids.PubLeafletDocument, rkey).toString();
-
authorDid = did;
-
} else {
-
// Publication post: look up by custom domain
-
let { data: pub, error } = await supabaseServerClient
-
.from("publications")
-
.select("*")
-
.eq("record->>base_path", url.host)
-
.single();
-
-
if (!pub) {
-
return {
-
message: `No publication found for ${url.host}/${path[0]}`,
-
error,
-
};
-
}
-
-
documentUri = AtUri.make(
-
pub.identity_did,
-
ids.PubLeafletDocument,
-
path[0],
-
).toString();
-
authorDid = pub.identity_did;
+
if (!pub) {
+
return {
+
message: `No publication found for ${url.host}/${path[0]}`,
+
error,
+
};
}
let bsky_post = await step.run("get-bsky-post-data", async () => {
···
}
await step.run("index-bsky-post", async () => {
-
await supabaseServerClient.from("bsky_posts").upsert({
+
await supabaseServerClient.from("bsky_posts").insert({
uri: bsky_post.uri,
cid: bsky_post.cid,
post_view: bsky_post as Json,
});
-
await supabaseServerClient.from("document_mentions_in_bsky").upsert({
+
await supabaseServerClient.from("document_mentions_in_bsky").insert({
uri: bsky_post.uri,
-
document: documentUri,
+
document: AtUri.make(
+
pub.identity_did,
+
ids.PubLeafletDocument,
+
path[0],
+
).toString(),
link: event.data.document_link,
});
-
});
-
-
await step.run("create-notification", async () => {
-
// Only create notification if the quote is from someone other than the author
-
if (bsky_post.author.did !== authorDid) {
-
// Check if a notification already exists for this post and recipient
-
const { data: existingNotification } = await supabaseServerClient
-
.from("notifications")
-
.select("id")
-
.eq("recipient", authorDid)
-
.eq("data->>type", "quote")
-
.eq("data->>bsky_post_uri", bsky_post.uri)
-
.eq("data->>document_uri", documentUri)
-
.single();
-
-
if (!existingNotification) {
-
const notification: Notification = {
-
id: v7(),
-
recipient: authorDid,
-
data: {
-
type: "quote",
-
bsky_post_uri: bsky_post.uri,
-
document_uri: documentUri,
-
},
-
};
-
await supabaseServerClient.from("notifications").insert(notification);
-
await pingIdentityToUpdateNotification(authorDid);
-
}
-
}
});
},
);
+4 -33
app/api/rpc/[command]/getFactsFromHomeLeaflets.ts
···
import { makeRoute } from "../lib";
import type { Env } from "./route";
import { scanIndexLocal } from "src/replicache/utils";
+
import { getBlocksWithTypeLocal } from "src/hooks/queries/useBlocks";
import * as base64 from "base64-js";
import { YJSFragmentToString } from "components/Blocks/TextBlock/RenderYJSFragment";
import { applyUpdate, Doc } from "yjs";
···
let scan = scanIndexLocal(facts[token]);
let [root] = scan.eav(token, "root/page");
let rootEntity = root?.data.value || token;
-
-
// Check page type to determine which blocks to look up
-
let [pageType] = scan.eav(rootEntity, "page/type");
-
let isCanvas = pageType?.data.value === "canvas";
-
-
// Get blocks and sort by position
-
let rawBlocks = isCanvas
-
? scan.eav(rootEntity, "canvas/block").sort((a, b) => {
-
if (a.data.position.y === b.data.position.y)
-
return a.data.position.x - b.data.position.x;
-
return a.data.position.y - b.data.position.y;
-
})
-
: scan.eav(rootEntity, "card/block").sort((a, b) => {
-
if (a.data.position === b.data.position)
-
return a.id > b.id ? 1 : -1;
-
return a.data.position > b.data.position ? 1 : -1;
-
});
-
-
// Map to get type and filter for text/heading
-
let blocks = rawBlocks
-
.map((b) => {
-
let type = scan.eav(b.data.value, "block/type")[0];
-
if (
-
!type ||
-
(type.data.value !== "text" && type.data.value !== "heading")
-
)
-
return null;
-
return b.data;
-
})
-
.filter((b): b is NonNullable<typeof b> => b !== null);
-
-
let title = blocks[0];
-
+
let [title] = getBlocksWithTypeLocal(facts[token], rootEntity).filter(
+
(b) => b.type === "text" || b.type === "heading",
+
);
if (!title) titles[token] = "Untitled";
else {
let [content] = scan.eav(title.value, "block/text");
+2 -4
app/api/rpc/[command]/get_leaflet_data.ts
···
>;
const leaflets_in_publications_query = `leaflets_in_publications(*, publications(*), documents(*))`;
-
const leaflets_to_documents_query = `leaflets_to_documents(*, documents(*))`;
export const get_leaflet_data = makeRoute({
route: "get_leaflet_data",
input: z.object({
···
.from("permission_tokens")
.select(
`*,
-
permission_token_rights(*, entity_sets(permission_tokens(${leaflets_in_publications_query}, ${leaflets_to_documents_query}))),
+
permission_token_rights(*, entity_sets(permission_tokens(${leaflets_in_publications_query}))),
custom_domain_routes!custom_domain_routes_edit_permission_token_fkey(*),
-
${leaflets_in_publications_query},
-
${leaflets_to_documents_query}`,
+
${leaflets_in_publications_query}`,
)
.eq("id", token_id)
.single();
-1
app/globals.css
···
@apply focus-within:outline-offset-1;
@apply disabled:border-border-light;
-
@apply disabled:hover:border-border-light;
@apply disabled:bg-border-light;
@apply disabled:text-tertiary;
}
+10
app/lish/Subscribe.tsx
···
pub_uri: string;
base_url: string;
subscribers: { identity: string }[];
+
pub_creator?: string;
}) => {
let { identity } = useIdentityData();
let searchParams = useSearchParams();
···
let subscribed =
identity?.atp_did &&
props.subscribers.find((s) => s.identity === identity.atp_did);
+
+
// Check if the logged-in user is the publication owner
+
let isOwner = identity?.atp_did && props.pub_creator === identity.atp_did;
if (successModalOpen)
return (
···
setOpen={setSuccessModalOpen}
/>
);
+
+
// Don't allow users to subscribe to their own publication
+
if (isOwner) {
+
return null;
+
}
+
if (subscribed) {
return <ManageSubscription {...props} />;
}
-24
app/lish/[did]/[publication]/PublicationHomeLayout.tsx
···
-
"use client";
-
-
import { usePreserveScroll } from "src/hooks/usePreserveScroll";
-
-
export function PublicationHomeLayout(props: {
-
uri: string;
-
showPageBackground: boolean;
-
children: React.ReactNode;
-
}) {
-
let { ref } = usePreserveScroll<HTMLDivElement>(props.uri);
-
return (
-
<div
-
ref={props.showPageBackground ? null : ref}
-
className={`pubWrapper flex flex-col sm:py-6 h-full ${props.showPageBackground ? "max-w-prose mx-auto sm:px-0 px-[6px] py-2" : "w-full overflow-y-scroll"}`}
-
>
-
<div
-
ref={!props.showPageBackground ? null : ref}
-
className={`pub sm:max-w-prose max-w-(--page-width-units) w-[1000px] mx-auto px-3 sm:px-4 py-5 ${props.showPageBackground ? "overflow-auto h-full bg-[rgba(var(--bg-page),var(--bg-page-alpha))] border border-border rounded-lg" : "h-fit"}`}
-
>
-
{props.children}
-
</div>
-
</div>
-
);
-
}
+3 -9
app/lish/[did]/[publication]/[rkey]/BaseTextBlock.tsx
···
${isStrikethrough ? "line-through decoration-tertiary" : ""}
${isHighlighted ? "highlight bg-highlight-1" : ""}`.replaceAll("\n", " ");
-
// Split text by newlines and insert <br> tags
-
const textParts = segment.text.split('\n');
-
const renderedText = textParts.flatMap((part, i) =>
-
i < textParts.length - 1 ? [part, <br key={`br-${counter}-${i}`} />] : [part]
-
);
-
if (isCode) {
children.push(
<code key={counter} className={className} id={id?.id}>
-
{renderedText}
+
{segment.text}
</code>,
);
} else if (link) {
···
className={`text-accent-contrast hover:underline ${className}`}
target="_blank"
>
-
{renderedText}
+
{segment.text}
</a>,
);
} else {
children.push(
<span key={counter} className={className} id={id?.id}>
-
{renderedText}
+
{segment.text}
</span>,
);
}
+26 -19
app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx
···
import { PostHeader } from "./PostHeader/PostHeader";
import { useDrawerOpen } from "./Interactions/InteractionDrawer";
import { PollData } from "./fetchPollData";
-
import { SharedPageProps } from "./PostPages";
export function CanvasPage({
+
document,
blocks,
+
did,
+
profile,
+
preferences,
+
pubRecord,
+
prerenderedCodeBlocks,
+
bskyPostData,
+
pollData,
+
document_uri,
+
pageId,
+
pageOptions,
+
fullPageScroll,
pages,
-
...props
-
}: Omit<SharedPageProps, "allPages"> & {
+
}: {
+
document_uri: string;
+
document: PostPageData;
blocks: PubLeafletPagesCanvas.Block[];
+
profile: ProfileViewDetailed;
+
pubRecord: PubLeafletPublication.Record;
+
did: string;
+
prerenderedCodeBlocks?: Map<string, string>;
+
bskyPostData: AppBskyFeedDefs.PostView[];
+
pollData: PollData[];
+
preferences: { showComments?: boolean };
+
pageId?: string;
+
pageOptions?: React.ReactNode;
+
fullPageScroll: boolean;
pages: (PubLeafletPagesLinearDocument.Main | PubLeafletPagesCanvas.Main)[];
}) {
-
const {
-
document,
-
did,
-
profile,
-
preferences,
-
pubRecord,
-
theme,
-
prerenderedCodeBlocks,
-
bskyPostData,
-
pollData,
-
document_uri,
-
pageId,
-
pageOptions,
-
fullPageScroll,
-
hasPageBackground,
-
} = props;
if (!document) return null;
+
let hasPageBackground = !!pubRecord.theme?.showPageBackground;
let isSubpage = !!pageId;
let drawer = useDrawerOpen(document_uri);
-146
app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx
···
-
import { AtpAgent } from "@atproto/api";
-
import { AtUri } from "@atproto/syntax";
-
import { ids } from "lexicons/api/lexicons";
-
import {
-
PubLeafletBlocksBskyPost,
-
PubLeafletDocument,
-
PubLeafletPagesLinearDocument,
-
PubLeafletPagesCanvas,
-
PubLeafletPublication,
-
} from "lexicons/api";
-
import { QuoteHandler } from "./QuoteHandler";
-
import {
-
PublicationBackgroundProvider,
-
PublicationThemeProvider,
-
} from "components/ThemeManager/PublicationThemeProvider";
-
import { getPostPageData } from "./getPostPageData";
-
import { PostPageContextProvider } from "./PostPageContext";
-
import { PostPages } from "./PostPages";
-
import { extractCodeBlocks } from "./extractCodeBlocks";
-
import { LeafletLayout } from "components/LeafletLayout";
-
import { fetchPollData } from "./fetchPollData";
-
-
export async function DocumentPageRenderer({
-
did,
-
rkey,
-
}: {
-
did: string;
-
rkey: string;
-
}) {
-
let agent = new AtpAgent({
-
service: "https://public.api.bsky.app",
-
fetch: (...args) =>
-
fetch(args[0], {
-
...args[1],
-
next: { revalidate: 3600 },
-
}),
-
});
-
-
let [document, profile] = await Promise.all([
-
getPostPageData(AtUri.make(did, ids.PubLeafletDocument, rkey).toString()),
-
agent.getProfile({ actor: did }),
-
]);
-
-
if (!document?.data)
-
return (
-
<div className="bg-bg-leaflet h-full p-3 text-center relative">
-
<div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 max-w-md w-full">
-
<div className=" px-3 py-4 opaque-container flex flex-col gap-1 mx-2 ">
-
<h3>Sorry, post not found!</h3>
-
<p>
-
This may be a glitch on our end. If the issue persists please{" "}
-
<a href="mailto:contact@leaflet.pub">send us a note</a>.
-
</p>
-
</div>
-
</div>
-
</div>
-
);
-
-
let record = document.data as PubLeafletDocument.Record;
-
let bskyPosts =
-
record.pages.flatMap((p) => {
-
let page = p as PubLeafletPagesLinearDocument.Main;
-
return page.blocks?.filter(
-
(b) => b.block.$type === ids.PubLeafletBlocksBskyPost,
-
);
-
}) || [];
-
-
// Batch bsky posts into groups of 25 and fetch in parallel
-
let bskyPostBatches = [];
-
for (let i = 0; i < bskyPosts.length; i += 25) {
-
bskyPostBatches.push(bskyPosts.slice(i, i + 25));
-
}
-
-
let bskyPostResponses = await Promise.all(
-
bskyPostBatches.map((batch) =>
-
agent.getPosts(
-
{
-
uris: batch.map((p) => {
-
let block = p?.block as PubLeafletBlocksBskyPost.Main;
-
return block.postRef.uri;
-
}),
-
},
-
{ headers: {} },
-
),
-
),
-
);
-
-
let bskyPostData =
-
bskyPostResponses.length > 0
-
? bskyPostResponses.flatMap((response) => response.data.posts)
-
: [];
-
-
// Extract poll blocks and fetch vote data
-
let pollBlocks = record.pages.flatMap((p) => {
-
let page = p as PubLeafletPagesLinearDocument.Main;
-
return (
-
page.blocks?.filter((b) => b.block.$type === ids.PubLeafletBlocksPoll) ||
-
[]
-
);
-
});
-
let pollData = await fetchPollData(
-
pollBlocks.map((b) => (b.block as any).pollRef.uri),
-
);
-
-
// Get theme from publication or document (for standalone docs)
-
let pubRecord = document.documents_in_publications[0]?.publications
-
?.record as PubLeafletPublication.Record | undefined;
-
let theme = pubRecord?.theme || record.theme || null;
-
let pub_creator =
-
document.documents_in_publications[0]?.publications?.identity_did || did;
-
let isStandalone = !pubRecord;
-
-
let firstPage = record.pages[0];
-
-
let firstPageBlocks =
-
(
-
firstPage as
-
| PubLeafletPagesLinearDocument.Main
-
| PubLeafletPagesCanvas.Main
-
).blocks || [];
-
let prerenderedCodeBlocks = await extractCodeBlocks(firstPageBlocks);
-
-
return (
-
<PostPageContextProvider value={document}>
-
<PublicationThemeProvider theme={theme} pub_creator={pub_creator} isStandalone={isStandalone}>
-
<PublicationBackgroundProvider theme={theme} pub_creator={pub_creator}>
-
<LeafletLayout>
-
<PostPages
-
document_uri={document.uri}
-
preferences={pubRecord?.preferences || {}}
-
pubRecord={pubRecord}
-
profile={JSON.parse(JSON.stringify(profile.data))}
-
document={document}
-
bskyPostData={bskyPostData}
-
did={did}
-
prerenderedCodeBlocks={prerenderedCodeBlocks}
-
pollData={pollData}
-
/>
-
</LeafletLayout>
-
-
<QuoteHandler />
-
</PublicationBackgroundProvider>
-
</PublicationThemeProvider>
-
</PostPageContextProvider>
-
);
-
}
+4
app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx
···
pubName={
document.documents_in_publications[0].publications.name
}
+
pub_creator={
+
document.documents_in_publications[0].publications
+
.identity_did
+
}
/>
)
)}
+21 -14
app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx
···
let record = document?.data as PubLeafletDocument.Record;
let profile = props.profile;
-
let pub = props.data?.documents_in_publications[0]?.publications;
+
let pub = props.data?.documents_in_publications[0].publications;
+
let pubRecord = pub?.record as PubLeafletPublication.Record;
const formattedDate = useLocalizedDate(
record.publishedAt || new Date().toISOString(),
···
year: "numeric",
month: "long",
day: "2-digit",
-
},
+
}
);
-
if (!document?.data) return;
+
if (!document?.data || !document.documents_in_publications[0].publications)
+
return;
return (
<div
className="max-w-prose w-full mx-auto px-3 sm:px-4 sm:pt-3 pt-2"
···
>
<div className="pubHeader flex flex-col pb-5">
<div className="flex justify-between w-full">
-
{pub && (
-
<SpeedyLink
-
className="font-bold hover:no-underline text-accent-contrast"
-
href={document && getPublicationURL(pub)}
-
>
-
{pub?.name}
-
</SpeedyLink>
-
)}
+
<SpeedyLink
+
className="font-bold hover:no-underline text-accent-contrast"
+
href={
+
document &&
+
getPublicationURL(
+
document.documents_in_publications[0].publications,
+
)
+
}
+
>
+
{pub?.name}
+
</SpeedyLink>
{identity &&
-
pub &&
-
identity.atp_did === pub.identity_did &&
+
identity.atp_did ===
+
document.documents_in_publications[0]?.publications
+
.identity_did &&
document.leaflets_in_publications[0] && (
<a
className=" rounded-full flex place-items-center"
···
) : null}
{record.publishedAt ? (
<>
-
|<p>{formattedDate}</p>
+
|
+
<p>{formattedDate}</p>
</>
) : null}
|{" "}
+75 -110
app/lish/[did]/[publication]/[rkey]/PostPages.tsx
···
};
});
-
// Shared props type for both page components
-
export type SharedPageProps = {
-
document: PostPageData;
-
did: string;
-
profile: ProfileViewDetailed;
-
preferences: { showComments?: boolean };
-
pubRecord?: PubLeafletPublication.Record;
-
theme?: PubLeafletPublication.Theme | null;
-
prerenderedCodeBlocks?: Map<string, string>;
-
bskyPostData: AppBskyFeedDefs.PostView[];
-
pollData: PollData[];
-
document_uri: string;
-
fullPageScroll: boolean;
-
hasPageBackground: boolean;
-
pageId?: string;
-
pageOptions?: React.ReactNode;
-
allPages: (PubLeafletPagesLinearDocument.Main | PubLeafletPagesCanvas.Main)[];
-
};
-
-
// Component that renders either Canvas or Linear page based on page type
-
function PageRenderer({
-
page,
-
...sharedProps
-
}: {
-
page: PubLeafletPagesLinearDocument.Main | PubLeafletPagesCanvas.Main;
-
} & SharedPageProps) {
-
const isCanvas = PubLeafletPagesCanvas.isMain(page);
-
-
if (isCanvas) {
-
return (
-
<CanvasPage
-
{...sharedProps}
-
blocks={(page as PubLeafletPagesCanvas.Main).blocks || []}
-
pages={sharedProps.allPages}
-
/>
-
);
-
}
-
-
return (
-
<LinearDocumentPage
-
{...sharedProps}
-
blocks={(page as PubLeafletPagesLinearDocument.Main).blocks || []}
-
/>
-
);
-
}
-
export function PostPages({
document,
+
blocks,
did,
profile,
preferences,
···
}: {
document_uri: string;
document: PostPageData;
+
blocks: PubLeafletPagesLinearDocument.Block[];
profile: ProfileViewDetailed;
-
pubRecord?: PubLeafletPublication.Record;
+
pubRecord: PubLeafletPublication.Record;
did: string;
prerenderedCodeBlocks?: Map<string, string>;
bskyPostData: AppBskyFeedDefs.PostView[];
···
}) {
let drawer = useDrawerOpen(document_uri);
useInitializeOpenPages();
-
let openPageIds = useOpenPages();
-
if (!document) return null;
+
let pages = useOpenPages();
+
if (!document || !document.documents_in_publications[0].publications)
+
return null;
+
let hasPageBackground = !!pubRecord.theme?.showPageBackground;
let record = document.data as PubLeafletDocument.Record;
-
let theme = pubRecord?.theme || record.theme || null;
-
// For publication posts, respect the publication's showPageBackground setting
-
// For standalone documents, default to showing page background
-
let isInPublication = !!pubRecord;
-
let hasPageBackground = isInPublication ? !!theme?.showPageBackground : true;
let quotesAndMentions = document.quotesAndMentions;
-
let firstPage = record.pages[0] as
-
| PubLeafletPagesLinearDocument.Main
-
| PubLeafletPagesCanvas.Main;
-
-
// Canvas pages don't support fullPageScroll well due to fixed 1272px width
-
let firstPageIsCanvas = PubLeafletPagesCanvas.isMain(firstPage);
-
-
// Shared props used for all pages
-
const sharedProps: SharedPageProps = {
-
document,
-
did,
-
profile,
-
preferences,
-
pubRecord,
-
theme,
-
prerenderedCodeBlocks,
-
bskyPostData,
-
pollData,
-
document_uri,
-
hasPageBackground,
-
allPages: record.pages as (
-
| PubLeafletPagesLinearDocument.Main
-
| PubLeafletPagesCanvas.Main
-
)[],
-
fullPageScroll:
-
!hasPageBackground &&
-
!drawer &&
-
openPageIds.length === 0 &&
-
!firstPageIsCanvas,
-
};
-
+
let fullPageScroll = !hasPageBackground && !drawer && pages.length === 0;
return (
<>
-
{!sharedProps.fullPageScroll && <BookendSpacer />}
-
-
<PageRenderer page={firstPage} {...sharedProps} />
+
{!fullPageScroll && <BookendSpacer />}
+
<LinearDocumentPage
+
document={document}
+
blocks={blocks}
+
did={did}
+
profile={profile}
+
fullPageScroll={fullPageScroll}
+
pollData={pollData}
+
preferences={preferences}
+
pubRecord={pubRecord}
+
prerenderedCodeBlocks={prerenderedCodeBlocks}
+
bskyPostData={bskyPostData}
+
document_uri={document_uri}
+
/>
{drawer && !drawer.pageId && (
<InteractionDrawer
document_uri={document.uri}
comments={
-
pubRecord?.preferences?.showComments === false
+
pubRecord.preferences?.showComments === false
? []
: document.comments_on_documents
}
···
/>
)}
-
{openPageIds.map((pageId) => {
+
{pages.map((p) => {
let page = record.pages.find(
-
(p) =>
+
(page) =>
(
-
p as
+
page as
| PubLeafletPagesLinearDocument.Main
| PubLeafletPagesCanvas.Main
-
).id === pageId,
+
).id === p,
) as
| PubLeafletPagesLinearDocument.Main
| PubLeafletPagesCanvas.Main
| undefined;
-
if (!page) return null;
+
const isCanvas = PubLeafletPagesCanvas.isMain(page);
+
return (
-
<Fragment key={pageId}>
+
<Fragment key={p}>
<SandwichSpacer />
-
<PageRenderer
-
page={page}
-
{...sharedProps}
-
fullPageScroll={false}
-
pageId={page.id}
-
pageOptions={
-
<PageOptions
-
onClick={() => closePage(page.id!)}
-
hasPageBackground={hasPageBackground}
-
/>
-
}
-
/>
+
{isCanvas ? (
+
<CanvasPage
+
fullPageScroll={false}
+
document={document}
+
blocks={(page as PubLeafletPagesCanvas.Main).blocks}
+
did={did}
+
preferences={preferences}
+
profile={profile}
+
pubRecord={pubRecord}
+
prerenderedCodeBlocks={prerenderedCodeBlocks}
+
pollData={pollData}
+
bskyPostData={bskyPostData}
+
document_uri={document_uri}
+
pageId={page.id}
+
pages={record.pages as PubLeafletPagesLinearDocument.Main[]}
+
pageOptions={
+
<PageOptions
+
onClick={() => closePage(page?.id!)}
+
hasPageBackground={hasPageBackground}
+
/>
+
}
+
/>
+
) : (
+
<LinearDocumentPage
+
fullPageScroll={false}
+
document={document}
+
blocks={(page as PubLeafletPagesLinearDocument.Main).blocks}
+
did={did}
+
preferences={preferences}
+
pubRecord={pubRecord}
+
pollData={pollData}
+
prerenderedCodeBlocks={prerenderedCodeBlocks}
+
bskyPostData={bskyPostData}
+
document_uri={document_uri}
+
pageId={page.id}
+
pageOptions={
+
<PageOptions
+
onClick={() => closePage(page?.id!)}
+
hasPageBackground={hasPageBackground}
+
/>
+
}
+
/>
+
)}
{drawer && drawer.pageId === page.id && (
<InteractionDrawer
pageId={page.id}
document_uri={document.uri}
comments={
-
pubRecord?.preferences?.showComments === false
+
pubRecord.preferences?.showComments === false
? []
: document.comments_on_documents
}
···
</Fragment>
);
})}
-
-
{!sharedProps.fullPageScroll && <BookendSpacer />}
+
{!fullPageScroll && <BookendSpacer />}
</>
);
}
+5 -4
app/lish/[did]/[publication]/[rkey]/PublishedPageBlock.tsx
···
<div className="grow">
{title && (
<div
-
className={`pageBlockOne outline-none resize-none align-top gap-2 ${title.$type === "pub.leaflet.blocks.header" ? "font-bold text-base" : ""}`}
+
className={`pageBlockOne outline-none resize-none align-top flex gap-2 ${title.$type === "pub.leaflet.blocks.header" ? "font-bold text-base" : ""}`}
>
<TextBlock
facets={title.facets}
···
)}
{description && (
<div
-
className={`pageBlockLineTwo outline-none resize-none align-top gap-2 ${description.$type === "pub.leaflet.blocks.header" ? "font-bold" : ""}`}
+
className={`pageBlockLineTwo outline-none resize-none align-top flex gap-2 ${description.$type === "pub.leaflet.blocks.header" ? "font-bold" : ""}`}
>
<TextBlock
facets={description.facets}
···
let previewRef = useRef<HTMLDivElement | null>(null);
let { rootEntity } = useReplicache();
let data = useContext(PostPageContext);
-
let theme = data?.theme;
+
let theme = data?.documents_in_publications[0]?.publications
+
?.record as PubLeafletPublication.Record;
let pageWidth = `var(--page-width-unitless)`;
-
let cardBorderHidden = !theme?.showPageBackground;
+
let cardBorderHidden = !theme.theme?.showPageBackground;
return (
<div
ref={previewRef}
+2 -3
app/lish/[did]/[publication]/[rkey]/extractCodeBlocks.ts
···
import {
PubLeafletDocument,
PubLeafletPagesLinearDocument,
-
PubLeafletPagesCanvas,
PubLeafletBlocksCode,
} from "lexicons/api";
import { codeToHtml, bundledLanguagesInfo, bundledThemesInfo } from "shiki";
export async function extractCodeBlocks(
-
blocks: PubLeafletPagesLinearDocument.Block[] | PubLeafletPagesCanvas.Block[],
+
blocks: PubLeafletPagesLinearDocument.Block[],
): Promise<Map<string, string>> {
const codeBlocks = new Map<string, string>();
-
// Process all blocks (works for both linear and canvas)
+
// Process all pages in the document
for (let i = 0; i < blocks.length; i++) {
const block = blocks[i];
const currentIndex = [i];
+3 -12
app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
···
import { supabaseServerClient } from "supabase/serverClient";
import { AtUri } from "@atproto/syntax";
-
import { PubLeafletDocument, PubLeafletPublication } from "lexicons/api";
+
import { PubLeafletPublication } from "lexicons/api";
export async function getPostPageData(uri: string) {
let { data: document } = await supabaseServerClient
···
// Fetch constellation backlinks for mentions
const pubRecord = document.documents_in_publications[0]?.publications
?.record as PubLeafletPublication.Record;
-
let aturi = new AtUri(uri);
-
const postUrl = pubRecord
-
? `https://${pubRecord?.base_path}/${aturi.rkey}`
-
: `https://leaflet.pub/p/${aturi.host}/${aturi.rkey}`;
+
const rkey = new AtUri(uri).rkey;
+
const postUrl = `https://${pubRecord?.base_path}/${rkey}`;
const constellationBacklinks = await getConstellationBacklinks(postUrl);
// Deduplicate constellation backlinks (same post could appear in both links and embeds)
···
...uniqueBacklinks,
];
-
let theme =
-
(
-
document?.documents_in_publications[0]?.publications
-
?.record as PubLeafletPublication.Record
-
)?.theme || (document?.data as PubLeafletDocument.Record)?.theme;
-
return {
...document,
quotesAndMentions,
-
theme,
};
}
+3 -4
app/lish/[did]/[publication]/[rkey]/l-quote/[quote]/opengraph-image.ts
···
export const revalidate = 60;
export default async function OpenGraphImage(props: {
-
params: Promise<{ publication: string; did: string; rkey: string; quote: string }>;
+
params: { publication: string; did: string; rkey: string; quote: string };
}) {
-
let params = await props.params;
-
let quotePosition = decodeQuotePosition(params.quote);
+
let quotePosition = decodeQuotePosition(props.params.quote);
return getMicroLinkOgImage(
-
`/lish/${decodeURIComponent(params.did)}/${decodeURIComponent(params.publication)}/${params.rkey}/l-quote/${params.quote}#${quotePosition?.pageId ? `${quotePosition.pageId}~` : ""}${quotePosition?.start.block.join(".")}_${quotePosition?.start.offset}`,
+
`/lish/${decodeURIComponent(props.params.did)}/${decodeURIComponent(props.params.publication)}/${props.params.rkey}/l-quote/${props.params.quote}#${quotePosition?.pageId ? `${quotePosition.pageId}~` : ""}${quotePosition?.start.block.join(".")}_${quotePosition?.start.offset}`,
{
width: 620,
height: 324,
+2 -3
app/lish/[did]/[publication]/[rkey]/opengraph-image.ts
···
export const revalidate = 60;
export default async function OpenGraphImage(props: {
-
params: Promise<{ publication: string; did: string; rkey: string }>;
+
params: { publication: string; did: string; rkey: string };
}) {
-
let params = await props.params;
return getMicroLinkOgImage(
-
`/lish/${decodeURIComponent(params.did)}/${decodeURIComponent(params.publication)}/${params.rkey}/`,
+
`/lish/${decodeURIComponent(props.params.did)}/${decodeURIComponent(props.params.publication)}/${props.params.rkey}/`,
);
}
+156 -6
app/lish/[did]/[publication]/[rkey]/page.tsx
···
import { supabaseServerClient } from "supabase/serverClient";
import { AtUri } from "@atproto/syntax";
import { ids } from "lexicons/api/lexicons";
-
import { PubLeafletDocument } from "lexicons/api";
+
import {
+
PubLeafletBlocksBskyPost,
+
PubLeafletDocument,
+
PubLeafletPagesLinearDocument,
+
PubLeafletPublication,
+
} from "lexicons/api";
import { Metadata } from "next";
-
import { DocumentPageRenderer } from "./DocumentPageRenderer";
+
import { AtpAgent } from "@atproto/api";
+
import { QuoteHandler } from "./QuoteHandler";
+
import { InteractionDrawer } from "./Interactions/InteractionDrawer";
+
import {
+
PublicationBackgroundProvider,
+
PublicationThemeProvider,
+
} from "components/ThemeManager/PublicationThemeProvider";
+
import { getPostPageData } from "./getPostPageData";
+
import { PostPageContextProvider } from "./PostPageContext";
+
import { PostPages } from "./PostPages";
+
import { extractCodeBlocks } from "./extractCodeBlocks";
+
import { LeafletLayout } from "components/LeafletLayout";
+
import { fetchPollData } from "./fetchPollData";
export async function generateMetadata(props: {
params: Promise<{ publication: string; did: string; rkey: string }>;
···
export default async function Post(props: {
params: Promise<{ publication: string; did: string; rkey: string }>;
}) {
-
let params = await props.params;
-
let did = decodeURIComponent(params.did);
-
+
let did = decodeURIComponent((await props.params).did);
if (!did)
return (
<div className="p-4 text-lg text-center flex flex-col gap-4">
···
</p>
</div>
);
+
let agent = new AtpAgent({
+
service: "https://public.api.bsky.app",
+
fetch: (...args) =>
+
fetch(args[0], {
+
...args[1],
+
next: { revalidate: 3600 },
+
}),
+
});
+
let [document, profile] = await Promise.all([
+
getPostPageData(
+
AtUri.make(
+
did,
+
ids.PubLeafletDocument,
+
(await props.params).rkey,
+
).toString(),
+
),
+
agent.getProfile({ actor: did }),
+
]);
+
if (!document?.data || !document.documents_in_publications[0].publications)
+
return (
+
<div className="bg-bg-leaflet h-full p-3 text-center relative">
+
<div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 max-w-md w-full">
+
<div className=" px-3 py-4 opaque-container flex flex-col gap-1 mx-2 ">
+
<h3>Sorry, post not found!</h3>
+
<p>
+
This may be a glitch on our end. If the issue persists please{" "}
+
<a href="mailto:contact@leaflet.pub">send us a note</a>.
+
</p>
+
</div>
+
</div>
+
</div>
+
);
+
let record = document.data as PubLeafletDocument.Record;
+
let bskyPosts =
+
record.pages.flatMap((p) => {
+
let page = p as PubLeafletPagesLinearDocument.Main;
+
return page.blocks?.filter(
+
(b) => b.block.$type === ids.PubLeafletBlocksBskyPost,
+
);
+
}) || [];
-
return <DocumentPageRenderer did={did} rkey={params.rkey} />;
+
// Batch bsky posts into groups of 25 and fetch in parallel
+
let bskyPostBatches = [];
+
for (let i = 0; i < bskyPosts.length; i += 25) {
+
bskyPostBatches.push(bskyPosts.slice(i, i + 25));
+
}
+
+
let bskyPostResponses = await Promise.all(
+
bskyPostBatches.map((batch) =>
+
agent.getPosts(
+
{
+
uris: batch.map((p) => {
+
let block = p?.block as PubLeafletBlocksBskyPost.Main;
+
return block.postRef.uri;
+
}),
+
},
+
{ headers: {} },
+
),
+
),
+
);
+
+
let bskyPostData =
+
bskyPostResponses.length > 0
+
? bskyPostResponses.flatMap((response) => response.data.posts)
+
: [];
+
+
// Extract poll blocks and fetch vote data
+
let pollBlocks = record.pages.flatMap((p) => {
+
let page = p as PubLeafletPagesLinearDocument.Main;
+
return (
+
page.blocks?.filter((b) => b.block.$type === ids.PubLeafletBlocksPoll) ||
+
[]
+
);
+
});
+
let pollData = await fetchPollData(
+
pollBlocks.map((b) => (b.block as any).pollRef.uri),
+
);
+
+
let pubRecord = document.documents_in_publications[0]?.publications
+
.record as PubLeafletPublication.Record;
+
+
let firstPage = record.pages[0];
+
let blocks: PubLeafletPagesLinearDocument.Block[] = [];
+
if (PubLeafletPagesLinearDocument.isMain(firstPage)) {
+
blocks = firstPage.blocks || [];
+
}
+
+
let prerenderedCodeBlocks = await extractCodeBlocks(blocks);
+
+
return (
+
<PostPageContextProvider value={document}>
+
<PublicationThemeProvider
+
record={pubRecord}
+
pub_creator={
+
document.documents_in_publications[0].publications.identity_did
+
}
+
>
+
<PublicationBackgroundProvider
+
record={pubRecord}
+
pub_creator={
+
document.documents_in_publications[0].publications.identity_did
+
}
+
>
+
{/*
+
TODO: SCROLL PAGE TO FIT DRAWER
+
If the drawer fits without scrolling, dont scroll
+
If both drawer and page fit if you scrolled it, scroll it all into the center
+
If the drawer and pafe doesn't all fit, scroll to drawer
+
+
TODO: SROLL BAR
+
If there is no drawer && there is no page bg, scroll the entire page
+
If there is either a drawer open OR a page background, scroll just the post content
+
+
TODO: HIGHLIGHTING BORKED
+
on chrome, if you scroll backward, things stop working
+
seems like if you use an older browser, sel direction is not a thing yet
+
*/}
+
<LeafletLayout>
+
<PostPages
+
document_uri={document.uri}
+
preferences={pubRecord.preferences || {}}
+
pubRecord={pubRecord}
+
profile={JSON.parse(JSON.stringify(profile.data))}
+
document={document}
+
bskyPostData={bskyPostData}
+
did={did}
+
blocks={blocks}
+
prerenderedCodeBlocks={prerenderedCodeBlocks}
+
pollData={pollData}
+
/>
+
</LeafletLayout>
+
+
<QuoteHandler />
+
</PublicationBackgroundProvider>
+
</PublicationThemeProvider>
+
</PostPageContextProvider>
+
);
}
+1 -3
app/lish/[did]/[publication]/dashboard/DraftList.tsx
···
cardBorderHidden={!props.showPageBackground}
leaflets={leaflets_in_publications
.filter((l) => !l.documents)
-
.filter((l) => !l.archived)
.map((l) => {
return {
-
archived: l.archived,
-
added_at: "",
token: {
...l.permission_tokens!,
leaflets_in_publications: [
···
},
],
},
+
added_at: "",
};
})}
initialFacts={pub_data.leaflet_data.facts || {}}
+2 -22
app/lish/[did]/[publication]/dashboard/PublicationSWRProvider.tsx
···
import type { GetPublicationDataReturnType } from "app/api/rpc/[command]/get_publication_data";
import { callRPC } from "app/api/rpc/client";
-
import { createContext, useContext, useEffect } from "react";
-
import useSWR, { SWRConfig, KeyedMutator, mutate } from "swr";
-
import { produce, Draft } from "immer";
-
-
export type PublicationData = GetPublicationDataReturnType["result"];
+
import { createContext, useContext } from "react";
+
import useSWR, { SWRConfig } from "swr";
const PublicationContext = createContext({ name: "", did: "" });
export function PublicationSWRDataProvider(props: {
···
children: React.ReactNode;
}) {
let key = `publication-data-${props.publication_did}-${props.publication_rkey}`;
-
useEffect(() => {
-
console.log("UPDATING");
-
mutate(key, props.publication_data);
-
}, [props.publication_data]);
return (
<PublicationContext
value={{ name: props.publication_rkey, did: props.publication_did }}
···
);
return { data, mutate };
}
-
-
export function mutatePublicationData(
-
mutate: KeyedMutator<PublicationData>,
-
recipe: (draft: Draft<NonNullable<PublicationData>>) => void,
-
) {
-
mutate(
-
(data) => {
-
if (!data) return data;
-
return produce(data, recipe);
-
},
-
{ revalidate: false },
-
);
-
}
+108 -112
app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx
···
import { MoreOptionsVerticalTiny } from "components/Icons/MoreOptionsVerticalTiny";
import { DeleteSmall } from "components/Icons/DeleteSmall";
import { ShareSmall } from "components/Icons/ShareSmall";
-
import { ShareButton } from "app/[leaflet_id]/actions/ShareOptions";
+
import { ShareButton } from "components/ShareOptions";
import { SpeedyLink } from "components/SpeedyLink";
import { QuoteTiny } from "components/Icons/QuoteTiny";
import { CommentTiny } from "components/Icons/CommentTiny";
import { useLocalizedDate } from "src/hooks/useLocalizedDate";
-
import { LeafletOptions } from "app/(home-pages)/home/LeafletList/LeafletOptions";
-
import { StaticLeafletDataContext } from "components/PageSWRDataProvider";
export function PublishedPostsList(props: {
searchValue: string;
···
let quotes = doc.documents.document_mentions_in_bsky[0]?.count || 0;
let comments = doc.documents.comments_on_documents[0]?.count || 0;
-
let postLink = data?.publication
-
? `${getPublicationURL(data?.publication)}/${new AtUri(doc.documents.uri).rkey}`
-
: "";
-
return (
<Fragment key={doc.documents?.uri}>
<div className="flex gap-2 w-full ">
···
</h3>
</a>
<div className="flex justify-start align-top flex-row gap-1">
-
{leaflet && leaflet.permission_tokens && (
-
<>
-
<SpeedyLink
-
className="pt-[6px]"
-
href={`/${leaflet.leaflet}`}
-
>
-
<EditTiny />
-
</SpeedyLink>
-
-
<StaticLeafletDataContext
-
value={{
-
...leaflet.permission_tokens,
-
leaflets_in_publications: [
-
{
-
...leaflet,
-
publications: publication,
-
documents: doc.documents
-
? {
-
uri: doc.documents.uri,
-
indexed_at: doc.documents.indexed_at,
-
data: doc.documents.data,
-
}
-
: null,
-
},
-
],
-
leaflets_to_documents: [],
-
blocked_by_admin: null,
-
custom_domain_routes: [],
-
}}
-
>
-
<LeafletOptions loggedIn={true} />
-
</StaticLeafletDataContext>
-
</>
+
{leaflet && (
+
<SpeedyLink
+
className="pt-[6px]"
+
href={`/${leaflet.leaflet}`}
+
>
+
<EditTiny />
+
</SpeedyLink>
)}
+
<Options document_uri={doc.documents.uri} />
</div>
</div>
···
);
}
-
// function OptionsMenu(props: { document_uri: string }) {
-
// let { mutate, data } = usePublicationData();
-
// let [state, setState] = useState<"normal" | "confirm">("normal");
+
let Options = (props: { document_uri: string }) => {
+
return (
+
<Menu
+
align="end"
+
alignOffset={20}
+
asChild
+
trigger={
+
<button className="text-secondary rounded-md selected-outline border-transparent! hover:border-border! h-min">
+
<MoreOptionsVerticalTiny />
+
</button>
+
}
+
>
+
<>
+
<OptionsMenu document_uri={props.document_uri} />
+
</>
+
</Menu>
+
);
+
};
-
// if (state === "normal") {
-
// return (
-
// <>
-
// <ShareButton
-
// className="justify-end"
-
// text={
-
// <div className="flex gap-2">
-
// Share Post Link
-
// <ShareSmall />
-
// </div>
-
// }
-
// subtext=""
-
// smokerText="Post link copied!"
-
// id="get-post-link"
-
// fullLink={postLink?.includes("https") ? postLink : undefined}
-
// link={postLink}
-
// />
+
function OptionsMenu(props: { document_uri: string }) {
+
let { mutate, data } = usePublicationData();
+
let [state, setState] = useState<"normal" | "confirm">("normal");
-
// <hr className="border-border-light" />
-
// <MenuItem
-
// className="justify-end"
-
// onSelect={async (e) => {
-
// e.preventDefault();
-
// setState("confirm");
-
// return;
-
// }}
-
// >
-
// Delete Post
-
// <DeleteSmall />
-
// </MenuItem>
-
// </>
-
// );
-
// }
-
// if (state === "confirm") {
-
// return (
-
// <div className="flex flex-col items-center font-bold text-secondary px-2 py-1">
-
// Are you sure?
-
// <div className="text-sm text-tertiary font-normal">
-
// This action cannot be undone!
-
// </div>
-
// <ButtonPrimary
-
// className="mt-2"
-
// onClick={async () => {
-
// await mutate((data) => {
-
// if (!data) return data;
-
// return {
-
// ...data,
-
// publication: {
-
// ...data.publication!,
-
// leaflets_in_publications:
-
// data.publication?.leaflets_in_publications.filter(
-
// (l) => l.doc !== props.document_uri,
-
// ) || [],
-
// documents_in_publications:
-
// data.publication?.documents_in_publications.filter(
-
// (d) => d.documents?.uri !== props.document_uri,
-
// ) || [],
-
// },
-
// };
-
// }, false);
-
// await deletePost(props.document_uri);
-
// }}
-
// >
-
// Delete
-
// </ButtonPrimary>
-
// </div>
-
// );
-
// }
-
//}
+
let postLink = data?.publication
+
? `${getPublicationURL(data?.publication)}/${new AtUri(props.document_uri).rkey}`
+
: null;
+
+
if (state === "normal") {
+
return (
+
<>
+
<ShareButton
+
className="justify-end"
+
text={
+
<div className="flex gap-2">
+
Share Post Link
+
<ShareSmall />
+
</div>
+
}
+
subtext=""
+
smokerText="Post link copied!"
+
id="get-post-link"
+
fullLink={postLink?.includes("https") ? postLink : undefined}
+
link={postLink}
+
/>
+
+
<hr className="border-border-light" />
+
<MenuItem
+
className="justify-end"
+
onSelect={async (e) => {
+
e.preventDefault();
+
setState("confirm");
+
return;
+
}}
+
>
+
Delete Post
+
<DeleteSmall />
+
</MenuItem>
+
</>
+
);
+
}
+
if (state === "confirm") {
+
return (
+
<div className="flex flex-col items-center font-bold text-secondary px-2 py-1">
+
Are you sure?
+
<div className="text-sm text-tertiary font-normal">
+
This action cannot be undone!
+
</div>
+
<ButtonPrimary
+
className="mt-2"
+
onClick={async () => {
+
await mutate((data) => {
+
if (!data) return data;
+
return {
+
...data,
+
publication: {
+
...data.publication!,
+
leaflets_in_publications:
+
data.publication?.leaflets_in_publications.filter(
+
(l) => l.doc !== props.document_uri,
+
) || [],
+
documents_in_publications:
+
data.publication?.documents_in_publications.filter(
+
(d) => d.documents?.uri !== props.document_uri,
+
) || [],
+
},
+
};
+
}, false);
+
await deletePost(props.document_uri);
+
}}
+
>
+
Delete
+
</ButtonPrimary>
+
</div>
+
);
+
}
+
}
function PublishedDate(props: { dateString: string }) {
const formattedDate = useLocalizedDate(props.dateString, {
···
day: "2-digit",
});
-
return <p className="text-sm text-tertiary">Published {formattedDate}</p>;
+
return (
+
<p className="text-sm text-tertiary">
+
Published {formattedDate}
+
</p>
+
);
}
-23
app/lish/[did]/[publication]/dashboard/deletePost.ts
···
.delete()
.eq("doc", document_uri),
]);
-
-
return revalidatePath("/lish/[did]/[publication]/dashboard", "layout");
-
}
-
-
export async function unpublishPost(document_uri: string) {
-
let identity = await getIdentityData();
-
if (!identity || !identity.atp_did) throw new Error("No Identity");
-
-
const oauthClient = await createOauthClient();
-
let credentialSession = await oauthClient.restore(identity.atp_did);
-
let agent = new AtpBaseClient(
-
credentialSession.fetchHandler.bind(credentialSession),
-
);
-
let uri = new AtUri(document_uri);
-
if (uri.host !== identity.atp_did) return;
-
-
await Promise.all([
-
agent.pub.leaflet.document.delete({
-
repo: credentialSession.did,
-
rkey: uri.rkey,
-
}),
-
supabaseServerClient.from("documents").delete().eq("uri", document_uri),
-
]);
return revalidatePath("/lish/[did]/[publication]/dashboard", "layout");
}
+4 -3
app/lish/[did]/[publication]/icon.ts
···
};
export const contentType = "image/png";
-
export default async function Icon(props: {
-
params: Promise<{ did: string; publication: string }>;
+
export default async function Icon({
+
params,
+
}: {
+
params: { did: string; publication: string };
}) {
-
const params = await props.params;
try {
let did = decodeURIComponent(params.did);
let uri;
+2 -3
app/lish/[did]/[publication]/opengraph-image.ts
···
export const revalidate = 60;
export default async function OpenGraphImage(props: {
-
params: Promise<{ publication: string; did: string }>;
+
params: { publication: string; did: string };
}) {
-
let params = await props.params;
return getMicroLinkOgImage(
-
`/lish/${encodeURIComponent(params.did)}/${encodeURIComponent(params.publication)}/`,
+
`/lish/${encodeURIComponent(props.params.did)}/${encodeURIComponent(props.params.publication)}/`,
);
}
+19 -6
app/lish/[did]/[publication]/page.tsx
···
import { CommentTiny } from "components/Icons/CommentTiny";
import { LocalizedDate } from "./LocalizedDate";
import { PublicationHomeLayout } from "./PublicationHomeLayout";
+
import { EditTiny } from "components/Icons/EditTiny";
+
import { getIdentityData } from "actions/getIdentityData";
export default async function Publication(props: {
params: Promise<{ publication: string; did: string }>;
···
let params = await props.params;
let did = decodeURIComponent(params.did);
if (!did) return <PubNotFound />;
+
let identity = await getIdentityData();
let agent = new BskyAgent({ service: "https://public.api.bsky.app" });
let uri;
let publication_name = decodeURIComponent(params.publication);
···
</p>
)}
<div className="sm:pt-4 pt-4">
-
<SubscribeWithBluesky
-
base_url={getPublicationURL(publication)}
-
pubName={publication.name}
-
pub_uri={publication.uri}
-
subscribers={publication.publication_subscriptions}
-
/>
+
{identity?.atp_did === publication.identity_did ? (
+
<a
+
href={`${getPublicationURL(publication)}/dashboard`}
+
className="flex gap-2 items-center hover:!no-underline selected-outline px-4 py-2 bg-accent-1 text-accent-2 font-bold w-fit rounded-lg !border-accent-1 !outline-accent-1 mx-auto text-base"
+
>
+
<EditTiny /> Edit Publication
+
</a>
+
) : (
+
<SubscribeWithBluesky
+
base_url={getPublicationURL(publication)}
+
pubName={publication.name}
+
pub_uri={publication.uri}
+
subscribers={publication.publication_subscriptions}
+
pub_creator={publication.identity_did}
+
/>
+
)}
</div>
</div>
<div className="publicationPostList w-full flex flex-col gap-4">
+7 -6
app/lish/createPub/CreatePubForm.tsx
···
onChange={(e) => setShowInDiscover(e.target.checked)}
>
<div className=" pt-0.5 flex flex-col text-sm text-tertiary ">
-
<p className="font-bold italic">Show In Discover</p>
-
<p className="text-sm text-tertiary font-normal">
-
Your posts will appear on our{" "}
+
<p className="font-bold italic">
+
Show In{" "}
<a href="/discover" target="_blank">
Discover
-
</a>{" "}
-
page. You can change this at any time!
+
</a>
+
</p>
+
<p className="text-sm text-tertiary font-normal">
+
You'll be able to change this later!
</p>
</div>
</Checkbox>
<hr className="border-border-light" />
-
<div className="flex w-full justify-end">
+
<div className="flex w-full justify-center">
<ButtonPrimary
type="submit"
disabled={
+2 -5
app/lish/createPub/UpdatePubForm.tsx
···
if (!pubData) return;
e.preventDefault();
props.setLoadingAction(true);
+
console.log("step 1:update");
let data = await updatePublication({
uri: pubData.uri,
name: nameValue,
···
</a>
</p>
<p className="text-xs text-tertiary font-normal">
-
Your posts will appear on our{" "}
-
<a href="/discover" target="_blank">
-
Discover
-
</a>{" "}
-
page. You can change this at any time!
+
This publication will appear on our public Discover page
</p>
</div>
</Checkbox>
-1
app/lish/createPub/createPublication.ts
···
await supabaseServerClient
.from("custom_domains")
.insert({ domain, confirmed: true, identity: null });
-
await supabaseServerClient
.from("publication_domains")
.insert({ domain, publication: result.uri, identity: identity.atp_did });
+11 -3
app/lish/createPub/getPublicationURL.ts
···
import { isProductionDomain } from "src/utils/isProductionDeployment";
import { Json } from "supabase/database.types";
-
export function getPublicationURL(pub: { uri: string; record: Json }) {
+
export function getPublicationURL(pub: {
+
uri: string;
+
name: string;
+
record: Json;
+
}) {
let record = pub.record as PubLeafletPublication.Record;
if (isProductionDomain() && record?.base_path)
return `https://${record.base_path}`;
else return getBasePublicationURL(pub);
}
-
export function getBasePublicationURL(pub: { uri: string; record: Json }) {
+
export function getBasePublicationURL(pub: {
+
uri: string;
+
name: string;
+
record: Json;
+
}) {
let record = pub.record as PubLeafletPublication.Record;
let aturi = new AtUri(pub.uri);
-
return `/lish/${aturi.host}/${encodeURIComponent(aturi.rkey || record?.name)}`;
+
return `/lish/${aturi.host}/${encodeURIComponent(aturi.rkey || record?.name || pub.name)}`;
}
+1 -1
app/lish/createPub/page.tsx
···
<div className="createPubContent h-full flex items-center max-w-sm w-full mx-auto">
<div className="createPubFormWrapper h-fit w-full flex flex-col gap-4">
<h2 className="text-center">Create Your Publication!</h2>
-
<div className="opaque-container w-full sm:py-4 p-3">
+
<div className="container w-full p-3">
<CreatePubForm />
</div>
</div>
+1 -1
app/login/LoginForm.tsx
···
</ButtonPrimary>
<button
type="button"
-
className={`${props.compact ? "text-xs mt-0.5" : "text-sm mt-[6px]"} text-accent-contrast place-self-center`}
+
className={`${props.compact ? "text-xs" : "text-sm"} text-accent-contrast place-self-center mt-[6px]`}
onClick={() => setSigningWithHandle(true)}
>
use an ATProto handle
-20
app/p/[didOrHandle]/[rkey]/l-quote/[quote]/opengraph-image.ts
···
-
import { getMicroLinkOgImage } from "src/utils/getMicroLinkOgImage";
-
import { decodeQuotePosition } from "app/lish/[did]/[publication]/[rkey]/quotePosition";
-
-
export const runtime = "edge";
-
export const revalidate = 60;
-
-
export default async function OpenGraphImage(props: {
-
params: Promise<{ didOrHandle: string; rkey: string; quote: string }>;
-
}) {
-
let params = await props.params;
-
let quotePosition = decodeQuotePosition(params.quote);
-
return getMicroLinkOgImage(
-
`/p/${decodeURIComponent(params.didOrHandle)}/${params.rkey}/l-quote/${params.quote}#${quotePosition?.pageId ? `${quotePosition.pageId}~` : ""}${quotePosition?.start.block.join(".")}_${quotePosition?.start.offset}`,
-
{
-
width: 620,
-
height: 324,
-
deviceScaleFactor: 2,
-
},
-
);
-
}
-8
app/p/[didOrHandle]/[rkey]/l-quote/[quote]/page.tsx
···
-
import PostPage from "app/p/[didOrHandle]/[rkey]/page";
-
-
export { generateMetadata } from "app/p/[didOrHandle]/[rkey]/page";
-
export default async function Post(props: {
-
params: Promise<{ didOrHandle: string; rkey: string }>;
-
}) {
-
return <PostPage {...props} />;
-
}
-13
app/p/[didOrHandle]/[rkey]/opengraph-image.ts
···
-
import { getMicroLinkOgImage } from "src/utils/getMicroLinkOgImage";
-
-
export const runtime = "edge";
-
export const revalidate = 60;
-
-
export default async function OpenGraphImage(props: {
-
params: Promise<{ rkey: string; didOrHandle: string }>;
-
}) {
-
let params = await props.params;
-
return getMicroLinkOgImage(
-
`/p/${params.didOrHandle}/${params.rkey}/`,
-
);
-
}
-90
app/p/[didOrHandle]/[rkey]/page.tsx
···
-
import { supabaseServerClient } from "supabase/serverClient";
-
import { AtUri } from "@atproto/syntax";
-
import { ids } from "lexicons/api/lexicons";
-
import { PubLeafletDocument } from "lexicons/api";
-
import { Metadata } from "next";
-
import { idResolver } from "app/(home-pages)/reader/idResolver";
-
import { DocumentPageRenderer } from "app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer";
-
-
export async function generateMetadata(props: {
-
params: Promise<{ didOrHandle: string; rkey: string }>;
-
}): Promise<Metadata> {
-
let params = await props.params;
-
let didOrHandle = decodeURIComponent(params.didOrHandle);
-
-
// Resolve handle to DID if necessary
-
let did = didOrHandle;
-
if (!didOrHandle.startsWith("did:")) {
-
try {
-
let resolved = await idResolver.handle.resolve(didOrHandle);
-
if (resolved) did = resolved;
-
} catch (e) {
-
return { title: "404" };
-
}
-
}
-
-
let { data: document } = await supabaseServerClient
-
.from("documents")
-
.select("*, documents_in_publications(publications(*))")
-
.eq("uri", AtUri.make(did, ids.PubLeafletDocument, params.rkey))
-
.single();
-
-
if (!document) return { title: "404" };
-
-
let docRecord = document.data as PubLeafletDocument.Record;
-
-
// For documents in publications, include publication name
-
let publicationName = document.documents_in_publications[0]?.publications?.name;
-
-
return {
-
icons: {
-
other: {
-
rel: "alternate",
-
url: document.uri,
-
},
-
},
-
title: publicationName
-
? `${docRecord.title} - ${publicationName}`
-
: docRecord.title,
-
description: docRecord?.description || "",
-
};
-
}
-
-
export default async function StandaloneDocumentPage(props: {
-
params: Promise<{ didOrHandle: string; rkey: string }>;
-
}) {
-
let params = await props.params;
-
let didOrHandle = decodeURIComponent(params.didOrHandle);
-
-
// Resolve handle to DID if necessary
-
let did = didOrHandle;
-
if (!didOrHandle.startsWith("did:")) {
-
try {
-
let resolved = await idResolver.handle.resolve(didOrHandle);
-
if (!resolved) {
-
return (
-
<div className="p-4 text-lg text-center flex flex-col gap-4">
-
<p>Sorry, can&apos;t resolve handle.</p>
-
<p>
-
This may be a glitch on our end. If the issue persists please{" "}
-
<a href="mailto:contact@leaflet.pub">send us a note</a>.
-
</p>
-
</div>
-
);
-
}
-
did = resolved;
-
} catch (e) {
-
return (
-
<div className="p-4 text-lg text-center flex flex-col gap-4">
-
<p>Sorry, can&apos;t resolve handle.</p>
-
<p>
-
This may be a glitch on our end. If the issue persists please{" "}
-
<a href="mailto:contact@leaflet.pub">send us a note</a>.
-
</p>
-
</div>
-
);
-
}
-
}
-
-
return <DocumentPageRenderer did={did} rkey={params.rkey} />;
-
}
+159
app/templates/TemplateList.tsx
···
+
"use client";
+
+
import { ButtonPrimary } from "components/Buttons";
+
import Image from "next/image";
+
import Link from "next/link";
+
import { createNewLeafletFromTemplate } from "actions/createNewLeafletFromTemplate";
+
import { AddTiny } from "components/Icons/AddTiny";
+
+
export function LeafletTemplate(props: {
+
title: string;
+
description?: string;
+
image: string;
+
alt: string;
+
templateID: string; // readonly id for the leaflet that will be duplicated
+
}) {
+
return (
+
<div className="flex flex-col gap-4">
+
<div className="flex flex-col gap-2">
+
<div className="max-w-[274px] h-[154px] relative">
+
<Image
+
className="absolute top-0 left-0 rounded-md w-full h-full object-cover"
+
src={props.image}
+
alt={props.alt}
+
width={274}
+
height={154}
+
/>
+
</div>
+
</div>
+
<div className={`flex flex-col ${props.description ? "gap-4" : "gap-2"}`}>
+
<div className="gap-0">
+
<h3 className="font-bold text-center text-secondary">
+
{props.title}
+
</h3>
+
{props.description && (
+
<div className="text-tertiary text-sm font-normal text-center">
+
{props.description}
+
</div>
+
)}
+
</div>
+
<div className="flex sm:flex-row flex-col gap-2 justify-center items-center bottom-4">
+
<Link
+
href={`https://leaflet.pub/` + props.templateID}
+
target="_blank"
+
className="no-underline hover:no-underline"
+
>
+
<ButtonPrimary className="bg-primary hover:outline-hidden! hover:scale-105 hover:rotate-3 transition-all">
+
Preview
+
</ButtonPrimary>
+
</Link>
+
<ButtonPrimary
+
className=" hover:outline-hidden! hover:scale-105 hover:-rotate-2 transition-all"
+
onClick={async () => {
+
let id = await createNewLeafletFromTemplate(
+
props.templateID,
+
false,
+
);
+
window.open(`/${id}`, "_blank");
+
}}
+
>
+
Create
+
<AddTiny />
+
</ButtonPrimary>
+
</div>
+
</div>
+
</div>
+
);
+
}
+
+
export function TemplateList(props: {
+
name: string;
+
description?: string;
+
children: React.ReactNode;
+
}) {
+
return (
+
<div className="templateLeafletGrid flex flex-col gap-6">
+
<div className="flex flex-col gap-0 text-center">
+
<h3 className="text-[24px]">{props.name}</h3>
+
<p className="text-secondary">{props.description}</p>
+
</div>
+
<div className="grid auto-rows-max md:grid-cols-4 sm:grid-cols-3 grid-cols-2 gap-y-8 gap-x-6 sm:gap-6 grow pb-8">
+
{props.children}
+
</div>
+
</div>
+
);
+
}
+
+
export function TemplateListThemes() {
+
return (
+
<>
+
<TemplateList
+
name="Themes"
+
description="A small sampling of Leaflet's infinite theme possibilities!"
+
>
+
<LeafletTemplate
+
title="Foliage"
+
image="/templates/template-foliage-548x308.jpg"
+
alt="preview image of Foliage theme, with lots of green and leafy bg"
+
templateID="e4323c1d-15c1-407d-afaf-e5d772a35f0e"
+
/>
+
<LeafletTemplate
+
title="Lunar"
+
image="/templates/template-lunar-548x308.jpg"
+
alt="preview image of Lunar theme, with dark grey, red, and moon bg"
+
templateID="219d14ab-096c-4b48-83ee-36446e335c3e"
+
/>
+
<LeafletTemplate
+
title="Paper"
+
image="/templates/template-paper-548x308.jpg"
+
alt="preview image of Paper theme, with red, gold, green and marbled paper bg"
+
templateID="9b28ceea-0220-42ac-87e6-3976d156f653"
+
/>
+
<LeafletTemplate
+
title="Oceanic"
+
image="/templates/template-oceanic-548x308.jpg"
+
alt="preview image of Oceanic theme, with dark and light blue and ocean bg"
+
templateID="a65a56d7-713d-437e-9c42-f18bdc6fe2a7"
+
/>
+
</TemplateList>
+
</>
+
);
+
}
+
+
export function TemplateListExamples() {
+
return (
+
<TemplateList
+
name="Examples"
+
description="Creative documents you can make and share with Leaflet"
+
>
+
<LeafletTemplate
+
title="Reading List"
+
description="Make a list for your own reading, or share recs with friends!"
+
image="/templates/template-reading-548x308.jpg"
+
alt="preview image of Reading List template, with a few sections and example books as sub-pages"
+
templateID="a5655b68-fe7a-4494-bda6-c9847523b2f6"
+
/>
+
<LeafletTemplate
+
title="Travel Plan"
+
description="Organize a trip — notes, logistics, itinerary, even a shared scrapbook"
+
image="/templates/template-travel-548x308.jpg"
+
alt="preview image of a Travel Plan template, with pages for itinerary, logistics, research, and a travel diary canvas"
+
templateID="4d6f1392-dfd3-4015-925d-df55b7da5566"
+
/>
+
<LeafletTemplate
+
title="Gift Guide"
+
description="Share your favorite things — products, restaurants, movies…"
+
image="/templates/template-gift-548x308.jpg"
+
alt="preview image for a Gift Guide template, with three blank canvases for different categories"
+
templateID="de73df29-35d9-4a43-a441-7ce45ad3b498"
+
/>
+
<LeafletTemplate
+
title="Event Page"
+
description="Host an event — from a single meetup, to a whole conference!"
+
image="/templates/template-event-548x308.jpg"
+
alt="preview image for an Event Page template, with an event info section and linked pages / canvases for more info"
+
templateID="23d8a4ec-b2f6-438a-933d-726d2188974d"
+
/>
+
</TemplateList>
+
);
+
}
+108
app/templates/icon.tsx
···
+
// NOTE: duplicated from home/icon.tsx
+
// we could make it different so it's clear it's not your personal colors?
+
+
import { ImageResponse } from "next/og";
+
import type { Fact } from "src/replicache";
+
import type { Attribute } from "src/replicache/attributes";
+
import { Database } from "../../supabase/database.types";
+
import { createServerClient } from "@supabase/ssr";
+
import { parseHSBToRGB } from "src/utils/parseHSB";
+
import { cookies } from "next/headers";
+
+
// Route segment config
+
export const revalidate = 0;
+
export const preferredRegion = ["sfo1"];
+
export const dynamic = "force-dynamic";
+
export const fetchCache = "force-no-store";
+
+
// Image metadata
+
export const size = {
+
width: 32,
+
height: 32,
+
};
+
export const contentType = "image/png";
+
+
// Image generation
+
let supabase = createServerClient<Database>(
+
process.env.NEXT_PUBLIC_SUPABASE_API_URL as string,
+
process.env.SUPABASE_SERVICE_ROLE_KEY as string,
+
{ cookies: {} },
+
);
+
export default async function Icon() {
+
let cookieStore = await cookies();
+
let identity = cookieStore.get("identity");
+
let rootEntity: string | null = null;
+
if (identity) {
+
let res = await supabase
+
.from("identities")
+
.select(
+
`*,
+
permission_tokens!identities_home_page_fkey(*, permission_token_rights(*)),
+
permission_token_on_homepage(
+
*, permission_tokens(*, permission_token_rights(*))
+
)
+
`,
+
)
+
.eq("id", identity?.value)
+
.single();
+
rootEntity = res.data?.permission_tokens?.root_entity || null;
+
}
+
let outlineColor, fillColor;
+
if (rootEntity) {
+
let { data } = await supabase.rpc("get_facts", {
+
root: rootEntity,
+
});
+
let initialFacts = (data as unknown as Fact<Attribute>[]) || [];
+
let themePageBG = initialFacts.find(
+
(f) => f.attribute === "theme/card-background",
+
) as Fact<"theme/card-background"> | undefined;
+
+
let themePrimary = initialFacts.find(
+
(f) => f.attribute === "theme/primary",
+
) as Fact<"theme/primary"> | undefined;
+
+
outlineColor = parseHSBToRGB(`hsba(${themePageBG?.data.value})`);
+
+
fillColor = parseHSBToRGB(`hsba(${themePrimary?.data.value})`);
+
}
+
+
return new ImageResponse(
+
(
+
// ImageResponse JSX element
+
<div style={{ display: "flex" }}>
+
<svg
+
width="32"
+
height="32"
+
viewBox="0 0 32 32"
+
fill="none"
+
xmlns="http://www.w3.org/2000/svg"
+
>
+
{/* outline */}
+
<path
+
fillRule="evenodd"
+
clipRule="evenodd"
+
d="M3.09628 21.8809C2.1044 23.5376 1.19806 25.3395 0.412496 27.2953C-0.200813 28.8223 0.539843 30.5573 2.06678 31.1706C3.59372 31.7839 5.32873 31.0433 5.94204 29.5163C6.09732 29.1297 6.24696 28.7489 6.39151 28.3811L6.39286 28.3777C6.94334 26.9769 7.41811 25.7783 7.99246 24.6987C8.63933 24.6636 9.37895 24.6582 10.2129 24.6535L10.3177 24.653C11.8387 24.6446 13.6711 24.6345 15.2513 24.3147C16.8324 23.9947 18.789 23.2382 19.654 21.2118C19.8881 20.6633 20.1256 19.8536 19.9176 19.0311C19.98 19.0311 20.044 19.031 20.1096 19.031C20.1447 19.031 20.1805 19.0311 20.2169 19.0311C21.0513 19.0316 22.2255 19.0324 23.2752 18.7469C24.5 18.4137 25.7878 17.6248 26.3528 15.9629C26.557 15.3624 26.5948 14.7318 26.4186 14.1358C26.4726 14.1262 26.528 14.1165 26.5848 14.1065C26.6121 14.1018 26.6398 14.0969 26.6679 14.092C27.3851 13.9667 28.3451 13.7989 29.1653 13.4921C29.963 13.1936 31.274 12.5268 31.6667 10.9987C31.8906 10.1277 31.8672 9.20568 31.3642 8.37294C31.1551 8.02669 30.889 7.75407 30.653 7.55302C30.8728 7.27791 31.1524 6.89517 31.345 6.47292C31.6791 5.74032 31.8513 4.66394 31.1679 3.61078C30.3923 2.4155 29.0623 2.2067 28.4044 2.1526C27.7203 2.09635 26.9849 2.15644 26.4564 2.2042C26.3846 2.02839 26.2858 1.84351 26.1492 1.66106C25.4155 0.681263 24.2775 0.598914 23.6369 0.61614C22.3428 0.650943 21.3306 1.22518 20.5989 1.82076C20.2149 2.13334 19.8688 2.48545 19.5698 2.81786C18.977 2.20421 18.1625 1.90193 17.3552 1.77751C15.7877 1.53594 14.5082 2.58853 13.6056 3.74374C12.4805 5.18375 11.7295 6.8566 10.7361 8.38059C10.3814 8.14984 9.83685 7.89945 9.16529 7.93065C8.05881 7.98204 7.26987 8.73225 6.79424 9.24551C5.96656 10.1387 5.46273 11.5208 5.10424 12.7289C4.71615 14.0368 4.38077 15.5845 4.06569 17.1171C3.87054 18.0664 3.82742 18.5183 4.01638 20.2489C3.43705 21.1826 3.54993 21.0505 3.09628 21.8809Z"
+
fill={outlineColor ? outlineColor : "#FFFFFF"}
+
/>
+
+
{/* fill */}
+
<path
+
fillRule="evenodd"
+
clipRule="evenodd"
+
d="M9.86889 10.2435C10.1927 10.528 10.5723 10.8615 11.3911 10.5766C11.9265 10.3903 12.6184 9.17682 13.3904 7.82283C14.5188 5.84367 15.8184 3.56431 17.0505 3.7542C18.5368 3.98325 18.4453 4.80602 18.3749 5.43886C18.3255 5.88274 18.2866 6.23317 18.8098 6.21972C19.3427 6.20601 19.8613 5.57971 20.4632 4.8529C21.2945 3.84896 22.2847 2.65325 23.6906 2.61544C24.6819 2.58879 24.6663 3.01595 24.6504 3.44913C24.6403 3.72602 24.63 4.00537 24.8826 4.17024C25.1314 4.33266 25.7571 4.2759 26.4763 4.21065C27.6294 4.10605 29.023 3.97963 29.4902 4.6995C29.9008 5.33235 29.3776 5.96135 28.8762 6.56423C28.4514 7.07488 28.0422 7.56679 28.2293 8.02646C28.3819 8.40149 28.6952 8.61278 29.0024 8.81991C29.5047 9.15866 29.9905 9.48627 29.7297 10.5009C29.4539 11.5737 27.7949 11.8642 26.2398 12.1366C24.937 12.3647 23.7072 12.5801 23.4247 13.2319C23.2475 13.6407 23.5414 13.8311 23.8707 14.0444C24.2642 14.2992 24.7082 14.5869 24.4592 15.3191C23.8772 17.031 21.9336 17.031 20.1095 17.0311C18.5438 17.0311 17.0661 17.0311 16.6131 18.1137C16.3515 18.7387 16.7474 18.849 17.1818 18.9701C17.7135 19.1183 18.3029 19.2826 17.8145 20.4267C16.8799 22.6161 13.3934 22.6357 10.2017 22.6536C9.03136 22.6602 7.90071 22.6665 6.95003 22.7795C6.84152 22.7924 6.74527 22.8547 6.6884 22.948C5.81361 24.3834 5.19318 25.9622 4.53139 27.6462C4.38601 28.0162 4.23862 28.3912 4.08611 28.7709C3.88449 29.2729 3.31413 29.5163 2.81217 29.3147C2.31021 29.1131 2.06673 28.5427 2.26834 28.0408C3.01927 26.1712 3.88558 24.452 4.83285 22.8739C6.37878 20.027 9.42621 16.5342 12.6488 13.9103C15.5162 11.523 18.2544 9.73614 21.4413 8.38026C21.8402 8.21054 21.7218 7.74402 21.3053 7.86437C18.4789 8.68119 15.9802 10.3013 13.3904 11.9341C10.5735 13.71 8.21288 16.1115 6.76027 17.8575C6.50414 18.1653 5.94404 17.9122 6.02468 17.5199C6.65556 14.4512 7.30668 11.6349 8.26116 10.605C9.16734 9.62708 9.47742 9.8995 9.86889 10.2435Z"
+
fill={fillColor ? fillColor : "#272727"}
+
/>
+
</svg>
+
</div>
+
),
+
// ImageResponse options
+
{
+
// For convenience, we can re-use the exported icons size metadata
+
// config to also set the ImageResponse's width and height.
+
...size,
+
headers: {
+
"Cache-Control": "no-cache",
+
},
+
},
+
);
+
}
+29
app/templates/page.tsx
···
+
import Link from "next/link";
+
import { TemplateListExamples, TemplateListThemes } from "./TemplateList";
+
import { ActionButton } from "components/ActionBar/ActionButton";
+
import { HomeSmall } from "components/Icons/HomeSmall";
+
+
export const metadata = {
+
title: "Leaflet Templates",
+
description: "example themes and documents you can use!",
+
};
+
+
export default function Templates() {
+
return (
+
<div className="flex h-full bg-bg-leaflet">
+
<div className="home relative max-w-(--breakpoint-lg) w-full h-full mx-auto flex sm:flex-row flex-col-reverse px-4 sm:px-6 ">
+
<div className="homeOptions z-10 shrink-0 sm:static absolute bottom-0 place-self-end sm:place-self-start flex sm:flex-col flex-row-reverse gap-2 sm:w-fit w-full items-center pb-2 pt-1 sm:pt-7">
+
{/* NOT using <HomeButton /> b/c it does a permission check we don't need */}
+
<Link href="/home">
+
<ActionButton icon={<HomeSmall />} label="Go Home" />
+
</Link>
+
</div>
+
<div className="flex flex-col gap-10 py-6 pt-3 sm:pt-6 sm:pb-12 sm:pl-6 grow w-full h-full overflow-y-scroll no-scrollbar">
+
<h1 className="text-center">Template Library</h1>
+
<TemplateListThemes />
+
<TemplateListExamples />
+
</div>
+
</div>
+
</div>
+
);
+
}
+17 -20
appview/index.ts
···
data: record.value as Json,
});
if (docResult.error) console.log(docResult.error);
-
if (record.value.publication) {
-
let publicationURI = new AtUri(record.value.publication);
+
let publicationURI = new AtUri(record.value.publication);
-
if (publicationURI.host !== evt.uri.host) {
-
console.log("Unauthorized to create post!");
-
return;
-
}
-
let docInPublicationResult = await supabase
-
.from("documents_in_publications")
-
.upsert({
-
publication: record.value.publication,
-
document: evt.uri.toString(),
-
});
-
await supabase
-
.from("documents_in_publications")
-
.delete()
-
.neq("publication", record.value.publication)
-
.eq("document", evt.uri.toString());
-
-
if (docInPublicationResult.error)
-
console.log(docInPublicationResult.error);
+
if (publicationURI.host !== evt.uri.host) {
+
console.log("Unauthorized to create post!");
+
return;
}
+
let docInPublicationResult = await supabase
+
.from("documents_in_publications")
+
.upsert({
+
publication: record.value.publication,
+
document: evt.uri.toString(),
+
});
+
await supabase
+
.from("documents_in_publications")
+
.delete()
+
.neq("publication", record.value.publication)
+
.eq("document", evt.uri.toString());
+
if (docInPublicationResult.error)
+
console.log(docInPublicationResult.error);
}
if (evt.event === "delete") {
await supabase.from("documents").delete().eq("uri", evt.uri.toString());
+5 -12
components/ActionBar/Navigation.tsx
···
import { SpeedyLink } from "components/SpeedyLink";
import { Separator } from "components/Layout";
-
export type navPages =
-
| "home"
-
| "reader"
-
| "pub"
-
| "discover"
-
| "notifications"
-
| "looseleafs";
+
export type navPages = "home" | "reader" | "pub" | "discover" | "notifications";
export const DesktopNavigation = (props: {
currentPage: navPages;
···
publication?: string;
}) => {
let { identity } = useIdentityData();
-
+
let thisPublication = identity?.publications?.find(
+
(pub) => pub.uri === props.publication,
+
);
return (
<div className="flex gap-1 ">
<Popover
···
<DiscoverButton current={props.currentPage === "discover"} />
<hr className="border-border-light my-1" />
-
<PublicationButtons
-
currentPage={props.currentPage}
-
currentPubUri={thisPublication?.uri}
-
/>
+
<PublicationButtons currentPubUri={thisPublication?.uri} />
</>
);
};
+25 -48
components/ActionBar/Publications.tsx
···
import { PublishSmall } from "components/Icons/PublishSmall";
import { Popover } from "components/Popover";
import { BlueskyLogin } from "app/login/LoginForm";
-
import { ButtonSecondary } from "components/Buttons";
+
import { ButtonPrimary } from "components/Buttons";
import { useIsMobile } from "src/hooks/isMobile";
import { useState } from "react";
-
import { LooseLeafSmall } from "components/Icons/LooseleafSmall";
-
import { navPages } from "./Navigation";
export const PublicationButtons = (props: {
-
currentPage: navPages;
currentPubUri: string | undefined;
}) => {
let { identity } = useIdentityData();
-
let looseleaves = identity?.permission_token_on_homepage.find(
-
(f) => f.permission_tokens.leaflets_to_documents,
-
);
// don't show pub list button if not logged in or no pub list
// we show a "start a pub" banner instead
if (!identity || !identity.atp_did || identity.publications.length === 0)
return <PubListEmpty />;
-
return (
<div className="pubListWrapper w-full flex flex-col gap-1 sm:bg-transparent sm:border-0">
-
{looseleaves && (
-
<>
-
<SpeedyLink
-
href={`/looseleafs`}
-
className="flex gap-2 items-start text-secondary font-bold hover:no-underline! hover:text-accent-contrast w-full"
-
>
-
{/*TODO How should i get if this is the current page or not?
-
theres not "pub" to check the uri for. Do i need to add it as an option to NavPages? thats kinda annoying*/}
-
<ActionButton
-
label="Looseleafs"
-
icon={<LooseLeafSmall />}
-
nav
-
className={
-
props.currentPage === "looseleafs"
-
? "bg-bg-page! border-border!"
-
: ""
-
}
-
/>
-
</SpeedyLink>
-
<hr className="border-border-light border-dashed mx-1" />
-
</>
-
)}
-
{identity.publications?.map((d) => {
return (
<PublicationOption
{...d}
key={d.uri}
record={d.record}
+
asActionButton
current={d.uri === props.currentPubUri}
/>
);
···
uri: string;
name: string;
record: Json;
+
asActionButton?: boolean;
current?: boolean;
}) => {
let record = props.record as PubLeafletPublication.Record | null;
···
href={`${getBasePublicationURL(props)}/dashboard`}
className="flex gap-2 items-start text-secondary font-bold hover:no-underline! hover:text-accent-contrast w-full"
>
-
<ActionButton
-
label={record.name}
-
icon={<PubIcon record={record} uri={props.uri} />}
-
nav
-
className={props.current ? "bg-bg-page! border-border!" : ""}
-
/>
+
{props.asActionButton ? (
+
<ActionButton
+
label={record.name}
+
icon={<PubIcon record={record} uri={props.uri} />}
+
nav
+
className={props.current ? "bg-bg-page! border-border!" : ""}
+
/>
+
) : (
+
<>
+
<PubIcon record={record} uri={props.uri} />
+
<div className="truncate">{record.name}</div>
+
</>
+
)}
</SpeedyLink>
);
};
const PubListEmpty = () => {
+
let { identity } = useIdentityData();
let isMobile = useIsMobile();
let [state, setState] = useState<"default" | "info">("default");
···
/>
);
-
if (isMobile && state === "info") return <PubListEmptyContent />;
+
if (isMobile && state === "info") return <PublishPopoverContent />;
else
return (
<Popover
side="right"
align="start"
className="p-1! max-w-56"
-
asChild
trigger={
<ActionButton
label="Publish"
···
/>
}
>
-
<PubListEmptyContent />
+
<PublishPopoverContent />
</Popover>
);
};
-
export const PubListEmptyContent = (props: { compact?: boolean }) => {
+
const PublishPopoverContent = () => {
let { identity } = useIdentityData();
return (
-
<div
-
className={`bg-[var(--accent-light)] w-full rounded-md flex flex-col text-center justify-center p-2 pb-4 text-sm`}
-
>
+
<div className="bg-[var(--accent-light)] w-full rounded-md flex flex-col text-center justify-center p-2 pb-4 text-sm">
<div className="mx-auto pt-2 scale-90">
<PubListEmptyIllo />
</div>
<div className="pt-1 font-bold">Publish on AT Proto</div>
-
{identity && !identity.atp_did ? (
+
{identity && identity.atp_did ? (
// has ATProto account and no pubs
<>
<div className="pb-2 text-secondary text-xs">
···
on AT Proto
</div>
<SpeedyLink href={`lish/createPub`} className=" hover:no-underline!">
-
<ButtonSecondary className="text-sm mx-auto" compact>
+
<ButtonPrimary className="text-sm mx-auto" compact>
Start a Publication!
-
</ButtonSecondary>
+
</ButtonPrimary>
</SpeedyLink>
</>
) : (
// no ATProto account and no pubs
<>
<div className="pb-2 text-secondary text-xs">
-
Link a Bluesky account to start <br /> a new publication on AT Proto
+
Link a Bluesky account to start a new publication on AT Proto
</div>
<BlueskyLogin compact />
+6 -43
components/Blocks/BaseTextareaBlock.tsx
···
import { BlockProps } from "./Block";
import { getCoordinatesInTextarea } from "src/utils/getCoordinatesInTextarea";
import { focusBlock } from "src/utils/focusBlock";
-
import { generateKeyBetween } from "fractional-indexing";
-
import { v7 } from "uuid";
-
import { elementId } from "src/utils/elementId";
-
import { Replicache } from "replicache";
-
import { ReplicacheMutators } from "src/replicache";
-
type BaseTextareaBlockProps = AutosizeTextareaProps & {
-
block: Pick<
-
BlockProps,
-
"previousBlock" | "nextBlock" | "parent" | "position" | "nextPosition"
-
>;
-
rep?: Replicache<ReplicacheMutators> | null;
-
permissionSet?: string;
-
};
-
-
export function BaseTextareaBlock(props: BaseTextareaBlockProps) {
-
let { block, rep, permissionSet, ...passDownProps } = props;
+
export function BaseTextareaBlock(
+
props: AutosizeTextareaProps & {
+
block: Pick<BlockProps, "previousBlock" | "nextBlock">;
+
},
+
) {
+
let { block, ...passDownProps } = props;
return (
<AsyncValueAutosizeTextarea
{...passDownProps}
noWrap
onKeyDown={(e) => {
-
// Shift-Enter or Ctrl-Enter: create new text block below and focus it
-
if (
-
(e.shiftKey || e.ctrlKey || e.metaKey) &&
-
e.key === "Enter" &&
-
rep &&
-
permissionSet
-
) {
-
e.preventDefault();
-
let newEntityID = v7();
-
rep.mutate.addBlock({
-
parent: block.parent,
-
type: "text",
-
factID: v7(),
-
permission_set: permissionSet,
-
position: generateKeyBetween(
-
block.position,
-
block.nextPosition || null,
-
),
-
newEntityID,
-
});
-
-
setTimeout(() => {
-
document.getElementById(elementId.block(newEntityID).text)?.focus();
-
}, 10);
-
return true;
-
}
-
if (e.key === "ArrowUp") {
let selection = e.currentTarget.selectionStart;
+1 -10
components/Blocks/BlockCommands.tsx
···
import { BlockMathSmall } from "components/Icons/BlockMathSmall";
import { BlockCodeSmall } from "components/Icons/BlockCodeSmall";
import { QuoteSmall } from "components/Icons/QuoteSmall";
-
import { LAST_USED_CODE_LANGUAGE_KEY } from "src/utils/codeLanguageStorage";
type Props = {
parent: string;
···
type: "block",
hiddenInPublication: false,
onSelect: async (rep, props) => {
-
let entity = await createBlockWithType(rep, props, "code");
-
let lastLang = localStorage.getItem(LAST_USED_CODE_LANGUAGE_KEY);
-
if (lastLang) {
-
await rep.mutate.assertFact({
-
entity,
-
attribute: "block/code-language",
-
data: { type: "string", value: lastLang },
-
});
-
}
+
createBlockWithType(rep, props, "code");
},
},
+1 -6
components/Blocks/CodeBlock.tsx
···
import { useEntitySetContext } from "components/EntitySetProvider";
import { flushSync } from "react-dom";
import { elementId } from "src/utils/elementId";
-
import { LAST_USED_CODE_LANGUAGE_KEY } from "src/utils/codeLanguageStorage";
export function CodeBlock(props: BlockProps) {
let { rep, rootEntity } = useReplicache();
···
let focusedBlock = useUIState(
(s) => s.focusedEntity?.entityID === props.entityID,
);
-
let entity_set = useEntitySetContext();
-
let { permissions } = entity_set;
+
let { permissions } = useEntitySetContext();
const [html, setHTML] = useState<string | null>(null);
useLayoutEffect(() => {
···
}}
value={lang}
onChange={async (e) => {
-
localStorage.setItem(LAST_USED_CODE_LANGUAGE_KEY, e.target.value);
await rep?.mutate.assertFact({
attribute: "block/code-language",
entity: props.entityID,
···
data-entityid={props.entityID}
id={elementId.block(props.entityID).input}
block={props}
-
rep={rep}
-
permissionSet={entity_set.set}
spellCheck={false}
autoCapitalize="none"
autoCorrect="off"
+16 -65
components/Blocks/EmbedBlock.tsx
···
import { Input } from "components/Input";
import { isUrl } from "src/utils/isURL";
import { elementId } from "src/utils/elementId";
+
import { deleteBlock } from "./DeleteBlock";
import { focusBlock } from "src/utils/focusBlock";
import { useDrag } from "src/hooks/useDrag";
import { BlockEmbedSmall } from "components/Icons/BlockEmbedSmall";
import { CheckTiny } from "components/Icons/CheckTiny";
-
import { DotLoader } from "components/utils/DotLoader";
-
import {
-
LinkPreviewBody,
-
LinkPreviewMetadataResult,
-
} from "app/api/link_previews/route";
export const EmbedBlock = (props: BlockProps & { preview?: boolean }) => {
let { permissions } = useEntitySetContext();
···
let entity_set = useEntitySetContext();
let [linkValue, setLinkValue] = useState("");
-
let [loading, setLoading] = useState(false);
let { rep } = useReplicache();
let submit = async () => {
let entity = props.entityID;
···
}
let link = linkValue;
if (!linkValue.startsWith("http")) link = `https://${linkValue}`;
+
// these mutations = simpler subset of addLinkBlock
if (!rep) return;
-
-
// Try to get embed URL from iframely, fallback to direct URL
-
setLoading(true);
-
try {
-
let res = await fetch("/api/link_previews", {
-
headers: { "Content-Type": "application/json" },
-
method: "POST",
-
body: JSON.stringify({ url: link, type: "meta" } as LinkPreviewBody),
-
});
-
-
let embedUrl = link;
-
let embedHeight = 360;
-
-
if (res.status === 200) {
-
let data = await (res.json() as LinkPreviewMetadataResult);
-
if (data.success && data.data.links?.player?.[0]) {
-
let embed = data.data.links.player[0];
-
embedUrl = embed.href;
-
embedHeight = embed.media?.height || 300;
-
}
-
}
-
-
await rep.mutate.assertFact([
-
{
-
entity: entity,
-
attribute: "embed/url",
-
data: {
-
type: "string",
-
value: embedUrl,
-
},
-
},
-
{
-
entity: entity,
-
attribute: "embed/height",
-
data: {
-
type: "number",
-
value: embedHeight,
-
},
-
},
-
]);
-
} catch {
-
// On any error, fallback to using the URL directly
-
await rep.mutate.assertFact([
-
{
-
entity: entity,
-
attribute: "embed/url",
-
data: {
-
type: "string",
-
value: link,
-
},
-
},
-
]);
-
} finally {
-
setLoading(false);
-
}
+
await rep.mutate.assertFact({
+
entity: entity,
+
attribute: "block/type",
+
data: { type: "block-type-union", value: "embed" },
+
});
+
await rep?.mutate.assertFact({
+
entity: entity,
+
attribute: "embed/url",
+
data: {
+
type: "string",
+
value: link,
+
},
+
});
};
let smoker = useSmoker();
···
<form
onSubmit={(e) => {
e.preventDefault();
-
if (loading) return;
let rect = document
.getElementById("embed-block-submit")
?.getBoundingClientRect();
···
<button
type="submit"
id="embed-block-submit"
-
disabled={loading}
className={`p-1 ${isSelected && !isLocked ? "text-accent-contrast" : "text-border"}`}
onMouseDown={(e) => {
e.preventDefault();
-
if (loading) return;
if (!linkValue || linkValue === "") {
smoker({
error: true,
···
submit();
}}
>
-
{loading ? <DotLoader /> : <CheckTiny />}
+
<CheckTiny />
</button>
</div>
</form>
+2 -2
components/Blocks/RSVPBlock/SendUpdate.tsx
···
import { sendUpdateToRSVPS } from "actions/sendUpdateToRSVPS";
import { useReplicache } from "src/replicache";
import { Checkbox } from "components/Checkbox";
-
import { useReadOnlyShareLink } from "app/[leaflet_id]/actions/ShareOptions";
+
import { usePublishLink } from "components/ShareOptions";
export function SendUpdateButton(props: { entityID: string }) {
-
let publishLink = useReadOnlyShareLink();
+
let publishLink = usePublishLink();
let { permissions } = useEntitySetContext();
let { permission_token } = useReplicache();
let [input, setInput] = useState("");
-8
components/Blocks/TextBlock/RenderYJSFragment.tsx
···
);
}
-
if (node.constructor === XmlElement && node.nodeName === "hard_break") {
-
return <br key={index} />;
-
}
-
return null;
})
)}
···
node: XmlElement | XmlText | XmlHook,
): string {
if (node.constructor === XmlElement) {
-
// Handle hard_break nodes specially
-
if (node.nodeName === "hard_break") {
-
return "\n";
-
}
return node
.toArray()
.map((f) => YJSFragmentToString(f))
+3 -12
components/Blocks/TextBlock/inputRules.ts
···
import { schema } from "./schema";
import { useUIState } from "src/useUIState";
import { flushSync } from "react-dom";
-
import { LAST_USED_CODE_LANGUAGE_KEY } from "src/utils/codeLanguageStorage";
export const inputrules = (
propsRef: MutableRefObject<BlockProps & { entity_set: { set: string } }>,
repRef: MutableRefObject<Replicache<ReplicacheMutators> | null>,
···
// Code Block
new InputRule(/^```\s$/, (state, match) => {
-
flushSync(() => {
+
flushSync(() =>
repRef.current?.mutate.assertFact({
entity: propsRef.current.entityID,
attribute: "block/type",
data: { type: "block-type-union", value: "code" },
-
});
-
let lastLang = localStorage.getItem(LAST_USED_CODE_LANGUAGE_KEY);
-
if (lastLang) {
-
repRef.current?.mutate.assertFact({
-
entity: propsRef.current.entityID,
-
attribute: "block/code-language",
-
data: { type: "string", value: lastLang },
-
});
-
}
-
});
+
}),
+
);
setTimeout(() => {
focusBlock({ ...propsRef.current, type: "code" }, { type: "start" });
}, 20);
+5 -5
components/Blocks/TextBlock/keymap.ts
···
);
},
"Shift-Enter": (state, dispatch, view) => {
-
// Insert a hard break
-
let hardBreak = schema.nodes.hard_break.create();
-
if (dispatch) {
-
dispatch(state.tr.replaceSelectionWith(hardBreak).scrollIntoView());
+
if (multiLine) {
+
return baseKeymap.Enter(state, dispatch, view);
}
-
return true;
+
return um.withUndoGroup(() =>
+
enter(propsRef, repRef)(state, dispatch, view),
+
);
},
"Ctrl-Enter": CtrlEnter(propsRef, repRef),
"Meta-Enter": CtrlEnter(propsRef, repRef),
-7
components/Blocks/TextBlock/schema.ts
···
text: {
group: "inline",
},
-
hard_break: {
-
group: "inline",
-
inline: true,
-
selectable: false,
-
parseDOM: [{ tag: "br" }],
-
toDOM: () => ["br"] as const,
-
},
},
};
export const schema = new Schema(baseSchema);
+21 -35
components/Buttons.tsx
···
import { PopoverArrow } from "./Icons/PopoverArrow";
type ButtonProps = Omit<JSX.IntrinsicElements["button"], "content">;
-
export const ButtonPrimary = forwardRef<
HTMLButtonElement,
ButtonProps & {
···
m-0 h-max
${fullWidth ? "w-full" : fullWidthOnMobile ? "w-full sm:w-max" : "w-max"}
${compact ? "py-0 px-1" : "px-2 py-0.5 "}
-
bg-accent-1 disabled:bg-border-light
-
border border-accent-1 rounded-md disabled:border-border-light
-
outline outline-transparent outline-offset-1 focus:outline-accent-1 hover:outline-accent-1
-
text-base font-bold text-accent-2 disabled:text-border disabled:hover:text-border
+
bg-accent-1 outline-transparent border border-accent-1
+
rounded-md text-base font-bold text-accent-2
flex gap-2 items-center justify-center shrink-0
+
transparent-outline focus:outline-accent-1 hover:outline-accent-1 outline-offset-1
+
disabled:bg-border-light disabled:border-border-light disabled:text-border disabled:hover:text-border
${className}
`}
>
···
<button
{...buttonProps}
ref={ref}
-
className={`
-
m-0 h-max
+
className={`m-0 h-max
${fullWidth ? "w-full" : fullWidthOnMobile ? "w-full sm:w-max" : "w-max"}
-
${compact ? "py-0 px-1" : "px-2 py-0.5 "}
-
bg-bg-page disabled:bg-border-light
-
border border-accent-contrast rounded-md
-
outline outline-transparent focus:outline-accent-contrast hover:outline-accent-contrast outline-offset-1
-
text-base font-bold text-accent-contrast disabled:text-border disabled:hover:text-border
-
flex gap-2 items-center justify-center shrink-0
-
${props.className}
-
`}
+
${props.compact ? "py-0 px-1" : "px-2 py-0.5 "}
+
bg-bg-page outline-transparent
+
rounded-md text-base font-bold text-accent-contrast
+
flex gap-2 items-center justify-center shrink-0
+
transparent-outline focus:outline-accent-contrast hover:outline-accent-contrast outline-offset-1
+
border border-accent-contrast
+
disabled:bg-border-light disabled:text-border disabled:hover:text-border
+
${props.className}
+
`}
>
{props.children}
</button>
···
HTMLButtonElement,
{
fullWidth?: boolean;
-
fullWidthOnMobile?: boolean;
children: React.ReactNode;
compact?: boolean;
} & ButtonProps
>((props, ref) => {
-
let {
-
className,
-
fullWidth,
-
fullWidthOnMobile,
-
compact,
-
children,
-
...buttonProps
-
} = props;
+
let { fullWidth, children, compact, ...buttonProps } = props;
return (
<button
{...buttonProps}
ref={ref}
-
className={`
-
m-0 h-max
-
${fullWidth ? "w-full" : fullWidthOnMobile ? "w-full sm:w-max" : "w-max"}
-
${compact ? "py-0 px-1" : "px-2 py-0.5 "}
-
bg-transparent hover:bg-[var(--accent-light)]
-
border border-transparent rounded-md hover:border-[var(--accent-light)]
-
outline outline-transparent focus:outline-[var(--accent-light)] hover:outline-[var(--accent-light)] outline-offset-1
-
text-base font-bold text-accent-contrast disabled:text-border
-
flex gap-2 items-center justify-center shrink-0
-
${props.className}
-
`}
+
className={`m-0 h-max ${fullWidth ? "w-full" : "w-max"} ${compact ? "px-0" : "px-1"}
+
bg-transparent text-base font-bold text-accent-contrast
+
flex gap-2 items-center justify-center shrink-0
+
hover:underline disabled:text-border
+
${props.className}
+
`}
>
{children}
</button>
+173
components/HelpPopover.tsx
···
+
"use client";
+
import { ShortcutKey } from "./Layout";
+
import { Media } from "./Media";
+
import { Popover } from "./Popover";
+
import { metaKey } from "src/utils/metaKey";
+
import { useEntitySetContext } from "./EntitySetProvider";
+
import { useState } from "react";
+
import { ActionButton } from "components/ActionBar/ActionButton";
+
import { HelpSmall } from "./Icons/HelpSmall";
+
import { isMac } from "src/utils/isDevice";
+
import { useIsMobile } from "src/hooks/isMobile";
+
+
export const HelpPopover = (props: { noShortcuts?: boolean }) => {
+
let entity_set = useEntitySetContext();
+
let isMobile = useIsMobile();
+
+
return entity_set.permissions.write ? (
+
<Popover
+
side={isMobile ? "top" : "right"}
+
align={isMobile ? "center" : "start"}
+
asChild
+
className="max-w-xs w-full"
+
trigger={<ActionButton icon={<HelpSmall />} label="About" />}
+
>
+
<div className="flex flex-col text-sm gap-2 text-secondary">
+
{/* about links */}
+
<HelpLink text="📖 Leaflet Manual" url="https://about.leaflet.pub" />
+
<HelpLink text="💡 Make with Leaflet" url="https://make.leaflet.pub" />
+
<HelpLink
+
text="✨ Explore Publications"
+
url="https://leaflet.pub/discover"
+
/>
+
<HelpLink text="📣 Newsletter" url="https://buttondown.com/leaflet" />
+
{/* contact links */}
+
<div className="columns-2 gap-2">
+
<HelpLink
+
text="🦋 Bluesky"
+
url="https://bsky.app/profile/leaflet.pub"
+
/>
+
<HelpLink text="💌 Email" url="mailto:contact@leaflet.pub" />
+
</div>
+
{/* keyboard shortcuts: desktop only */}
+
<Media mobile={false}>
+
{!props.noShortcuts && (
+
<>
+
<hr className="text-border my-1" />
+
<div className="flex flex-col gap-1">
+
<Label>Text Shortcuts</Label>
+
<KeyboardShortcut name="Bold" keys={[metaKey(), "B"]} />
+
<KeyboardShortcut name="Italic" keys={[metaKey(), "I"]} />
+
<KeyboardShortcut name="Underline" keys={[metaKey(), "U"]} />
+
<KeyboardShortcut
+
name="Highlight"
+
keys={[metaKey(), isMac() ? "Ctrl" : "Meta", "H"]}
+
/>
+
<KeyboardShortcut
+
name="Strikethrough"
+
keys={[metaKey(), isMac() ? "Ctrl" : "Meta", "X"]}
+
/>
+
<KeyboardShortcut name="Inline Link" keys={[metaKey(), "K"]} />
+
+
<Label>Block Shortcuts</Label>
+
{/* shift + up/down arrows (or click + drag): select multiple blocks */}
+
<KeyboardShortcut
+
name="Move Block Up"
+
keys={["Shift", metaKey(), "↑"]}
+
/>
+
<KeyboardShortcut
+
name="Move Block Down"
+
keys={["Shift", metaKey(), "↓"]}
+
/>
+
{/* cmd/ctrl-a: first selects all text in a block; again selects all blocks on page */}
+
{/* cmd/ctrl + up/down arrows: go to beginning / end of doc */}
+
+
<Label>Canvas Shortcuts</Label>
+
<OtherShortcut name="Add Block" description="Double click" />
+
<OtherShortcut name="Select Block" description="Long press" />
+
+
<Label>Outliner Shortcuts</Label>
+
<KeyboardShortcut
+
name="Make List"
+
keys={[metaKey(), isMac() ? "Opt" : "Alt", "L"]}
+
/>
+
{/* tab / shift + tab: indent / outdent */}
+
<KeyboardShortcut
+
name="Toggle Checkbox"
+
keys={[metaKey(), "Enter"]}
+
/>
+
<KeyboardShortcut
+
name="Toggle Fold"
+
keys={[metaKey(), "Shift", "Enter"]}
+
/>
+
<KeyboardShortcut
+
name="Fold All"
+
keys={[metaKey(), isMac() ? "Opt" : "Alt", "Shift", "↑"]}
+
/>
+
<KeyboardShortcut
+
name="Unfold All"
+
keys={[metaKey(), isMac() ? "Opt" : "Alt", "Shift", "↓"]}
+
/>
+
</div>
+
</>
+
)}
+
</Media>
+
{/* links: terms and privacy */}
+
<hr className="text-border my-1" />
+
{/* <HelpLink
+
text="Terms and Privacy Policy"
+
url="https://leaflet.pub/legal"
+
/> */}
+
<div>
+
<a href="https://leaflet.pub/legal" target="_blank">
+
Terms and Privacy Policy
+
</a>
+
</div>
+
</div>
+
</Popover>
+
) : null;
+
};
+
+
const KeyboardShortcut = (props: { name: string; keys: string[] }) => {
+
return (
+
<div className="flex gap-2 justify-between items-center">
+
{props.name}
+
<div className="flex gap-1 items-center font-bold">
+
{props.keys.map((key, index) => {
+
return <ShortcutKey key={index}>{key}</ShortcutKey>;
+
})}
+
</div>
+
</div>
+
);
+
};
+
+
const OtherShortcut = (props: { name: string; description: string }) => {
+
return (
+
<div className="flex justify-between items-center">
+
<span>{props.name}</span>
+
<span>
+
<strong>{props.description}</strong>
+
</span>
+
</div>
+
);
+
};
+
+
const Label = (props: { children: React.ReactNode }) => {
+
return <div className="text-tertiary font-bold pt-2 ">{props.children}</div>;
+
};
+
+
const HelpLink = (props: { url: string; text: string }) => {
+
const [isHovered, setIsHovered] = useState(false);
+
const handleMouseEnter = () => {
+
setIsHovered(true);
+
};
+
const handleMouseLeave = () => {
+
setIsHovered(false);
+
};
+
return (
+
<a
+
href={props.url}
+
target="_blank"
+
className="py-2 px-2 rounded-md flex flex-col gap-1 bg-border-light hover:bg-border hover:no-underline"
+
style={{
+
backgroundColor: isHovered
+
? "color-mix(in oklab, rgb(var(--accent-contrast)), rgb(var(--bg-page)) 85%)"
+
: "color-mix(in oklab, rgb(var(--accent-contrast)), rgb(var(--bg-page)) 75%)",
+
}}
+
onMouseEnter={handleMouseEnter}
+
onMouseLeave={handleMouseLeave}
+
>
+
<strong>{props.text}</strong>
+
</a>
+
);
+
};
+76
components/HomeButton.tsx
···
+
"use client";
+
import Link from "next/link";
+
import { useEntitySetContext } from "./EntitySetProvider";
+
import { ActionButton } from "components/ActionBar/ActionButton";
+
import { useParams, useSearchParams } from "next/navigation";
+
import { useIdentityData } from "./IdentityProvider";
+
import { useReplicache } from "src/replicache";
+
import { addLeafletToHome } from "actions/addLeafletToHome";
+
import { useSmoker } from "./Toast";
+
import { AddToHomeSmall } from "./Icons/AddToHomeSmall";
+
import { HomeSmall } from "./Icons/HomeSmall";
+
import { permission } from "process";
+
+
export function HomeButton() {
+
let { permissions } = useEntitySetContext();
+
let searchParams = useSearchParams();
+
+
return (
+
<>
+
<Link
+
href="/home"
+
prefetch
+
className="hover:no-underline"
+
style={{ textDecorationLine: "none !important" }}
+
>
+
<ActionButton icon={<HomeSmall />} label="Go Home" />
+
</Link>
+
{<AddToHomeButton />}
+
</>
+
);
+
}
+
+
const AddToHomeButton = (props: {}) => {
+
let { permission_token } = useReplicache();
+
let { identity, mutate } = useIdentityData();
+
let smoker = useSmoker();
+
if (
+
identity?.permission_token_on_homepage.find(
+
(pth) => pth.permission_tokens.id === permission_token.id,
+
) ||
+
!identity
+
)
+
return null;
+
return (
+
<ActionButton
+
onClick={async (e) => {
+
await addLeafletToHome(permission_token.id);
+
mutate((identity) => {
+
if (!identity) return;
+
return {
+
...identity,
+
permission_token_on_homepage: [
+
...identity.permission_token_on_homepage,
+
{
+
created_at: new Date().toISOString(),
+
permission_tokens: {
+
...permission_token,
+
leaflets_in_publications: [],
+
},
+
},
+
],
+
};
+
});
+
smoker({
+
position: {
+
x: e.clientX + 64,
+
y: e.clientY,
+
},
+
text: "Leaflet added to your home!",
+
});
+
}}
+
icon={<AddToHomeSmall />}
+
label="Add to Home"
+
/>
+
);
+
};
-21
components/Icons/ArchiveSmall.tsx
···
-
import { Props } from "./Props";
-
-
export const ArchiveSmall = (props: Props) => {
-
return (
-
<svg
-
width="24"
-
height="24"
-
viewBox="0 0 24 24"
-
fill="none"
-
xmlns="http://www.w3.org/2000/svg"
-
{...props}
-
>
-
<path
-
fillRule="evenodd"
-
clipRule="evenodd"
-
d="M14.3935 2.33729C14.4781 2.30741 14.5682 2.29611 14.6576 2.30415C14.7774 2.31514 14.897 2.32836 15.0165 2.34211C15.2401 2.36784 15.5571 2.40755 15.9337 2.46375C16.6844 2.57577 17.6834 2.755 18.6552 3.02334C20.043 3.40654 21.1623 4.08204 21.9307 4.65549C22.3161 4.94319 22.6172 5.20811 22.8237 5.40315C22.9788 5.5496 23.0813 5.6572 23.1271 5.70673C23.3287 5.92633 23.375 6.26081 23.1986 6.51162C23.0315 6.74906 22.723 6.84022 22.4537 6.73167C22.0456 6.56715 21.4938 6.48314 21.0486 6.65428C20.807 6.74717 20.531 6.94113 20.3218 7.3713L20.6009 7.19094C20.7969 7.06426 21.0472 7.05737 21.2499 7.17306C21.4527 7.28875 21.574 7.50775 21.5646 7.74096L21.2277 16.1284C21.2197 16.3285 21.1162 16.5127 20.9494 16.6237L11.9336 22.6232C11.7666 22.7343 11.5564 22.7585 11.3685 22.6883L2.23473 19.2743C2.00112 19.187 1.84179 18.9692 1.82933 18.7201L1.40252 10.1857C1.39041 9.94356 1.5194 9.71628 1.73347 9.60253L2.89319 8.98631C3.19801 8.82434 3.57642 8.94015 3.73838 9.24497C3.8855 9.52184 3.80344 9.85944 3.55872 10.0404L4.46834 10.3669C4.529 10.1684 4.63256 9.64884 4.57793 9.06783C4.51992 8.45086 4.29459 7.8533 3.74994 7.45779C3.09256 6.98978 2.55044 6.51789 2.315 6.27264C2.07596 6.02363 2.08403 5.62799 2.33304 5.38894C2.58204 5.14989 2.97769 5.15797 3.21674 5.40697C3.38499 5.58224 3.87255 6.01278 4.49863 6.45635C5.12762 6.90198 5.83958 7.31975 6.4589 7.5144C7.00579 7.68628 7.7553 7.62969 8.5369 7.43649C9.3015 7.24751 10.0054 6.95105 10.4074 6.74228C10.5756 6.65494 10.7743 6.64864 10.9477 6.72514C12.2233 7.28795 12.9191 8.50607 13.2891 9.66169C13.5067 10.3415 13.6259 11.0415 13.6803 11.6632L15.3414 10.5898C15.3412 10.5032 15.3407 10.4155 15.3403 10.3268C15.3336 9.034 15.3259 7.52674 16.0328 6.1972C15.7338 6.16682 15.3912 6.12949 15.0302 6.08539C13.9285 5.95083 12.5649 5.74352 11.7833 5.45362C11.0189 5.17008 10.3102 4.75223 9.80152 4.41446C9.6696 4.32685 9.54977 4.24371 9.4444 4.16843C9.26969 4.41598 9.11811 4.6909 8.99766 4.9675C8.79907 5.42358 8.71173 5.82238 8.71173 6.05267C8.71173 6.39784 8.43191 6.67767 8.08673 6.67767C7.74155 6.67767 7.46173 6.39784 7.46173 6.05267C7.46173 5.58769 7.61509 5.01162 7.8516 4.46846C8.09203 3.91632 8.44552 3.33542 8.89963 2.8725C9.12701 2.64071 9.4943 2.62192 9.74446 2.82883L9.74577 2.8299C9.80956 2.88191 9.87475 2.93223 9.94039 2.98188C10.0714 3.08094 10.2612 3.21923 10.493 3.37315C10.9612 3.68404 11.5799 4.04492 12.218 4.28164C12.8391 4.512 14.0548 4.70696 15.1817 4.84461C15.7313 4.91174 16.2384 4.96292 16.6084 4.99732C16.8076 5.01584 17.007 5.03362 17.2065 5.04896C17.4444 5.06698 17.6512 5.21883 17.7397 5.44036C17.8282 5.66191 17.7828 5.9145 17.6228 6.09143C16.7171 7.09276 16.6045 8.33681 16.5923 9.78143L18.8039 8.35222C18.7998 8.30706 18.8006 8.26075 18.8068 8.21391C19.0047 6.71062 19.6821 5.84043 20.6001 5.48753C20.6783 5.45746 20.7569 5.4317 20.8356 5.40989C20.1821 4.96625 19.3286 4.50604 18.3225 4.22826C17.4178 3.97844 16.4732 3.80809 15.7493 3.70006C15.3886 3.64625 15.0857 3.60832 14.8736 3.58392C14.8084 3.57642 14.7519 3.57021 14.705 3.56521C14.6894 3.57354 14.6728 3.58282 14.6556 3.59303C14.5489 3.65657 14.4711 3.72644 14.4347 3.7856C14.2538 4.07957 13.8688 4.17123 13.5749 3.99032C13.2809 3.80941 13.1892 3.42445 13.3701 3.13047C13.5575 2.82606 13.8293 2.63024 14.0162 2.51897C14.1352 2.44809 14.2601 2.38531 14.3906 2.33829L14.3921 2.33776L14.3935 2.33729ZM12.4675 12.447C12.4635 11.7846 12.3687 10.8866 12.0986 10.0428C11.8096 9.1402 11.353 8.39584 10.6886 7.99621C10.209 8.21933 9.54785 8.47423 8.83684 8.64998C7.98278 8.86108 6.96103 8.98249 6.08412 8.70689C5.98146 8.67463 5.87826 8.63824 5.77495 8.59834C5.79615 8.71819 5.81166 8.83611 5.82244 8.95081C5.89602 9.73333 5.75996 10.4455 5.64541 10.7895L11.68 12.9559L12.4675 12.447ZM4.77065 13.1487C4.60756 13.0891 4.43494 13.2099 4.43494 13.3835V14.9513C4.43494 15.1613 4.5662 15.3489 4.76351 15.421L8.55169 16.8036C8.71479 16.8631 8.88741 16.7423 8.88741 16.5687V15.001C8.88741 14.7909 8.75614 14.6033 8.55884 14.5313L4.77065 13.1487ZM2.69778 11.0594L11.1256 14.085L11.0552 17.5412C11.0482 17.8863 11.3222 18.1718 11.6673 18.1788C12.0124 18.1859 12.2979 17.9118 12.3049 17.5667L12.3778 13.9933L20.2673 8.89485L19.9915 15.7596L12.2366 20.9201L12.2469 20.4127C12.254 20.0676 11.9799 19.7821 11.6348 19.7751C11.2897 19.768 11.0042 20.0421 10.9972 20.3872L10.9804 21.2088L3.05725 18.2473L2.69778 11.0594Z"
-
fill="currentColor"
-
/>
-
</svg>
-
);
-
};
-19
components/Icons/LooseleafSmall.tsx
···
-
import { Props } from "./Props";
-
-
export const LooseLeafSmall = (props: Props) => {
-
return (
-
<svg
-
width="24"
-
height="24"
-
viewBox="0 0 24 24"
-
fill="none"
-
xmlns="http://www.w3.org/2000/svg"
-
{...props}
-
>
-
<path
-
d="M16.5339 4.65788L21.9958 5.24186C22.4035 5.28543 22.7014 5.6481 22.6638 6.05632C22.5159 7.65303 22.3525 9.87767 22.0925 11.9186C21.9621 12.9418 21.805 13.9374 21.6091 14.8034C21.4166 15.6542 21.1733 16.442 20.8454 17.0104C20.1989 18.131 19.0036 18.9569 17.9958 19.4782C17.4793 19.7453 16.9792 19.9495 16.569 20.0827C16.3649 20.1489 16.1724 20.2013 16.0046 20.234C15.8969 20.255 15.7254 20.2816 15.5495 20.2682C15.5466 20.2681 15.5423 20.2684 15.5378 20.2682C15.527 20.2678 15.5112 20.267 15.4919 20.2663C15.4526 20.2647 15.3959 20.2623 15.3239 20.2584C15.1788 20.2506 14.9699 20.2366 14.7116 20.2145C14.1954 20.1703 13.4757 20.0909 12.6598 19.9489C11.0477 19.6681 8.97633 19.1301 7.36198 18.0807C6.70824 17.6557 5.95381 17.064 5.21842 16.4469C5.09798 16.5214 4.97261 16.591 4.81803 16.6706C4.28341 16.9455 3.71779 17.0389 3.17935 16.9137C2.64094 16.7885 2.20091 16.4608 1.89126 16.0231C1.28226 15.1618 1.16463 13.8852 1.5729 12.5514L1.60708 12.4606C1.7005 12.255 1.88295 12.1001 2.10513 12.0436C2.35906 11.9792 2.62917 12.0524 2.81607 12.236L2.82486 12.2448C2.8309 12.2507 2.84033 12.2596 2.8522 12.2712C2.87664 12.295 2.91343 12.3309 2.9606 12.3766C3.05513 12.4682 3.19281 12.6016 3.3649 12.7653C3.70953 13.0931 4.19153 13.5443 4.73795 14.0378C5.84211 15.0349 7.17372 16.1691 8.17937 16.8229C9.53761 17.7059 11.3696 18.2017 12.9177 18.4713C13.6815 18.6043 14.3565 18.679 14.8395 18.7204C15.0804 18.741 15.2731 18.7533 15.404 18.7604C15.4691 18.7639 15.5195 18.7659 15.5524 18.7672C15.5684 18.7679 15.5809 18.7689 15.5886 18.7692H15.5983L15.6374 18.7731C15.6457 18.7724 15.671 18.7704 15.7175 18.7614C15.8087 18.7436 15.9399 18.7095 16.1052 18.6559C16.4345 18.549 16.8594 18.3773 17.3063 18.1461C18.2257 17.6706 19.1147 17.0089 19.5466 16.2604C19.7578 15.8941 19.9618 15.2874 20.1462 14.4723C20.3271 13.6723 20.4767 12.7294 20.6042 11.7292C20.8232 10.0102 20.9711 8.17469 21.1042 6.65397L16.3747 6.14909C15.963 6.10498 15.6648 5.73562 15.7087 5.3239C15.7528 4.91222 16.1222 4.61399 16.5339 4.65788ZM12.0593 13.1315L12.2038 13.1647L12.3776 13.235C12.7592 13.4197 12.9689 13.7541 13.0837 14.0573C13.2089 14.3885 13.2545 14.7654 13.2858 15.0573C13.3144 15.3233 13.3319 15.5214 13.361 15.6774C13.4345 15.6215 13.5233 15.5493 13.6413 15.4479C13.7924 15.318 14.0034 15.1374 14.2429 15.0114C14.4965 14.878 14.8338 14.7772 15.2175 14.8747C15.5354 14.9556 15.7394 15.1539 15.8679 15.3229C15.9757 15.4648 16.0814 15.6631 16.1247 15.736C16.1889 15.8438 16.2218 15.8788 16.239 15.8922C16.2438 15.896 16.2462 15.8979 16.2497 15.8991C16.2541 15.9005 16.2717 15.9049 16.3093 15.9049C16.6541 15.9051 16.934 16.1851 16.9343 16.5299C16.9343 16.875 16.6543 17.1548 16.3093 17.1549C15.9766 17.1549 15.6957 17.0542 15.4694 16.8776C15.2617 16.7153 15.1322 16.5129 15.0505 16.3756C14.9547 16.2147 14.9262 16.1561 14.8815 16.0944C14.8684 16.0989 14.849 16.1051 14.8249 16.1178C14.7289 16.1684 14.6182 16.2555 14.4557 16.3952C14.3175 16.514 14.1171 16.6946 13.9069 16.821C13.6882 16.9524 13.3571 17.0902 12.9684 16.9938C12.4305 16.8602 12.2473 16.3736 12.1764 16.1051C12.1001 15.8159 12.0709 15.4542 12.0427 15.1911C12.0102 14.8884 11.9751 14.662 11.9138 14.4997C11.9011 14.4662 11.8884 14.4403 11.8776 14.4206C11.7899 14.4801 11.6771 14.5721 11.5329 14.7047C11.3855 14.8404 11.181 15.0386 11.0016 15.196C10.8175 15.3575 10.5936 15.5364 10.3512 15.6569C10.19 15.737 9.99118 15.7919 9.77214 15.7594C9.55026 15.7264 9.38367 15.6153 9.27019 15.5045C9.08085 15.3197 8.96362 15.0503 8.91081 14.9391C8.8766 14.8671 8.85074 14.814 8.82585 14.7692C8.541 14.777 8.27798 14.5891 8.20378 14.3014C8.11797 13.9674 8.31907 13.6269 8.653 13.5407L8.79558 13.5124C8.93966 13.4936 9.0875 13.5034 9.23308 13.5485C9.42396 13.6076 9.569 13.7155 9.67449 13.8239C9.85113 14.0055 9.96389 14.244 10.027 14.3776C10.0723 14.3417 10.124 14.3034 10.1774 14.2565C10.3474 14.1073 10.4942 13.9615 10.6862 13.7848C10.8571 13.6276 11.0614 13.4475 11.2731 13.32C11.4428 13.2178 11.7294 13.081 12.0593 13.1315ZM2.84537 14.3366C2.88081 14.6965 2.98677 14.9742 3.11588 15.1569C3.24114 15.334 3.38295 15.4211 3.5192 15.4528C3.63372 15.4794 3.79473 15.4775 4.00553 15.3932C3.9133 15.3109 3.82072 15.2311 3.73209 15.151C3.40947 14.8597 3.10909 14.5828 2.84537 14.3366ZM8.73601 3.86003C9.14672 3.91292 9.43715 4.28918 9.38445 4.69987C9.25964 5.66903 9.14642 7.35598 8.87077 9.02018C8.59001 10.7151 8.11848 12.5766 7.20085 14.1003C6.98712 14.4551 6.52539 14.5698 6.17057 14.3561C5.81623 14.1423 5.70216 13.6814 5.91569 13.3268C6.68703 12.0463 7.121 10.4066 7.39128 8.77506C7.66663 7.11265 7.74965 5.64618 7.89616 4.50847C7.94916 4.09794 8.32546 3.80744 8.73601 3.86003ZM11.7614 8.36784C12.1238 8.21561 12.4973 8.25977 12.8054 8.46452C13.0762 8.64474 13.2601 8.92332 13.3884 9.18912C13.5214 9.46512 13.6241 9.79028 13.7009 10.1354C13.7561 10.3842 13.7827 10.6162 13.8034 10.8044C13.8257 11.0069 13.8398 11.1363 13.864 11.2438C13.8806 11.3174 13.8959 11.3474 13.9011 11.3561C13.9095 11.3609 13.9289 11.3695 13.9655 11.3786C14.0484 11.3991 14.0814 11.3929 14.0895 11.3913C14.1027 11.3885 14.1323 11.3804 14.2028 11.3366C14.3137 11.2677 14.6514 11.0042 15.0563 10.8288L15.1364 10.7985C15.3223 10.7392 15.4987 10.7526 15.6335 10.7838C15.7837 10.8188 15.918 10.883 16.0231 10.9421C16.2276 11.057 16.4458 11.2251 16.613 11.3503C16.8019 11.4917 16.9527 11.5999 17.0827 11.6676C17.1539 11.7047 17.1908 11.7142 17.2009 11.7165L17.2849 11.7047C17.5751 11.6944 17.8425 11.8891 17.9138 12.1823C17.995 12.5174 17.7897 12.8554 17.4548 12.9372C17.0733 13.0299 16.7253 12.8909 16.5046 12.776C16.2705 12.6541 16.042 12.4845 15.864 12.3512C15.6704 12.2064 15.5344 12.1038 15.4216 12.0387C15.2178 12.1436 15.1125 12.2426 14.862 12.3981C14.7283 12.4811 14.5564 12.5716 14.3415 12.6159C14.1216 12.6611 13.8975 12.6501 13.6647 12.5924C13.3819 12.5222 13.1344 12.3858 12.9479 12.1657C12.7701 11.9555 12.689 11.7172 12.6442 11.5182C12.601 11.3259 12.58 11.112 12.5612 10.9411C12.5408 10.7561 12.5194 10.5827 12.4802 10.4059C12.4169 10.1215 12.3411 9.89526 12.2624 9.73209C12.2296 9.66404 12.1981 9.61255 12.1716 9.57487C12.1263 9.61576 12.0615 9.68493 11.9802 9.7985C11.8864 9.92952 11.7821 10.0922 11.6589 10.2838C11.5393 10.4698 11.4043 10.6782 11.2634 10.8786C11.123 11.0782 10.9664 11.2843 10.7975 11.4635C10.633 11.6381 10.4285 11.8185 10.1862 11.9342C9.87476 12.0828 9.50095 11.9507 9.35222 11.6393C9.20377 11.3279 9.33594 10.9551 9.64714 10.8063C9.69148 10.7851 9.77329 10.7282 9.88835 10.6061C9.99931 10.4883 10.1167 10.3365 10.2409 10.1598C10.3647 9.98378 10.4855 9.79617 10.6071 9.60709C10.7249 9.42397 10.8479 9.23258 10.9636 9.07096C11.1814 8.76677 11.4424 8.50191 11.7614 8.36784ZM12.4304 2.81218C13.631 2.81246 14.6042 3.78628 14.6042 4.98698C14.6041 5.39899 14.4869 5.78271 14.2878 6.111L15.0007 6.9069C15.2772 7.21532 15.2515 7.689 14.9431 7.96549C14.6347 8.24164 14.1609 8.21606 13.8845 7.90788L13.1139 7.0485C12.8988 7.11984 12.6695 7.16075 12.4304 7.16081C11.2296 7.16081 10.2558 6.18766 10.2555 4.98698C10.2555 3.7861 11.2295 2.81218 12.4304 2.81218ZM12.4304 4.31218C12.0579 4.31218 11.7555 4.61453 11.7555 4.98698C11.7558 5.35924 12.058 5.66081 12.4304 5.66081C12.8024 5.66053 13.104 5.35907 13.1042 4.98698C13.1042 4.6147 12.8026 4.31246 12.4304 4.31218Z"
-
fill="currentColor"
-
/>
-
</svg>
-
);
-
};
+21
components/Icons/TemplateRemoveSmall.tsx
···
+
import { Props } from "./Props";
+
+
export const TemplateRemoveSmall = (props: Props) => {
+
return (
+
<svg
+
width="24"
+
height="24"
+
viewBox="0 0 24 24"
+
fill="none"
+
xmlns="http://www.w3.org/2000/svg"
+
{...props}
+
>
+
<path
+
fillRule="evenodd"
+
clipRule="evenodd"
+
d="M21.6598 1.22969C22.0503 0.839167 22.6835 0.839167 23.074 1.22969C23.4646 1.62021 23.4646 2.25338 23.074 2.6439L21.9991 3.71887C22 3.72121 22.001 3.72355 22.002 3.7259L21.0348 4.69374C21.0347 4.69033 21.0345 4.68693 21.0344 4.68353L17.2882 8.42972L17.2977 8.43313L16.3813 9.35011L16.3714 9.34656L15.5955 10.1224L15.6058 10.1261L14.6894 11.0431L14.6787 11.0393L14.3959 11.3221L14.4067 11.326L13.4903 12.2429L13.479 12.2389L12.8919 12.8261L12.9034 12.8302L10.2156 15.5198L10.2028 15.5152L9.35969 16.3583C9.36255 16.3614 9.36541 16.3645 9.36826 16.3676L7.20585 18.5314C7.19871 18.5321 7.19159 18.5328 7.18448 18.5335L6.26611 19.4519C6.27069 19.4539 6.27528 19.4559 6.27989 19.4579L5.40679 20.3316C5.40244 20.3291 5.39809 20.3267 5.39376 20.3242L2.54817 23.1698C2.15765 23.5603 1.52448 23.5603 1.13396 23.1698C0.743434 22.7793 0.743433 22.1461 1.13396 21.7556L4.57518 18.3144C4.5862 18.296 4.59778 18.2779 4.6099 18.2599C4.72342 18.0917 4.86961 17.964 5.02393 17.8656L6.39488 16.4947C6.25376 16.4822 6.10989 16.4734 5.96441 16.4685C5.20904 16.4433 4.461 16.5264 3.88183 16.7201C3.2818 16.9207 2.99485 17.1912 2.91069 17.4452C2.80892 17.7525 2.47737 17.919 2.17013 17.8173C1.8629 17.7155 1.69634 17.3839 1.79811 17.0767C2.05627 16.2973 2.78206 15.852 3.51019 15.6085C4.2592 15.3581 5.15477 15.2689 6.00346 15.2972C6.48903 15.3133 6.97583 15.3686 7.42782 15.4617L8.11942 14.7701L7.89431 14.6896C7.7838 14.6501 7.69213 14.5705 7.63742 14.4667L5.91365 11.1952C5.86162 11.0964 5.84836 10.9944 5.86434 10.9002L5.85245 10.9196L5.11563 9.4308C4.96523 9.11293 5.04515 8.78343 5.24544 8.56361L5.25054 8.55806C5.25749 8.55058 5.26457 8.54323 5.2718 8.53601L6.43022 7.3457C6.6445 7.11834 6.97346 7.03892 7.26837 7.14439L9.80363 8.05107L12.9624 7.10485C13.1067 7.02062 13.2859 6.99834 13.4555 7.05901L14.4322 7.40831C14.7942 6.69891 14.93 5.89897 15.0777 5.02873L15.0777 5.02872L15.0958 4.9222C15.2586 3.96572 15.4529 2.86736 16.1798 2.04515C17.0056 1.11114 18.7307 0.837125 20.2663 1.83615C20.4285 1.94168 20.5821 2.05061 20.7266 2.16294L21.6598 1.22969ZM19.8899 2.99965C19.8075 2.93935 19.72 2.87895 19.6271 2.81856C18.4897 2.07854 17.4326 2.39759 17.0579 2.82147C16.5869 3.3541 16.4234 4.10723 16.2512 5.11887L16.2231 5.28522L16.2231 5.28523C16.1304 5.83581 16.0274 6.44661 15.8342 7.05527L19.8899 2.99965ZM14.288 8.60148L13.2682 8.23675L11.6654 8.71688L13.5122 9.37736L14.288 8.60148ZM12.5953 10.2942L9.59692 9.22187L9.58424 9.21734L7.10654 8.33124L6.82935 8.61605L12.3125 10.577L12.5953 10.2942ZM11.3957 11.4938L6.56005 9.76447L6.04788 10.6006C6.16458 10.5123 6.32269 10.4767 6.48628 10.5352L10.8085 12.081L11.3957 11.4938ZM17.0099 12.2569L16.2294 11.9778L15.313 12.8948L16.8798 13.4551L18.7426 16.9905L18.0747 17.8398L19.1912 18.2615C19.6607 18.4294 20.1033 18.1358 20.2179 17.728L20.7391 16.3648C20.824 16.1511 20.8112 15.9108 20.7039 15.7071L19.124 12.7086L18.8949 11.321L18.8931 11.3104L18.8904 11.2969C18.8874 11.234 18.8742 11.1705 18.8497 11.1087L18.3522 9.8537L16.5121 11.6949L16.5482 11.7078L16.5582 11.7115L17.1419 11.9202L17.0099 12.2569ZM12.0382 16.1716L14.7261 13.482L16.0553 13.9574C16.1658 13.9969 16.2575 14.0764 16.3122 14.1803L18.0359 17.4518C18.2352 17.83 17.8658 18.2557 17.4633 18.1118L12.0382 16.1716ZM8.44038 19.7717L7.26492 20.9479C7.80247 21.0274 8.35468 21.0252 8.82243 20.8811C9.24804 20.7499 9.52382 20.5096 9.73008 20.285C9.79978 20.2091 9.87046 20.1246 9.92979 20.0536L9.92981 20.0536L9.92999 20.0534L9.9306 20.0527C9.95072 20.0286 9.96953 20.0061 9.98653 19.9861C10.0618 19.8973 10.1248 19.8281 10.1905 19.7694C10.307 19.6651 10.4472 19.579 10.6908 19.5395C10.9182 19.5027 11.2529 19.5041 11.7567 19.6004C11.6943 19.6815 11.6359 19.764 11.5823 19.8476C11.3276 20.2439 11.1352 20.7322 11.2038 21.2293C11.3097 21.9955 11.8139 22.4463 12.3522 22.6544C12.8626 22.8518 13.4377 22.8513 13.8631 22.731C14.7279 22.4863 15.6213 21.724 15.4107 20.664C15.3105 20.1591 14.9656 19.7211 14.4516 19.3701C14.3677 19.3128 14.2783 19.2571 14.1833 19.203C14.5987 19.0436 14.9889 19.0051 15.2828 19.1025C15.59 19.2042 15.9215 19.0377 16.0233 18.7304C16.1251 18.4232 15.9585 18.0916 15.6513 17.9899C14.6724 17.6656 13.5751 18.0821 12.7766 18.6397C12.6141 18.5938 12.4436 18.5504 12.265 18.5097C11.5394 18.3444 10.9698 18.307 10.5035 18.3825C10.018 18.4612 9.67586 18.657 9.40877 18.8961C9.28262 19.009 9.17853 19.1268 9.09296 19.2277C9.06342 19.2625 9.03731 19.2937 9.0131 19.3227L9.01295 19.3228C8.9605 19.3856 8.91697 19.4377 8.86686 19.4922C8.73917 19.6313 8.63185 19.7134 8.47726 19.761C8.46519 19.7648 8.45289 19.7683 8.44038 19.7717ZM12.5683 20.4811C12.3863 20.7644 12.3505 20.965 12.3648 21.0689C12.4003 21.3259 12.5445 21.4722 12.7749 21.5613C13.0331 21.6611 13.3469 21.659 13.544 21.6032C14.1554 21.4302 14.2952 21.0637 14.2612 20.8923C14.2391 20.7814 14.1422 20.578 13.7907 20.338C13.6005 20.2082 13.347 20.076 13.0173 19.9508C12.8341 20.1242 12.681 20.3057 12.5683 20.4811Z"
+
fill="currentColor"
+
/>
+
</svg>
+
);
+
};
+25
components/Icons/TemplateSmall.tsx
···
+
import { Props } from "./Props";
+
+
export const TemplateSmall = (props: Props & { fill?: string }) => {
+
return (
+
<svg
+
width="24"
+
height="24"
+
viewBox="0 0 24 24"
+
fill="none"
+
xmlns="http://www.w3.org/2000/svg"
+
{...props}
+
>
+
<path
+
d="M14.1876 3.5073C14.3657 2.68428 14.8409 1.80449 15.1974 1.39941L15.2085 1.38682C15.5258 1.02605 16.1664 0.297788 17.7348 0.0551971C19.7272 -0.252968 22.338 1.22339 23.1781 3.53026C23.9464 5.63998 22.4863 7.65134 21.1778 8.49107C20.443 8.96256 19.8776 9.29865 19.5389 9.6655C19.6381 9.88024 19.8755 10.4623 19.9945 10.8588C20.1304 11.312 20.1356 11.8263 20.2444 12.3342C20.6412 13.1008 21.4615 14.6122 21.6483 14.9894C21.9441 15.5868 22.0637 16.0554 21.901 16.59C21.7793 16.99 21.3809 18.0037 21.2098 18.4064C21.1134 18.6333 20.6741 19.1794 20.165 19.3516C19.5207 19.5694 19.2 19.533 18.2867 19.1682C17.9231 19.3768 17.3068 19.3194 17.0874 19.2128C16.9902 19.5392 16.6234 19.8695 16.4353 20.0055C16.5008 20.1749 16.6684 20.619 16.5759 21.4191C16.4257 22.7176 14.6119 24.4819 12.2763 23.8544C10.5744 23.3971 10.2099 22.1002 10.0744 21.5462C8.16651 22.8209 5.74592 21.9772 4.43632 21.1133C3.44653 20.4603 3.16063 19.4467 3.2199 18.7888C2.57837 19.147 1.33433 19.2159 0.756062 17.9729C0.320217 17.036 0.838862 15.6535 2.49397 14.7706C3.56898 14.1971 5.01017 14.061 6.14456 14.136C5.47545 12.9417 4.17774 10.4051 3.97777 9.74456C3.72779 8.91889 3.94746 8.3129 4.30348 7.88113C4.6595 7.44936 5.21244 6.90396 5.75026 6.38129C6.28808 5.85862 7.06074 5.85862 7.7349 6.07072C8.27424 6.2404 9.36352 6.65146 9.84074 6.83578C10.5069 6.63086 11.9689 6.18102 12.4877 6.02101C13.0065 5.861 13.184 5.78543 13.7188 5.90996C13.8302 5.37643 14.0045 4.35336 14.1876 3.5073Z"
+
fill={props.fill || "transparent"}
+
/>
+
<path
+
fillRule="evenodd"
+
clipRule="evenodd"
+
d="M19.6271 2.81856C18.4896 2.07854 17.4326 2.39759 17.0578 2.82147C16.5869 3.3541 16.4234 4.10723 16.2512 5.11887L16.2231 5.28522L16.2231 5.28523C16.0919 6.06363 15.9405 6.96241 15.5423 7.80533L17.4557 8.48962C18.0778 7.71969 18.7304 7.28473 19.2974 6.92363L19.3687 6.87829C20.0258 6.46022 20.473 6.17579 20.7913 5.5972C21.0667 5.09643 21.0978 4.64884 20.9415 4.23092C20.7767 3.79045 20.3738 3.3044 19.6271 2.81856ZM15.0777 5.02873C14.9299 5.89897 14.7941 6.69891 14.4321 7.4083L13.4555 7.05901C13.2858 6.99834 13.1067 7.02061 12.9624 7.10485L9.80359 8.05107L7.26833 7.14438C6.97342 7.03892 6.64447 7.11834 6.43018 7.3457L5.27176 8.53601C5.26453 8.54323 5.25745 8.55058 5.2505 8.55806L5.2454 8.56361C5.04511 8.78343 4.9652 9.11292 5.1156 9.43079L5.85241 10.9196L5.8643 10.9002C5.84832 10.9944 5.86158 11.0964 5.91361 11.1952L7.63738 14.4667C7.6921 14.5705 7.78376 14.6501 7.89428 14.6896L17.4633 18.1118C17.8658 18.2557 18.2352 17.83 18.0359 17.4518L16.3121 14.1803C16.2574 14.0764 16.1657 13.9969 16.0552 13.9574L6.48624 10.5352C6.32266 10.4767 6.16454 10.5123 6.04784 10.6006L6.56002 9.76447L16.8798 13.4551L18.7426 16.9905L18.0747 17.8398L19.1912 18.2615C19.6606 18.4294 20.1033 18.1358 20.2179 17.728L20.7391 16.3648C20.8239 16.1511 20.8112 15.9108 20.7039 15.7071L19.124 12.7086L18.8949 11.321C18.8935 11.3129 18.892 11.3049 18.8904 11.2969C18.8874 11.234 18.8741 11.1705 18.8496 11.1087L18.1936 9.45372C18.7455 8.68856 19.3357 8.28878 19.927 7.9122C19.9681 7.88603 20.0096 7.85977 20.0514 7.83331C20.6663 7.44436 21.3511 7.01112 21.8182 6.16211C22.2345 5.40522 22.3314 4.60167 22.0392 3.82037C21.7555 3.06161 21.1334 2.40034 20.2662 1.83615C18.7307 0.837123 17.0056 1.11114 16.1798 2.04515C15.4528 2.86736 15.2586 3.96572 15.0958 4.92219L15.0777 5.02872L15.0777 5.02873ZM13.2681 8.23675L11.6653 8.71688L16.3567 10.3947L16.6254 9.4374L13.2681 8.23675ZM16.5481 11.7078L16.5582 11.7114L17.1419 11.9202L17.0098 12.2569L6.82932 8.61605L7.1065 8.33124L9.5842 9.21734L9.59688 9.22187L16.5481 11.7078ZM12.5683 20.4811C12.3863 20.7644 12.3505 20.965 12.3648 21.0689C12.4003 21.3259 12.5444 21.4722 12.7748 21.5613C13.0331 21.6611 13.3469 21.659 13.544 21.6032C14.1553 21.4302 14.2952 21.0637 14.2611 20.8923C14.2391 20.7814 14.1421 20.578 13.7906 20.338C13.6004 20.2082 13.3469 20.076 13.0173 19.9508C12.834 20.1242 12.681 20.3057 12.5683 20.4811ZM11.7567 19.6004C11.6942 19.6815 11.6359 19.764 11.5822 19.8476C11.3276 20.2439 11.1351 20.7322 11.2038 21.2293C11.3096 21.9955 11.8139 22.4463 12.3521 22.6544C12.8626 22.8518 13.4377 22.8513 13.863 22.731C14.7279 22.4863 15.6213 21.724 15.4107 20.664C15.3104 20.1591 14.9656 19.7211 14.4515 19.3701C14.3677 19.3128 14.2783 19.2571 14.1833 19.203C14.5987 19.0436 14.9889 19.0051 15.2827 19.1025C15.59 19.2042 15.9215 19.0377 16.0233 18.7304C16.125 18.4232 15.9585 18.0916 15.6513 17.9899C14.6724 17.6656 13.5751 18.0821 12.7766 18.6397C12.6141 18.5938 12.4436 18.5504 12.265 18.5097C11.5393 18.3444 10.9698 18.307 10.5034 18.3825C10.018 18.4612 9.67582 18.657 9.40873 18.8961C9.28258 19.009 9.17849 19.1268 9.09292 19.2277C9.06338 19.2625 9.03727 19.2937 9.01306 19.3227L9.01291 19.3228C8.96046 19.3856 8.91693 19.4377 8.86682 19.4922C8.73913 19.6313 8.63181 19.7134 8.47722 19.761C8.03942 19.896 7.30137 19.8237 6.60705 19.5851C6.27195 19.4699 5.98787 19.3293 5.79222 19.1916C5.64379 19.0871 5.59428 19.019 5.58047 19L5.58045 19C5.57827 18.997 5.57698 18.9952 5.57634 18.9947C5.57144 18.9579 5.57397 18.938 5.57539 18.9305C5.57674 18.9233 5.57829 18.9201 5.58128 18.9156C5.59031 18.9023 5.63142 18.8546 5.76375 18.7965C6.04383 18.6735 6.48291 18.6061 7.03421 18.5487C7.12534 18.5392 7.22003 18.5299 7.31675 18.5205L7.31734 18.5205L7.31774 18.5204C7.75337 18.478 8.22986 18.4315 8.60602 18.3399C8.83695 18.2837 9.10046 18.1956 9.31444 18.0333C9.55604 17.8501 9.73703 17.5659 9.72457 17.1949C9.71117 16.7955 9.50249 16.4807 9.2559 16.2553C9.01235 16.0327 8.69774 15.863 8.36729 15.7333C7.70363 15.4729 6.85166 15.3254 6.00343 15.2972C5.15473 15.2689 4.25916 15.3581 3.51015 15.6085C2.78202 15.852 2.05623 16.2973 1.79807 17.0767C1.6963 17.3839 1.86287 17.7155 2.1701 17.8173C2.47733 17.919 2.80889 17.7525 2.91065 17.4452C2.99481 17.1912 3.28176 16.9207 3.8818 16.7201C4.46096 16.5264 5.209 16.4433 5.96437 16.4685C6.7202 16.4937 7.43275 16.6256 7.93908 16.8243C8.19363 16.9243 8.36538 17.0292 8.46519 17.1204C8.4773 17.1315 8.4878 17.1419 8.49689 17.1515C8.45501 17.1668 8.39992 17.1838 8.3287 17.2012C8.04154 17.2711 7.67478 17.3072 7.24492 17.3496L7.24413 17.3497L7.24246 17.3498C7.13635 17.3603 7.02639 17.3711 6.91284 17.3829C6.38763 17.4376 5.76632 17.5153 5.29238 17.7234C5.0477 17.8309 4.78839 17.9954 4.60986 18.2599C4.42009 18.541 4.36482 18.8707 4.42432 19.213C4.49899 19.6426 4.83826 19.9534 5.11763 20.15C5.42736 20.368 5.81812 20.5533 6.22607 20.6935C7.01783 20.9656 8.03865 21.1226 8.82239 20.8811C9.248 20.7499 9.52379 20.5096 9.73004 20.285C9.79974 20.2091 9.87042 20.1246 9.92975 20.0536L9.92977 20.0536L9.92995 20.0534C9.9503 20.0291 9.96932 20.0063 9.98649 19.9861C10.0618 19.8973 10.1248 19.8281 10.1905 19.7694C10.3069 19.6651 10.4472 19.579 10.6908 19.5395C10.9181 19.5027 11.2529 19.5041 11.7567 19.6004Z"
+
fill="currentColor"
+
/>
+
</svg>
+
);
+
};
-19
components/Icons/UnpublishSmall.tsx
···
-
import { Props } from "./Props";
-
-
export const UnpublishSmall = (props: Props) => {
-
return (
-
<svg
-
width="24"
-
height="24"
-
viewBox="0 0 24 24"
-
fill="none"
-
xmlns="http://www.w3.org/2000/svg"
-
{...props}
-
>
-
<path
-
d="M15.5207 11.5526C15.9624 11.2211 16.5896 11.3101 16.9211 11.7518L18.9162 14.411L21.5754 12.4158C22.017 12.0845 22.6433 12.1735 22.9748 12.6151C23.306 13.0568 23.2172 13.684 22.7756 14.0155L20.1164 16.0106L22.1115 18.6698C22.4425 19.1114 22.3537 19.7378 21.9123 20.0692C21.4707 20.4006 20.8434 20.3114 20.5119 19.87L18.5168 17.2108L15.8576 19.2059C15.416 19.537 14.7897 19.4479 14.4582 19.0067C14.1267 18.565 14.2158 17.9378 14.6574 17.6063L17.3166 15.6112L15.3215 12.952C14.9902 12.5103 15.0792 11.8841 15.5207 11.5526ZM12.2062 4.29378C13.7932 3.59008 15.5128 3.49569 16.9767 4.29769C19.1391 5.48261 19.9471 8.15954 19.5314 10.8885C19.4793 11.2296 19.1606 11.4638 18.8195 11.4119C18.4786 11.3598 18.2444 11.042 18.2961 10.701C18.669 8.25384 17.8985 6.22855 16.3761 5.39436C15.5192 4.92484 14.4833 4.85746 13.4006 5.1805C13.3522 5.21491 13.3004 5.24633 13.2414 5.26644C13.0411 5.33451 12.8498 5.39707 12.6662 5.45686C12.6176 5.47894 12.5684 5.50065 12.5197 5.52425C11.1279 6.19898 9.77207 7.47892 8.81657 9.22249C7.86108 10.9662 7.51225 12.7985 7.69254 14.3348C7.87314 15.8723 8.57043 17.0593 9.65739 17.6551C10.3281 18.0226 11.1012 18.1431 11.9211 18.0272C12.2625 17.9791 12.5786 18.2161 12.6271 18.5575C12.6754 18.8992 12.4375 19.216 12.0959 19.2645C11.0448 19.4131 9.99397 19.2653 9.0568 18.7518C7.96346 18.1527 7.21589 17.1633 6.79801 15.9862C6.74111 15.914 6.69783 15.829 6.67692 15.7332C6.5875 15.3237 6.4571 14.8734 6.30387 14.4188C6.00205 14.7748 5.69607 15.0308 5.37419 15.1834C5.04355 15.3401 4.70719 15.3838 4.38102 15.327C4.06576 15.272 3.79527 15.129 3.57145 14.9696C2.96057 14.5342 2.36597 14.0627 1.89274 13.5487C1.4209 13.036 1.0333 12.4423 0.8986 11.7596C0.842171 11.4736 0.768809 11.1336 0.89274 10.5985C0.997303 10.1475 1.23987 9.57405 1.69059 8.73226L1.60758 8.66585C1.60246 8.66173 1.59696 8.65743 1.59196 8.65315C1.16612 8.2884 1.07023 7.69032 1.08708 7.21468C1.1054 6.69843 1.25893 6.12189 1.54411 5.6014C1.81576 5.10576 2.17253 4.65997 2.58903 4.35433C3.00424 4.04981 3.53772 3.84664 4.10661 3.97737C4.12165 3.98084 4.13775 3.98453 4.15251 3.98909L5.22575 4.3221C5.62556 4.21028 6.05447 4.1958 6.48747 4.32015L6.54801 4.34065L6.54997 4.34163C6.55156 4.34227 6.55431 4.34319 6.55778 4.34456C6.56529 4.34752 6.57742 4.35226 6.59294 4.35823C6.62402 4.3702 6.67024 4.3877 6.72868 4.40901C6.84618 4.45186 7.01173 4.50951 7.20133 4.56819C7.59399 4.6897 8.04168 4.79978 8.382 4.81624C9.99154 4.89405 10.8568 4.72942 12.2062 4.29378ZM12.5441 6.13655C13.7669 5.47408 15.1231 5.29219 16.256 5.91292C17.1747 6.41641 17.7296 7.33256 17.9572 8.39729C18.0148 8.66723 17.8433 8.93322 17.5734 8.99104C17.3035 9.04869 17.0375 8.8771 16.9797 8.60726C16.7956 7.74535 16.3745 7.11819 15.7756 6.78987C15.0408 6.38732 14.0621 6.45197 13.0216 7.01546C12.7704 7.15159 12.5186 7.31527 12.2716 7.50472C13.0464 8.19627 13.6187 8.92334 13.9347 9.64632C14.2881 10.4549 14.3328 11.2901 13.9328 12.0203C13.5333 12.7492 12.7922 13.1542 11.9211 13.2918C11.1394 13.4153 10.2177 13.3313 9.2277 13.0614C9.20118 13.3705 9.19947 13.6697 9.21989 13.9539C9.30483 15.1342 9.77626 15.9936 10.5109 16.3963C10.8983 16.6086 11.346 16.6898 11.8351 16.6405C12.1098 16.6128 12.3552 16.8131 12.383 17.0877C12.4107 17.3624 12.2103 17.6077 11.9357 17.6356C11.2725 17.7026 10.6177 17.5951 10.0304 17.2733C8.89778 16.6525 8.32161 15.4121 8.22184 14.0252C8.12182 12.6321 8.49018 11.0188 9.32243 9.49983C10.1548 7.98089 11.316 6.80199 12.5441 6.13655ZM2.67204 9.54866C2.32412 10.2204 2.17134 10.6184 2.11051 10.8807C2.04887 11.1469 2.07605 11.2695 2.12516 11.5184C2.19851 11.8898 2.4242 12.2809 2.81169 12.702C3.1981 13.1217 3.71082 13.5349 4.29606 13.952C4.42383 14.043 4.52152 14.0826 4.59489 14.0955C4.65746 14.1064 4.73234 14.1036 4.83805 14.0535C5.04286 13.9565 5.35376 13.6844 5.76383 13.035C5.42543 12.2826 5.08809 11.7185 4.84391 11.4735C4.57886 11.2075 4.20518 10.9304 3.87907 10.7108C3.71974 10.6035 3.57875 10.514 3.4777 10.452C3.42724 10.421 3.3866 10.3967 3.35954 10.3807C3.34614 10.3728 3.33581 10.366 3.32926 10.3621L3.32047 10.3582C3.29879 10.3457 3.278 10.3312 3.25797 10.3162C2.98299 10.1101 2.79521 9.83996 2.67204 9.54866ZM11.5216 8.17561C11.0336 8.67806 10.5807 9.28455 10.1994 9.9803C9.81804 10.6763 9.54956 11.3844 9.38883 12.0662C10.3261 12.3341 11.1364 12.4037 11.7648 12.3045C12.4323 12.1991 12.8487 11.9177 13.0558 11.5399C13.2683 11.1518 13.2832 10.6541 13.0177 10.0467C12.7657 9.47024 12.2702 8.82723 11.5216 8.17561ZM9.63883 6.07112C9.45477 6.07962 9.26355 6.08427 9.06266 6.08382C9.01613 6.11598 8.96536 6.1545 8.91032 6.20003C8.71163 6.36444 8.4977 6.58912 8.28434 6.84651C7.85781 7.36118 7.46925 7.96403 7.24626 8.37093C6.99703 8.82575 6.71681 9.39869 6.51969 9.97542C6.34987 10.4725 6.25688 10.9316 6.26969 11.3055C6.3691 11.4655 6.46736 11.6376 6.56266 11.8182C6.76355 10.7536 7.14751 9.66653 7.71989 8.6219C8.25537 7.64475 8.9105 6.78559 9.63883 6.07112ZM6.12516 5.51741C5.92665 5.46415 5.72213 5.47396 5.50895 5.54378C5.15736 5.78936 4.57147 6.28659 4.28727 6.81136C3.94853 7.43736 3.7629 8.31657 3.71598 8.67561C3.71568 8.67793 3.71436 8.68015 3.71403 8.68245C3.72929 8.72056 3.74152 8.76064 3.74919 8.80257C3.79805 9.07007 3.89591 9.222 3.99626 9.30354L3.99723 9.3055C4.02922 9.32447 4.07496 9.35213 4.13102 9.38655C4.24364 9.45571 4.40052 9.5546 4.57731 9.67366C4.82014 9.83722 5.11483 10.0498 5.39079 10.283C5.44136 10.068 5.50384 9.85578 5.5734 9.65218C5.79598 9.00089 6.10514 8.37255 6.3693 7.89046C6.61869 7.4354 7.0422 6.77704 7.51481 6.20686C7.57748 6.13127 7.64175 6.05648 7.70719 5.98323C7.39142 5.92263 7.08276 5.84103 6.83219 5.76351C6.61847 5.69737 6.43222 5.63106 6.29997 5.58284C6.23424 5.55887 6.1809 5.53953 6.14372 5.52522C6.13705 5.52265 6.1308 5.51963 6.12516 5.51741ZM3.81559 5.19319C3.71663 5.17448 3.55572 5.19609 3.32926 5.36214C3.09558 5.53353 2.84889 5.82236 2.64079 6.20198C2.4462 6.55708 2.34736 6.94361 2.3361 7.25862C2.3235 7.61435 2.42004 7.7163 2.40446 7.70296L2.81657 8.03304C2.92255 7.54286 3.11192 6.88062 3.40739 6.33479C3.61396 5.95324 3.91707 5.60514 4.21794 5.31722L3.81559 5.19319Z"
-
fill="currentColor"
-
/>
-
</svg>
-
);
-
};
+1 -18
components/IdentityProvider.tsx
···
import useSWR, { KeyedMutator, mutate } from "swr";
import { DashboardState } from "./PageLayouts/DashboardLayout";
import { supabaseBrowserClient } from "supabase/browserClient";
-
import { produce, Draft } from "immer";
export type InterfaceState = {
dashboards: { [id: string]: DashboardState | undefined };
};
-
export type Identity = Awaited<ReturnType<typeof getIdentityData>>;
+
type Identity = Awaited<ReturnType<typeof getIdentityData>>;
let IdentityContext = createContext({
identity: null as Identity,
mutate: (() => {}) as KeyedMutator<Identity>,
});
export const useIdentityData = () => useContext(IdentityContext);
-
-
export function mutateIdentityData(
-
mutate: KeyedMutator<Identity>,
-
recipe: (draft: Draft<NonNullable<Identity>>) => void,
-
) {
-
mutate(
-
(data) => {
-
if (!data) return data;
-
return produce(data, recipe);
-
},
-
{ revalidate: false },
-
);
-
}
export function IdentityContextProvider(props: {
children: React.ReactNode;
initialValue: Identity;
···
let { data: identity, mutate } = useSWR("identity", () => getIdentityData(), {
fallbackData: props.initialValue,
});
-
useEffect(() => {
-
mutate(props.initialValue);
-
}, [props.initialValue]);
useEffect(() => {
if (!identity?.atp_did) return;
let supabase = supabaseBrowserClient();
+2 -10
components/Input.tsx
···
JSX.IntrinsicElements["textarea"],
) => {
let { label, textarea, ...inputProps } = props;
-
let style = `
-
appearance-none resize-none w-full
-
bg-transparent
-
outline-hidden focus:outline-0
-
font-normal not-italic text-base text-primary disabled:text-tertiary
-
disabled:cursor-not-allowed
-
${props.className}`;
+
let style = `appearance-none w-full font-normal not-italic bg-transparent text-base text-primary focus:outline-0 ${props.className} outline-hidden resize-none`;
return (
-
<label
-
className={`input-with-border flex flex-col gap-px text-sm text-tertiary font-bold italic leading-tight py-1! px-[6px]! ${props.disabled && "bg-border-light! cursor-not-allowed! hover:border-border!"}`}
-
>
+
<label className=" input-with-border flex flex-col gap-px text-sm text-tertiary font-bold italic leading-tight py-1! px-[6px]!">
{props.label}
{textarea ? (
<textarea {...inputProps} className={style} />
+3 -2
components/Layout.tsx
···
-
"use client";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { theme } from "tailwind.config";
import { NestedCardThemeProvider } from "./ThemeManager/ThemeProvider";
···
import { useState } from "react";
export const Separator = (props: { classname?: string }) => {
-
return <div className={`h-full border-r border-border ${props.classname}`} />;
+
return (
+
<div className={`min-h-full border-r border-border ${props.classname}`} />
+
);
};
export const Menu = (props: {
+23 -27
components/PageLayouts/DashboardLayout.tsx
···
drafts: boolean;
published: boolean;
docs: boolean;
-
archived: boolean;
+
templates: boolean;
};
};
···
const defaultDashboardState: DashboardState = {
display: undefined,
sort: undefined,
-
filter: {
-
drafts: false,
-
published: false,
-
docs: false,
-
archived: false,
-
},
+
filter: { drafts: false, published: false, docs: false, templates: false },
};
export const useDashboardStore = create<DashboardStore>((set, get) => ({
···
hasBackgroundImage: boolean;
defaultDisplay: Exclude<DashboardState["display"], undefined>;
hasPubs: boolean;
-
hasArchived: boolean;
+
hasTemplates: boolean;
}) => {
let { display, sort } = useDashboardState();
display = display || props.defaultDisplay;
···
<DisplayToggle setState={setState} display={display} />
<Separator classname="h-4 min-h-4!" />
-
{props.hasPubs ? (
+
{props.hasPubs || props.hasTemplates ? (
<>
+
{props.hasPubs}
+
{props.hasTemplates}
<FilterOptions
hasPubs={props.hasPubs}
-
hasArchived={props.hasArchived}
+
hasTemplates={props.hasTemplates}
/>
<Separator classname="h-4 min-h-4!" />{" "}
</>
···
);
}
-
const FilterOptions = (props: {
-
hasPubs: boolean;
-
hasArchived: boolean;
-
}) => {
+
const FilterOptions = (props: { hasPubs: boolean; hasTemplates: boolean }) => {
let { filter } = useDashboardState();
let setState = useSetDashboardState();
let filterCount = Object.values(filter).filter(Boolean).length;
···
</>
)}
-
{props.hasArchived && (
-
<Checkbox
-
small
-
checked={filter.archived}
-
onChange={(e) =>
-
setState({
-
filter: { ...filter, archived: !!e.target.checked },
-
})
-
}
-
>
-
Archived
-
</Checkbox>
+
{props.hasTemplates && (
+
<>
+
<Checkbox
+
small
+
checked={filter.templates}
+
onChange={(e) =>
+
setState({
+
filter: { ...filter, templates: !!e.target.checked },
+
})
+
}
+
>
+
Templates
+
</Checkbox>
+
</>
)}
<Checkbox
small
···
docs: false,
published: false,
drafts: false,
-
archived: false,
+
templates: false,
},
});
}}
+6 -52
components/PageSWRDataProvider.tsx
···
import { getPollData } from "actions/pollActions";
import type { GetLeafletDataReturnType } from "app/api/rpc/[command]/get_leaflet_data";
import { createContext, useContext } from "react";
-
import { getPublicationMetadataFromLeafletData } from "src/utils/getPublicationMetadataFromLeafletData";
-
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
-
import { AtUri } from "@atproto/syntax";
export const StaticLeafletDataContext = createContext<
null | GetLeafletDataReturnType["result"]["data"]
···
};
export function useLeafletPublicationData() {
let { data, mutate } = useLeafletData();
-
-
// First check for leaflets in publications
-
let pubData = getPublicationMetadataFromLeafletData(data);
-
return {
-
data: pubData || null,
+
data:
+
data?.leaflets_in_publications?.[0] ||
+
data?.permission_token_rights[0].entity_sets?.permission_tokens?.find(
+
(p) => p.leaflets_in_publications.length,
+
)?.leaflets_in_publications?.[0] ||
+
null,
mutate,
};
}
···
let { data, mutate } = useLeafletData();
return { data: data?.custom_domain_routes, mutate: mutate };
}
-
-
export function useLeafletPublicationStatus() {
-
const data = useContext(StaticLeafletDataContext);
-
if (!data) return null;
-
-
const publishedInPublication = data.leaflets_in_publications?.find(
-
(l) => l.doc,
-
);
-
const publishedStandalone = data.leaflets_to_documents?.find(
-
(l) => !!l.documents,
-
);
-
-
const documentUri =
-
publishedInPublication?.documents?.uri ?? publishedStandalone?.document;
-
-
// Compute the full post URL for sharing
-
let postShareLink: string | undefined;
-
if (publishedInPublication?.publications && publishedInPublication.documents) {
-
// Published in a publication - use publication URL + document rkey
-
const docUri = new AtUri(publishedInPublication.documents.uri);
-
postShareLink = `${getPublicationURL(publishedInPublication.publications)}/${docUri.rkey}`;
-
} else if (publishedStandalone?.document) {
-
// Standalone published post - use /p/{did}/{rkey} format
-
const docUri = new AtUri(publishedStandalone.document);
-
postShareLink = `/p/${docUri.host}/${docUri.rkey}`;
-
}
-
-
return {
-
token: data,
-
leafletId: data.root_entity,
-
shareLink: data.id,
-
// Draft state - in a publication but not yet published
-
draftInPublication:
-
data.leaflets_in_publications?.[0]?.publication ?? undefined,
-
// Published state
-
isPublished: !!(publishedInPublication || publishedStandalone),
-
publishedAt:
-
publishedInPublication?.documents?.indexed_at ??
-
publishedStandalone?.documents?.indexed_at,
-
documentUri,
-
// Full URL for sharing published posts
-
postShareLink,
-
};
-
}
+1 -4
components/Pages/Page.tsx
···
import { PageOptions } from "./PageOptions";
import { CardThemeProvider } from "components/ThemeManager/ThemeProvider";
import { useDrawerOpen } from "app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer";
-
import { usePreserveScroll } from "src/hooks/usePreserveScroll";
export function Page(props: {
entityID: string;
···
/>
}
>
-
{props.first && pageType === "doc" && (
+
{props.first && (
<>
<PublicationMetadata />
</>
···
pageType: "canvas" | "doc";
drawerOpen: boolean | undefined;
}) => {
-
let { ref } = usePreserveScroll<HTMLDivElement>(props.id);
return (
// this div wraps the contents AND the page options.
// it needs to be its own div because this container does NOT scroll, and therefore doesn't clip the absolutely positioned pageOptions
···
it needs to be a separate div so that the user can scroll from anywhere on the page if there isn't a card border
*/}
<div
-
ref={ref}
onClick={props.onClickAction}
id={props.id}
className={`
+6 -7
components/Pages/PageShareMenu.tsx
···
import { useLeafletDomains } from "components/PageSWRDataProvider";
-
import {
-
ShareButton,
-
useReadOnlyShareLink,
-
} from "app/[leaflet_id]/actions/ShareOptions";
+
import { ShareButton, usePublishLink } from "components/ShareOptions";
import { useEffect, useState } from "react";
export const PageShareMenu = (props: { entityID: string }) => {
-
let publishLink = useReadOnlyShareLink();
+
let publishLink = usePublishLink();
let { data: domains } = useLeafletDomains();
let [collabLink, setCollabLink] = useState<null | string>(null);
useEffect(() => {
···
<div>
<ShareButton
text="Share Edit Link"
-
subtext="Recipients can edit the full Leaflet"
+
subtext=""
+
helptext="recipients can edit the full Leaflet"
smokerText="Collab link copied!"
id="get-page-collab-link"
link={`${collabLink}?page=${props.entityID}`}
/>
<ShareButton
text="Share View Link"
-
subtext="Recipients can view the full Leaflet"
+
subtext=""
+
helptext="recipients can view the full Leaflet"
smokerText="Publish link copied!"
id="get-page-publish-link"
fullLink={
+13 -19
components/Pages/PublicationMetadata.tsx
···
let record = pub?.documents?.data as PubLeafletDocument.Record | null;
let publishedAt = record?.publishedAt;
-
if (!pub) return null;
+
if (!pub || !pub.publications) return null;
if (typeof title !== "string") {
title = pub?.title || "";
···
return (
<div className={`flex flex-col px-3 sm:px-4 pb-5 sm:pt-3 pt-2`}>
<div className="flex gap-2">
-
{pub.publications && (
-
<Link
-
href={
-
identity?.atp_did === pub.publications?.identity_did
-
? `${getBasePublicationURL(pub.publications)}/dashboard`
-
: getPublicationURL(pub.publications)
-
}
-
className="leafletMetadata text-accent-contrast font-bold hover:no-underline"
-
>
-
{pub.publications?.name}
-
</Link>
-
)}
+
<Link
+
href={
+
identity?.atp_did === pub.publications?.identity_did
+
? `${getBasePublicationURL(pub.publications)}/dashboard`
+
: getPublicationURL(pub.publications)
+
}
+
className="leafletMetadata text-accent-contrast font-bold hover:no-underline"
+
>
+
{pub.publications?.name}
+
</Link>
<div className="font-bold text-tertiary px-1 text-sm flex place-items-center bg-border-light rounded-md ">
Editor
</div>
···
<Link
target="_blank"
className="text-sm"
-
href={
-
pub.publications
-
? `${getPublicationURL(pub.publications)}/${new AtUri(pub.doc).rkey}`
-
: `/p/${new AtUri(pub.doc).host}/${new AtUri(pub.doc).rkey}`
-
}
+
href={`${getPublicationURL(pub.publications)}/${new AtUri(pub.doc).rkey}`}
>
View Post
</Link>
···
let record = pub?.documents?.data as PubLeafletDocument.Record | null;
let publishedAt = record?.publishedAt;
-
if (!pub) return null;
+
if (!pub || !pub.publications) return null;
return (
<div className={`flex flex-col px-3 sm:px-4 pb-5 sm:pt-3 pt-2`}>
+394
components/ShareOptions/DomainOptions.tsx
···
+
import { useState } from "react";
+
import { ButtonPrimary } from "components/Buttons";
+
+
import { useSmoker, useToaster } from "components/Toast";
+
import { Input, InputWithLabel } from "components/Input";
+
import useSWR from "swr";
+
import { useIdentityData } from "components/IdentityProvider";
+
import { addDomain } from "actions/domains/addDomain";
+
import { callRPC } from "app/api/rpc/client";
+
import { useLeafletDomains } from "components/PageSWRDataProvider";
+
import { usePublishLink } from ".";
+
import { addDomainPath } from "actions/domains/addDomainPath";
+
import { useReplicache } from "src/replicache";
+
import { deleteDomain } from "actions/domains/deleteDomain";
+
import { AddTiny } from "components/Icons/AddTiny";
+
+
type DomainMenuState =
+
| {
+
state: "default";
+
}
+
| {
+
state: "domain-settings";
+
domain: string;
+
}
+
| {
+
state: "add-domain";
+
}
+
| {
+
state: "has-domain";
+
domain: string;
+
};
+
export function CustomDomainMenu(props: {
+
setShareMenuState: (s: "default") => void;
+
}) {
+
let { data: domains } = useLeafletDomains();
+
let [state, setState] = useState<DomainMenuState>(
+
domains?.[0]
+
? { state: "has-domain", domain: domains[0].domain }
+
: { state: "default" },
+
);
+
switch (state.state) {
+
case "has-domain":
+
case "default":
+
return (
+
<DomainOptions
+
setDomainMenuState={setState}
+
domainConnected={false}
+
setShareMenuState={props.setShareMenuState}
+
/>
+
);
+
case "domain-settings":
+
return (
+
<DomainSettings domain={state.domain} setDomainMenuState={setState} />
+
);
+
case "add-domain":
+
return <AddDomain setDomainMenuState={setState} />;
+
}
+
}
+
+
export const DomainOptions = (props: {
+
setShareMenuState: (s: "default") => void;
+
setDomainMenuState: (state: DomainMenuState) => void;
+
domainConnected: boolean;
+
}) => {
+
let { data: domains, mutate: mutateDomains } = useLeafletDomains();
+
let [selectedDomain, setSelectedDomain] = useState<string | undefined>(
+
domains?.[0]?.domain,
+
);
+
let [selectedRoute, setSelectedRoute] = useState(
+
domains?.[0]?.route.slice(1) || "",
+
);
+
let { identity } = useIdentityData();
+
let { permission_token } = useReplicache();
+
+
let toaster = useToaster();
+
let smoker = useSmoker();
+
let publishLink = usePublishLink();
+
+
return (
+
<div className="px-3 py-1 flex flex-col gap-3 max-w-full w-[600px]">
+
<h3 className="text-secondary">Choose a Domain</h3>
+
<div className="flex flex-col gap-1 text-secondary">
+
{identity?.custom_domains
+
.filter((d) => !d.publication_domains.length)
+
.map((domain) => {
+
return (
+
<DomainOption
+
selectedRoute={selectedRoute}
+
setSelectedRoute={setSelectedRoute}
+
key={domain.domain}
+
domain={domain.domain}
+
checked={selectedDomain === domain.domain}
+
setChecked={setSelectedDomain}
+
setDomainMenuState={props.setDomainMenuState}
+
/>
+
);
+
})}
+
<button
+
onMouseDown={() => {
+
props.setDomainMenuState({ state: "add-domain" });
+
}}
+
className="text-accent-contrast flex gap-2 items-center px-1 py-0.5"
+
>
+
<AddTiny /> Add a New Domain
+
</button>
+
</div>
+
+
{/* ONLY SHOW IF A DOMAIN IS CURRENTLY CONNECTED */}
+
<div className="flex gap-3 items-center justify-end">
+
{props.domainConnected && (
+
<button
+
onMouseDown={() => {
+
props.setShareMenuState("default");
+
toaster({
+
content: (
+
<div className="font-bold">
+
Unpublished from custom domain!
+
</div>
+
),
+
type: "error",
+
});
+
}}
+
>
+
Unpublish
+
</button>
+
)}
+
+
<ButtonPrimary
+
id="publish-to-domain"
+
disabled={
+
domains?.[0]
+
? domains[0].domain === selectedDomain &&
+
domains[0].route.slice(1) === selectedRoute
+
: !selectedDomain
+
}
+
onClick={async () => {
+
// let rect = document
+
// .getElementById("publish-to-domain")
+
// ?.getBoundingClientRect();
+
// smoker({
+
// error: true,
+
// text: "url already in use!",
+
// position: {
+
// x: rect ? rect.left : 0,
+
// y: rect ? rect.top + 26 : 0,
+
// },
+
// });
+
if (!selectedDomain || !publishLink) return;
+
await addDomainPath({
+
domain: selectedDomain,
+
route: "/" + selectedRoute,
+
view_permission_token: publishLink,
+
edit_permission_token: permission_token.id,
+
});
+
+
toaster({
+
content: (
+
<div className="font-bold">
+
Published to custom domain!{" "}
+
<a
+
className="underline text-accent-2"
+
href={`https://${selectedDomain}/${selectedRoute}`}
+
target="_blank"
+
>
+
View
+
</a>
+
</div>
+
),
+
type: "success",
+
});
+
mutateDomains();
+
props.setShareMenuState("default");
+
}}
+
>
+
Publish!
+
</ButtonPrimary>
+
</div>
+
</div>
+
);
+
};
+
+
const DomainOption = (props: {
+
selectedRoute: string;
+
setSelectedRoute: (s: string) => void;
+
checked: boolean;
+
setChecked: (checked: string) => void;
+
domain: string;
+
setDomainMenuState: (state: DomainMenuState) => void;
+
}) => {
+
let [value, setValue] = useState("");
+
let { data } = useSWR(props.domain, async (domain) => {
+
return await callRPC("get_domain_status", { domain });
+
});
+
let pending = data?.config?.misconfigured || data?.error;
+
return (
+
<label htmlFor={props.domain}>
+
<input
+
type="radio"
+
name={props.domain}
+
id={props.domain}
+
value={props.domain}
+
checked={props.checked}
+
className="hidden appearance-none"
+
onChange={() => {
+
if (pending) return;
+
props.setChecked(props.domain);
+
}}
+
/>
+
<div
+
className={`
+
px-[6px] py-1
+
flex
+
border rounded-md
+
${
+
pending
+
? "border-border-light text-secondary justify-between gap-2 items-center "
+
: !props.checked
+
? "flex-wrap border-border-light"
+
: "flex-wrap border-accent-1 bg-accent-1 text-accent-2 font-bold"
+
} `}
+
>
+
<div className={`w-max truncate ${pending && "animate-pulse"}`}>
+
{props.domain}
+
</div>
+
{props.checked && (
+
<div className="flex gap-0 w-full">
+
<span
+
className="font-normal"
+
style={value === "" ? { opacity: "0.5" } : {}}
+
>
+
/
+
</span>
+
+
<Input
+
type="text"
+
autoFocus
+
className="appearance-none focus:outline-hidden font-normal text-accent-2 w-full bg-transparent placeholder:text-accent-2 placeholder:opacity-50"
+
placeholder="add-optional-path"
+
onChange={(e) => props.setSelectedRoute(e.target.value)}
+
value={props.selectedRoute}
+
/>
+
</div>
+
)}
+
{pending && (
+
<button
+
className="text-accent-contrast text-sm"
+
onMouseDown={() => {
+
props.setDomainMenuState({
+
state: "domain-settings",
+
domain: props.domain,
+
});
+
}}
+
>
+
pending
+
</button>
+
)}
+
</div>
+
</label>
+
);
+
};
+
+
export const AddDomain = (props: {
+
setDomainMenuState: (state: DomainMenuState) => void;
+
}) => {
+
let [value, setValue] = useState("");
+
let { mutate } = useIdentityData();
+
let smoker = useSmoker();
+
return (
+
<div className="flex flex-col gap-1 px-3 py-1 max-w-full w-[600px]">
+
<div>
+
<h3 className="text-secondary">Add a New Domain</h3>
+
<div className="text-xs italic text-secondary">
+
Don't include the protocol or path, just the base domain name for now
+
</div>
+
</div>
+
+
<Input
+
className="input-with-border text-primary"
+
placeholder="www.example.com"
+
value={value}
+
onChange={(e) => setValue(e.target.value)}
+
/>
+
+
<ButtonPrimary
+
disabled={!value}
+
className="place-self-end mt-2"
+
onMouseDown={async (e) => {
+
// call the vercel api, set the thing...
+
let { error } = await addDomain(value);
+
if (error) {
+
smoker({
+
error: true,
+
text:
+
error === "invalid_domain"
+
? "Invalid domain! Use just the base domain"
+
: error === "domain_already_in_use"
+
? "That domain is already in use!"
+
: "An unknown error occured",
+
position: {
+
y: e.clientY,
+
x: e.clientX - 5,
+
},
+
});
+
return;
+
}
+
mutate();
+
props.setDomainMenuState({ state: "domain-settings", domain: value });
+
}}
+
>
+
Verify Domain
+
</ButtonPrimary>
+
</div>
+
);
+
};
+
+
const DomainSettings = (props: {
+
domain: string;
+
setDomainMenuState: (s: DomainMenuState) => void;
+
}) => {
+
let isSubdomain = props.domain.split(".").length > 2;
+
return (
+
<div className="flex flex-col gap-1 px-3 py-1 max-w-full w-[600px]">
+
<h3 className="text-secondary">Verify Domain</h3>
+
+
<div className="text-secondary text-sm flex flex-col gap-3">
+
<div className="flex flex-col gap-[6px]">
+
<div>
+
To verify this domain, add the following record to your DNS provider
+
for <strong>{props.domain}</strong>.
+
</div>
+
+
{isSubdomain ? (
+
<div className="flex gap-3 p-1 border border-border-light rounded-md py-1">
+
<div className="flex flex-col ">
+
<div className="text-tertiary">Type</div>
+
<div>CNAME</div>
+
</div>
+
<div className="flex flex-col">
+
<div className="text-tertiary">Name</div>
+
<div style={{ wordBreak: "break-word" }}>
+
{props.domain.split(".").slice(0, -2).join(".")}
+
</div>
+
</div>
+
<div className="flex flex-col">
+
<div className="text-tertiary">Value</div>
+
<div style={{ wordBreak: "break-word" }}>
+
cname.vercel-dns.com
+
</div>
+
</div>
+
</div>
+
) : (
+
<div className="flex gap-3 p-1 border border-border-light rounded-md py-1">
+
<div className="flex flex-col ">
+
<div className="text-tertiary">Type</div>
+
<div>A</div>
+
</div>
+
<div className="flex flex-col">
+
<div className="text-tertiary">Name</div>
+
<div>@</div>
+
</div>
+
<div className="flex flex-col">
+
<div className="text-tertiary">Value</div>
+
<div>76.76.21.21</div>
+
</div>
+
</div>
+
)}
+
</div>
+
<div>
+
Once you do this, the status may be pending for up to a few hours.
+
</div>
+
<div>Check back later to see if verification was successful.</div>
+
</div>
+
+
<div className="flex gap-3 justify-between items-center mt-2">
+
<button
+
className="text-accent-contrast font-bold "
+
onMouseDown={async () => {
+
await deleteDomain({ domain: props.domain });
+
props.setDomainMenuState({ state: "default" });
+
}}
+
>
+
Delete Domain
+
</button>
+
<ButtonPrimary
+
onMouseDown={() => {
+
props.setDomainMenuState({ state: "default" });
+
}}
+
>
+
Back to Domains
+
</ButtonPrimary>
+
</div>
+
</div>
+
);
+
};
+70
components/ShareOptions/getShareLink.ts
···
+
"use server";
+
+
import { eq, and } from "drizzle-orm";
+
import { drizzle } from "drizzle-orm/node-postgres";
+
import { permission_token_rights, permission_tokens } from "drizzle/schema";
+
import { pool } from "supabase/pool";
+
export async function getShareLink(
+
token: { id: string; entity_set: string },
+
rootEntity: string,
+
) {
+
const client = await pool.connect();
+
const db = drizzle(client);
+
let link = await db.transaction(async (tx) => {
+
// This will likely error out when if we have multiple permission
+
// token rights associated with a single token
+
let [tokenW] = await tx
+
.select()
+
.from(permission_tokens)
+
.leftJoin(
+
permission_token_rights,
+
eq(permission_token_rights.token, permission_tokens.id),
+
)
+
.where(eq(permission_tokens.id, token.id));
+
if (
+
!tokenW.permission_token_rights ||
+
tokenW.permission_token_rights.create_token !== true ||
+
tokenW.permission_tokens.root_entity !== rootEntity ||
+
tokenW.permission_token_rights.entity_set !== token.entity_set
+
) {
+
return null;
+
}
+
+
let [existingToken] = await tx
+
.select()
+
.from(permission_tokens)
+
.rightJoin(
+
permission_token_rights,
+
eq(permission_token_rights.token, permission_tokens.id),
+
)
+
.where(
+
and(
+
eq(permission_token_rights.read, true),
+
eq(permission_token_rights.write, false),
+
eq(permission_token_rights.create_token, false),
+
eq(permission_token_rights.change_entity_set, false),
+
eq(permission_token_rights.entity_set, token.entity_set),
+
eq(permission_tokens.root_entity, rootEntity),
+
),
+
);
+
if (existingToken) {
+
return existingToken.permission_tokens;
+
}
+
let [newToken] = await tx
+
.insert(permission_tokens)
+
.values({ root_entity: rootEntity })
+
.returning();
+
await tx.insert(permission_token_rights).values({
+
entity_set: token.entity_set,
+
token: newToken.id,
+
read: true,
+
write: false,
+
create_token: false,
+
change_entity_set: false,
+
});
+
return newToken;
+
});
+
+
client.release();
+
return link;
+
}
+284
components/ShareOptions/index.tsx
···
+
import { useReplicache } from "src/replicache";
+
import React, { useEffect, useState } from "react";
+
import { getShareLink } from "./getShareLink";
+
import { useEntitySetContext } from "components/EntitySetProvider";
+
import { useSmoker } from "components/Toast";
+
import { Menu, MenuItem } from "components/Layout";
+
import { ActionButton } from "components/ActionBar/ActionButton";
+
import useSWR from "swr";
+
import { useTemplateState } from "app/(home-pages)/home/Actions/CreateNewButton";
+
import LoginForm from "app/login/LoginForm";
+
import { CustomDomainMenu } from "./DomainOptions";
+
import { useIdentityData } from "components/IdentityProvider";
+
import {
+
useLeafletDomains,
+
useLeafletPublicationData,
+
} from "components/PageSWRDataProvider";
+
import { ShareSmall } from "components/Icons/ShareSmall";
+
import { PubLeafletDocument } from "lexicons/api";
+
import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
+
import { AtUri } from "@atproto/syntax";
+
import { useIsMobile } from "src/hooks/isMobile";
+
+
export type ShareMenuStates = "default" | "login" | "domain";
+
+
export let usePublishLink = () => {
+
let { permission_token, rootEntity } = useReplicache();
+
let entity_set = useEntitySetContext();
+
let { data: publishLink } = useSWR(
+
"publishLink-" + permission_token.id,
+
async () => {
+
if (
+
!permission_token.permission_token_rights.find(
+
(s) => s.entity_set === entity_set.set && s.create_token,
+
)
+
)
+
return;
+
let shareLink = await getShareLink(
+
{ id: permission_token.id, entity_set: entity_set.set },
+
rootEntity,
+
);
+
return shareLink?.id;
+
},
+
);
+
return publishLink;
+
};
+
+
export function ShareOptions() {
+
let [menuState, setMenuState] = useState<ShareMenuStates>("default");
+
let { data: pub } = useLeafletPublicationData();
+
let isMobile = useIsMobile();
+
+
return (
+
<Menu
+
asChild
+
side={isMobile ? "top" : "right"}
+
align={isMobile ? "center" : "start"}
+
className="max-w-xs"
+
onOpenChange={() => {
+
setMenuState("default");
+
}}
+
trigger={
+
<ActionButton
+
icon=<ShareSmall />
+
primary={!!!pub}
+
secondary={!!pub}
+
label={`Share ${pub ? "Draft" : ""}`}
+
/>
+
}
+
>
+
{menuState === "login" ? (
+
<div className="px-3 py-1">
+
<LoginForm text="Save your Leaflets and access them on multiple devices!" />
+
</div>
+
) : menuState === "domain" ? (
+
<CustomDomainMenu setShareMenuState={setMenuState} />
+
) : (
+
<ShareMenu
+
setMenuState={setMenuState}
+
domainConnected={false}
+
isPub={!!pub}
+
/>
+
)}
+
</Menu>
+
);
+
}
+
+
const ShareMenu = (props: {
+
setMenuState: (state: ShareMenuStates) => void;
+
domainConnected: boolean;
+
isPub?: boolean;
+
}) => {
+
let { permission_token } = useReplicache();
+
let { data: pub } = useLeafletPublicationData();
+
+
let record = pub?.documents?.data as PubLeafletDocument.Record | null;
+
+
let postLink =
+
pub?.publications && pub.documents
+
? `${getPublicationURL(pub.publications)}/${new AtUri(pub?.documents.uri).rkey}`
+
: null;
+
let publishLink = usePublishLink();
+
let [collabLink, setCollabLink] = useState<null | string>(null);
+
useEffect(() => {
+
// strip leading '/' character from pathname
+
setCollabLink(window.location.pathname.slice(1));
+
}, []);
+
let { data: domains } = useLeafletDomains();
+
+
let isTemplate = useTemplateState(
+
(s) => !!s.templates.find((t) => t.id === permission_token.id),
+
);
+
+
return (
+
<>
+
{isTemplate && (
+
<>
+
<ShareButton
+
text="Share Template"
+
subtext="Let others make new Leaflets as copies of this template"
+
smokerText="Template link copied!"
+
id="get-template-link"
+
link={`template/${publishLink}` || ""}
+
/>
+
<hr className="border-border my-1" />
+
</>
+
)}
+
+
<ShareButton
+
text={`Share ${postLink ? "Draft" : ""} Edit Link`}
+
subtext=""
+
smokerText="Edit link copied!"
+
id="get-edit-link"
+
link={collabLink}
+
/>
+
<ShareButton
+
text={`Share ${postLink ? "Draft" : ""} View Link`}
+
subtext=<>
+
{domains?.[0] ? (
+
<>
+
This Leaflet is published on{" "}
+
<span className="italic underline">
+
{domains[0].domain}
+
{domains[0].route}
+
</span>
+
</>
+
) : (
+
""
+
)}
+
</>
+
smokerText="View link copied!"
+
id="get-view-link"
+
fullLink={
+
domains?.[0]
+
? `https://${domains[0].domain}${domains[0].route}`
+
: undefined
+
}
+
link={publishLink || ""}
+
/>
+
{postLink && (
+
<>
+
<hr className="border-border-light" />
+
+
<ShareButton
+
text="Share Published Link"
+
subtext=""
+
smokerText="Post link copied!"
+
id="get-post-link"
+
fullLink={postLink.includes("http") ? postLink : undefined}
+
link={postLink}
+
/>
+
</>
+
)}
+
{!props.isPub && (
+
<>
+
<hr className="border-border mt-1" />
+
<DomainMenuItem setMenuState={props.setMenuState} />
+
</>
+
)}
+
</>
+
);
+
};
+
+
export const ShareButton = (props: {
+
text: React.ReactNode;
+
subtext: React.ReactNode;
+
helptext?: string;
+
smokerText: string;
+
id: string;
+
link: null | string;
+
fullLink?: string;
+
className?: string;
+
}) => {
+
let smoker = useSmoker();
+
+
return (
+
<MenuItem
+
id={props.id}
+
onSelect={(e) => {
+
e.preventDefault();
+
let rect = document.getElementById(props.id)?.getBoundingClientRect();
+
if (props.link || props.fullLink) {
+
navigator.clipboard.writeText(
+
props.fullLink
+
? props.fullLink
+
: `${location.protocol}//${location.host}/${props.link}`,
+
);
+
smoker({
+
position: {
+
x: rect ? rect.left + (rect.right - rect.left) / 2 : 0,
+
y: rect ? rect.top + 26 : 0,
+
},
+
text: props.smokerText,
+
});
+
}
+
}}
+
>
+
<div className={`group/${props.id} ${props.className}`}>
+
<div className={`group-hover/${props.id}:text-accent-contrast`}>
+
{props.text}
+
</div>
+
<div
+
className={`text-sm font-normal text-tertiary group-hover/${props.id}:text-accent-contrast`}
+
>
+
{props.subtext}
+
</div>
+
{/* optional help text */}
+
{props.helptext && (
+
<div
+
className={`text-sm italic font-normal text-tertiary group-hover/${props.id}:text-accent-contrast`}
+
>
+
{props.helptext}
+
</div>
+
)}
+
</div>
+
</MenuItem>
+
);
+
};
+
+
const DomainMenuItem = (props: {
+
setMenuState: (state: ShareMenuStates) => void;
+
}) => {
+
let { identity } = useIdentityData();
+
let { data: domains } = useLeafletDomains();
+
+
if (identity === null)
+
return (
+
<div className="text-tertiary font-normal text-sm px-3 py-1">
+
<button
+
className="text-accent-contrast hover:font-bold"
+
onClick={() => {
+
props.setMenuState("login");
+
}}
+
>
+
Log In
+
</button>{" "}
+
to publish on a custom domain!
+
</div>
+
);
+
else
+
return (
+
<>
+
{domains?.[0] ? (
+
<button
+
className="px-3 py-1 text-accent-contrast text-sm hover:font-bold w-fit text-left"
+
onMouseDown={() => {
+
props.setMenuState("domain");
+
}}
+
>
+
Edit custom domain
+
</button>
+
) : (
+
<MenuItem
+
className="font-normal text-tertiary text-sm"
+
onSelect={(e) => {
+
e.preventDefault();
+
props.setMenuState("domain");
+
}}
+
>
+
Publish on a custom domain
+
</MenuItem>
+
)}
+
</>
+
);
+
};
+43 -2
components/ThemeManager/PubThemeSetter.tsx
···
import { PubAccentPickers } from "./PubPickers/PubAcccentPickers";
import { Separator } from "components/Layout";
import { PubSettingsHeader } from "app/lish/[did]/[publication]/dashboard/PublicationSettings";
-
import { ColorToRGB, ColorToRGBA } from "./colorToLexicons";
export type ImageState = {
src: string;
···
theme: localPubTheme,
setTheme,
changes,
-
} = useLocalPubTheme(record?.theme, showPageBackground);
+
} = useLocalPubTheme(record, showPageBackground);
let [image, setImage] = useState<ImageState | null>(
PubLeafletThemeBackgroundImage.isMain(record?.theme?.backgroundImage)
? {
···
</div>
);
};
+
+
export function ColorToRGBA(color: Color) {
+
if (!color)
+
return {
+
$type: "pub.leaflet.theme.color#rgba" as const,
+
r: 0,
+
g: 0,
+
b: 0,
+
a: 1,
+
};
+
let c = color.toFormat("rgba");
+
const r = c.getChannelValue("red");
+
const g = c.getChannelValue("green");
+
const b = c.getChannelValue("blue");
+
const a = c.getChannelValue("alpha");
+
return {
+
$type: "pub.leaflet.theme.color#rgba" as const,
+
r: Math.round(r),
+
g: Math.round(g),
+
b: Math.round(b),
+
a: Math.round(a * 100),
+
};
+
}
+
function ColorToRGB(color: Color) {
+
if (!color)
+
return {
+
$type: "pub.leaflet.theme.color#rgb" as const,
+
r: 0,
+
g: 0,
+
b: 0,
+
};
+
let c = color.toFormat("rgb");
+
const r = c.getChannelValue("red");
+
const g = c.getChannelValue("green");
+
const b = c.getChannelValue("blue");
+
return {
+
$type: "pub.leaflet.theme.color#rgb" as const,
+
r: Math.round(r),
+
g: Math.round(g),
+
b: Math.round(b),
+
};
+
}
+25 -35
components/ThemeManager/PublicationThemeProvider.tsx
···
accentText: "#FFFFFF",
accentBackground: "#0000FF",
};
-
-
// Default page background for standalone leaflets (matches editor default)
-
const StandalonePageBackground = "#FFFFFF";
function parseThemeColor(
c: PubLeafletThemeColor.Rgb | PubLeafletThemeColor.Rgba,
) {
···
}
let useColor = (
-
theme: PubLeafletPublication.Record["theme"] | null | undefined,
+
record: PubLeafletPublication.Record | null | undefined,
c: keyof typeof PubThemeDefaults,
) => {
return useMemo(() => {
-
let v = theme?.[c];
+
let v = record?.theme?.[c];
if (isColor(v)) {
return parseThemeColor(v);
} else return parseColor(PubThemeDefaults[c]);
-
}, [theme?.[c]]);
+
}, [record?.theme?.[c]]);
};
let isColor = (
c: any,
···
return (
<PublicationThemeProvider
pub_creator={pub?.identity_did || ""}
-
theme={(pub?.record as PubLeafletPublication.Record)?.theme}
+
record={pub?.record as PubLeafletPublication.Record}
>
<PublicationBackgroundProvider
-
theme={(pub?.record as PubLeafletPublication.Record)?.theme}
+
record={pub?.record as PubLeafletPublication.Record}
pub_creator={pub?.identity_did || ""}
>
{props.children}
···
}
export function PublicationBackgroundProvider(props: {
-
theme?: PubLeafletPublication.Record["theme"] | null;
+
record?: PubLeafletPublication.Record | null;
pub_creator: string;
className?: string;
children: React.ReactNode;
}) {
-
let backgroundImage = props.theme?.backgroundImage?.image?.ref
-
? blobRefToSrc(props.theme?.backgroundImage?.image?.ref, props.pub_creator)
+
let backgroundImage = props.record?.theme?.backgroundImage?.image?.ref
+
? blobRefToSrc(
+
props.record?.theme?.backgroundImage?.image?.ref,
+
props.pub_creator,
+
)
: null;
-
let backgroundImageRepeat = props.theme?.backgroundImage?.repeat;
-
let backgroundImageSize = props.theme?.backgroundImage?.width || 500;
+
let backgroundImageRepeat = props.record?.theme?.backgroundImage?.repeat;
+
let backgroundImageSize = props.record?.theme?.backgroundImage?.width || 500;
return (
<div
className="PubBackgroundWrapper w-full bg-bg-leaflet text-primary h-full flex flex-col bg-cover bg-center bg-no-repeat items-stretch"
···
export function PublicationThemeProvider(props: {
local?: boolean;
children: React.ReactNode;
-
theme?: PubLeafletPublication.Record["theme"] | null;
+
record?: PubLeafletPublication.Record | null;
pub_creator: string;
-
isStandalone?: boolean;
}) {
-
let colors = usePubTheme(props.theme, props.isStandalone);
+
let colors = usePubTheme(props.record);
return (
<BaseThemeProvider local={props.local} {...colors}>
{props.children}
···
);
}
-
export const usePubTheme = (
-
theme?: PubLeafletPublication.Record["theme"] | null,
-
isStandalone?: boolean,
-
) => {
-
let bgLeaflet = useColor(theme, "backgroundColor");
-
let bgPage = useColor(theme, "pageBackground");
-
// For standalone documents, use the editor default page background (#FFFFFF)
-
// For publications without explicit pageBackground, use bgLeaflet
-
if (isStandalone && !theme?.pageBackground) {
-
bgPage = parseColor(StandalonePageBackground);
-
} else if (theme && !theme.pageBackground) {
-
bgPage = bgLeaflet;
-
}
-
let showPageBackground = theme?.showPageBackground;
+
export const usePubTheme = (record?: PubLeafletPublication.Record | null) => {
+
let bgLeaflet = useColor(record, "backgroundColor");
+
let bgPage = useColor(record, "pageBackground");
+
bgPage = record?.theme?.pageBackground ? bgPage : bgLeaflet;
+
let showPageBackground = record?.theme?.showPageBackground;
-
let primary = useColor(theme, "primary");
+
let primary = useColor(record, "primary");
-
let accent1 = useColor(theme, "accentBackground");
-
let accent2 = useColor(theme, "accentText");
+
let accent1 = useColor(record, "accentBackground");
+
let accent2 = useColor(record, "accentText");
let highlight1 = useEntity(null, "theme/highlight-1")?.data.value;
let highlight2 = useColorAttribute(null, "theme/highlight-2");
···
};
export const useLocalPubTheme = (
-
theme: PubLeafletPublication.Record["theme"] | undefined,
+
record: PubLeafletPublication.Record | undefined,
showPageBackground?: boolean,
) => {
-
const pubTheme = usePubTheme(theme);
+
const pubTheme = usePubTheme(record);
const [localOverrides, setTheme] = useState<Partial<typeof pubTheme>>({});
const mergedTheme = useMemo(() => {
+2 -4
components/ThemeManager/ThemeProvider.tsx
···
return (
<PublicationThemeProvider
{...props}
-
theme={(pub.publications?.record as PubLeafletPublication.Record)?.theme}
+
record={pub.publications?.record as PubLeafletPublication.Record}
pub_creator={pub.publications?.identity_did}
/>
);
···
return (
<PublicationBackgroundProvider
pub_creator={pub?.publications.identity_did || ""}
-
theme={
-
(pub.publications?.record as PubLeafletPublication.Record)?.theme
-
}
+
record={pub?.publications.record as PubLeafletPublication.Record}
>
{props.children}
</PublicationBackgroundProvider>
+2 -2
components/ThemeManager/ThemeSetter.tsx
···
}, [rep, props.entityID]);
if (!permission) return null;
-
if (pub?.publications) return null;
+
if (pub) return null;
return (
<>
···
}, [rep, props.entityID]);
if (!permission) return null;
-
if (pub?.publications) return null;
+
if (pub) return null;
return (
<div className="themeSetterContent flex flex-col w-full overflow-y-scroll no-scrollbar">
<div className="themeBGLeaflet flex">
-44
components/ThemeManager/colorToLexicons.ts
···
-
import { Color } from "react-aria-components";
-
-
export function ColorToRGBA(color: Color) {
-
if (!color)
-
return {
-
$type: "pub.leaflet.theme.color#rgba" as const,
-
r: 0,
-
g: 0,
-
b: 0,
-
a: 1,
-
};
-
let c = color.toFormat("rgba");
-
const r = c.getChannelValue("red");
-
const g = c.getChannelValue("green");
-
const b = c.getChannelValue("blue");
-
const a = c.getChannelValue("alpha");
-
return {
-
$type: "pub.leaflet.theme.color#rgba" as const,
-
r: Math.round(r),
-
g: Math.round(g),
-
b: Math.round(b),
-
a: Math.round(a * 100),
-
};
-
}
-
-
export function ColorToRGB(color: Color) {
-
if (!color)
-
return {
-
$type: "pub.leaflet.theme.color#rgb" as const,
-
r: 0,
-
g: 0,
-
b: 0,
-
};
-
let c = color.toFormat("rgb");
-
const r = c.getChannelValue("red");
-
const g = c.getChannelValue("green");
-
const b = c.getChannelValue("blue");
-
return {
-
$type: "pub.leaflet.theme.color#rgb" as const,
-
r: Math.round(r),
-
g: Math.round(g),
-
b: Math.round(b),
-
};
-
}
+1 -1
feeds/index.ts
···
.from("documents")
.select(
`*,
-
documents_in_publications(publications(*))`,
+
documents_in_publications!inner(publications!inner(*))`,
)
.or(
"record->preferences->showInDiscover.is.null,record->preferences->>showInDiscover.eq.true",
+1 -5
lexicons/api/lexicons.ts
···
description: 'Record containing a document',
record: {
type: 'object',
-
required: ['pages', 'author', 'title'],
+
required: ['pages', 'author', 'title', 'publication'],
properties: {
title: {
type: 'string',
···
author: {
type: 'string',
format: 'at-identifier',
-
},
-
theme: {
-
type: 'ref',
-
ref: 'lex:pub.leaflet.publication#theme',
},
pages: {
type: 'array',
+1 -3
lexicons/api/types/pub/leaflet/document.ts
···
import { validate as _validate } from '../../../lexicons'
import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util'
import type * as ComAtprotoRepoStrongRef from '../../com/atproto/repo/strongRef'
-
import type * as PubLeafletPublication from './publication'
import type * as PubLeafletPagesLinearDocument from './pages/linearDocument'
import type * as PubLeafletPagesCanvas from './pages/canvas'
···
postRef?: ComAtprotoRepoStrongRef.Main
description?: string
publishedAt?: string
-
publication?: string
+
publication: string
author: string
-
theme?: PubLeafletPublication.Theme
pages: (
| $Typed<PubLeafletPagesLinearDocument.Main>
| $Typed<PubLeafletPagesCanvas.Main>
+2 -5
lexicons/pub/leaflet/document.json
···
"required": [
"pages",
"author",
-
"title"
+
"title",
+
"publication"
],
"properties": {
"title": {
···
"author": {
"type": "string",
"format": "at-identifier"
-
},
-
"theme": {
-
"type": "ref",
-
"ref": "pub.leaflet.publication#theme"
},
"pages": {
"type": "array",
+1 -2
lexicons/src/document.ts
···
description: "Record containing a document",
record: {
type: "object",
-
required: ["pages", "author", "title"],
+
required: ["pages", "author", "title", "publication"],
properties: {
title: { type: "string", maxLength: 1280, maxGraphemes: 128 },
postRef: { type: "ref", ref: "com.atproto.repo.strongRef" },
···
publishedAt: { type: "string", format: "datetime" },
publication: { type: "string", format: "at-uri" },
author: { type: "string", format: "at-identifier" },
-
theme: { type: "ref", ref: "pub.leaflet.publication#theme" },
pages: {
type: "array",
items: {
+1 -1
next-env.d.ts
···
/// <reference types="next" />
/// <reference types="next/image-types/global" />
-
import "./.next/dev/types/routes.d.ts";
+
/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
+2 -2
next.config.js
···
},
];
},
-
serverExternalPackages: ["yjs", "pino"],
+
serverExternalPackages: ["yjs"],
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
images: {
loader: "custom",
···
{ protocol: "https", hostname: "bdefzwcumgzjwllsnaej.supabase.co" },
],
},
-
reactCompiler: true,
experimental: {
+
reactCompiler: true,
serverActions: {
bodySizeLimit: "5mb",
},
+465 -2330
package-lock.json
···
"@hono/node-server": "^1.14.3",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
-
"@next/bundle-analyzer": "16.0.3",
-
"@next/mdx": "16.0.3",
+
"@next/bundle-analyzer": "^15.3.2",
+
"@next/mdx": "15.3.2",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-popover": "^1.1.15",
···
"linkifyjs": "^4.2.0",
"luxon": "^3.7.2",
"multiformats": "^13.3.2",
-
"next": "16.0.3",
+
"next": "^15.5.3",
"pg": "^8.16.3",
"prosemirror-commands": "^1.5.2",
"prosemirror-inputrules": "^1.4.0",
···
"prosemirror-model": "^1.21.0",
"prosemirror-schema-basic": "^1.2.2",
"prosemirror-state": "^1.4.3",
-
"react": "19.2.0",
+
"react": "^19.1.1",
"react-aria-components": "^1.8.0",
"react-day-picker": "^9.3.0",
-
"react-dom": "19.2.0",
+
"react-dom": "^19.1.1",
"react-use-measure": "^2.1.1",
"redlock": "^5.0.0-beta.2",
"rehype-parse": "^9.0.0",
···
"@types/katex": "^0.16.7",
"@types/luxon": "^3.7.1",
"@types/node": "^22.15.17",
-
"@types/react": "19.2.6",
-
"@types/react-dom": "19.2.3",
+
"@types/react": "19.1.3",
+
"@types/react-dom": "19.1.3",
"@types/uuid": "^10.0.0",
"drizzle-kit": "^0.21.2",
"esbuild": "^0.25.4",
-
"eslint": "^9.39.1",
-
"eslint-config-next": "16.0.3",
+
"eslint": "8.57.0",
+
"eslint-config-next": "^15.5.3",
"postcss": "^8.4.38",
"prettier": "3.2.5",
"supabase": "^1.187.3",
···
"node": ">=18.7.0"
}
},
-
"node_modules/@babel/code-frame": {
-
"version": "7.27.1",
-
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
-
"integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
-
"dev": true,
-
"dependencies": {
-
"@babel/helper-validator-identifier": "^7.27.1",
-
"js-tokens": "^4.0.0",
-
"picocolors": "^1.1.1"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/compat-data": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz",
-
"integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==",
-
"dev": true,
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/core": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz",
-
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
-
"dev": true,
-
"dependencies": {
-
"@babel/code-frame": "^7.27.1",
-
"@babel/generator": "^7.28.5",
-
"@babel/helper-compilation-targets": "^7.27.2",
-
"@babel/helper-module-transforms": "^7.28.3",
-
"@babel/helpers": "^7.28.4",
-
"@babel/parser": "^7.28.5",
-
"@babel/template": "^7.27.2",
-
"@babel/traverse": "^7.28.5",
-
"@babel/types": "^7.28.5",
-
"@jridgewell/remapping": "^2.3.5",
-
"convert-source-map": "^2.0.0",
-
"debug": "^4.1.0",
-
"gensync": "^1.0.0-beta.2",
-
"json5": "^2.2.3",
-
"semver": "^6.3.1"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
},
-
"funding": {
-
"type": "opencollective",
-
"url": "https://opencollective.com/babel"
-
}
-
},
-
"node_modules/@babel/core/node_modules/json5": {
-
"version": "2.2.3",
-
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
-
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
-
"dev": true,
-
"bin": {
-
"json5": "lib/cli.js"
-
},
-
"engines": {
-
"node": ">=6"
-
}
-
},
-
"node_modules/@babel/core/node_modules/semver": {
-
"version": "6.3.1",
-
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
-
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
-
"dev": true,
-
"bin": {
-
"semver": "bin/semver.js"
-
}
-
},
-
"node_modules/@babel/generator": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz",
-
"integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==",
-
"dev": true,
-
"dependencies": {
-
"@babel/parser": "^7.28.5",
-
"@babel/types": "^7.28.5",
-
"@jridgewell/gen-mapping": "^0.3.12",
-
"@jridgewell/trace-mapping": "^0.3.28",
-
"jsesc": "^3.0.2"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helper-compilation-targets": {
-
"version": "7.27.2",
-
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz",
-
"integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
-
"dev": true,
-
"dependencies": {
-
"@babel/compat-data": "^7.27.2",
-
"@babel/helper-validator-option": "^7.27.1",
-
"browserslist": "^4.24.0",
-
"lru-cache": "^5.1.1",
-
"semver": "^6.3.1"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": {
-
"version": "5.1.1",
-
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-
"dev": true,
-
"dependencies": {
-
"yallist": "^3.0.2"
-
}
-
},
-
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
-
"version": "6.3.1",
-
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
-
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
-
"dev": true,
-
"bin": {
-
"semver": "bin/semver.js"
-
}
-
},
-
"node_modules/@babel/helper-compilation-targets/node_modules/yallist": {
-
"version": "3.1.1",
-
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-
"dev": true
-
},
-
"node_modules/@babel/helper-globals": {
-
"version": "7.28.0",
-
"resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
-
"integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
-
"dev": true,
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helper-module-imports": {
-
"version": "7.27.1",
-
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz",
-
"integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==",
-
"dev": true,
-
"dependencies": {
-
"@babel/traverse": "^7.27.1",
-
"@babel/types": "^7.27.1"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helper-module-transforms": {
-
"version": "7.28.3",
-
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz",
-
"integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==",
-
"dev": true,
-
"dependencies": {
-
"@babel/helper-module-imports": "^7.27.1",
-
"@babel/helper-validator-identifier": "^7.27.1",
-
"@babel/traverse": "^7.28.3"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
},
-
"peerDependencies": {
-
"@babel/core": "^7.0.0"
-
}
-
},
"node_modules/@babel/helper-string-parser": {
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
···
}
},
"node_modules/@babel/helper-validator-identifier": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
-
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helper-validator-option": {
"version": "7.27.1",
-
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
-
"integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
-
"dev": true,
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/helpers": {
-
"version": "7.28.4",
-
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz",
-
"integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==",
-
"dev": true,
-
"dependencies": {
-
"@babel/template": "^7.27.2",
-
"@babel/types": "^7.28.4"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/parser": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz",
-
"integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==",
-
"dev": true,
-
"dependencies": {
-
"@babel/types": "^7.28.5"
-
},
-
"bin": {
-
"parser": "bin/babel-parser.js"
-
},
-
"engines": {
-
"node": ">=6.0.0"
-
}
-
},
-
"node_modules/@babel/template": {
-
"version": "7.27.2",
-
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz",
-
"integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
-
"dev": true,
-
"dependencies": {
-
"@babel/code-frame": "^7.27.1",
-
"@babel/parser": "^7.27.2",
-
"@babel/types": "^7.27.1"
-
},
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
-
"node_modules/@babel/traverse": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz",
-
"integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==",
-
"dev": true,
-
"dependencies": {
-
"@babel/code-frame": "^7.27.1",
-
"@babel/generator": "^7.28.5",
-
"@babel/helper-globals": "^7.28.0",
-
"@babel/parser": "^7.28.5",
-
"@babel/template": "^7.27.2",
-
"@babel/types": "^7.28.5",
-
"debug": "^4.3.1"
-
},
+
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz",
+
"integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==",
+
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": {
-
"version": "7.28.5",
-
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz",
-
"integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==",
+
"version": "7.27.1",
+
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz",
+
"integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==",
+
"license": "MIT",
"dependencies": {
"@babel/helper-string-parser": "^7.27.1",
-
"@babel/helper-validator-identifier": "^7.28.5"
+
"@babel/helper-validator-identifier": "^7.27.1"
},
"engines": {
"node": ">=6.9.0"
···
"source-map-support": "^0.5.21"
}
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
-
"integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
-
"integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
-
"integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
-
"integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
-
"integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
-
"integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
-
"integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
-
"integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
-
"integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
-
"integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
-
"integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
-
"cpu": [
-
"loong64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
-
"integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
-
"cpu": [
-
"mips64el"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
-
"integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
-
"integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
-
"cpu": [
-
"riscv64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
-
"integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
-
"cpu": [
-
"s390x"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
···
"node": ">=12"
}
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
-
"integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"netbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
-
"integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"openbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
-
"integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"sunos"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
-
"integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
-
"integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": {
-
"version": "0.18.20",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
-
"integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
"node_modules/@esbuild-kit/core-utils/node_modules/esbuild": {
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
···
"esbuild": "*"
}
},
-
"node_modules/@esbuild/aix-ppc64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.4.tgz",
-
"integrity": "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"aix"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/android-arm": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.4.tgz",
-
"integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/android-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.4.tgz",
-
"integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/android-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.4.tgz",
-
"integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/darwin-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz",
-
"integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/freebsd-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.4.tgz",
-
"integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/freebsd-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.4.tgz",
-
"integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-arm": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.4.tgz",
-
"integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.4.tgz",
-
"integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-ia32": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.4.tgz",
-
"integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-loong64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.4.tgz",
-
"integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==",
-
"cpu": [
-
"loong64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-mips64el": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.4.tgz",
-
"integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==",
-
"cpu": [
-
"mips64el"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-ppc64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.4.tgz",
-
"integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-riscv64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.4.tgz",
-
"integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==",
-
"cpu": [
-
"riscv64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/linux-s390x": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.4.tgz",
-
"integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==",
-
"cpu": [
-
"s390x"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
"node_modules/@esbuild/linux-x64": {
"version": "0.25.4",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz",
···
"node": ">=18"
}
},
-
"node_modules/@esbuild/netbsd-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz",
-
"integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"netbsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/netbsd-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.4.tgz",
-
"integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"netbsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/openbsd-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz",
-
"integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"openbsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/openbsd-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.4.tgz",
-
"integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"openbsd"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/sunos-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.4.tgz",
-
"integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"sunos"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/win32-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.4.tgz",
-
"integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/win32-ia32": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.4.tgz",
-
"integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
-
"node_modules/@esbuild/win32-x64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz",
-
"integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
"node_modules/@eslint-community/eslint-utils": {
-
"version": "4.9.0",
-
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
-
"integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==",
+
"version": "4.7.0",
+
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
+
"integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"eslint-visitor-keys": "^3.4.3"
},
···
"eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
}
},
-
"node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
-
"version": "3.4.3",
-
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
-
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
-
"dev": true,
-
"engines": {
-
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-
},
-
"funding": {
-
"url": "https://opencollective.com/eslint"
-
}
-
},
"node_modules/@eslint-community/regexpp": {
-
"version": "4.12.2",
-
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
-
"integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
+
"version": "4.10.0",
+
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
+
"integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
"dev": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
-
"node_modules/@eslint/config-array": {
-
"version": "0.21.1",
-
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",
-
"integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",
-
"dev": true,
-
"dependencies": {
-
"@eslint/object-schema": "^2.1.7",
-
"debug": "^4.3.1",
-
"minimatch": "^3.1.2"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
}
-
},
-
"node_modules/@eslint/config-helpers": {
-
"version": "0.4.2",
-
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
-
"integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
-
"dev": true,
-
"dependencies": {
-
"@eslint/core": "^0.17.0"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
}
-
},
-
"node_modules/@eslint/core": {
-
"version": "0.17.0",
-
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
-
"integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
-
"dev": true,
-
"dependencies": {
-
"@types/json-schema": "^7.0.15"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
}
-
},
"node_modules/@eslint/eslintrc": {
-
"version": "3.3.1",
-
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",
-
"integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==",
+
"version": "2.1.4",
+
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
+
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true,
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
-
"espree": "^10.0.1",
-
"globals": "^14.0.0",
+
"espree": "^9.6.0",
+
"globals": "^13.19.0",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
···
"strip-json-comments": "^3.1.1"
},
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/@eslint/js": {
-
"version": "9.39.1",
-
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz",
-
"integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
+
"version": "8.57.0",
+
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
+
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
"dev": true,
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
},
-
"funding": {
-
"url": "https://eslint.org/donate"
-
}
-
},
-
"node_modules/@eslint/object-schema": {
-
"version": "2.1.7",
-
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
-
"integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
-
"dev": true,
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
}
-
},
-
"node_modules/@eslint/plugin-kit": {
-
"version": "0.4.1",
-
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
-
"integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
-
"dev": true,
-
"dependencies": {
-
"@eslint/core": "^0.17.0",
-
"levn": "^0.4.1"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/@fastify/busboy": {
···
"hono": "^4"
},
-
"node_modules/@humanfs/core": {
-
"version": "0.19.1",
-
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
-
"integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
-
"dev": true,
-
"engines": {
-
"node": ">=18.18.0"
-
}
-
},
-
"node_modules/@humanfs/node": {
-
"version": "0.16.7",
-
"resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",
-
"integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",
+
"node_modules/@humanwhocodes/config-array": {
+
"version": "0.11.14",
+
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
+
"integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
"dev": true,
"dependencies": {
-
"@humanfs/core": "^0.19.1",
-
"@humanwhocodes/retry": "^0.4.0"
+
"@humanwhocodes/object-schema": "^2.0.2",
+
"debug": "^4.3.1",
+
"minimatch": "^3.0.5"
},
"engines": {
-
"node": ">=18.18.0"
+
"node": ">=10.10.0"
},
"node_modules/@humanwhocodes/module-importer": {
···
"url": "https://github.com/sponsors/nzakas"
},
-
"node_modules/@humanwhocodes/retry": {
-
"version": "0.4.3",
-
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
-
"integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
-
"dev": true,
-
"engines": {
-
"node": ">=18.18"
-
},
-
"funding": {
-
"type": "github",
-
"url": "https://github.com/sponsors/nzakas"
-
}
+
"node_modules/@humanwhocodes/object-schema": {
+
"version": "2.0.3",
+
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
+
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
+
"dev": true
},
"node_modules/@img/colour": {
"version": "1.0.0",
···
},
"node_modules/@next/bundle-analyzer": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-16.0.3.tgz",
-
"integrity": "sha512-6Xo8f8/ZXtASfTPa6TH1aUn+xDg9Pkyl1YHVxu+89cVdLH7MnYjxv3rPOfEJ9BwCZCU2q4Flyw5MwltfD2pGbA==",
+
"version": "15.3.2",
+
"resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.3.2.tgz",
+
"integrity": "sha512-zY5O1PNKNxWEjaFX8gKzm77z2oL0cnj+m5aiqNBgay9LPLCDO13Cf+FJONeNq/nJjeXptwHFT9EMmTecF9U4Iw==",
+
"license": "MIT",
"dependencies": {
"webpack-bundle-analyzer": "4.10.1"
},
"node_modules/@next/env": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.3.tgz",
-
"integrity": "sha512-IqgtY5Vwsm14mm/nmQaRMmywCU+yyMIYfk3/MHZ2ZTJvwVbBn3usZnjMi1GacrMVzVcAxJShTCpZlPs26EdEjQ=="
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.3.tgz",
+
"integrity": "sha512-RSEDTRqyihYXygx/OJXwvVupfr9m04+0vH8vyy0HfZ7keRto6VX9BbEk0J2PUk0VGy6YhklJUSrgForov5F9pw==",
+
"license": "MIT"
},
"node_modules/@next/eslint-plugin-next": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.3.tgz",
-
"integrity": "sha512-6sPWmZetzFWMsz7Dhuxsdmbu3fK+/AxKRtj7OB0/3OZAI2MHB/v2FeYh271LZ9abvnM1WIwWc/5umYjx0jo5sQ==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.3.tgz",
+
"integrity": "sha512-SdhaKdko6dpsSr0DldkESItVrnPYB1NS2NpShCSX5lc7SSQmLZt5Mug6t2xbiuVWEVDLZSuIAoQyYVBYp0dR5g==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"fast-glob": "3.3.1"
···
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz",
"integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
···
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
+
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
···
},
"node_modules/@next/mdx": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-16.0.3.tgz",
-
"integrity": "sha512-uVl2JSEGAjBV+EVnpt1cZN88SK3lJ2n7Fc+iqTsgVx2g9+Y6ru+P6nuUgXd38OHPUIwzL6k2V1u4iV3kwuTySQ==",
+
"version": "15.3.2",
+
"resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-15.3.2.tgz",
+
"integrity": "sha512-D6lSSbVzn1EiPwrBKG5QzXClcgdqiNCL8a3/6oROinzgZnYSxbVmnfs0UrqygtGSOmgW7sdJJSEOy555DoAwvw==",
+
"license": "MIT",
"dependencies": {
"source-map": "^0.7.0"
},
···
},
"node_modules/@next/swc-darwin-arm64": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.3.tgz",
-
"integrity": "sha512-MOnbd92+OByu0p6QBAzq1ahVWzF6nyfiH07dQDez4/Nku7G249NjxDVyEfVhz8WkLiOEU+KFVnqtgcsfP2nLXg==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.3.tgz",
+
"integrity": "sha512-nzbHQo69+au9wJkGKTU9lP7PXv0d1J5ljFpvb+LnEomLtSbJkbZyEs6sbF3plQmiOB2l9OBtN2tNSvCH1nQ9Jg==",
"cpu": [
"arm64"
],
+
"license": "MIT",
"optional": true,
"os": [
"darwin"
···
},
"node_modules/@next/swc-darwin-x64": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.3.tgz",
-
"integrity": "sha512-i70C4O1VmbTivYdRlk+5lj9xRc2BlK3oUikt3yJeHT1unL4LsNtN7UiOhVanFdc7vDAgZn1tV/9mQwMkWOJvHg==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.3.tgz",
+
"integrity": "sha512-w83w4SkOOhekJOcA5HBvHyGzgV1W/XvOfpkrxIse4uPWhYTTRwtGEM4v/jiXwNSJvfRvah0H8/uTLBKRXlef8g==",
"cpu": [
"x64"
],
+
"license": "MIT",
"optional": true,
"os": [
"darwin"
···
},
"node_modules/@next/swc-linux-arm64-gnu": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.3.tgz",
-
"integrity": "sha512-O88gCZ95sScwD00mn/AtalyCoykhhlokxH/wi1huFK+rmiP5LAYVs/i2ruk7xST6SuXN4NI5y4Xf5vepb2jf6A==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.3.tgz",
+
"integrity": "sha512-+m7pfIs0/yvgVu26ieaKrifV8C8yiLe7jVp9SpcIzg7XmyyNE7toC1fy5IOQozmr6kWl/JONC51osih2RyoXRw==",
"cpu": [
"arm64"
],
+
"license": "MIT",
"optional": true,
"os": [
"linux"
···
},
"node_modules/@next/swc-linux-arm64-musl": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.3.tgz",
-
"integrity": "sha512-CEErFt78S/zYXzFIiv18iQCbRbLgBluS8z1TNDQoyPi8/Jr5qhR3e8XHAIxVxPBjDbEMITprqELVc5KTfFj0gg==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.3.tgz",
+
"integrity": "sha512-u3PEIzuguSenoZviZJahNLgCexGFhso5mxWCrrIMdvpZn6lkME5vc/ADZG8UUk5K1uWRy4hqSFECrON6UKQBbQ==",
"cpu": [
"arm64"
],
+
"license": "MIT",
"optional": true,
"os": [
"linux"
···
},
"node_modules/@next/swc-linux-x64-gnu": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.3.tgz",
-
"integrity": "sha512-Tc3i+nwt6mQ+Dwzcri/WNDj56iWdycGVh5YwwklleClzPzz7UpfaMw1ci7bLl6GRYMXhWDBfe707EXNjKtiswQ==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.3.tgz",
+
"integrity": "sha512-lDtOOScYDZxI2BENN9m0pfVPJDSuUkAD1YXSvlJF0DKwZt0WlA7T7o3wrcEr4Q+iHYGzEaVuZcsIbCps4K27sA==",
"cpu": [
"x64"
],
+
"license": "MIT",
"optional": true,
"os": [
"linux"
···
},
"node_modules/@next/swc-linux-x64-musl": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.3.tgz",
-
"integrity": "sha512-zTh03Z/5PBBPdTurgEtr6nY0vI9KR9Ifp/jZCcHlODzwVOEKcKRBtQIGrkc7izFgOMuXDEJBmirwpGqdM/ZixA==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.3.tgz",
+
"integrity": "sha512-9vWVUnsx9PrY2NwdVRJ4dUURAQ8Su0sLRPqcCCxtX5zIQUBES12eRVHq6b70bbfaVaxIDGJN2afHui0eDm+cLg==",
"cpu": [
"x64"
],
+
"license": "MIT",
"optional": true,
"os": [
"linux"
···
},
"node_modules/@next/swc-win32-arm64-msvc": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.3.tgz",
-
"integrity": "sha512-Jc1EHxtZovcJcg5zU43X3tuqzl/sS+CmLgjRP28ZT4vk869Ncm2NoF8qSTaL99gh6uOzgM99Shct06pSO6kA6g==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.3.tgz",
+
"integrity": "sha512-1CU20FZzY9LFQigRi6jM45oJMU3KziA5/sSG+dXeVaTm661snQP6xu3ykGxxwU5sLG3sh14teO/IOEPVsQMRfA==",
"cpu": [
"arm64"
],
+
"license": "MIT",
"optional": true,
"os": [
"win32"
···
},
"node_modules/@next/swc-win32-x64-msvc": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.3.tgz",
-
"integrity": "sha512-N7EJ6zbxgIYpI/sWNzpVKRMbfEGgsWuOIvzkML7wxAAZhPk1Msxuo/JDu1PKjWGrAoOLaZcIX5s+/pF5LIbBBg==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.3.tgz",
+
"integrity": "sha512-JMoLAq3n3y5tKXPQwCK5c+6tmwkuFDa2XAxz8Wm4+IVthdBZdZGh+lmiLUHg9f9IDwIQpUjp+ysd6OkYTyZRZw==",
"cpu": [
"x64"
],
+
"license": "MIT",
"optional": true,
"os": [
"win32"
···
"dev": true,
"license": "MIT"
},
+
"node_modules/@rushstack/eslint-patch": {
+
"version": "1.10.3",
+
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz",
+
"integrity": "sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg==",
+
"dev": true
+
},
"node_modules/@shikijs/core": {
"version": "3.8.1",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.8.1.tgz",
···
"@types/unist": "*"
},
-
"node_modules/@types/json-schema": {
-
"version": "7.0.15",
-
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
-
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
-
"dev": true
-
},
"node_modules/@types/json5": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
···
"integrity": "sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA=="
},
"node_modules/@types/react": {
-
"version": "19.2.6",
-
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.6.tgz",
-
"integrity": "sha512-p/jUvulfgU7oKtj6Xpk8cA2Y1xKTtICGpJYeJXz2YVO2UcvjQgeRMLDGfDeqeRW2Ta+0QNFwcc8X3GH8SxZz6w==",
+
"version": "19.1.3",
+
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.3.tgz",
+
"integrity": "sha512-dLWQ+Z0CkIvK1J8+wrDPwGxEYFA4RAyHoZPxHVGspYmFVnwGSNT24cGIhFJrtfRnWVuW8X7NO52gCXmhkVUWGQ==",
+
"license": "MIT",
"dependencies": {
-
"csstype": "^3.2.2"
+
"csstype": "^3.0.2"
},
"node_modules/@types/react-dom": {
-
"version": "19.2.3",
-
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",
-
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
+
"version": "19.1.3",
+
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.3.tgz",
+
"integrity": "sha512-rJXC08OG0h3W6wDMFxQrZF00Kq6qQvw0djHRdzl3U5DnIERz0MRce3WVc7IS6JYBwtaP/DwYtRRjVlvivNveKg==",
"devOptional": true,
+
"license": "MIT",
"peerDependencies": {
-
"@types/react": "^19.2.0"
+
"@types/react": "^19.0.0"
},
"node_modules/@types/shimmer": {
···
},
"node_modules/@typescript-eslint/eslint-plugin": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.47.0.tgz",
-
"integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.0.tgz",
+
"integrity": "sha512-/jU9ettcntkBFmWUzzGgsClEi2ZFiikMX5eEQsmxIAWMOn4H3D4rvHssstmAHGVvrYnaMqdWWWg0b5M6IN/MTQ==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
-
"@typescript-eslint/scope-manager": "8.47.0",
-
"@typescript-eslint/type-utils": "8.47.0",
-
"@typescript-eslint/utils": "8.47.0",
-
"@typescript-eslint/visitor-keys": "8.47.0",
+
"@typescript-eslint/scope-manager": "8.32.0",
+
"@typescript-eslint/type-utils": "8.32.0",
+
"@typescript-eslint/utils": "8.32.0",
+
"@typescript-eslint/visitor-keys": "8.32.0",
"graphemer": "^1.4.0",
-
"ignore": "^7.0.0",
+
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.1.0"
},
···
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
-
"@typescript-eslint/parser": "^8.47.0",
+
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
"eslint": "^8.57.0 || ^9.0.0",
-
"typescript": ">=4.8.4 <6.0.0"
-
}
-
},
-
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
-
"version": "7.0.5",
-
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
-
"integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
-
"dev": true,
-
"engines": {
-
"node": ">= 4"
+
"typescript": ">=4.8.4 <5.9.0"
},
"node_modules/@typescript-eslint/parser": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.47.0.tgz",
-
"integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.0.tgz",
+
"integrity": "sha512-B2MdzyWxCE2+SqiZHAjPphft+/2x2FlO9YBx7eKE1BCb+rqBlQdhtAEhzIEdozHd55DXPmxBdpMygFJjfjjA9A==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@typescript-eslint/scope-manager": "8.47.0",
-
"@typescript-eslint/types": "8.47.0",
-
"@typescript-eslint/typescript-estree": "8.47.0",
-
"@typescript-eslint/visitor-keys": "8.47.0",
+
"@typescript-eslint/scope-manager": "8.32.0",
+
"@typescript-eslint/types": "8.32.0",
+
"@typescript-eslint/typescript-estree": "8.32.0",
+
"@typescript-eslint/visitor-keys": "8.32.0",
"debug": "^4.3.4"
},
"engines": {
···
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
-
"typescript": ">=4.8.4 <6.0.0"
-
}
-
},
-
"node_modules/@typescript-eslint/project-service": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.47.0.tgz",
-
"integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==",
-
"dev": true,
-
"dependencies": {
-
"@typescript-eslint/tsconfig-utils": "^8.47.0",
-
"@typescript-eslint/types": "^8.47.0",
-
"debug": "^4.3.4"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
},
-
"funding": {
-
"type": "opencollective",
-
"url": "https://opencollective.com/typescript-eslint"
-
},
-
"peerDependencies": {
-
"typescript": ">=4.8.4 <6.0.0"
+
"typescript": ">=4.8.4 <5.9.0"
},
"node_modules/@typescript-eslint/scope-manager": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.47.0.tgz",
-
"integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.0.tgz",
+
"integrity": "sha512-jc/4IxGNedXkmG4mx4nJTILb6TMjL66D41vyeaPWvDUmeYQzF3lKtN15WsAeTr65ce4mPxwopPSo1yUUAWw0hQ==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@typescript-eslint/types": "8.47.0",
-
"@typescript-eslint/visitor-keys": "8.47.0"
+
"@typescript-eslint/types": "8.32.0",
+
"@typescript-eslint/visitor-keys": "8.32.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
···
"url": "https://opencollective.com/typescript-eslint"
},
-
"node_modules/@typescript-eslint/tsconfig-utils": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.47.0.tgz",
-
"integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==",
-
"dev": true,
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
},
-
"funding": {
-
"type": "opencollective",
-
"url": "https://opencollective.com/typescript-eslint"
-
},
-
"peerDependencies": {
-
"typescript": ">=4.8.4 <6.0.0"
-
}
-
},
"node_modules/@typescript-eslint/type-utils": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.47.0.tgz",
-
"integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.0.tgz",
+
"integrity": "sha512-t2vouuYQKEKSLtJaa5bB4jHeha2HJczQ6E5IXPDPgIty9EqcJxpr1QHQ86YyIPwDwxvUmLfP2YADQ5ZY4qddZg==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@typescript-eslint/types": "8.47.0",
-
"@typescript-eslint/typescript-estree": "8.47.0",
-
"@typescript-eslint/utils": "8.47.0",
+
"@typescript-eslint/typescript-estree": "8.32.0",
+
"@typescript-eslint/utils": "8.32.0",
"debug": "^4.3.4",
"ts-api-utils": "^2.1.0"
},
···
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
-
"typescript": ">=4.8.4 <6.0.0"
+
"typescript": ">=4.8.4 <5.9.0"
},
"node_modules/@typescript-eslint/types": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.47.0.tgz",
-
"integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.0.tgz",
+
"integrity": "sha512-O5Id6tGadAZEMThM6L9HmVf5hQUXNSxLVKeGJYWNhhVseps/0LddMkp7//VDkzwJ69lPL0UmZdcZwggj9akJaA==",
"dev": true,
+
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
···
},
"node_modules/@typescript-eslint/typescript-estree": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.47.0.tgz",
-
"integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.0.tgz",
+
"integrity": "sha512-pU9VD7anSCOIoBFnhTGfOzlVFQIA1XXiQpH/CezqOBaDppRwTglJzCC6fUQGpfwey4T183NKhF1/mfatYmjRqQ==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@typescript-eslint/project-service": "8.47.0",
-
"@typescript-eslint/tsconfig-utils": "8.47.0",
-
"@typescript-eslint/types": "8.47.0",
-
"@typescript-eslint/visitor-keys": "8.47.0",
+
"@typescript-eslint/types": "8.32.0",
+
"@typescript-eslint/visitor-keys": "8.32.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",
···
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
-
"typescript": ">=4.8.4 <6.0.0"
+
"typescript": ">=4.8.4 <5.9.0"
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
-
"version": "2.0.2",
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
-
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
+
"version": "2.0.1",
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0"
···
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"dev": true,
+
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.1"
},
···
},
"node_modules/@typescript-eslint/utils": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.47.0.tgz",
-
"integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.0.tgz",
+
"integrity": "sha512-8S9hXau6nQ/sYVtC3D6ISIDoJzS1NsCK+gluVhLN2YkBPX+/1wkwyUiDKnxRh15579WoOIyVWnoyIf3yGI9REw==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.7.0",
-
"@typescript-eslint/scope-manager": "8.47.0",
-
"@typescript-eslint/types": "8.47.0",
-
"@typescript-eslint/typescript-estree": "8.47.0"
+
"@typescript-eslint/scope-manager": "8.32.0",
+
"@typescript-eslint/types": "8.32.0",
+
"@typescript-eslint/typescript-estree": "8.32.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
···
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
-
"typescript": ">=4.8.4 <6.0.0"
+
"typescript": ">=4.8.4 <5.9.0"
},
"node_modules/@typescript-eslint/visitor-keys": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.47.0.tgz",
-
"integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==",
+
"version": "8.32.0",
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.0.tgz",
+
"integrity": "sha512-1rYQTCLFFzOI5Nl0c8LUpJT8HxpwVRn9E4CkMsYfuN6ctmQqExjSTzzSk0Tz2apmXy7WU6/6fyaZVVA/thPN+w==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@typescript-eslint/types": "8.47.0",
-
"eslint-visitor-keys": "^4.2.1"
+
"@typescript-eslint/types": "8.32.0",
+
"eslint-visitor-keys": "^4.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
···
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
+
}
+
},
+
"node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
+
"version": "4.2.0",
+
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+
"integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
+
"dev": true,
+
"license": "Apache-2.0",
+
"engines": {
+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
},
+
"funding": {
+
"url": "https://opencollective.com/eslint"
},
"node_modules/@ungap/structured-clone": {
···
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
···
"license": "MIT"
},
"node_modules/array-includes": {
-
"version": "3.1.9",
-
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz",
-
"integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==",
+
"version": "3.1.8",
+
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz",
+
"integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==",
"dev": true,
"dependencies": {
-
"call-bind": "^1.0.8",
-
"call-bound": "^1.0.4",
+
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
-
"es-abstract": "^1.24.0",
-
"es-object-atoms": "^1.1.1",
-
"get-intrinsic": "^1.3.0",
-
"is-string": "^1.1.1",
-
"math-intrinsics": "^1.1.0"
+
"es-abstract": "^1.23.2",
+
"es-object-atoms": "^1.0.0",
+
"get-intrinsic": "^1.2.4",
+
"is-string": "^1.0.7"
},
"engines": {
"node": ">= 0.4"
···
},
"node_modules/array.prototype.findlastindex": {
-
"version": "1.2.6",
-
"resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz",
-
"integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==",
+
"version": "1.2.5",
+
"resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz",
+
"integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==",
"dev": true,
"dependencies": {
-
"call-bind": "^1.0.8",
-
"call-bound": "^1.0.4",
+
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
-
"es-abstract": "^1.23.9",
+
"es-abstract": "^1.23.2",
"es-errors": "^1.3.0",
-
"es-object-atoms": "^1.1.1",
-
"es-shim-unscopables": "^1.1.0"
+
"es-object-atoms": "^1.0.0",
+
"es-shim-unscopables": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
···
},
"node_modules/array.prototype.flat": {
-
"version": "1.3.3",
-
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz",
-
"integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==",
+
"version": "1.3.2",
+
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz",
+
"integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==",
"dev": true,
"dependencies": {
-
"call-bind": "^1.0.8",
-
"define-properties": "^1.2.1",
-
"es-abstract": "^1.23.5",
-
"es-shim-unscopables": "^1.0.2"
+
"call-bind": "^1.0.2",
+
"define-properties": "^1.2.0",
+
"es-abstract": "^1.22.1",
+
"es-shim-unscopables": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
···
},
-
"node_modules/baseline-browser-mapping": {
-
"version": "2.8.30",
-
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.30.tgz",
-
"integrity": "sha512-aTUKW4ptQhS64+v2d6IkPzymEzzhw+G0bA1g3uBRV3+ntkH+svttKseW5IOR4Ed6NUVKqnY7qT3dKvzQ7io4AA==",
-
"dev": true,
-
"bin": {
-
"baseline-browser-mapping": "dist/cli.js"
-
}
-
},
"node_modules/bignumber.js": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
···
"node": ">=8"
},
-
"node_modules/browserslist": {
-
"version": "4.28.0",
-
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
-
"integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==",
-
"dev": true,
-
"funding": [
-
{
-
"type": "opencollective",
-
"url": "https://opencollective.com/browserslist"
-
},
-
{
-
"type": "tidelift",
-
"url": "https://tidelift.com/funding/github/npm/browserslist"
-
},
-
{
-
"type": "github",
-
"url": "https://github.com/sponsors/ai"
-
}
-
],
-
"dependencies": {
-
"baseline-browser-mapping": "^2.8.25",
-
"caniuse-lite": "^1.0.30001754",
-
"electron-to-chromium": "^1.5.249",
-
"node-releases": "^2.0.27",
-
"update-browserslist-db": "^1.1.4"
-
},
-
"bin": {
-
"browserslist": "cli.js"
-
},
-
"engines": {
-
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
-
}
-
},
"node_modules/buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
···
},
"node_modules/caniuse-lite": {
-
"version": "1.0.30001756",
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001756.tgz",
-
"integrity": "sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A==",
+
"version": "1.0.30001717",
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz",
+
"integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==",
"funding": [
"type": "opencollective",
···
"type": "github",
"url": "https://github.com/sponsors/ai"
-
]
+
],
+
"license": "CC-BY-4.0"
},
"node_modules/canonicalize": {
"version": "1.0.8",
···
"node": ">= 0.6"
},
-
"node_modules/convert-source-map": {
-
"version": "2.0.0",
-
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
-
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
-
"dev": true
-
},
"node_modules/cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
···
},
"node_modules/cross-spawn": {
-
"version": "7.0.6",
-
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
-
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+
"version": "7.0.3",
+
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
···
},
"node_modules/csstype": {
-
"version": "3.2.3",
-
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
-
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="
+
"version": "3.1.3",
+
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
+
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
},
"node_modules/d": {
"version": "1.0.2",
···
"node": "*"
},
+
"node_modules/doctrine": {
+
"version": "3.0.0",
+
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+
"dev": true,
+
"dependencies": {
+
"esutils": "^2.0.2"
+
},
+
"engines": {
+
"node": ">=6.0.0"
+
}
+
},
"node_modules/dreamopt": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/dreamopt/-/dreamopt-0.8.0.tgz",
···
"drizzle-kit": "bin.cjs"
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/aix-ppc64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
-
"integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"aix"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/android-arm": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
-
"integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/android-arm64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
-
"integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/android-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
-
"integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/darwin-arm64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
-
"integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/darwin-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
-
"integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/freebsd-arm64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
-
"integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/freebsd-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
-
"integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-arm": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
-
"integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-arm64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
-
"integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-ia32": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
-
"integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-loong64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
-
"integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
-
"cpu": [
-
"loong64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-mips64el": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
-
"integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
-
"cpu": [
-
"mips64el"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-ppc64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
-
"integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-riscv64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
-
"integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
-
"cpu": [
-
"riscv64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/linux-s390x": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
-
"integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
-
"cpu": [
-
"s390x"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
"node_modules/drizzle-kit/node_modules/@esbuild/linux-x64": {
"version": "0.19.12",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
···
"node": ">=12"
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/netbsd-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
-
"integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"netbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/openbsd-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
-
"integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"openbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/sunos-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
-
"integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"sunos"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/win32-arm64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
-
"integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/win32-ia32": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
-
"integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/drizzle-kit/node_modules/@esbuild/win32-x64": {
-
"version": "0.19.12",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
-
"integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
"node_modules/drizzle-kit/node_modules/esbuild": {
"version": "0.19.12",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz",
···
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
"license": "MIT"
},
-
"node_modules/electron-to-chromium": {
-
"version": "1.5.258",
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.258.tgz",
-
"integrity": "sha512-rHUggNV5jKQ0sSdWwlaRDkFc3/rRJIVnOSe9yR4zrR07m3ZxhP4N27Hlg8VeJGGYgFTxK5NqDmWI4DSH72vIJg==",
-
"dev": true
-
},
"node_modules/emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
···
},
"node_modules/es-abstract": {
-
"version": "1.24.0",
-
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz",
-
"integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==",
+
"version": "1.23.9",
+
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz",
+
"integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"array-buffer-byte-length": "^1.0.2",
"arraybuffer.prototype.slice": "^1.0.4",
"available-typed-arrays": "^1.0.7",
"call-bind": "^1.0.8",
-
"call-bound": "^1.0.4",
+
"call-bound": "^1.0.3",
"data-view-buffer": "^1.0.2",
"data-view-byte-length": "^1.0.2",
"data-view-byte-offset": "^1.0.1",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
-
"es-object-atoms": "^1.1.1",
+
"es-object-atoms": "^1.0.0",
"es-set-tostringtag": "^2.1.0",
"es-to-primitive": "^1.3.0",
"function.prototype.name": "^1.1.8",
-
"get-intrinsic": "^1.3.0",
-
"get-proto": "^1.0.1",
+
"get-intrinsic": "^1.2.7",
+
"get-proto": "^1.0.0",
"get-symbol-description": "^1.1.0",
"globalthis": "^1.0.4",
"gopd": "^1.2.0",
···
"is-array-buffer": "^3.0.5",
"is-callable": "^1.2.7",
"is-data-view": "^1.0.2",
-
"is-negative-zero": "^2.0.3",
"is-regex": "^1.2.1",
-
"is-set": "^2.0.3",
"is-shared-array-buffer": "^1.0.4",
"is-string": "^1.1.1",
"is-typed-array": "^1.1.15",
-
"is-weakref": "^1.1.1",
+
"is-weakref": "^1.1.0",
"math-intrinsics": "^1.1.0",
-
"object-inspect": "^1.13.4",
+
"object-inspect": "^1.13.3",
"object-keys": "^1.1.1",
"object.assign": "^4.1.7",
"own-keys": "^1.0.1",
-
"regexp.prototype.flags": "^1.5.4",
+
"regexp.prototype.flags": "^1.5.3",
"safe-array-concat": "^1.1.3",
"safe-push-apply": "^1.0.0",
"safe-regex-test": "^1.1.0",
"set-proto": "^1.0.0",
-
"stop-iteration-iterator": "^1.1.0",
"string.prototype.trim": "^1.2.10",
"string.prototype.trimend": "^1.0.9",
"string.prototype.trimstart": "^1.0.8",
···
"typed-array-byte-offset": "^1.0.4",
"typed-array-length": "^1.0.7",
"unbox-primitive": "^1.1.0",
-
"which-typed-array": "^1.1.19"
+
"which-typed-array": "^1.1.18"
},
"engines": {
"node": ">= 0.4"
···
},
"node_modules/es-shim-unscopables": {
-
"version": "1.1.0",
-
"resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz",
-
"integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==",
+
"version": "1.0.2",
+
"resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz",
+
"integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==",
"dev": true,
"dependencies": {
-
"hasown": "^2.0.2"
-
},
-
"engines": {
-
"node": ">= 0.4"
+
"hasown": "^2.0.0"
},
"node_modules/es-to-primitive": {
···
"esbuild": ">=0.12 <1"
},
-
"node_modules/esbuild/node_modules/@esbuild/darwin-arm64": {
-
"version": "0.25.4",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.4.tgz",
-
"integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=18"
-
}
-
},
"node_modules/escalade": {
-
"version": "3.2.0",
-
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
-
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+
"version": "3.1.2",
+
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
+
"integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
"engines": {
"node": ">=6"
···
},
"node_modules/eslint": {
-
"version": "9.39.1",
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz",
-
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
+
"version": "8.57.0",
+
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
+
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
"dev": true,
"dependencies": {
-
"@eslint-community/eslint-utils": "^4.8.0",
-
"@eslint-community/regexpp": "^4.12.1",
-
"@eslint/config-array": "^0.21.1",
-
"@eslint/config-helpers": "^0.4.2",
-
"@eslint/core": "^0.17.0",
-
"@eslint/eslintrc": "^3.3.1",
-
"@eslint/js": "9.39.1",
-
"@eslint/plugin-kit": "^0.4.1",
-
"@humanfs/node": "^0.16.6",
+
"@eslint-community/eslint-utils": "^4.2.0",
+
"@eslint-community/regexpp": "^4.6.1",
+
"@eslint/eslintrc": "^2.1.4",
+
"@eslint/js": "8.57.0",
+
"@humanwhocodes/config-array": "^0.11.14",
"@humanwhocodes/module-importer": "^1.0.1",
-
"@humanwhocodes/retry": "^0.4.2",
-
"@types/estree": "^1.0.6",
+
"@nodelib/fs.walk": "^1.2.8",
+
"@ungap/structured-clone": "^1.2.0",
"ajv": "^6.12.4",
"chalk": "^4.0.0",
-
"cross-spawn": "^7.0.6",
+
"cross-spawn": "^7.0.2",
"debug": "^4.3.2",
+
"doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0",
-
"eslint-scope": "^8.4.0",
-
"eslint-visitor-keys": "^4.2.1",
-
"espree": "^10.4.0",
-
"esquery": "^1.5.0",
+
"eslint-scope": "^7.2.2",
+
"eslint-visitor-keys": "^3.4.3",
+
"espree": "^9.6.1",
+
"esquery": "^1.4.2",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
-
"file-entry-cache": "^8.0.0",
+
"file-entry-cache": "^6.0.1",
"find-up": "^5.0.0",
"glob-parent": "^6.0.2",
+
"globals": "^13.19.0",
+
"graphemer": "^1.4.0",
"ignore": "^5.2.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
+
"is-path-inside": "^3.0.3",
+
"js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
+
"levn": "^0.4.1",
"lodash.merge": "^4.6.2",
"minimatch": "^3.1.2",
"natural-compare": "^1.4.0",
-
"optionator": "^0.9.3"
+
"optionator": "^0.9.3",
+
"strip-ansi": "^6.0.1",
+
"text-table": "^0.2.0"
},
"bin": {
"eslint": "bin/eslint.js"
},
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
-
"url": "https://eslint.org/donate"
-
},
-
"peerDependencies": {
-
"jiti": "*"
-
},
-
"peerDependenciesMeta": {
-
"jiti": {
-
"optional": true
-
}
+
"url": "https://opencollective.com/eslint"
},
"node_modules/eslint-config-next": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.0.3.tgz",
-
"integrity": "sha512-5F6qDjcZldf0Y0ZbqvWvap9xzYUxyDf7/of37aeyhvkrQokj/4bT1JYWZdlWUr283aeVa+s52mPq9ogmGg+5dw==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.5.3.tgz",
+
"integrity": "sha512-e6j+QhQFOr5pfsc8VJbuTD9xTXJaRvMHYjEeLPA2pFkheNlgPLCkxdvhxhfuM4KGcqSZj2qEnpHisdTVs3BxuQ==",
"dev": true,
+
"license": "MIT",
"dependencies": {
-
"@next/eslint-plugin-next": "16.0.3",
+
"@next/eslint-plugin-next": "15.5.3",
+
"@rushstack/eslint-patch": "^1.10.3",
+
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
+
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
-
"eslint-plugin-import": "^2.32.0",
+
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
-
"eslint-plugin-react-hooks": "^7.0.0",
-
"globals": "16.4.0",
-
"typescript-eslint": "^8.46.0"
+
"eslint-plugin-react-hooks": "^5.0.0"
},
"peerDependencies": {
-
"eslint": ">=9.0.0",
+
"eslint": "^7.23.0 || ^8.0.0 || ^9.0.0",
"typescript": ">=3.3.1"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
-
}
-
},
-
"node_modules/eslint-config-next/node_modules/globals": {
-
"version": "16.4.0",
-
"resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
-
"integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
-
"dev": true,
-
"engines": {
-
"node": ">=18"
-
},
-
"funding": {
-
"url": "https://github.com/sponsors/sindresorhus"
},
"node_modules/eslint-import-resolver-node": {
···
},
"node_modules/eslint-module-utils": {
-
"version": "2.12.1",
-
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz",
-
"integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==",
+
"version": "2.12.0",
+
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz",
+
"integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"debug": "^3.2.7"
},
···
},
"node_modules/eslint-plugin-import": {
-
"version": "2.32.0",
-
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz",
-
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
+
"version": "2.31.0",
+
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz",
+
"integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==",
"dev": true,
+
"license": "MIT",
"dependencies": {
"@rtsao/scc": "^1.1.0",
-
"array-includes": "^3.1.9",
-
"array.prototype.findlastindex": "^1.2.6",
-
"array.prototype.flat": "^1.3.3",
-
"array.prototype.flatmap": "^1.3.3",
+
"array-includes": "^3.1.8",
+
"array.prototype.findlastindex": "^1.2.5",
+
"array.prototype.flat": "^1.3.2",
+
"array.prototype.flatmap": "^1.3.2",
"debug": "^3.2.7",
"doctrine": "^2.1.0",
"eslint-import-resolver-node": "^0.3.9",
-
"eslint-module-utils": "^2.12.1",
+
"eslint-module-utils": "^2.12.0",
"hasown": "^2.0.2",
-
"is-core-module": "^2.16.1",
+
"is-core-module": "^2.15.1",
"is-glob": "^4.0.3",
"minimatch": "^3.1.2",
"object.fromentries": "^2.0.8",
"object.groupby": "^1.0.3",
-
"object.values": "^1.2.1",
+
"object.values": "^1.2.0",
"semver": "^6.3.1",
-
"string.prototype.trimend": "^1.0.9",
+
"string.prototype.trimend": "^1.0.8",
"tsconfig-paths": "^3.15.0"
},
"engines": {
···
},
"node_modules/eslint-plugin-react-hooks": {
-
"version": "7.0.1",
-
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz",
-
"integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==",
+
"version": "5.2.0",
+
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz",
+
"integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==",
"dev": true,
-
"dependencies": {
-
"@babel/core": "^7.24.4",
-
"@babel/parser": "^7.24.4",
-
"hermes-parser": "^0.25.1",
-
"zod": "^3.25.0 || ^4.0.0",
-
"zod-validation-error": "^3.5.0 || ^4.0.0"
-
},
+
"license": "MIT",
"engines": {
-
"node": ">=18"
+
"node": ">=10"
},
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
},
-
"node_modules/eslint-plugin-react-hooks/node_modules/zod": {
-
"version": "4.1.12",
-
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz",
-
"integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==",
-
"dev": true,
-
"funding": {
-
"url": "https://github.com/sponsors/colinhacks"
-
}
-
},
-
"node_modules/eslint-plugin-react-hooks/node_modules/zod-validation-error": {
-
"version": "4.0.2",
-
"resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz",
-
"integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==",
-
"dev": true,
-
"engines": {
-
"node": ">=18.0.0"
-
},
-
"peerDependencies": {
-
"zod": "^3.25.0 || ^4.0.0"
-
}
-
},
"node_modules/eslint-plugin-react/node_modules/doctrine": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
···
},
"node_modules/eslint-scope": {
-
"version": "8.4.0",
-
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
-
"integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
+
"version": "7.2.2",
+
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+
"integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true,
"dependencies": {
"esrecurse": "^4.3.0",
"estraverse": "^5.2.0"
},
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
},
"node_modules/eslint-visitor-keys": {
-
"version": "4.2.1",
-
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
-
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+
"version": "3.4.3",
+
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true,
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
···
},
"node_modules/espree": {
-
"version": "10.4.0",
-
"resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
-
"integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
+
"version": "9.6.1",
+
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
+
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
"dev": true,
"dependencies": {
-
"acorn": "^8.15.0",
+
"acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
-
"eslint-visitor-keys": "^4.2.1"
+
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
···
},
"node_modules/fast-uri": {
-
"version": "3.1.0",
-
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
-
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
+
"version": "3.0.5",
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.5.tgz",
+
"integrity": "sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q==",
"dev": true,
"funding": [
···
"type": "opencollective",
"url": "https://opencollective.com/fastify"
-
]
+
],
+
"license": "BSD-3-Clause"
},
"node_modules/fastq": {
"version": "1.17.1",
···
},
"node_modules/file-entry-cache": {
-
"version": "8.0.0",
-
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
-
"integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+
"version": "6.0.1",
+
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
+
"integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
"dev": true,
"dependencies": {
-
"flat-cache": "^4.0.0"
+
"flat-cache": "^3.0.4"
},
"engines": {
-
"node": ">=16.0.0"
+
"node": "^10.12.0 || >=12.0.0"
},
"node_modules/fill-range": {
···
},
"node_modules/flat-cache": {
-
"version": "4.0.1",
-
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
-
"integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+
"version": "3.2.0",
+
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
+
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
"dev": true,
"dependencies": {
"flatted": "^3.2.9",
-
"keyv": "^4.5.4"
+
"keyv": "^4.5.3",
+
"rimraf": "^3.0.2"
},
"engines": {
-
"node": ">=16"
+
"node": "^10.12.0 || >=12.0.0"
},
"node_modules/flatted": {
-
"version": "3.3.3",
-
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
-
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
+
"version": "3.3.1",
+
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
+
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
"dev": true
},
"node_modules/follow-redirects": {
···
"node": ">=14"
-
"node_modules/gensync": {
-
"version": "1.0.0-beta.2",
-
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
-
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
-
"dev": true,
-
"engines": {
-
"node": ">=6.9.0"
-
}
-
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
···
"node_modules/globals": {
-
"version": "14.0.0",
-
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
-
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+
"version": "13.24.0",
+
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
+
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
+
"dependencies": {
+
"type-fest": "^0.20.2"
+
},
"engines": {
-
"node": ">=18"
+
"node": ">=8"
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
···
"integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==",
"dev": true
-
"node_modules/hermes-estree": {
-
"version": "0.25.1",
-
"resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz",
-
"integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==",
-
"dev": true
-
},
-
"node_modules/hermes-parser": {
-
"version": "0.25.1",
-
"resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz",
-
"integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==",
-
"dev": true,
-
"dependencies": {
-
"hermes-estree": "0.25.1"
-
}
-
},
"node_modules/hono": {
"version": "4.7.11",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.7.11.tgz",
···
"node_modules/import-fresh": {
-
"version": "3.3.1",
-
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
-
"integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+
"version": "3.3.0",
+
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"dependencies": {
"parent-module": "^1.0.0",
···
"url": "https://github.com/sponsors/ljharb"
-
"node_modules/is-negative-zero": {
-
"version": "2.0.3",
-
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
-
"integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==",
-
"dev": true,
-
"engines": {
-
"node": ">= 0.4"
-
},
-
"funding": {
-
"url": "https://github.com/sponsors/ljharb"
-
}
-
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
···
"funding": {
"url": "https://github.com/sponsors/ljharb"
+
}
+
},
+
"node_modules/is-path-inside": {
+
"version": "3.0.3",
+
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
+
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
+
"dev": true,
+
"engines": {
+
"node": ">=8"
"node_modules/is-plain-obj": {
···
"license": "MIT"
"node_modules/js-yaml": {
-
"version": "4.1.1",
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
-
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
+
"version": "4.1.0",
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"dependencies": {
"argparse": "^2.0.1"
"bin": {
"js-yaml": "bin/js-yaml.js"
-
}
-
},
-
"node_modules/jsesc": {
-
"version": "3.1.0",
-
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
-
"integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
-
"dev": true,
-
"bin": {
-
"jsesc": "bin/jsesc"
-
},
-
"engines": {
-
"node": ">=6"
"node_modules/json-bigint": {
···
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
-
"dev": true
+
"dev": true,
+
"license": "MIT"
"node_modules/json-stable-stringify-without-jsonify": {
"version": "1.0.1",
···
"node_modules/next": {
-
"version": "16.0.3",
-
"resolved": "https://registry.npmjs.org/next/-/next-16.0.3.tgz",
-
"integrity": "sha512-Ka0/iNBblPFcIubTA1Jjh6gvwqfjrGq1Y2MTI5lbjeLIAfmC+p5bQmojpRZqgHHVu5cG4+qdIiwXiBSm/8lZ3w==",
+
"version": "15.5.3",
+
"resolved": "https://registry.npmjs.org/next/-/next-15.5.3.tgz",
+
"integrity": "sha512-r/liNAx16SQj4D+XH/oI1dlpv9tdKJ6cONYPwwcCC46f2NjpaRWY+EKCzULfgQYV6YKXjHBchff2IZBSlZmJNw==",
+
"license": "MIT",
"dependencies": {
-
"@next/env": "16.0.3",
+
"@next/env": "15.5.3",
"@swc/helpers": "0.5.15",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
···
"next": "dist/bin/next"
"engines": {
-
"node": ">=20.9.0"
+
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
"optionalDependencies": {
-
"@next/swc-darwin-arm64": "16.0.3",
-
"@next/swc-darwin-x64": "16.0.3",
-
"@next/swc-linux-arm64-gnu": "16.0.3",
-
"@next/swc-linux-arm64-musl": "16.0.3",
-
"@next/swc-linux-x64-gnu": "16.0.3",
-
"@next/swc-linux-x64-musl": "16.0.3",
-
"@next/swc-win32-arm64-msvc": "16.0.3",
-
"@next/swc-win32-x64-msvc": "16.0.3",
-
"sharp": "^0.34.4"
+
"@next/swc-darwin-arm64": "15.5.3",
+
"@next/swc-darwin-x64": "15.5.3",
+
"@next/swc-linux-arm64-gnu": "15.5.3",
+
"@next/swc-linux-arm64-musl": "15.5.3",
+
"@next/swc-linux-x64-gnu": "15.5.3",
+
"@next/swc-linux-x64-musl": "15.5.3",
+
"@next/swc-win32-arm64-msvc": "15.5.3",
+
"@next/swc-win32-x64-msvc": "15.5.3",
+
"sharp": "^0.34.3"
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
···
"node-gyp-build-optional-packages-optional": "optional.js",
"node-gyp-build-optional-packages-test": "build-test.js"
-
},
-
"node_modules/node-releases": {
-
"version": "2.0.27",
-
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
-
"integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",
-
"dev": true
"node_modules/normalize-path": {
"version": "3.0.0",
···
"dev": true,
"engines": {
"node": ">=8"
+
}
+
},
+
"node_modules/path-is-absolute": {
+
"version": "1.0.1",
+
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+
"dev": true,
+
"engines": {
+
"node": ">=0.10.0"
"node_modules/path-key": {
···
"node_modules/react": {
-
"version": "19.2.0",
-
"resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
-
"integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
+
"version": "19.1.1",
+
"resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz",
+
"integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==",
+
"license": "MIT",
"engines": {
"node": ">=0.10.0"
···
"node_modules/react-dom": {
-
"version": "19.2.0",
-
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
-
"integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
+
"version": "19.1.1",
+
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz",
+
"integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==",
+
"license": "MIT",
"dependencies": {
-
"scheduler": "^0.27.0"
+
"scheduler": "^0.26.0"
"peerDependencies": {
-
"react": "^19.2.0"
+
"react": "^19.1.1"
"node_modules/react-is": {
···
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
"dev": true,
+
"license": "MIT",
"engines": {
"node": ">=0.10.0"
···
"node": ">=0.10.0"
+
"node_modules/rimraf": {
+
"version": "3.0.2",
+
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+
"deprecated": "Rimraf versions prior to v4 are no longer supported",
+
"dev": true,
+
"dependencies": {
+
"glob": "^7.1.3"
+
},
+
"bin": {
+
"rimraf": "bin.js"
+
},
+
"funding": {
+
"url": "https://github.com/sponsors/isaacs"
+
}
+
},
+
"node_modules/rimraf/node_modules/glob": {
+
"version": "7.2.3",
+
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+
"deprecated": "Glob versions prior to v9 are no longer supported",
+
"dev": true,
+
"dependencies": {
+
"fs.realpath": "^1.0.0",
+
"inflight": "^1.0.4",
+
"inherits": "2",
+
"minimatch": "^3.1.1",
+
"once": "^1.3.0",
+
"path-is-absolute": "^1.0.0"
+
},
+
"engines": {
+
"node": "*"
+
},
+
"funding": {
+
"url": "https://github.com/sponsors/isaacs"
+
}
+
},
"node_modules/rollup-plugin-inject": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz",
···
"license": "ISC"
"node_modules/scheduler": {
-
"version": "0.27.0",
-
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
-
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="
+
"version": "0.26.0",
+
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz",
+
"integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==",
+
"license": "MIT"
"node_modules/scmp": {
"version": "2.1.0",
···
"node": ">= 0.8"
-
"node_modules/stop-iteration-iterator": {
-
"version": "1.1.0",
-
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
-
"integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==",
-
"dev": true,
-
"dependencies": {
-
"es-errors": "^1.3.0",
-
"internal-slot": "^1.1.0"
-
},
-
"engines": {
-
"node": ">= 0.4"
-
}
-
},
"node_modules/stoppable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
···
"integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==",
"license": "ISC"
+
"node_modules/text-table": {
+
"version": "0.2.0",
+
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
+
"dev": true
+
},
"node_modules/thread-stream": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz",
···
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz",
"integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==",
"dev": true,
+
"license": "MIT",
"engines": {
"node": ">=18.12"
···
"node": ">= 0.8.0"
+
"node_modules/type-fest": {
+
"version": "0.20.2",
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+
"dev": true,
+
"engines": {
+
"node": ">=10"
+
},
+
"funding": {
+
"url": "https://github.com/sponsors/sindresorhus"
+
}
+
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
···
"engines": {
"node": ">=14.17"
-
}
-
},
-
"node_modules/typescript-eslint": {
-
"version": "8.47.0",
-
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.47.0.tgz",
-
"integrity": "sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==",
-
"dev": true,
-
"dependencies": {
-
"@typescript-eslint/eslint-plugin": "8.47.0",
-
"@typescript-eslint/parser": "8.47.0",
-
"@typescript-eslint/typescript-estree": "8.47.0",
-
"@typescript-eslint/utils": "8.47.0"
-
},
-
"engines": {
-
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-
},
-
"funding": {
-
"type": "opencollective",
-
"url": "https://opencollective.com/typescript-eslint"
-
},
-
"peerDependencies": {
-
"eslint": "^8.57.0 || ^9.0.0",
-
"typescript": ">=4.8.4 <6.0.0"
"node_modules/uc.micro": {
···
"node": ">= 0.8"
-
"node_modules/update-browserslist-db": {
-
"version": "1.1.4",
-
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz",
-
"integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==",
-
"dev": true,
-
"funding": [
-
{
-
"type": "opencollective",
-
"url": "https://opencollective.com/browserslist"
-
},
-
{
-
"type": "tidelift",
-
"url": "https://tidelift.com/funding/github/npm/browserslist"
-
},
-
{
-
"type": "github",
-
"url": "https://github.com/sponsors/ai"
-
}
-
],
-
"dependencies": {
-
"escalade": "^3.2.0",
-
"picocolors": "^1.1.1"
-
},
-
"bin": {
-
"update-browserslist-db": "cli.js"
-
},
-
"peerDependencies": {
-
"browserslist": ">= 4.21.0"
-
}
-
},
"node_modules/use-callback-ref": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz",
···
-
"node_modules/wrangler/node_modules/@esbuild/android-arm": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
-
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/android-arm64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
-
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/android-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
-
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"android"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/darwin-arm64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
-
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/darwin-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
-
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"darwin"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
-
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/freebsd-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
-
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"freebsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-arm": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
-
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
-
"cpu": [
-
"arm"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-arm64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
-
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-ia32": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
-
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-loong64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
-
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
-
"cpu": [
-
"loong64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-mips64el": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
-
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
-
"cpu": [
-
"mips64el"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-ppc64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
-
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
-
"cpu": [
-
"ppc64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-riscv64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
-
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
-
"cpu": [
-
"riscv64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/linux-s390x": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
-
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
-
"cpu": [
-
"s390x"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
"node_modules/wrangler/node_modules/@esbuild/linux-x64": {
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
···
"optional": true,
"os": [
"linux"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/netbsd-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
-
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"netbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/openbsd-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
-
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"openbsd"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/sunos-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
-
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"sunos"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/win32-arm64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
-
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
-
"cpu": [
-
"arm64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/win32-ia32": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
-
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
-
"cpu": [
-
"ia32"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
-
],
-
"engines": {
-
"node": ">=12"
-
}
-
},
-
"node_modules/wrangler/node_modules/@esbuild/win32-x64": {
-
"version": "0.17.19",
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
-
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
-
"cpu": [
-
"x64"
-
],
-
"dev": true,
-
"optional": true,
-
"os": [
-
"win32"
"engines": {
"node": ">=12"
+11 -11
package.json
···
"@hono/node-server": "^1.14.3",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
-
"@next/bundle-analyzer": "16.0.3",
-
"@next/mdx": "16.0.3",
+
"@next/bundle-analyzer": "^15.3.2",
+
"@next/mdx": "15.3.2",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-popover": "^1.1.15",
···
"linkifyjs": "^4.2.0",
"luxon": "^3.7.2",
"multiformats": "^13.3.2",
-
"next": "16.0.3",
+
"next": "^15.5.3",
"pg": "^8.16.3",
"prosemirror-commands": "^1.5.2",
"prosemirror-inputrules": "^1.4.0",
···
"prosemirror-model": "^1.21.0",
"prosemirror-schema-basic": "^1.2.2",
"prosemirror-state": "^1.4.3",
-
"react": "19.2.0",
+
"react": "^19.1.1",
"react-aria-components": "^1.8.0",
"react-day-picker": "^9.3.0",
-
"react-dom": "19.2.0",
+
"react-dom": "^19.1.1",
"react-use-measure": "^2.1.1",
"redlock": "^5.0.0-beta.2",
"rehype-parse": "^9.0.0",
···
"@types/katex": "^0.16.7",
"@types/luxon": "^3.7.1",
"@types/node": "^22.15.17",
-
"@types/react": "19.2.6",
-
"@types/react-dom": "19.2.3",
+
"@types/react": "19.1.3",
+
"@types/react-dom": "19.1.3",
"@types/uuid": "^10.0.0",
"drizzle-kit": "^0.21.2",
"esbuild": "^0.25.4",
-
"eslint": "^9.39.1",
-
"eslint-config-next": "16.0.3",
+
"eslint": "8.57.0",
+
"eslint-config-next": "^15.5.3",
"postcss": "^8.4.38",
"prettier": "3.2.5",
"supabase": "^1.187.3",
···
"overrides": {
"ajv": "^8.17.1",
"whatwg-url": "^14.0.0",
-
"@types/react": "19.2.6",
-
"@types/react-dom": "19.2.3"
+
"@types/react": "19.1.3",
+
"@types/react-dom": "19.1.3"
}
}
+4 -47
src/notifications.ts
···
export type NotificationData =
| { type: "comment"; comment_uri: string; parent_uri?: string }
-
| { type: "subscribe"; subscription_uri: string }
-
| { type: "quote"; bsky_post_uri: string; document_uri: string };
+
| { type: "subscribe"; subscription_uri: string };
export type HydratedNotification =
| HydratedCommentNotification
-
| HydratedSubscribeNotification
-
| HydratedQuoteNotification;
+
| HydratedSubscribeNotification;
export async function hydrateNotifications(
notifications: NotificationRow[],
): Promise<Array<HydratedNotification>> {
// Call all hydrators in parallel
-
const [commentNotifications, subscribeNotifications, quoteNotifications] = await Promise.all([
+
const [commentNotifications, subscribeNotifications] = await Promise.all([
hydrateCommentNotifications(notifications),
hydrateSubscribeNotifications(notifications),
-
hydrateQuoteNotifications(notifications),
]);
// Combine all hydrated notifications
-
const allHydrated = [...commentNotifications, ...subscribeNotifications, ...quoteNotifications];
+
const allHydrated = [...commentNotifications, ...subscribeNotifications];
// Sort by created_at to maintain order
allHydrated.sort(
···
subscriptionData: subscriptions?.find(
(s) => s.uri === notification.data.subscription_uri,
)!,
-
}));
-
}
-
-
export type HydratedQuoteNotification = Awaited<
-
ReturnType<typeof hydrateQuoteNotifications>
-
>[0];
-
-
async function hydrateQuoteNotifications(notifications: NotificationRow[]) {
-
const quoteNotifications = notifications.filter(
-
(n): n is NotificationRow & { data: ExtractNotificationType<"quote"> } =>
-
(n.data as NotificationData)?.type === "quote",
-
);
-
-
if (quoteNotifications.length === 0) {
-
return [];
-
}
-
-
// Fetch bsky post data and document data
-
const bskyPostUris = quoteNotifications.map((n) => n.data.bsky_post_uri);
-
const documentUris = quoteNotifications.map((n) => n.data.document_uri);
-
-
const { data: bskyPosts } = await supabaseServerClient
-
.from("bsky_posts")
-
.select("*")
-
.in("uri", bskyPostUris);
-
-
const { data: documents } = await supabaseServerClient
-
.from("documents")
-
.select("*, documents_in_publications(publications(*))")
-
.in("uri", documentUris);
-
-
return quoteNotifications.map((notification) => ({
-
id: notification.id,
-
recipient: notification.recipient,
-
created_at: notification.created_at,
-
type: "quote" as const,
-
bsky_post_uri: notification.data.bsky_post_uri,
-
document_uri: notification.data.document_uri,
-
bskyPost: bskyPosts?.find((p) => p.uri === notification.data.bsky_post_uri)!,
-
document: documents?.find((d) => d.uri === notification.data.document_uri)!,
}));
}
-1
src/utils/codeLanguageStorage.ts
···
-
export const LAST_USED_CODE_LANGUAGE_KEY = "lastUsedCodeLanguage";
+3 -3
src/utils/getCurrentDeploymentDomain.ts
···
-
import { headers } from "next/headers";
-
export async function getCurrentDeploymentDomain() {
-
const headersList = await headers();
+
import { headers, type UnsafeUnwrappedHeaders } from "next/headers";
+
export function getCurrentDeploymentDomain() {
+
const headersList = (headers() as unknown as UnsafeUnwrappedHeaders);
const hostname = headersList.get("x-forwarded-host");
let protocol = headersList.get("x-forwarded-proto");
return `${protocol}://${hostname}/`;
-50
src/utils/getPublicationMetadataFromLeafletData.ts
···
-
import { GetLeafletDataReturnType } from "app/api/rpc/[command]/get_leaflet_data";
-
import { Json } from "supabase/database.types";
-
-
export function getPublicationMetadataFromLeafletData(
-
data?: GetLeafletDataReturnType["result"]["data"],
-
) {
-
if (!data) return null;
-
-
let pubData:
-
| {
-
description: string;
-
title: string;
-
leaflet: string;
-
doc: string | null;
-
publications: {
-
identity_did: string;
-
name: string;
-
indexed_at: string;
-
record: Json | null;
-
uri: string;
-
} | null;
-
documents: {
-
data: Json;
-
indexed_at: string;
-
uri: string;
-
} | null;
-
}
-
| undefined
-
| null =
-
data?.leaflets_in_publications?.[0] ||
-
data?.permission_token_rights[0].entity_sets?.permission_tokens?.find(
-
(p) => p.leaflets_in_publications?.length,
-
)?.leaflets_in_publications?.[0];
-
-
// If not found, check for standalone documents
-
let standaloneDoc =
-
data?.leaflets_to_documents?.[0] ||
-
data?.permission_token_rights[0].entity_sets?.permission_tokens.find(
-
(p) => p.leaflets_to_documents?.length,
-
)?.leaflets_to_documents?.[0];
-
if (!pubData && standaloneDoc) {
-
// Transform standalone document data to match the expected format
-
pubData = {
-
...standaloneDoc,
-
publications: null, // No publication for standalone docs
-
doc: standaloneDoc.document,
-
};
-
}
-
return pubData;
-
}
+16
src/utils/isBot.ts
···
+
import { cookies, headers, type UnsafeUnwrappedHeaders } from "next/headers";
+
export function getIsBot() {
+
const userAgent =
+
(headers() as unknown as UnsafeUnwrappedHeaders).get("user-agent") || "";
+
const botPatterns = [
+
/bot/i,
+
/crawler/i,
+
/spider/i,
+
/googlebot/i,
+
/bingbot/i,
+
/yahoo/i,
+
// Add more patterns as needed
+
];
+
+
return botPatterns.some((pattern) => pattern.test(userAgent));
+
}
-15
supabase/migrations/20251122220118_add_cascade_on_update_to_pt_relations.sql
···
-
alter table "public"."permission_token_on_homepage" drop constraint "permission_token_creator_token_fkey";
-
-
alter table "public"."leaflets_in_publications" drop constraint "leaflets_in_publications_leaflet_fkey";
-
-
alter table "public"."leaflets_in_publications" drop column "archived";
-
-
alter table "public"."permission_token_on_homepage" drop column "archived";
-
-
alter table "public"."permission_token_on_homepage" add constraint "permission_token_on_homepage_token_fkey" FOREIGN KEY (token) REFERENCES permission_tokens(id) ON UPDATE CASCADE ON DELETE CASCADE not valid;
-
-
alter table "public"."permission_token_on_homepage" validate constraint "permission_token_on_homepage_token_fkey";
-
-
alter table "public"."leaflets_in_publications" add constraint "leaflets_in_publications_leaflet_fkey" FOREIGN KEY (leaflet) REFERENCES permission_tokens(id) ON UPDATE CASCADE ON DELETE CASCADE not valid;
-
-
alter table "public"."leaflets_in_publications" validate constraint "leaflets_in_publications_leaflet_fkey";
-2
supabase/migrations/20251124214105_add_back_archived_cols.sql
···
-
alter table "public"."permission_token_on_homepage" add column "archived" boolean;
-
alter table "public"."leaflets_in_publications" add column "archived" boolean;
+5 -14
tsconfig.json
···
{
"compilerOptions": {
-
"lib": [
-
"dom",
-
"dom.iterable",
-
"esnext"
-
],
-
"types": [
-
"@cloudflare/workers-types"
-
],
+
"lib": ["dom", "dom.iterable", "esnext"],
+
"types": ["@cloudflare/workers-types"],
"baseUrl": ".",
"allowJs": true,
"skipLibCheck": true,
···
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
-
"jsx": "react-jsx",
+
"jsx": "preserve",
"plugins": [
{
"name": "next"
···
"**/*.js",
"**/*.ts",
"**/*.tsx",
-
"**/*.mdx",
-
".next/dev/types/**/*.ts"
+
"**/*.mdx"
],
-
"exclude": [
-
"node_modules"
-
]
+
"exclude": ["node_modules"]
}