Skip to content

Commit

Permalink
Merge branch 'main' into vscode-webview-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
pankgeorg committed Jan 11, 2022
2 parents 069cfd5 + 5218f85 commit 2a6874b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Pluto"
uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
license = "MIT"
authors = ["Fons van der Plas <[email protected]>"]
version = "0.17.3"
version = "0.17.5"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
2 changes: 1 addition & 1 deletion frontend/common/MsgPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ codec.addExtPacker(0x12, DataView, packTypedArray)
// But it does throw when I create a custom @bind that has a Date value...
// For decoding I now also use a "Invalid Date", but the code in https://stackoverflow.com/a/55338384/2681964 did work in Safari.
// Also there is no way now to send an "Invalid Date", so it just does nothing
codec.addExtPacker(0x0d, Date, (d) => new BigInt64Array([BigInt(d)]))
codec.addExtPacker(0x0d, Date, (d) => new BigInt64Array([BigInt(+d)]))
codec.addExtUnpacker(0x0d, (uintarray) => {
if ("getBigInt64" in DataView.prototype) {
let dataview = new DataView(uintarray.buffer, uintarray.byteOffset, uintarray.byteLength)
Expand Down
9 changes: 5 additions & 4 deletions frontend/components/CellOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ let IframeContainer = ({ body }) => {
/** Grab the <script> tag for the iframe content window resizer
* @type {HTMLScriptElement} */
let original_script_element = document.querySelector("#iframe-resizer-content-window-script")
// Clone it into the iframe document, so we have the exact same script tag there
let iframe_resizer_content_script = iframeDocument.importNode(original_script_element)
// Fix the `src` so it isn't relative to the iframes url, but this documents url
iframe_resizer_content_script.src = new URL(iframe_resizer_content_script.src, original_script_element.baseURI).toString()

// Insert iframe resizer inside the iframe
let iframe_resizer_content_script = iframeDocument.createElement("script")
iframe_resizer_content_script.src = original_script_element.src
iframe_resizer_content_script.crossOrigin = "anonymous"
iframeDocument.head.appendChild(iframe_resizer_content_script)

// Apply iframe resizer from the host side
Expand Down
29 changes: 7 additions & 22 deletions frontend/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ nav#at_the_top img#logo-small {
nav#at_the_top > pluto-filepicker {
width: 210px;
flex-grow: 1;

display: flex;
flex-direction: row;
}
Expand Down Expand Up @@ -621,6 +620,7 @@ pluto-filepicker .cm-scroller::-webkit-scrollbar {

nav#at_the_top > pluto-filepicker button {
cursor: pointer;
height: auto;
}

button.start_stop_recording,
Expand Down Expand Up @@ -887,6 +887,8 @@ main > preamble {
font-family: "Segoe UI Emoji", "Roboto Mono", monospace;
font-size: 0.75rem;
pointer-events: all;
/* break-inside: avoid; */
white-space: nowrap;
}

main > preamble #saveall-container {
Expand Down Expand Up @@ -1601,26 +1603,6 @@ pkg-status-mark.disable_pkg > button > span::after {
background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/chatbox-ellipses-outline.svg");
opacity: 0.6;
}
pkg-status-mark select {
width: 100%;
white-space: nowrap;
border: none;
background-color: transparent;
font-size: 0.65rem;
font-family: "Space Mono", monospace;
font-weight: 500;
text-align: center;
text-align-last: center;
}

pkg-status-mark option {
background: #d3752538;
color: #00000060;
}
pkg-status-mark option.installed {
background: unset;
color: black;
}

pkg-popup {
display: block;
Expand Down Expand Up @@ -2013,9 +1995,9 @@ footer {

footer form {
height: 1.5rem;

opacity: 1;
transition: opacity 5s;
display: flex;
}

footer form > * {
Expand Down Expand Up @@ -2067,6 +2049,7 @@ footer button {
/* border: none; */
font-family: inherit;
font-weight: 600;
height: auto;
font-size: 0.75rem;
}

Expand Down Expand Up @@ -2295,12 +2278,14 @@ pluto-input .cm-editor .cm-content {

.cm-editor .cm-gutter {
min-width: 29px;
min-height: 23px;
}

.cm-editor .cm-gutters {
/* background: hsla(46, 90%, 98%, 1); */
background: transparent;
border-right: solid 1px hsla(0, 0%, 0%, 0);
/* height: auto; */
}

pluto-cell.code_differs .cm-editor .cm-gutters {
Expand Down
24 changes: 13 additions & 11 deletions src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ function transform_bond_value(s::Symbol, value_from_js)
transform_value_ref[](element, value_from_js)
catch e
@error "AbstractPlutoDingetjes: Bond value transformation errored." exception=(e, catch_backtrace())
(Text("❌ AbstractPlutoDingetjes: Bond value transformation errored."), e, stacktrace(catch_backtrace()))
(Text("❌ AbstractPlutoDingetjes: Bond value transformation errored."), e, stacktrace(catch_backtrace()), value_from_js)
end
end

Expand Down Expand Up @@ -1883,28 +1883,30 @@ function Base.show(io::IO, m::MIME"text/html", e::EmbeddableDisplay)
# In this case, we can just embed the HTML content directly.
body
else
"""<pluto-display></pluto-display><script id=$(e.script_id)>
s = """<pluto-display></pluto-display><script id=$(e.script_id)>
// see https://plutocon2021-demos.netlify.app/fonsp%20%E2%80%94%20javascript%20inside%20pluto to learn about the techniques used in this script
const body = $(publish_to_js(body, e.script_id))
const mime = "$(string(mime))"
const body = $(publish_to_js(body, e.script_id));
const mime = "$(string(mime))";
const create_new = this == null || this._mime !== mime
const create_new = this == null || this._mime !== mime;
const display = create_new ? currentScript.previousElementSibling : this
const display = create_new ? currentScript.previousElementSibling : this;
display.persist_js_state = true
display.body = body
display.persist_js_state = true;
display.body = body;
if(create_new) {
// only set the mime if necessary, it triggers a second preact update
display.mime = mime
display.mime = mime;
// add it also as unwatched property to prevent interference from Preact
display._mime = mime
display._mime = mime;
}
return display
return display;
</script>"""

replace(replace(s, r"//.+" => ""), "\n" => "")
end
write(io, to_write)
end
Expand Down

0 comments on commit 2a6874b

Please sign in to comment.