Merge branch 'master' into fix/wb-fixes

This commit is contained in:
Gabriel Horner
2022-11-18 12:35:41 -05:00
committed by GitHub
66 changed files with 1355 additions and 800 deletions

View File

@@ -61,6 +61,7 @@
[frontend.util.drawer :as drawer]
[frontend.util.property :as property]
[frontend.util.text :as text-util]
[frontend.handler.notification :as notification]
[goog.dom :as gdom]
[goog.object :as gobj]
[lambdaisland.glogi :as log]
@@ -264,14 +265,6 @@
(when (seq images)
(lightbox/preview-images! images))))
(defn copy-image-to-clipboard
[src]
(-> (js/fetch src)
(.then (fn [data]
(-> (.blob data)
(.then (fn [blob]
(js/navigator.clipboard.write (clj->js [(js/ClipboardItem. (clj->js {(.-type blob) blob}))])))))))))
(defonce *resizing-image? (atom false))
(rum/defcs resizable-image <
(rum/local nil ::size)
@@ -353,12 +346,13 @@
(ui/icon "trash")]
[:button.asset-action-btn
{:title (t :asset/copy)
:tabIndex "-1"
{:title (t :asset/copy)
:tabIndex "-1"
:on-mouse-down util/stop
:on-click (fn [e]
(util/stop e)
(copy-image-to-clipboard image-src))}
:on-click (fn [e]
(util/stop e)
(-> (util/copy-image-to-clipboard image-src)
(p/then #(notification/show! "Copied!" :success))))}
(ui/icon "copy")]
[:button.asset-action-btn
@@ -1045,7 +1039,7 @@
[:a.asset-ref.is-pdf
{:on-mouse-down (fn [_event]
(when-let [current (pdf-assets/inflate-asset s)]
(state/set-state! :pdf/current current)))}
(state/set-current-pdf! current)))}
(or label-text
(->elem :span (map-inline config label)))]
@@ -3252,9 +3246,9 @@
:else
[:<>
(lazy-editor/editor config (str (d/squuid)) attr code options)
(let [options (:options options)]
(let [options (:options options) block (:block config)]
(when (and (= language "clojure") (contains? (set options) ":results"))
(sci/eval-result code)))])])))))
(sci/eval-result code block)))])])))))
(defn ^:large-vars/cleanup-todo markup-element-cp
[{:keys [html-export?] :as config} item]