(step: DriveStep)
| 29 | } |
| 30 | |
| 31 | export function highlight(step: DriveStep) { |
| 32 | const { element } = step; |
| 33 | let elemObj = |
| 34 | typeof element === "function" ? element() : typeof element === "string" ? document.querySelector(element) : element; |
| 35 | |
| 36 | // If the element is not found, we mount a 1px div |
| 37 | // at the center of the screen to highlight and show |
| 38 | // the popover on top of that. This is to show a |
| 39 | // modal-like highlight. |
| 40 | if (!elemObj) { |
| 41 | elemObj = mountDummyElement(); |
| 42 | } |
| 43 | |
| 44 | transferHighlight(elemObj, step); |
| 45 | } |
| 46 | |
| 47 | export function refreshActiveHighlight() { |
| 48 | const activeHighlight = getState("__activeElement"); |
no test coverage detected
searching dependent graphs…