diff --git a/DESCRIPTION b/DESCRIPTION index 4f9eca75f..f1eea4f9f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: bslib Title: Custom 'Bootstrap' 'Sass' Themes for 'shiny' and 'rmarkdown' -Version: 0.9.0.9002 +Version: 0.10.0 Authors@R: c( person("Carson", "Sievert", , "carson@posit.co", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-4958-2844")), diff --git a/NEWS.md b/NEWS.md index eed32a649..fbd1c2aae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,8 @@ -# bslib (development version) +# bslib 0.10.0 ## Breaking changes -* bslib now uses the `{brand.yml}` package for reading [brand.yml](https://posit-dev.github.io/brand.yml) files. This change improves compatibility with other tools that use brand.yml files, such as Quarto. The `{brand.yml}` package must be installed for `_brand.yml` files to be automatically discovered. (#1227) +* bslib now uses the `{brand.yml}` package for reading [brand.yml](https://posit-dev.github.io/brand-yml/) files. This change improves compatibility with other tools that use brand.yml files, such as Quarto. The `{brand.yml}` package must be installed for `_brand.yml` files to be automatically discovered. (#1227) ## New features diff --git a/R/staticimports.R b/R/staticimports.R index dd7c659d7..31392b3ff 100644 --- a/R/staticimports.R +++ b/R/staticimports.R @@ -29,8 +29,7 @@ get_package_version <- function(pkg) { } is_installed <- function(pkg, version = NULL) { - installed <- isNamespaceLoaded(pkg) || - nzchar(system_file_cached(package = pkg)) + installed <- isNamespaceLoaded(pkg) || nzchar(system_file_cached(package = pkg)) if (is.null(version)) { return(installed) @@ -39,9 +38,7 @@ is_installed <- function(pkg, version = NULL) { if (!is.character(version) && !inherits(version, "numeric_version")) { # Avoid https://bugs.r-project.org/show_bug.cgi?id=18548 alert <- if (identical(Sys.getenv("TESTTHAT"), "true")) stop else warning - alert( - "`version` must be a character string or a `package_version` or `numeric_version` object." - ) + alert("`version` must be a character string or a `package_version` or `numeric_version` object.") version <- numeric_version(sprintf("%0.9g", version)) } @@ -70,13 +67,12 @@ read_utf8 <- function(file) { } register_upgrade_message <- function(pkg, version, error = FALSE) { + msg <- sprintf( "This version of '%s' is designed to work with '%s' >= %s. Please upgrade via install.packages('%s').", environmentName(environment(register_upgrade_message)), - pkg, - version, - pkg + pkg, version, pkg ) cond <- if (error) stop else packageStartupMessage @@ -103,7 +99,7 @@ register_upgrade_message <- function(pkg, version, error = FALSE) { # Also, to keep the implementation simple, it doesn't support specification of # lib.loc or mustWork. system_file <- function(..., package = "base") { - if (!devtools_loaded(package)) { + if (!devtools_loaded(package)) { return(system_file_cached(..., package = package)) } diff --git a/R/sysdata.rda b/R/sysdata.rda index 24b61f441..a9b80cc68 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/cran-comments.md b/cran-comments.md index b4aebb108..b21a310e0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,14 +1,21 @@ - ## revdepcheck results -We checked 95 reverse dependencies (94 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. +We checked 141 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. - * We saw 0 new problems - * We failed to check 1 packages + * We saw 3 new problems + * We failed to check 0 packages Issues with CRAN packages are summarised below. -### Failed to check +### New problems + +This version of bslib uses the new `brand.yml` package for brand themes. Unlike the previous implementation, brand.yml provides more detailed validation of brand themes, but this has led to one package failing tests. + +* OmopViewer: Submitted a patch to fix this on 2026-01-21, awaiting maintainer response. https://github.com/OHDSI/OmopViewer/pull/355 + +This version of bslib introduces a new function `show_toast()`, which conflicts with a function of the same name in the shinyWidgets package. Several packages on CRAN fully import both the bslib and shinyWidgets namespaces, leading to warnings during installation about the function name conflict. + +* qrlabelr: Submitted a patch to fix this on 2025-12-19, awaiting maintainer response. https://github.com/awkena/qrlabelr/pull/4 -* Certara.VPCResults (installation error) +* tfrmtbuilder: Submitted a patch to fix this on 2025-12-19, awaiting maintainer response. https://github.com/GSK-Biostatistics/tfrmtbuilder/pull/91 diff --git a/inst/components/dist/code-editor.js b/inst/components/dist/code-editor.js index 6416c371b..dd2bf22df 100644 --- a/inst/components/dist/code-editor.js +++ b/inst/components/dist/code-editor.js @@ -1,4 +1,4 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); diff --git a/inst/components/dist/code-editor.min.js b/inst/components/dist/code-editor.min.js index faaaf8bdf..d1aedff83 100644 --- a/inst/components/dist/code-editor.min.js +++ b/inst/components/dist/code-editor.min.js @@ -1,3 +1,3 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ -var O=(n,r,e)=>{if(!r.has(n))throw TypeError("Cannot "+e)};var p=(n,r,e)=>(O(n,r,"read from private field"),e?e.call(n):r.get(n)),b=(n,r,e)=>{if(r.has(n))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(n):r.set(n,e)},U=(n,r,e,t)=>(O(n,r,"write to private field"),t?t.call(n,e):r.set(n,e),e);var m=(n,r,e)=>(O(n,r,"access private method"),e);var h=(n,r,e)=>new Promise((t,i)=>{var s=a=>{try{l(e.next(a))}catch(g){i(g)}},u=a=>{try{l(e.throw(a))}catch(g){i(g)}},l=a=>a.done?t(a.value):Promise.resolve(a.value).then(s,u);l((e=e.apply(n,r)).next())});function R(n,{type:r=null}={}){if(!window.Shiny)return;class e extends window.Shiny.InputBinding{constructor(){super()}find(i){return $(i).find(n)}getValue(i){return"getValue"in i?i.getValue():i.value}getType(i){return r}subscribe(i,s){i.onChangeCallback=s}unsubscribe(i){i.onChangeCallback=s=>{}}receiveMessage(i,s){i.receiveMessage(i,s)}}window.Shiny.inputBindings.register(new e,`${n}-Binding`)}var E=window.Shiny,te=E?E.InputBinding:class{};function P({headline:n="",message:r,status:e="warning"}){document.dispatchEvent(new CustomEvent("shiny:client-message",{detail:{headline:n,message:r,status:e}}))}function c(n,r){return Object.prototype.hasOwnProperty.call(n,r)&&n[r]!==void 0}function X(...n){return h(this,null,function*(){if(!E)throw new Error("This function must be called in a Shiny app.");return E.renderContentAsync?yield E.renderContentAsync.apply(null,n):yield E.renderContent.apply(null,n)})}function j(n,r){return h(this,null,function*(){if(typeof n!="undefined"){if(r.length!==1)throw new Error("labelNode must be of length 1");typeof n=="string"&&(n={html:n,deps:[]}),n.html===""?r.addClass("shiny-label-null"):(yield X(r,n),r.removeClass("shiny-label-null"))}})}var q="plain",z=2,J="github-light",Q="github-dark",V=400,S,w,y,f,L,M,_,C,x,o=class extends HTMLElement{constructor(){super(...arguments);this.onChangeCallback=()=>{}}get language(){var e;return(e=this.getAttribute("language"))!=null?e:q}set language(e){this.setAttribute("language",e)}get readonly(){return this.hasAttribute("readonly")&&this.getAttribute("readonly")!=="false"}set readonly(e){this.setAttribute("readonly",String(e))}get lineNumbers(){return this.getAttribute("line-numbers")!=="false"}set lineNumbers(e){this.setAttribute("line-numbers",String(e))}get wordWrap(){return this.getAttribute("word-wrap")==="true"}set wordWrap(e){this.setAttribute("word-wrap",String(e))}get tabSize(){let e=this.getAttribute("tab-size"),t=e?parseInt(e):z;return isNaN(t)?z:t}set tabSize(e){this.setAttribute("tab-size",String(e))}get insertSpaces(){return this.getAttribute("insert-spaces")!=="false"}set insertSpaces(e){this.setAttribute("insert-spaces",String(e))}get themeLight(){var e;return(e=this.getAttribute("theme-light"))!=null?e:J}set themeLight(e){this.setAttribute("theme-light",e)}get themeDark(){var e;return(e=this.getAttribute("theme-dark"))!=null?e:Q}set themeDark(e){this.setAttribute("theme-dark",e)}get value(){var e,t;return(t=(e=this.prismEditor)==null?void 0:e.value)!=null?t:""}set value(e){this.prismEditor&&this.prismEditor.setOptions({value:e})}getValue(){if(this.prismEditor)return this.value}connectedCallback(){if(this.prismEditor)return;this.initPromise=this._initializeEditor(),this.initPromise.then(()=>{this.onChangeCallback(!1)}).catch(t=>{P({headline:"Code Editor Initialization Error",message:"An error occurred while initializing the code editor. See console for details.",status:"error"}),console.error("Failed to initialize code editor:",t)});let e=()=>this.onChangeCallback(!0);this.addEventListener("bslibCodeEditorUpdate",e)}disconnectedCallback(){var e,t;(e=this.darkLightObserver)==null||e.disconnect(),this.darkLightObserver=void 0,(t=this.readonlyTooltipCleanup)==null||t.call(this),this.readonlyTooltipCleanup=void 0}attributeChangedCallback(e,t,i){var u,l;if(t===i||!this.prismEditor)return;let s=this.prismEditor;switch(e){case"language":i&&(this.languageChangePromise=this._handleLanguageChange(i));break;case"readonly":{let a=i==="true";s.setOptions({readOnly:a}),a&&!this.readonlyTooltipCleanup?this._setupReadOnlyTooltip(s):!a&&this.readonlyTooltipCleanup&&(this.readonlyTooltipCleanup(),this.readonlyTooltipCleanup=void 0);break}case"line-numbers":s.setOptions({lineNumbers:i!=="false"});break;case"word-wrap":s.setOptions({wordWrap:i==="true"});break;case"tab-size":{let a=i?parseInt(i):z;isNaN(a)||s.setOptions({tabSize:a});break}case"insert-spaces":s.setOptions({insertSpaces:i!=="false"});break;case"theme-light":i&&m(u=o,C,x).call(u,i);break;case"theme-dark":i&&m(l=o,C,x).call(l,i);break;default:break}}_initializeEditor(){return h(this,null,function*(){var D,B,N;let e=this.querySelector(".code-editor");if(!e){P({headline:"Code Editor Initialization Error",message:"Expected to find `.code-editor` inside `` container element.",status:"error"});return}let t=this.language,i=(D=this.getAttribute("value"))!=null?D:"";this.removeAttribute("value");let s=this.readonly,u=this.lineNumbers,l=this.wordWrap,a=this.tabSize,g=this.insertSpaces,v=m(B=o,f,L).call(B);yield m(N=o,M,_).call(N,t);let[{createEditor:T},{copyButton:F},{defaultCommands:W}]=yield Promise.all([import(`${v}/index.js`),import(`${v}/extensions/copyButton/index.js`),import(`${v}/extensions/commands.js`)]),k=T(e,{language:t,value:i,tabSize:a,insertSpaces:g,lineNumbers:u,wordWrap:l,readOnly:s},F(),W()),A=k.keyCommandMap.Enter;k.keyCommandMap.Enter=(I,G,K)=>I.metaKey||I.ctrlKey?(this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate")),e.classList.add("code-editor-submit-flash"),setTimeout(()=>{e.classList.remove("code-editor-submit-flash")},V),!0):A==null?void 0:A(I,G,K),this.prismEditor=k,this.darkLightObserver=this._setupThemeWatcher();let H=this.querySelector("textarea");return H&&H.addEventListener("blur",()=>{this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate"))}),s&&this._setupReadOnlyTooltip(k),k})}_setupThemeWatcher(){let e=()=>{var l;let u=document.documentElement.getAttribute("data-bs-theme")==="dark"?this.themeDark:this.themeLight;m(l=o,C,x).call(l,u)};e();let t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),t}_handleLanguageChange(e){return h(this,null,function*(){var i;let t=this.prismEditor;if(t)try{yield m(i=o,M,_).call(i,e),t.setOptions({language:e}),t.update()}catch(s){P({headline:"Code Editor Language Load Error",message:`Failed to load language '${e}'. See console for details.`,status:"error"}),console.error(`Failed to load language '${e}':`,s)}})}_setupReadOnlyTooltip(e){return h(this,null,function*(){var t;try{let i=m(t=o,f,L).call(t),[{addTooltip:s},{cursorPosition:u}]=yield Promise.all([import(`${i}/tooltips.js`),import(`${i}/extensions/cursor.js`)]);u()(e);let l=document.createElement("div");l.className="code-editor-readonly-tooltip alert alert-danger",l.textContent="Cannot edit read-only editor.";let[a,g]=s(e,l,!1),v=()=>{this.classList.add("is-invalid"),a()},T=()=>{this.classList.remove("is-invalid"),g()};e.textarea.addEventListener("beforeinput",v,!0),e.on("selectionChange",T),e.textarea.addEventListener("click",T),this.readonlyTooltipCleanup=()=>{e.textarea.removeEventListener("beforeinput",v,!0),e.textarea.removeEventListener("click",T),g()}}catch(i){console.error("Failed to setup read-only tooltip:",i)}})}receiveMessage(e,t){return h(this,null,function*(){var i;if(this.initPromise&&(yield this.initPromise),!this.prismEditor){P({headline:"Code Editor could not update",message:"An update was ignored because the editor is not yet initialized.",status:"warning"});return}if(c(t,"value")&&(this.value=(i=t.value)!=null?i:""),c(t,"label")){let s=$(this).find("label");yield j(t.label,s)}c(t,"tab_size")&&t.tab_size!==void 0&&(this.tabSize=t.tab_size),c(t,"indentation")&&(this.insertSpaces=t.indentation==="space"),c(t,"read_only")&&t.read_only!==void 0&&(this.readonly=t.read_only),c(t,"line_numbers")&&t.line_numbers!==void 0&&(this.lineNumbers=t.line_numbers),c(t,"word_wrap")&&t.word_wrap!==void 0&&(this.wordWrap=t.word_wrap),c(t,"language")&&t.language&&(this.language=t.language,this.languageChangePromise&&(yield this.languageChangePromise,this.languageChangePromise=void 0)),c(t,"theme_light")&&t.theme_light&&(this.themeLight=t.theme_light),c(t,"theme_dark")&&t.theme_dark&&(this.themeDark=t.theme_dark),this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate"))})}},d=o;S=new WeakMap,w=new WeakMap,y=new WeakMap,f=new WeakSet,L=function(){if(p(o,y)!==null)return p(o,y);let e=document.querySelector('script[src*="prism-code-editor"][src$="index.js"]');if(!e)throw new Error("Could not find prism-code-editor script element. Ensure the prism-code-editor dependency is properly loaded.");let t=e.getAttribute("src");if(!t)throw new Error("prism-code-editor script element has no src attribute");let i=new URL(t,document.baseURI).href;return U(o,y,i.replace(/\/index\.js$/,"")),p(o,y)},M=new WeakSet,_=function(e){return h(this,null,function*(){var s;if(p(o,S).has(e)||["plain","plaintext","text","txt"].includes(e))return;let t=e;e==="html"&&(t="markup"),yield import(`${m(s=o,f,L).call(s)}/prism/languages/${t}.js`),p(o,S).add(e)})},C=new WeakSet,x=function(e){var u;if(p(o,w).has(e))return;let t=`code-editor-theme-${e}`;if(document.getElementById(t)){p(o,w).add(e);return}let i=m(u=o,f,L).call(u),s=document.createElement("link");s.id=t,s.rel="stylesheet",s.href=`${i}/themes/${e}.css`,s.addEventListener("load",()=>{p(o,w).add(e)}),s.addEventListener("error",()=>{console.error(`Failed to load code editor theme: ${e}`)}),document.head.appendChild(s)},b(d,f),b(d,M),b(d,C),d.tagName="bslib-code-editor",d.isShinyInput=!0,d.observedAttributes=["language","readonly","line-numbers","word-wrap","tab-size","insert-spaces","theme-light","theme-dark"],b(d,S,new Set),b(d,w,new Set),b(d,y,null);customElements.define(d.tagName,d);window.Shiny&&R(d.tagName);export{d as BslibCodeEditor}; +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +var O=(n,r,e)=>{if(!r.has(n))throw TypeError("Cannot "+e)};var p=(n,r,e)=>(O(n,r,"read from private field"),e?e.call(n):r.get(n)),b=(n,r,e)=>{if(r.has(n))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(n):r.set(n,e)},U=(n,r,e,t)=>(O(n,r,"write to private field"),t?t.call(n,e):r.set(n,e),e);var m=(n,r,e)=>(O(n,r,"access private method"),e);var h=(n,r,e)=>new Promise((t,i)=>{var s=a=>{try{l(e.next(a))}catch(g){i(g)}},u=a=>{try{l(e.throw(a))}catch(g){i(g)}},l=a=>a.done?t(a.value):Promise.resolve(a.value).then(s,u);l((e=e.apply(n,r)).next())});function R(n,{type:r=null}={}){if(!window.Shiny)return;class e extends window.Shiny.InputBinding{constructor(){super()}find(i){return $(i).find(n)}getValue(i){return"getValue"in i?i.getValue():i.value}getType(i){return r}subscribe(i,s){i.onChangeCallback=s}unsubscribe(i){i.onChangeCallback=s=>{}}receiveMessage(i,s){i.receiveMessage(i,s)}}window.Shiny.inputBindings.register(new e,`${n}-Binding`)}var E=window.Shiny,ee=E?E.InputBinding:class{};function P({headline:n="",message:r,status:e="warning"}){document.dispatchEvent(new CustomEvent("shiny:client-message",{detail:{headline:n,message:r,status:e}}))}function c(n,r){return Object.prototype.hasOwnProperty.call(n,r)&&n[r]!==void 0}function X(...n){return h(this,null,function*(){if(!E)throw new Error("This function must be called in a Shiny app.");return E.renderContentAsync?yield E.renderContentAsync.apply(null,n):yield E.renderContent.apply(null,n)})}function j(n,r){return h(this,null,function*(){if(typeof n!="undefined"){if(r.length!==1)throw new Error("labelNode must be of length 1");typeof n=="string"&&(n={html:n,deps:[]}),n.html===""?r.addClass("shiny-label-null"):(yield X(r,n),r.removeClass("shiny-label-null"))}})}var q="plain",z=2,J="github-light",Q="github-dark",V=400,S,w,y,f,L,M,_,C,x,o=class extends HTMLElement{constructor(){super(...arguments);this.onChangeCallback=()=>{}}get language(){var e;return(e=this.getAttribute("language"))!=null?e:q}set language(e){this.setAttribute("language",e)}get readonly(){return this.hasAttribute("readonly")&&this.getAttribute("readonly")!=="false"}set readonly(e){this.setAttribute("readonly",String(e))}get lineNumbers(){return this.getAttribute("line-numbers")!=="false"}set lineNumbers(e){this.setAttribute("line-numbers",String(e))}get wordWrap(){return this.getAttribute("word-wrap")==="true"}set wordWrap(e){this.setAttribute("word-wrap",String(e))}get tabSize(){let e=this.getAttribute("tab-size"),t=e?parseInt(e):z;return isNaN(t)?z:t}set tabSize(e){this.setAttribute("tab-size",String(e))}get insertSpaces(){return this.getAttribute("insert-spaces")!=="false"}set insertSpaces(e){this.setAttribute("insert-spaces",String(e))}get themeLight(){var e;return(e=this.getAttribute("theme-light"))!=null?e:J}set themeLight(e){this.setAttribute("theme-light",e)}get themeDark(){var e;return(e=this.getAttribute("theme-dark"))!=null?e:Q}set themeDark(e){this.setAttribute("theme-dark",e)}get value(){var e,t;return(t=(e=this.prismEditor)==null?void 0:e.value)!=null?t:""}set value(e){this.prismEditor&&this.prismEditor.setOptions({value:e})}getValue(){if(this.prismEditor)return this.value}connectedCallback(){if(this.prismEditor)return;this.initPromise=this._initializeEditor(),this.initPromise.then(()=>{this.onChangeCallback(!1)}).catch(t=>{P({headline:"Code Editor Initialization Error",message:"An error occurred while initializing the code editor. See console for details.",status:"error"}),console.error("Failed to initialize code editor:",t)});let e=()=>this.onChangeCallback(!0);this.addEventListener("bslibCodeEditorUpdate",e)}disconnectedCallback(){var e,t;(e=this.darkLightObserver)==null||e.disconnect(),this.darkLightObserver=void 0,(t=this.readonlyTooltipCleanup)==null||t.call(this),this.readonlyTooltipCleanup=void 0}attributeChangedCallback(e,t,i){var u,l;if(t===i||!this.prismEditor)return;let s=this.prismEditor;switch(e){case"language":i&&(this.languageChangePromise=this._handleLanguageChange(i));break;case"readonly":{let a=i==="true";s.setOptions({readOnly:a}),a&&!this.readonlyTooltipCleanup?this._setupReadOnlyTooltip(s):!a&&this.readonlyTooltipCleanup&&(this.readonlyTooltipCleanup(),this.readonlyTooltipCleanup=void 0);break}case"line-numbers":s.setOptions({lineNumbers:i!=="false"});break;case"word-wrap":s.setOptions({wordWrap:i==="true"});break;case"tab-size":{let a=i?parseInt(i):z;isNaN(a)||s.setOptions({tabSize:a});break}case"insert-spaces":s.setOptions({insertSpaces:i!=="false"});break;case"theme-light":i&&m(u=o,C,x).call(u,i);break;case"theme-dark":i&&m(l=o,C,x).call(l,i);break;default:break}}_initializeEditor(){return h(this,null,function*(){var D,B,N;let e=this.querySelector(".code-editor");if(!e){P({headline:"Code Editor Initialization Error",message:"Expected to find `.code-editor` inside `` container element.",status:"error"});return}let t=this.language,i=(D=this.getAttribute("value"))!=null?D:"";this.removeAttribute("value");let s=this.readonly,u=this.lineNumbers,l=this.wordWrap,a=this.tabSize,g=this.insertSpaces,v=m(B=o,f,L).call(B);yield m(N=o,M,_).call(N,t);let[{createEditor:T},{copyButton:F},{defaultCommands:W}]=yield Promise.all([import(`${v}/index.js`),import(`${v}/extensions/copyButton/index.js`),import(`${v}/extensions/commands.js`)]),k=T(e,{language:t,value:i,tabSize:a,insertSpaces:g,lineNumbers:u,wordWrap:l,readOnly:s},F(),W()),A=k.keyCommandMap.Enter;k.keyCommandMap.Enter=(I,G,K)=>I.metaKey||I.ctrlKey?(this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate")),e.classList.add("code-editor-submit-flash"),setTimeout(()=>{e.classList.remove("code-editor-submit-flash")},V),!0):A==null?void 0:A(I,G,K),this.prismEditor=k,this.darkLightObserver=this._setupThemeWatcher();let H=this.querySelector("textarea");return H&&H.addEventListener("blur",()=>{this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate"))}),s&&this._setupReadOnlyTooltip(k),k})}_setupThemeWatcher(){let e=()=>{var l;let u=document.documentElement.getAttribute("data-bs-theme")==="dark"?this.themeDark:this.themeLight;m(l=o,C,x).call(l,u)};e();let t=new MutationObserver(()=>e());return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),t}_handleLanguageChange(e){return h(this,null,function*(){var i;let t=this.prismEditor;if(t)try{yield m(i=o,M,_).call(i,e),t.setOptions({language:e}),t.update()}catch(s){P({headline:"Code Editor Language Load Error",message:`Failed to load language '${e}'. See console for details.`,status:"error"}),console.error(`Failed to load language '${e}':`,s)}})}_setupReadOnlyTooltip(e){return h(this,null,function*(){var t;try{let i=m(t=o,f,L).call(t),[{addTooltip:s},{cursorPosition:u}]=yield Promise.all([import(`${i}/tooltips.js`),import(`${i}/extensions/cursor.js`)]);u()(e);let l=document.createElement("div");l.className="code-editor-readonly-tooltip alert alert-danger",l.textContent="Cannot edit read-only editor.";let[a,g]=s(e,l,!1),v=()=>{this.classList.add("is-invalid"),a()},T=()=>{this.classList.remove("is-invalid"),g()};e.textarea.addEventListener("beforeinput",v,!0),e.on("selectionChange",T),e.textarea.addEventListener("click",T),this.readonlyTooltipCleanup=()=>{e.textarea.removeEventListener("beforeinput",v,!0),e.textarea.removeEventListener("click",T),g()}}catch(i){console.error("Failed to setup read-only tooltip:",i)}})}receiveMessage(e,t){return h(this,null,function*(){var i;if(this.initPromise&&(yield this.initPromise),!this.prismEditor){P({headline:"Code Editor could not update",message:"An update was ignored because the editor is not yet initialized.",status:"warning"});return}if(c(t,"value")&&(this.value=(i=t.value)!=null?i:""),c(t,"label")){let s=$(this).find("label");yield j(t.label,s)}c(t,"tab_size")&&t.tab_size!==void 0&&(this.tabSize=t.tab_size),c(t,"indentation")&&(this.insertSpaces=t.indentation==="space"),c(t,"read_only")&&t.read_only!==void 0&&(this.readonly=t.read_only),c(t,"line_numbers")&&t.line_numbers!==void 0&&(this.lineNumbers=t.line_numbers),c(t,"word_wrap")&&t.word_wrap!==void 0&&(this.wordWrap=t.word_wrap),c(t,"language")&&t.language&&(this.language=t.language,this.languageChangePromise&&(yield this.languageChangePromise,this.languageChangePromise=void 0)),c(t,"theme_light")&&t.theme_light&&(this.themeLight=t.theme_light),c(t,"theme_dark")&&t.theme_dark&&(this.themeDark=t.theme_dark),this.dispatchEvent(new CustomEvent("bslibCodeEditorUpdate"))})}},d=o;S=new WeakMap,w=new WeakMap,y=new WeakMap,f=new WeakSet,L=function(){if(p(o,y)!==null)return p(o,y);let e=document.querySelector('script[src*="prism-code-editor"][src$="index.js"]');if(!e)throw new Error("Could not find prism-code-editor script element. Ensure the prism-code-editor dependency is properly loaded.");let t=e.getAttribute("src");if(!t)throw new Error("prism-code-editor script element has no src attribute");let i=new URL(t,document.baseURI).href;return U(o,y,i.replace(/\/index\.js$/,"")),p(o,y)},M=new WeakSet,_=function(e){return h(this,null,function*(){var s;if(p(o,S).has(e)||["plain","plaintext","text","txt"].includes(e))return;let t=e;e==="html"&&(t="markup"),yield import(`${m(s=o,f,L).call(s)}/prism/languages/${t}.js`),p(o,S).add(e)})},C=new WeakSet,x=function(e){var u;if(p(o,w).has(e))return;let t=`code-editor-theme-${e}`;if(document.getElementById(t)){p(o,w).add(e);return}let i=m(u=o,f,L).call(u),s=document.createElement("link");s.id=t,s.rel="stylesheet",s.href=`${i}/themes/${e}.css`,s.addEventListener("load",()=>{p(o,w).add(e)}),s.addEventListener("error",()=>{console.error(`Failed to load code editor theme: ${e}`)}),document.head.appendChild(s)},b(d,f),b(d,M),b(d,C),d.tagName="bslib-code-editor",d.isShinyInput=!0,d.observedAttributes=["language","readonly","line-numbers","word-wrap","tab-size","insert-spaces","theme-light","theme-dark"],b(d,S,new Set),b(d,w,new Set),b(d,y,null);customElements.define(d.tagName,d);window.Shiny&&R(d.tagName);export{d as BslibCodeEditor}; //# sourceMappingURL=code-editor.min.js.map diff --git a/inst/components/dist/components.js b/inst/components/dist/components.js index acc23e3d8..32ea58bd6 100644 --- a/inst/components/dist/components.js +++ b/inst/components/dist/components.js @@ -1,4 +1,4 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ "use strict"; (() => { var __getOwnPropNames = Object.getOwnPropertyNames; diff --git a/inst/components/dist/components.min.js b/inst/components/dist/components.min.js index cb0eef368..8f41e259c 100644 --- a/inst/components/dist/components.min.js +++ b/inst/components/dist/components.min.js @@ -1,4 +1,4 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ "use strict";(()=>{var p=(s,e)=>()=>(s&&(e=s(s=0)),e);var pe=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var Q=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var M=(s,e,t)=>(Q(s,e,"read from private field"),t?t.call(s):e.get(s)),x=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var D=(s,e,t)=>(Q(s,e,"access private method"),t);var h=(s,e,t)=>new Promise((i,n)=>{var r=a=>{try{d(t.next(a))}catch(u){n(u)}},o=a=>{try{d(t.throw(a))}catch(u){n(u)}},d=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,o);d((t=t.apply(s,e)).next())});function g(s,e){b&&b.inputBindings.register(new s,"bslib."+e)}function k(s,e){window.bslib=window.bslib||{},window.bslib[s]?console.error(`[bslib] Global window.bslib.${s} was already defined, using previous definition.`):window.bslib[s]=e}function N({headline:s="",message:e,status:t="warning"}){document.dispatchEvent(new CustomEvent("shiny:client-message",{detail:{headline:s,message:e,status:t}}))}function I(s,e){return Object.prototype.hasOwnProperty.call(s,e)&&s[e]!==void 0}function ee(s){let e=["a[href]","area[href]","button","details summary","input","iframe","select","textarea",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]',"[tabindex]"],t=[':not([tabindex="-1"])',":not([disabled])"],i=e.map(r=>r+t.join("")),n=s.querySelectorAll(i.join(", "));return Array.from(n)}function v(...s){return h(this,null,function*(){if(!b)throw new Error("This function must be called in a Shiny app.");return b.renderContentAsync?yield b.renderContentAsync.apply(null,s):yield b.renderContent.apply(null,s)})}function te(s,e){return h(this,null,function*(){if(typeof s!="undefined"){if(e.length!==1)throw new Error("labelNode must be of length 1");typeof s=="string"&&(s={html:s,deps:[]}),s.html===""?e.addClass("shiny-label-null"):(yield v(e,s),e.removeClass("shiny-label-null"))}})}var b,m,E=p(()=>{"use strict";b=window.Shiny,m=b?b.InputBinding:class{}});var W,ie=p(()=>{"use strict";E();W=class extends m{find(e){return $(e).find(".accordion.bslib-accordion-input")}getValue(e){let i=this._getItemInfo(e).filter(n=>n.isOpen()).map(n=>n.value);return i.length===0?null:i}subscribe(e,t){$(e).on("shown.bs.collapse.accordionInputBinding hidden.bs.collapse.accordionInputBinding",function(i){t(!0)})}unsubscribe(e){$(e).off(".accordionInputBinding")}receiveMessage(e,t){return h(this,null,function*(){let i=t.method;if(i==="set")this._setItems(e,t);else if(i==="open")this._openItems(e,t);else if(i==="close")this._closeItems(e,t);else if(i==="remove")this._removeItem(e,t);else if(i==="insert")yield this._insertItem(e,t);else if(i==="update")yield this._updateItem(e,t);else throw new Error(`Method not yet implemented: ${i}`)})}_setItems(e,t){let i=this._getItemInfo(e),n=this._getValues(e,i,t.values);i.forEach(r=>{n.indexOf(r.value)>-1?r.show():r.hide()})}_openItems(e,t){let i=this._getItemInfo(e),n=this._getValues(e,i,t.values);i.forEach(r=>{n.indexOf(r.value)>-1&&r.show()})}_closeItems(e,t){let i=this._getItemInfo(e),n=this._getValues(e,i,t.values);i.forEach(r=>{n.indexOf(r.value)>-1&&r.hide()})}_insertItem(e,t){return h(this,null,function*(){let i=this._findItem(e,t.target);i||(i=t.position==="before"?e.firstElementChild:e.lastElementChild);let n=t.panel;if(i?yield v(i,n,t.position==="before"?"beforeBegin":"afterEnd"):yield v(e,n),this._isAutoClosing(e)){let r=$(n.html).attr("data-value");$(e).find(`[data-value="${r}"] .accordion-collapse`).attr("data-bs-parent","#"+e.id)}})}_removeItem(e,t){var r;let i=this._getItemInfo(e).filter(o=>t.target.indexOf(o.value)>-1),n=(r=window.Shiny)==null?void 0:r.unbindAll;i.forEach(o=>{n&&n(o.item),o.item.remove()})}_updateItem(e,t){return h(this,null,function*(){let i=this._findItem(e,t.target);if(!i)throw new Error(`Unable to find an accordion_panel() with a value of ${t.target}`);if(I(t,"value")&&(i.dataset.value=t.value),I(t,"body")){let r=i.querySelector(".accordion-body");yield v(r,t.body)}let n=i.querySelector(".accordion-header");if(I(t,"title")){let r=n.querySelector(".accordion-title");yield v(r,t.title)}if(I(t,"icon")){let r=n.querySelector(".accordion-button > .accordion-icon");yield v(r,t.icon)}})}_getItemInfo(e){return Array.from(e.querySelectorAll(":scope > .accordion-item")).map(i=>this._getSingleItemInfo(i))}_getSingleItemInfo(e){let t=e.querySelector(".accordion-collapse"),i=()=>$(t).hasClass("show");return{item:e,value:e.dataset.value,isOpen:i,show:()=>{i()||$(t).collapse("show")},hide:()=>{i()&&$(t).collapse("hide")}}}_getValues(e,t,i){let n=i!==!0?i:t.map(o=>o.value);return this._isAutoClosing(e)&&(n=n.slice(n.length-1,n.length)),n}_findItem(e,t){return e.querySelector(`[data-value="${t}"]`)}_isAutoClosing(e){return e.classList.contains("autoclose")}};g(W,"accordion")});var H,U=p(()=>{"use strict";H=class{constructor(){this.resizeObserverEntries=[],this.resizeObserver=new ResizeObserver(e=>{let t=new Event("resize");if(window.dispatchEvent(t),!window.Shiny)return;let i=[];for(let n of e)n.target instanceof HTMLElement&&n.target.querySelector(".shiny-bound-output")&&n.target.querySelectorAll(".shiny-bound-output").forEach(r=>{if(i.includes(r))return;let{binding:o,onResize:d}=$(r).data("shinyOutputBinding");if(!o||!o.resize)return;let a=r.shinyResizeObserver;if(a&&a!==this||(a||(r.shinyResizeObserver=this),d(r),i.push(r),!r.classList.contains("shiny-plot-output")))return;let u=r.querySelector('img:not([width="100%"])');u&&u.setAttribute("width","100%")})})}observe(e){this.resizeObserver.observe(e),this.resizeObserverEntries.push(e)}unobserve(e){let t=this.resizeObserverEntries.indexOf(e);t<0||(this.resizeObserver.unobserve(e),this.resizeObserverEntries.splice(t,1))}flush(){this.resizeObserverEntries.forEach(e=>{document.body.contains(e)||this.unobserve(e)})}}});var F,se=p(()=>{"use strict";F=class{constructor(e,t){this.watching=new Set,this.observer=new MutationObserver(i=>{let n=new Set;for(let{type:r,removedNodes:o}of i)if(r==="childList"&&o.length!==0)for(let d of o)d instanceof HTMLElement&&(d.matches(e)&&n.add(d),d.querySelector(e)&&d.querySelectorAll(e).forEach(a=>n.add(a)));if(n.size!==0)for(let r of n)try{t(r)}catch(o){console.error(o)}})}observe(e){let t=this._flush();if(this.watching.has(e)){if(!t)return}else this.watching.add(e);t?this._restartObserver():this.observer.observe(e,{childList:!0,subtree:!0})}unobserve(e){this.watching.has(e)&&(this.watching.delete(e),this._flush(),this._restartObserver())}_restartObserver(){this.observer.disconnect();for(let e of this.watching)this.observer.observe(e,{childList:!0,subtree:!0})}_flush(){let e=!1,t=Array.from(this.watching);for(let i of t)document.body.contains(i)||(this.watching.delete(i),e=!0);return e}}});var l,y,ne=p(()=>{"use strict";E();U();se();l=class{constructor(e){var t;e.removeAttribute(l.attr.ATTR_INIT),(t=e.querySelector(`script[${l.attr.ATTR_INIT}]`))==null||t.remove(),this.card=e,l.instanceMap.set(e,this),l.shinyResizeObserver.observe(this.card),l.cardRemovedObserver.observe(document.body),this._addEventListeners(),this.overlay=this._createOverlay(),this._setShinyInput(),this._exitFullScreenOnEscape=this._exitFullScreenOnEscape.bind(this),this._trapFocusExit=this._trapFocusExit.bind(this)}enterFullScreen(e){var t;e&&e.preventDefault(),this.card.id&&this.overlay.anchor.setAttribute("aria-controls",this.card.id),document.addEventListener("keydown",this._exitFullScreenOnEscape,!1),document.addEventListener("keydown",this._trapFocusExit,!0),this.card.setAttribute(l.attr.ATTR_FULL_SCREEN,"true"),document.body.classList.add(l.attr.CLASS_HAS_FULL_SCREEN),this.card.insertAdjacentElement("beforebegin",this.overlay.container),(!this.card.contains(document.activeElement)||(t=document.activeElement)!=null&&t.classList.contains(l.attr.CLASS_FULL_SCREEN_ENTER))&&(this.card.setAttribute("tabindex","-1"),this.card.focus()),this._emitFullScreenEvent(!0),this._setShinyInput()}exitFullScreen(){document.removeEventListener("keydown",this._exitFullScreenOnEscape,!1),document.removeEventListener("keydown",this._trapFocusExit,!0),this.overlay.container.remove(),this.card.setAttribute(l.attr.ATTR_FULL_SCREEN,"false"),this.card.removeAttribute("tabindex"),document.body.classList.remove(l.attr.CLASS_HAS_FULL_SCREEN),this._emitFullScreenEvent(!1),this._setShinyInput()}_setShinyInput(){if(!this.card.classList.contains(l.attr.CLASS_SHINY_INPUT)||!b)return;if(!b.setInputValue){setTimeout(()=>this._setShinyInput(),0);return}let e=this.card.getAttribute(l.attr.ATTR_FULL_SCREEN);b.setInputValue(this.card.id+"_full_screen",e==="true")}_emitFullScreenEvent(e){let t=new CustomEvent("bslib.card",{bubbles:!0,detail:{fullScreen:e}});this.card.dispatchEvent(t)}_addEventListeners(){let e=this.card.querySelector(`:scope > * > .${l.attr.CLASS_FULL_SCREEN_ENTER}`);e&&e.addEventListener("click",t=>this.enterFullScreen(t))}_exitFullScreenOnEscape(e){if(!(e.target instanceof HTMLElement))return;let t=["select[open]","input[aria-expanded='true']"];e.target.matches(t.join(", "))||e.key==="Escape"&&this.exitFullScreen()}_trapFocusExit(e){if(!(e instanceof KeyboardEvent)||e.key!=="Tab")return;let t=e.target===this.card,i=e.target===this.overlay.anchor,n=this.card.contains(e.target),r=()=>{e.preventDefault(),e.stopImmediatePropagation()};if(!(n||t||i)){r(),this.card.focus();return}let o=ee(this.card).filter(w=>!w.classList.contains(l.attr.CLASS_FULL_SCREEN_ENTER));if(!(o.length>0)){r(),this.overlay.anchor.focus();return}if(t)return;let a=o[o.length-1],u=e.target===a;if(i&&e.shiftKey){r(),a.focus();return}if(u&&!e.shiftKey){r(),this.overlay.anchor.focus();return}}_createOverlay(){let e=document.createElement("div");e.id=l.attr.ID_FULL_SCREEN_OVERLAY,e.onclick=this.exitFullScreen.bind(this);let t=this._createOverlayCloseAnchor();return e.appendChild(t),{container:e,anchor:t}}_createOverlayCloseAnchor(){let e=document.createElement("a");return e.classList.add(l.attr.CLASS_FULL_SCREEN_EXIT),e.tabIndex=0,e.setAttribute("aria-expanded","true"),e.setAttribute("aria-label","Close card"),e.setAttribute("role","button"),e.onclick=t=>{this.exitFullScreen(),t.stopPropagation()},e.onkeydown=t=>{(t.key==="Enter"||t.key===" ")&&this.exitFullScreen()},e.innerHTML=this._overlayCloseHtml(),e}_overlayCloseHtml(){return"Close "}static getInstance(e){return l.instanceMap.get(e)}static initializeAllCards(e=!0){if(document.readyState==="loading"){l.onReadyScheduled||(l.onReadyScheduled=!0,document.addEventListener("DOMContentLoaded",()=>{l.initializeAllCards(!1)}));return}e&&l.shinyResizeObserver.flush();let t=`.${l.attr.CLASS_CARD}[${l.attr.ATTR_INIT}]`;if(!document.querySelector(t))return;document.querySelectorAll(t).forEach(n=>new l(n))}},y=l;y.attr={ATTR_INIT:"data-bslib-card-init",CLASS_CARD:"bslib-card",ATTR_FULL_SCREEN:"data-full-screen",CLASS_HAS_FULL_SCREEN:"bslib-has-full-screen",CLASS_FULL_SCREEN_ENTER:"bslib-full-screen-enter",CLASS_FULL_SCREEN_EXIT:"bslib-full-screen-exit",ID_FULL_SCREEN_OVERLAY:"bslib-full-screen-overlay",CLASS_SHINY_INPUT:"bslib-card-input"},y.shinyResizeObserver=new H,y.cardRemovedObserver=new F(`.${l.attr.CLASS_CARD}`,e=>{let t=l.getInstance(e);t&&t.card.getAttribute(l.attr.ATTR_FULL_SCREEN)==="true"&&t.exitFullScreen()}),y.instanceMap=new WeakMap,y.onReadyScheduled=!1;k("Card",y)});function re(s,e){let t=s();return()=>{let i=s();i!==t&&e(),t=i}}var c,f,q,oe=p(()=>{"use strict";E();U();c=class{constructor(e){this.resizeState={isResizing:!1,startX:0,startWidth:0,minWidth:150,maxWidth:()=>window.innerWidth-50,constrainedWidth:e=>Math.max(this.resizeState.minWidth,Math.min(this.resizeState.maxWidth(),e))};this.windowSize="";var n;c.instanceMap.set(e,this),this.layout={container:e,main:e.querySelector(":scope > .main"),sidebar:e.querySelector(":scope > .sidebar"),toggle:e.querySelector(":scope > .collapse-toggle")};let t=this.layout.sidebar.querySelector(":scope > .sidebar-content > .accordion");t&&((n=t==null?void 0:t.parentElement)==null||n.classList.add("has-accordion"),t.classList.add("accordion-flush")),this._initSidebarCounters(),this._initSidebarState(),(this._isCollapsible("desktop")||this._isCollapsible("mobile"))&&this._initEventListeners(),this._initResizeHandle(),c.shinyResizeObserver.observe(this.layout.main),e.removeAttribute("data-bslib-sidebar-init");let i=e.querySelector(":scope > script[data-bslib-sidebar-init]");i&&e.removeChild(i)}get isClosed(){return this.layout.container.classList.contains(c.classes.COLLAPSE)}static getInstance(e){return c.instanceMap.get(e)}_isCollapsible(e="desktop"){let{container:t}=this.layout,i=e==="desktop"?"collapsibleDesktop":"collapsibleMobile",n=t.dataset[i];return n===void 0?!0:n.trim().toLowerCase()!=="false"}static initCollapsibleAll(e=!0){if(document.readyState==="loading"){c.onReadyScheduled||(c.onReadyScheduled=!0,document.addEventListener("DOMContentLoaded",()=>{c.initCollapsibleAll(!1)}));return}let t=`.${c.classes.LAYOUT}[data-bslib-sidebar-init]`;if(!document.querySelector(t))return;e&&c.shinyResizeObserver.flush(),document.querySelectorAll(t).forEach(n=>new c(n))}_initResizeHandle(){if(!this.layout.resizeHandle){let e=this._createResizeHandle();this.layout.container.appendChild(e),this.layout.resizeHandle=e,this._attachResizeEventListeners(e)}this._updateResizeAvailability()}_createResizeHandle(){let e=document.createElement("div");e.className=c.classes.RESIZE_HANDLE,e.setAttribute("role","separator"),e.setAttribute("aria-orientation","vertical"),e.setAttribute("aria-label","Resize sidebar"),e.setAttribute("tabindex","0"),e.setAttribute("aria-keyshortcuts","ArrowLeft ArrowRight Home End"),e.title="Drag to resize sidebar";let t=document.createElement("div");t.className="resize-indicator",e.appendChild(t);let i=document.createElement("div");return i.className="visually-hidden",i.textContent="Use arrow keys to resize the sidebar, Shift for larger steps, Home/End for min/max width.",e.appendChild(i),e}_attachResizeEventListeners(e){e.addEventListener("mousedown",this._onResizeStart.bind(this)),document.addEventListener("mousemove",this._onResizeMove.bind(this)),document.addEventListener("mouseup",this._onResizeEnd.bind(this)),e.addEventListener("touchstart",this._onResizeStart.bind(this),{passive:!1}),document.addEventListener("touchmove",this._onResizeMove.bind(this),{passive:!1}),document.addEventListener("touchend",this._onResizeEnd.bind(this)),e.addEventListener("keydown",this._onResizeKeyDown.bind(this)),window.addEventListener("resize",re(()=>this._getWindowSize(),()=>this._updateResizeAvailability()))}_shouldEnableResize(){let e=this._getWindowSize()==="desktop",t=!this.layout.container.classList.contains(c.classes.TRANSITIONING),i=!this.isClosed;return e&&t&&i}_onResizeStart(e){if(!this._shouldEnableResize())return;e.preventDefault();let t="touches"in e?e.touches[0].clientX:e.clientX;this.resizeState.isResizing=!0,this.resizeState.startX=t,this.resizeState.startWidth=this._getCurrentSidebarWidth(),this.layout.container.style.setProperty("--_transition-duration","0ms"),this.layout.container.classList.add(c.classes.RESIZING),document.documentElement.setAttribute(`data-bslib-${c.classes.RESIZING}`,"true"),this._dispatchResizeEvent("start",this.resizeState.startWidth)}_onResizeMove(e){if(!this.resizeState.isResizing)return;e.preventDefault();let i=("touches"in e?e.touches[0].clientX:e.clientX)-this.resizeState.startX,r=this._isRightSidebar()?this.resizeState.startWidth-i:this.resizeState.startWidth+i,o=this.resizeState.constrainedWidth(r);this._updateSidebarWidth(o),this._dispatchResizeEvent("move",o)}_onResizeEnd(){this.resizeState.isResizing&&(this.resizeState.isResizing=!1,this.layout.container.style.removeProperty("--_transition-duration"),this.layout.container.classList.remove(c.classes.RESIZING),document.documentElement.removeAttribute(`data-bslib-${c.classes.RESIZING}`),c.shinyResizeObserver.flush(),this._dispatchResizeEvent("end",this._getCurrentSidebarWidth()))}_onResizeKeyDown(e){if(!this._shouldEnableResize())return;let t=e.shiftKey?50:10,i=this._getCurrentSidebarWidth();switch(e.key){case"ArrowLeft":i=this._isRightSidebar()?i+t:i-t;break;case"ArrowRight":i=this._isRightSidebar()?i-t:i+t;break;case"Home":i=this.resizeState.minWidth;break;case"End":i=this.resizeState.maxWidth();break;default:return}e.preventDefault(),i=this.resizeState.constrainedWidth(i),this._updateSidebarWidth(i),c.shinyResizeObserver.flush(),this._dispatchResizeEvent("keyboard",i)}_getCurrentSidebarWidth(){return this.layout.sidebar.getBoundingClientRect().width||250}_updateSidebarWidth(e){let{container:t,resizeHandle:i}=this.layout;t.style.setProperty("--_sidebar-width",`${e}px`),i&&(i.setAttribute("aria-valuenow",e.toString()),i.setAttribute("aria-valuemin",this.resizeState.minWidth.toString()),i.setAttribute("aria-valuemax",this.resizeState.maxWidth().toString()))}_isRightSidebar(){return this.layout.container.classList.contains("sidebar-right")}_updateResizeAvailability(){if(!this.layout.resizeHandle)return;let e=this._shouldEnableResize();this.layout.resizeHandle.style.display=e?"":"none",this.layout.resizeHandle.setAttribute("aria-hidden",e?"false":"true"),e?this.layout.resizeHandle.setAttribute("tabindex","0"):this.layout.resizeHandle.removeAttribute("tabindex")}_dispatchResizeEvent(e,t){let i=new CustomEvent("bslib.sidebar.resize",{bubbles:!0,detail:{phase:e,width:t,sidebar:this}});this.layout.sidebar.dispatchEvent(i)}_initEventListeners(){var t;let{toggle:e}=this.layout;e.addEventListener("click",i=>{i.preventDefault(),this.toggle("toggle")}),(t=e.querySelector(".collapse-icon"))==null||t.addEventListener("transitionend",()=>{this._finalizeState()}),!(this._isCollapsible("desktop")&&this._isCollapsible("mobile"))&&window.addEventListener("resize",re(()=>this._getWindowSize(),()=>this._initSidebarState()))}_initSidebarCounters(){let{container:e}=this.layout,t=`.${c.classes.LAYOUT}> .main > .${c.classes.LAYOUT}:not([data-bslib-sidebar-open="always"])`;if(!(e.querySelector(t)===null))return;function n(a){return a=a?a.parentElement:null,a&&a.classList.contains("main")&&(a=a.parentElement),a&&a.classList.contains(c.classes.LAYOUT)?a:null}let r=[e],o=n(e);for(;o;)r.unshift(o),o=n(o);let d={left:0,right:0};r.forEach(function(a){let w=a.classList.contains("sidebar-right")?d.right++:d.left++;a.style.setProperty("--_js-toggle-count-this-side",w.toString()),a.style.setProperty("--_js-toggle-count-max-side",Math.max(d.right,d.left).toString())})}_getWindowSize(){let{container:e}=this.layout;return window.getComputedStyle(e).getPropertyValue("--bslib-sidebar-js-window-size").trim()}_initialToggleState(){var n,r;let{container:e}=this.layout,t=this.windowSize==="desktop"?"openDesktop":"openMobile",i=(r=(n=e.dataset[t])==null?void 0:n.trim())==null?void 0:r.toLowerCase();return i===void 0||["open","always"].includes(i)?"open":["close","closed"].includes(i)?"close":"open"}_initSidebarState(){this.windowSize=this._getWindowSize();let e=this._initialToggleState();this.toggle(e,!0)}toggle(e,t=!1){typeof e=="undefined"?e="toggle":e==="closed"&&(e="close");let{container:i,sidebar:n}=this.layout,r=this.isClosed;if(["open","close","toggle"].indexOf(e)===-1)throw new Error(`Unknown method ${e}`);if(e==="toggle"&&(e=r?"open":"close"),r&&e==="close"||!r&&e==="open"){t&&this._finalizeState();return}e==="open"&&(n.hidden=!1),i.classList.toggle(c.classes.TRANSITIONING,!t),i.classList.toggle(c.classes.COLLAPSE),t&&this._finalizeState()}_finalizeState(){let{container:e,sidebar:t,toggle:i}=this.layout;e.classList.remove(c.classes.TRANSITIONING),t.hidden=this.isClosed,i.setAttribute("aria-expanded",this.isClosed?"false":"true"),this._updateResizeAvailability();let n=new CustomEvent("bslib.sidebar",{bubbles:!0,detail:{open:!this.isClosed}});t.dispatchEvent(n),$(t).trigger("toggleCollapse.sidebarInputBinding"),$(t).trigger(this.isClosed?"hidden":"shown")}},f=c;f.shinyResizeObserver=new H,f.classes={LAYOUT:"bslib-sidebar-layout",COLLAPSE:"sidebar-collapsed",TRANSITIONING:"transitioning",RESIZE_HANDLE:"bslib-sidebar-resize-handle",RESIZING:"sidebar-resizing"},f.onReadyScheduled=!1,f.instanceMap=new WeakMap;q=class extends m{find(e){return $(e).find(`.${f.classes.LAYOUT} > .bslib-sidebar-input`)}getValue(e){let t=f.getInstance(e.parentElement);return t?!t.isClosed:!1}setValue(e,t){let i=t?"open":"close";this.receiveMessage(e,{method:i})}subscribe(e,t){$(e).on("toggleCollapse.sidebarInputBinding",function(i){t(!0)})}unsubscribe(e){$(e).off(".sidebarInputBinding")}receiveMessage(e,t){let i=f.getInstance(e.parentElement);i&&i.toggle(t.method)}};g(q,"sidebar");k("Sidebar",f)});var _,C,R,K,V,ae=p(()=>{"use strict";E();V=class extends m{constructor(){super(...arguments);x(this,R);x(this,_,new WeakMap);x(this,C,new WeakMap)}find(t){return $(t).find(".bslib-task-button")}getValue(t){var i;return{value:(i=M(this,_).get(t))!=null?i:0,autoReset:t.hasAttribute("data-auto-reset")}}getType(){return"bslib.taskbutton"}subscribe(t,i){M(this,C).has(t)&&this.unsubscribe(t);let n=()=>{var r;M(this,_).set(t,((r=M(this,_).get(t))!=null?r:0)+1),i(!0),D(this,R,K).call(this,t,"busy")};M(this,C).set(t,n),t.addEventListener("click",n)}unsubscribe(t){let i=M(this,C).get(t);i&&t.removeEventListener("click",i)}receiveMessage(n,r){return h(this,arguments,function*(t,{state:i}){D(this,R,K).call(this,t,i)})}};_=new WeakMap,C=new WeakMap,R=new WeakSet,K=function(t,i){t.disabled=i==="busy";let n=t.querySelector("bslib-switch-inline");n&&(n.case=i)};g(V,"task-button")});function de(s){let e=P(s),t=!s.value;e.classList.toggle("disabled",t),e.setAttribute("aria-disabled",t.toString()),t?e.setAttribute("tabindex","-1"):e.removeAttribute("tabindex")}function G(s){s.scrollHeight!==0&&(s.style.height="auto",s.style.height=s.scrollHeight+"px")}function me(s){if(!s.hasAttribute("data-needs-modifier"))return;let e=P(s);if(!e.querySelector(`.${L.submitKey}`))return;let t=navigator.userAgent.indexOf("Mac")!==-1;e.querySelectorAll(`.${L.submitKey}`).forEach(r=>{let o=t?"\u2318":"Ctrl";r.textContent=`${o} \u23CE`});let i=t?"Command":"Ctrl";e.title=e.title.replace("Press Enter",`Press ${i}+Enter`);let n=e.getAttribute("aria-label");n&&e.setAttribute("aria-label",n.replace("Press Enter",`Press ${i}+Enter`))}function P(s){var t;let e=(t=s.parentElement)==null?void 0:t.querySelector(`.${L.button}`);if(e instanceof HTMLButtonElement)return e;throw new Error("Expected input_submit_textarea()'s container to have a button with class of 'bslib-submit-textarea-btn'")}function fe(s){let e=s.selectionStart,t=s.selectionEnd;s.value=s.value.substring(0,e)+` `+s.value.substring(t),s.selectionStart=s.selectionEnd=e+1,s.dispatchEvent(new Event("input",{bubbles:!0}))}var S,L,le,X,ce=p(()=>{"use strict";E();S="textSubmitInputBinding",L={input:"bslib-input-submit-textarea",container:"bslib-submit-textarea-container",button:"bslib-submit-textarea-btn",submitKey:"bslib-submit-key"},le=new IntersectionObserver(s=>{s.forEach(e=>{e.isIntersecting&&G(e.target)})}),X=class extends m{find(e){return $(e).find(`.${L.input} textarea`)}initialize(e){de(e),G(e),me(e)}getValue(e){return $(e).data("val")}setValue(e,t){e.value=t}subscribe(e,t){function i(){$(e).data("val",e.value),e.value="",e.dispatchEvent(new Event("input",{bubbles:!0})),t("event")}let n=P(e);n.classList.contains("shiny-bound-input")?$(n).on(`shiny:inputchanged.${S}`,i):$(n).on(`click.${S}`,i),$(e).on(`input.${S}`,function(){de(e),G(e)}),$(e).on(`keydown.${S}`,function(o){if(o.key!=="Enter")return;if(!e.value){o.preventDefault();return}if(o.shiftKey)return;if(o.altKey){o.preventDefault(),fe(e);return}let d=e.hasAttribute("data-needs-modifier");if(!d){o.preventDefault(),n.click();return}let a=o.ctrlKey||o.metaKey;if(d&&a){o.preventDefault(),n.click();return}});let r=e.closest(`.${L.container}`);$(r).on(`click.${S}`,o=>{o.target.classList.contains(L.container)&&e.focus()}),le.observe(e)}unsubscribe(e){$(e).off(`.${S}`);let t=e.nextElementSibling;$(t).off(`.${S}`);let i=e.closest(`.${L.container}`);$(i).off(`.${S}`),le.unobserve(e)}receiveMessage(e,t){return h(this,null,function*(){let i=e.value;if(t.value!==void 0&&(e.value=t.value,e.dispatchEvent(new Event("input",{bubbles:!0}))),t.placeholder!==void 0&&(e.placeholder=t.placeholder),t.label!==void 0){let n=$(e).closest(`.${L.input}`).find("label");yield te(t.label,n)}t.submit&&(P(e).click(),e.value=i),t.focus&&e.focus()})}};g(X,"submit-text-area")});function B(s){if(window.Shiny)for(let[e,t]of Object.entries(s))window.Shiny.addCustomMessageHandler(e,t)}var j=p(()=>{"use strict"});function Ee(s){return h(this,null,function*(){var O,Z;let{html:e,deps:t,autohide:i,duration:n,position:r,id:o}=s;if(!window.bootstrap||!window.bootstrap.Toast){N({headline:"Bootstrap 5 Required",message:"Toast notifications require Bootstrap 5.",status:"error"});return}let d=document.getElementById(o);if(d){let T=z.get(d);T&&(T.hide(),z.delete(d)),(Z=(O=window==null?void 0:window.Shiny)==null?void 0:O.unbindAll)==null||Z.call(O,d),d.remove()}let a=ge.getOrCreateToaster(r);yield v(a,{html:e,deps:t},"beforeEnd");let u=document.getElementById(o);if(!u){N({headline:"Toast Creation Failed",message:`Failed to create toast with id "${o}".`,status:"error"});return}let w=new Y(u,{autohide:i,duration:n});z.set(u,w),w.show(),u.addEventListener("hidden.bs.toast",()=>{var T,J;(J=(T=window==null?void 0:window.Shiny)==null?void 0:T.unbindAll)==null||J.call(T,u),u.remove(),z.delete(u),a.children.length===0&&a.remove()})})}function ye(s){let{id:e}=s,t=document.getElementById(e);if(!t){N({headline:"Toast Not Found",message:`No toast with id "${e}" was found.`,status:"warning"});return}let i=z.get(t);i&&i.hide()}var ve,A,ge,Y,z,ue=p(()=>{"use strict";j();E();ve=window.bootstrap?window.bootstrap.Toast:class{},A=class{constructor(){this.containers=new Map}getOrCreateToaster(e){let t=this.containers.get(e);return(!t||!document.body.contains(t))&&(t=A._createToaster(e),document.body.appendChild(t),this.containers.set(e,t)),t}static _createToaster(e){let t=document.createElement("div");return t.className="toast-container position-fixed p-1 p-md-2",t.setAttribute("data-bslib-toast-container",e),t.classList.add(...A._positionClasses(e)),t}static _positionClasses(e){return{"top-left":["top-0","start-0"],"top-center":["top-0","start-50","translate-middle-x"],"top-right":["top-0","end-0"],"middle-left":["top-50","start-0","translate-middle-y"],"middle-center":["top-50","start-50","translate-middle"],"middle-right":["top-50","end-0","translate-middle-y"],"bottom-left":["bottom-0","start-0"],"bottom-center":["bottom-0","start-50","translate-middle-x"],"bottom-right":["bottom-0","end-0"]}[e]}},ge=new A,Y=class{constructor(e,t){this.progressBar=null;this.timeStart=0;this.timeRemaining=0;this.hideTimeoutId=null;this.isPaused=!1;this.isPointerOver=!1;this.hasFocus=!1;this.element=e,this.timeRemaining=t.duration||5e3;let i={animation:!0,autohide:!1};this.bsToast=new ve(e,i),t.autohide&&(this._addProgressBar(),this._setupInteractionPause())}show(){this.bsToast.show()}hide(){this.hideTimeoutId!==null&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=null),this.bsToast.hide()}_addProgressBar(){this.progressBar=document.createElement("div"),this.progressBar.className="bslib-toast-progress-bar",this.progressBar.style.cssText=` animation: bslib-toast-progress ${this.timeRemaining}ms linear forwards; diff --git a/inst/components/dist/web-components.js b/inst/components/dist/web-components.js index 864098ddc..24d127e73 100644 --- a/inst/components/dist/web-components.js +++ b/inst/components/dist/web-components.js @@ -1,4 +1,4 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ "use strict"; (() => { var __defProp = Object.defineProperty; diff --git a/inst/components/dist/web-components.min.js b/inst/components/dist/web-components.min.js index 2a73a280e..e58a81366 100644 --- a/inst/components/dist/web-components.min.js +++ b/inst/components/dist/web-components.min.js @@ -1,4 +1,4 @@ -/*! bslib 0.9.0.9002 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ +/*! bslib 0.10.0 | (c) 2012-2026 RStudio, PBC. | License: MIT + file LICENSE */ "use strict";(()=>{var He=Object.defineProperty,Ze=Object.defineProperties,et=Object.getOwnPropertyDescriptor,tt=Object.getOwnPropertyDescriptors;var xe=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;var Me=(n,t,e)=>t in n?He(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,k=(n,t)=>{for(var e in t||(t={}))it.call(t,e)&&Me(n,e,t[e]);if(xe)for(var e of xe(t))st.call(t,e)&&Me(n,e,t[e]);return n},Q=(n,t)=>Ze(n,tt(t));var y=(n,t,e,i)=>{for(var s=i>1?void 0:i?et(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&He(t,e,s),s};var oe=(n,t,e)=>new Promise((i,s)=>{var r=a=>{try{c(e.next(a))}catch(l){s(l)}},o=a=>{try{c(e.throw(a))}catch(l){s(l)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,o);c((e=e.apply(n,t)).next())});var nt=(n,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?Q(k({},t),{finisher(e){e.createProperty(t.key,n)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,n)}},rt=(n,t,e)=>{t.constructor.createProperty(e,n)};function g(n){return(t,e)=>e!==void 0?rt(n,t,e):nt(n,t)}var ae,Nt=((ae=window.HTMLSlotElement)===null||ae===void 0?void 0:ae.prototype.assignedElements)!=null?(n,t)=>n.assignedElements(t):(n,t)=>n.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);var X=window,Y=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,le=Symbol(),Le=new WeakMap,j=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==le)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Y&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Le.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Le.set(e,t))}return t}toString(){return this.cssText}},Oe=n=>new j(typeof n=="string"?n:n+"",void 0,le),b=(n,...t)=>{let e=n.length===1?n[0]:t.reduce((i,s,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[r+1],n[0]);return new j(e,n,le)},he=(n,t)=>{Y?n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let i=document.createElement("style"),s=X.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)})},Z=Y?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Oe(e)})(n):n;var de,ee=window,Pe=ee.trustedTypes,ot=Pe?Pe.emptyScript:"",Ne=ee.reactiveElementPolyfillSupport,pe={toAttribute(n,t){switch(t){case Boolean:n=n?ot:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch(i){e=null}}return e}},ze=(n,t)=>t!==n&&(t==t||n==n),ce={attribute:!0,type:String,converter:pe,reflect:!1,hasChanged:ze},ue="finalized",E=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let s=this._$Ep(i,e);s!==void 0&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=ce){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){let r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||ce}static finalize(){if(this.hasOwnProperty(ue))return!1;this[ue]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(Z(s))}else t!==void 0&&e.push(Z(t));return e}static _$Ep(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return he(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=ce){var s;let r=this.constructor._$Ep(t,i);if(r!==void 0&&i.reflect===!0){let o=(((s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?i.converter:pe).toAttribute(e,i.type);this._$El=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;let s=this.constructor,r=s._$Ev.get(t);if(r!==void 0&&this._$El!==r){let o=s.getPropertyOptions(r),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:pe;this._$El=r,this[r]=c.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||ze)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}_$Ej(){return oe(this,null,function*(){this.isUpdatePending=!0;try{yield this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&(yield t),!this.isUpdatePending})}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,r)=>this[r]=s),this._$Ei=void 0);let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(s=>{var r;return(r=s.hostUpdate)===null||r===void 0?void 0:r.call(s)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};E[ue]=!0,E.elementProperties=new Map,E.elementStyles=[],E.shadowRootOptions={mode:"open"},Ne==null||Ne({ReactiveElement:E}),((de=ee.reactiveElementVersions)!==null&&de!==void 0?de:ee.reactiveElementVersions=[]).push("1.6.2");var me,te=window,U=te.trustedTypes,Re=U?U.createPolicy("lit-html",{createHTML:n=>n}):void 0,fe="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,qe="?"+x,at=`<${qe}>`,O=document,F=()=>O.createComment(""),G=n=>n===null||typeof n!="object"&&typeof n!="function",je=Array.isArray,lt=n=>je(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ve=`[ \f\r]`,K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ue=/-->/g,Ie=/>/g,H=RegExp(`>|${ve}(?:([^\\s"'>=/]+)(${ve}*=${ve}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Be=/'/g,De=/"/g,Ke=/^(?:script|style|textarea|title)$/i,Fe=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),_=Fe(1),ii=Fe(2),P=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),We=new WeakMap,L=O.createTreeWalker(O,129,null,!1);function Ge(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Re!==void 0?Re.createHTML(t):t}var ht=(n,t)=>{let e=n.length-1,i=[],s,r=t===2?"":"",o=K;for(let c=0;c"?(o=s!=null?s:K,p=-1):h[1]===void 0?p=-2:(p=o.lastIndex-h[2].length,l=h[1],o=h[3]===void 0?H:h[3]==='"'?De:Be):o===De||o===Be?o=H:o===Ue||o===Ie?o=K:(o=H,s=void 0);let u=o===H&&n[c+1].startsWith("/>")?" ":"";r+=o===K?a+at:p>=0?(i.push(l),a.slice(0,p)+fe+a.slice(p)+x+u):a+x+(p===-2?(i.push(void 0),c):u)}return[Ge(n,r+(n[e]||"")+(t===2?"":"")),i]},N=class{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0,c=t.length-1,a=this.parts,[l,h]=ht(t,e);if(this.el=N.createElement(l,i),L.currentNode=this.el.content,e===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(s=L.nextNode())!==null&&a.length0){s.textContent=U?U.emptyScript:"";for(let u=0;u2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=m}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){let r=this.strings,o=!1;if(r===void 0)t=I(this,t,e,0),o=!G(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{let c=t,a,l;for(t=r[0],a=0;a{var i,s;let r=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t,o=r._$litPart$;if(o===void 0){let c=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;r._$litPart$=o=new z(t.insertBefore(F(),c),c,void 0,e!=null?e:{})}return o._$AI(n),o};var $e,we;var v=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=J(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return P}};v.finalized=!0,v._$litElement$=!0,($e=globalThis.litElementHydrateSupport)===null||$e===void 0||$e.call(globalThis,{LitElement:v});var Je=globalThis.litElementPolyfillSupport;Je==null||Je({LitElement:v});((we=globalThis.litElementVersions)!==null&&we!==void 0?we:globalThis.litElementVersions=[]).push("3.3.2");var M=class extends v{connectedCallback(){this.maybeCarryFill(),super.connectedCallback()}render(){return _``}maybeCarryFill(){this.isFillCarrier?(this.classList.add("html-fill-container"),this.classList.add("html-fill-item")):(this.classList.remove("html-fill-container"),this.classList.remove("html-fill-item"))}get isFillCarrier(){if(!this.parentElement)return!1;let t=this.parentElement.classList.contains("html-fill-container"),e=Array.from(this.children).some(i=>i.classList.contains("html-fill-item"));return t&&e}};M.isShinyInput=!1,M.styles=b` diff --git a/revdep/README.md b/revdep/README.md index fe63a90f2..853a6da64 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,9 +1,10 @@ # Revdeps -## Failed to check (2) +## New problems (3) -|package |version |error |warning |note | -|:------------------|:-------|:-----|:-------|:----| -|Certara.VPCResults |3.0.2 |1 | | | -|ordinalsimr |? | | | | +|package |version |error |warning |note | +|:------------|:-------|:------|:-------|:----| +|[OmopViewer](problems.md#omopviewer)|0.6.0 |__+1__ | | | +|[qrlabelr](problems.md#qrlabelr)|0.2.0 | |__+1__ |1 | +|[tfrmtbuilder](problems.md#tfrmtbuilder)|0.1.0 | |__+1__ | | diff --git a/revdep/cran.md b/revdep/cran.md index 985e3671f..ef782d1fc 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,12 +1,21 @@ ## revdepcheck results -We checked 95 reverse dependencies (94 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. +We checked 147 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. - * We saw 0 new problems - * We failed to check 1 packages + * We saw 3 new problems + * We failed to check 0 packages Issues with CRAN packages are summarised below. -### Failed to check +### New problems +(This reports the first line of each new failure) + +* OmopViewer + checking tests ... ERROR + +* qrlabelr + checking whether package ‘qrlabelr’ can be installed ... WARNING + +* tfrmtbuilder + checking whether package ‘tfrmtbuilder’ can be installed ... WARNING -* Certara.VPCResults (NA) diff --git a/revdep/failures.md b/revdep/failures.md index 2e13626d4..9a2073633 100644 --- a/revdep/failures.md +++ b/revdep/failures.md @@ -1,95 +1 @@ -# Certara.VPCResults - -
- -* Version: 3.0.2 -* GitHub: NA -* Source code: https://github.com/cran/Certara.VPCResults -* Date/Publication: 2024-12-02 15:30:02 UTC -* Number of recursive dependencies: 141 - -Run `revdepcheck::cloud_details(, "Certara.VPCResults")` for more info - -
- -## In both - -* checking whether package ‘Certara.VPCResults’ can be installed ... ERROR - ``` - Installation failed. - See ‘/tmp/workdir/Certara.VPCResults/new/Certara.VPCResults.Rcheck/00install.out’ for details. - ``` - -## Installation - -### Devel - -``` -* installing *source* package ‘Certara.VPCResults’ ... -** package ‘Certara.VPCResults’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** inst -** byte-compile and prepare package for lazy loading -Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : - namespace ‘Matrix’ 1.5-4.1 is already loaded, but >= 1.6.0 is required -Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace -Execution halted -ERROR: lazy loading failed for package ‘Certara.VPCResults’ -* removing ‘/tmp/workdir/Certara.VPCResults/new/Certara.VPCResults.Rcheck/Certara.VPCResults’ - - -``` -### CRAN - -``` -* installing *source* package ‘Certara.VPCResults’ ... -** package ‘Certara.VPCResults’ successfully unpacked and MD5 sums checked -** using staged installation -** R -** inst -** byte-compile and prepare package for lazy loading -Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : - namespace ‘Matrix’ 1.5-4.1 is already loaded, but >= 1.6.0 is required -Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace -Execution halted -ERROR: lazy loading failed for package ‘Certara.VPCResults’ -* removing ‘/tmp/workdir/Certara.VPCResults/old/Certara.VPCResults.Rcheck/Certara.VPCResults’ - - -``` -# ordinalsimr - -
- -* Version: NA -* GitHub: NA -* Source code: https://github.com/cran/ordinalsimr -* Number of recursive dependencies: 121 - -Run `revdepcheck::cloud_details(, "ordinalsimr")` for more info - -
- -## Error before installation - -### Devel - -``` - - - - - - -``` -### CRAN - -``` - - - - - - -``` +*Wow, no problems at all. :)* \ No newline at end of file diff --git a/revdep/problems.md b/revdep/problems.md index 9a2073633..fabec9839 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -1 +1,84 @@ -*Wow, no problems at all. :)* \ No newline at end of file +# OmopViewer (0.6.0) + +* GitHub: +* Email: +* GitHub mirror: + +Run `revdepcheck::cloud_details(, "OmopViewer")` for more info + +## Newly broken + +* checking tests ... ERROR + ``` + ... + [ FAIL 1 | WARN 0 | SKIP 6 | PASS 65 ] + + ══ Skipped tests (6) ═══════════════════════════════════════════════════════════ + • On CRAN (5): 'test-packagesSupported.R:2:3', 'test-appStatic.R:1:1', + 'test-appStatic.R:37:1', 'test-appStatic.R:51:1', 'test-appStatic.R:71:3' + • manual test (1): 'test-functions.R:3:3' + + ══ Failed tests ════════════════════════════════════════════════════════════════ + ── Error ('test-appStatic.R:183:3'): theme ───────────────────────────────────── + + Error in `brand_resolve(brand)`: The package "brand.yml" is required. + Backtrace: + ▆ + 1. ├─testthat::expect_identical(...) at test-appStatic.R:183:3 + 2. │ └─testthat::quasi_label(enquo(object), label) + 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) + 4. └─bslib::bs_theme(brand = validateTheme(NULL)) + 5. ├─bslib:::brand_resolve(brand) + 6. └─bslib:::brand_resolve.list(brand) + 7. └─rlang::check_installed("brand.yml") + + [ FAIL 1 | WARN 0 | SKIP 6 | PASS 65 ] + Error: + ! Test failures. + Execution halted + ``` + +# qrlabelr (0.2.0) + +* GitHub: +* Email: +* GitHub mirror: + +Run `revdepcheck::cloud_details(, "qrlabelr")` for more info + +## Newly broken + +* checking whether package ‘qrlabelr’ can be installed ... WARNING + ``` + Found the following significant warnings: + Warning: replacing previous import ‘bslib::show_toast’ by ‘shinyWidgets::show_toast’ when loading ‘qrlabelr’ + See ‘/tmp/workdir/qrlabelr/new/qrlabelr.Rcheck/00install.out’ for details. + ``` + +## In both + +* checking DESCRIPTION meta-information ... NOTE + ``` + Missing dependency on R >= 4.2.0 because package code uses the pipe + placeholder syntax added in R 4.2.0. + File(s) using such syntax: + ‘all_new_functions.R’ + ``` + +# tfrmtbuilder (0.1.0) + +* GitHub: +* Email: +* GitHub mirror: + +Run `revdepcheck::cloud_details(, "tfrmtbuilder")` for more info + +## Newly broken + +* checking whether package ‘tfrmtbuilder’ can be installed ... WARNING + ``` + Found the following significant warnings: + Warning: replacing previous import ‘bslib::show_toast’ by ‘shinyWidgets::show_toast’ when loading ‘tfrmtbuilder’ + See ‘/tmp/workdir/tfrmtbuilder/new/tfrmtbuilder.Rcheck/00install.out’ for details. + ``` + diff --git a/srcts/build/index.ts b/srcts/build/index.ts index 0bbaec633..c875f6046 100644 --- a/srcts/build/index.ts +++ b/srcts/build/index.ts @@ -5,7 +5,8 @@ import { build } from "./_build"; import type { BuildOptions, Plugin } from "esbuild"; -import { copyFileSync, readFileSync } from "fs"; +import { copyFileSync } from "fs"; +import { basename } from "path"; const opts: BuildOptions = { target: ["es6"], @@ -35,7 +36,7 @@ function copyCssPlugin(source: string, dest: string): Plugin { build.onEnd(() => { copyFileSync(source, dest); - console.log("√ -", "code-editor.css", "-", new Date().toJSON()); + console.log(`√ - ${basename(dest)} - ${new Date().toJSON()}`); }); }, }; @@ -67,12 +68,15 @@ for (const minified of [true, false]) { outfile: `inst/components/dist/code-editor${minified ? ".min" : ""}.js`, minify: minified, format: "esm", - inject: ["watch-css"], - plugins: [ - copyCssPlugin( - "srcts/src/components/codeEditor.css", - "inst/components/dist/code-editor.css" - ), - ], + // Only attach plugin to non-minified build + ...(minified ? {} : { + inject: ["watch-css"], + plugins: [ + copyCssPlugin( + "srcts/src/components/codeEditor.css", + "inst/components/dist/code-editor.css" + ), + ], + }), }); }