Stimulus
Controller identifiers, every action, and every event with its detail shape.
Two controllers ship with the bundle, and every event they emit is prefixed ux-driver:. Events are
dispatched on the controller element and bubble, so document.addEventListener reaches all of them.
Templates print the same action attributes with ux_tour_action() and ux_hints_action(). The tables
below are the Stimulus contract those helpers emit.
Controllers
| Identifier | Drives |
|---|---|
pentiminax--ux-driver--tour | Tours and Highlights |
pentiminax--ux-driver--hints | Hints groups |
Tour actions
| Action | Effect | Param |
|---|---|---|
start | Resolves the steps and starts the Tour | index (optional) |
highlight | Highlights the first resolved step | none |
next | moveNext() | none |
previous | movePrevious() | none |
moveTo | moveTo(index) — ignored unless index is an integer | index |
refresh | refresh() | none |
destroy | Destroys the Driver.js instance | none |
Hints actions
| Action | Effect | Param |
|---|---|---|
show | Resolves the hints and calls show() | none |
hide | Hides the Hints instance | none |
open | open(hintId) | hintId |
close | close() | none |
dismiss | dismiss(hintId) | hintId |
restore | restore(hintId) | hintId |
restoreAll | Restores every current hint, by id or index | none |
refresh | refresh() | none |
Params are written as data-pentiminax--ux-driver--hints-hint-id-param="export".
Tour events
| Event | Cancelable | Detail |
|---|---|---|
ux-driver:pre-connect | no | {config} from start, {config, step} from highlight |
ux-driver:connect | no | {driver} |
ux-driver:empty | no | {id} |
ux-driver:highlight-started | no | {tourId, index, step, element, driver} |
ux-driver:highlighted | no | {tourId, index, step, element, driver} |
ux-driver:deselected | no | {tourId, index, step, element, driver} |
ux-driver:destroyed | no | {tourId, index, step, element, driver} |
ux-driver:next | yes | {tourId, index, step, element, driver} |
ux-driver:previous | yes | {tourId, index, step, element, driver} |
ux-driver:close | yes | {tourId, index, step, element, driver} |
ux-driver:done | yes | {tourId, index, step, element, driver} |
ux-driver:destroy-started | yes | {tourId, index, step, element, driver} |
Hints events
| Event | Cancelable | Detail |
|---|---|---|
ux-driver:hints-pre-connect | no | {config} |
ux-driver:hints-connect | no | {hints} |
ux-driver:empty | no | {id} |
ux-driver:hint-open | no | {groupId, hintId, hint, element, data, hints} |
ux-driver:hint-dismiss | no | {groupId, hintId, hint, element, data, hints} |
ux-driver:hint-button-click | no | {groupId, hintId, hint, element, data, hints} |
No Hints event is cancelable. ux-driver:empty is shared by both controllers and carries only the group
or Tour id.