Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: add highlights for features, and Free trial button
Iuliia Shnai9e4bd41d214d
diff --git a/components/billing/pro-banner.tsx b/components/billing/pro-banner.tsxindex 68728e2b..c66fa795 100644--- a/components/billing/pro-banner.tsx+++ b/components/billing/pro-banner.tsx@@ -42,8 +42,9 @@ export default function ProBanner({</p><div className="flex"><UpgradePlanModal- clickedPlan={PlanEnum.Business}+ clickedPlan={PlanEnum.Pro}trigger={"pro_banner"}+ highlightItem={["custom-branding"]}><Buttontype="button"diff --git a/components/billing/upgrade-plan-modal.tsx b/components/billing/upgrade-plan-modal.tsxindex 4f376724..572fa077 100644--- a/components/billing/upgrade-plan-modal.tsx+++ b/components/billing/upgrade-plan-modal.tsx@@ -9,7 +9,8 @@ import { getStripe } from "@/ee/stripe/client";import { Feature, PlanEnum, getPlanFeatures } from "@/ee/stripe/constants";import { getPriceIdFromPlan } from "@/ee/stripe/functions/get-price-id-from-plan";import { PLANS } from "@/ee/stripe/utils";-import { CheckIcon, Users2Icon } from "lucide-react";+import { CheckIcon, Users2Icon, CircleHelpIcon } from "lucide-react";+import { toast } from "sonner";import { useAnalytics } from "@/lib/analytics";import { usePlan } from "@/lib/swr/use-billing";@@ -23,8 +24,27 @@ import {TooltipContent,TooltipProvider,TooltipTrigger,+ BadgeTooltip,} from "@/components/ui/tooltip";+// Start Data Room Trial Button Component+const StartDataRoomTrialButton = ({ teamId }: { teamId?: string }) => {+ const router = useRouter();++ const handleStartTrial = () => {+ router.push('/welcome?type=dataroom-trial');+ };++ return (+ <span+ onClick={handleStartTrial}+ className="cursor-pointer underline underline-offset-4 hover:text-foreground"+ >+ Start free Data Room trial+ </span>+ );+};+// Feature rendering componentconst FeatureItem = ({ feature }: { feature: Feature }) => {const baseClasses = `flex items-center ${feature.isHighlighted ? "bg-orange-50 -mx-6 px-6 py-2 -my-1 font-bold rounded-md dark:bg-orange-900/20" : ""}`;@@ -57,7 +77,14 @@ const FeatureItem = ({ feature }: { feature: Feature }) => {return (<div className={cn("text-sm", baseClasses)}><CheckIcon className="mr-3 h-5 w-5 flex-shrink-0 text-[#fb7a00]" />- <span>{feature.text}</span>+ <div className="flex items-center gap-2">+ <span>{feature.text}</span>+ {feature.tooltip && (+ <BadgeTooltip content={feature.tooltip}>+ <CircleHelpIcon className="h-4 w-4 shrink-0 text-muted-foreground hover:text-foreground" />+ </BadgeTooltip>+ )}+ </div></div>);};@@ -118,7 +145,7 @@ export function UpgradePlanModal({const [selectedPlan, setSelectedPlan] = useState<string | null>(null);const teamInfo = useTeam();const teamId = teamInfo?.currentTeam?.id;- const { plan: teamPlan, isCustomer, isOldAccount } = usePlan();+ const { plan: teamPlan, isCustomer, isOldAccount, isTrial } = usePlan();const analytics = useAnalytics();const [showDataRoomsPlus, setShowDataRoomsPlus] = useState(false);@@ -348,12 +375,21 @@ export function UpgradePlanModal({<div className="flex flex-col items-center text-center text-sm text-muted-foreground">All plans include unlimited viewers and page by page documentanalytics.- <Link- href="/settings/upgrade"- className="underline underline-offset-4 hover:text-foreground"- >- See all plans- </Link>+ <div className="flex items-center gap-2">+ <Link+ href="/settings/upgrade"+ className="underline underline-offset-4 hover:text-foreground"+ >+ See all plans+ </Link>+ {trigger === "sidebar_datarooms" &&+ ((teamPlan === "free" && !isTrial) || (teamPlan === "pro" && !isTrial)) && (+ <>+ <span>|</span>+ <StartDataRoomTrialButton teamId={teamId} />+ </>+ )}+ </div></div></DialogContent></Dialog>diff --git a/components/domains/add-domain-modal.tsx b/components/domains/add-domain-modal.tsxindex 2d215596..c7572e58 100644--- a/components/domains/add-domain-modal.tsx+++ b/components/domains/add-domain-modal.tsx@@ -123,6 +123,7 @@ export function AddDomainModal({: PlanEnum.Business}trigger={"add_domain_overview"}+ highlightItem={["custom-domain"]}><Button>Upgrade to Add Domain</Button></UpgradePlanModal>@@ -138,6 +139,7 @@ export function AddDomainModal({open={open}setOpen={setOpen}trigger={"add_domain_link_sheet"}+ highlightItem={["custom-domain"]}/>);}diff --git a/components/links/link-sheet/agreement-section.tsx b/components/links/link-sheet/agreement-section.tsxindex aee6176b..dca3335d 100644--- a/components/links/link-sheet/agreement-section.tsx+++ b/components/links/link-sheet/agreement-section.tsx@@ -32,6 +32,7 @@ export default function AgreementSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;}) {const { agreements } = useAgreements();@@ -89,6 +90,7 @@ export default function AgreementSection({state: true,trigger: "link_sheet_agreement_section",plan: "Data Rooms",+ highlightItem: ["nda"],})}/>diff --git a/components/links/link-sheet/allow-list-section.tsx b/components/links/link-sheet/allow-list-section.tsxindex 521dd05d..15cf5031 100644--- a/components/links/link-sheet/allow-list-section.tsx+++ b/components/links/link-sheet/allow-list-section.tsx@@ -26,6 +26,7 @@ export default function AllowListSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;presets: LinkPreset | null;}) {@@ -97,6 +98,7 @@ export default function AllowListSection({state: true,trigger: "link_sheet_allowlist_section",plan: "Business",+ highlightItem: ["allow-block"],})}/>diff --git a/components/links/link-sheet/deny-list-section.tsx b/components/links/link-sheet/deny-list-section.tsxindex db79fbcf..1be96c12 100644--- a/components/links/link-sheet/deny-list-section.tsx+++ b/components/links/link-sheet/deny-list-section.tsx@@ -26,6 +26,7 @@ export default function DenyListSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;presets: LinkPreset | null;}) {@@ -96,6 +97,7 @@ export default function DenyListSection({state: true,trigger: "link_sheet_denylist_section",plan: "Business",+ highlightItem: ["allow-block"],})}/>diff --git a/components/links/link-sheet/domain-section.tsx b/components/links/link-sheet/domain-section.tsxindex d677713e..a3f439c1 100644--- a/components/links/link-sheet/domain-section.tsx+++ b/components/links/link-sheet/domain-section.tsx@@ -320,6 +320,7 @@ export default function DomainSection({? "select_custom_domain_dataroom": "select_custom_domain_document"}+ highlightItem={["custom-domain"]}/></>);diff --git a/components/links/link-sheet/email-authentication-section.tsx b/components/links/link-sheet/email-authentication-section.tsxindex 568e7280..b539192b 100644--- a/components/links/link-sheet/email-authentication-section.tsx+++ b/components/links/link-sheet/email-authentication-section.tsx@@ -17,6 +17,7 @@ export default function EmailAuthenticationSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;}) {const { emailProtected, emailAuthenticated, enableConversation } = data;@@ -54,6 +55,7 @@ export default function EmailAuthenticationSection({state: true,trigger: "link_sheet_email_auth_section",plan: "Business",+ highlightItem: ["email-verify"],})}/>diff --git a/components/links/link-sheet/link-options.tsx b/components/links/link-sheet/link-options.tsxindex c699b5ac..77b1db08 100644--- a/components/links/link-sheet/link-options.tsx+++ b/components/links/link-sheet/link-options.tsx@@ -34,6 +34,7 @@ export type LinkUpgradeOptions = {state: boolean;trigger: string;plan?: "Pro" | "Business" | "Data Rooms" | "Data Rooms Plus";+ highlightItem?: string[];};export const LinkOptions = ({@@ -68,17 +69,20 @@ export const LinkOptions = ({const [openUpgradeModal, setOpenUpgradeModal] = useState<boolean>(false);const [trigger, setTrigger] = useState<string>("");const [upgradePlan, setUpgradePlan] = useState<PlanEnum>(PlanEnum.Business);+ const [highlightItem, setHighlightItem] = useState<string[]>([]);const handleUpgradeStateChange = ({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => {setOpenUpgradeModal(state);setTrigger(trigger);if (plan) {setUpgradePlan(plan as PlanEnum);}+ setHighlightItem(highlightItem || []);};return (@@ -236,6 +240,7 @@ export const LinkOptions = ({open={openUpgradeModal}setOpen={setOpenUpgradeModal}trigger={trigger}+ highlightItem={highlightItem}/></div>);diff --git a/components/links/link-sheet/og-section.tsx b/components/links/link-sheet/og-section.tsxindex a496b033..678d9f7c 100644--- a/components/links/link-sheet/og-section.tsx+++ b/components/links/link-sheet/og-section.tsx@@ -32,6 +32,7 @@ export default function OGSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;editLink: boolean;presets: LinkPreset | null;@@ -176,6 +177,7 @@ export default function OGSection({state: true,trigger: "link_sheet_og_section",plan: "Business",+ highlightItem: ["custom-social-cards"],})}resetAction={resetMetatags}diff --git a/components/links/link-sheet/pro-banner-section.tsx b/components/links/link-sheet/pro-banner-section.tsxindex 9abc483c..505db116 100644--- a/components/links/link-sheet/pro-banner-section.tsx+++ b/components/links/link-sheet/pro-banner-section.tsx@@ -17,6 +17,7 @@ export function ProBannerSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;}) {const { showBanner } = data;@@ -45,6 +46,7 @@ export function ProBannerSection({state: true,trigger: "link_sheet_hide_pro_banner_section",plan: "Pro",+ highlightItem: ["branding"],})}/>diff --git a/components/links/link-sheet/screenshot-protection-section.tsx b/components/links/link-sheet/screenshot-protection-section.tsxindex 6887c5e0..03b827c2 100644--- a/components/links/link-sheet/screenshot-protection-section.tsx+++ b/components/links/link-sheet/screenshot-protection-section.tsx@@ -17,6 +17,7 @@ export default function ScreenshotProtectionSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;}) {const { enableScreenshotProtection } = data;@@ -49,6 +50,7 @@ export default function ScreenshotProtectionSection({state: true,trigger: "link_sheet_screenshot_protection_section",plan: "Business",+ highlightItem: ["screenshot"],})}/>diff --git a/components/links/link-sheet/watermark-section.tsx b/components/links/link-sheet/watermark-section.tsxindex 648180b0..dc9bf9db 100644--- a/components/links/link-sheet/watermark-section.tsx+++ b/components/links/link-sheet/watermark-section.tsx@@ -30,6 +30,7 @@ export default function WatermarkSection({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => void;presets: LinkPreset | null;}) {@@ -97,6 +98,7 @@ export default function WatermarkSection({state: true,trigger: "link_sheet_watermark_section",plan: "Data Rooms",+ highlightItem: ["watermark"],})}/>diff --git a/components/sidebar/app-sidebar.tsx b/components/sidebar/app-sidebar.tsxindex 6748c8fe..a7a939d0 100644--- a/components/sidebar/app-sidebar.tsx+++ b/components/sidebar/app-sidebar.tsx@@ -100,6 +100,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {disabled: !isBusiness && !isDatarooms && !isDataroomsPlus && !isTrial,trigger: "sidebar_datarooms",plan: PlanEnum.Business,+ highlightItem: ["datarooms"],},{title: "Visitors",@@ -109,6 +110,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {disabled: isFree && !isTrial,trigger: "sidebar_visitors",plan: PlanEnum.Pro,+ highlightItem: ["visitors"],},{title: "Branding",diff --git a/components/sidebar/nav-main.tsx b/components/sidebar/nav-main.tsxindex 57cdc5be..838e2e00 100644--- a/components/sidebar/nav-main.tsx+++ b/components/sidebar/nav-main.tsx@@ -35,6 +35,7 @@ export interface NavItem {disabled?: boolean;plan?: PlanEnum;trigger?: string;+ highlightItem?: string[];items?: {title: string;url: string;@@ -60,6 +61,7 @@ export function NavMain({ items }: { items: NavItem[] }) {key={item.title}clickedPlan={item.plan as PlanEnum}trigger={item.trigger}+ highlightItem={item.highlightItem}><div className="peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm text-muted-foreground outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0"><item.icon />diff --git a/components/welcome/containers/onboarding-link-options.tsx b/components/welcome/containers/onboarding-link-options.tsxindex c729f77c..a7a25af3 100644--- a/components/welcome/containers/onboarding-link-options.tsx+++ b/components/welcome/containers/onboarding-link-options.tsx@@ -33,6 +33,7 @@ export type LinkUpgradeOptions = {state: boolean;trigger: string;plan?: "Pro" | "Business" | "Data Rooms" | "Data Rooms Plus";+ highlightItem?: string[];};export const OnboardingLinkOptions = ({@@ -69,17 +70,20 @@ export const OnboardingLinkOptions = ({const [upgradePlan, setUpgradePlan] = useState<PlanEnum>(PlanEnum.Business);const [showAdvancedSettings, setShowAdvancedSettings] =useState<boolean>(false);+ const [highlightItem, setHighlightItem] = useState<string[]>([]);const handleUpgradeStateChange = ({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => {setOpenUpgradeModal(state);setTrigger(trigger);if (plan) {setUpgradePlan(plan as PlanEnum);}+ setHighlightItem(highlightItem || []);};// Basic settings that are always shown@@ -263,6 +267,7 @@ export const OnboardingLinkOptions = ({open={openUpgradeModal}setOpen={setOpenUpgradeModal}trigger={trigger}+ highlightItem={highlightItem}/></div>);diff --git a/ee/stripe/constants.ts b/ee/stripe/constants.tsindex bb64764d..eba43320 100644--- a/ee/stripe/constants.ts+++ b/ee/stripe/constants.ts@@ -69,8 +69,10 @@ export const BASE_FEATURES: Record<PlanEnum, PlanFeatures> = {{ id: "folder", text: "Folder organization" },{ id: "uploads", text: "Large file uploads" },{ id: "video", text: "Video sharing and analytics" },+ { id: "visitors", text: "Visitors analytics" },{ id: "file-types-basic", text: "More file types: ppt, docx, excel" },{ id: "branding", text: "Remove Papermark branding" },+ { id: "custom-branding", text: "Custom branding" },{ id: "retention", text: "1-year analytics retention" },],},@@ -83,7 +85,11 @@ export const BASE_FEATURES: Record<PlanEnum, PlanFeatures> = {isUsers: true,usersIncluded: 3,},- { id: "datarooms", text: "Unlimited light data rooms" },+ {+ id: "datarooms",+ text: "Unlimited light data rooms",+ tooltip: "Light data rooms include only basic security settings for sharing your data room, described in Business plan. "+ },{ id: "documents", text: "1000 documents per data room" },{id: "custom-domain",@@ -92,6 +98,7 @@ export const BASE_FEATURES: Record<PlanEnum, PlanFeatures> = {},{ id: "folder-levels", text: "Unlimited folder levels" },{ id: "multi-file", text: "Multi-file sharing" },+ { id: "custom-social-cards", text: "Custom social media cards" },{ id: "screenshot", text: "Screenshot protection" },{ id: "email-verify", text: "Require email verification" },{ id: "allow-block", text: "Allow/Block list" },diff --git a/next.config.mjs b/next.config.mjsindex 3da0a211..2b925e1b 100644--- a/next.config.mjs+++ b/next.config.mjs@@ -117,21 +117,21 @@ const nextConfig = {},],},- {- source: "/services/:path*",- has: [- {- type: "host",- value: process.env.NEXT_PUBLIC_WEBHOOK_BASE_HOST,- },- ],- headers: [- {- key: "X-Robots-Tag",- value: "noindex",- },- ],- },+ // {+ // source: "/services/:path*",+ // has: [+ // {+ // type: "host",+ // value: process.env.NEXT_PUBLIC_WEBHOOK_BASE_HOST,+ // },+ // ],+ // headers: [+ // {+ // key: "X-Robots-Tag",+ // value: "noindex",+ // },+ // ],+ // },{source: "/api/webhooks/services/:path*",headers: [diff --git a/pages/branding.tsx b/pages/branding.tsxindex 5c45d6a5..718c6207 100644--- a/pages/branding.tsx+++ b/pages/branding.tsx@@ -392,6 +392,7 @@ export default function Branding() {<UpgradePlanModalclickedPlan={PlanEnum.Pro}trigger={"branding_page"}+ highlightItem={["custom-branding"]}><Button>Upgrade to Save Branding</Button></UpgradePlanModal>diff --git a/pages/settings/agreements.tsx b/pages/settings/agreements.tsxindex 2dc6e18f..16302029 100644--- a/pages/settings/agreements.tsx+++ b/pages/settings/agreements.tsx@@ -140,6 +140,7 @@ export default function NdaAgreements() {trigger="nda_agreements_page"open={showUpgradeModal}setOpen={setShowUpgradeModal}+ highlightItem={["nda"]}/><AgreementSheet isOpen={isOpen} setIsOpen={setIsOpen} /></AppLayout>diff --git a/pages/settings/presets/[id].tsx b/pages/settings/presets/[id].tsxindex 0a160133..c182a59b 100644--- a/pages/settings/presets/[id].tsx+++ b/pages/settings/presets/[id].tsx@@ -92,17 +92,20 @@ export default function EditPreset() {const [openUpgradeModal, setOpenUpgradeModal] = useState<boolean>(false);const [trigger, setTrigger] = useState<string>("");const [upgradePlan, setUpgradePlan] = useState<PlanEnum>(PlanEnum.Business);+ const [highlightItem, setHighlightItem] = useState<string[]>([]);const handleUpgradeStateChange = ({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => {setOpenUpgradeModal(state);setTrigger(trigger);if (plan) {setUpgradePlan(plan as PlanEnum);}+ setHighlightItem(highlightItem || []);};useEffect(() => {@@ -502,6 +505,7 @@ export default function EditPreset() {open={openUpgradeModal}setOpen={setOpenUpgradeModal}trigger={trigger}+ highlightItem={highlightItem}/></AppLayout>);diff --git a/pages/settings/presets/new.tsx b/pages/settings/presets/new.tsxindex f3b30352..a6a4c033 100644--- a/pages/settings/presets/new.tsx+++ b/pages/settings/presets/new.tsx@@ -71,17 +71,20 @@ export default function NewPreset() {const [openUpgradeModal, setOpenUpgradeModal] = useState<boolean>(false);const [trigger, setTrigger] = useState<string>("");const [upgradePlan, setUpgradePlan] = useState<PlanEnum>(PlanEnum.Business);+ const [highlightItem, setHighlightItem] = useState<string[]>([]);const handleUpgradeStateChange = ({state,trigger,plan,+ highlightItem,}: LinkUpgradeOptions) => {setOpenUpgradeModal(state);setTrigger(trigger);if (plan) {setUpgradePlan(plan as PlanEnum);}+ setHighlightItem(highlightItem || []);};const handleSubmit = async (e: FormEvent) => {@@ -342,6 +345,7 @@ export default function NewPreset() {open={openUpgradeModal}setOpen={setOpenUpgradeModal}trigger={trigger}+ highlightItem={highlightItem}/></AppLayout>);diff --git a/pages/settings/webhooks/new.tsx b/pages/settings/webhooks/new.tsxindex 00d23e38..999ef045 100644--- a/pages/settings/webhooks/new.tsx+++ b/pages/settings/webhooks/new.tsx@@ -93,7 +93,6 @@ export default function NewWebhook() {const createWebhook = async () => {if (isFree || isPro) {- toast.error("This feature is not available on your plan");return;}@@ -343,9 +342,10 @@ export default function NewWebhook() {key="create-webhook"clickedPlan={PlanEnum.Business}trigger="create_webhook"+ highlightItem={["webhooks"]}><Button type="submit" disabled={isLoading}>- Create Webhook+ Upgrade to Save Webhook</Button></UpgradePlanModal>) : (