Compare commits

...

13 Commits

Author SHA1 Message Date
karangattu
5f9176ac3b yarn build (GitHub Actions) 2024-10-31 16:48:08 +00:00
Karan Gathani
8f6ccd6bc4 remove comment 2024-10-31 09:43:06 -07:00
karangattu
380dfe0904 yarn build (GitHub Actions) 2024-10-31 16:22:50 +00:00
Karan Gathani
774def26de Add entry in NEWS.md 2024-10-31 09:18:40 -07:00
Karan
b24cbcb7b8 Merge branch 'main' into add-clientdata-height-width 2024-10-30 21:12:03 -07:00
Carson
4d3ec8e7bd Add to initial values; re-send window sizes in a debounced and decoupled fashion on resize; remove user-agent and mobile values 2024-10-30 17:10:06 -05:00
karangattu
1018f7cc62 yarn build (GitHub Actions) 2024-10-29 01:29:43 +00:00
Karan Gathani
d87bcc5184 Merge branch 'add-clientdata-height-width' of https://github.com/rstudio/shiny into add-clientdata-height-width 2024-10-28 18:25:39 -07:00
Karan Gathani
ca590f3854 use existing sendImageSizeFns instead of new SendWindowSize 2024-10-28 18:25:37 -07:00
karangattu
a56cd962f0 yarn build (GitHub Actions) 2024-10-28 23:56:39 +00:00
Karan Gathani
078aeb23a8 use debouncer when fetching window sizes 2024-10-28 16:52:05 -07:00
karangattu
f0bbc1db56 yarn build (GitHub Actions) 2024-10-22 20:02:09 +00:00
Karan Gathani
930040b66c Add viewport and scrollable size values to clientdata 2024-10-22 12:50:48 -07:00
6 changed files with 44 additions and 10 deletions

View File

@@ -6,6 +6,8 @@
* When spinners and the pulse busy indicators are enabled, Shiny now shows the pulse indicator when dynamic UI elements are recalculating if no other spinners are present in the app. (#4137)
* Capture and send client window size and scroll dimensions to the server which can be accessed via `session$clientData`. (#4147)
## Bug fixes
* Fixed a bug in `conditionalPanel()` that would cause the panel to repeatedly show/hide itself when the provided condition was not boolean. (@kamilzyla, #4127)

View File

@@ -25132,11 +25132,17 @@
value: function() {
var _initialize = _asyncToGenerator14(/* @__PURE__ */ _regeneratorRuntime14().mark(function _callee3() {
var _this2 = this;
var shinyapp, inputBatchSender, inputsNoResend, inputsEvent, inputsRate, inputsDefer, target, inputs, inputBindings, outputBindings, shinyBindCtx, initializeInputs, getIdFromEl, initialValues, getComputedBgColor, getComputedFont, maybeAddThemeObserver, doSendTheme, doSendImageSize, isHidden, lastKnownVisibleOutputs, doSendOutputHiddenState, sendOutputHiddenStateDebouncer, sendOutputHiddenState, filterEventsByNamespace, bs3classes, singletonText, dependencyText;
var shinyapp, inputBatchSender, inputsNoResend, inputsEvent, inputsRate, inputsDefer, target, inputs, inputBindings, outputBindings, shinyBindCtx, initializeInputs, getIdFromEl, initialValues, getComputedBgColor, getComputedFont, maybeAddThemeObserver, doSendTheme, doSendImageSize, isHidden, lastKnownVisibleOutputs, doSendOutputHiddenState, sendOutputHiddenStateDebouncer, sendOutputHiddenState, filterEventsByNamespace, bs3classes, doSendWindowSize, singletonText, dependencyText;
return _regeneratorRuntime14().wrap(function _callee3$(_context3) {
while (1)
switch (_context3.prev = _context3.next) {
case 0:
doSendWindowSize = function _doSendWindowSize() {
inputs.setInput(".clientdata_window_width", window.innerWidth);
inputs.setInput(".clientdata_window_height", window.innerHeight);
inputs.setInput(".clientdata_scroll_width", document.documentElement.scrollWidth);
inputs.setInput(".clientdata_scroll_height", document.documentElement.scrollHeight);
};
filterEventsByNamespace = function _filterEventsByNamesp(namespace, handler) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
@@ -25364,9 +25370,9 @@
this.initializeInputs = initializeInputs;
initializeInputs(document.documentElement);
_context3.t0 = mapValues;
_context3.next = 34;
_context3.next = 35;
return _bindAll(shinyBindCtx(), document.documentElement);
case 34:
case 35:
_context3.t1 = _context3.sent;
_context3.t2 = function(x2) {
return x2.value;
@@ -25438,6 +25444,11 @@
return;
e4;
});
initialValues[".clientdata_window_width"] = window.innerWidth;
initialValues[".clientdata_window_height"] = window.innerHeight;
initialValues[".clientdata_scroll_width"] = document.documentElement.scrollWidth;
initialValues[".clientdata_scroll_height"] = document.documentElement.scrollHeight;
(0, import_jquery39.default)(window).resize(debounce(500, doSendWindowSize));
singletonText = initialValues[".clientdata_singletons"] = (0, import_jquery39.default)('script[type="application/shiny-singletons"]').text();
registerNames(singletonText.split(/,/));
dependencyText = (0, import_jquery39.default)('script[type="application/html-dependencies"]').text();
@@ -25455,7 +25466,7 @@
(0, import_jquery39.default)(document).one("shiny:sessioninitialized", function() {
_this2.initializedPromise.resolve();
});
case 69:
case 75:
case "end":
return _context3.stop();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -646,6 +646,27 @@ class ShinyClass {
e;
});
initialValues[".clientdata_window_width"] = window.innerWidth;
initialValues[".clientdata_window_height"] = window.innerHeight;
initialValues[".clientdata_scroll_width"] =
document.documentElement.scrollWidth;
initialValues[".clientdata_scroll_height"] =
document.documentElement.scrollHeight;
function doSendWindowSize() {
inputs.setInput(".clientdata_window_width", window.innerWidth);
inputs.setInput(".clientdata_window_height", window.innerHeight);
inputs.setInput(
".clientdata_scroll_width",
document.documentElement.scrollWidth
);
inputs.setInput(
".clientdata_scroll_height",
document.documentElement.scrollHeight
);
}
$(window).resize(debounce(500, doSendWindowSize));
// The server needs to know what singletons were rendered as part of
// the page loading
const singletonText = (initialValues[".clientdata_singletons"] = $(