| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <title>sketch-timeline-message demo</title> |
| 4 | <link rel="stylesheet" href="demo.css" /> |
| Philip Zeyliger | 72682df | 2025-04-23 13:09:46 -0700 | [diff] [blame] | 5 | <script type="module" src="../sketch-timeline-message.ts"></script> |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 6 | |
| 7 | <script> |
| 8 | const messages = [ |
| 9 | { |
| 10 | type: "agent", |
| 11 | content: "an agent message", |
| 12 | }, |
| 13 | { |
| 14 | type: "user", |
| 15 | content: "a user message", |
| 16 | }, |
| 17 | { |
| 18 | type: "tool", |
| 19 | content: "a tool use message", |
| 20 | }, |
| 21 | { |
| Autoformatter | dded2d6 | 2025-04-28 00:27:21 +0000 | [diff] [blame] | 22 | type: "agent", |
| Sean McCullough | 8d93e36 | 2025-04-27 23:32:18 +0000 | [diff] [blame] | 23 | content: `Mermaid Sequence Diagram Example |
| 24 | \`\`\`mermaid |
| 25 | sequenceDiagram |
| 26 | participant Browser |
| 27 | participant Server |
| 28 | Browser->>Server: GET /index.html |
| 29 | Server-->>Browser: HTML Response |
| 30 | Browser->>Server: GET /style.css |
| 31 | Server-->>Browser: CSS Response |
| 32 | Browser->>Server: GET /script.js |
| 33 | Server-->>Browser: JS Response |
| 34 | \`\`\``, |
| 35 | }, |
| 36 | { |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 37 | type: "commit", |
| 38 | end_of_turn: false, |
| 39 | content: "", |
| 40 | commits: [ |
| 41 | { |
| 42 | hash: "ece101c103ec231da87f4df05c1b5e6a24e13add", |
| 43 | subject: "Add README.md for web components directory", |
| Philip Zeyliger | 2032b1c | 2025-04-23 19:40:42 -0700 | [diff] [blame] | 44 | body: "This adds documentation for the web components used in the Loop UI,\nincluding a description of each component, usage examples, and\ndevelopment guidelines.\n\nCo-Authored-By: sketch\nadd README.md for webui/src/web-components", |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 45 | pushed_branch: |
| 46 | "sketch/create-readmemd-for-web-components-directory", |
| 47 | }, |
| 48 | ], |
| 49 | timestamp: "2025-04-14T16:39:33.639533919Z", |
| 50 | conversation_id: "", |
| 51 | idx: 17, |
| 52 | }, |
| 53 | { |
| 54 | type: "agent", |
| 55 | content: "an end-of-turn agent message", |
| 56 | end_of_turn: true, |
| 57 | }, |
| 58 | ]; |
| 59 | document.addEventListener("DOMContentLoaded", () => { |
| 60 | messages.forEach((msg, idx) => { |
| 61 | const jsonEl = document.createElement("pre"); |
| 62 | jsonEl.innerText = `.message property: ${JSON.stringify(msg)}`; |
| 63 | document.body.append(jsonEl); |
| 64 | const messageEl = document.createElement("sketch-timeline-message"); |
| 65 | messageEl.message = msg; |
| 66 | document.body.appendChild(messageEl); |
| 67 | }); |
| Sean McCullough | 71941bd | 2025-04-18 13:31:48 -0700 | [diff] [blame] | 68 | window.addEventListener("show-commit-diff", (evt) => { |
| 69 | console.log("show-commit-diff", evt); |
| 70 | }); |
| Sean McCullough | 86b5686 | 2025-04-18 13:04:03 -0700 | [diff] [blame] | 71 | }); |
| 72 | </script> |
| 73 | </head> |
| 74 | <body> |
| 75 | <h1>sketch-timeline-message demo</h1> |
| 76 | </body> |
| 77 | </html> |