mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-24 04:26:14 +00:00
Compare commits
No commits in common. "3755bfde3438c8688e56c028fc4479d64bcfc880" and "5d7fb638afcfae54494cf555bd3b4dcfda023e0c" have entirely different histories.
3755bfde34
...
5d7fb638af
16
frontend/package-lock.json
generated
16
frontend/package-lock.json
generated
@ -16,7 +16,6 @@
|
||||
"@embedpdf/plugin-loader": "^1.1.1",
|
||||
"@embedpdf/plugin-pan": "^1.1.1",
|
||||
"@embedpdf/plugin-render": "^1.1.1",
|
||||
"@embedpdf/plugin-rotate": "^1.1.1",
|
||||
"@embedpdf/plugin-scroll": "^1.1.1",
|
||||
"@embedpdf/plugin-search": "^1.1.1",
|
||||
"@embedpdf/plugin-selection": "^1.1.1",
|
||||
@ -716,21 +715,6 @@
|
||||
"vue": ">=3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-rotate": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-rotate/-/plugin-rotate-1.1.1.tgz",
|
||||
"integrity": "sha512-xxM62dv4TAoTEfCNxyC0UbGryT3ucAH4txQAoab7tfvnfqbAIxTonH1PzQMsBmzN0WETCGjUBm1Ympb95cDx2Q==",
|
||||
"dependencies": {
|
||||
"@embedpdf/models": "1.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@embedpdf/core": "1.1.1",
|
||||
"preact": "^10.26.4",
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0",
|
||||
"vue": ">=3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@embedpdf/plugin-scroll": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@embedpdf/plugin-scroll/-/plugin-scroll-1.1.1.tgz",
|
||||
|
@ -12,7 +12,6 @@
|
||||
"@embedpdf/plugin-loader": "^1.1.1",
|
||||
"@embedpdf/plugin-pan": "^1.1.1",
|
||||
"@embedpdf/plugin-render": "^1.1.1",
|
||||
"@embedpdf/plugin-rotate": "^1.1.1",
|
||||
"@embedpdf/plugin-scroll": "^1.1.1",
|
||||
"@embedpdf/plugin-search": "^1.1.1",
|
||||
"@embedpdf/plugin-selection": "^1.1.1",
|
||||
|
@ -683,76 +683,7 @@
|
||||
"8": "Document #6: Page 10"
|
||||
},
|
||||
"splitPages": "Enter pages to split on:",
|
||||
"submit": "Split",
|
||||
"error": {
|
||||
"failed": "An error occurred while splitting the PDF."
|
||||
},
|
||||
"method": {
|
||||
"label": "Choose split method",
|
||||
"placeholder": "Select how to split the PDF"
|
||||
},
|
||||
"methods": {
|
||||
"byPages": "Split at Page Numbers",
|
||||
"bySections": "Split by Sections",
|
||||
"bySize": "Split by File Size",
|
||||
"byPageCount": "Split by Page Count",
|
||||
"byDocCount": "Split by Document Count",
|
||||
"byChapters": "Split by Chapters"
|
||||
},
|
||||
"value": {
|
||||
"fileSize": {
|
||||
"label": "File Size",
|
||||
"placeholder": "e.g. 10MB, 500KB"
|
||||
},
|
||||
"pageCount": {
|
||||
"label": "Pages per File",
|
||||
"placeholder": "e.g. 5, 10"
|
||||
},
|
||||
"docCount": {
|
||||
"label": "Number of Files",
|
||||
"placeholder": "e.g. 3, 5"
|
||||
}
|
||||
},
|
||||
"tooltip": {
|
||||
"header": {
|
||||
"title": "Split Methods Overview"
|
||||
},
|
||||
"byPages": {
|
||||
"title": "Split at Page Numbers",
|
||||
"text": "Split your PDF at specific page numbers. Using 'n' splits after page n. Using 'n-m' splits before page n and after page m.",
|
||||
"bullet1": "Single split points: 3,7 (splits after pages 3 and 7)",
|
||||
"bullet2": "Range split points: 3-8 (splits before page 3 and after page 8)",
|
||||
"bullet3": "Mixed: 2,5-10,15 (splits after page 2, before page 5, after page 10, and after page 15)"
|
||||
},
|
||||
"bySections": {
|
||||
"title": "Split by Grid Sections",
|
||||
"text": "Divide each page into a grid of sections. Useful for splitting documents with multiple columns or extracting specific areas.",
|
||||
"bullet1": "Horizontal: Number of rows to create",
|
||||
"bullet2": "Vertical: Number of columns to create",
|
||||
"bullet3": "Merge: Combine all sections into one PDF"
|
||||
},
|
||||
"bySize": {
|
||||
"title": "Split by File Size",
|
||||
"text": "Create multiple PDFs that don't exceed a specified file size. Ideal for file size limitations or email attachments.",
|
||||
"bullet1": "Use MB for larger files (e.g., 10MB)",
|
||||
"bullet2": "Use KB for smaller files (e.g., 500KB)",
|
||||
"bullet3": "System will split at page boundaries"
|
||||
},
|
||||
"byCount": {
|
||||
"title": "Split by Count",
|
||||
"text": "Create multiple PDFs with a specific number of pages or documents each.",
|
||||
"bullet1": "Page Count: Fixed number of pages per file",
|
||||
"bullet2": "Document Count: Fixed number of output files",
|
||||
"bullet3": "Useful for batch processing workflows"
|
||||
},
|
||||
"byChapters": {
|
||||
"title": "Split by Chapters",
|
||||
"text": "Use PDF bookmarks to automatically split at chapter boundaries. Requires PDFs with bookmark structure.",
|
||||
"bullet1": "Bookmark Level: Which level to split on (1=top level)",
|
||||
"bullet2": "Include Metadata: Preserve document properties",
|
||||
"bullet3": "Allow Duplicates: Handle repeated bookmark names"
|
||||
}
|
||||
}
|
||||
"submit": "Split"
|
||||
},
|
||||
"rotate": {
|
||||
"tags": "server side",
|
||||
@ -2645,15 +2576,5 @@
|
||||
"processImages": "Process Images",
|
||||
"processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images."
|
||||
}
|
||||
},
|
||||
"viewer": {
|
||||
"firstPage": "First Page",
|
||||
"lastPage": "Last Page",
|
||||
"previousPage": "Previous Page",
|
||||
"nextPage": "Next Page",
|
||||
"zoomIn": "Zoom In",
|
||||
"zoomOut": "Zoom Out",
|
||||
"singlePageView": "Single Page View",
|
||||
"dualPageView": "Dual Page View"
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import { useRightRail } from '../../contexts/RightRailContext';
|
||||
import { useFileState, useFileSelection, useFileManagement } from '../../contexts/FileContext';
|
||||
import { useNavigationState } from '../../contexts/NavigationContext';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import '../../types/embedPdf';
|
||||
|
||||
import LanguageSelector from '../shared/LanguageSelector';
|
||||
import { useRainbowThemeContext } from '../shared/RainbowThemeProvider';
|
||||
@ -18,7 +17,6 @@ import { SearchInterface } from '../viewer/SearchInterface';
|
||||
export default function RightRail() {
|
||||
const { t } = useTranslation();
|
||||
const [isPanning, setIsPanning] = useState(false);
|
||||
const [currentRotation, setCurrentRotation] = useState(0);
|
||||
const { toggleTheme } = useRainbowThemeContext();
|
||||
const { buttons, actions } = useRightRail();
|
||||
const topButtons = useMemo(() => buttons.filter(b => (b.section || 'top') === 'top' && (b.visible ?? true)), [buttons]);
|
||||
@ -32,24 +30,6 @@ export default function RightRail() {
|
||||
// Navigation view
|
||||
const { workbench: currentView } = useNavigationState();
|
||||
|
||||
// Sync rotation state with EmbedPDF API
|
||||
useEffect(() => {
|
||||
if (currentView === 'viewer' && window.embedPdfRotate) {
|
||||
const updateRotation = () => {
|
||||
const rotation = window.embedPdfRotate?.getRotation() || 0;
|
||||
setCurrentRotation(rotation * 90); // Convert enum to degrees
|
||||
};
|
||||
|
||||
// Update rotation immediately
|
||||
updateRotation();
|
||||
|
||||
// Set up periodic updates to keep state in sync
|
||||
const interval = setInterval(updateRotation, 1000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}
|
||||
}, [currentView]);
|
||||
|
||||
// File state and selection
|
||||
const { state, selectors } = useFileState();
|
||||
const { selectedFiles, selectedFileIds, setSelectedFiles } = useFileSelection();
|
||||
@ -269,7 +249,7 @@ export default function RightRail() {
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => {
|
||||
window.embedPdfPan?.togglePan();
|
||||
(window as any).embedPdfPan?.togglePan();
|
||||
setIsPanning(!isPanning);
|
||||
}}
|
||||
disabled={currentView !== 'viewer'}
|
||||
@ -278,33 +258,16 @@ export default function RightRail() {
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
{/* Rotate Left */}
|
||||
<Tooltip content={t('rightRail.rotateLeft', 'Rotate Left')} position="left" offset={12} arrow>
|
||||
{/* Select Mode */}
|
||||
<Tooltip content={t('rightRail.selectMode', 'Select Mode')} position="left" offset={12} arrow>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => {
|
||||
window.embedPdfRotate?.rotateBackward();
|
||||
}}
|
||||
onClick={() => (window as any).embedPdfControls?.pointer()}
|
||||
disabled={currentView !== 'viewer'}
|
||||
>
|
||||
<LocalIcon icon="rotate-left" width="1.5rem" height="1.5rem" />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
{/* Rotate Right */}
|
||||
<Tooltip content={t('rightRail.rotateRight', 'Rotate Right')} position="left" offset={12} arrow>
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => {
|
||||
window.embedPdfRotate?.rotateForward();
|
||||
}}
|
||||
disabled={currentView !== 'viewer'}
|
||||
>
|
||||
<LocalIcon icon="rotate-right" width="1.5rem" height="1.5rem" />
|
||||
<LocalIcon icon="mouse-pointer" width="1.5rem" height="1.5rem" />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
@ -314,7 +277,7 @@ export default function RightRail() {
|
||||
variant="subtle"
|
||||
radius="md"
|
||||
className="right-rail-icon"
|
||||
onClick={() => window.toggleThumbnailSidebar?.()}
|
||||
onClick={() => (window as any).toggleThumbnailSidebar?.()}
|
||||
disabled={currentView !== 'viewer'}
|
||||
>
|
||||
<LocalIcon icon="view-list" width="1.5rem" height="1.5rem" />
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Stack, TextInput, Select, Checkbox } from '@mantine/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { isSplitMethod, SPLIT_METHODS } from '../../../constants/splitConstants';
|
||||
import { isSplitMode, isSplitType, SPLIT_MODES, SPLIT_TYPES } from '../../../constants/splitConstants';
|
||||
import { SplitParameters } from '../../../hooks/tools/split/useSplitParameters';
|
||||
|
||||
export interface SplitSettingsProps {
|
||||
@ -57,37 +57,28 @@ const SplitSettings = ({
|
||||
</Stack>
|
||||
);
|
||||
|
||||
const renderSplitValueForm = () => {
|
||||
let label, placeholder;
|
||||
|
||||
switch (parameters.method) {
|
||||
case SPLIT_METHODS.BY_SIZE:
|
||||
label = t("split.value.fileSize.label", "File Size");
|
||||
placeholder = t("split.value.fileSize.placeholder", "e.g. 10MB, 500KB");
|
||||
break;
|
||||
case SPLIT_METHODS.BY_PAGE_COUNT:
|
||||
label = t("split.value.pageCount.label", "Pages per File");
|
||||
placeholder = t("split.value.pageCount.placeholder", "e.g. 5, 10");
|
||||
break;
|
||||
case SPLIT_METHODS.BY_DOC_COUNT:
|
||||
label = t("split.value.docCount.label", "Number of Files");
|
||||
placeholder = t("split.value.docCount.placeholder", "e.g. 3, 5");
|
||||
break;
|
||||
default:
|
||||
label = t("split-by-size-or-count.value.label", "Split Value");
|
||||
placeholder = t("split-by-size-or-count.value.placeholder", "e.g. 10MB or 5 pages");
|
||||
}
|
||||
|
||||
return (
|
||||
const renderBySizeOrCountForm = () => (
|
||||
<Stack gap="sm">
|
||||
<Select
|
||||
label={t("split-by-size-or-count.type.label", "Split Type")}
|
||||
value={parameters.splitType}
|
||||
onChange={(v) => isSplitType(v) && onParameterChange('splitType', v)}
|
||||
disabled={disabled}
|
||||
data={[
|
||||
{ value: SPLIT_TYPES.SIZE, label: t("split-by-size-or-count.type.size", "By Size") },
|
||||
{ value: SPLIT_TYPES.PAGES, label: t("split-by-size-or-count.type.pageCount", "By Page Count") },
|
||||
{ value: SPLIT_TYPES.DOCS, label: t("split-by-size-or-count.type.docCount", "By Document Count") },
|
||||
]}
|
||||
/>
|
||||
<TextInput
|
||||
label={label}
|
||||
placeholder={placeholder}
|
||||
label={t("split-by-size-or-count.value.label", "Split Value")}
|
||||
placeholder={t("split-by-size-or-count.value.placeholder", "e.g. 10MB or 5 pages")}
|
||||
value={parameters.splitValue}
|
||||
onChange={(e) => onParameterChange('splitValue', e.target.value)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
);
|
||||
};
|
||||
</Stack>
|
||||
);
|
||||
|
||||
const renderByChaptersForm = () => (
|
||||
<Stack gap="sm">
|
||||
@ -115,30 +106,26 @@ const SplitSettings = ({
|
||||
|
||||
return (
|
||||
<Stack gap="md">
|
||||
{/* Method Selector */}
|
||||
{/* Mode Selector */}
|
||||
<Select
|
||||
label={t("split.method.label", "Choose split method")}
|
||||
placeholder={t("split.method.placeholder", "Select how to split the PDF")}
|
||||
value={parameters.method}
|
||||
onChange={(v) => isSplitMethod(v) && onParameterChange('method', v)}
|
||||
label="Choose split method"
|
||||
placeholder="Select how to split the PDF"
|
||||
value={parameters.mode}
|
||||
onChange={(v) => isSplitMode(v) && onParameterChange('mode', v)}
|
||||
disabled={disabled}
|
||||
data={[
|
||||
{ value: SPLIT_METHODS.BY_PAGES, label: t("split.methods.byPages", "Split at Pages Numbers") },
|
||||
{ value: SPLIT_METHODS.BY_SECTIONS, label: t("split.methods.bySections", "Split by Sections") },
|
||||
{ value: SPLIT_METHODS.BY_SIZE, label: t("split.methods.bySize", "Split by Size") },
|
||||
{ value: SPLIT_METHODS.BY_PAGE_COUNT, label: t("split.methods.byPageCount", "Split by Page Count") },
|
||||
{ value: SPLIT_METHODS.BY_DOC_COUNT, label: t("split.methods.byDocCount", "Split by Document Count") },
|
||||
{ value: SPLIT_METHODS.BY_CHAPTERS, label: t("split.methods.byChapters", "Split by Chapters") },
|
||||
{ value: SPLIT_MODES.BY_PAGES, label: t("split.header", "Split by Pages") + " (e.g. 1,3,5-10)" },
|
||||
{ value: SPLIT_MODES.BY_SECTIONS, label: t("split-by-sections.title", "Split by Grid Sections") },
|
||||
{ value: SPLIT_MODES.BY_SIZE_OR_COUNT, label: t("split-by-size-or-count.title", "Split by Size or Count") },
|
||||
{ value: SPLIT_MODES.BY_CHAPTERS, label: t("splitByChapters.title", "Split by Chapters") },
|
||||
]}
|
||||
/>
|
||||
|
||||
{/* Parameter Form */}
|
||||
{parameters.method === SPLIT_METHODS.BY_PAGES && renderByPagesForm()}
|
||||
{parameters.method === SPLIT_METHODS.BY_SECTIONS && renderBySectionsForm()}
|
||||
{(parameters.method === SPLIT_METHODS.BY_SIZE ||
|
||||
parameters.method === SPLIT_METHODS.BY_PAGE_COUNT ||
|
||||
parameters.method === SPLIT_METHODS.BY_DOC_COUNT) && renderSplitValueForm()}
|
||||
{parameters.method === SPLIT_METHODS.BY_CHAPTERS && renderByChaptersForm()}
|
||||
{parameters.mode === SPLIT_MODES.BY_PAGES && renderByPagesForm()}
|
||||
{parameters.mode === SPLIT_MODES.BY_SECTIONS && renderBySectionsForm()}
|
||||
{parameters.mode === SPLIT_MODES.BY_SIZE_OR_COUNT && renderBySizeOrCountForm()}
|
||||
{parameters.mode === SPLIT_MODES.BY_CHAPTERS && renderByChaptersForm()}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
@ -1,59 +0,0 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TooltipContent } from '../../types/tips';
|
||||
|
||||
export const useSplitTips = (): TooltipContent => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return {
|
||||
header: {
|
||||
title: t("split.tooltip.header.title", "Split Methods Overview")
|
||||
},
|
||||
tips: [
|
||||
{
|
||||
title: t("split.tooltip.byPages.title", "Split at Page Numbers"),
|
||||
description: t("split.tooltip.byPages.text", "Extract specific pages or ranges from your PDF. Use commas to separate individual pages and hyphens for ranges."),
|
||||
bullets: [
|
||||
t("split.tooltip.byPages.bullet1", "Single pages: 1,3,5"),
|
||||
t("split.tooltip.byPages.bullet2", "Page ranges: 1-5,10-15"),
|
||||
t("split.tooltip.byPages.bullet3", "Mixed: 1,3-7,12,15-20")
|
||||
]
|
||||
},
|
||||
{
|
||||
title: t("split.tooltip.bySections.title", "Split by Grid Sections"),
|
||||
description: t("split.tooltip.bySections.text", "Divide each page into a grid of sections. Useful for splitting documents with multiple columns or extracting specific areas."),
|
||||
bullets: [
|
||||
t("split.tooltip.bySections.bullet1", "Horizontal: Number of rows to create"),
|
||||
t("split.tooltip.bySections.bullet2", "Vertical: Number of columns to create"),
|
||||
t("split.tooltip.bySections.bullet3", "Merge: Combine all sections into one PDF")
|
||||
]
|
||||
},
|
||||
{
|
||||
title: t("split.tooltip.bySize.title", "Split by File Size"),
|
||||
description: t("split.tooltip.bySize.text", "Create multiple PDFs that don't exceed a specified file size. Ideal for file size limitations or email attachments."),
|
||||
bullets: [
|
||||
t("split.tooltip.bySize.bullet1", "Use MB for larger files (e.g., 10MB)"),
|
||||
t("split.tooltip.bySize.bullet2", "Use KB for smaller files (e.g., 500KB)"),
|
||||
t("split.tooltip.bySize.bullet3", "System will split at page boundaries")
|
||||
]
|
||||
},
|
||||
{
|
||||
title: t("split.tooltip.byCount.title", "Split by Count"),
|
||||
description: t("split.tooltip.byCount.text", "Create multiple PDFs with a specific number of pages or documents each."),
|
||||
bullets: [
|
||||
t("split.tooltip.byCount.bullet1", "Page Count: Fixed number of pages per file"),
|
||||
t("split.tooltip.byCount.bullet2", "Document Count: Fixed number of output files"),
|
||||
t("split.tooltip.byCount.bullet3", "Useful for batch processing workflows")
|
||||
]
|
||||
},
|
||||
{
|
||||
title: t("split.tooltip.byChapters.title", "Split by Chapters"),
|
||||
description: t("split.tooltip.byChapters.text", "Use PDF bookmarks to automatically split at chapter boundaries. Requires PDFs with bookmark structure."),
|
||||
bullets: [
|
||||
t("split.tooltip.byChapters.bullet1", "Bookmark Level: Which level to split on (1=top level)"),
|
||||
t("split.tooltip.byChapters.bullet2", "Include Metadata: Preserve document properties"),
|
||||
t("split.tooltip.byChapters.bullet3", "Allow Duplicates: Handle repeated bookmark names")
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Box, Center, Text, ActionIcon } from '@mantine/core';
|
||||
import { Box, Center, Text, ActionIcon, Tabs } from '@mantine/core';
|
||||
import { useMantineTheme, useMantineColorScheme } from '@mantine/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
|
||||
import { useFileState } from "../../contexts/FileContext";
|
||||
@ -19,11 +20,12 @@ export interface EmbedPdfViewerProps {
|
||||
}
|
||||
|
||||
const EmbedPdfViewerContent = ({
|
||||
sidebarsVisible: _sidebarsVisible,
|
||||
setSidebarsVisible: _setSidebarsVisible,
|
||||
sidebarsVisible,
|
||||
setSidebarsVisible,
|
||||
onClose,
|
||||
previewFile,
|
||||
}: EmbedPdfViewerProps) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useMantineTheme();
|
||||
const { colorScheme } = useMantineColorScheme();
|
||||
const viewerRef = React.useRef<HTMLDivElement>(null);
|
||||
|
@ -8,7 +8,7 @@ import { Viewport, ViewportPluginPackage } from '@embedpdf/plugin-viewport/react
|
||||
import { Scroller, ScrollPluginPackage, ScrollStrategy } from '@embedpdf/plugin-scroll/react';
|
||||
import { LoaderPluginPackage } from '@embedpdf/plugin-loader/react';
|
||||
import { RenderLayer, RenderPluginPackage } from '@embedpdf/plugin-render/react';
|
||||
import { ZoomPluginPackage } from '@embedpdf/plugin-zoom/react';
|
||||
import { ZoomPluginPackage, ZoomMode } from '@embedpdf/plugin-zoom/react';
|
||||
import { InteractionManagerPluginPackage, PagePointerProvider, GlobalPointerProvider } from '@embedpdf/plugin-interaction-manager/react';
|
||||
import { SelectionLayer, SelectionPluginPackage } from '@embedpdf/plugin-selection/react';
|
||||
import { TilingLayer, TilingPluginPackage } from '@embedpdf/plugin-tiling/react';
|
||||
@ -16,8 +16,6 @@ import { PanPluginPackage } from '@embedpdf/plugin-pan/react';
|
||||
import { SpreadPluginPackage, SpreadMode } from '@embedpdf/plugin-spread/react';
|
||||
import { SearchPluginPackage } from '@embedpdf/plugin-search/react';
|
||||
import { ThumbnailPluginPackage } from '@embedpdf/plugin-thumbnail/react';
|
||||
import { RotatePluginPackage, Rotate } from '@embedpdf/plugin-rotate/react';
|
||||
import { Rotation } from '@embedpdf/models';
|
||||
import { CustomSearchLayer } from './CustomSearchLayer';
|
||||
import { ZoomAPIBridge } from './ZoomAPIBridge';
|
||||
import { ScrollAPIBridge } from './ScrollAPIBridge';
|
||||
@ -26,7 +24,6 @@ import { PanAPIBridge } from './PanAPIBridge';
|
||||
import { SpreadAPIBridge } from './SpreadAPIBridge';
|
||||
import { SearchAPIBridge } from './SearchAPIBridge';
|
||||
import { ThumbnailAPIBridge } from './ThumbnailAPIBridge';
|
||||
import { RotateAPIBridge } from './RotateAPIBridge';
|
||||
|
||||
interface LocalEmbedPDFProps {
|
||||
file?: File | Blob;
|
||||
@ -36,7 +33,7 @@ interface LocalEmbedPDFProps {
|
||||
|
||||
export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
const [pdfUrl, setPdfUrl] = useState<string | null>(null);
|
||||
|
||||
|
||||
// Convert color scheme (handle 'auto' mode by defaulting to 'light')
|
||||
const actualColorScheme = colorScheme === 'auto' ? 'light' : colorScheme;
|
||||
|
||||
@ -54,7 +51,7 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
// Create plugins configuration
|
||||
const plugins = useMemo(() => {
|
||||
if (!pdfUrl) return [];
|
||||
|
||||
|
||||
return [
|
||||
createPluginRegistration(LoaderPluginPackage, {
|
||||
loadingOptions: {
|
||||
@ -73,47 +70,42 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
initialPage: 0,
|
||||
}),
|
||||
createPluginRegistration(RenderPluginPackage),
|
||||
|
||||
|
||||
// Register interaction manager (required for zoom and selection features)
|
||||
createPluginRegistration(InteractionManagerPluginPackage),
|
||||
|
||||
|
||||
// Register selection plugin (depends on InteractionManager)
|
||||
createPluginRegistration(SelectionPluginPackage),
|
||||
|
||||
|
||||
// Register pan plugin (depends on Viewport, InteractionManager)
|
||||
createPluginRegistration(PanPluginPackage, {
|
||||
defaultMode: 'mobile', // Try mobile mode which might be more permissive
|
||||
}),
|
||||
|
||||
|
||||
// Register zoom plugin with configuration
|
||||
createPluginRegistration(ZoomPluginPackage, {
|
||||
defaultZoomLevel: 1.4, // Start at 140% zoom for better readability
|
||||
defaultZoomLevel: 1.0, // Start at exactly 100% zoom
|
||||
minZoom: 0.2,
|
||||
maxZoom: 3.0,
|
||||
}),
|
||||
|
||||
|
||||
// Register tiling plugin (depends on Render, Scroll, Viewport)
|
||||
createPluginRegistration(TilingPluginPackage, {
|
||||
tileSize: 768,
|
||||
overlapPx: 5,
|
||||
extraRings: 1,
|
||||
}),
|
||||
|
||||
|
||||
// Register spread plugin for dual page layout
|
||||
createPluginRegistration(SpreadPluginPackage, {
|
||||
defaultSpreadMode: SpreadMode.None, // Start with single page view
|
||||
}),
|
||||
|
||||
|
||||
// Register search plugin for text search
|
||||
createPluginRegistration(SearchPluginPackage),
|
||||
|
||||
|
||||
// Register thumbnail plugin for page thumbnails
|
||||
createPluginRegistration(ThumbnailPluginPackage),
|
||||
|
||||
// Register rotate plugin
|
||||
createPluginRegistration(RotatePluginPackage, {
|
||||
defaultRotation: Rotation.Degree0, // Start with no rotation
|
||||
}),
|
||||
];
|
||||
}, [pdfUrl]);
|
||||
|
||||
@ -178,10 +170,10 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
|
||||
// Wrap your UI with the <EmbedPDF> provider
|
||||
return (
|
||||
<div style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
position: 'relative',
|
||||
<div style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
@ -195,7 +187,6 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
<SpreadAPIBridge />
|
||||
<SearchAPIBridge />
|
||||
<ThumbnailAPIBridge />
|
||||
<RotateAPIBridge />
|
||||
<GlobalPointerProvider>
|
||||
<Viewport
|
||||
style={{
|
||||
@ -214,37 +205,35 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
>
|
||||
<Scroller
|
||||
renderPage={({ width, height, pageIndex, scale, rotation }: { width: number; height: number; pageIndex: number; scale: number; rotation?: number }) => (
|
||||
<Rotate pageSize={{ width, height }}>
|
||||
<PagePointerProvider {...{ pageWidth: width, pageHeight: height, pageIndex, scale, rotation: rotation || 0 }}>
|
||||
<div
|
||||
style={{
|
||||
width,
|
||||
height,
|
||||
position: 'relative',
|
||||
userSelect: 'none',
|
||||
WebkitUserSelect: 'none',
|
||||
MozUserSelect: 'none',
|
||||
msUserSelect: 'none'
|
||||
}}
|
||||
draggable={false}
|
||||
onDragStart={(e) => e.preventDefault()}
|
||||
onDrop={(e) => e.preventDefault()}
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
>
|
||||
{/* 1. Low-resolution base layer for immediate feedback */}
|
||||
<RenderLayer pageIndex={pageIndex} scale={0.5} />
|
||||
|
||||
{/* 2. High-resolution tile layer on top */}
|
||||
<TilingLayer pageIndex={pageIndex} scale={scale} />
|
||||
|
||||
{/* 3. Search highlight layer */}
|
||||
<CustomSearchLayer pageIndex={pageIndex} scale={scale} />
|
||||
|
||||
{/* 4. Selection layer for text interaction */}
|
||||
<SelectionLayer pageIndex={pageIndex} scale={scale} />
|
||||
</div>
|
||||
</PagePointerProvider>
|
||||
</Rotate>
|
||||
<PagePointerProvider {...{ pageWidth: width, pageHeight: height, pageIndex, scale, rotation: rotation || 0 }}>
|
||||
<div
|
||||
style={{
|
||||
width,
|
||||
height,
|
||||
position: 'relative',
|
||||
userSelect: 'none',
|
||||
WebkitUserSelect: 'none',
|
||||
MozUserSelect: 'none',
|
||||
msUserSelect: 'none'
|
||||
}}
|
||||
draggable={false}
|
||||
onDragStart={(e) => e.preventDefault()}
|
||||
onDrop={(e) => e.preventDefault()}
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
>
|
||||
{/* 1. Low-resolution base layer for immediate feedback */}
|
||||
<RenderLayer pageIndex={pageIndex} scale={0.5} />
|
||||
|
||||
{/* 2. High-resolution tile layer on top */}
|
||||
<TilingLayer pageIndex={pageIndex} scale={scale} />
|
||||
|
||||
{/* 3. Search highlight layer */}
|
||||
<CustomSearchLayer pageIndex={pageIndex} scale={scale} />
|
||||
|
||||
{/* 4. Selection layer for text interaction */}
|
||||
<SelectionLayer pageIndex={pageIndex} scale={scale} />
|
||||
</div>
|
||||
</PagePointerProvider>
|
||||
)}
|
||||
/>
|
||||
</Viewport>
|
||||
@ -252,4 +241,4 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) {
|
||||
</EmbedPDF>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
@ -35,6 +35,8 @@ export function PanAPIBridge() {
|
||||
},
|
||||
};
|
||||
|
||||
} else {
|
||||
console.warn('EmbedPDF pan API not available yet');
|
||||
}
|
||||
}, [pan, isPanning]);
|
||||
|
||||
|
@ -36,6 +36,7 @@ export function PdfViewerToolbar({
|
||||
const [dynamicZoom, setDynamicZoom] = useState(currentZoom);
|
||||
const [dynamicPage, setDynamicPage] = useState(currentPage);
|
||||
const [dynamicTotalPages, setDynamicTotalPages] = useState(totalPages);
|
||||
const [isPanning, setIsPanning] = useState(false);
|
||||
|
||||
// Update zoom and scroll state from EmbedPDF APIs
|
||||
useEffect(() => {
|
||||
@ -55,6 +56,11 @@ export function PdfViewerToolbar({
|
||||
setPageInput(currentPageNum);
|
||||
}
|
||||
|
||||
// Update pan mode state
|
||||
if (window.embedPdfPan) {
|
||||
const panState = window.embedPdfPan.isPanning || false;
|
||||
setIsPanning(panState);
|
||||
}
|
||||
};
|
||||
|
||||
// Update state immediately
|
||||
|
@ -1,23 +0,0 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useRotate } from '@embedpdf/plugin-rotate/react';
|
||||
|
||||
/**
|
||||
* Component that runs inside EmbedPDF context and exports rotate controls globally
|
||||
*/
|
||||
export function RotateAPIBridge() {
|
||||
const { provides: rotate, rotation } = useRotate();
|
||||
|
||||
useEffect(() => {
|
||||
if (rotate) {
|
||||
// Export rotate controls to global window for right rail access
|
||||
window.embedPdfRotate = {
|
||||
rotateForward: () => rotate.rotateForward(),
|
||||
rotateBackward: () => rotate.rotateBackward(),
|
||||
setRotation: (rotationValue: number) => rotate.setRotation(rotationValue),
|
||||
getRotation: () => rotation,
|
||||
};
|
||||
}
|
||||
}, [rotate, rotation]);
|
||||
|
||||
return null;
|
||||
}
|
@ -33,6 +33,8 @@ export function SpreadAPIBridge() {
|
||||
spreadAPI: spread,
|
||||
availableMethods: Object.keys(spread)
|
||||
});
|
||||
} else {
|
||||
console.warn('EmbedPDF spread API not available yet');
|
||||
}
|
||||
}, [spread, spreadMode]);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { useZoom } from '@embedpdf/plugin-zoom/react';
|
||||
|
||||
/**
|
||||
@ -6,30 +6,17 @@ import { useZoom } from '@embedpdf/plugin-zoom/react';
|
||||
*/
|
||||
export function ZoomAPIBridge() {
|
||||
const { provides: zoom, state: zoomState } = useZoom();
|
||||
const hasSetInitialZoom = useRef(false);
|
||||
|
||||
// Set initial zoom once when plugin is ready
|
||||
useEffect(() => {
|
||||
if (zoom && !hasSetInitialZoom.current) {
|
||||
hasSetInitialZoom.current = true;
|
||||
setTimeout(() => {
|
||||
console.log('Setting initial zoom to 140%');
|
||||
zoom.requestZoom(1.4);
|
||||
}, 50);
|
||||
}
|
||||
}, [zoom]);
|
||||
|
||||
useEffect(() => {
|
||||
if (zoom) {
|
||||
|
||||
// Export zoom controls to global window for right rail access
|
||||
(window as any).embedPdfZoom = {
|
||||
zoomIn: () => zoom.zoomIn(),
|
||||
zoomOut: () => zoom.zoomOut(),
|
||||
toggleMarqueeZoom: () => zoom.toggleMarqueeZoom(),
|
||||
requestZoom: (level: any) => zoom.requestZoom(level),
|
||||
currentZoom: zoomState?.currentZoomLevel || 1.4,
|
||||
zoomPercent: Math.round((zoomState?.currentZoomLevel || 1.4) * 100),
|
||||
currentZoom: zoomState?.currentZoomLevel || 1,
|
||||
zoomPercent: Math.round((zoomState?.currentZoomLevel || 1) * 100),
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,25 +1,30 @@
|
||||
export const SPLIT_METHODS = {
|
||||
export const SPLIT_MODES = {
|
||||
BY_PAGES: 'byPages',
|
||||
BY_SECTIONS: 'bySections',
|
||||
BY_SIZE: 'bySize',
|
||||
BY_PAGE_COUNT: 'byPageCount',
|
||||
BY_DOC_COUNT: 'byDocCount',
|
||||
BY_SIZE_OR_COUNT: 'bySizeOrCount',
|
||||
BY_CHAPTERS: 'byChapters'
|
||||
} as const;
|
||||
|
||||
|
||||
export const ENDPOINTS = {
|
||||
[SPLIT_METHODS.BY_PAGES]: 'split-pages',
|
||||
[SPLIT_METHODS.BY_SECTIONS]: 'split-pdf-by-sections',
|
||||
[SPLIT_METHODS.BY_SIZE]: 'split-by-size-or-count',
|
||||
[SPLIT_METHODS.BY_PAGE_COUNT]: 'split-by-size-or-count',
|
||||
[SPLIT_METHODS.BY_DOC_COUNT]: 'split-by-size-or-count',
|
||||
[SPLIT_METHODS.BY_CHAPTERS]: 'split-pdf-by-chapters'
|
||||
export const SPLIT_TYPES = {
|
||||
SIZE: 'size',
|
||||
PAGES: 'pages',
|
||||
DOCS: 'docs'
|
||||
} as const;
|
||||
|
||||
export type SplitMethod = typeof SPLIT_METHODS[keyof typeof SPLIT_METHODS];
|
||||
export const isSplitMethod = (value: string | null): value is SplitMethod => {
|
||||
return Object.values(SPLIT_METHODS).includes(value as SplitMethod);
|
||||
export const ENDPOINTS = {
|
||||
[SPLIT_MODES.BY_PAGES]: 'split-pages',
|
||||
[SPLIT_MODES.BY_SECTIONS]: 'split-pdf-by-sections',
|
||||
[SPLIT_MODES.BY_SIZE_OR_COUNT]: 'split-by-size-or-count',
|
||||
[SPLIT_MODES.BY_CHAPTERS]: 'split-pdf-by-chapters'
|
||||
} as const;
|
||||
|
||||
export type SplitMode = typeof SPLIT_MODES[keyof typeof SPLIT_MODES];
|
||||
export type SplitType = typeof SPLIT_TYPES[keyof typeof SPLIT_TYPES];
|
||||
|
||||
export const isSplitMode = (value: string | null): value is SplitMode => {
|
||||
return Object.values(SPLIT_MODES).includes(value as SplitMode);
|
||||
}
|
||||
|
||||
|
||||
export const isSplitType = (value: string | null): value is SplitType => {
|
||||
return Object.values(SPLIT_TYPES).includes(value as SplitType);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { ToolType, useToolOperation, ToolOperationConfig } from '../shared/useToolOperation';
|
||||
import { createStandardErrorHandler } from '../../../utils/toolErrorHandler';
|
||||
import { SplitParameters, defaultParameters } from './useSplitParameters';
|
||||
import { SPLIT_METHODS } from '../../../constants/splitConstants';
|
||||
import { SPLIT_MODES } from '../../../constants/splitConstants';
|
||||
import { useToolResources } from '../shared/useToolResources';
|
||||
|
||||
// Static functions that can be used by both the hook and automation executor
|
||||
@ -12,53 +12,46 @@ export const buildSplitFormData = (parameters: SplitParameters, file: File): For
|
||||
|
||||
formData.append("fileInput", file);
|
||||
|
||||
switch (parameters.method) {
|
||||
case SPLIT_METHODS.BY_PAGES:
|
||||
switch (parameters.mode) {
|
||||
case SPLIT_MODES.BY_PAGES:
|
||||
formData.append("pageNumbers", parameters.pages);
|
||||
break;
|
||||
case SPLIT_METHODS.BY_SECTIONS:
|
||||
case SPLIT_MODES.BY_SECTIONS:
|
||||
formData.append("horizontalDivisions", parameters.hDiv);
|
||||
formData.append("verticalDivisions", parameters.vDiv);
|
||||
formData.append("merge", parameters.merge.toString());
|
||||
break;
|
||||
case SPLIT_METHODS.BY_SIZE:
|
||||
formData.append("splitType", "0");
|
||||
case SPLIT_MODES.BY_SIZE_OR_COUNT:
|
||||
formData.append(
|
||||
"splitType",
|
||||
parameters.splitType === "size" ? "0" : parameters.splitType === "pages" ? "1" : "2"
|
||||
);
|
||||
formData.append("splitValue", parameters.splitValue);
|
||||
break;
|
||||
case SPLIT_METHODS.BY_PAGE_COUNT:
|
||||
formData.append("splitType", "1");
|
||||
formData.append("splitValue", parameters.splitValue);
|
||||
break;
|
||||
case SPLIT_METHODS.BY_DOC_COUNT:
|
||||
formData.append("splitType", "2");
|
||||
formData.append("splitValue", parameters.splitValue);
|
||||
break;
|
||||
case SPLIT_METHODS.BY_CHAPTERS:
|
||||
case SPLIT_MODES.BY_CHAPTERS:
|
||||
formData.append("bookmarkLevel", parameters.bookmarkLevel);
|
||||
formData.append("includeMetadata", parameters.includeMetadata.toString());
|
||||
formData.append("allowDuplicates", parameters.allowDuplicates.toString());
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown split method: ${parameters.method}`);
|
||||
throw new Error(`Unknown split mode: ${parameters.mode}`);
|
||||
}
|
||||
|
||||
return formData;
|
||||
};
|
||||
|
||||
export const getSplitEndpoint = (parameters: SplitParameters): string => {
|
||||
switch (parameters.method) {
|
||||
case SPLIT_METHODS.BY_PAGES:
|
||||
switch (parameters.mode) {
|
||||
case SPLIT_MODES.BY_PAGES:
|
||||
return "/api/v1/general/split-pages";
|
||||
case SPLIT_METHODS.BY_SECTIONS:
|
||||
case SPLIT_MODES.BY_SECTIONS:
|
||||
return "/api/v1/general/split-pdf-by-sections";
|
||||
case SPLIT_METHODS.BY_SIZE:
|
||||
case SPLIT_METHODS.BY_PAGE_COUNT:
|
||||
case SPLIT_METHODS.BY_DOC_COUNT:
|
||||
case SPLIT_MODES.BY_SIZE_OR_COUNT:
|
||||
return "/api/v1/general/split-by-size-or-count";
|
||||
case SPLIT_METHODS.BY_CHAPTERS:
|
||||
case SPLIT_MODES.BY_CHAPTERS:
|
||||
return "/api/v1/general/split-pdf-by-chapters";
|
||||
default:
|
||||
throw new Error(`Unknown split method: ${parameters.method}`);
|
||||
throw new Error(`Unknown split mode: ${parameters.mode}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
import { SPLIT_METHODS, ENDPOINTS, type SplitMethod } from '../../../constants/splitConstants';
|
||||
import { SPLIT_MODES, SPLIT_TYPES, ENDPOINTS, type SplitMode, SplitType } from '../../../constants/splitConstants';
|
||||
import { BaseParameters } from '../../../types/parameters';
|
||||
import { useBaseParameters, BaseParametersHook } from '../shared/useBaseParameters';
|
||||
|
||||
export interface SplitParameters extends BaseParameters {
|
||||
method: SplitMethod | '';
|
||||
mode: SplitMode | '';
|
||||
pages: string;
|
||||
hDiv: string;
|
||||
vDiv: string;
|
||||
merge: boolean;
|
||||
splitType: SplitType | '';
|
||||
splitValue: string;
|
||||
bookmarkLevel: string;
|
||||
includeMetadata: boolean;
|
||||
@ -17,11 +18,12 @@ export interface SplitParameters extends BaseParameters {
|
||||
export type SplitParametersHook = BaseParametersHook<SplitParameters>;
|
||||
|
||||
export const defaultParameters: SplitParameters = {
|
||||
method: '',
|
||||
mode: '',
|
||||
pages: '',
|
||||
hDiv: '2',
|
||||
vDiv: '2',
|
||||
merge: false,
|
||||
splitType: SPLIT_TYPES.SIZE,
|
||||
splitValue: '',
|
||||
bookmarkLevel: '1',
|
||||
includeMetadata: false,
|
||||
@ -32,22 +34,20 @@ export const useSplitParameters = (): SplitParametersHook => {
|
||||
return useBaseParameters({
|
||||
defaultParameters,
|
||||
endpointName: (params) => {
|
||||
if (!params.method) return ENDPOINTS[SPLIT_METHODS.BY_PAGES];
|
||||
return ENDPOINTS[params.method as SplitMethod];
|
||||
if (!params.mode) return ENDPOINTS[SPLIT_MODES.BY_PAGES];
|
||||
return ENDPOINTS[params.mode as SplitMode];
|
||||
},
|
||||
validateFn: (params) => {
|
||||
if (!params.method) return false;
|
||||
if (!params.mode) return false;
|
||||
|
||||
switch (params.method) {
|
||||
case SPLIT_METHODS.BY_PAGES:
|
||||
switch (params.mode) {
|
||||
case SPLIT_MODES.BY_PAGES:
|
||||
return params.pages.trim() !== "";
|
||||
case SPLIT_METHODS.BY_SECTIONS:
|
||||
case SPLIT_MODES.BY_SECTIONS:
|
||||
return params.hDiv !== "" && params.vDiv !== "";
|
||||
case SPLIT_METHODS.BY_SIZE:
|
||||
case SPLIT_METHODS.BY_PAGE_COUNT:
|
||||
case SPLIT_METHODS.BY_DOC_COUNT:
|
||||
case SPLIT_MODES.BY_SIZE_OR_COUNT:
|
||||
return params.splitValue.trim() !== "";
|
||||
case SPLIT_METHODS.BY_CHAPTERS:
|
||||
case SPLIT_MODES.BY_CHAPTERS:
|
||||
return params.bookmarkLevel !== "";
|
||||
default:
|
||||
return false;
|
||||
|
@ -183,10 +183,10 @@ export const mantineTheme = createTheme({
|
||||
},
|
||||
option: {
|
||||
color: 'var(--text-primary)',
|
||||
'&[dataHovered]': {
|
||||
'&[data-hovered]': {
|
||||
backgroundColor: 'var(--hover-bg)',
|
||||
},
|
||||
'&[dataSelected]': {
|
||||
'&[data-selected]': {
|
||||
backgroundColor: 'var(--color-primary-100)',
|
||||
color: 'var(--color-primary-900)',
|
||||
},
|
||||
|
@ -4,12 +4,10 @@ import SplitSettings from "../components/tools/split/SplitSettings";
|
||||
import { useSplitParameters } from "../hooks/tools/split/useSplitParameters";
|
||||
import { useSplitOperation } from "../hooks/tools/split/useSplitOperation";
|
||||
import { useBaseTool } from "../hooks/tools/shared/useBaseTool";
|
||||
import { useSplitTips } from "../components/tooltips/useSplitTips";
|
||||
import { BaseToolProps, ToolComponent } from "../types/tool";
|
||||
|
||||
const Split = (props: BaseToolProps) => {
|
||||
const { t } = useTranslation();
|
||||
const splitTips = useSplitTips();
|
||||
|
||||
const base = useBaseTool(
|
||||
'split',
|
||||
@ -28,7 +26,6 @@ const Split = (props: BaseToolProps) => {
|
||||
title: "Settings",
|
||||
isCollapsed: base.settingsCollapsed,
|
||||
onCollapsedClick: base.hasResults ? base.handleSettingsReset : undefined,
|
||||
tooltip: splitTips,
|
||||
content: (
|
||||
<SplitSettings
|
||||
parameters={base.params.parameters}
|
||||
|
@ -17,24 +17,12 @@ export interface EmbedPdfScrollAPI {
|
||||
|
||||
export interface EmbedPdfPanAPI {
|
||||
isPanning: boolean;
|
||||
togglePan: () => void;
|
||||
}
|
||||
|
||||
export interface EmbedPdfSpreadAPI {
|
||||
toggleSpreadMode: () => void;
|
||||
}
|
||||
|
||||
export interface EmbedPdfRotateAPI {
|
||||
rotateForward: () => void;
|
||||
rotateBackward: () => void;
|
||||
setRotation: (rotation: number) => void;
|
||||
getRotation: () => number;
|
||||
}
|
||||
|
||||
export interface EmbedPdfControlsAPI {
|
||||
pointer: () => void;
|
||||
}
|
||||
|
||||
export interface EmbedPdfThumbnailAPI {
|
||||
thumbnailAPI: {
|
||||
renderThumb: (pageIndex: number, scale: number) => {
|
||||
@ -49,8 +37,6 @@ declare global {
|
||||
embedPdfScroll?: EmbedPdfScrollAPI;
|
||||
embedPdfPan?: EmbedPdfPanAPI;
|
||||
embedPdfSpread?: EmbedPdfSpreadAPI;
|
||||
embedPdfRotate?: EmbedPdfRotateAPI;
|
||||
embedPdfControls?: EmbedPdfControlsAPI;
|
||||
embedPdfThumbnail?: EmbedPdfThumbnailAPI;
|
||||
toggleThumbnailSidebar?: () => void;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user