Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error console sizing constant across base and bslib apps #3947

Merged
merged 6 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inst/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -22265,7 +22265,7 @@
}
return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
}
var buttonStyles = i(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n background-color: transparent;\n outline: none;\n border-style: none;\n padding: var(--space-3);\n border-radius: var(--space-1);\n font-size: 1.5rem;\n background-color: inherit;\n display: block;\n }\n\n button > svg {\n display: block;\n }\n"])));
var buttonStyles = i(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n background-color: transparent;\n outline: none;\n border-style: none;\n padding: var(--space-3);\n border-radius: var(--space-1);\n font-size: var(--font-lg);\n background-color: inherit;\n display: block;\n }\n\n button > svg {\n display: block;\n }\n"])));
var ShinyErrorConsole = /* @__PURE__ */ function(_LitElement) {
_inherits25(ShinyErrorConsole2, _LitElement);
var _super = _createSuper25(ShinyErrorConsole2);
Expand Down Expand Up @@ -22297,7 +22297,7 @@
}]);
return ShinyErrorConsole2;
}(s3);
_defineProperty19(ShinyErrorConsole, "styles", [i(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n :host {\n /* These are all taken from open-props */\n --space-1: 0.5rem;\n --space-2: calc(var(--space-1) * 2);\n --space-3: calc(var(--space-1) * 3);\n --space-4: calc(var(--space-1) * 4);\n\n --red-2: #ffc9c9;\n --red-6: #fa5252;\n --red-7: #f03e3e;\n --red-8: #e03131;\n --red-10: #b02525;\n --red-11: #962020;\n --red-12: #7d1a1a;\n\n --gray-1: #f8f9fa;\n --gray-2: #e9ecef;\n --gray-3: #dee2e6;\n --gray-4: #ced4da;\n --gray-6: #868e96;\n --gray-8: #6c757d;\n\n --green-8: #51cf66;\n\n --shadow-color: 220 3% 15%;\n --shadow-strength: 1%;\n --shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 2%)),\n 0 1px 2px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 2%)),\n 0 2px 5px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 4%)),\n 0 4px 12px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 5%)),\n 0 12px 15px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 7%));\n\n --ring-shadow: 0 0 0 1px var(--gray-2);\n\n /* How fast should the message pop in and out of the screen? */\n --animation-speed: 500ms;\n\n /* Taken from open-props */\n --ease-3: cubic-bezier(0.25, 0, 0.3, 1);\n --animation-slide-in-left: slide-in-left var(--animation-speed)\n var(--ease-3);\n\n --animation-slide-out-left: slide-out-left var(--animation-speed)\n var(--ease-3);\n --modal-bg-color: white;\n\n position: fixed;\n top: var(--space-1);\n right: var(--space-1);\n z-index: 1000;\n\n display: flex;\n flex-direction: column;\n\n background-color: var(--modal-bg-color);\n border-radius: var(--space-1);\n\n animation: var(--animation-slide-in-left);\n box-shadow: var(--shadow-3), var(--ring-shadow);\n\n /* Dont let the error console burst out of the viewport */\n max-height: calc(100vh - 2 * var(--space-1));\n }\n\n @keyframes slide-in-left {\n from {\n transform: translateX(100%);\n }\n }\n @keyframes slide-out-left {\n to {\n transform: translateX(100%);\n }\n }\n\n :host(.leaving) {\n animation: var(--animation-slide-out-left);\n }\n\n .header {\n display: flex;\n justify-content: flex-end;\n align-items: flex-start;\n gap: var(--space-2);\n }\n\n .title {\n font-size: 1.6rem;\n margin-right: auto;\n padding: var(--space-3);\n line-height: 1;\n font-weight: 600;\n color: var(--red-12);\n }\n\n ", "\n\n button:hover {\n background-color: var(--gray-2);\n }\n\n .toggle-button {\n width: fit-content;\n border: none;\n aspect-ratio: 1;\n border-color: var(--gray-4);\n }\n\n .close-button {\n display: flex;\n align-items: center;\n color: var(--red-11);\n }\n\n .close-button > svg {\n margin-right: 3px;\n }\n\n .toggle-button:focus {\n outline: 1px solid black;\n }\n\n .toggle-icon {\n transition: transform var(--animation-speed) ease-in-out;\n }\n\n :host(.collapsed) .toggle-icon {\n transform: scaleX(-1) scaleY(-1);\n }\n\n :host(.collapsed) .close-button {\n display: none;\n }\n\n .content {\n display: block;\n padding: var(--space-4);\n padding-top: var(--space-2);\n max-height: 100%;\n overflow: auto;\n }\n\n :host(.collapsed) .content {\n display: none;\n }\n "])), buttonStyles)]);
_defineProperty19(ShinyErrorConsole, "styles", [i(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n :host {\n /* We declare hard pixel values here to avoid body font size changes\n messing up the size of the console. This was an issue with bslib setting\n the body font-size at 16px relative to base shiny's 14px. */\n --font-md: 14px;\n --font-lg: 16px;\n --font-xl: 18px;\n\n /* These are all taken from open-props */\n --space-1: 6px;\n --space-2: calc(var(--space-1) * 2);\n --space-3: calc(var(--space-1) * 3);\n --space-4: calc(var(--space-1) * 4);\n --space-8: calc(var(--space-1) * 8);\n\n --red-2: #ffc9c9;\n --red-6: #fa5252;\n --red-7: #f03e3e;\n --red-8: #e03131;\n --red-10: #b02525;\n --red-11: #962020;\n --red-12: #7d1a1a;\n\n --gray-1: #f8f9fa;\n --gray-2: #e9ecef;\n --gray-3: #dee2e6;\n --gray-4: #ced4da;\n --gray-6: #868e96;\n --gray-8: #6c757d;\n\n --green-8: #51cf66;\n\n --shadow-color: 220 3% 15%;\n --shadow-strength: 1%;\n --shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 2%)),\n 0 1px 2px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 2%)),\n 0 2px 5px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 4%)),\n 0 4px 12px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 5%)),\n 0 12px 15px -5px hsl(var(--shadow-color) /\n calc(var(--shadow-strength) + 7%));\n\n --ring-shadow: 0 0 0 1px var(--gray-2);\n\n /* How fast should the message pop in and out of the screen? */\n --animation-speed: 500ms;\n\n /* Taken from open-props */\n --ease-3: cubic-bezier(0.25, 0, 0.3, 1);\n --animation-slide-in-left: slide-in-left var(--animation-speed)\n var(--ease-3);\n\n --animation-slide-out-left: slide-out-left var(--animation-speed)\n var(--ease-3);\n --modal-bg-color: white;\n\n position: fixed;\n top: var(--space-1);\n right: var(--space-1);\n z-index: 1000;\n\n display: flex;\n flex-direction: column;\n\n background-color: var(--modal-bg-color);\n border-radius: var(--space-1);\n\n animation: var(--animation-slide-in-left);\n box-shadow: var(--shadow-3), var(--ring-shadow);\n\n /* Dont let the error console burst out of the viewport */\n max-height: calc(100vh - 2 * var(--space-1));\n }\n\n @keyframes slide-in-left {\n from {\n transform: translateX(100%);\n }\n }\n @keyframes slide-out-left {\n to {\n transform: translateX(100%);\n }\n }\n\n :host(.leaving) {\n animation: var(--animation-slide-out-left);\n }\n\n .header {\n display: flex;\n justify-content: flex-end;\n align-items: flex-start;\n gap: var(--space-2);\n }\n\n .title {\n font-size: var(--font-xl);\n margin-right: auto;\n padding: var(--space-3);\n line-height: 1;\n font-weight: 600;\n color: var(--red-12);\n }\n\n ", "\n\n button:hover {\n background-color: var(--gray-2);\n }\n\n .toggle-button {\n width: fit-content;\n border: none;\n aspect-ratio: 1;\n border-color: var(--gray-4);\n }\n\n .close-button {\n display: flex;\n align-items: center;\n color: var(--red-11);\n }\n\n .close-button > svg {\n margin-right: 3px;\n }\n\n .toggle-button:focus {\n outline: 1px solid black;\n }\n\n .toggle-icon {\n transition: transform var(--animation-speed) ease-in-out;\n }\n\n :host(.collapsed) .toggle-icon {\n transform: scaleX(-1) scaleY(-1);\n }\n\n :host(.collapsed) .close-button {\n display: none;\n }\n\n .content {\n display: block;\n padding-inline: var(--space-4);\n padding-block-start: 0;\n padding-block-end: var(--space-4);\n max-height: 100%;\n overflow: auto;\n }\n\n :host(.collapsed) .content {\n display: none;\n }\n "])), buttonStyles)]);
customElements.define("shiny-error-console", ShinyErrorConsole);
var ShinyErrorMessage = /* @__PURE__ */ function(_LitElement2) {
_inherits25(ShinyErrorMessage2, _LitElement2);
Expand Down Expand Up @@ -22352,7 +22352,7 @@
headline: {},
message: {}
});
_defineProperty19(ShinyErrorMessage, "styles", [i(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(['\n :host {\n color: var(--red-11);\n display: block;\n font-size: 1.4rem;\n\n position: relative;\n --icon-size: 1.5rem;\n\n --padding-top: var(--space-1);\n --padding-bottom: var(--space-3);\n\n /* Reset box sizing */\n box-sizing: border-box;\n }\n\n .container {\n display: flex;\n gap: var(--space-2);\n }\n\n .contents {\n width: 40ch;\n display: flex;\n flex-direction: column;\n gap: var(--space-1);\n padding-bottom: var(--padding-bottom);\n padding-top: var(--padding-top);\n overflow: auto;\n }\n\n :host(:last-of-type) .contents {\n --padding-bottom: var(--space-1);\n }\n\n .contents > h3 {\n font-size: 1em;\n font-weight: 500;\n color: var(--red-12);\n }\n\n .contents > * {\n margin-block: 0;\n }\n\n .error-message {\n font-family: "Courier New", Courier, monospace;\n }\n\n .decoration-container {\n flex-shrink: 0;\n padding-inline: var(0.375rem);\n position: relative;\n\n --line-w: 2px;\n --dot-size: 1rem;\n }\n\n :host(:hover) .decoration-container {\n --scale: 1.25;\n }\n\n .vertical-line {\n margin-inline: auto;\n width: var(--line-w);\n height: 100%;\n\n background-color: var(--red-10);\n }\n\n :host(:first-of-type) .vertical-line {\n height: calc(100% - var(--dot-size));\n margin-top: var(--dot-size);\n }\n\n .dot {\n position: absolute;\n width: var(--dot-size);\n height: var(--dot-size);\n top: var(--dot-size);\n left: calc(50% - var(--dot-size) / 2);\n border-radius: 100%;\n transform: scale(var(--scale, 1));\n\n color: var(--red-6);\n background-color: var(--red-10);\n }\n\n .actions {\n transform: scaleX(0);\n transition: transform calc(var(--animation-speed) / 2) ease-in-out;\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n /* Delay transition on mouseout so the buttons don\'t jump away if the user\n overshoots them with their mouse */\n :host(:not(:hover)) .actions {\n transition-delay: 0.15s;\n }\n\n :host(:hover) .actions {\n transform: scaleX(1);\n }\n\n ', "\n\n .copy-button {\n padding: 0;\n width: 4rem;\n height: 4rem;\n position: relative;\n --pad: var(--space-2);\n }\n\n .copy-button-inner {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n transition: transform 0.5s;\n transform-style: preserve-3d;\n }\n\n /* Animate flipping to the other side when the .copy-success class is\n added to the host */\n :host(.copy-success) .copy-button-inner {\n transform: rotateY(180deg);\n }\n\n /* Position the front and back side */\n .copy-button .front,\n .copy-button .back {\n --side: calc(100% - 2 * var(--pad));\n position: absolute;\n inset: var(--pad);\n height: var(--side);\n width: var(--side);\n -webkit-backface-visibility: hidden; /* Safari */\n backface-visibility: hidden;\n }\n\n .copy-button:hover .copy-button-inner {\n background-color: var(--gray-2);\n }\n\n /* Style the back side */\n .copy-button .back {\n --pad: var(--space-1);\n color: var(--green-8);\n transform: rotateY(180deg);\n }\n "])), buttonStyles)]);
_defineProperty19(ShinyErrorMessage, "styles", [i(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(['\n :host {\n color: var(--red-11);\n display: block;\n font-size: var(--font-md);\n\n position: relative;\n --icon-size: var(--font-lg)\n\n /* Reset box sizing */\n box-sizing: border-box;\n }\n\n .container {\n display: flex;\n gap: var(--space-2);\n }\n\n .contents {\n width: 40ch;\n display: flex;\n flex-direction: column;\n gap: var(--space-1);\n padding-block-start: 0;\n padding-block-end: var(--space-3);\n overflow: auto;\n }\n\n :host(:last-of-type) .contents {\n\n padding-block-end: var(--space-1);\n }\n\n .contents > h3 {\n font-size: 1em;\n font-weight: 500;\n color: var(--red-12);\n }\n\n .contents > * {\n margin-block: 0;\n }\n\n .error-message {\n font-family: "Courier New", Courier, monospace;\n }\n\n .decoration-container {\n flex-shrink: 0;\n position: relative;\n\n --line-w: 2px;\n --dot-size: 11px;\n }\n\n :host(:hover) .decoration-container {\n --scale: 1.25;\n }\n\n .vertical-line {\n margin-inline: auto;\n width: var(--line-w);\n height: 100%;\n\n background-color: var(--red-10);\n }\n\n :host(:first-of-type) .vertical-line {\n height: calc(100% - var(--dot-size));\n margin-top: var(--dot-size);\n }\n\n .dot {\n position: absolute;\n width: var(--dot-size);\n height: var(--dot-size);\n top: calc(-1px + var(--dot-size) / 2);\n left: calc(50% - var(--dot-size) / 2);\n border-radius: 100%;\n transform: scale(var(--scale, 1));\n\n color: var(--red-6);\n background-color: var(--red-10);\n }\n\n .actions {\n transform: scaleX(0);\n transition: transform calc(var(--animation-speed) / 2) ease-in-out;\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n /* Delay transition on mouseout so the buttons don\'t jump away if the user\n overshoots them with their mouse */\n :host(:not(:hover)) .actions {\n transition-delay: 0.15s;\n }\n\n :host(:hover) .actions {\n transform: scaleX(1);\n }\n\n ', "\n\n .copy-button {\n padding: 0;\n width: var(--space-8);\n height: var(--space-8);\n position: relative;\n --pad: var(--space-2);\n }\n\n .copy-button-inner {\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n transition: transform 0.5s;\n transform-style: preserve-3d;\n }\n\n /* Animate flipping to the other side when the .copy-success class is\n added to the host */\n :host(.copy-success) .copy-button-inner {\n transform: rotateY(180deg);\n }\n\n /* Position the front and back side */\n .copy-button .front,\n .copy-button .back {\n --side: calc(100% - 2 * var(--pad));\n position: absolute;\n inset: var(--pad);\n height: var(--side);\n width: var(--side);\n -webkit-backface-visibility: hidden; /* Safari */\n backface-visibility: hidden;\n }\n\n .copy-button:hover .copy-button-inner {\n background-color: var(--gray-2);\n }\n\n /* Style the back side */\n .copy-button .back {\n --pad: var(--space-1);\n color: var(--green-8);\n transform: rotateY(180deg);\n }\n "])), buttonStyles)]);
customElements.define("shiny-error-message", ShinyErrorMessage);
function showErrorInClientConsole(e4) {
var errorMsg = null;
Expand Down
Loading