| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>Sketch Monaco Diff View Demo</title> |
| 7 | <script type="module"> |
| 8 | // Set up the demo environment with mock data service |
| 9 | import { MockGitDataService } from './mock-git-data-service.ts'; |
| 10 | import '../sketch-diff2-view.ts'; |
| 11 | |
| 12 | // Wait for DOM content to be loaded before initializing components |
| 13 | document.addEventListener('DOMContentLoaded', () => { |
| 14 | // Create a mock service instance |
| 15 | const mockService = new MockGitDataService(); |
| 16 | console.log('Demo initialized with MockGitDataService'); |
| 17 | |
| 18 | // Get the diff2 view component and set its gitService property |
| 19 | const diff2View = document.querySelector('sketch-diff2-view'); |
| 20 | if (diff2View) { |
| 21 | diff2View.gitService = mockService; |
| 22 | } |
| 23 | }); |
| 24 | </script> |
| 25 | <style> |
| 26 | body { |
| 27 | font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; |
| 28 | max-width: 1200px; |
| 29 | margin: 0 auto; |
| 30 | padding: 2rem; |
| 31 | } |
| 32 | |
| 33 | h1 { |
| 34 | color: #333; |
| 35 | margin-bottom: 2rem; |
| 36 | } |
| 37 | |
| 38 | .control-panel { |
| 39 | margin-bottom: 2rem; |
| 40 | padding: 1rem; |
| 41 | background-color: #f0f0f0; |
| 42 | border-radius: 4px; |
| 43 | } |
| 44 | |
| 45 | .demo-container { |
| 46 | display: flex; |
| 47 | height: 80vh; /* Use viewport height to ensure good sizing */ |
| 48 | min-height: 600px; /* Minimum height */ |
| 49 | border: 1px solid #ddd; |
| 50 | margin-top: 20px; |
| 51 | margin-bottom: 30px; |
| 52 | } |
| 53 | |
| 54 | sketch-diff2-view { |
| 55 | width: 100%; |
| 56 | height: 100%; |
| 57 | } |
| 58 | </style> |
| 59 | </head> |
| 60 | <body> |
| 61 | <h1>Sketch Monaco Diff View Demo</h1> |
| 62 | |
| 63 | <div class="control-panel"> |
| 64 | <p>This demonstrates the Monaco-based diff view with range and file pickers.</p> |
| 65 | <p>Using mock data to simulate the real API responses.</p> |
| 66 | </div> |
| 67 | |
| 68 | <div class="demo-container"> |
| 69 | <sketch-diff2-view></sketch-diff2-view> |
| 70 | </div> |
| 71 | |
| 72 | |
| 73 | </body> |
| 74 | </html> |