mirror of
https://github.com/penpot/penpot.git
synced 2026-05-07 09:08:33 +00:00
Merge pull request #6997 from penpot/alotor-fix-wasm-bugs
🐛 Fix wasm problems
This commit is contained in:
commit
3f657a0c04
@ -27,7 +27,9 @@
|
||||
[app.main.data.workspace.libraries :as dwl]
|
||||
[app.main.data.workspace.thumbnails :as dwth]
|
||||
[app.main.errors]
|
||||
[app.main.features :as features]
|
||||
[app.main.router :as rt]
|
||||
[app.render-wasm.shape :as wasm.shape]
|
||||
[app.util.http :as http]
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
[beicon.v2.core :as rx]
|
||||
@ -128,6 +130,14 @@
|
||||
;; Workspace Page CRUD
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn update-page-root
|
||||
[file-id page-id]
|
||||
(ptk/reify ::update-page-root
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(-> state
|
||||
(update-in [:files file-id :data :pages-index page-id :objects uuid/zero] wasm.shape/create-shape)))))
|
||||
|
||||
(defn create-page
|
||||
[{:keys [page-id file-id]}]
|
||||
(let [id (or page-id (uuid/next))]
|
||||
@ -146,7 +156,11 @@
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/add-empty-page id name))]
|
||||
|
||||
(rx/of (dch/commit-changes changes)))))))
|
||||
(rx/concat
|
||||
(rx/of (dch/commit-changes changes))
|
||||
(if (features/active-feature? state "render-wasm/v1")
|
||||
(rx/of (update-page-root file-id id))
|
||||
(rx/empty))))))))
|
||||
|
||||
(defn duplicate-page
|
||||
[page-id]
|
||||
|
||||
@ -116,7 +116,10 @@
|
||||
id (get shape :id)]
|
||||
(case k
|
||||
:parent-id (api/set-parent-id v)
|
||||
:type (api/set-shape-type v)
|
||||
:type (do
|
||||
(api/set-shape-type v)
|
||||
(when (or (= v :path) (= v :bool))
|
||||
(api/set-shape-path-content (:content shape))))
|
||||
:bool-type (api/set-shape-bool-type v)
|
||||
:selrect (api/set-shape-selrect v)
|
||||
:show-content (if (= (:type shape) :frame)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user