diff --git a/NEWS.md b/NEWS.md index 4977e06a5..1480a0e71 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## Improvements and bug fixes -* `bs_theme_dependencies()` now avoids unecessarily copying internal package files to R's temporary directory more than once when preparing precompiled theme dependencies (e.g. for a standard `bs_theme()` theme). (#1184) +* `bs_theme_dependencies()` now avoids unnecessarily copying internal package files to R's temporary directory more than once when preparing precompiled theme dependencies (e.g. for a standard `bs_theme()` theme). (#1184) * Fixed an issue where the `
` areas of `page_sidebar()` and `page_navbar()` (with a `sidebar`) were made to be a fillable containers even when `fillable = FALSE`. (#1188) @@ -14,6 +14,8 @@ * `sidebar()` gains a `fillable` argument to support vertical fill behavior in sidebars. (#1226) +* `sidebar_toggle()` is now officially deprecated in favor of `toggle_sidebar()`. (#1235) + # bslib 0.9.0 ## Breaking changes diff --git a/R/deprecated.R b/R/deprecated.R index f53dcb369..8b5a07357 100644 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -2,6 +2,10 @@ #' #' These functions have been deprecated but remain for backwards compatibility. #' +#' @section v0.9.1: +#' The function `sidebar_toggle()` is now deprecated in v0.9.1. Please use +#' [toggle_sidebar()] instead. +#' #' @section Navigation Containers: #' #' Several functions for navigation containers were renamed in version 0.5.0: @@ -163,6 +167,17 @@ page_fill <- function(...) { page_fillable(...) } +#' @rdname deprecated +#' @export +sidebar_toggle <- function(id, open = NULL, session = get_current_session()) { + lifecycle::deprecate_warn( + "0.9.1", + "sidebar_toggle()", + "toggle_sidebar()" + ) + toggle_sidebar(id = id, open = open, session = session) +} + # Legacy Nav Containers -------------------------------------------------- # This is needed since some shiny functions like `tabPanel()` call # `nav()` underneath the hood. In a future release of shiny, we diff --git a/R/sidebar.R b/R/sidebar.R index d5775ec76..02884a403 100644 --- a/R/sidebar.R +++ b/R/sidebar.R @@ -458,11 +458,6 @@ toggle_sidebar <- function(id, open = NULL, session = get_current_session()) { session$onFlush(callback, once = TRUE) } -#' @rdname sidebar -#' @usage NULL -#' @export -sidebar_toggle <- toggle_sidebar - collapse_icon <- function() { if (!is_installed("bsicons")) { icon <- "" diff --git a/R/sysdata.rda b/R/sysdata.rda index bcc19a0d5..54027e474 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/man/deprecated.Rd b/man/deprecated.Rd index 8e8df60b9..8c37deaad 100644 --- a/man/deprecated.Rd +++ b/man/deprecated.Rd @@ -17,6 +17,7 @@ \alias{bs_add_declarations} \alias{card_body_fill} \alias{page_fill} +\alias{sidebar_toggle} \alias{nav} \alias{nav_content} \alias{navs_tab} @@ -58,6 +59,8 @@ card_body_fill(...) page_fill(...) +sidebar_toggle(id, open = NULL, session = get_current_session()) + nav(...) nav_content(...) @@ -82,6 +85,12 @@ a \code{\link[=bs_theme]{bs_theme()}} object. \description{ These functions have been deprecated but remain for backwards compatibility. } +\section{v0.9.1}{ + +The function \code{sidebar_toggle()} is now deprecated in v0.9.1. Please use +\code{\link[=toggle_sidebar]{toggle_sidebar()}} instead. +} + \section{Navigation Containers}{ diff --git a/man/sidebar.Rd b/man/sidebar.Rd index ae3d5d43f..06ecaa8ac 100644 --- a/man/sidebar.Rd +++ b/man/sidebar.Rd @@ -4,7 +4,6 @@ \alias{sidebar} \alias{layout_sidebar} \alias{toggle_sidebar} -\alias{sidebar_toggle} \title{Sidebar layouts} \usage{ sidebar(