| 63 | const [code, setCode] = createSignal<HTMLElement[]>([]) |
| 64 | |
| 65 | const getCode = () => { |
| 66 | const el = scroll |
| 67 | if (!el) return [] |
| 68 | |
| 69 | const host = el.querySelector("diffs-container") |
| 70 | if (!(host instanceof HTMLElement)) return [] |
| 71 | |
| 72 | const root = host.shadowRoot |
| 73 | if (!root) return [] |
| 74 | |
| 75 | return Array.from(root.querySelectorAll("[data-code]")).filter( |
| 76 | (node): node is HTMLElement => node instanceof HTMLElement && node.clientWidth > 0, |
| 77 | ) |
| 78 | } |
| 79 | |
| 80 | const save = (next: ScrollPos) => { |
| 81 | pending = next |