0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-07 15:39:42 -05:00

Rename "Library backup" to "Main components"

This commit is contained in:
Andrés Moya 2024-01-30 09:10:35 +01:00 committed by Andrey Antukh
parent 7aeb5498a1
commit a85a7c74c3
2 changed files with 4 additions and 4 deletions

View file

@ -359,10 +359,10 @@
(mapcat used-assets-container (containers-seq file-data))))
(defn get-or-add-library-page
"If exists a page named 'Library backup', get the id and calculate the position to start
"If exists a page named 'Main components', get the id and calculate the position to start
adding new components. If not, create it and start at (0, 0)."
[file-data grid-gap]
(let [library-page (d/seek #(= (:name %) "Library backup") (ctpl/pages-seq file-data))]
(let [library-page (d/seek #(= (:name %) "Main components") (ctpl/pages-seq file-data))]
(if (some? library-page)
(let [compare-pos (fn [pos shape]
(let [bounds (gsh/bounding-box shape)]
@ -374,7 +374,7 @@
(gpt/point 0 0)
(ctn/shapes-seq library-page))]
[file-data (:id library-page) position])
(let [library-page (ctp/make-empty-page (uuid/next) "Library backup")]
(let [library-page (ctp/make-empty-page (uuid/next) "Main components")]
[(ctpl/add-page file-data library-page) (:id library-page) (gpt/point 0 0)]))))
(defn- absorb-components

View file

@ -102,7 +102,7 @@
(t/is (= (count pages) 2))
(t/is (= (:name (first pages)) "Page 1"))
(t/is (= (:name (second pages)) "Library backup"))
(t/is (= (:name (second pages)) "Main components"))
(t/is (= (count components) 1))