Skip to content

Commit

Permalink
chore: Move component deps back to page functions (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Nov 2, 2023
1 parent b5ab607 commit f7c45f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
1 change: 0 additions & 1 deletion R/bs-dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ bs_theme_dependencies <- function(
meta = list(viewport = "width=device-width, initial-scale=1, shrink-to-fit=no")
)
),
if (version >= 5) component_dependencies(),
htmlDependencies(out_file)
))
}
Expand Down
19 changes: 16 additions & 3 deletions R/page.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ page <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
tags$body(...),
title = title,
theme = theme,
lang = lang
lang = lang,
component_dependencies()
),
theme = theme
)
Expand All @@ -37,7 +38,13 @@ page <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
#' @export
page_fluid <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
as_page(
shiny::fluidPage(..., title = title, theme = theme, lang = lang),
shiny::fluidPage(
...,
title = title,
theme = theme,
lang = lang,
component_dependencies()
),
theme = theme
)
}
Expand All @@ -49,7 +56,13 @@ page_fluid <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
#' @export
page_fixed <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
as_page(
shiny::fixedPage(..., title = title, theme = theme, lang = lang),
shiny::fixedPage(
...,
title = title,
theme = theme,
lang = lang,
component_dependencies()
),
theme = theme
)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/page/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link href="lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
<script src="lib/bootstrap/bootstrap.bundle.min.js"></script>
<script src="lib/bslib-component-js/components.min.js"></script>
<script src="lib/bslib-component-js/web-components.min.js" type="module"></script>
<link href="lib/bslib-component-css/components.css" rel="stylesheet" />
<script src="lib/bs3compat/transition.js"></script>
<script src="lib/bs3compat/tabs.js"></script>
<script src="lib/bs3compat/bs3compat.js"></script>
<link href="lib/htmltools-fill/fill.css" rel="stylesheet" />
<script src="lib/bslib-component-js/components.min.js"></script>
<script src="lib/bslib-component-js/web-components.min.js" type="module"></script>
<link href="lib/bslib-component-css/components.css" rel="stylesheet" />
<script src="lib/bslib-tag-require/tag-require.js"></script>

</head>
Expand Down

0 comments on commit f7c45f1

Please sign in to comment.