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

Function handleArrowRight

src/driver.ts:183–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181 }
182
183 function handleArrowRight() {
184 const isTransitioning = getState("__transitionCallback");
185 if (isTransitioning) {
186 return;
187 }
188
189 const activeIndex = getState("activeIndex");
190 const activeStep = getState("__activeStep");
191 const activeElement = getState("__activeElement");
192 if (typeof activeIndex === "undefined" || typeof activeStep === "undefined") {
193 return;
194 }
195
196 const steps = getConfig("steps") || [];
197 const isLastStep = activeIndex === steps.length - 1;
198 const onDoneClick = activeStep.popover?.onDoneClick || getConfig("onDoneClick");
199 if (isLastStep && onDoneClick) {
200 return onDoneClick(activeElement, activeStep, {
201 config: getConfig(),
202 state: getState(),
203 driver: getCurrentDriver(),
204 });
205 }
206
207 const onNextClick = activeStep.popover?.onNextClick || getConfig("onNextClick");
208 if (onNextClick) {
209 return onNextClick(activeElement, activeStep, {
210 config: getConfig(),
211 state: getState(),
212 driver: getCurrentDriver(),
213 });
214 }
215
216 moveNext();
217 }
218
219 function init() {
220 if (getState("isInitialized")) {

Callers

nothing calls this directly

Calls 4

getStateFunction · 0.90
getConfigFunction · 0.90
getCurrentDriverFunction · 0.90
moveNextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…