Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
Merge branch 'main' into pricing-datarooms
Marc Seitz0ad97095d9b2
diff --cc components/billing/upgrade-plan-modal.tsxindex e32d8507,66386b73..fc88309f--- a/components/billing/upgrade-plan-modal.tsx+++ b/components/billing/upgrade-plan-modal.tsx@@@ -5,57 -5,23 +5,63 @@@ import { useEffect, useMemo, useStateimport React from "react";import { useTeam } from "@/context/team-context";+ import { getStripe } from "@/ee/stripe/client";+ import { PLANS } from "@/ee/stripe/utils";-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";- 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 enum PlanEnum {+ Pro = "Pro",+ Business = "Business",+ DataRooms = "Data Rooms",++ DataRoomsPlus = "Data Rooms Plus",+ }export function UpgradePlanModal({clickedPlan,trigger,@@@ -83,79 -48,32 +89,61 @@@Pro: {featureIntro: "Everything in Free, plus:",features: [- <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",+ "1 user included",+ "300 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",+ // "Require email verification",+ "More file types: ppt, docx, excel",- "Papermark branding removed",++ "Remove Papermark branding","1-year analytics retention",],},Business: {featureIntro: "Everything in Pro, plus:",features: [- "3 users included",- "1 dataroom",- <span key="custom-dataroom">- Custom domain <b>for documents</b>- </span>,+ <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",++ "Unlimited data rooms",+ "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",++ "Require email verification","Allow/Block list","Dataroom branding",- "More file types: dmg (cad)",+ "Webhooks",+ "More file types: dwg, kml, zip","2-year analytics retention",],},diff --cc components/documents/add-document-modal.tsxindex d187909b,9340f662..a96b837f--- a/components/documents/add-document-modal.tsx+++ b/components/documents/add-document-modal.tsx@@@ -512,12 -439,15 +521,16 @@@ export function AddDocumentModal(className="border-none bg-transparent text-foreground shadow-none"isDocumentDialog>+ <DialogTitle className="sr-only">Add Document</DialogTitle>+ <DialogDescription className="sr-only">+ An overlayed modal that can be clicked to upload a document+ </DialogDescription><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">diff --cc lib/swr/use-billing.tsindex 71f4c6db,362d077f..35724c5c--- a/lib/swr/use-billing.ts+++ b/lib/swr/use-billing.ts@@@ -1,9 -1,9 +1,4 @@@--import { useRouter } from "next/router";----import { useMemo } from "react";--import { useTeam } from "@/context/team-context";--import { parse } from "path";import useSWR from "swr";import { fetcher } from "@/lib/utils";diff --cc pages/settings/billing.tsxindex 457c3809,45e42089..be64eaca--- a/pages/settings/billing.tsx+++ b/pages/settings/billing.tsx@@@ -1,22 -1,26 +1,16 @@@--import Link from "next/link";import { useRouter } from "next/router";import { useEffect, useState } from "react";import { useTeam } from "@/context/team-context";- import { CheckIcon, MinusCircleIcon, PlusCircleIcon } from "lucide-react";-import { CheckIcon } from "lucide-react";import { toast } from "sonner";- import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";+ import UpgradePlanContainer from "@/components/billing/upgrade-plan-container";-import {- PlanEnum,- UpgradePlanModal,-} from "@/components/billing/upgrade-plan-modal";import AppLayout from "@/components/layouts/app";import { SettingsHeader } from "@/components/settings/settings-header";--import { Badge } from "@/components/ui/badge";--import { Button } from "@/components/ui/button";--import { Switch } from "@/components/ui/switch";import { useAnalytics } from "@/lib/analytics";import { usePlan } from "@/lib/swr/use-billing";--import { cn } from "@/lib/utils";const frequencies: {value: "monthly" | "annually";@@@ -126,20 -130,18 +120,20 @@@ export default function Billing()id: "tier-pro",href: "/login",currentPlan: plan && plan == "pro" ? true : false,-- price: { monthly: "€39", annually: "€25" },++ price: { monthly: "€29", annually: "€24" },description: "The branded experience for your documents.",featureIntro: "Everything in Free, plus:",features: [- "2 users included",- "100 documents",+ "1 user included","Unlimited links",+ "300 documents","Custom branding","Folder organization",+ "Large file uploads",- "Require email verification",+ // "Require email verification",+ "More file types: ppt, docx, excel",- "Papermark branding removed",+ "Video sharing and analytics",- "More file types: pppt, docx, excel",- "Papermark branding removed",++ "Remove Papermark branding","1-year analytics retention",],bgColor: "bg-gray-200",@@@ -153,22 -155,22 +147,22 @@@id: "tier-business",href: "/login",currentPlan: plan && plan == "business" ? true : false,-- price: { monthly: "€79", annually: "€45" },++ price: { monthly: "€79", annually: "€59" },description:"The one for more control, data room, and multi-file sharing.",featureIntro: "Everything in Pro, plus:",features: ["3 users included",-- "1 dataroom",- "Unlimited documents",++ "Unlimited data rooms",+ "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",@@@ -182,7 -185,7 +176,7 @@@id: "tier-datarooms",href: "/login",currentPlan: plan && plan == "datarooms" ? true : false,-- price: { monthly: "€199", annually: "€99" },++ price: { monthly: "€149", annually: "€99" },description:"The one for more control, data room, and multi-file sharing.",featureIntro: "Everything in Business, plus:",@@@ -206,34 -208,6 +200,34 @@@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" },++ price: { monthly: "€299", annually: "€199" },+ 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 = [diff --cc pages/settings/upgrade.tsxindex 5ef50280,c6cf98ca..0f2f1863--- a/pages/settings/upgrade.tsx+++ b/pages/settings/upgrade.tsx@@@ -4,20 -4,14 +4,20 @@@ import { useMemo, useState } from "reacimport React from "react";import { useTeam } from "@/context/team-context";+ import { getStripe } from "@/ee/stripe/client";+ import { PLANS } from "@/ee/stripe/utils";-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";- import { PLANS } from "@/lib/stripe/utils";import { usePlan } from "@/lib/swr/use-billing";import { capitalize } from "@/lib/utils";@@@ -62,79 -28,32 +62,58 @@@ export default function UpgradePage()Pro: {featureIntro: "Everything in Free, 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>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",+ "1 user included",- "300 documents","Unlimited links",++ "300 documents","Custom branding","Folder organization",+ "Large file uploads",- "Require email verification",+ // "Require email verification",+ "More file types: ppt, docx, excel",- "Papermark branding removed",+ "Video sharing and analytics",- "More file types: pppt, docx, excel",- "Papermark branding removed",++ "Remove Papermark branding","1-year analytics retention",],},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",],},