mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
remove file loading
This commit is contained in:
parent
b7d4995042
commit
5d40fcf49f
@ -8,7 +8,6 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Divider,
|
Divider,
|
||||||
FileButton,
|
|
||||||
Group,
|
Group,
|
||||||
Modal,
|
Modal,
|
||||||
Pagination,
|
Pagination,
|
||||||
@ -27,7 +26,6 @@ import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdfOutlined';
|
|||||||
import AutorenewIcon from '@mui/icons-material/Autorenew';
|
import AutorenewIcon from '@mui/icons-material/Autorenew';
|
||||||
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
||||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||||
import UploadIcon from '@mui/icons-material/Upload';
|
|
||||||
import CloseIcon from '@mui/icons-material/Close';
|
import CloseIcon from '@mui/icons-material/Close';
|
||||||
import { Rnd } from 'react-rnd';
|
import { Rnd } from 'react-rnd';
|
||||||
|
|
||||||
@ -348,7 +346,6 @@ const PdfTextEditorView = ({ data }: PdfTextEditorViewProps) => {
|
|||||||
forceSingleTextElement,
|
forceSingleTextElement,
|
||||||
groupingMode: externalGroupingMode,
|
groupingMode: externalGroupingMode,
|
||||||
requestPagePreview,
|
requestPagePreview,
|
||||||
onLoadJson,
|
|
||||||
onSelectPage,
|
onSelectPage,
|
||||||
onGroupEdit,
|
onGroupEdit,
|
||||||
onGroupDelete,
|
onGroupDelete,
|
||||||
@ -1116,19 +1113,6 @@ const PdfTextEditorView = ({ data }: PdfTextEditorViewProps) => {
|
|||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Stack gap="xs">
|
<Stack gap="xs">
|
||||||
<FileButton onChange={onLoadJson} accept="application/pdf,application/json,.pdf,.json">
|
|
||||||
{(props) => (
|
|
||||||
<Button
|
|
||||||
variant="light"
|
|
||||||
leftSection={<UploadIcon fontSize="small" />}
|
|
||||||
loading={isConverting}
|
|
||||||
fullWidth
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{t('pdfTextEditor.actions.load', 'Load File')}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</FileButton>
|
|
||||||
<Button
|
<Button
|
||||||
variant="subtle"
|
variant="subtle"
|
||||||
leftSection={<AutorenewIcon fontSize="small" />}
|
leftSection={<AutorenewIcon fontSize="small" />}
|
||||||
|
|||||||
@ -351,8 +351,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
let shouldUseLazyMode = false;
|
let shouldUseLazyMode = false;
|
||||||
let pendingJobId: string | null = null;
|
let pendingJobId: string | null = null;
|
||||||
|
|
||||||
setErrorMessage(null);
|
|
||||||
|
|
||||||
if (isPdf) {
|
if (isPdf) {
|
||||||
latestPdfRequestIdRef.current = requestId;
|
latestPdfRequestIdRef.current = requestId;
|
||||||
setIsConverting(true);
|
setIsConverting(true);
|
||||||
@ -539,7 +537,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
setCachedJobId(shouldUseLazyMode ? pendingJobId : null);
|
setCachedJobId(shouldUseLazyMode ? pendingJobId : null);
|
||||||
setFileName(file.name);
|
setFileName(file.name);
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
autoLoadKeyRef.current = fileKey;
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Failed to load file', error);
|
console.error('Failed to load file', error);
|
||||||
console.error('Error details:', {
|
console.error('Error details:', {
|
||||||
@ -1052,7 +1049,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
forceSingleTextElement,
|
forceSingleTextElement,
|
||||||
groupingMode,
|
groupingMode,
|
||||||
requestPagePreview,
|
requestPagePreview,
|
||||||
onLoadJson: handleLoadFile,
|
|
||||||
onSelectPage: handleSelectPage,
|
onSelectPage: handleSelectPage,
|
||||||
onGroupEdit: handleGroupTextChange,
|
onGroupEdit: handleGroupTextChange,
|
||||||
onGroupDelete: handleGroupDelete,
|
onGroupDelete: handleGroupDelete,
|
||||||
@ -1076,7 +1072,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
|||||||
handleGroupTextChange,
|
handleGroupTextChange,
|
||||||
handleGroupDelete,
|
handleGroupDelete,
|
||||||
handleImageReset,
|
handleImageReset,
|
||||||
handleLoadFile,
|
|
||||||
handleResetEdits,
|
handleResetEdits,
|
||||||
handleSelectPage,
|
handleSelectPage,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user