MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / enablePickMode

Function enablePickMode

packages/core/src/runtime/picker.ts:226–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224 }
225
226 function enablePickMode(): void {
227 if (pickModeActive) return;
228 pickModeActive = true;
229 pickModeStyleEl = document.createElement("style");
230 pickModeStyleEl.textContent = [
231 ".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",
232 ".__hf-pick-active * { cursor: crosshair !important; }",
233 ].join("\n");
234 document.head.appendChild(pickModeStyleEl);
235 document.body.classList.add("__hf-pick-active");
236 document.addEventListener("mousemove", onPickMouseMove, true);
237 document.addEventListener("click", onPickClick, true);
238 document.addEventListener("keydown", onPickKeyDown, true);
239 emitPickerRuntimeEvent("hyperframe:picker:mode", { isPickMode: true, timestamp: Date.now() });
240 }
241
242 function disablePickMode(): void {
243 if (!pickModeActive) return;

Callers

nothing calls this directly

Calls 3

emitPickerRuntimeEventFunction · 0.85
addMethod · 0.80
nowMethod · 0.80

Tested by

no test coverage detected