Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
chore: cleanup
Marc Seitze2aa7d10bfcc
diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsxindex 8e45ef04..47ab0b5e 100644--- a/components/links/link-sheet/index.tsx+++ b/components/links/link-sheet/index.tsx@@ -75,7 +75,6 @@ export const DEFAULT_LINK_PROPS = (linkType: LinkType) => ({watermarkConfig: null,audienceType: LinkAudienceType.GENERAL,groupId: null,- screenShieldPercentage: null,customFields: [],});@@ -109,7 +108,6 @@ export type DEFAULT_LINK_TYPE = {watermarkConfig: WatermarkConfig | null;audienceType: LinkAudienceType;groupId: string | null;- screenShieldPercentage: number | null;customFields: CustomFieldData[];};diff --git a/components/links/link-sheet/link-options.tsx b/components/links/link-sheet/link-options.tsxindex 5c562281..3e8e9a77 100644--- a/components/links/link-sheet/link-options.tsx+++ b/components/links/link-sheet/link-options.tsx@@ -25,7 +25,6 @@ import useLimits from "@/lib/swr/use-limits";import AgreementSection from "./agreement-section";import CustomFieldsSection from "./custom-fields-section";import QuestionSection from "./question-section";-import ScreenShieldSection from "./screen-shield-section";import ScreenshotProtectionSection from "./screenshot-protection-section";import WatermarkSection from "./watermark-section";diff --git a/components/links/links-table.tsx b/components/links/links-table.tsxindex 358eaef0..58cdb2e6 100644--- a/components/links/links-table.tsx+++ b/components/links/links-table.tsx@@ -137,7 +137,6 @@ export default function LinksTable({watermarkConfig: link.watermarkConfig as WatermarkConfig | null,audienceType: link.audienceType,groupId: link.groupId,- screenShieldPercentage: link.screenShieldPercentage,customFields: link.customFields || [],});//wait for dropdown to close before opening the link sheetdiff --git a/components/view/PagesViewerNew.tsx b/components/view/PagesViewerNew.tsxindex 7fbfc3fb..a2f67881 100644--- a/components/view/PagesViewerNew.tsx+++ b/components/view/PagesViewerNew.tsx@@ -27,7 +27,6 @@ import { TDocumentData } from "./dataroom/dataroom-view";import Nav from "./nav";import { PoweredBy } from "./powered-by";import Question from "./question";-import { ScreenShield } from "./screen-shield";import Toolbar from "./toolbar";import ViewDurationSummary from "./visitor-graph";import { SVGWatermark } from "./watermark-svg";@@ -77,7 +76,6 @@ export default function PagesViewer({allowDownload,feedbackEnabled,screenshotProtectionEnabled,- screenShieldPercentage,versionNumber,brand,documentName,@@ -108,7 +106,6 @@ export default function PagesViewer({allowDownload: boolean;feedbackEnabled: boolean;screenshotProtectionEnabled: boolean;- screenShieldPercentage: number | null;versionNumber: number;brand?: Partial<Brand> | Partial<DataroomBrand> | null;documentName?: string;@@ -496,7 +493,7 @@ export default function PagesViewer({// Function to handle context for screenshottingconst handleContextMenu = (event: React.MouseEvent<HTMLDivElement>) => {- if (!screenshotProtectionEnabled && !screenShieldPercentage) {+ if (!screenshotProtectionEnabled) {return null;}@@ -1107,9 +1104,6 @@ export default function PagesViewer({isPreview={isPreview}/>) : null}- {!!screenShieldPercentage ? (- <ScreenShield visiblePercentage={screenShieldPercentage} />- ) : null}{screenshotProtectionEnabled ? <ScreenProtector /> : null}{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}</div>diff --git a/components/view/view-data.tsx b/components/view/view-data.tsxindex f5d80615..d605289d 100644--- a/components/view/view-data.tsx+++ b/components/view/view-data.tsx@@ -121,7 +121,6 @@ export default function ViewData({allowDownload={link.allowDownload!}feedbackEnabled={link.enableFeedback!}screenshotProtectionEnabled={link.enableScreenshotProtection!}- screenShieldPercentage={link.screenShieldPercentage}versionNumber={document.versions[0].versionNumber}brand={brand}showPoweredByBanner={showPoweredByBanner}@@ -148,7 +147,6 @@ export default function ViewData({allowDownload={link.allowDownload!}feedbackEnabled={link.enableFeedback!}screenshotProtectionEnabled={link.enableScreenshotProtection!}- screenShieldPercentage={link.screenShieldPercentage}versionNumber={document.versions[0].versionNumber}brand={brand}showPoweredByBanner={showPoweredByBanner}@@ -174,7 +172,6 @@ export default function ViewData({allowDownload={link.allowDownload!}feedbackEnabled={link.enableFeedback!}screenshotProtectionEnabled={link.enableScreenshotProtection!}- screenShieldPercentage={link.screenShieldPercentage}versionNumber={document.versions[0].versionNumber}brand={brand}showPoweredByBanner={showPoweredByBanner}diff --git a/components/view/viewer/image-viewer.tsx b/components/view/viewer/image-viewer.tsxindex a83ef2a4..d4c82ba2 100644--- a/components/view/viewer/image-viewer.tsx+++ b/components/view/viewer/image-viewer.tsx@@ -4,7 +4,6 @@ import { useEffect, useRef, useState } from "react";import React from "react";import { Brand, DataroomBrand } from "@prisma/client";-import { toast } from "sonner";import { WatermarkConfig } from "@/lib/types";import { cn } from "@/lib/utils";@@ -16,7 +15,6 @@ import { ScreenProtector } from "../ScreenProtection";import { TDocumentData } from "../dataroom/dataroom-view";import Nav from "../nav";import { PoweredBy } from "../powered-by";-import { ScreenShield } from "../screen-shield";import { SVGWatermark } from "../watermark-svg";const trackPageView = async (data: {@@ -50,7 +48,6 @@ export default function ImageViewer({allowDownload,feedbackEnabled,screenshotProtectionEnabled,- screenShieldPercentage,versionNumber,brand,documentName,@@ -74,7 +71,6 @@ export default function ImageViewer({allowDownload: boolean;feedbackEnabled: boolean;screenshotProtectionEnabled: boolean;- screenShieldPercentage: number | null;versionNumber: number;brand?: Partial<Brand> | Partial<DataroomBrand> | null;documentName?: string;@@ -359,9 +355,6 @@ export default function ImageViewer({</div></div>- {!!screenShieldPercentage ? (- <ScreenShield visiblePercentage={screenShieldPercentage} />- ) : null}{screenshotProtectionEnabled ? <ScreenProtector /> : null}{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}</div>diff --git a/components/view/viewer/pages-horizontal-viewer.tsx b/components/view/viewer/pages-horizontal-viewer.tsxindex 43b8612a..82130175 100644--- a/components/view/viewer/pages-horizontal-viewer.tsx+++ b/components/view/viewer/pages-horizontal-viewer.tsx@@ -6,7 +6,6 @@ import React from "react";import { Brand, DataroomBrand } from "@prisma/client";import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";import { useSession } from "next-auth/react";-import { toast } from "sonner";import { WatermarkConfig } from "@/lib/types";import { cn } from "@/lib/utils";@@ -19,7 +18,6 @@ import { TDocumentData } from "../dataroom/dataroom-view";import Nav from "../nav";import { PoweredBy } from "../powered-by";import Question from "../question";-import { ScreenShield } from "../screen-shield";import Toolbar from "../toolbar";import ViewDurationSummary from "../visitor-graph";import { SVGWatermark } from "../watermark-svg";@@ -69,7 +67,6 @@ export default function PagesHorizontalViewer({allowDownload,feedbackEnabled,screenshotProtectionEnabled,- screenShieldPercentage,versionNumber,brand,documentName,@@ -99,7 +96,6 @@ export default function PagesHorizontalViewer({allowDownload: boolean;feedbackEnabled: boolean;screenshotProtectionEnabled: boolean;- screenShieldPercentage: number | null;versionNumber: number;brand?: Partial<Brand> | Partial<DataroomBrand> | null;documentName?: string;@@ -811,9 +807,7 @@ export default function PagesHorizontalViewer({isPreview={isPreview}/>) : null}- {!!screenShieldPercentage ? (- <ScreenShield visiblePercentage={screenShieldPercentage} />- ) : null}+{screenshotProtectionEnabled ? <ScreenProtector /> : null}{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}</div>diff --git a/components/view/viewer/pages-vertical-viewer.tsx b/components/view/viewer/pages-vertical-viewer.tsxindex 7a42dc4f..61d2b016 100644--- a/components/view/viewer/pages-vertical-viewer.tsx+++ b/components/view/viewer/pages-vertical-viewer.tsx@@ -4,16 +4,7 @@ import { useEffect, useRef, useState } from "react";import React from "react";import { Brand, DataroomBrand } from "@prisma/client";-import {- ChevronDownIcon,- ChevronLeftIcon,- ChevronRightIcon,- ChevronUpIcon,- ZoomInIcon,- ZoomOutIcon,-} from "lucide-react";-import { useSession } from "next-auth/react";-import { toast } from "sonner";+import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";import { WatermarkConfig } from "@/lib/types";import { cn } from "@/lib/utils";@@ -26,9 +17,7 @@ import { TDocumentData } from "../dataroom/dataroom-view";import Nav from "../nav";import { PoweredBy } from "../powered-by";import Question from "../question";-import { ScreenShield } from "../screen-shield";import Toolbar from "../toolbar";-import ViewDurationSummary from "../visitor-graph";import { SVGWatermark } from "../watermark-svg";const DEFAULT_PRELOADED_IMAGES_NUM = 5;@@ -103,7 +92,6 @@ export default function PagesVerticalViewer({allowDownload,feedbackEnabled,screenshotProtectionEnabled,- screenShieldPercentage,versionNumber,brand,documentName,@@ -133,7 +121,6 @@ export default function PagesVerticalViewer({allowDownload: boolean;feedbackEnabled: boolean;screenshotProtectionEnabled: boolean;- screenShieldPercentage: number | null;versionNumber: number;brand?: Partial<Brand> | Partial<DataroomBrand> | null;documentName?: string;@@ -945,9 +932,7 @@ export default function PagesVerticalViewer({isPreview={isPreview}/>) : null}- {!!screenShieldPercentage ? (- <ScreenShield visiblePercentage={screenShieldPercentage} />- ) : null}+{screenshotProtectionEnabled ? <ScreenProtector /> : null}{showPoweredByBanner ? <PoweredBy linkId={linkId} /> : null}</div>diff --git a/lib/api/views/record-visit.ts b/lib/api/views/record-visit.tsindex c4c404af..f3cb54c1 100644--- a/lib/api/views/record-visit.ts+++ b/lib/api/views/record-visit.ts@@ -95,7 +95,6 @@ export async function recordVisit({enabledFeedback: link.enableFeedback ?? false,enabledQuestion: link.enableQuestion ?? false,enabledScreenshotProtection: link.enableScreenshotProtection ?? false,- enabledScreenShieldPercentage: !!link.screenShieldPercentage,enabledAgreement: link.enableAgreement ?? false,enabledWatermark: link.enableWatermark ?? false,metaTitle: link.metaTitle,diff --git a/lib/zod/schemas/webhooks.ts b/lib/zod/schemas/webhooks.tsindex 91c8824a..2a91adcc 100644--- a/lib/zod/schemas/webhooks.ts+++ b/lib/zod/schemas/webhooks.ts@@ -56,7 +56,6 @@ const linkEventSchema = z.object({enabledFeedback: z.boolean().default(false),enabledQuestion: z.boolean().default(false),enabledScreenshotProtection: z.boolean().default(false),- enabledScreenShieldPercentage: z.boolean().default(false),enabledAgreement: z.boolean().default(false),enabledWatermark: z.boolean().default(false),diff --git a/pages/api/links/[id]/documents/[documentId].ts b/pages/api/links/[id]/documents/[documentId].tsindex 6f044743..e4579656 100644--- a/pages/api/links/[id]/documents/[documentId].ts+++ b/pages/api/links/[id]/documents/[documentId].ts@@ -32,7 +32,6 @@ export default async function handle(allowDownload: true,enableFeedback: true,enableScreenshotProtection: true,- screenShieldPercentage: true,password: true,isArchived: true,enableCustomMetatag: true,diff --git a/pages/api/links/[id]/index.ts b/pages/api/links/[id]/index.tsindex 7bfed592..678117cf 100644--- a/pages/api/links/[id]/index.ts+++ b/pages/api/links/[id]/index.ts@@ -38,7 +38,6 @@ export default async function handle(allowDownload: true,enableFeedback: true,enableScreenshotProtection: true,- screenShieldPercentage: true,password: true,isArchived: true,enableCustomMetatag: true,@@ -269,7 +268,6 @@ export default async function handle(enableNotification: linkData.enableNotification,enableFeedback: linkData.enableFeedback,enableScreenshotProtection: linkData.enableScreenshotProtection,- screenShieldPercentage: linkData.screenShieldPercentage,enableCustomMetatag: linkData.enableCustomMetatag,metaTitle: linkData.metaTitle || null,metaDescription: linkData.metaDescription || null,diff --git a/pages/api/links/domains/[...domainSlug].ts b/pages/api/links/domains/[...domainSlug].tsindex 6434c9f1..ebc45534 100644--- a/pages/api/links/domains/[...domainSlug].ts+++ b/pages/api/links/domains/[...domainSlug].ts@@ -50,7 +50,6 @@ export default async function handle(enableCustomMetatag: true,enableFeedback: true,enableScreenshotProtection: true,- screenShieldPercentage: true,metaTitle: true,metaDescription: true,metaImage: true,diff --git a/pages/api/links/index.ts b/pages/api/links/index.tsindex 5b3738d8..0a619ef5 100644--- a/pages/api/links/index.ts+++ b/pages/api/links/index.ts@@ -132,7 +132,6 @@ export default async function handler(enableNotification: linkData.enableNotification,enableFeedback: linkData.enableFeedback,enableScreenshotProtection: linkData.enableScreenshotProtection,- screenShieldPercentage: linkData.screenShieldPercentage,enableCustomMetatag: linkData.enableCustomMetatag,metaTitle: linkData.metaTitle || null,metaDescription: linkData.metaDescription || null,