mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 09:29: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.",
|
"description": "Configure the settings for this tool. These settings will be applied when the automation runs.",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"save": "Save Configuration"
|
"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.",
|
"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",
|
"processImages": "Process Images",
|
||||||
"processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the 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": {
|
"automate": {
|
||||||
|
@ -14,8 +14,8 @@ interface AutomationEntryProps {
|
|||||||
description?: string;
|
description?: string;
|
||||||
/** MUI Icon component for the badge */
|
/** MUI Icon component for the badge */
|
||||||
badgeIcon?: React.ComponentType<any>;
|
badgeIcon?: React.ComponentType<any>;
|
||||||
/** Array of tool operation names in the workflow OR full operation objects with display names */
|
/** Array of tool operation names in the workflow */
|
||||||
operations: string[] | Array<{operation: string; displayName?: string}>;
|
operations: string[];
|
||||||
/** Click handler */
|
/** Click handler */
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
/** Whether to keep the icon at normal color (for special cases like "Add New") */
|
/** Whether to keep the icon at normal color (for special cases like "Add New") */
|
||||||
@ -53,36 +53,30 @@ export default function AutomationEntry({
|
|||||||
const createTooltipContent = () => {
|
const createTooltipContent = () => {
|
||||||
if (!description) return null;
|
if (!description) return null;
|
||||||
|
|
||||||
const toolChain = operations.map((op, index) => {
|
const toolChain = operations.map((op, index) => (
|
||||||
// Handle both string[] and operation object arrays
|
<React.Fragment key={`${op}-${index}`}>
|
||||||
const operationName = typeof op === 'string' ? op : op.operation;
|
<Text
|
||||||
const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName);
|
component="span"
|
||||||
|
size="sm"
|
||||||
return (
|
fw={600}
|
||||||
<React.Fragment key={`${operationName}-${index}`}>
|
style={{
|
||||||
<Text
|
color: 'var(--mantine-primary-color-filled)',
|
||||||
component="span"
|
background: 'var(--mantine-primary-color-light)',
|
||||||
size="sm"
|
padding: '2px 6px',
|
||||||
fw={600}
|
borderRadius: '4px',
|
||||||
style={{
|
fontSize: '0.75rem',
|
||||||
color: 'var(--mantine-primary-color-filled)',
|
whiteSpace: 'nowrap'
|
||||||
background: 'var(--mantine-primary-color-light)',
|
}}
|
||||||
padding: '2px 6px',
|
>
|
||||||
borderRadius: '4px',
|
{t(`${op}.title`, op)}
|
||||||
fontSize: '0.75rem',
|
</Text>
|
||||||
whiteSpace: 'nowrap'
|
{index < operations.length - 1 && (
|
||||||
}}
|
<Text component="span" size="sm" mx={4}>
|
||||||
>
|
→
|
||||||
{displayName}
|
|
||||||
</Text>
|
</Text>
|
||||||
{index < operations.length - 1 && (
|
)}
|
||||||
<Text component="span" size="sm" mx={4}>
|
</React.Fragment>
|
||||||
→
|
));
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ minWidth: '400px', width: 'auto' }}>
|
<div style={{ minWidth: '400px', width: 'auto' }}>
|
||||||
@ -125,25 +119,19 @@ export default function AutomationEntry({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Group gap="xs" justify="flex-start" style={{ flex: 1 }}>
|
<Group gap="xs" justify="flex-start" style={{ flex: 1 }}>
|
||||||
{operations.map((op, index) => {
|
{operations.map((op, index) => (
|
||||||
// Handle both string[] and operation object arrays
|
<React.Fragment key={`${op}-${index}`}>
|
||||||
const operationName = typeof op === 'string' ? op : op.operation;
|
<Text size="xs" style={{ color: 'var(--mantine-color-text)' }}>
|
||||||
const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName);
|
{t(`${op}.title`, op)}
|
||||||
|
</Text>
|
||||||
|
|
||||||
return (
|
{index < operations.length - 1 && (
|
||||||
<React.Fragment key={`${operationName}-${index}`}>
|
<Text size="xs" c="dimmed" style={{ color: 'var(--mantine-color-text)' }}>
|
||||||
<Text size="xs" style={{ color: 'var(--mantine-color-text)' }}>
|
→
|
||||||
{displayName}
|
|
||||||
</Text>
|
</Text>
|
||||||
|
)}
|
||||||
{index < operations.length - 1 && (
|
</React.Fragment>
|
||||||
<Text size="xs" c="dimmed" style={{ color: 'var(--mantine-color-text)' }}>
|
))}
|
||||||
→
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
@ -68,7 +68,7 @@ export default function AutomationSelection({
|
|||||||
title={automation.name}
|
title={automation.name}
|
||||||
description={automation.description}
|
description={automation.description}
|
||||||
badgeIcon={automation.icon}
|
badgeIcon={automation.icon}
|
||||||
operations={automation.operations}
|
operations={automation.operations.map(op => op.operation)}
|
||||||
onClick={() => onRun(automation)}
|
onClick={() => onRun(automation)}
|
||||||
showMenu={true}
|
showMenu={true}
|
||||||
onCopy={() => onCopyFromSuggested(automation)}
|
onCopy={() => onCopyFromSuggested(automation)}
|
||||||
|
@ -23,7 +23,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
operation: "sanitize",
|
operation: "sanitize",
|
||||||
displayName: t("automation.operation.sanitize", "Sanitize"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
removeJavaScript: true,
|
removeJavaScript: true,
|
||||||
removeEmbeddedFiles: true,
|
removeEmbeddedFiles: true,
|
||||||
@ -35,7 +34,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "ocr",
|
operation: "ocr",
|
||||||
displayName: t("automation.operation.ocrCleanup", "OCR & Cleanup"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
languages: ['eng'],
|
languages: ['eng'],
|
||||||
ocrType: 'skip-text',
|
ocrType: 'skip-text',
|
||||||
@ -45,7 +43,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "convert",
|
operation: "convert",
|
||||||
displayName: t("automation.operation.pdfaConversion", "PDF/A Conversion"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
fromExtension: 'pdf',
|
fromExtension: 'pdf',
|
||||||
toExtension: 'pdfa',
|
toExtension: 'pdfa',
|
||||||
@ -56,7 +53,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "compress",
|
operation: "compress",
|
||||||
displayName: t("automation.operation.compress", "Compress"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
compressionLevel: 5,
|
compressionLevel: 5,
|
||||||
grayscale: false,
|
grayscale: false,
|
||||||
@ -78,7 +74,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
operation: "compress",
|
operation: "compress",
|
||||||
displayName: t("automation.operation.compress", "Compress"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
compressionLevel: 5,
|
compressionLevel: 5,
|
||||||
grayscale: false,
|
grayscale: false,
|
||||||
@ -90,7 +85,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "splitPdf",
|
operation: "splitPdf",
|
||||||
displayName: t("automation.operation.splitBySize", "Split by Size (20MB)"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
mode: 'bySizeOrCount',
|
mode: 'bySizeOrCount',
|
||||||
pages: '',
|
pages: '',
|
||||||
@ -106,7 +100,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "sanitize",
|
operation: "sanitize",
|
||||||
displayName: t("automation.operation.sanitizeMetadata", "Remove Metadata"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
removeJavaScript: false,
|
removeJavaScript: false,
|
||||||
removeEmbeddedFiles: false,
|
removeEmbeddedFiles: false,
|
||||||
@ -128,7 +121,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
operation: "sanitize",
|
operation: "sanitize",
|
||||||
displayName: t("automation.operation.sanitize", "Sanitize"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
removeJavaScript: true,
|
removeJavaScript: true,
|
||||||
removeEmbeddedFiles: true,
|
removeEmbeddedFiles: true,
|
||||||
@ -140,7 +132,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "addPassword",
|
operation: "addPassword",
|
||||||
displayName: t("automation.operation.addPassword", "Add Password Protection"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
password: 'password',
|
password: 'password',
|
||||||
ownerPassword: '',
|
ownerPassword: '',
|
||||||
@ -169,7 +160,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
operation: "convert",
|
operation: "convert",
|
||||||
displayName: t("automation.operation.imageToPdf", "Image to PDF"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
fromExtension: 'image',
|
fromExtension: 'image',
|
||||||
toExtension: 'pdf',
|
toExtension: 'pdf',
|
||||||
@ -185,7 +175,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
operation: "ocr",
|
operation: "ocr",
|
||||||
displayName: t("automation.operation.ocr", "OCR Text Extraction"),
|
|
||||||
parameters: {
|
parameters: {
|
||||||
languages: ['eng'],
|
languages: ['eng'],
|
||||||
ocrType: 'skip-text',
|
ocrType: 'skip-text',
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
export interface AutomationOperation {
|
export interface AutomationOperation {
|
||||||
operation: string;
|
operation: string;
|
||||||
parameters: Record<string, any>;
|
parameters: Record<string, any>;
|
||||||
displayName?: string; // Custom display name for tooltip
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutomationConfig {
|
export interface AutomationConfig {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user