mirror of
https://github.com/penpot/penpot.git
synced 2025-03-15 17:21:17 -05:00
commit
aae1571a5c
5 changed files with 56 additions and 15 deletions
|
@ -83,6 +83,8 @@
|
||||||
- Fix problem when dismissing shared library update [Taiga #8669](https://tree.taiga.io/project/penpot/issue/8669)
|
- Fix problem when dismissing shared library update [Taiga #8669](https://tree.taiga.io/project/penpot/issue/8669)
|
||||||
- Fix visual problem with stroke cap menu [Taiga #8730](https://tree.taiga.io/project/penpot/issue/8730)
|
- Fix visual problem with stroke cap menu [Taiga #8730](https://tree.taiga.io/project/penpot/issue/8730)
|
||||||
- Fix issue when exporting libraries when merging libraries [Taiga #8758](https://tree.taiga.io/project/penpot/issue/8758)
|
- Fix issue when exporting libraries when merging libraries [Taiga #8758](https://tree.taiga.io/project/penpot/issue/8758)
|
||||||
|
- Fix problem with comments max length [Taiga #8778](https://tree.taiga.io/project/penpot/issue/8778)
|
||||||
|
- Fix copy/paste images in Safari [Taiga #8771](https://tree.taiga.io/project/penpot/issue/8771)
|
||||||
|
|
||||||
## 2.1.5
|
## 2.1.5
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@
|
||||||
[:map {:title "create-comment-thread"}
|
[:map {:title "create-comment-thread"}
|
||||||
[:file-id ::sm/uuid]
|
[:file-id ::sm/uuid]
|
||||||
[:position ::gpt/point]
|
[:position ::gpt/point]
|
||||||
[:content [:string {:max 250}]]
|
[:content [:string {:max 750}]]
|
||||||
[:page-id ::sm/uuid]
|
[:page-id ::sm/uuid]
|
||||||
[:frame-id ::sm/uuid]
|
[:frame-id ::sm/uuid]
|
||||||
[:share-id {:optional true} [:maybe ::sm/uuid]]])
|
[:share-id {:optional true} [:maybe ::sm/uuid]]])
|
||||||
|
|
|
@ -85,7 +85,8 @@
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.v2.core :as ptk]))
|
[potok.v2.core :as ptk]
|
||||||
|
[promesa.core :as p]))
|
||||||
|
|
||||||
(def default-workspace-local {:zoom 1})
|
(def default-workspace-local {:zoom 1})
|
||||||
(log/set-level! :debug)
|
(log/set-level! :debug)
|
||||||
|
@ -1551,6 +1552,31 @@
|
||||||
shapes (->> (cfh/selected-with-children objects selected)
|
shapes (->> (cfh/selected-with-children objects selected)
|
||||||
(keep (d/getf objects)))]
|
(keep (d/getf objects)))]
|
||||||
|
|
||||||
|
;; The clipboard API doesn't handle well asynchronous calls because it expects to use
|
||||||
|
;; the clipboard in an user interaction. If you do an async call the callback is outside
|
||||||
|
;; the thread of the UI and so Safari blocks the copying event.
|
||||||
|
;; We use the API `ClipboardItem` that allows promises to be passed and so the event
|
||||||
|
;; will wait for the promise to resolve and everything should work as expected.
|
||||||
|
;; This only works in the current versions of the browsers.
|
||||||
|
(if (some? (unchecked-get ug/global "ClipboardItem"))
|
||||||
|
(let [resolve-data-promise
|
||||||
|
(p/create
|
||||||
|
(fn [resolve reject]
|
||||||
|
(->> (rx/from shapes)
|
||||||
|
(rx/merge-map (partial prepare-object objects frame-id))
|
||||||
|
(rx/reduce collect-data initial)
|
||||||
|
(rx/map (partial sort-selected state))
|
||||||
|
(rx/map (partial advance-copies state selected))
|
||||||
|
(rx/map #(t/encode-str % {:type :json-verbose}))
|
||||||
|
(rx/map #(wapi/create-blob % "text/plain"))
|
||||||
|
(rx/subs! resolve reject))))]
|
||||||
|
(->> (rx/from (wapi/write-to-clipboard-promise "text/plain" resolve-data-promise))
|
||||||
|
(rx/catch on-copy-error)
|
||||||
|
(rx/ignore)))
|
||||||
|
|
||||||
|
;; FIXME: this is to support Firefox versions below 116 that don't support `ClipboardItem`
|
||||||
|
;; after the version 116 is less common we could remove this.
|
||||||
|
;; https://caniuse.com/?search=ClipboardItem
|
||||||
(->> (rx/from shapes)
|
(->> (rx/from shapes)
|
||||||
(rx/merge-map (partial prepare-object objects frame-id))
|
(rx/merge-map (partial prepare-object objects frame-id))
|
||||||
(rx/reduce collect-data initial)
|
(rx/reduce collect-data initial)
|
||||||
|
@ -1559,7 +1585,7 @@
|
||||||
(rx/map #(t/encode-str % {:type :json-verbose}))
|
(rx/map #(t/encode-str % {:type :json-verbose}))
|
||||||
(rx/map wapi/write-to-clipboard)
|
(rx/map wapi/write-to-clipboard)
|
||||||
(rx/catch on-copy-error)
|
(rx/catch on-copy-error)
|
||||||
(rx/ignore)))))))))
|
(rx/ignore))))))))))
|
||||||
|
|
||||||
(declare ^:private paste-transit)
|
(declare ^:private paste-transit)
|
||||||
(declare ^:private paste-text)
|
(declare ^:private paste-text)
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
on-focus (unchecked-get props "on-focus")
|
on-focus (unchecked-get props "on-focus")
|
||||||
on-blur (unchecked-get props "on-blur")
|
on-blur (unchecked-get props "on-blur")
|
||||||
placeholder (unchecked-get props "placeholder")
|
placeholder (unchecked-get props "placeholder")
|
||||||
|
max-length (unchecked-get props "max-length")
|
||||||
on-change (unchecked-get props "on-change")
|
on-change (unchecked-get props "on-change")
|
||||||
on-esc (unchecked-get props "on-esc")
|
on-esc (unchecked-get props "on-esc")
|
||||||
on-ctrl-enter (unchecked-get props "on-ctrl-enter")
|
on-ctrl-enter (unchecked-get props "on-ctrl-enter")
|
||||||
|
@ -88,7 +89,8 @@
|
||||||
:on-blur on-blur
|
:on-blur on-blur
|
||||||
:value value
|
:value value
|
||||||
:placeholder placeholder
|
:placeholder placeholder
|
||||||
:on-change on-change*}]))
|
:on-change on-change*
|
||||||
|
:max-length max-length}]))
|
||||||
|
|
||||||
(mf/defc reply-form
|
(mf/defc reply-form
|
||||||
[{:keys [thread] :as props}]
|
[{:keys [thread] :as props}]
|
||||||
|
@ -128,7 +130,8 @@
|
||||||
:on-focus on-focus
|
:on-focus on-focus
|
||||||
:select-on-focus? false
|
:select-on-focus? false
|
||||||
:on-ctrl-enter on-submit
|
:on-ctrl-enter on-submit
|
||||||
:on-change on-change}]
|
:on-change on-change
|
||||||
|
:max-length 750}]
|
||||||
(when (or @show-buttons? (seq @content))
|
(when (or @show-buttons? (seq @content))
|
||||||
[:div {:class (stl/css :buttons-wrapper)}
|
[:div {:class (stl/css :buttons-wrapper)}
|
||||||
[:input.btn-secondary
|
[:input.btn-secondary
|
||||||
|
@ -196,7 +199,8 @@
|
||||||
:select-on-focus? false
|
:select-on-focus? false
|
||||||
:on-esc on-esc
|
:on-esc on-esc
|
||||||
:on-change on-change
|
:on-change on-change
|
||||||
:on-ctrl-enter on-submit}]
|
:on-ctrl-enter on-submit
|
||||||
|
:max-length 750}]
|
||||||
[:div {:class (stl/css :buttons-wrapper)}
|
[:div {:class (stl/css :buttons-wrapper)}
|
||||||
|
|
||||||
[:input {:on-click on-esc
|
[:input {:on-click on-esc
|
||||||
|
@ -233,7 +237,8 @@
|
||||||
:select-on-focus true
|
:select-on-focus true
|
||||||
:select-on-focus? false
|
:select-on-focus? false
|
||||||
:on-ctrl-enter on-submit*
|
:on-ctrl-enter on-submit*
|
||||||
:on-change on-change}]
|
:on-change on-change
|
||||||
|
:max-length 750}]
|
||||||
[:div {:class (stl/css :buttons-wrapper)}
|
[:div {:class (stl/css :buttons-wrapper)}
|
||||||
[:input {:type "button"
|
[:input {:type "button"
|
||||||
:value "Cancel"
|
:value "Cancel"
|
||||||
|
|
|
@ -103,6 +103,14 @@
|
||||||
(let [cboard (unchecked-get js/navigator "clipboard")]
|
(let [cboard (unchecked-get js/navigator "clipboard")]
|
||||||
(.writeText ^js cboard data)))
|
(.writeText ^js cboard data)))
|
||||||
|
|
||||||
|
(defn write-to-clipboard-promise
|
||||||
|
[mimetype promise]
|
||||||
|
(let [cboard (unchecked-get js/navigator "clipboard")
|
||||||
|
data (js/ClipboardItem.
|
||||||
|
(-> (obj/create)
|
||||||
|
(obj/set! mimetype promise)))]
|
||||||
|
(.write ^js cboard #js [data])))
|
||||||
|
|
||||||
(defn read-from-clipboard
|
(defn read-from-clipboard
|
||||||
[]
|
[]
|
||||||
(try
|
(try
|
||||||
|
|
Loading…
Add table
Reference in a new issue