R/dependencies.R

Defines functions bucket_list_dependencies rank_list_dependencies css_dependency

css_dependency <- function(name, files, scripts = NULL) {
  list(
    htmltools::htmlDependency(
      name,
      version = utils::packageVersion("sortable"),
      src = "htmlwidgets/plugins/sortable-rstudio",
      package = "sortable",
      stylesheet = files,
      script = scripts
    )
  )
}

rank_list_dependencies <- function() {
  css_dependency(
    "sortable-rank-list",
    files = "rank_list.css",
    scripts = "rank_list_binding.js"
  )
}

bucket_list_dependencies <- function() {
  append(
    rank_list_dependencies(),
    css_dependency("sortable-bucket-list", "bucket_list.css")
  )
}
rstudio/sortable documentation built on Sept. 13, 2024, 12:31 p.m.