From 0bef54c51c6a58df66677d5ddab836fee65bc7e4 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 1 Jul 2026 11:20:55 +0330 Subject: [PATCH] pages list in editor --- .../catalogue/components/CatalogPreview.tsx | 2 +- src/pages/viewer/components/BookPage.tsx | 61 +++++++++++++++++-- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/src/pages/catalogue/components/CatalogPreview.tsx b/src/pages/catalogue/components/CatalogPreview.tsx index 187e3f2..c1cacab 100644 --- a/src/pages/catalogue/components/CatalogPreview.tsx +++ b/src/pages/catalogue/components/CatalogPreview.tsx @@ -90,7 +90,7 @@ const CatalogPreview: FC = ({ item, page, size, className, selected }) => height: pageHeight, }} > - + ); diff --git a/src/pages/viewer/components/BookPage.tsx b/src/pages/viewer/components/BookPage.tsx index 6deea19..278544e 100644 --- a/src/pages/viewer/components/BookPage.tsx +++ b/src/pages/viewer/components/BookPage.tsx @@ -38,6 +38,8 @@ const getRasterObjectStyle = ( type RenderObjectOptions = { skipEntrance?: boolean; + /** در پیش‌نمایش (لیست صفحات و کاتالوگ) رسانه تعاملی نباشد */ + staticMedia?: boolean; }; type BookPageProps = { @@ -56,8 +58,10 @@ type BookPageProps = { backgroundImageUrl?: string; /** فاز انیمیشن ورود — از BookViewer کنترل می‌شود */ entrancePhase?: EntrancePhase; - /** در پیش‌نمایش کاتالوگ انیمیشن ورود غیرفعال باشد */ + /** در پیش‌نمایش کاتالوگ انیمی션 ورود غیرفعال باشد */ disableEntranceAnimations?: boolean; + /** ویدیو/صوت فقط به‌صورت کاور — بدون کنترل و بدون کلیک */ + staticMedia?: boolean; /** سایهٔ لبهٔ کاغذ (گرادیان داخل DOM — سازگار با iOS قدیمی) */ showPaperShadow?: boolean; /** ورق سخت به‌جای clip-path برای iOS قدیمی */ @@ -78,7 +82,7 @@ type BookPageProps = { * نیاز به forwardRef دارد تا react-pageflip بتواند ref را مدیریت کند */ const BookPage = forwardRef( - ({ page, scale = 1, pageWidth, pageHeight, onLinkClick, backgroundType, backgroundColor, backgroundGradient, backgroundImageUrl, entrancePhase = 'idle', disableEntranceAnimations = false, showPaperShadow = true, useHardPage = false, idSuffix = '' }, ref) => { + ({ page, scale = 1, pageWidth, pageHeight, onLinkClick, backgroundType, backgroundColor, backgroundGradient, backgroundImageUrl, entrancePhase = 'idle', disableEntranceAnimations = false, staticMedia = false, showPaperShadow = true, useHardPage = false, idSuffix = '' }, ref) => { const phase: EntrancePhase = disableEntranceAnimations ? 'settled' : entrancePhase; // تابع برای تبدیل opacity به رنگ (مثل editor) // در editor، getColorWithOpacity انتظار opacity 0-100 دارد @@ -243,6 +247,35 @@ const BookPage = forwardRef( ); case 'video': + if (options.staticMedia) { + return ( +