Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat:updates

Iuliia Shnaibeb3c812266b
diff --git a/components/datarooms/settings/introduction-settings.tsx b/components/datarooms/settings/introduction-settings.tsx
new file mode 100644
index 00000000..f17ec60a
--- /dev/null
+++ b/components/datarooms/settings/introduction-settings.tsx
@@ -0,0 +1,748 @@
+"use client";
+
+import { useCallback, useEffect, useRef, useState } from "react";
+
+import { useTeam } from "@/context/team-context";
+import { BookOpenIcon, EyeIcon } from "lucide-react";
+import { toast } from "sonner";
+import { mutate } from "swr";
+
+import { usePlan } from "@/lib/swr/use-billing";
+import { uploadImage } from "@/lib/utils";
+
+import PlanBadge from "@/components/billing/plan-badge";
+import { Button } from "@/components/ui/button";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+import { Label } from "@/components/ui/label";
+import LoadingSpinner from "@/components/ui/loading-spinner";
+import { RichTextEditor } from "@/components/ui/rich-text-editor";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import { Switch } from "@/components/ui/switch";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+
+interface IntroductionSettingsProps {
+ dataroomId: string;
+}
+
+interface FolderItem {
+ id: string;
+ name: string;
+ documents?: { document: { name: string } }[];
+}
+
+interface DocumentItem {
+ document: { name: string };
+}
+
+// Generate TipTap JSON content for introduction based on dataroom structure
+function generateIntroductionContent(
+ dataroomName: string,
+ folders: FolderItem[],
+ rootDocuments: DocumentItem[],
+): any {
+ const content: any[] = [];
+
+ // Overview paragraph (no "Welcome to" repetition)
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: `This data room contains confidential documents and materials prepared for your review. Please take a moment to familiarize yourself with the structure below.`,
+ },
+ ],
+ });
+
+ // What's Inside section
+ content.push({
+ type: "heading",
+ attrs: { level: 2 },
+ content: [{ type: "text", text: "What's Inside" }],
+ });
+
+ // If there are folders, list them
+ if (folders.length > 0) {
+ const folderList = {
+ type: "bulletList",
+ content: folders.slice(0, 8).map((folder) => ({
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: folder.name,
+ marks: [{ type: "bold" }],
+ },
+ ...(folder.documents && folder.documents.length > 0
+ ? [
+ {
+ type: "text",
+ text: ` — ${folder.documents.length} document${folder.documents.length > 1 ? "s" : ""}`,
+ },
+ ]
+ : []),
+ ],
+ },
+ ],
+ })),
+ };
+ content.push(folderList);
+
+ if (folders.length > 8) {
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: `...and ${folders.length - 8} more sections.`,
+ },
+ ],
+ });
+ }
+ } else {
+ // Show placeholder sections if dataroom is empty
+ const placeholderList = {
+ type: "bulletList",
+ content: [
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ { type: "text", text: "Section 1", marks: [{ type: "bold" }] },
+ { type: "text", text: " — Company Overview & Key Documents" },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ { type: "text", text: "Section 2", marks: [{ type: "bold" }] },
+ { type: "text", text: " — Financial Information" },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ { type: "text", text: "Section 3", marks: [{ type: "bold" }] },
+ { type: "text", text: " — Legal & Compliance" },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ { type: "text", text: "Section 4", marks: [{ type: "bold" }] },
+ { type: "text", text: " — Additional Materials" },
+ ],
+ },
+ ],
+ },
+ ],
+ };
+ content.push(placeholderList);
+ }
+
+ // If there are root documents, mention them
+ if (rootDocuments.length > 0) {
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: `There ${rootDocuments.length === 1 ? "is" : "are"} also ${rootDocuments.length} document${rootDocuments.length > 1 ? "s" : ""} available at the root level for quick access.`,
+ },
+ ],
+ });
+ }
+
+ // How to Navigate section
+ content.push({
+ type: "heading",
+ attrs: { level: 2 },
+ content: [{ type: "text", text: "How to Navigate" }],
+ });
+
+ content.push({
+ type: "bulletList",
+ content: [
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Use the sidebar on the left to browse sections and folders",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Click on any document to open and view it",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Use the search function to find specific documents quickly",
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ });
+
+ // Placeholder for navigation screenshot
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "[Add a screenshot of your data room navigation here]",
+ marks: [{ type: "italic" }],
+ },
+ ],
+ });
+
+ // Q&A and Conversations section
+ content.push({
+ type: "heading",
+ attrs: { level: 2 },
+ content: [{ type: "text", text: "Q&A and Conversations" }],
+ });
+
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Have questions about specific documents? You can start a conversation directly within the data room. Use the chat feature to ask questions and get answers from our team.",
+ },
+ ],
+ });
+
+ content.push({
+ type: "bulletList",
+ content: [
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Click the chat icon to start a new conversation",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Ask questions about any document or section",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "listItem",
+ content: [
+ {
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "Receive timely responses from our team",
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ });
+
+ // Placeholder for conversations screenshot
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "[Add a screenshot of the chat/conversation feature here]",
+ marks: [{ type: "italic" }],
+ },
+ ],
+ });
+
+ // Need Help section
+ content.push({
+ type: "heading",
+ attrs: { level: 2 },
+ content: [{ type: "text", text: "Need Help?" }],
+ });
+
+ content.push({
+ type: "paragraph",
+ content: [
+ {
+ type: "text",
+ text: "If you have any questions or need assistance, please reach out to your designated contact. We're here to help you navigate this data room effectively.",
+ },
+ ],
+ });
+
+ return {
+ type: "doc",
+ content,
+ };
+}
+
+// Render TipTap JSON content for preview
+function renderContent(content: any): React.ReactNode {
+ if (!content || !content.content) return null;
+
+ return content.content.map((node: any, index: number) => {
+ if (node.type === "heading") {
+ const level = node.attrs?.level || 1;
+ const text = node.content?.[0]?.text || "";
+ if (level === 1) {
+ return (
+ <h1
+ key={index}
+ className="mb-3 mt-4 text-xl font-bold text-gray-900 first:mt-0"
+ >
+ {text}
+ </h1>
+ );
+ }
+ return (
+ <h2
+ key={index}
+ className="mb-2 mt-4 text-base font-semibold text-gray-800 first:mt-0"
+ >
+ {text}
+ </h2>
+ );
+ } else if (node.type === "paragraph") {
+ return (
+ <p key={index} className="mb-3 text-sm leading-relaxed text-gray-700">
+ {node.content?.map((textNode: any, textIndex: number) => {
+ if (textNode.type === "text") {
+ let text: React.ReactNode = textNode.text;
+ if (textNode.marks) {
+ textNode.marks.forEach((mark: any) => {
+ if (mark.type === "bold") {
+ text = (
+ <strong key={textIndex} className="font-semibold">
+ {text}
+ </strong>
+ );
+ } else if (mark.type === "italic") {
+ text = (
+ <em key={textIndex} className="italic">
+ {text}
+ </em>
+ );
+ }
+ });
+ }
+ return text;
+ } else if (textNode.type === "image") {
+ return (
+ <img
+ key={textIndex}
+ src={textNode.attrs?.src}
+ alt={textNode.attrs?.alt || ""}
+ className="my-2 h-auto max-w-full rounded-md"
+ />
+ );
+ }
+ return null;
+ }) ?? null}
+ </p>
+ );
+ } else if (node.type === "bulletList") {
+ return (
+ <ul key={index} className="mb-3 list-disc pl-5 text-sm text-gray-700">
+ {node.content?.map((item: any, itemIndex: number) => (
+ <li key={itemIndex} className="mb-1">
+ {item.content?.[0]?.content?.map(
+ (textNode: any, textIndex: number) =>
+ textNode.type === "text" ? textNode.text : null,
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+ } else if (node.type === "orderedList") {
+ return (
+ <ol
+ key={index}
+ className="mb-3 list-decimal pl-5 text-sm text-gray-700"
+ >
+ {node.content?.map((item: any, itemIndex: number) => (
+ <li key={itemIndex} className="mb-1">
+ {item.content?.[0]?.content?.map(
+ (textNode: any, textIndex: number) =>
+ textNode.type === "text" ? textNode.text : null,
+ )}
+ </li>
+ ))}
+ </ol>
+ );
+ } else if (node.type === "blockquote") {
+ return (
+ <blockquote
+ key={index}
+ className="mb-3 border-l-4 border-gray-300 pl-4 italic text-gray-600"
+ >
+ {node.content?.map((p: any) =>
+ p.content?.map((textNode: any) =>
+ textNode.type === "text" ? textNode.text : null,
+ ),
+ )}
+ </blockquote>
+ );
+ } else if (node.type === "image") {
+ return (
+ <img
+ key={index}
+ src={node.attrs?.src}
+ alt={node.attrs?.alt || ""}
+ className="my-3 h-auto max-w-full rounded-md"
+ />
+ );
+ }
+ return null;
+ });
+}
+
+export default function IntroductionSettings({
+ dataroomId,
+}: IntroductionSettingsProps) {
+ const teamInfo = useTeam();
+ const teamId = teamInfo?.currentTeam?.id;
+ const { isDataroomsPlus, isTrial } = usePlan();
+
+ const [isFetching, setIsFetching] = useState(true);
+ const [isSaving, setIsSaving] = useState(false);
+ const [introductionEnabled, setIntroductionEnabled] = useState(false);
+ const [introductionContent, setIntroductionContent] = useState<any>({
+ type: "doc",
+ content: [],
+ });
+ const [showPreview, setShowPreview] = useState(false);
+ const [dataroomName, setDataroomName] = useState<string>("Data Room");
+
+ const isFeatureAvailable = isDataroomsPlus || isTrial;
+ const saveTimeoutRef = useRef<NodeJS.Timeout | null>(null);
+ const hasInitialLoadRef = useRef(false);
+
+ // Fetch current introduction settings from dataroom
+ useEffect(() => {
+ const fetchSettings = async () => {
+ if (!teamId) return;
+
+ try {
+ const response = await fetch(
+ `/api/teams/${teamId}/datarooms/${dataroomId}`,
+ );
+ if (response.ok) {
+ const data = await response.json();
+ setIntroductionEnabled(data.introductionEnabled || false);
+ setDataroomName(data.name || "Data Room");
+
+ const existingContent = data.introductionContent;
+ const hasExistingContent =
+ existingContent?.content && existingContent.content.length > 0;
+
+ if (hasExistingContent) {
+ setIntroductionContent(existingContent);
+ } else {
+ // Auto-generate introduction if empty
+ try {
+ const foldersResponse = await fetch(
+ `/api/teams/${teamId}/datarooms/${dataroomId}/folders?include_documents=true`,
+ );
+
+ let folders: FolderItem[] = [];
+ let rootDocuments: DocumentItem[] = [];
+
+ if (foldersResponse.ok) {
+ const foldersData = await foldersResponse.json();
+ folders = foldersData.filter(
+ (item: any) => item.name && !item.document,
+ );
+ rootDocuments = foldersData.filter(
+ (item: any) => item.document,
+ );
+ }
+
+ const generatedContent = generateIntroductionContent(
+ data.name || "Data Room",
+ folders,
+ rootDocuments,
+ );
+ setIntroductionContent(generatedContent);
+ } catch (genError) {
+ console.error("Failed to auto-generate introduction:", genError);
+ setIntroductionContent({ type: "doc", content: [] });
+ }
+ }
+ }
+ } catch (error) {
+ console.error("Failed to fetch introduction settings:", error);
+ } finally {
+ setIsFetching(false);
+ hasInitialLoadRef.current = true;
+ }
+ };
+
+ fetchSettings();
+ }, [teamId, dataroomId]);
+
+ // Auto-save function
+ const saveSettings = useCallback(
+ async (enabled: boolean, content: any) => {
+ if (!teamId || !isFeatureAvailable) return;
+
+ setIsSaving(true);
+ try {
+ const response = await fetch(
+ `/api/teams/${teamId}/datarooms/${dataroomId}`,
+ {
+ method: "PATCH",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ introductionEnabled: enabled,
+ introductionContent: content,
+ }),
+ },
+ );
+
+ if (response.ok) {
+ await mutate(`/api/teams/${teamId}/datarooms/${dataroomId}`);
+ } else {
+ toast.error("Failed to save introduction settings");
+ }
+ } catch (error) {
+ console.error("Failed to save introduction settings:", error);
+ toast.error("Failed to save introduction settings");
+ } finally {
+ setIsSaving(false);
+ }
+ },
+ [teamId, dataroomId, isFeatureAvailable],
+ );
+
+ // Debounced auto-save on content change
+ useEffect(() => {
+ if (!hasInitialLoadRef.current) return;
+
+ if (saveTimeoutRef.current) {
+ clearTimeout(saveTimeoutRef.current);
+ }
+
+ saveTimeoutRef.current = setTimeout(() => {
+ saveSettings(introductionEnabled, introductionContent);
+ }, 1000);
+
+ return () => {
+ if (saveTimeoutRef.current) {
+ clearTimeout(saveTimeoutRef.current);
+ }
+ };
+ }, [introductionContent, introductionEnabled, saveSettings]);
+
+ const handleImageUpload = async (file: File): Promise<string> => {
+ try {
+ const imageUrl = await uploadImage(file, "assets");
+ return imageUrl;
+ } catch (error) {
+ console.error("Failed to upload image:", error);
+ throw new Error("Failed to upload image");
+ }
+ };
+
+ const handleToggle = (checked: boolean) => {
+ if (!isFeatureAvailable) {
+ toast.error("This feature is only available on Data Rooms Plus plan");
+ return;
+ }
+ setIntroductionEnabled(checked);
+ };
+
+ const hasContent =
+ introductionContent?.content && introductionContent.content.length > 0;
+
+ if (isFetching) {
+ return (
+ <Card className="bg-transparent">
+ <CardContent className="flex items-center justify-center py-10">
+ <LoadingSpinner className="h-6 w-6" />
+ </CardContent>
+ </Card>
+ );
+ }
+
+ return (
+ <Card className="bg-transparent">
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ Introduction Page{" "}
+ {!isFeatureAvailable && <PlanBadge plan="data rooms plus" />}
+ {isSaving && (
+ <span className="text-xs font-normal text-muted-foreground">
+ Saving...
+ </span>
+ )}
+ </CardTitle>
+ <CardDescription>
+ Create an introduction page that will be shown to viewers when they
+ first access your data room. Write your message based on the premade
+ template below. You can edit, add and remove sections as you see fit.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-6">
+ {/* Toggle and Preview */}
+ <div className="flex items-center justify-between">
+ <Label
+ htmlFor="introduction-toggle"
+ className="flex items-center gap-2"
+ >
+ <BookOpenIcon className="h-4 w-4" />
+ Show introduction on first visit
+ </Label>
+ <div className="flex items-center gap-2">
+ <TooltipProvider delayDuration={0}>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={() => setShowPreview(true)}
+ disabled={!hasContent}
+ className="h-8 w-8"
+ >
+ <EyeIcon className="h-4 w-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Preview introduction</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ <Switch
+ id="introduction-toggle"
+ checked={introductionEnabled}
+ onCheckedChange={handleToggle}
+ disabled={!isFeatureAvailable}
+ />
+ </div>
+ </div>
+
+ {/* Rich Text Editor */}
+ <div className="space-y-2">
+ <RichTextEditor
+ content={introductionContent}
+ onChange={setIntroductionContent}
+ placeholder="Welcome to our data room! Here you'll find..."
+ onImageUpload={handleImageUpload}
+ />
+ </div>
+
+ {/* Preview Dialog */}
+ <Dialog open={showPreview} onOpenChange={setShowPreview}>
+ <DialogContent className="max-h-[90vh] w-[95vw] max-w-3xl overflow-hidden border-0 p-0 shadow-2xl sm:rounded-2xl">
+ <DialogHeader className="border-b border-gray-100 bg-gray-50 px-4 py-6 dark:border-gray-800 dark:bg-gray-900 sm:px-6">
+ <p className="mb-1 text-xs text-muted-foreground">
+ This is preview
+ </p>
+ <DialogTitle className="text-xl font-semibold">
+ Welcome to {dataroomName}
+ </DialogTitle>
+ </DialogHeader>
+ <ScrollArea className="max-h-[55vh] px-4 py-5 sm:px-6">
+ <div className="prose prose-sm max-w-none dark:prose-invert">
+ {renderContent(introductionContent)}
+ </div>
+ </ScrollArea>
+ <div className="flex justify-end border-t border-gray-100 bg-gray-50 px-4 py-3 dark:border-gray-800 dark:bg-gray-900 sm:px-6 sm:py-4">
+ <Button onClick={() => setShowPreview(false)}>
+ Continue to Data Room
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ </CardContent>
+ <CardFooter className="flex items-center rounded-b-lg border-t bg-muted px-6 py-4">
+ <p className="text-sm text-muted-foreground">
+ This page will appear as a welcome popup when visitors first open the
+ data room. Changes are saved automatically.
+ </p>
+ </CardFooter>
+ </Card>
+ );
+}
diff --git a/components/datarooms/settings/settings-tabs.tsx b/components/datarooms/settings/settings-tabs.tsx
index 1f4d70f5..275f0ded 100644
--- a/components/datarooms/settings/settings-tabs.tsx
+++ b/components/datarooms/settings/settings-tabs.tsx
@@ -1,7 +1,13 @@
import Link from "next/link";
import { useRouter } from "next/router";
-import { BellIcon, CogIcon, DownloadIcon, ShieldIcon } from "lucide-react";
+import {
+ BellIcon,
+ BookOpenIcon,
+ CogIcon,
+ DownloadIcon,
+ ShieldIcon,
+} from "lucide-react";
import { cn } from "@/lib/utils";
@@ -27,6 +33,18 @@ export default function SettingsTabs({ dataroomId }: SettingsTabsProps) {
<CogIcon className="h-4 w-4" />
General
</Link>
+ <Link
+ href={`/datarooms/${dataroomId}/settings/introduction`}
+ className={cn(
+ "flex items-center gap-x-2 rounded-md p-2 text-primary hover:bg-muted",
+ {
+ "bg-muted font-medium": router.pathname.includes("introduction"),
+ },
+ )}
+ >
+ <BookOpenIcon className="h-4 w-4" />
+ Introduction
+ </Link>
<Link
href={`/datarooms/${dataroomId}/settings/notifications`}
className={cn(
diff --git a/components/ui/rich-text-editor.tsx b/components/ui/rich-text-editor.tsx
index c2aaae7b..28ab909c 100644
--- a/components/ui/rich-text-editor.tsx
+++ b/components/ui/rich-text-editor.tsx
@@ -8,6 +8,8 @@ import { EditorContent, useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import {
Bold,
+ Heading1,
+ Heading2,
ImageIcon,
Italic,
List,
@@ -159,6 +161,29 @@ export function RichTextEditor({
<div className="rounded-md border border-input">
{/* Toolbar */}
<div className="flex flex-wrap gap-1 border-b border-input p-2">
+ <Button
+ variant="ghost"
+ size="sm"
+ type="button"
+ onClick={() =>
+ editor.chain().focus().toggleHeading({ level: 1 }).run()
+ }
+ className={editor.isActive("heading", { level: 1 }) ? "bg-muted" : ""}
+ >
+ <Heading1 className="h-4 w-4" />
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ type="button"
+ onClick={() =>
+ editor.chain().focus().toggleHeading({ level: 2 }).run()
+ }
+ className={editor.isActive("heading", { level: 2 }) ? "bg-muted" : ""}
+ >
+ <Heading2 className="h-4 w-4" />
+ </Button>
+ <div className="mx-1 h-6 w-px bg-border" />
<Button
variant="ghost"
size="sm"
diff --git a/components/view/dataroom/introduction-modal.tsx b/components/view/dataroom/introduction-modal.tsx
new file mode 100644
index 00000000..06765620
--- /dev/null
+++ b/components/view/dataroom/introduction-modal.tsx
@@ -0,0 +1,236 @@
+"use client";
+
+import { useEffect, useState } from "react";
+
+import { InfoIcon } from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+
+interface IntroductionModalProps {
+ dataroom: {
+ id?: string;
+ name?: string;
+ introductionEnabled?: boolean;
+ introductionContent?: any;
+ };
+ viewerId?: string;
+}
+
+// Render TipTap JSON content
+function renderContent(content: any): React.ReactNode {
+ if (!content || !content.content) return null;
+
+ return content.content.map((node: any, index: number) => {
+ if (node.type === "heading") {
+ const level = node.attrs?.level || 1;
+ const text = node.content?.[0]?.text || "";
+ if (level === 1) {
+ return (
+ <h1
+ key={index}
+ className="mb-3 mt-4 text-xl font-bold text-gray-900 first:mt-0 dark:text-gray-100"
+ >
+ {text}
+ </h1>
+ );
+ }
+ return (
+ <h2
+ key={index}
+ className="mb-2 mt-4 text-base font-semibold text-gray-800 first:mt-0 dark:text-gray-200"
+ >
+ {text}
+ </h2>
+ );
+ } else if (node.type === "paragraph") {
+ return (
+ <p key={index} className="mb-3 text-sm leading-relaxed text-gray-700">
+ {node.content?.map((textNode: any, textIndex: number) => {
+ if (textNode.type === "text") {
+ let text: React.ReactNode = textNode.text;
+ if (textNode.marks) {
+ textNode.marks.forEach((mark: any) => {
+ if (mark.type === "bold") {
+ text = (
+ <strong key={textIndex} className="font-semibold">
+ {text}
+ </strong>
+ );
+ } else if (mark.type === "italic") {
+ text = (
+ <em key={textIndex} className="italic">
+ {text}
+ </em>
+ );
+ }
+ });
+ }
+ return text;
+ } else if (textNode.type === "image") {
+ return (
+ <img
+ key={textIndex}
+ src={textNode.attrs?.src}
+ alt={textNode.attrs?.alt || ""}
+ className="my-2 h-auto max-w-full rounded-md"
+ />
+ );
+ }
+ return null;
+ }) ?? null}
+ </p>
+ );
+ } else if (node.type === "bulletList") {
+ return (
+ <ul key={index} className="mb-3 list-disc pl-5 text-sm text-gray-700">
+ {node.content?.map((item: any, itemIndex: number) => (
+ <li key={itemIndex} className="mb-1">
+ {item.content?.[0]?.content?.map(
+ (textNode: any, textIndex: number) =>
+ textNode.type === "text" ? textNode.text : null,
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+ } else if (node.type === "orderedList") {
+ return (
+ <ol
+ key={index}
+ className="mb-3 list-decimal pl-5 text-sm text-gray-700"
+ >
+ {node.content?.map((item: any, itemIndex: number) => (
+ <li key={itemIndex} className="mb-1">
+ {item.content?.[0]?.content?.map(
+ (textNode: any, textIndex: number) =>
+ textNode.type === "text" ? textNode.text : null,
+ )}
+ </li>
+ ))}
+ </ol>
+ );
+ } else if (node.type === "blockquote") {
+ return (
+ <blockquote
+ key={index}
+ className="mb-3 border-l-4 border-gray-300 pl-4 italic text-gray-600"
+ >
+ {node.content?.map((p: any, pIndex: number) =>
+ p.content?.map((textNode: any, textIndex: number) =>
+ textNode.type === "text" ? textNode.text : null,
+ ),
+ )}
+ </blockquote>
+ );
+ } else if (node.type === "image") {
+ return (
+ <img
+ key={index}
+ src={node.attrs?.src}
+ alt={node.attrs?.alt || ""}
+ className="my-3 h-auto max-w-full rounded-md"
+ />
+ );
+ }
+ return null;
+ });
+}
+
+export function IntroductionModal({
+ dataroom,
+ viewerId,
+}: IntroductionModalProps) {
+ const [isOpen, setIsOpen] = useState(false);
+
+ const storageKey = `dataroom-intro-seen-${dataroom.id}${viewerId ? `-${viewerId}` : ""}`;
+
+ useEffect(() => {
+ // Check if introduction is enabled and has content
+ if (!dataroom.introductionEnabled || !dataroom.introductionContent) {
+ return;
+ }
+
+ // Check if user has already seen the introduction - show only first time
+ const seen = localStorage.getItem(storageKey);
+ if (!seen) {
+ setIsOpen(true);
+ }
+ }, [dataroom.introductionEnabled, dataroom.introductionContent, storageKey]);
+
+ const handleClose = () => {
+ setIsOpen(false);
+ localStorage.setItem(storageKey, "true");
+ };
+
+ const handleReopen = () => {
+ setIsOpen(true);
+ };
+
+ // Don't render anything if introduction is not enabled or has no content
+ if (!dataroom.introductionEnabled || !dataroom.introductionContent) {
+ return null;
+ }
+
+ const content = dataroom.introductionContent as any;
+ const hasContent = content?.content && content.content.length > 0;
+
+ if (!hasContent) {
+ return null;
+ }
+
+ return (
+ <>
+ {/* Info icon to reopen introduction - always visible */}
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ onClick={handleReopen}
+ className="fixed right-4 top-20 z-50 flex h-10 w-10 items-center justify-center rounded-full bg-white/90 shadow-lg ring-1 ring-gray-200 backdrop-blur-sm transition-all hover:bg-white hover:shadow-xl dark:bg-gray-800/90 dark:ring-gray-700 dark:hover:bg-gray-800"
+ aria-label="View introduction"
+ >
+ <InfoIcon className="h-5 w-5 text-gray-600 dark:text-gray-300" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>View introduction</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ {/* Introduction Modal */}
+ <Dialog open={isOpen} onOpenChange={setIsOpen}>
+ <DialogContent className="max-h-[85vh] max-w-2xl overflow-hidden border-0 p-0 shadow-2xl sm:max-w-xl sm:rounded-2xl md:max-w-2xl">
+ <DialogHeader className="border-b border-gray-100 bg-gray-50 px-6 py-6 dark:border-gray-800 dark:bg-gray-900">
+ <DialogTitle className="text-xl font-semibold">
+ Welcome to {dataroom.name || "Data Room"}
+ </DialogTitle>
+ </DialogHeader>
+ <ScrollArea className="max-h-[60vh] px-6 py-5">
+ <div className="prose prose-sm max-w-none dark:prose-invert">
+ {renderContent(content)}
+ </div>
+ </ScrollArea>
+ <div className="flex justify-end border-t border-gray-100 bg-gray-50 px-6 py-4 dark:border-gray-800 dark:bg-gray-900">
+ <Button onClick={handleClose} size="lg">
+ Continue to Data Room
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+}
diff --git a/components/view/viewer/dataroom-viewer.tsx b/components/view/viewer/dataroom-viewer.tsx
index 020459a9..ba5a6346 100644
--- a/components/view/viewer/dataroom-viewer.tsx
+++ b/components/view/viewer/dataroom-viewer.tsx
@@ -48,6 +48,7 @@ import DocumentCard from "../dataroom/document-card";
import { DocumentUploadModal } from "../dataroom/document-upload-modal";
import FolderCard from "../dataroom/folder-card";
import IndexFileDialog from "../dataroom/index-file-dialog";
+import { IntroductionModal } from "../dataroom/introduction-modal";
import DataroomNav from "../dataroom/nav-dataroom";
const ViewerBreadcrumbItem = ({
@@ -561,6 +562,9 @@ export default function DataroomViewer({
{/* AI Chat Components */}
<ViewerChatPanel />
<ViewerChatToggle />
+
+ {/* Introduction Modal */}
+ <IntroductionModal dataroom={dataroom} viewerId={viewerId} />
</ViewerChatProvider>
);
}
diff --git a/lib/api/links/link-data.ts b/lib/api/links/link-data.ts
index dee8468d..9d67508a 100644
--- a/lib/api/links/link-data.ts
+++ b/lib/api/links/link-data.ts
@@ -206,6 +206,8 @@ export async function fetchDataroomLinkData({
teamId: true,
allowBulkDownload: true,
showLastUpdated: true,
+ introductionEnabled: true,
+ introductionContent: true,
createdAt: true,
documents: {
where:
diff --git a/package-lock.json b/package-lock.json
index de69e800..3156f73d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -333,7 +333,6 @@
"integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.24"
@@ -655,6 +654,7 @@
"resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.978.0.tgz",
"integrity": "sha512-2chs05VbfgRNb5ZEYIwooeHCaL+DjwvrW3ElkslI71ltEqVNdeWvB7hbkLWPPKazV3kjY3H90pLDY8mMqsET+A==",
"license": "Apache-2.0",
+ "peer": true,
"dependencies": {
"@aws-crypto/sha1-browser": "5.2.0",
"@aws-crypto/sha256-browser": "5.2.0",
@@ -1601,6 +1601,7 @@
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz",
"integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
@@ -1705,6 +1706,7 @@
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
+ "peer": true,
"dependencies": {
"@dnd-kit/accessibility": "^3.1.1",
"@dnd-kit/utilities": "^3.2.2",
@@ -2305,6 +2307,7 @@
"version": "1.6.8",
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.8.tgz",
"integrity": "sha512-kx62rP19VZ767Q653wsP1XZCGIirkE09E0QUGNYTM/ttbbQHqcGPdSfWFxUyyNLc/W6aoJRBajOSXhP6GXjC0Q==",
+ "peer": true,
"dependencies": {
"@floating-ui/core": "^1.6.0",
"@floating-ui/utils": "^0.2.5"
@@ -3492,6 +3495,7 @@
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
+ "peer": true,
"engines": {
"node": ">=8.0.0"
}
@@ -3899,6 +3903,7 @@
"integrity": "sha512-M6w1Ql/BeiGoZmhMdAZUXHu5sz5HubyVcKukbLs3l0ELcQb8hTUJxtGEChhv4SVJ0QJlwtLnwOLgIRQhpsm9dw==",
"hasInstallScript": true,
"license": "Apache-2.0",
+ "peer": true,
"engines": {
"node": ">=18.18"
},
@@ -5694,6 +5699,7 @@
"resolved": "https://registry.npmjs.org/@react-email/body/-/body-0.2.1.tgz",
"integrity": "sha512-ljDiQiJDu/Fq//vSIIP0z5Nuvt4+DX1RqGasstChDGJB/14ogd4VdNS9aacoede/ZjGy3o3Qb+cxyS+XgM6SwQ==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5706,6 +5712,7 @@
"resolved": "https://registry.npmjs.org/@react-email/button/-/button-0.2.1.tgz",
"integrity": "sha512-qXyj7RZLE7POy9BMKSoqQ00tOXThjOZSUnI2Yu9i29IHngPlmrNayIWBoVKtElES7OWwypUcpiajwi1mUWx6/A==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5718,6 +5725,7 @@
"resolved": "https://registry.npmjs.org/@react-email/code-block/-/code-block-0.2.1.tgz",
"integrity": "sha512-M3B7JpVH4ytgn83/ujRR1k1DQHvTeABiDM61OvAbjLRPhC/5KLHU5KkzIbbuGIrjWwxAbL1kSQzU8MhLEtSxyw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"prismjs": "^1.30.0"
},
@@ -5733,6 +5741,7 @@
"resolved": "https://registry.npmjs.org/@react-email/code-inline/-/code-inline-0.0.6.tgz",
"integrity": "sha512-jfhebvv3dVsp3OdPgKXnk8+e2pBiDVZejDOBFzBa/IblrAJ9cQDkN6rBD5IyEg8hTOxwbw3iaI/yZFmDmIguIA==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5791,6 +5800,7 @@
"resolved": "https://registry.npmjs.org/@react-email/container/-/container-0.0.16.tgz",
"integrity": "sha512-QWBB56RkkU0AJ9h+qy33gfT5iuZknPC7Un/IjZv9B0QmMIK+WWacc0cH6y2SV5Cv/b99hU94fjEMOOO4enpkbQ==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5827,6 +5837,7 @@
"resolved": "https://registry.npmjs.org/@react-email/heading/-/heading-0.0.16.tgz",
"integrity": "sha512-jmsKnQm1ykpBzw4hCYHwBkt5pW2jScXffPeEH5ZRF5tZeF5b1pvlFTO9han7C0pCkZYo1kEvWiRtx69yfCIwuw==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5839,6 +5850,7 @@
"resolved": "https://registry.npmjs.org/@react-email/hr/-/hr-0.0.12.tgz",
"integrity": "sha512-TwmOmBDibavUQpXBxpmZYi2Iks/yeZOzFYh+di9EltMSnEabH8dMZXrl+pxNXzCgZ2XE8HY7VmUL65Lenfu5PA==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5863,6 +5875,7 @@
"resolved": "https://registry.npmjs.org/@react-email/img/-/img-0.0.12.tgz",
"integrity": "sha512-sRCpEARNVTf3FQhZOC+JTvu5r6ubiYWkT0ucYXg8ctkyi4G8QG+jgYPiNUqVeTLA2STOfmPM/nrk1nb84y6CPQ==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5875,6 +5888,7 @@
"resolved": "https://registry.npmjs.org/@react-email/link/-/link-0.0.13.tgz",
"integrity": "sha512-lkWc/NjOcefRZMkQoSDDbuKBEBDES9aXnFEOuPH845wD3TxPwh+QTf0fStuzjoRLUZWpHnio4z7qGGRYusn/sw==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -5902,6 +5916,7 @@
"resolved": "https://registry.npmjs.org/@react-email/preview/-/preview-0.0.14.tgz",
"integrity": "sha512-aYK8q0IPkBXyMsbpMXgxazwHxYJxTrXrV95GFuu2HbEiIToMwSyUgb8HDFYwPqqfV03/jbwqlsXmFxsOd+VNaw==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -6307,6 +6322,7 @@
"resolved": "https://registry.npmjs.org/@react-email/text/-/text-0.1.6.tgz",
"integrity": "sha512-TYqkioRS45wTR5il3dYk/SbUjjEdhSwh9BtRNB99qNH1pXAwA45H7rAuxehiu8iJQJH0IyIr+6n62gBz9ezmsw==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=20.0.0"
},
@@ -7380,6 +7396,7 @@
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.6.2.tgz",
"integrity": "sha512-XKZYrCVFsyQGF6dXQR73YR222l/76wkKfZ+2/4LCrem5qtcOarmv5pYxjUBG8mRuBPskTTBImSFTeQltJIUNCg==",
"license": "MIT",
+ "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
@@ -7615,6 +7632,7 @@
"resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.6.2.tgz",
"integrity": "sha512-ZLaEHGVq4eL26hZZFE9e7RArk2rEjcVstN/YTRTKElTnLaf58kLTKN3nlgy1PWGwzfWGUuXURBuEBLaq5l6djg==",
"license": "MIT",
+ "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
@@ -7733,6 +7751,7 @@
"resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.6.2.tgz",
"integrity": "sha512-tg7/DgaI6SpkeawryapUtNoBxsJUMJl3+nSjTfTvsaNXed+BHzLPsvmPbzlF9ScrAbVEx8nj6CCkneECYIQ4CQ==",
"license": "MIT",
+ "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
@@ -7747,6 +7766,7 @@
"resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.6.2.tgz",
"integrity": "sha512-g+NXjqjbj6NfHOMl22uNWVYIu8oCq7RFfbnpohPMsSKJLaHYE8mJR++7T6P5R9FoqhIFdwizg1jTpwRU5CHqXQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"prosemirror-changeset": "^2.3.0",
"prosemirror-collab": "^1.3.1",
@@ -8326,6 +8346,7 @@
"version": "18.3.18",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.18.tgz",
"integrity": "sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==",
+ "peer": true,
"dependencies": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
@@ -8336,6 +8357,7 @@
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz",
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
"license": "MIT",
+ "peer": true,
"peerDependencies": {
"@types/react": "^18.0.0"
}
@@ -8416,6 +8438,7 @@
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.7.0.tgz",
"integrity": "sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==",
+ "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.7.0",
"@typescript-eslint/types": "8.7.0",
@@ -8621,6 +8644,7 @@
"resolved": "https://registry.npmjs.org/@upstash/redis/-/redis-1.36.1.tgz",
"integrity": "sha512-N6SjDcgXdOcTAF+7uNoY69o7hCspe9BcA7YjQdxVu5d25avljTwyLaHBW3krWjrP0FfocgMk94qyVtQbeDp39A==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"uncrypto": "^0.1.3"
}
@@ -8705,7 +8729,6 @@
"integrity": "sha512-gKp0zGoLnMYtw4uS/SJRRO7rsVggLjvot3mcctlMXunYNsX+aRJDqqw/lV5/gHK91nvaAAlWFgdVl020AW1Prg==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@babel/parser": "^7.24.7",
"@vue/shared": "3.4.35",
@@ -8719,8 +8742,7 @@
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true,
- "optional": true,
- "peer": true
+ "optional": true
},
"node_modules/@vue/compiler-dom": {
"version": "3.4.35",
@@ -8728,7 +8750,6 @@
"integrity": "sha512-pWIZRL76/oE/VMhdv/ovZfmuooEni6JPG1BFe7oLk5DZRo/ImydXijoZl/4kh2406boRQ7lxTYzbZEEXEhj9NQ==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@vue/compiler-core": "3.4.35",
"@vue/shared": "3.4.35"
@@ -8740,7 +8761,6 @@
"integrity": "sha512-xacnRS/h/FCsjsMfxBkzjoNxyxEyKyZfBch/P4vkLRvYJwe5ChXmZZrj8Dsed/752H2Q3JE8kYu9Uyha9J6PgA==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@babel/parser": "^7.24.7",
"@vue/compiler-core": "3.4.35",
@@ -8758,8 +8778,7 @@
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true,
- "optional": true,
- "peer": true
+ "optional": true
},
"node_modules/@vue/compiler-ssr": {
"version": "3.4.35",
@@ -8767,7 +8786,6 @@
"integrity": "sha512-7iynB+0KB1AAJKk/biENTV5cRGHRdbdaD7Mx3nWcm1W8bVD6QmnH3B4AHhQQ1qZHhqFwzEzMwiytXm3PX1e60A==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@vue/compiler-dom": "3.4.35",
"@vue/shared": "3.4.35"
@@ -8778,8 +8796,7 @@
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.35.tgz",
"integrity": "sha512-hvuhBYYDe+b1G8KHxsQ0diDqDMA8D9laxWZhNAjE83VZb5UDaXl9Xnz7cGdDSyiHM90qqI/CyGMcpBpiDy6VVQ==",
"dev": true,
- "optional": true,
- "peer": true
+ "optional": true
},
"node_modules/@yarnpkg/lockfile": {
"version": "1.1.0",
@@ -8837,6 +8854,7 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"license": "MIT",
+ "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -9601,6 +9619,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -10093,7 +10112,6 @@
"integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15",
"@types/estree": "^1.0.1",
@@ -10555,6 +10573,7 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
"integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
+ "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/kossnocorp"
@@ -10970,7 +10989,8 @@
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz",
"integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==",
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/embla-carousel-react": {
"version": "8.6.0",
@@ -11307,6 +11327,7 @@
"integrity": "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==",
"hasInstallScript": true,
"license": "MIT",
+ "peer": true,
"bin": {
"esbuild": "bin/esbuild"
},
@@ -11379,6 +11400,7 @@
"version": "8.57.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
+ "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
@@ -11526,6 +11548,7 @@
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz",
"integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==",
+ "peer": true,
"dependencies": {
"array-includes": "^3.1.7",
"array.prototype.findlastindex": "^1.2.3",
@@ -11838,7 +11861,6 @@
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@types/estree": "^1.0.0"
}
@@ -13725,7 +13747,6 @@
"integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@types/estree": "*"
}
@@ -14207,6 +14228,7 @@
"https://opencollective.com/katex",
"https://github.com/sponsors/katex"
],
+ "peer": true,
"dependencies": {
"commander": "^8.3.0"
},
@@ -14407,8 +14429,7 @@
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
"dev": true,
- "optional": true,
- "peer": true
+ "optional": true
},
"node_modules/locate-path": {
"version": "6.0.0",
@@ -14666,7 +14687,6 @@
"integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0"
}
@@ -15974,6 +15994,7 @@
"resolved": "https://registry.npmjs.org/next/-/next-14.2.35.tgz",
"integrity": "sha512-KhYd2Hjt/O1/1aZVX3dCwGXM1QmOV4eNM2UTacK5gipDdPN/oHHK/4oVGy7X8GMfPMsUTUEmGlsy0EY1YGAkig==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@next/env": "14.2.35",
"@swc/helpers": "0.5.5",
@@ -16024,6 +16045,7 @@
"resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.13.tgz",
"integrity": "sha512-sgObCfcfL7BzIK76SS5TnQtc3yo2Oifp/yIpfv6fMfeBOiBJkDWF3A2y9+yqnmJ4JKc2C+nMjSjmgDeTwgN1rQ==",
"license": "ISC",
+ "peer": true,
"dependencies": {
"@babel/runtime": "^7.20.13",
"@panva/hkdf": "^1.0.2",
@@ -16177,6 +16199,7 @@
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.13.tgz",
"integrity": "sha512-PNDFSJdP+KFgdsG3ZzMXCgquO7I6McjY2vlqILjtJd0hy8wEvtugS9xKRF2NWlPNGxvLCXlTNIae4serI7dinw==",
"license": "MIT-0",
+ "peer": true,
"engines": {
"node": ">=6.0.0"
}
@@ -17077,7 +17100,6 @@
"integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^3.0.0",
@@ -17184,6 +17206,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -17595,6 +17618,7 @@
"resolved": "https://registry.npmjs.org/preact/-/preact-10.28.2.tgz",
"integrity": "sha512-lbteaWGzGHdlIuiJ0l2Jq454m6kcpI1zNje6d8MlGAFlYvP2GO4ibnat7P74Esfz4sPTdM6UxtTwh/d3pwM9JA==",
"license": "MIT",
+ "peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
@@ -17624,6 +17648,7 @@
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz",
"integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
"license": "MIT",
+ "peer": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
@@ -17725,6 +17750,7 @@
"devOptional": true,
"hasInstallScript": true,
"license": "Apache-2.0",
+ "peer": true,
"dependencies": {
"@prisma/config": "6.5.0",
"@prisma/engines": "6.5.0"
@@ -17929,6 +17955,7 @@
"resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.3.tgz",
"integrity": "sha512-dY2HdaNXlARknJbrManZ1WyUtos+AP97AmvqdOQtWtrrC5g4mohVX5DTi9rXNFSk09eczLq9GuNTtq3EfMeMGA==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"orderedmap": "^2.0.0"
}
@@ -17958,6 +17985,7 @@
"resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.3.tgz",
"integrity": "sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"prosemirror-model": "^1.0.0",
"prosemirror-transform": "^1.0.0",
@@ -18018,6 +18046,7 @@
"resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.41.0.tgz",
"integrity": "sha512-FatMIIl0vRHMcNc3sPy3cMw5MMyWuO1nWQxqvYpJvXAruucGvmQ2tyyjT2/Lbok77T9a/qZqBVCq4sj43V2ihw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"prosemirror-model": "^1.20.0",
"prosemirror-state": "^1.0.0",
@@ -18131,6 +18160,7 @@
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
+ "peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
},
@@ -18165,6 +18195,7 @@
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
+ "peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
@@ -18387,6 +18418,7 @@
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.71.1.tgz",
"integrity": "sha512-9SUJKCGKo8HUSsCO+y0CtqkqI5nNuaDqTxyqPsZPqIwudpj4rCrAz/jZV+jn57bx5gtZKOh3neQu94DXMc+w5w==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=18.0.0"
},
@@ -20215,7 +20247,6 @@
"integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"@ampproject/remapping": "^2.2.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
@@ -20242,7 +20273,6 @@
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"dequal": "^2.0.3"
}
@@ -20253,7 +20283,6 @@
"integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
"dev": true,
"optional": true,
- "peer": true,
"engines": {
"node": ">= 0.4"
}
@@ -20264,7 +20293,6 @@
"integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
"dev": true,
"optional": true,
- "peer": true,
"dependencies": {
"mdn-data": "2.0.30",
"source-map-js": "^1.0.1"
@@ -20278,8 +20306,7 @@
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
"dev": true,
- "optional": true,
- "peer": true
+ "optional": true
},
"node_modules/svix": {
"version": "1.84.1",
@@ -20357,6 +20384,7 @@
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz",
"integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"arg": "^5.0.2",
@@ -20578,6 +20606,7 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
"dev": true,
+ "peer": true,
"engines": {
"node": ">=12"
},
@@ -20847,6 +20876,7 @@
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
"license": "Apache-2.0",
+ "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -21077,6 +21107,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz",
"integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -21869,6 +21900,7 @@
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
"license": "MIT",
+ "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/branding.ts b/pages/api/teams/[teamId]/datarooms/[id]/branding.ts
index 7a4d7aa7..6bc462d1 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/branding.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/branding.ts
@@ -142,7 +142,7 @@ export default async function handle(
return res.status(204).end();
} else {
- // We only allow GET and DELETE requests
+ // We only allow GET, POST, PUT, DELETE requests
res.setHeader("Allow", ["GET", "POST", "PUT", "DELETE"]);
return res.status(405).end(`Method ${req.method} Not Allowed`);
}
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
index ad30e543..ed0c78c7 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
@@ -117,6 +117,8 @@ export default async function handle(
showLastUpdated,
tags,
agentsEnabled,
+ introductionEnabled,
+ introductionContent,
} = req.body as {
name?: string;
internalName?: string | null;
@@ -126,6 +128,8 @@ export default async function handle(
showLastUpdated?: boolean;
tags?: string[];
agentsEnabled?: boolean;
+ introductionEnabled?: boolean;
+ introductionContent?: any;
};
const featureFlags = await getFeatureFlags({ teamId: team.id });
@@ -172,6 +176,12 @@ export default async function handle(
...(typeof agentsEnabled === "boolean" && {
agentsEnabled,
}),
+ ...(typeof introductionEnabled === "boolean" && {
+ introductionEnabled,
+ }),
+ ...(introductionContent !== undefined && {
+ introductionContent,
+ }),
},
});
diff --git a/pages/datarooms/[id]/settings/introduction.tsx b/pages/datarooms/[id]/settings/introduction.tsx
new file mode 100644
index 00000000..fab9fa61
--- /dev/null
+++ b/pages/datarooms/[id]/settings/introduction.tsx
@@ -0,0 +1,43 @@
+import { useDataroom } from "@/lib/swr/use-dataroom";
+
+import { DataroomHeader } from "@/components/datarooms/dataroom-header";
+import { DataroomNavigation } from "@/components/datarooms/dataroom-navigation";
+import IntroductionSettings from "@/components/datarooms/settings/introduction-settings";
+import SettingsTabs from "@/components/datarooms/settings/settings-tabs";
+import AppLayout from "@/components/layouts/app";
+
+export default function Introduction() {
+ const { dataroom } = useDataroom();
+
+ if (!dataroom) {
+ return <div>Loading...</div>;
+ }
+
+ return (
+ <AppLayout>
+ <main className="relative mx-2 mb-10 mt-4 space-y-8 overflow-hidden px-1 sm:mx-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">
+ <header>
+ <DataroomHeader
+ title={dataroom.name}
+ description={dataroom.pId}
+ internalName={dataroom.internalName}
+ actions={[]}
+ />
+
+ <DataroomNavigation dataroomId={dataroom.id} />
+ </header>
+
+ {/* Settings */}
+ <div className="mx-auto grid w-full gap-2">
+ <h1 className="text-2xl font-semibold">Settings</h1>
+ </div>
+ <div className="mx-auto grid w-full items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]">
+ <SettingsTabs dataroomId={dataroom.id} />
+ <div className="grid gap-6">
+ <IntroductionSettings dataroomId={dataroom.id} />
+ </div>
+ </div>
+ </main>
+ </AppLayout>
+ );
+}
diff --git a/prisma/schema/dataroom.prisma b/prisma/schema/dataroom.prisma
index da3c71cf..554606d1 100644
--- a/prisma/schema/dataroom.prisma
+++ b/prisma/schema/dataroom.prisma
@@ -46,6 +46,10 @@ model Dataroom {
// display settings
showLastUpdated Boolean @default(true) // Show/hide last updated date in dataroom view
+ // Introduction page settings
+ introductionEnabled Boolean @default(false) // Toggle to show introduction on first visit
+ introductionContent Json? // TipTap JSON content for the introduction page
+
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt