mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-26 17:52:59 +02:00
combine steps 2 and 3
This commit is contained in:
parent
bcc0dffa4e
commit
9f1aa5be6d
@ -2178,6 +2178,7 @@
|
|||||||
"tags": "Stamp, Add image, center image, Watermark, PDF, Embed, Customize,Customise",
|
"tags": "Stamp, Add image, center image, Watermark, PDF, Embed, Customize,Customise",
|
||||||
"header": "Stamp PDF",
|
"header": "Stamp PDF",
|
||||||
"title": "Stamp PDF",
|
"title": "Stamp PDF",
|
||||||
|
"stampSetup": "Stamp Setup",
|
||||||
"stampType": "Stamp Type",
|
"stampType": "Stamp Type",
|
||||||
"stampText": "Stamp Text",
|
"stampText": "Stamp Text",
|
||||||
"stampImage": "Stamp Image",
|
"stampImage": "Stamp Image",
|
||||||
@ -2191,7 +2192,7 @@
|
|||||||
"customMargin": "Custom Margin",
|
"customMargin": "Custom Margin",
|
||||||
"customColor": "Custom Text Colour",
|
"customColor": "Custom Text Colour",
|
||||||
"submit": "Submit",
|
"submit": "Submit",
|
||||||
"noStampSelected": "No stamp selected. Return to Step 3."
|
"noStampSelected": "No stamp selected. Return to Step 1."
|
||||||
},
|
},
|
||||||
"removeImagePdf": {
|
"removeImagePdf": {
|
||||||
"tags": "Remove Image,Page operations,Back end,server side"
|
"tags": "Remove Image,Page operations,Back end,server side"
|
||||||
|
@ -1455,6 +1455,7 @@
|
|||||||
"tags": "Stamp, Add image, center image, Watermark, PDF, Embed, Customize",
|
"tags": "Stamp, Add image, center image, Watermark, PDF, Embed, Customize",
|
||||||
"header": "Stamp PDF",
|
"header": "Stamp PDF",
|
||||||
"title": "Stamp PDF",
|
"title": "Stamp PDF",
|
||||||
|
"stampSetup": "Stamp Setup",
|
||||||
"stampType": "Stamp Type",
|
"stampType": "Stamp Type",
|
||||||
"stampText": "Stamp Text",
|
"stampText": "Stamp Text",
|
||||||
"stampImage": "Stamp Image",
|
"stampImage": "Stamp Image",
|
||||||
@ -1468,7 +1469,7 @@
|
|||||||
"customMargin": "Custom Margin",
|
"customMargin": "Custom Margin",
|
||||||
"customColor": "Custom Text Color",
|
"customColor": "Custom Text Color",
|
||||||
"submit": "Submit",
|
"submit": "Submit",
|
||||||
"noStampSelected": "No stamp selected. Return to Step 3."
|
"noStampSelected": "No stamp selected. Return to Step 1."
|
||||||
},
|
},
|
||||||
"removeImagePdf": {
|
"removeImagePdf": {
|
||||||
"tags": "Remove Image,Page operations,Back end,server side"
|
"tags": "Remove Image,Page operations,Back end,server side"
|
||||||
|
@ -6,7 +6,7 @@ import { BaseToolProps, ToolComponent } from "../types/tool";
|
|||||||
import { useEndpointEnabled } from "../hooks/useEndpointConfig";
|
import { useEndpointEnabled } from "../hooks/useEndpointConfig";
|
||||||
import { useAddStampParameters } from "../components/tools/addStamp/useAddStampParameters";
|
import { useAddStampParameters } from "../components/tools/addStamp/useAddStampParameters";
|
||||||
import { useAddStampOperation } from "../components/tools/addStamp/useAddStampOperation";
|
import { useAddStampOperation } from "../components/tools/addStamp/useAddStampOperation";
|
||||||
import { Group, Select, Stack, Textarea, TextInput, ColorInput, Button, Slider, Text, NumberInput } from "@mantine/core";
|
import { Group, Select, Stack, Textarea, TextInput, ColorInput, Button, Slider, Text, NumberInput, Divider } from "@mantine/core";
|
||||||
import StampPreview from "../components/tools/addStamp/StampPreview";
|
import StampPreview from "../components/tools/addStamp/StampPreview";
|
||||||
import LocalIcon from "../components/shared/LocalIcon";
|
import LocalIcon from "../components/shared/LocalIcon";
|
||||||
import styles from "../components/tools/addStamp/StampPreview.module.css";
|
import styles from "../components/tools/addStamp/StampPreview.module.css";
|
||||||
@ -50,14 +50,13 @@ const AddStamp = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
|
|
||||||
enum AddStampStep {
|
enum AddStampStep {
|
||||||
NONE = 'none',
|
NONE = 'none',
|
||||||
PAGE_SELECTION = 'pageSelection',
|
STAMP_SETUP = 'stampSetup',
|
||||||
STAMP_TYPE = 'stampType',
|
|
||||||
POSITION_FORMATTING = 'positionFormatting'
|
POSITION_FORMATTING = 'positionFormatting'
|
||||||
}
|
}
|
||||||
|
|
||||||
const accordion = useAccordionSteps<AddStampStep>({
|
const accordion = useAccordionSteps<AddStampStep>({
|
||||||
noneValue: AddStampStep.NONE,
|
noneValue: AddStampStep.NONE,
|
||||||
initialStep: AddStampStep.PAGE_SELECTION,
|
initialStep: AddStampStep.STAMP_SETUP,
|
||||||
stateConditions: {
|
stateConditions: {
|
||||||
hasFiles,
|
hasFiles,
|
||||||
hasResults
|
hasResults
|
||||||
@ -71,11 +70,11 @@ const AddStamp = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
const getSteps = () => {
|
const getSteps = () => {
|
||||||
const steps: any[] = [];
|
const steps: any[] = [];
|
||||||
|
|
||||||
// Step 1: File settings (page selection)
|
// Step 1: Stamp Setup
|
||||||
steps.push({
|
steps.push({
|
||||||
title: t("AddStampRequest.pageSelection", "Page Selection"),
|
title: t("AddStampRequest.stampSetup", "Stamp Setup"),
|
||||||
isCollapsed: accordion.getCollapsedState(AddStampStep.PAGE_SELECTION),
|
isCollapsed: accordion.getCollapsedState(AddStampStep.STAMP_SETUP),
|
||||||
onCollapsedClick: () => accordion.handleStepToggle(AddStampStep.PAGE_SELECTION),
|
onCollapsedClick: () => accordion.handleStepToggle(AddStampStep.STAMP_SETUP),
|
||||||
isVisible: hasFiles || hasResults,
|
isVisible: hasFiles || hasResults,
|
||||||
content: (
|
content: (
|
||||||
<Stack gap="md">
|
<Stack gap="md">
|
||||||
@ -85,18 +84,7 @@ const AddStamp = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
onChange={(e) => params.updateParameter('pageNumbers', e.currentTarget.value)}
|
onChange={(e) => params.updateParameter('pageNumbers', e.currentTarget.value)}
|
||||||
disabled={endpointLoading}
|
disabled={endpointLoading}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
<Divider/>
|
||||||
),
|
|
||||||
});
|
|
||||||
|
|
||||||
// Step 2: Type & Content
|
|
||||||
steps.push({
|
|
||||||
title: t("AddStampRequest.stampType", "Stamp Type"),
|
|
||||||
isCollapsed: accordion.getCollapsedState(AddStampStep.STAMP_TYPE),
|
|
||||||
onCollapsedClick: () => accordion.handleStepToggle(AddStampStep.STAMP_TYPE),
|
|
||||||
isVisible: hasFiles || hasResults,
|
|
||||||
content: (
|
|
||||||
<Stack gap="md" justify="space-between" flex={1}>
|
|
||||||
<div>
|
<div>
|
||||||
<Text size="sm" fw={500} mb="xs">{t('AddStampRequest.stampType', 'Stamp Type')}</Text>
|
<Text size="sm" fw={500} mb="xs">{t('AddStampRequest.stampType', 'Stamp Type')}</Text>
|
||||||
<ButtonSelector
|
<ButtonSelector
|
||||||
@ -374,7 +362,7 @@ const AddStamp = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
}
|
}
|
||||||
overlayMessage={
|
overlayMessage={
|
||||||
<Text size="sm" c="white" fw={600}>
|
<Text size="sm" c="white" fw={600}>
|
||||||
{t('AddStampRequest.noStampSelected', 'No stamp selected. Return to Step 3.')}
|
{t('AddStampRequest.noStampSelected', 'No stamp selected. Return to Step 1.')}
|
||||||
</Text>
|
</Text>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user