From bfb7f420658a040bff3e903443c70205363aa3d2 Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Sat, 29 Aug 2026 08:46:41 +0330 Subject: [PATCH] feat(ui): integrate RichTextEditor for product full description and add click-outside handlers for dropdowns --- .../src/components/ui/RichTextEditor.tsx | 20 +- frontend/admin-panel/src/pages/Products.tsx | 24 +- frontend/application/components/Header.tsx | 7 +- graphify-out/.graphify_labels.json | 55 +- graphify-out/.graphify_labels.json.sig | 2 +- .../2026-08-29/.graphify_analysis.json | 4948 + graphify-out/2026-08-29/.graphify_labels.json | 328 + .../2026-08-29/.graphify_semantic_marker | 1 + graphify-out/2026-08-29/GRAPH_REPORT.md | 1129 + graphify-out/2026-08-29/graph.json | 133374 +++++++++++++++ graphify-out/2026-08-29/manifest.json | 3656 + graphify-out/GRAPH_REPORT.md | 338 +- ...64c68c8912277ad9645310f7e8116fbcba741.json | 1 + ...1fcbe9f74db7901cf204b5058da3132d3c1d2.json | 1 + graphify-out/cache/stat-index.json | 2 +- graphify-out/graph.html | 8 +- graphify-out/graph.json | 10834 +- graphify-out/manifest.json | 1254 +- 18 files changed, 150012 insertions(+), 5970 deletions(-) create mode 100644 graphify-out/2026-08-29/.graphify_analysis.json create mode 100644 graphify-out/2026-08-29/.graphify_labels.json create mode 100644 graphify-out/2026-08-29/.graphify_semantic_marker create mode 100644 graphify-out/2026-08-29/GRAPH_REPORT.md create mode 100644 graphify-out/2026-08-29/graph.json create mode 100644 graphify-out/2026-08-29/manifest.json create mode 100644 graphify-out/cache/ast/v0.9.44/c564f4aba35d32a733a5837c33664c68c8912277ad9645310f7e8116fbcba741.json create mode 100644 graphify-out/cache/ast/v0.9.44/d6cc5e861e43bf82dcffe1ad7121fcbe9f74db7901cf204b5058da3132d3c1d2.json diff --git a/frontend/admin-panel/src/components/ui/RichTextEditor.tsx b/frontend/admin-panel/src/components/ui/RichTextEditor.tsx index 6261e71f..23e0cc62 100644 --- a/frontend/admin-panel/src/components/ui/RichTextEditor.tsx +++ b/frontend/admin-panel/src/components/ui/RichTextEditor.tsx @@ -87,6 +87,22 @@ export default function RichTextEditor({ const [isFullscreen, setIsFullscreen] = useState(false); const [showColorPicker, setShowColorPicker] = useState(false); const [showBgColorPicker, setShowBgColorPicker] = useState(false); + const colorPickerRef = useRef(null); + const bgColorPickerRef = useRef(null); + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if (colorPickerRef.current && !colorPickerRef.current.contains(event.target as Node)) { + setShowColorPicker(false); + } + if (bgColorPickerRef.current && !bgColorPickerRef.current.contains(event.target as Node)) { + setShowBgColorPicker(false); + } + }; + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, []); + const [customColor, setCustomColor] = useState('#111827'); const [customBgColor, setCustomBgColor] = useState('#fef08a'); @@ -608,7 +624,7 @@ export default function RichTextEditor({ {/* Text Color Picker */} -
+
- + setFormData({ ...formData, description: val })} + placeholder="توضیحات کامل علمی، نحوه عملکرد مکمل و جزئیات ترکیبات محصول را وارد کنید..." + minHeight="min-h-[250px]" + />