mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 01:19:24 +00:00
remove naming
This commit is contained in:
parent
1c043b60fb
commit
8c4c44b39f
@ -2275,6 +2275,20 @@
|
||||
"description": "Configure the settings for this tool. These settings will be applied when the automation runs.",
|
||||
"cancel": "Cancel",
|
||||
"save": "Save Configuration"
|
||||
}
|
||||
},
|
||||
"copyToSaved": "Copy to Saved"
|
||||
}
|
||||
},
|
||||
"automation": {
|
||||
"suggested": {
|
||||
"securePdfIngestion": "Secure PDF Ingestion",
|
||||
"securePdfIngestionDesc": "Comprehensive PDF processing workflow that sanitises documents, applies OCR with cleanup, converts to PDF/A format for long-term archival, and optimises file size.",
|
||||
"emailPreparation": "Email Preparation",
|
||||
"emailPreparationDesc": "Optimises PDFs for email distribution by compressing files, splitting large documents into 20MB chunks for email compatibility, and removing metadata for privacy.",
|
||||
"secureWorkflow": "Security Workflow",
|
||||
"secureWorkflowDesc": "Secures PDF documents by removing potentially malicious content like JavaScript and embedded files, then adds password protection to prevent unauthorised access.",
|
||||
"processImages": "Process Images",
|
||||
"processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2117,17 +2117,6 @@
|
||||
"secureWorkflowDesc": "Secures PDF documents by removing potentially malicious content like JavaScript and embedded files, then adds password protection to prevent unauthorized access.",
|
||||
"processImages": "Process Images",
|
||||
"processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images."
|
||||
},
|
||||
"operation": {
|
||||
"sanitize": "Sanitize",
|
||||
"ocrCleanup": "OCR & Cleanup",
|
||||
"pdfaConversion": "PDF/A Conversion",
|
||||
"compress": "Compress",
|
||||
"splitBySize": "Split by Size (20MB)",
|
||||
"sanitizeMetadata": "Remove Metadata",
|
||||
"addPassword": "Add Password Protection",
|
||||
"imageToPdf": "Image to PDF",
|
||||
"ocr": "OCR Text Extraction"
|
||||
}
|
||||
},
|
||||
"automate": {
|
||||
|
@ -14,8 +14,8 @@ interface AutomationEntryProps {
|
||||
description?: string;
|
||||
/** MUI Icon component for the badge */
|
||||
badgeIcon?: React.ComponentType<any>;
|
||||
/** Array of tool operation names in the workflow OR full operation objects with display names */
|
||||
operations: string[] | Array<{operation: string; displayName?: string}>;
|
||||
/** Array of tool operation names in the workflow */
|
||||
operations: string[];
|
||||
/** Click handler */
|
||||
onClick: () => void;
|
||||
/** Whether to keep the icon at normal color (for special cases like "Add New") */
|
||||
@ -53,36 +53,30 @@ export default function AutomationEntry({
|
||||
const createTooltipContent = () => {
|
||||
if (!description) return null;
|
||||
|
||||
const toolChain = operations.map((op, index) => {
|
||||
// Handle both string[] and operation object arrays
|
||||
const operationName = typeof op === 'string' ? op : op.operation;
|
||||
const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName);
|
||||
|
||||
return (
|
||||
<React.Fragment key={`${operationName}-${index}`}>
|
||||
<Text
|
||||
component="span"
|
||||
size="sm"
|
||||
fw={600}
|
||||
style={{
|
||||
color: 'var(--mantine-primary-color-filled)',
|
||||
background: 'var(--mantine-primary-color-light)',
|
||||
padding: '2px 6px',
|
||||
borderRadius: '4px',
|
||||
fontSize: '0.75rem',
|
||||
whiteSpace: 'nowrap'
|
||||
}}
|
||||
>
|
||||
{displayName}
|
||||
const toolChain = operations.map((op, index) => (
|
||||
<React.Fragment key={`${op}-${index}`}>
|
||||
<Text
|
||||
component="span"
|
||||
size="sm"
|
||||
fw={600}
|
||||
style={{
|
||||
color: 'var(--mantine-primary-color-filled)',
|
||||
background: 'var(--mantine-primary-color-light)',
|
||||
padding: '2px 6px',
|
||||
borderRadius: '4px',
|
||||
fontSize: '0.75rem',
|
||||
whiteSpace: 'nowrap'
|
||||
}}
|
||||
>
|
||||
{t(`${op}.title`, op)}
|
||||
</Text>
|
||||
{index < operations.length - 1 && (
|
||||
<Text component="span" size="sm" mx={4}>
|
||||
→
|
||||
</Text>
|
||||
{index < operations.length - 1 && (
|
||||
<Text component="span" size="sm" mx={4}>
|
||||
→
|
||||
</Text>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
});
|
||||
)}
|
||||
</React.Fragment>
|
||||
));
|
||||
|
||||
return (
|
||||
<div style={{ minWidth: '400px', width: 'auto' }}>
|
||||
@ -125,25 +119,19 @@ export default function AutomationEntry({
|
||||
/>
|
||||
)}
|
||||
<Group gap="xs" justify="flex-start" style={{ flex: 1 }}>
|
||||
{operations.map((op, index) => {
|
||||
// Handle both string[] and operation object arrays
|
||||
const operationName = typeof op === 'string' ? op : op.operation;
|
||||
const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName);
|
||||
{operations.map((op, index) => (
|
||||
<React.Fragment key={`${op}-${index}`}>
|
||||
<Text size="xs" style={{ color: 'var(--mantine-color-text)' }}>
|
||||
{t(`${op}.title`, op)}
|
||||
</Text>
|
||||
|
||||
return (
|
||||
<React.Fragment key={`${operationName}-${index}`}>
|
||||
<Text size="xs" style={{ color: 'var(--mantine-color-text)' }}>
|
||||
{displayName}
|
||||
{index < operations.length - 1 && (
|
||||
<Text size="xs" c="dimmed" style={{ color: 'var(--mantine-color-text)' }}>
|
||||
→
|
||||
</Text>
|
||||
|
||||
{index < operations.length - 1 && (
|
||||
<Text size="xs" c="dimmed" style={{ color: 'var(--mantine-color-text)' }}>
|
||||
→
|
||||
</Text>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
)}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</Group>
|
||||
</Group>
|
||||
);
|
||||
|
@ -68,7 +68,7 @@ export default function AutomationSelection({
|
||||
title={automation.name}
|
||||
description={automation.description}
|
||||
badgeIcon={automation.icon}
|
||||
operations={automation.operations}
|
||||
operations={automation.operations.map(op => op.operation)}
|
||||
onClick={() => onRun(automation)}
|
||||
showMenu={true}
|
||||
onCopy={() => onCopyFromSuggested(automation)}
|
||||
|
@ -23,7 +23,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
operations: [
|
||||
{
|
||||
operation: "sanitize",
|
||||
displayName: t("automation.operation.sanitize", "Sanitize"),
|
||||
parameters: {
|
||||
removeJavaScript: true,
|
||||
removeEmbeddedFiles: true,
|
||||
@ -35,7 +34,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "ocr",
|
||||
displayName: t("automation.operation.ocrCleanup", "OCR & Cleanup"),
|
||||
parameters: {
|
||||
languages: ['eng'],
|
||||
ocrType: 'skip-text',
|
||||
@ -45,7 +43,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "convert",
|
||||
displayName: t("automation.operation.pdfaConversion", "PDF/A Conversion"),
|
||||
parameters: {
|
||||
fromExtension: 'pdf',
|
||||
toExtension: 'pdfa',
|
||||
@ -56,7 +53,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "compress",
|
||||
displayName: t("automation.operation.compress", "Compress"),
|
||||
parameters: {
|
||||
compressionLevel: 5,
|
||||
grayscale: false,
|
||||
@ -78,7 +74,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
operations: [
|
||||
{
|
||||
operation: "compress",
|
||||
displayName: t("automation.operation.compress", "Compress"),
|
||||
parameters: {
|
||||
compressionLevel: 5,
|
||||
grayscale: false,
|
||||
@ -90,7 +85,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "splitPdf",
|
||||
displayName: t("automation.operation.splitBySize", "Split by Size (20MB)"),
|
||||
parameters: {
|
||||
mode: 'bySizeOrCount',
|
||||
pages: '',
|
||||
@ -106,7 +100,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "sanitize",
|
||||
displayName: t("automation.operation.sanitizeMetadata", "Remove Metadata"),
|
||||
parameters: {
|
||||
removeJavaScript: false,
|
||||
removeEmbeddedFiles: false,
|
||||
@ -128,7 +121,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
operations: [
|
||||
{
|
||||
operation: "sanitize",
|
||||
displayName: t("automation.operation.sanitize", "Sanitize"),
|
||||
parameters: {
|
||||
removeJavaScript: true,
|
||||
removeEmbeddedFiles: true,
|
||||
@ -140,7 +132,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "addPassword",
|
||||
displayName: t("automation.operation.addPassword", "Add Password Protection"),
|
||||
parameters: {
|
||||
password: 'password',
|
||||
ownerPassword: '',
|
||||
@ -169,7 +160,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
operations: [
|
||||
{
|
||||
operation: "convert",
|
||||
displayName: t("automation.operation.imageToPdf", "Image to PDF"),
|
||||
parameters: {
|
||||
fromExtension: 'image',
|
||||
toExtension: 'pdf',
|
||||
@ -185,7 +175,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
||||
},
|
||||
{
|
||||
operation: "ocr",
|
||||
displayName: t("automation.operation.ocr", "OCR Text Extraction"),
|
||||
parameters: {
|
||||
languages: ['eng'],
|
||||
ocrType: 'skip-text',
|
||||
|
@ -5,7 +5,6 @@
|
||||
export interface AutomationOperation {
|
||||
operation: string;
|
||||
parameters: Record<string, any>;
|
||||
displayName?: string; // Custom display name for tooltip
|
||||
}
|
||||
|
||||
export interface AutomationConfig {
|
||||
|
Loading…
x
Reference in New Issue
Block a user