mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 13:11:39 +02:00
✨ Normalize default page data structure.
This commit is contained in:
parent
422536d4a1
commit
e61cdc500c
3 changed files with 10 additions and 10 deletions
|
@ -14,6 +14,7 @@
|
||||||
[uxbox.db :as db]
|
[uxbox.db :as db]
|
||||||
[uxbox.common.exceptions :as ex]
|
[uxbox.common.exceptions :as ex]
|
||||||
[uxbox.common.spec :as us]
|
[uxbox.common.spec :as us]
|
||||||
|
[uxbox.common.pages :as cp]
|
||||||
[uxbox.services.mutations :as sm]
|
[uxbox.services.mutations :as sm]
|
||||||
[uxbox.services.mutations.projects :as proj]
|
[uxbox.services.mutations.projects :as proj]
|
||||||
[uxbox.services.util :as su]
|
[uxbox.services.util :as su]
|
||||||
|
|
|
@ -135,6 +135,14 @@
|
||||||
(s/def ::change (s/multi-spec change-spec-impl :type))
|
(s/def ::change (s/multi-spec change-spec-impl :type))
|
||||||
(s/def ::changes (s/coll-of ::change))
|
(s/def ::changes (s/coll-of ::change))
|
||||||
|
|
||||||
|
(def default-page-data
|
||||||
|
"A reference value of the empty page data."
|
||||||
|
{:version 1
|
||||||
|
:shapes []
|
||||||
|
:canvas []
|
||||||
|
:options {}
|
||||||
|
:shapes-by-id {}})
|
||||||
|
|
||||||
;; --- Changes Processing Impl
|
;; --- Changes Processing Impl
|
||||||
|
|
||||||
(declare process-change)
|
(declare process-change)
|
||||||
|
|
|
@ -350,15 +350,6 @@
|
||||||
|
|
||||||
(declare page-created)
|
(declare page-created)
|
||||||
|
|
||||||
(def default-page-data
|
|
||||||
{:version 1
|
|
||||||
:shapes []
|
|
||||||
:canvas []
|
|
||||||
:options {:grid-x 10
|
|
||||||
:grid-y 10
|
|
||||||
:grid-color "#cccccc"}
|
|
||||||
:shapes-by-id {}})
|
|
||||||
|
|
||||||
(def create-empty-page
|
(def create-empty-page
|
||||||
(ptk/reify ::create-empty-page
|
(ptk/reify ::create-empty-page
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
|
@ -369,7 +360,7 @@
|
||||||
params {:name name
|
params {:name name
|
||||||
:file-id file-id
|
:file-id file-id
|
||||||
:ordering ordering
|
:ordering ordering
|
||||||
:data default-page-data}]
|
:data cp/default-page-data}]
|
||||||
(->> (rp/mutation :create-project-page params)
|
(->> (rp/mutation :create-project-page params)
|
||||||
(rx/map page-created))))))
|
(rx/map page-created))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue