Add frontend autoformatting and set CI to require formatted code for all languages (#6052)
# Description of Changes Changes the strategy for autoformatting to reject PRs if they are not formatted correctly instead of allowing them to merge and then spawning a new PR to fix the formatting. The old strategy just caused more work for us because we'd have to manually approve the followup PR and get it merged, which required 2 reviewers so in practice it rarely got done and just meant everyone's PRs ended up containing reformatting for unrelated files, which makes code review unnecessarily difficult. If the PR's code is not formatted correctly after this PR, a comment will be added automatically to tell the author how to run the formatter script to fix their code so it can go in. This also enables autoformatting for the frontend code, using Prettier. I've enabled it for pretty much everything in the frontend folder, other than 3rd party files and files it doesn't make sense for. I also excluded Markdown because it sounds likely to be more annoying to have to autoformat the Markdown in the frontend folder but nowhere else. Open to changing this though if people disagree. > [!note] > > Advice to reviewers: The first commit contains all of the actual logic I've introduced (CI changes, Prettier config, etc.) > The second commit is just the reformatting of the entire frontend folder. > The first commit needs proper review, the second one just give it a spot-check that it's doing what you'd expect.
This commit is contained in:
@@ -1,69 +1,69 @@
|
||||
import { type TFunction } from 'i18next';
|
||||
import React from 'react';
|
||||
import { ToolOperationConfig } from '@app/hooks/tools/shared/toolOperationTypes';
|
||||
import { BaseToolProps } from '@app/types/tool';
|
||||
import { WorkbenchType } from '@app/types/workbench';
|
||||
import { LinkToolId, RegularToolId, SuperToolId, ToolId, ToolKind } from '@app/types/toolId';
|
||||
import DrawRoundedIcon from '@mui/icons-material/DrawRounded';
|
||||
import SecurityRoundedIcon from '@mui/icons-material/SecurityRounded';
|
||||
import VerifiedUserRoundedIcon from '@mui/icons-material/VerifiedUserRounded';
|
||||
import RateReviewRoundedIcon from '@mui/icons-material/RateReviewRounded';
|
||||
import ViewAgendaRoundedIcon from '@mui/icons-material/ViewAgendaRounded';
|
||||
import FileDownloadRoundedIcon from '@mui/icons-material/FileDownloadRounded';
|
||||
import DeleteSweepRoundedIcon from '@mui/icons-material/DeleteSweepRounded';
|
||||
import SmartToyRoundedIcon from '@mui/icons-material/SmartToyRounded';
|
||||
import BuildRoundedIcon from '@mui/icons-material/BuildRounded';
|
||||
import TuneRoundedIcon from '@mui/icons-material/TuneRounded';
|
||||
import CodeRoundedIcon from '@mui/icons-material/CodeRounded';
|
||||
import { ProprietaryToolId } from '@app/types/proprietaryToolId';
|
||||
import { type TFunction } from "i18next";
|
||||
import React from "react";
|
||||
import { ToolOperationConfig } from "@app/hooks/tools/shared/toolOperationTypes";
|
||||
import { BaseToolProps } from "@app/types/tool";
|
||||
import { WorkbenchType } from "@app/types/workbench";
|
||||
import { LinkToolId, RegularToolId, SuperToolId, ToolId, ToolKind } from "@app/types/toolId";
|
||||
import DrawRoundedIcon from "@mui/icons-material/DrawRounded";
|
||||
import SecurityRoundedIcon from "@mui/icons-material/SecurityRounded";
|
||||
import VerifiedUserRoundedIcon from "@mui/icons-material/VerifiedUserRounded";
|
||||
import RateReviewRoundedIcon from "@mui/icons-material/RateReviewRounded";
|
||||
import ViewAgendaRoundedIcon from "@mui/icons-material/ViewAgendaRounded";
|
||||
import FileDownloadRoundedIcon from "@mui/icons-material/FileDownloadRounded";
|
||||
import DeleteSweepRoundedIcon from "@mui/icons-material/DeleteSweepRounded";
|
||||
import SmartToyRoundedIcon from "@mui/icons-material/SmartToyRounded";
|
||||
import BuildRoundedIcon from "@mui/icons-material/BuildRounded";
|
||||
import TuneRoundedIcon from "@mui/icons-material/TuneRounded";
|
||||
import CodeRoundedIcon from "@mui/icons-material/CodeRounded";
|
||||
import { ProprietaryToolId } from "@app/types/proprietaryToolId";
|
||||
|
||||
export enum SubcategoryId {
|
||||
SIGNING = 'signing',
|
||||
DOCUMENT_SECURITY = 'documentSecurity',
|
||||
VERIFICATION = 'verification',
|
||||
DOCUMENT_REVIEW = 'documentReview',
|
||||
PAGE_FORMATTING = 'pageFormatting',
|
||||
EXTRACTION = 'extraction',
|
||||
REMOVAL = 'removal',
|
||||
AUTOMATION = 'automation',
|
||||
GENERAL = 'general',
|
||||
ADVANCED_FORMATTING = 'advancedFormatting',
|
||||
DEVELOPER_TOOLS = 'developerTools'
|
||||
SIGNING = "signing",
|
||||
DOCUMENT_SECURITY = "documentSecurity",
|
||||
VERIFICATION = "verification",
|
||||
DOCUMENT_REVIEW = "documentReview",
|
||||
PAGE_FORMATTING = "pageFormatting",
|
||||
EXTRACTION = "extraction",
|
||||
REMOVAL = "removal",
|
||||
AUTOMATION = "automation",
|
||||
GENERAL = "general",
|
||||
ADVANCED_FORMATTING = "advancedFormatting",
|
||||
DEVELOPER_TOOLS = "developerTools",
|
||||
}
|
||||
|
||||
export enum ToolCategoryId {
|
||||
STANDARD_TOOLS = 'standardTools',
|
||||
ADVANCED_TOOLS = 'advancedTools',
|
||||
RECOMMENDED_TOOLS = 'recommendedTools'
|
||||
STANDARD_TOOLS = "standardTools",
|
||||
ADVANCED_TOOLS = "advancedTools",
|
||||
RECOMMENDED_TOOLS = "recommendedTools",
|
||||
}
|
||||
|
||||
export type ToolRegistryEntry = {
|
||||
icon: React.ReactNode;
|
||||
name: string;
|
||||
component: React.ComponentType<BaseToolProps> | null;
|
||||
description: string;
|
||||
categoryId: ToolCategoryId;
|
||||
subcategoryId: SubcategoryId;
|
||||
maxFiles?: number;
|
||||
supportedFormats?: string[];
|
||||
endpoints?: string[];
|
||||
link?: string;
|
||||
kind?: ToolKind;
|
||||
// Workbench type for navigation
|
||||
workbench?: WorkbenchType;
|
||||
// Operation configuration for automation
|
||||
operationConfig?: ToolOperationConfig<any>;
|
||||
// Settings component for automation configuration
|
||||
automationSettings: React.ComponentType<any> | null;
|
||||
// Whether this tool supports automation (defaults to true)
|
||||
supportsAutomate?: boolean;
|
||||
// Synonyms for search (optional)
|
||||
synonyms?: string[];
|
||||
// Version status indicator (e.g., "alpha", "beta")
|
||||
versionStatus?: "alpha" | "beta";
|
||||
// Whether this tool requires premium access
|
||||
requiresPremium?: boolean;
|
||||
}
|
||||
icon: React.ReactNode;
|
||||
name: string;
|
||||
component: React.ComponentType<BaseToolProps> | null;
|
||||
description: string;
|
||||
categoryId: ToolCategoryId;
|
||||
subcategoryId: SubcategoryId;
|
||||
maxFiles?: number;
|
||||
supportedFormats?: string[];
|
||||
endpoints?: string[];
|
||||
link?: string;
|
||||
kind?: ToolKind;
|
||||
// Workbench type for navigation
|
||||
workbench?: WorkbenchType;
|
||||
// Operation configuration for automation
|
||||
operationConfig?: ToolOperationConfig<any>;
|
||||
// Settings component for automation configuration
|
||||
automationSettings: React.ComponentType<any> | null;
|
||||
// Whether this tool supports automation (defaults to true)
|
||||
supportsAutomate?: boolean;
|
||||
// Synonyms for search (optional)
|
||||
synonyms?: string[];
|
||||
// Version status indicator (e.g., "alpha", "beta")
|
||||
versionStatus?: "alpha" | "beta";
|
||||
// Whether this tool requires premium access
|
||||
requiresPremium?: boolean;
|
||||
};
|
||||
|
||||
export type RegularToolRegistry = Record<RegularToolId, ToolRegistryEntry>;
|
||||
export type SuperToolRegistry = Record<SuperToolId, ToolRegistryEntry>;
|
||||
@@ -86,17 +86,17 @@ export const SUBCATEGORY_ORDER: SubcategoryId[] = [
|
||||
];
|
||||
|
||||
export const SUBCATEGORY_COLOR_MAP: Record<SubcategoryId, string> = {
|
||||
[SubcategoryId.SIGNING]: 'var(--category-color-signing)', // Green
|
||||
[SubcategoryId.DOCUMENT_SECURITY]: 'var(--category-color-security)', // Orange
|
||||
[SubcategoryId.VERIFICATION]: 'var(--category-color-verification)', // Orange
|
||||
[SubcategoryId.DOCUMENT_REVIEW]: 'var(--category-color-general)', // Blue
|
||||
[SubcategoryId.PAGE_FORMATTING]: 'var(--category-color-formatting)', // Purple
|
||||
[SubcategoryId.EXTRACTION]: 'var(--category-color-extraction)', // Cyan
|
||||
[SubcategoryId.REMOVAL]: 'var(--category-color-removal)', // Red
|
||||
[SubcategoryId.AUTOMATION]: 'var(--category-color-automation)', // Pink
|
||||
[SubcategoryId.GENERAL]: 'var(--category-color-general)', // Blue
|
||||
[SubcategoryId.ADVANCED_FORMATTING]: 'var(--category-color-formatting)', // Purple
|
||||
[SubcategoryId.DEVELOPER_TOOLS]: 'var(--category-color-developer)', // Gray
|
||||
[SubcategoryId.SIGNING]: "var(--category-color-signing)", // Green
|
||||
[SubcategoryId.DOCUMENT_SECURITY]: "var(--category-color-security)", // Orange
|
||||
[SubcategoryId.VERIFICATION]: "var(--category-color-verification)", // Orange
|
||||
[SubcategoryId.DOCUMENT_REVIEW]: "var(--category-color-general)", // Blue
|
||||
[SubcategoryId.PAGE_FORMATTING]: "var(--category-color-formatting)", // Purple
|
||||
[SubcategoryId.EXTRACTION]: "var(--category-color-extraction)", // Cyan
|
||||
[SubcategoryId.REMOVAL]: "var(--category-color-removal)", // Red
|
||||
[SubcategoryId.AUTOMATION]: "var(--category-color-automation)", // Pink
|
||||
[SubcategoryId.GENERAL]: "var(--category-color-general)", // Blue
|
||||
[SubcategoryId.ADVANCED_FORMATTING]: "var(--category-color-formatting)", // Purple
|
||||
[SubcategoryId.DEVELOPER_TOOLS]: "var(--category-color-developer)", // Gray
|
||||
};
|
||||
|
||||
export const getSubcategoryIcon = (subcategory: SubcategoryId): React.ReactNode => {
|
||||
@@ -130,13 +130,11 @@ export const getSubcategoryIcon = (subcategory: SubcategoryId): React.ReactNode
|
||||
|
||||
export const getCategoryLabel = (t: TFunction, id: ToolCategoryId): string => t(`toolPicker.categories.${id}`, id);
|
||||
export const getSubcategoryLabel = (t: TFunction, id: SubcategoryId): string => t(`toolPicker.subcategories.${id}`, id);
|
||||
export const getSubcategoryColor = (subcategory: SubcategoryId): string => SUBCATEGORY_COLOR_MAP[subcategory] || '#7882FF';
|
||||
|
||||
|
||||
export const getSubcategoryColor = (subcategory: SubcategoryId): string => SUBCATEGORY_COLOR_MAP[subcategory] || "#7882FF";
|
||||
|
||||
export const getAllEndpoints = (registry: ToolRegistry): string[] => {
|
||||
const lists: string[][] = [];
|
||||
Object.values(registry).forEach(entry => {
|
||||
Object.values(registry).forEach((entry) => {
|
||||
if (entry.endpoints && entry.endpoints.length > 0) {
|
||||
lists.push(entry.endpoints);
|
||||
}
|
||||
@@ -146,8 +144,8 @@ export const getAllEndpoints = (registry: ToolRegistry): string[] => {
|
||||
|
||||
export const getConversionEndpoints = (extensionToEndpoint: Record<string, Record<string, string>>): string[] => {
|
||||
const endpoints = new Set<string>();
|
||||
Object.values(extensionToEndpoint).forEach(toEndpoints => {
|
||||
Object.values(toEndpoints).forEach(endpoint => {
|
||||
Object.values(extensionToEndpoint).forEach((toEndpoints) => {
|
||||
Object.values(toEndpoints).forEach((endpoint) => {
|
||||
endpoints.add(endpoint);
|
||||
});
|
||||
});
|
||||
@@ -156,7 +154,7 @@ export const getConversionEndpoints = (extensionToEndpoint: Record<string, Recor
|
||||
|
||||
export const getAllApplicationEndpoints = (
|
||||
registry: ToolRegistry,
|
||||
extensionToEndpoint?: Record<string, Record<string, string>>
|
||||
extensionToEndpoint?: Record<string, Record<string, string>>,
|
||||
): string[] => {
|
||||
const toolEp = getAllEndpoints(registry);
|
||||
const convEp = extensionToEndpoint ? getConversionEndpoints(extensionToEndpoint) : [];
|
||||
@@ -167,7 +165,7 @@ export const getAllApplicationEndpoints = (
|
||||
* Default workbench for tools that don't specify one
|
||||
* Returns null to trigger the default case in Workbench component (ToolRenderer)
|
||||
*/
|
||||
export const getDefaultToolWorkbench = (): WorkbenchType => 'fileEditor';
|
||||
export const getDefaultToolWorkbench = (): WorkbenchType => "fileEditor";
|
||||
|
||||
/**
|
||||
* Get workbench type for a tool
|
||||
@@ -180,7 +178,7 @@ export const getToolWorkbench = (tool: ToolRegistryEntry): WorkbenchType => {
|
||||
* Get URL path for a tool
|
||||
*/
|
||||
export const getToolUrlPath = (toolId: string): string => {
|
||||
return `/${toolId.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
|
||||
return `/${toolId.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,5 +11,5 @@ import { type ProprietaryToolRegistry } from "@app/data/toolsTaxonomy";
|
||||
|
||||
// Empty hook that returns empty registry (overridden in proprietary version)
|
||||
export function useProprietaryToolRegistry(): ProprietaryToolRegistry {
|
||||
return useMemo(() => ({} as ProprietaryToolRegistry), []);
|
||||
return useMemo(() => ({}) as ProprietaryToolRegistry, []);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
SuperToolRegistry,
|
||||
LinkToolRegistry,
|
||||
} from "@app/data/toolsTaxonomy";
|
||||
import { isSuperToolId, isLinkToolId } from '@app/types/toolId';
|
||||
import { isSuperToolId, isLinkToolId } from "@app/types/toolId";
|
||||
import AdjustContrast from "@app/tools/AdjustContrast";
|
||||
import AdjustContrastSingleStepSettings from "@app/components/tools/adjustContrast/AdjustContrastSingleStepSettings";
|
||||
import { adjustContrastOperationConfig } from "@app/hooks/tools/adjustContrast/useAdjustContrastOperation";
|
||||
@@ -32,8 +32,8 @@ import GetPdfInfo from "@app/tools/GetPdfInfo";
|
||||
import AddWatermark from "@app/tools/AddWatermark";
|
||||
import AddStamp from "@app/tools/AddStamp";
|
||||
import AddAttachments from "@app/tools/AddAttachments";
|
||||
import Merge from '@app/tools/Merge';
|
||||
import EditTableOfContents from '@app/tools/EditTableOfContents';
|
||||
import Merge from "@app/tools/Merge";
|
||||
import EditTableOfContents from "@app/tools/EditTableOfContents";
|
||||
import Repair from "@app/tools/Repair";
|
||||
import AutoRename from "@app/tools/AutoRename";
|
||||
import SingleLargePage from "@app/tools/SingleLargePage";
|
||||
@@ -72,8 +72,8 @@ import { changePermissionsOperationConfig } from "@app/hooks/tools/changePermiss
|
||||
import { certSignOperationConfig } from "@app/hooks/tools/certSign/useCertSignOperation";
|
||||
import { timestampPdfOperationConfig } from "@app/hooks/tools/timestampPdf/useTimestampPdfOperation";
|
||||
import { bookletImpositionOperationConfig } from "@app/hooks/tools/bookletImposition/useBookletImpositionOperation";
|
||||
import { mergeOperationConfig } from '@app/hooks/tools/merge/useMergeOperation';
|
||||
import { editTableOfContentsOperationConfig } from '@app/hooks/tools/editTableOfContents/useEditTableOfContentsOperation';
|
||||
import { mergeOperationConfig } from "@app/hooks/tools/merge/useMergeOperation";
|
||||
import { editTableOfContentsOperationConfig } from "@app/hooks/tools/editTableOfContents/useEditTableOfContentsOperation";
|
||||
import { autoRenameOperationConfig } from "@app/hooks/tools/autoRename/useAutoRenameOperation";
|
||||
import { flattenOperationConfig } from "@app/hooks/tools/flatten/useFlattenOperation";
|
||||
import { redactOperationConfig } from "@app/hooks/tools/redact/useRedactOperation";
|
||||
@@ -91,7 +91,7 @@ import { adjustPageScaleOperationConfig } from "@app/hooks/tools/adjustPageScale
|
||||
import { scannerImageSplitOperationConfig } from "@app/hooks/tools/scannerImageSplit/useScannerImageSplitOperation";
|
||||
import { addPageNumbersOperationConfig } from "@app/components/tools/addPageNumbers/useAddPageNumbersOperation";
|
||||
import { extractPagesOperationConfig } from "@app/hooks/tools/extractPages/useExtractPagesOperation";
|
||||
import { ENDPOINTS as SPLIT_ENDPOINT_NAMES } from '@app/constants/splitConstants';
|
||||
import { ENDPOINTS as SPLIT_ENDPOINT_NAMES } from "@app/constants/splitConstants";
|
||||
import CompressSettings from "@app/components/tools/compress/CompressSettings";
|
||||
import AddPasswordSettings from "@app/components/tools/addPassword/AddPasswordSettings";
|
||||
import RemovePasswordSettings from "@app/components/tools/removePassword/RemovePasswordSettings";
|
||||
@@ -109,7 +109,7 @@ import ReplaceColor from "@app/tools/ReplaceColor";
|
||||
import ScannerImageSplit from "@app/tools/ScannerImageSplit";
|
||||
import OverlayPdfs from "@app/tools/OverlayPdfs";
|
||||
import { ToolId } from "@app/types/toolId";
|
||||
import MergeSettings from '@app/components/tools/merge/MergeSettings';
|
||||
import MergeSettings from "@app/components/tools/merge/MergeSettings";
|
||||
import AdjustPageScaleSettings from "@app/components/tools/adjustPageScale/AdjustPageScaleSettings";
|
||||
import ScannerImageSplitSettings from "@app/components/tools/scannerImageSplit/ScannerImageSplitSettings";
|
||||
import ChangeMetadataSingleStep from "@app/components/tools/changeMetadata/ChangeMetadataSingleStep";
|
||||
@@ -138,8 +138,6 @@ import Automate from "@app/tools/Automate";
|
||||
import Compare from "@app/tools/Compare";
|
||||
import { CONVERT_SUPPORTED_FORMATS } from "@app/constants/convertSupportedFornats";
|
||||
|
||||
|
||||
|
||||
export interface TranslatedToolCatalog {
|
||||
allTools: ToolRegistry;
|
||||
regularTools: RegularToolRegistry;
|
||||
@@ -163,7 +161,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
component: PdfTextEditor,
|
||||
description: t(
|
||||
"home.pdfTextEditor.desc",
|
||||
"Review and edit text and images in PDFs with grouped text editing and PDF regeneration"
|
||||
"Review and edit text and images in PDFs with grouped text editing and PDF regeneration",
|
||||
),
|
||||
categoryId: ToolCategoryId.RECOMMENDED_TOOLS,
|
||||
subcategoryId: SubcategoryId.GENERAL,
|
||||
@@ -186,7 +184,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["multi-tool"],
|
||||
synonyms: getSynonyms(t, "multiTool"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
merge: {
|
||||
icon: <LocalIcon icon="library-add-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -199,7 +197,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["merge-pdfs"],
|
||||
operationConfig: mergeOperationConfig,
|
||||
automationSettings: MergeSettings,
|
||||
synonyms: getSynonyms(t, "merge")
|
||||
synonyms: getSynonyms(t, "merge"),
|
||||
},
|
||||
// Signing
|
||||
certSign: {
|
||||
@@ -243,42 +241,42 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
},
|
||||
addText: {
|
||||
icon: <LocalIcon icon="text-fields-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t('home.addText.title', 'Add Text'),
|
||||
name: t("home.addText.title", "Add Text"),
|
||||
component: AddText,
|
||||
description: t('home.addText.desc', 'Add custom text anywhere in your PDF'),
|
||||
description: t("home.addText.desc", "Add custom text anywhere in your PDF"),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.GENERAL,
|
||||
endpoints: ["sign"],
|
||||
operationConfig: signOperationConfig,
|
||||
automationSettings: null,
|
||||
synonyms: getSynonyms(t, 'addText'),
|
||||
synonyms: getSynonyms(t, "addText"),
|
||||
supportsAutomate: false,
|
||||
},
|
||||
addImage: {
|
||||
icon: <LocalIcon icon="image-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t('home.addImage.title', 'Add Image'),
|
||||
name: t("home.addImage.title", "Add Image"),
|
||||
component: AddImage,
|
||||
description: t('home.addImage.desc', 'Add images anywhere in your PDF'),
|
||||
description: t("home.addImage.desc", "Add images anywhere in your PDF"),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.GENERAL,
|
||||
endpoints: ["add-image"],
|
||||
operationConfig: signOperationConfig,
|
||||
automationSettings: null,
|
||||
synonyms: getSynonyms(t, 'addImage'),
|
||||
synonyms: getSynonyms(t, "addImage"),
|
||||
supportsAutomate: false,
|
||||
},
|
||||
annotate: {
|
||||
icon: <LocalIcon icon="edit" width="1.5rem" height="1.5rem" />,
|
||||
name: t('home.annotate.title', 'Annotate'),
|
||||
name: t("home.annotate.title", "Annotate"),
|
||||
component: Annotate,
|
||||
description: t('home.annotate.desc', 'Highlight, draw, add notes, and shapes directly in the viewer'),
|
||||
description: t("home.annotate.desc", "Highlight, draw, add notes, and shapes directly in the viewer"),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.GENERAL,
|
||||
workbench: 'viewer',
|
||||
workbench: "viewer",
|
||||
endpoints: ["view-pdf"],
|
||||
operationConfig: signOperationConfig,
|
||||
automationSettings: null,
|
||||
synonyms: getSynonyms(t, 'annotate'),
|
||||
synonyms: getSynonyms(t, "annotate"),
|
||||
supportsAutomate: false,
|
||||
},
|
||||
|
||||
@@ -295,8 +293,8 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["add-password"],
|
||||
operationConfig: addPasswordOperationConfig,
|
||||
automationSettings: AddPasswordSettings,
|
||||
synonyms: getSynonyms(t, "addPassword")
|
||||
},
|
||||
synonyms: getSynonyms(t, "addPassword"),
|
||||
},
|
||||
watermark: {
|
||||
icon: <LocalIcon icon="branding-watermark-outline-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t("home.watermark.title", "Add Watermark"),
|
||||
@@ -308,7 +306,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["add-watermark"],
|
||||
operationConfig: addWatermarkOperationConfig,
|
||||
automationSettings: AddWatermarkSingleStepSettings,
|
||||
synonyms: getSynonyms(t, "watermark")
|
||||
synonyms: getSynonyms(t, "watermark"),
|
||||
},
|
||||
addStamp: {
|
||||
icon: <LocalIcon icon="approval-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -334,7 +332,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["sanitize-pdf"],
|
||||
operationConfig: sanitizeOperationConfig,
|
||||
automationSettings: SanitizeSettings,
|
||||
synonyms: getSynonyms(t, "sanitize")
|
||||
synonyms: getSynonyms(t, "sanitize"),
|
||||
},
|
||||
flatten: {
|
||||
icon: <LocalIcon icon="layers-clear-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -347,7 +345,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["flatten"],
|
||||
operationConfig: flattenOperationConfig,
|
||||
automationSettings: FlattenSettings,
|
||||
synonyms: getSynonyms(t, "flatten")
|
||||
synonyms: getSynonyms(t, "flatten"),
|
||||
},
|
||||
unlockPDFForms: {
|
||||
icon: <LocalIcon icon="preview-off-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -360,20 +358,20 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["unlock-pdf-forms"],
|
||||
operationConfig: unlockPdfFormsOperationConfig,
|
||||
synonyms: getSynonyms(t, "unlockPDFForms"),
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
formFill: {
|
||||
icon: <LocalIcon icon="text-fields-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t('home.formFill.title', 'Fill Form'),
|
||||
name: t("home.formFill.title", "Fill Form"),
|
||||
component: FormFill,
|
||||
description: t('home.formFill.desc', 'Fill PDF form fields interactively with a visual editor'),
|
||||
description: t("home.formFill.desc", "Fill PDF form fields interactively with a visual editor"),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.GENERAL,
|
||||
workbench: 'viewer' as const,
|
||||
endpoints: ['form-fill'],
|
||||
workbench: "viewer" as const,
|
||||
endpoints: ["form-fill"],
|
||||
automationSettings: null,
|
||||
supportsAutomate: false,
|
||||
synonyms: ['form', 'fill', 'fillable', 'input', 'field', 'acroform'],
|
||||
synonyms: ["form", "fill", "fillable", "input", "field", "acroform"],
|
||||
},
|
||||
changePermissions: {
|
||||
icon: <LocalIcon icon="lock-outline" width="1.5rem" height="1.5rem" />,
|
||||
@@ -411,7 +409,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
maxFiles: -1,
|
||||
endpoints: ["validate-signature"],
|
||||
synonyms: getSynonyms(t, "validateSignature"),
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
|
||||
// Document Review
|
||||
@@ -423,14 +421,14 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
workbench: "viewer",
|
||||
description: t(
|
||||
"home.read.desc",
|
||||
"View and annotate PDFs. Highlight text, draw, or insert comments for review and collaboration."
|
||||
"View and annotate PDFs. Highlight text, draw, or insert comments for review and collaboration.",
|
||||
),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.DOCUMENT_REVIEW,
|
||||
endpoints: ["view-pdf"],
|
||||
synonyms: getSynonyms(t, "read"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
changeMetadata: {
|
||||
icon: <LocalIcon icon="assignment-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -443,16 +441,13 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["update-metadata"],
|
||||
operationConfig: changeMetadataOperationConfig,
|
||||
automationSettings: ChangeMetadataSingleStep,
|
||||
synonyms: getSynonyms(t, "changeMetadata")
|
||||
synonyms: getSynonyms(t, "changeMetadata"),
|
||||
},
|
||||
editTableOfContents: {
|
||||
icon: <LocalIcon icon="toc-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t("home.editTableOfContents.title", "Edit Table of Contents"),
|
||||
component: EditTableOfContents,
|
||||
description: t(
|
||||
"home.editTableOfContents.desc",
|
||||
"Add or edit bookmarks and table of contents in PDF documents"
|
||||
),
|
||||
description: t("home.editTableOfContents.desc", "Add or edit bookmarks and table of contents in PDF documents"),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.DOCUMENT_REVIEW,
|
||||
maxFiles: 1,
|
||||
@@ -487,7 +482,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["rotate-pdf"],
|
||||
operationConfig: rotateOperationConfig,
|
||||
automationSettings: RotateAutomationSettings,
|
||||
synonyms: getSynonyms(t, "rotate")
|
||||
synonyms: getSynonyms(t, "rotate"),
|
||||
},
|
||||
split: {
|
||||
icon: <LocalIcon icon="content-cut-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -499,7 +494,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: Array.from(new Set(Object.values(SPLIT_ENDPOINT_NAMES))),
|
||||
operationConfig: splitOperationConfig,
|
||||
automationSettings: SplitAutomationSettings,
|
||||
synonyms: getSynonyms(t, "split")
|
||||
synonyms: getSynonyms(t, "split"),
|
||||
},
|
||||
reorganizePages: {
|
||||
icon: <LocalIcon icon="move-down-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -507,15 +502,14 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
component: ReorganizePages,
|
||||
description: t(
|
||||
"home.reorganizePages.desc",
|
||||
"Rearrange, duplicate, or delete PDF pages with visual drag-and-drop control."
|
||||
"Rearrange, duplicate, or delete PDF pages with visual drag-and-drop control.",
|
||||
),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.PAGE_FORMATTING,
|
||||
endpoints: ["rearrange-pages"],
|
||||
operationConfig: reorganizePagesOperationConfig,
|
||||
synonyms: getSynonyms(t, "reorganizePages"),
|
||||
automationSettings: null
|
||||
|
||||
automationSettings: null,
|
||||
},
|
||||
scalePages: {
|
||||
icon: <LocalIcon icon="crop-free-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -528,7 +522,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["scale-pages"],
|
||||
operationConfig: adjustPageScaleOperationConfig,
|
||||
automationSettings: AdjustPageScaleSettings,
|
||||
synonyms: getSynonyms(t, "scalePages")
|
||||
synonyms: getSynonyms(t, "scalePages"),
|
||||
},
|
||||
addPageNumbers: {
|
||||
icon: <LocalIcon icon="123-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -541,7 +535,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
maxFiles: -1,
|
||||
endpoints: ["add-page-numbers"],
|
||||
operationConfig: addPageNumbersOperationConfig,
|
||||
synonyms: getSynonyms(t, "addPageNumbers")
|
||||
synonyms: getSynonyms(t, "addPageNumbers"),
|
||||
},
|
||||
pageLayout: {
|
||||
icon: <LocalIcon icon="dashboard-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -553,7 +547,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
maxFiles: -1,
|
||||
endpoints: ["multi-page-layout"],
|
||||
automationSettings: PageLayoutSettings,
|
||||
synonyms: getSynonyms(t, "pageLayout")
|
||||
synonyms: getSynonyms(t, "pageLayout"),
|
||||
},
|
||||
bookletImposition: {
|
||||
icon: <LocalIcon icon="menu-book-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -561,13 +555,15 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
component: BookletImposition,
|
||||
operationConfig: bookletImpositionOperationConfig,
|
||||
automationSettings: BookletImpositionSettings,
|
||||
description: t("home.bookletImposition.desc", "Create booklets with proper page ordering and multi-page layout for printing and binding"),
|
||||
description: t(
|
||||
"home.bookletImposition.desc",
|
||||
"Create booklets with proper page ordering and multi-page layout for printing and binding",
|
||||
),
|
||||
categoryId: ToolCategoryId.STANDARD_TOOLS,
|
||||
subcategoryId: SubcategoryId.PAGE_FORMATTING,
|
||||
endpoints: ["booklet-imposition"],
|
||||
},
|
||||
pdfToSinglePage: {
|
||||
|
||||
icon: <LocalIcon icon="looks-one-outline-rounded" width="1.5rem" height="1.5rem" />,
|
||||
name: t("home.pdfToSinglePage.title", "PDF to Single Large Page"),
|
||||
component: SingleLargePage,
|
||||
@@ -620,7 +616,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["extract-images"],
|
||||
operationConfig: extractImagesOperationConfig,
|
||||
automationSettings: ExtractImagesSettings,
|
||||
synonyms: getSynonyms(t, "extractImages")
|
||||
synonyms: getSynonyms(t, "extractImages"),
|
||||
},
|
||||
|
||||
// Removal
|
||||
@@ -662,7 +658,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["remove-annotations"],
|
||||
operationConfig: removeAnnotationsOperationConfig,
|
||||
automationSettings: null,
|
||||
synonyms: getSynonyms(t, "removeAnnotations")
|
||||
synonyms: getSynonyms(t, "removeAnnotations"),
|
||||
},
|
||||
removeImage: {
|
||||
icon: <LocalIcon icon="remove-selection-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -688,7 +684,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
maxFiles: -1,
|
||||
operationConfig: removePasswordOperationConfig,
|
||||
automationSettings: RemovePasswordSettings,
|
||||
synonyms: getSynonyms(t, "removePassword")
|
||||
synonyms: getSynonyms(t, "removePassword"),
|
||||
},
|
||||
removeCertSign: {
|
||||
icon: <LocalIcon icon="remove-moderator-outline-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -712,7 +708,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
component: Automate,
|
||||
description: t(
|
||||
"home.automate.desc",
|
||||
"Build multi-step workflows by chaining together PDF actions. Ideal for recurring tasks."
|
||||
"Build multi-step workflows by chaining together PDF actions. Ideal for recurring tasks.",
|
||||
),
|
||||
categoryId: ToolCategoryId.ADVANCED_TOOLS,
|
||||
subcategoryId: SubcategoryId.AUTOMATION,
|
||||
@@ -762,7 +758,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["repair"],
|
||||
operationConfig: repairOperationConfig,
|
||||
synonyms: getSynonyms(t, "repair"),
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
scannerImageSplit: {
|
||||
icon: <LocalIcon icon="scanner-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -787,7 +783,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["overlay-pdf"],
|
||||
operationConfig: overlayPdfsOperationConfig,
|
||||
synonyms: getSynonyms(t, "overlay-pdfs"),
|
||||
automationSettings: OverlayPdfsSettings
|
||||
automationSettings: OverlayPdfsSettings,
|
||||
},
|
||||
replaceColor: {
|
||||
icon: <LocalIcon icon="format-color-fill-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -811,7 +807,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
subcategoryId: SubcategoryId.ADVANCED_FORMATTING,
|
||||
endpoints: ["scanner-effect"],
|
||||
synonyms: getSynonyms(t, "scannerEffect"),
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
|
||||
// Developer Tools
|
||||
@@ -827,7 +823,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["show-javascript"],
|
||||
synonyms: getSynonyms(t, "showJS"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
devApi: {
|
||||
icon: <LocalIcon icon="open-in-new-rounded" width="1.5rem" height="1.5rem" style={{ color: "#2F7BF6" }} />,
|
||||
@@ -840,7 +836,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["dev-api-docs"],
|
||||
synonyms: getSynonyms(t, "devApi"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
devFolderScanning: {
|
||||
icon: <LocalIcon icon="open-in-new-rounded" width="1.5rem" height="1.5rem" style={{ color: "#2F7BF6" }} />,
|
||||
@@ -853,7 +849,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["dev-folder-scanning-docs"],
|
||||
synonyms: getSynonyms(t, "devFolderScanning"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
devSsoGuide: {
|
||||
icon: <LocalIcon icon="open-in-new-rounded" width="1.5rem" height="1.5rem" style={{ color: "#2F7BF6" }} />,
|
||||
@@ -866,7 +862,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["dev-sso-guide-docs"],
|
||||
synonyms: getSynonyms(t, "devSsoGuide"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
devAirgapped: {
|
||||
icon: <LocalIcon icon="open-in-new-rounded" width="1.5rem" height="1.5rem" style={{ color: "#2F7BF6" }} />,
|
||||
@@ -879,7 +875,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["dev-airgapped-docs"],
|
||||
synonyms: getSynonyms(t, "devAirgapped"),
|
||||
supportsAutomate: false,
|
||||
automationSettings: null
|
||||
automationSettings: null,
|
||||
},
|
||||
|
||||
// Recommended Tools
|
||||
@@ -895,7 +891,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
operationConfig: undefined,
|
||||
automationSettings: null,
|
||||
synonyms: getSynonyms(t, "compare"),
|
||||
supportsAutomate: false
|
||||
supportsAutomate: false,
|
||||
},
|
||||
compress: {
|
||||
icon: <LocalIcon icon="zoom-in-map-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -908,7 +904,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["compress-pdf"],
|
||||
operationConfig: compressOperationConfig,
|
||||
automationSettings: CompressSettings,
|
||||
synonyms: getSynonyms(t, "compress")
|
||||
synonyms: getSynonyms(t, "compress"),
|
||||
},
|
||||
convert: {
|
||||
icon: <LocalIcon icon="sync-alt-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -940,7 +936,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
|
||||
operationConfig: convertOperationConfig,
|
||||
automationSettings: ConvertSettings,
|
||||
synonyms: getSynonyms(t, "convert")
|
||||
synonyms: getSynonyms(t, "convert"),
|
||||
},
|
||||
|
||||
ocr: {
|
||||
@@ -954,7 +950,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["ocr-pdf"],
|
||||
operationConfig: ocrOperationConfig,
|
||||
automationSettings: OCRSettings,
|
||||
synonyms: getSynonyms(t, "ocr")
|
||||
synonyms: getSynonyms(t, "ocr"),
|
||||
},
|
||||
redact: {
|
||||
icon: <LocalIcon icon="visibility-off-rounded" width="1.5rem" height="1.5rem" />,
|
||||
@@ -967,7 +963,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog {
|
||||
endpoints: ["auto-redact"],
|
||||
operationConfig: redactOperationConfig,
|
||||
automationSettings: RedactSingleStepSettings,
|
||||
synonyms: getSynonyms(t, "redact")
|
||||
synonyms: getSynonyms(t, "redact"),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user