Skip to content

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

billing update and new plan

Iuliia Shnaid84c418de712
diff --git a/components/billing/upgrade-plan-modal.tsx b/components/billing/upgrade-plan-modal.tsx
index fea30f51..e32d8507 100644
--- a/components/billing/upgrade-plan-modal.tsx
+++ b/components/billing/upgrade-plan-modal.tsx
@@ -5,11 +5,22 @@ import { useEffect, useMemo, useState } from "react";
import React from "react";
import { useTeam } from "@/context/team-context";
-import { CheckIcon } from "lucide-react";
+import {
+ CheckIcon,
+ MinusCircleIcon,
+ PlusCircleIcon,
+ Users2Icon,
+} from "lucide-react";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import { Switch } from "@/components/ui/switch";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
import { useAnalytics } from "@/lib/analytics";
import { getStripe } from "@/lib/stripe/client";
@@ -17,6 +28,34 @@ import { PLANS } from "@/lib/stripe/utils";
import { usePlan } from "@/lib/swr/use-billing";
import { capitalize } from "@/lib/utils";
+// Add the PLAN_PRICING constant
+const PLAN_PRICING = {
+ Pro: {
+ extraUserPrice: {
+ monthly: "€19/month per additional user",
+ yearly: "€14/month per additional user",
+ },
+ },
+ Business: {
+ extraUserPrice: {
+ monthly: "€26/month per additional user",
+ yearly: "€19/month per additional user",
+ },
+ },
+ "Data Rooms": {
+ extraUserPrice: {
+ monthly: "€49/month per additional user",
+ yearly: "€33/month per additional user",
+ },
+ },
+ "Data Rooms Plus": {
+ extraUserPrice: {
+ monthly: "€79/month per additional user",
+ yearly: "€49/month per additional user",
+ },
+ },
+};
+
export function UpgradePlanModal({
clickedPlan,
trigger,
@@ -24,7 +63,7 @@ export function UpgradePlanModal({
setOpen,
children,
}: {
- clickedPlan: "Pro" | "Business" | "Data Rooms";
+ clickedPlan: "Pro" | "Business" | "Data Rooms" | "Data Rooms Plus";
trigger?: string;
open?: boolean;
setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -37,18 +76,44 @@ export function UpgradePlanModal({
const teamInfo = useTeam();
const { plan: teamPlan, trial, isCustomer, isOldAccount } = usePlan();
const analytics = useAnalytics();
+ const [showDataRoomsPlus, setShowDataRoomsPlus] = useState(false);
const planFeatures = useMemo(
() => ({
Pro: {
featureIntro: "Everything in Free, plus:",
features: [
- "2 users included",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <span>2 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING.Pro.extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
"100 documents",
"Unlimited links",
- "Custom branding",
+ <div key="custom-domain" className="flex items-center gap-x-3">
+ <span>
+ Custom domain <b>for documents</b>
+ </span>
+ </div>,
"Folder organization",
+ "Large file uploads",
"Require email verification",
+ "Video sharing and analytics",
"More file types: pppt, docx, excel",
"Papermark branding removed",
"1-year analytics retention",
@@ -57,41 +122,173 @@ export function UpgradePlanModal({
Business: {
featureIntro: "Everything in Pro, plus:",
features: [
- "3 users included",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <span>3 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING.Business.extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
"1 dataroom",
- <span key="custom-dataroom">
- Custom domain <b>for documents</b>
- </span>,
+ "1000 documents",
+ <div key="custom-domain" className="flex items-center gap-x-3">
+ <span>
+ Custom domain <b>for documents</b>
+ </span>
+ </div>,
"Unlimited folder levels",
- "Unlimited documents",
- "Large file uploads",
"Multi-file sharing",
+ "Screen shield/fence protection",
"Allow/Block list",
"Dataroom branding",
- "More file types: dmg (cad)",
+ "Webhooks",
+ "More file types: dwg, kml, zip",
"2-year analytics retention",
],
},
"Data Rooms": {
featureIntro: "Everything in Business, plus:",
+ features: showDataRoomsPlus
+ ? [
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <span>5 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>
+ {PLAN_PRICING["Data Rooms Plus"].extraUserPrice[period]}
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
+ <div key="storage" className="flex items-center gap-x-3">
+ <span>
+ <b>Unlimited</b> encrypted storage
+ </span>
+ </div>,
+ "No file size limit",
+ <div key="custom-domain" className="flex items-center gap-x-3">
+ <span>
+ Unlimited custom domains <b>for data rooms</b>
+ </span>
+ </div>,
+ "Q&A module with custom permissions",
+ "Automatic file indexing",
+ "Assign users to particular data room",
+ "Email invite viewers directly from Papermark",
+ "White-labeling",
+ "Dedicated account manager",
+ "3-year analytics retention",
+ ]
+ : [
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <span>3 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING["Data Rooms"].extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
+ "Unlimited data rooms",
+ "Unlimited documents",
+ <div key="custom-domain" className="flex items-center gap-x-3">
+ <span>
+ Custom domain <b>for data rooms</b>
+ </span>
+ </div>,
+ "Data rooms analytics",
+ "NDA agreements",
+ "Dynamic watermark",
+ "Granular user/group permissions",
+ "Audit log for viewers",
+ "24h priority support",
+ "Custom onboarding",
+ "2-year analytics retention",
+ ],
+ },
+ "Data Rooms Plus": {
+ featureIntro: "Everything in Data Rooms, plus:",
features: [
- "3 users included",
- "Unlimited data rooms",
- <span key="custom-dataroom">
- Custom domain <b>for data rooms</b>
- </span>,
- "Advanced data rooms analytics",
- "NDA agreements",
- "Dynamic Watermark",
- "Granular user/group permissions",
- "Invite users directly from Papermark",
- "Audit log",
- "24h priority support",
- "Custom onboarding ",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <span>5 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>
+ {PLAN_PRICING["Data Rooms Plus"].extraUserPrice[period]}
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
+ <div key="storage" className="flex items-center gap-x-3">
+ <span>
+ <b>Unlimited</b> encrypted storage
+ </span>
+ </div>,
+ "No file size limit",
+ <div key="custom-domain" className="flex items-center gap-x-3">
+ <span>
+ Unlimited custom domains <b>for data rooms</b>
+ </span>
+ </div>,
+ "Q&A module with custom permissions",
+ "Automatic file indexing",
+ "Assign users to particular data room",
+ "Email invite viewers directly from Papermark",
+ "White-labeling",
+ "Dedicated account manager",
+ "3-year analytics retention",
],
},
}),
- [],
+ [period, showDataRoomsPlus],
);
const plansToShow = useMemo(() => {
@@ -101,15 +298,17 @@ export function UpgradePlanModal({
case "Business":
return ["Business", "Data Rooms"];
case "Data Rooms":
- return ["Data Rooms"];
+ return ["Data Rooms", "Data Rooms Plus"];
+ case "Data Rooms Plus":
+ return ["Data Rooms", "Data Rooms Plus"];
default:
return ["Pro", "Business"];
}
}, [clickedPlan]);
- // Add this new constant to determine if only Data Rooms plan is shown
- const isOnlyDataRooms = useMemo(
- () => plansToShow.length === 1 && plansToShow[0] === "Data Rooms",
+ // Update this to check for Data Rooms plans
+ const isDataRoomsPlans = useMemo(
+ () => plansToShow.every((plan) => plan.includes("Data Rooms")),
[plansToShow],
);
@@ -137,14 +336,22 @@ export function UpgradePlanModal({
? React.cloneElement(children, { onClick: handleUpgradeClick })
: children;
+ // Add this helper function to get the correct plan name for button and pricing
+ const getEffectivePlanName = (planOption: string) => {
+ if (planOption === "Data Rooms" && showDataRoomsPlus) {
+ return "Data Rooms Plus";
+ }
+ return planOption;
+ };
+
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>{buttonChild}</DialogTrigger>
<DialogContent
className="max-h-[90vh] overflow-y-auto bg-gray-50 text-foreground dark:bg-gray-900"
style={{
- width: isOnlyDataRooms ? "550px" : "90vw", // Adjust width based on plans shown
- maxWidth: isOnlyDataRooms ? "550px" : "900px", // Adjust maxWidth based on plans shown
+ width: "90vw",
+ maxWidth: "900px",
}}
>
<div className="flex items-center justify-center">
@@ -156,7 +363,7 @@ export function UpgradePlanModal({
}
/>
<span className="ml-2 text-sm">
- Annually <span className="text-[#fb7a00]">(Save up to 25%)</span>
+ Annually <span className="text-[#fb7a00]">(Save up to 35%)</span>
</span>
</div>
@@ -165,33 +372,64 @@ export function UpgradePlanModal({
<div
key={planOption}
className={`relative flex flex-col rounded-lg border ${
- planOption === "Business"
+ planOption === "Business" && plansToShow.includes("Data Rooms")
? "border-[#fb7a00]"
- : "border-gray-200"
- } bg-white p-6 shadow-sm ${
- isOnlyDataRooms
- ? "mx-auto w-[450px] max-w-full md:col-span-2"
- : ""
- } dark:bg-gray-900`}
+ : planOption === "Data Rooms Plus" &&
+ plansToShow.includes("Data Rooms")
+ ? "border-gray-900"
+ : "border-gray-200"
+ } bg-white p-6 shadow-sm dark:bg-gray-900`}
>
<div className="mb-4 border-b border-gray-200 pb-2">
- <h3 className="text-balance text-xl font-medium text-gray-900 dark:text-white">
- Papermark {planOption}
- </h3>
- {planOption === "Business" && (
- <span className="absolute right-2 top-2 rounded bg-[#fb7a00] px-2 py-1 text-xs text-white">
- Most popular
+ <div className="flex items-center justify-between">
+ <h3 className="text-balance text-xl font-medium text-gray-900 dark:text-white">
+ Papermark{" "}
+ {showDataRoomsPlus &&
+ planOption === "Data Rooms" &&
+ plansToShow.includes("Business")
+ ? "Data Rooms Plus"
+ : planOption}
+ </h3>
+ {planOption === "Data Rooms" &&
+ plansToShow.includes("Business") && (
+ <button
+ onClick={() => setShowDataRoomsPlus(!showDataRoomsPlus)}
+ className="focus:outline-none"
+ >
+ {showDataRoomsPlus ? (
+ <MinusCircleIcon className="h-6 w-6 text-[#fb7a00] hover:text-[#fb7a00]/90" />
+ ) : (
+ <PlusCircleIcon className="h-6 w-6 text-[#fb7a00] hover:text-[#fb7a00]/90" />
+ )}
+ </button>
+ )}
+ </div>
+ {((planOption === "Business" &&
+ plansToShow.includes("Data Rooms")) ||
+ (planOption === "Data Rooms Plus" &&
+ plansToShow.includes("Data Rooms"))) && (
+ <span
+ className={`absolute right-2 top-2 rounded px-2 py-1 text-xs text-white ${
+ planOption === "Data Rooms Plus"
+ ? "bg-gray-900"
+ : "bg-[#fb7a00]"
+ }`}
+ >
+ {planOption === "Data Rooms Plus"
+ ? "Best deal"
+ : "Most popular"}
</span>
)}
</div>
- {/* Add pricing information here */}
+ {/* Update pricing section */}
<div className="mb-2">
<span className="text-balance text-4xl font-medium tabular-nums text-gray-900 dark:text-white">
€
{
- PLANS.find((p) => p.name === planOption)?.price[period]
- .amount
+ PLANS.find(
+ (p) => p.name === getEffectivePlanName(planOption),
+ )?.price[period].amount
}
</span>
<span className="text-gray-500 dark:text-white/75">/month</span>
@@ -223,10 +461,10 @@ export function UpgradePlanModal({
? "bg-[#fb7a00]/90 text-white hover:bg-[#fb7a00]"
: "bg-gray-800 text-white hover:bg-gray-900 hover:text-white dark:hover:bg-gray-700/80"
}`}
- loading={selectedPlan === planOption} // Show loading only for the clicked plan
+ loading={selectedPlan === planOption}
disabled={selectedPlan !== null}
onClick={() => {
- setSelectedPlan(planOption); // Set the clicked plan
+ setSelectedPlan(planOption);
if (isCustomer && teamPlan !== "free") {
fetch(
`/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,
@@ -240,11 +478,19 @@ export function UpgradePlanModal({
})
.catch((err) => {
alert(err);
- setSelectedPlan(null); // Reset loading state on error
+ setSelectedPlan(null);
});
} else {
fetch(
- `/api/teams/${teamInfo?.currentTeam?.id}/billing/upgrade?priceId=${PLANS.find((p) => p.name === planOption)!.price[period].priceIds[process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? "production" : "test"][isOldAccount ? "old" : "new"]}`,
+ `/api/teams/${teamInfo?.currentTeam?.id}/billing/upgrade?priceId=${
+ PLANS.find(
+ (p) => p.name === getEffectivePlanName(planOption),
+ )!.price[period].priceIds[
+ process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
+ ? "production"
+ : "test"
+ ][isOldAccount ? "old" : "new"]
+ }`,
{
method: "POST",
headers: {
@@ -260,14 +506,14 @@ export function UpgradePlanModal({
})
.catch((err) => {
alert(err);
- setSelectedPlan(null); // Reset loading state on error
+ setSelectedPlan(null);
});
}
}}
>
{selectedPlan === planOption
? "Redirecting to Stripe..."
- : `Upgrade to ${planOption} ${capitalize(period)}`}
+ : `Upgrade to ${getEffectivePlanName(planOption)} ${capitalize(period)}`}
</Button>
</div>
</div>
@@ -278,7 +524,8 @@ export function UpgradePlanModal({
href="/settings/upgrade"
className="text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline"
>
- See all plans
+ See all plans. All plans include unlimited viewers and page by page
+ document analytics.
</Link>
</div>
</DialogContent>
diff --git a/components/documents/add-document-modal.tsx b/components/documents/add-document-modal.tsx
index 76f1e786..d187909b 100644
--- a/components/documents/add-document-modal.tsx
+++ b/components/documents/add-document-modal.tsx
@@ -57,6 +57,7 @@ export function AddDocumentModal({
const [isOpen, setIsOpen] = useState<boolean | undefined>(undefined);
const [currentFile, setCurrentFile] = useState<File | null>(null);
const [notionLink, setNotionLink] = useState<string | null>(null);
+ const [figmaLink, setFigmaLink] = useState<string | null>(null);
const teamInfo = useTeam();
const { canAddDocuments } = useLimits();
const { plan, trial } = usePlan();
@@ -398,9 +399,90 @@ export function AddDocumentModal({
}
};
+ const handleFigmaUpload = async (
+ event: FormEvent<HTMLFormElement>,
+ ): Promise<void> => {
+ event.preventDefault();
+
+ if (!canAddDocuments) {
+ toast.error("You have reached the maximum number of documents.");
+ return;
+ }
+
+ // Validate Figma URL
+ const isFigmaURL = figmaLink?.includes("figma.com");
+ if (!figmaLink || !isFigmaURL) {
+ toast.error("Please enter a valid Figma presentation link.");
+ return;
+ }
+
+ try {
+ setUploading(true);
+
+ const response = await fetch(
+ `/api/teams/${teamInfo?.currentTeam?.id}/documents`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ name: "Figma Presentation",
+ url: figmaLink,
+ numPages: 1,
+ type: "figma",
+ createLink: false,
+ folderPathName: currentFolderPath?.join("/"),
+ }),
+ },
+ );
+
+ if (response) {
+ const document = await response.json();
+
+ if (isDataroom && dataroomId) {
+ await addDocumentToDataroom({
+ documentId: document.id,
+ folderPathName: currentFolderPath?.join("/"),
+ });
+
+ plausible("documentUploaded");
+ plausible("figmaDocumentUploaded");
+ analytics.capture("Document Added", {
+ documentId: document.id,
+ name: document.name,
+ path: router.asPath,
+ type: "figma",
+ teamId: teamId,
+ dataroomId: dataroomId,
+ $set: {
+ teamId: teamId,
+ teamPlan: plan,
+ },
+ });
+
+ return;
+ }
+
+ toast.success("Figma presentation processed. Redirecting to document page...");
+ router.push("/documents/" + document.id);
+ }
+ } catch (error) {
+ setUploading(false);
+ toast.error(
+ "Oops! Can't access the Figma presentation. Please check if it's publicly accessible."
+ );
+ console.error("An error occurred while processing the Figma link: ", error);
+ } finally {
+ setUploading(false);
+ setIsOpen(false);
+ }
+ };
+
const clearModelStates = () => {
currentFile !== null && setCurrentFile(null);
notionLink !== null && setNotionLink(null);
+ figmaLink !== null && setFigmaLink(null);
setIsOpen(!isOpen);
setAddDocumentModalOpen && setAddDocumentModalOpen(!isOpen);
};
@@ -432,9 +514,10 @@ export function AddDocumentModal({
>
<Tabs defaultValue="document">
{!newVersion ? (
- <TabsList className="grid w-full grid-cols-2">
+ <TabsList className="grid w-full grid-cols-3">
<TabsTrigger value="document">Document</TabsTrigger>
<TabsTrigger value="notion">Notion Page</TabsTrigger>
+ <TabsTrigger value="figma">Figma Deck</TabsTrigger>
</TabsList>
) : (
<TabsList className="grid w-full grid-cols-1">
@@ -566,6 +649,51 @@ export function AddDocumentModal({
</Card>
</TabsContent>
)}
+ <TabsContent value="figma">
+ <Card>
+ <CardHeader className="space-y-3">
+ <CardTitle>Share a Figma Presentation</CardTitle>
+ <CardDescription>
+ Share your Figma presentation deck. Make sure your presentation is publicly accessible.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-2">
+ <form
+ encType="multipart/form-data"
+ onSubmit={handleFigmaUpload}
+ className="flex flex-col"
+ >
+ <div className="space-y-1 pb-8">
+ <Label htmlFor="figma-link">Figma Presentation Link</Label>
+ <div className="mt-2">
+ <input
+ type="text"
+ name="figma-link"
+ id="figma-link"
+ placeholder="figma.com/..."
+ className="flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
+ value={figmaLink || ""}
+ onChange={(e) => setFigmaLink(e.target.value)}
+ />
+ </div>
+ <small className="text-xs text-muted-foreground">
+ Your Figma presentation needs to be publicly accessible.
+ </small>
+ </div>
+ <div className="flex justify-center">
+ <Button
+ type="submit"
+ className="w-full lg:w-1/2"
+ disabled={uploading || !figmaLink}
+ loading={uploading}
+ >
+ {uploading ? "Processing..." : "Share Figma Deck"}
+ </Button>
+ </div>
+ </form>
+ </CardContent>
+ </Card>
+ </TabsContent>
</Tabs>
</DialogContent>
</Dialog>
diff --git a/lib/stripe/utils.ts b/lib/stripe/utils.ts
index 05ec486b..56d00a08 100644
--- a/lib/stripe/utils.ts
+++ b/lib/stripe/utils.ts
@@ -155,6 +155,41 @@ export const PLANS = [
},
},
},
+ {
+ name: "Data Rooms Plus",
+ slug: "datarooms-plus",
+ minQuantity: 5,
+ price: {
+ monthly: {
+ amount: 399,
+ unitPrice: 4967,
+ priceIds: {
+ test: {
+ old: "price_1QojZuFJyGSZ96lhNwiD1y2r",
+ new: "price_1QojT3BYvhH6u7U7quP5CAXv",
+ },
+ production: {
+ old: "price_1QojcVFJyGSZ96lhZFAJBCaJ",
+ new: "price_1QojXJBYvhH6u7U7Jd3sVnMY",
+ },
+ },
+ },
+ yearly: {
+ amount: 249,
+ unitPrice: 3300,
+ priceIds: {
+ test: {
+ old: "price_1QojaPFJyGSZ96lhods9TOxh",
+ new: "price_1QojT3BYvhH6u7U7VNseK7Fw",
+ },
+ production: {
+ old: "price_1QojcVFJyGSZ96lhhlR7qR4C",
+ new: "price_1QojXJBYvhH6u7U7AFd0GxkA",
+ },
+ },
+ },
+ },
+ },
];
export const isOldAccount = (plan: string) => {
diff --git a/lib/swr/use-billing.ts b/lib/swr/use-billing.ts
index c0825f04..71f4c6db 100644
--- a/lib/swr/use-billing.ts
+++ b/lib/swr/use-billing.ts
@@ -43,7 +43,9 @@ export type BasePlan =
| "pro"
| "trial"
| "business"
- | "datarooms";
+ | "datarooms"
+ | "datarooms-plus";
+
type PlanWithTrial = `${BasePlan}+drtrial`;
type PlanWithOld = `${BasePlan}+old` | `${BasePlan}+drtrial+old`;
diff --git a/lib/types.ts b/lib/types.ts
index 68f4cba9..0b8af894 100644
--- a/lib/types.ts
+++ b/lib/types.ts
@@ -295,3 +295,11 @@ export const WatermarkConfigSchema = z.object({
export type WatermarkConfig = z.infer<typeof WatermarkConfigSchema>;
export type NotionTheme = "light" | "dark";
+
+export type BasePlan =
+ | "free"
+ | "pro"
+ | "business"
+ | "datarooms"
+ | "datarooms-plus"
+ | "enterprise";
diff --git a/package-lock.json b/package-lock.json
index fe108468..8ea7cf19 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17032,6 +17032,21 @@
"peerDependencies": {
"zod": "^3.18.0"
}
+ },
+ "node_modules/react-email/node_modules/@next/swc-win32-ia32-msvc": {
+ "version": "14.2.23",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.23.tgz",
+ "integrity": "sha512-zfHZOGguFCqAJ7zldTKg4tJHPJyJCOFhpoJcVxKL9BSUHScVDnMdDuOU1zPPGdOzr/GWxbhYTjyiEgLEpAoFPA==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
}
}
}
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx
index 599076ae..457c3809 100644
--- a/pages/settings/billing.tsx
+++ b/pages/settings/billing.tsx
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { useTeam } from "@/context/team-context";
-import { CheckIcon } from "lucide-react";
+import { CheckIcon, MinusCircleIcon, PlusCircleIcon } from "lucide-react";
import { toast } from "sonner";
import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";
@@ -39,6 +39,7 @@ export default function Billing() {
const [frequencyPro, setFrequencyPro] = useState(frequencies[0]);
const [frequencyBusiness, setFrequencyBusiness] = useState(frequencies[0]);
const [frequencyDatarooms, setFrequencyDatarooms] = useState(frequencies[0]);
+ const [showDataRoomsPlus, setShowDataRoomsPlus] = useState(false);
useEffect(() => {
if (toggleProYear) {
@@ -106,15 +107,14 @@ export default function Billing() {
featureIntro: "What's included:",
features: [
"1 user",
- "10 links",
"10 documents",
+ "10 links",
"Unlimited visitors",
"Page-by-page analytics",
"Document sharing controls",
"Password protection",
"30-day analytics retention",
],
-
bgColor: "bg-gray-200",
borderColor: "#bg-gray-800",
textColor: "text-foreground ",
@@ -131,11 +131,13 @@ export default function Billing() {
featureIntro: "Everything in Free, plus:",
features: [
"2 users included",
- "Unlimited links",
"100 documents",
+ "Unlimited links",
"Custom branding",
"Folder organization",
+ "Large file uploads",
"Require email verification",
+ "Video sharing and analytics",
"More file types: pppt, docx, excel",
"Papermark branding removed",
"1-year analytics retention",
@@ -158,15 +160,15 @@ export default function Billing() {
features: [
"3 users included",
"1 dataroom",
- "Unlimited documents",
+ "1000 documents",
"Custom domain for documents",
- "Unlimited folder and subfolder levels",
- "Large file uploads",
+ "Unlimited folder levels",
"Multi-file sharing",
+ "Screen shield/fence protection",
"Allow/Block list",
"Dataroom branding",
-
- "More file types: dmg (cad)",
+ "Webhooks",
+ "More file types: dwg, kml, zip",
"2-year analytics retention",
],
bgColor: "#bg-gray-500",
@@ -175,7 +177,6 @@ export default function Billing() {
buttonText: "Upgrade to Business",
mostPopular: true,
},
-
{
name: "Data Rooms",
id: "tier-datarooms",
@@ -188,15 +189,16 @@ export default function Billing() {
features: [
"3 users included",
"Unlimited data rooms",
- "Custom domain for data rooms",
- "Advanced data rooms analytics",
+ "Unlimited documents",
+ "One custom domain for data rooms",
+ "Data rooms analytics",
"NDA agreements",
- "Dynamic Watermark",
- "Granular user/group permisssions",
- "Invite users directly from Papermark",
- "Audit log",
+ "Dynamic watermark",
+ "Granular user/group permissions",
+ "Audit log for viewers",
"24h priority support",
- "Custom onboarding ",
+ "Custom onboarding",
+ "2-year analytics retention",
],
bgColor: "#fb7a00",
borderColor: "#fb7a00",
@@ -204,20 +206,99 @@ export default function Billing() {
buttonText: "Upgrade to Data Rooms",
mostPopular: true,
},
+ {
+ name: "Data Rooms Plus",
+ id: "tier-datarooms-plus",
+ href: "/login",
+ currentPlan: plan && plan == "datarooms-plus" ? true : false,
+ price: { monthly: "€399", annually: "€249" },
+ description:
+ "The ultimate data room solution with advanced features and unlimited storage.",
+ featureIntro: "Everything in Data Rooms, plus:",
+ features: [
+ "5 users included",
+ "Unlimited storage",
+ "No file size limit",
+ "Unlimited custom domains for data rooms",
+ "Q&A module with permissions",
+ "Automatic file indexing",
+ "Assign users to data room",
+ "Email invite viewers directly from Papermark",
+ "White-labeling",
+ "Dedicated account manager",
+ "3-year analytics retention",
+ ],
+ bgColor: "bg-gray-900",
+ borderColor: "border-gray-900",
+ textColor: "text-white",
+ buttonText: "Upgrade to Data Rooms Plus",
+ mostPopular: true,
+ },
];
const enterpriseFeatures = [
"Self-hosted version",
+ "Bring your own storage for documents",
"Unlimited users",
"Unlimited documents",
"Unlimited folders and subfolders",
"Unlimited datarooms",
+ "Unlimited storage",
"Full white-labeling",
- "Up to 5TB file uploads",
+ "No file size limit",
+ "Single sign-on (SSO)",
"Dedicated support",
"Custom onboarding",
];
+ const displayTiers = tiers.filter(
+ (tier) =>
+ tier.name !== (showDataRoomsPlus ? "Data Rooms" : "Data Rooms Plus"),
+ );
+
+ const dataRoomsIndex = displayTiers.findIndex(
+ (tier) => tier.name === "Data Rooms" || tier.name === "Data Rooms Plus",
+ );
+
+ if (dataRoomsIndex !== -1) {
+ const currentTier = displayTiers[dataRoomsIndex];
+ displayTiers[dataRoomsIndex] = {
+ ...currentTier,
+ name: showDataRoomsPlus ? "Data Rooms Plus" : "Data Rooms",
+ price: showDataRoomsPlus
+ ? { monthly: "€299", annually: "€249" }
+ : { monthly: "€199", annually: "€99" },
+ features: showDataRoomsPlus
+ ? [
+ "5 users included",
+ "Unlimited encrypted storage",
+ "No file size limit",
+ "Unlimited custom domains for data rooms",
+ "Q&A module with custom permissions",
+ "Automatic file indexing",
+ "Assign users to particular data room",
+ "Email invite viewers directly from Papermark",
+ "White-labeling",
+ "Dedicated account manager",
+ "3-year analytics retention",
+ ]
+ : [
+ "3 users included",
+ "Unlimited data rooms",
+ "Unlimited documents",
+ "One custom domain for data rooms",
+ "Data rooms analytics",
+ "NDA agreements",
+ "Dynamic watermark",
+ "Granular user/group permissions",
+ "Audit log for viewers",
+ "24h priority support",
+ "Custom onboarding",
+ "2-year analytics retention",
+ ],
+ };
+ }
+
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">
@@ -246,22 +327,43 @@ export default function Billing() {
<div className="bg-white dark:bg-gray-900">
<div className="mx-auto space-y-8">
<div className="isolate grid grid-cols-1 overflow-hidden rounded-xl border border-black dark:border-muted-foreground md:grid-cols-4">
- {tiers.map((tier) => (
+ {displayTiers.map((tier) => (
<div
key={tier.id}
className="flex flex-col justify-between border-r-0 border-black dark:border-muted-foreground md:border-r md:last:!border-r-0"
>
<div>
<div className="border-b border-black bg-gray-100 p-6 dark:border-muted-foreground dark:bg-gray-500">
- <h3
- id={tier.id}
- className="flex items-center gap-x-2 text-balance text-xl leading-8 text-foreground"
- >
- <span>{tier.name}</span>
- {tier.currentPlan ? (
- <Badge className="rounded-md">Current Plan</Badge>
- ) : null}
- </h3>
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-x-3">
+ <h3
+ id={tier.id}
+ className="flex items-center text-balance text-xl leading-8 text-foreground"
+ >
+ {tier.name}
+ </h3>
+ {tier.currentPlan ? (
+ <Badge className="rounded-md">Current Plan</Badge>
+ ) : null}
+ </div>
+ {(tier.name === "Data Rooms" ||
+ tier.name === "Data Rooms Plus") && (
+ <div className="flex items-center gap-x-2">
+ <button
+ onClick={() =>
+ setShowDataRoomsPlus(!showDataRoomsPlus)
+ }
+ className="focus:outline-none"
+ >
+ {showDataRoomsPlus ? (
+ <MinusCircleIcon className="h-6 w-6 text-[#fb7a00] hover:text-[#fb7a00]/90" />
+ ) : (
+ <PlusCircleIcon className="h-6 w-6 text-[#fb7a00] hover:text-[#fb7a00]/90" />
+ )}
+ </button>
+ </div>
+ )}
+ </div>
</div>
<div className="p-6">
<div className="mt-2">
diff --git a/pages/settings/upgrade.tsx b/pages/settings/upgrade.tsx
index 6356f916..5ef50280 100644
--- a/pages/settings/upgrade.tsx
+++ b/pages/settings/upgrade.tsx
@@ -4,10 +4,16 @@ import { useMemo, useState } from "react";
import React from "react";
import { useTeam } from "@/context/team-context";
-import { CheckIcon } from "lucide-react";
+import { CheckIcon, Users2Icon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
import { useAnalytics } from "@/lib/analytics";
import { getStripe } from "@/lib/stripe/client";
@@ -15,10 +21,38 @@ import { PLANS } from "@/lib/stripe/utils";
import { usePlan } from "@/lib/swr/use-billing";
import { capitalize } from "@/lib/utils";
+// First define the pricing data structure outside the component
+const PLAN_PRICING = {
+ Pro: {
+ extraUserPrice: {
+ monthly: "€19/month per additional user",
+ yearly: "€14/month per additional user",
+ },
+ },
+ Business: {
+ extraUserPrice: {
+ monthly: "€26/month per additional user",
+ yearly: "€19/month per additional user",
+ },
+ },
+ "Data Rooms": {
+ extraUserPrice: {
+ monthly: "€49/month per additional user",
+ yearly: "€33/month per additional user",
+ },
+ },
+ "Data Rooms Plus": {
+ extraUserPrice: {
+ monthly: "€79/month per additional user",
+ yearly: "€49/month per additional user",
+ },
+ },
+};
+
export default function UpgradePage() {
const router = useRouter();
const [period, setPeriod] = useState<"yearly" | "monthly">("yearly");
- const [selectedPlan, setSelectedPlan] = useState<string | null>(null); // Track the clicked plan
+ const [selectedPlan, setSelectedPlan] = useState<string | null>(null);
const teamInfo = useTeam();
const { plan: teamPlan, trial, isCustomer, isOldAccount } = usePlan();
const analytics = useAnalytics();
@@ -28,12 +62,34 @@ export default function UpgradePage() {
Pro: {
featureIntro: "Everything in Free, plus:",
features: [
- "2 users included",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>2 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING.Pro.extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
"100 documents",
"Unlimited links",
"Custom branding",
"Folder organization",
+ "Large file uploads",
"Require email verification",
+ "Video sharing and analytics",
"More file types: pppt, docx, excel",
"Papermark branding removed",
"1-year analytics retention",
@@ -42,44 +98,142 @@ export default function UpgradePage() {
Business: {
featureIntro: "Everything in Pro, plus:",
features: [
- "3 users included",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>3 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING.Business.extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
"1 dataroom",
- <span key="custom-dataroom">
- Custom domain <b>for documents</b>
+ "1000 documents",
+ <span key="custom-domain" className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>
+ Custom domain <b>for documents</b>
+ </span>
</span>,
"Unlimited folder levels",
- "Unlimited documents",
- "Large file uploads",
+
"Multi-file sharing",
+ "Screen shield/fence protection",
"Allow/Block list",
"Dataroom branding",
- "More file types: dmg (cad)",
+ "Webhooks",
+ "More file types: dwg, kml, zip",
"2-year analytics retention",
],
},
"Data Rooms": {
featureIntro: "Everything in Business, plus:",
features: [
- "3 users included",
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>3 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{PLAN_PRICING["Data Rooms"].extraUserPrice[period]}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
"Unlimited data rooms",
- <span key="custom-dataroom">
- Custom domain <b>for data rooms</b>
+ "Unlimited documents",
+ <span key="custom-domain" className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>
+ One custom domain <b>for data rooms</b>
+ </span>
</span>,
- "Advanced data rooms analytics",
+ "Data rooms analytics",
"NDA agreements",
- "Dynamic Watermark",
+ "Dynamic watermark",
"Granular user/group permissions",
- "Invite users directly from Papermark",
- "Audit log",
+ "Audit log for viewers",
"24h priority support",
- "Custom onboarding ",
+ "Custom onboarding",
+ "2-year analytics retention",
+ ],
+ },
+ "Data Rooms Plus": {
+ featureIntro: "Everything in Data Rooms, plus:",
+ features: [
+ <div
+ key="users"
+ className="flex items-center justify-between gap-x-8"
+ >
+ <div className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>5 users included</span>
+ </div>
+ <TooltipProvider>
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild>
+ <div className="cursor-help">
+ <Users2Icon className="h-4 w-4 text-gray-500" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>
+ {PLAN_PRICING["Data Rooms Plus"].extraUserPrice[period]}
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>,
+
+ <span key="custom-domain" className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>
+ <b>Unlimited</b> encrypted storage
+ </span>
+ </span>,
+ "No file size limit",
+ <span key="custom-domain" className="flex items-center gap-x-3">
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ <span>
+ Unlimited custom domains <b>for data rooms</b>
+ </span>
+ </span>,
+ "Q&A module with custom permissions",
+ "Automatic file indexing",
+ "Assign users to particular data room",
+ "Email invite viewers directly from Papermark",
+ "White-labeling",
+ "Dedicated account manager",
+ "3-year analytics retention",
],
},
}),
- [],
+ [period],
);
- const plansToShow = ["Pro", "Business", "Data Rooms"];
+ const plansToShow = ["Pro", "Business", "Data Rooms", "Data Rooms Plus"];
return (
<div className="min-h-screen bg-gray-50 p-8 dark:bg-gray-900">
@@ -96,25 +250,38 @@ export default function UpgradePage() {
}
/>
<span className="ml-2 text-sm">
- Annually <span className="text-[#fb7a00]">(Save up to 25%)</span>
+ Annually <span className="text-[#fb7a00]">(Save up to 35%)</span>
</span>
</div>
- <div className="grid grid-cols-1 gap-8 md:grid-cols-3">
+ <div className="grid grid-cols-1 gap-2 md:grid-cols-4">
{plansToShow.map((planOption) => (
<div
key={planOption}
className={`relative flex flex-col rounded-lg border ${
- planOption === "Business" ? "border-[#fb7a00]" : "border-gray-200"
+ planOption === "Business"
+ ? "border-[#fb7a00]"
+ : planOption === "Data Rooms Plus"
+ ? "border-gray-900"
+ : "border-gray-200"
} bg-white p-6 shadow-sm dark:bg-gray-900`}
>
<div className="mb-4 border-b border-gray-200 pb-2">
<h3 className="text-balance text-xl font-medium text-foreground text-gray-900 dark:text-white">
Papermark {planOption}
</h3>
- {planOption === "Business" && (
- <span className="absolute right-2 top-2 rounded bg-[#fb7a00] px-2 py-1 text-xs text-white">
- Most popular
+ {(planOption === "Business" ||
+ planOption === "Data Rooms Plus") && (
+ <span
+ className={`absolute -top-3 right-4 rounded px-2 py-1 text-xs text-white ${
+ planOption === "Data Rooms Plus"
+ ? "bg-gray-900"
+ : "bg-[#fb7a00]"
+ }`}
+ >
+ {planOption === "Data Rooms Plus"
+ ? "Best offer"
+ : "Most popular"}
</span>
)}
</div>
@@ -132,13 +299,24 @@ export default function UpgradePage() {
}
</p>
- <ul className="mb-4 mt-4 space-y-3 text-sm leading-6 text-gray-600 dark:text-muted-foreground">
+ <ul
+ role="list"
+ className="mb-4 mt-4 space-y-3 text-sm leading-6 text-gray-600"
+ >
{planFeatures[
planOption as keyof typeof planFeatures
].features.map((feature, i) => (
<li key={i} className="flex items-center text-sm">
- <CheckIcon className="mr-3 h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
- <span>{feature}</span>
+ {typeof feature === "string" ? (
+ <>
+ <CheckIcon className="mr-3 h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
+ <span>{feature}</span>
+ </>
+ ) : React.isValidElement(feature) ? (
+ feature
+ ) : (
+ feature
+ )}
</li>
))}
</ul>
@@ -150,10 +328,10 @@ export default function UpgradePage() {
? "bg-[#fb7a00]/90 text-white hover:bg-[#fb7a00]"
: "bg-gray-800 text-white hover:bg-gray-900 dark:hover:bg-gray-700/80"
}`}
- loading={selectedPlan === planOption} // Show loading only for the clicked plan
+ loading={selectedPlan === planOption}
disabled={selectedPlan !== null}
onClick={() => {
- setSelectedPlan(planOption); // Set the clicked plan
+ setSelectedPlan(planOption);
if (isCustomer && teamPlan !== "free") {
fetch(
`/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,
@@ -167,7 +345,7 @@ export default function UpgradePage() {
})
.catch((err) => {
alert(err);
- setSelectedPlan(null); // Reset loading state on error
+ setSelectedPlan(null);
});
} else {
fetch(
@@ -196,7 +374,7 @@ export default function UpgradePage() {
})
.catch((err) => {
alert(err);
- setSelectedPlan(null); // Reset loading state on error
+ setSelectedPlan(null);
});
}
}}
@@ -210,7 +388,14 @@ export default function UpgradePage() {
))}
</div>
- <div className="mt-8 text-center">
+ <div className="mt-8 flex flex-col items-center space-y-2">
+ <a
+ target="_blank"
+ className="text-sm text-muted-foreground underline-offset-4"
+ >
+ All plans include unlimited viewers and page by page document
+ analytics.
+ </a>
<a
href="https://cal.com/marcseitz/papermark"
target="_blank"