cicerone icon indicating copy to clipboard operation
cicerone copied to clipboard

Upgrade cicerone to use the latest [email protected]

Open yogat3ch opened this issue 4 months ago • 7 comments

This PR is a relatively substantial overhaul to the cicerone package in order to create a more seamless experience of using the full feature set of driver.js with cicerone. This was accomplished by:

  • Creating snake case parity between the driver.js documentation and argument names in cicerone such that functionality of particular argument can be clearly determined.
  • Inclusion of all driver.js configuration options as explicit arguments

Changes

  • The highlight and initialise methods are now the same function and do what one would expect: create a one-off highlight on the intended element from a reactive context.
  • The prep_element prepending of # to the element when not a class or ID can be muted with el_as_is = TRUE on Cicerone$step and highlight
  • Users can supply callback JS code and the callbacks are created internally to the init method in cicerone.js to preserve Shiny and expected driver.js functionality while also allowing users to run their own code.
  • Users can reference id (the id of the driver), and this.get_driver(id) to call the driver object to run their own API calls inside a callback.

Testing

There is now a demo app in inst/shiny-examples/basic-guide/app.R for use in development and for testing. This app demonstrates a critical subset of the functionality added in this release and can be used for reviewing this PR.

Legacy functionality

R

Legacy functionality was preserved to the greatest extent possible, and deprecation warnings have been provided for all legacy argument names, with substitution and replacement occurring where possible. See deprecate_replace

No longer supported

I was unable to determine what the purpose of the legacy JS code related to tab and tab_id was, so it was omitted. This includes the usage of onHighlightTab. If we wish to retain this, please feel free to open a branch off of this one to re-integrate it.

yogat3ch avatar Apr 24 '24 18:04 yogat3ch