feat: add auto pagination detection

This commit is contained in:
Rohit Rajan
2025-11-30 14:48:03 +05:30
parent ad8df66ecd
commit 6cdeb0b0e2
6 changed files with 1149 additions and 9 deletions

View File

@@ -80,6 +80,7 @@ interface BrowserStepsContextType {
newLabel: string
) => void;
updateListStepLimit: (listId: number, limit: number) => void;
updateListStepPagination: (listId: number, pagination: { type: string; selector: string | null; isShadow?: boolean }) => void;
updateListStepData: (listId: number, extractedData: any[]) => void;
updateListStepName: (listId: number, name: string) => void;
updateScreenshotStepName: (id: number, name: string) => void;
@@ -479,6 +480,26 @@ export const BrowserStepsProvider: React.FC<{ children: React.ReactNode }> = ({
);
};
const updateListStepPagination = (
listId: number,
pagination: { type: string; selector: string | null; isShadow?: boolean }
) => {
setBrowserSteps((prevSteps) =>
prevSteps.map((step) => {
if (step.type === "list" && step.id === listId) {
return {
...step,
pagination: {
...pagination,
selector: pagination.selector || "",
},
};
}
return step;
})
);
};
const updateListStepName = (listId: number, name: string) => {
setBrowserSteps((prevSteps) =>
prevSteps.map((step) => {
@@ -533,6 +554,7 @@ export const BrowserStepsProvider: React.FC<{ children: React.ReactNode }> = ({
updateBrowserTextStepLabel,
updateListTextFieldLabel,
updateListStepLimit,
updateListStepPagination,
updateListStepData,
updateListStepName,
updateScreenshotStepName,