MCPcopy
hub / github.com/nilbuild/driver.js / highlight

Function highlight

src/highlight.ts:31–45  ·  view source on GitHub ↗
(step: DriveStep)

Source from the content-addressed store, hash-verified

29}
30
31export 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
47export function refreshActiveHighlight() {
48 const activeHighlight = getState("__activeElement");

Callers 2

driveFunction · 0.90
driverFunction · 0.90

Calls 2

transferHighlightFunction · 0.85
mountDummyElementFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…