Security Fixes: - Add DOMPurify HTML sanitization for all dangerouslySetInnerHTML usage - Create comprehensive HTML sanitization utility with configurable security levels - Implement safe template rendering for slide content and layouts - Add input validation for image sources and dangerous attributes UI/UX Improvements: - Replace browser alert() and confirm() with proper React modal components - Create reusable Modal, AlertDialog, and ConfirmDialog components - Add useDialog hook for easy dialog state management - Implement proper accessibility with keyboard navigation and focus management - Add smooth animations and responsive design for dialogs Components Added: - src/utils/htmlSanitizer.ts - Comprehensive HTML sanitization - src/components/ui/Modal.tsx - Base modal component - src/components/ui/AlertDialog.tsx - Alert dialog component - src/components/ui/ConfirmDialog.tsx - Confirmation dialog component - src/hooks/useDialog.ts - Dialog state management hook Updated Components: - SlideEditor.tsx - Now uses sanitized HTML rendering - LayoutPreviewPage.tsx - Now uses sanitized HTML rendering - PresentationEditor.tsx - Now uses React dialogs instead of browser dialogs Benefits: ✅ Eliminates XSS vulnerabilities from unsafe HTML rendering ✅ Provides consistent, accessible user interface ✅ Improves user experience with proper modal dialogs ✅ Maintains security while preserving slide formatting capabilities ✅ Follows React best practices for component composition 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
984 B
JSON
37 lines
984 B
JSON
{
|
|
"name": "slideshare",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "npm run generate-manifest && vite",
|
|
"build": "npm run generate-manifest && tsc -b && vite build",
|
|
"lint": "eslint .",
|
|
"preview": "vite preview",
|
|
"generate-manifest": "node scripts/generate-themes-manifest.js"
|
|
},
|
|
"dependencies": {
|
|
"dompurify": "^3.2.6",
|
|
"loglevel": "^1.9.2",
|
|
"postcss": "^8.5.6",
|
|
"react": "^19.1.1",
|
|
"react-dom": "^19.1.1",
|
|
"react-router-dom": "^7.8.1"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.33.0",
|
|
"@types/dompurify": "^3.0.5",
|
|
"@types/node": "^24.3.0",
|
|
"@types/react": "^19.1.10",
|
|
"@types/react-dom": "^19.1.7",
|
|
"@vitejs/plugin-react": "^5.0.0",
|
|
"eslint": "^9.33.0",
|
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
"globals": "^16.3.0",
|
|
"typescript": "~5.8.3",
|
|
"typescript-eslint": "^8.39.1",
|
|
"vite": "^7.1.2"
|
|
}
|
|
}
|