diff --git a/Project.toml b/Project.toml index 372a0d3033..099f5c55c9 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "Pluto" uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781" license = "MIT" authors = ["Fons van der Plas <fons@plutojl.org>"] -version = "0.17.3" +version = "0.17.5" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/frontend/common/MsgPack.js b/frontend/common/MsgPack.js index a0dfba1b7a..7d139e302e 100644 --- a/frontend/common/MsgPack.js +++ b/frontend/common/MsgPack.js @@ -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) diff --git a/frontend/components/CellOutput.js b/frontend/components/CellOutput.js index 7a6ea56f59..5b49ac2daf 100644 --- a/frontend/components/CellOutput.js +++ b/frontend/components/CellOutput.js @@ -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 diff --git a/frontend/editor.css b/frontend/editor.css index 14025f3fe6..8798e86ee7 100644 --- a/frontend/editor.css +++ b/frontend/editor.css @@ -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; } @@ -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, @@ -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 { @@ -1601,26 +1603,6 @@ pkg-status-mark.disable_pkg > button > span::after { background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/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; @@ -2013,9 +1995,9 @@ footer { footer form { height: 1.5rem; - opacity: 1; transition: opacity 5s; + display: flex; } footer form > * { @@ -2067,6 +2049,7 @@ footer button { /* border: none; */ font-family: inherit; font-weight: 600; + height: auto; font-size: 0.75rem; } @@ -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 { diff --git a/src/runner/PlutoRunner.jl b/src/runner/PlutoRunner.jl index f8a6a9cab6..688d6d5855 100644 --- a/src/runner/PlutoRunner.jl +++ b/src/runner/PlutoRunner.jl @@ -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 @@ -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