From fa4d2bc09a2331d6e77297d79187061ef1335e37 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Tue, 9 Dec 2025 11:43:18 +0000 Subject: [PATCH 1/2] Fix path to sample file in tour (#5186) # Description of Changes Fix path to sample file in tour --- frontend/src/core/contexts/TourOrchestrationContext.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/core/contexts/TourOrchestrationContext.tsx b/frontend/src/core/contexts/TourOrchestrationContext.tsx index f8364ba5c..a594e8322 100644 --- a/frontend/src/core/contexts/TourOrchestrationContext.tsx +++ b/frontend/src/core/contexts/TourOrchestrationContext.tsx @@ -1,4 +1,5 @@ import React, { createContext, useContext, useCallback, useRef } from 'react'; +import { BASE_PATH } from '@app/constants/app'; import { useFileHandler } from '@app/hooks/useFileHandler'; import { useFilesModalContext } from '@app/contexts/FilesModalContext'; import { useNavigationActions } from '@app/contexts/NavigationContext'; @@ -110,7 +111,7 @@ export const TourOrchestrationProvider: React.FC<{ children: React.ReactNode }> const loadSampleFile = useCallback(async () => { try { - const response = await fetch('samples/Sample.pdf'); + const response = await fetch(`${BASE_PATH}/samples/Sample.pdf`); const blob = await response.blob(); const file = new File([blob], 'Sample.pdf', { type: 'application/pdf' }); From c980ee10c0c8bebc77d6dc4a1432ffde09bfe488 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Tue, 9 Dec 2025 11:45:01 +0000 Subject: [PATCH 2/2] Backport fixes from SaaS (#5187) # Description of Changes - Add new skeleton loader style type (block - nothing's currently using it but it might as well be available) - Make Dev API overridable (and set to the new docs that actually work while Swagger docs don't work properly) --- .../core/components/shared/SkeletonLoader.tsx | 67 +++++++++++++------ frontend/src/core/constants/links.ts | 1 + .../core/data/useTranslatedToolRegistry.tsx | 3 +- 3 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 frontend/src/core/constants/links.ts diff --git a/frontend/src/core/components/shared/SkeletonLoader.tsx b/frontend/src/core/components/shared/SkeletonLoader.tsx index 63c4bd22a..a95949e8f 100644 --- a/frontend/src/core/components/shared/SkeletonLoader.tsx +++ b/frontend/src/core/components/shared/SkeletonLoader.tsx @@ -2,23 +2,44 @@ import React from 'react'; import { Box, Group, Stack } from '@mantine/core'; interface SkeletonLoaderProps { - type: 'pageGrid' | 'fileGrid' | 'controls' | 'viewer'; + type: 'pageGrid' | 'fileGrid' | 'controls' | 'viewer' | 'block'; count?: number; animated?: boolean; + width?: number | string; + height?: number | string; + radius?: number | string; } -const SkeletonLoader: React.FC = ({ - type, - count = 8, - animated = true +const SkeletonLoader: React.FC = ({ + type, + count = 8, + animated = true, + width, + height, + radius = 8, }) => { const animationStyle = animated ? { animation: 'pulse 2s infinite' } : {}; + // Generic block skeleton for inline text/inputs/etc. + const renderBlock = () => ( + + ); + const renderPageGridSkeleton = () => ( -
{Array.from({ length: count }).map((_, i) => ( = ({ w="100%" h={240} bg="gray.1" - style={{ + style={{ borderRadius: '8px', ...animationStyle, animationDelay: animated ? `${i * 0.1}s` : undefined @@ -37,10 +58,10 @@ const SkeletonLoader: React.FC = ({ ); const renderFileGridSkeleton = () => ( -
{Array.from({ length: count }).map((_, i) => ( = ({ w="100%" h={280} bg="gray.1" - style={{ + style={{ borderRadius: '8px', ...animationStyle, animationDelay: animated ? `${i * 0.1}s` : undefined @@ -76,18 +97,20 @@ const SkeletonLoader: React.FC = ({ {/* Main content skeleton */} - ); switch (type) { + case 'block': + return renderBlock(); case 'pageGrid': return renderPageGridSkeleton(); case 'fileGrid': @@ -101,4 +124,4 @@ const SkeletonLoader: React.FC = ({ } }; -export default SkeletonLoader; \ No newline at end of file +export default SkeletonLoader; diff --git a/frontend/src/core/constants/links.ts b/frontend/src/core/constants/links.ts new file mode 100644 index 000000000..c48ea04ab --- /dev/null +++ b/frontend/src/core/constants/links.ts @@ -0,0 +1 @@ +export const devApiLink = "https://registry.scalar.com/@stirlingpdf/apis/stirling-pdf-processing-api/"; diff --git a/frontend/src/core/data/useTranslatedToolRegistry.tsx b/frontend/src/core/data/useTranslatedToolRegistry.tsx index 0844b94d1..3208e4ef7 100644 --- a/frontend/src/core/data/useTranslatedToolRegistry.tsx +++ b/frontend/src/core/data/useTranslatedToolRegistry.tsx @@ -1,6 +1,7 @@ import { useMemo } from "react"; import LocalIcon from "@app/components/shared/LocalIcon"; import { useTranslation } from "react-i18next"; +import { devApiLink } from "@app/constants/links"; import SplitPdfPanel from "@app/tools/Split"; import CompressPdfPanel from "@app/tools/Compress"; import OCRPanel from "@app/tools/OCR"; @@ -784,7 +785,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog { description: t("home.devApi.desc", "Link to API documentation"), categoryId: ToolCategoryId.ADVANCED_TOOLS, subcategoryId: SubcategoryId.DEVELOPER_TOOLS, - link: "https://stirlingpdf.io/swagger-ui/5.21.0/index.html", + link: devApiLink, synonyms: getSynonyms(t, "devApi"), supportsAutomate: false, automationSettings: null