0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

Merge branch 'staging' into develop

This commit is contained in:
Andrés Moya 2024-06-06 11:21:42 +02:00
commit ccd687cbf3
4 changed files with 43 additions and 32 deletions

View file

@ -21,23 +21,24 @@
### :sparkles: New features ### :sparkles: New features
- Improve auth process [Taiga #7094](https://tree.taiga.io/project/penpot/us/7094) - Improve auth process [Taiga #7094](https://tree.taiga.io/project/penpot/us/7094)
- Add locking degrees increment (hold shift) on path edition [Taiga Issue #7761](https://tree.taiga.io/project/penpot/issue/7761) - Add locking degrees increment (hold shift) on path edition [Taiga #7761](https://tree.taiga.io/project/penpot/issue/7761)
- Persistence & Concurrent Edition Enhancements [Taiga #5657](https://tree.taiga.io/project/penpot/us/5657) - Persistence & Concurrent Edition Enhancements [Taiga #5657](https://tree.taiga.io/project/penpot/us/5657)
- Allow library colors as recent colors [Taiga Issue #7640](https://tree.taiga.io/project/penpot/issue/7640) - Allow library colors as recent colors [Taiga #7640](https://tree.taiga.io/project/penpot/issue/7640)
### :bug: Bugs fixed ### :bug: Bugs fixed
- Layout and scrollign fixes for the bottom palette [Taiga Issue #7559](https://tree.taiga.io/project/penpot/issue/7559) - Layout and scrollign fixes for the bottom palette [Taiga #7559](https://tree.taiga.io/project/penpot/issue/7559)
- Fix expand libraries when search results are present [Taiga issue #7876](https://tree.taiga.io/project/penpot/issue/7876) - Fix expand libraries when search results are present [Taiga #7876](https://tree.taiga.io/project/penpot/issue/7876)
- Fix color palette default library [Taiga #8029](https://tree.taiga.io/project/penpot/issue/8029)
- Component Library is lost after exporting/importing in .zip format [Github #4672](https://github.com/penpot/penpot/issues/4672)
## 2.0.3 ## 2.0.3
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix chrome scrollbar styling [Taiga Issue #7852](https://tree.taiga.io/project/penpot/issue/7852) - Fix chrome scrollbar styling [Taiga #7852](https://tree.taiga.io/project/penpot/issue/7852)
- Fix incorrect password encoding on create-profile manage scritp [Github #3651](https://github.com/penpot/penpot/issues/3651) - Fix incorrect password encoding on create-profile manage scritp [Github #3651](https://github.com/penpot/penpot/issues/3651)
## 2.0.2 ## 2.0.2
### :sparkles: Enhancements ### :sparkles: Enhancements
@ -47,7 +48,7 @@
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix color palette sorting [Taiga Issue #7458](https://tree.taiga.io/project/penpot/issue/7458) - Fix color palette sorting [Taiga #7458](https://tree.taiga.io/project/penpot/issue/7458)
- Fix style scoping problem with imported SVG [Taiga #7671](https://tree.taiga.io/project/penpot/issue/7671) - Fix style scoping problem with imported SVG [Taiga #7671](https://tree.taiga.io/project/penpot/issue/7671)
@ -192,7 +193,7 @@
- Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683) - Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683)
- Internal error when you copy and paste some main components between files [Taiga #7397](https://tree.taiga.io/project/penpot/issue/7397) - Internal error when you copy and paste some main components between files [Taiga #7397](https://tree.taiga.io/project/penpot/issue/7397)
- Fix toolbar disappearing [Taiga #7411](https://tree.taiga.io/project/penpot/issue/7411) - Fix toolbar disappearing [Taiga #7411](https://tree.taiga.io/project/penpot/issue/7411)
- Fix long text on tab breaks UI [Taiga Issue #7421](https://tree.taiga.io/project/penpot/issue/7421) - Fix long text on tab breaks UI [Taiga #7421](https://tree.taiga.io/project/penpot/issue/7421)
## 1.19.5 ## 1.19.5

View file

@ -38,7 +38,8 @@
fail-on-spec?] fail-on-spec?]
:or {add-container? false :or {add-container? false
fail-on-spec? false}}] fail-on-spec? false}}]
(let [component-id (:current-component-id file) (let [components-v2 (dm/get-in file [:data :options :components-v2])
component-id (:current-component-id file)
change (cond-> change change (cond-> change
(and add-container? (some? component-id)) (and add-container? (some? component-id))
(-> (assoc :component-id component-id) (-> (assoc :component-id component-id)
@ -61,12 +62,12 @@
::sm/explain explain)))) ::sm/explain explain))))
(cond-> file (cond-> file
valid? (and valid? (not (and components-v2 add-container? (some? component-id))))
(-> (update :changes conjv change) (-> (update :changes conjv change) ;; In components-v2 we do not add shapes
(update :data ch/process-changes [change] false)) (update :data ch/process-changes [change] false)) ;; inside a component
(not valid?) (not valid?)
(update :errors conjv change))))) (update :errors conjv change)))));)
(defn- lookup-objects (defn- lookup-objects
([file] ([file]
@ -181,10 +182,11 @@
(update :parent-stack conjv (:id obj))))) (update :parent-stack conjv (:id obj)))))
(defn close-artboard [file] (defn close-artboard [file]
(let [parent-id (-> file :parent-stack peek) (let [components-v2 (dm/get-in file [:data :options :components-v2])
parent-id (-> file :parent-stack peek)
parent (lookup-shape file parent-id) parent (lookup-shape file parent-id)
current-frame-id (or (:frame-id parent) current-frame-id (or (:frame-id parent)
(when (nil? (:current-component-id file)) (when (or (nil? (:current-component-id file)) components-v2)
root-id))] root-id))]
(-> file (-> file
(assoc :current-frame-id current-frame-id) (assoc :current-frame-id current-frame-id)
@ -515,7 +517,8 @@
([file data root-type] ([file data root-type]
;; FIXME: data probably can be a shape instance, then we can use gsh/shape->rect ;; FIXME: data probably can be a shape instance, then we can use gsh/shape->rect
(let [selrect (or (grc/make-rect (:x data) (:y data) (:width data) (:height data)) (let [components-v2 (dm/get-in file [:data :options :components-v2])
selrect (or (grc/make-rect (:x data) (:y data) (:width data) (:height data))
grc/empty-rect) grc/empty-rect)
name (:name data) name (:name data)
path (:path data) path (:path data)
@ -542,13 +545,14 @@
(-> file (-> file
(commit-change (commit-change
{:type :add-component (cond-> {:type :add-component
:id (:id obj) :id (:id obj)
:name name :name name
:path path :path path
:main-instance-id main-instance-id :main-instance-id main-instance-id
:main-instance-page main-instance-page :main-instance-page main-instance-page}
:shapes [obj]}) (not components-v2)
(assoc :shapes [obj])))
(assoc :last-id (:id obj)) (assoc :last-id (:id obj))
(assoc :parent-stack [(:id obj)]) (assoc :parent-stack [(:id obj)])

View file

@ -149,7 +149,7 @@
shared-libs (mf/deref refs/workspace-libraries) shared-libs (mf/deref refs/workspace-libraries)
colors (mf/use-state [])] colors (mf/use-state [])]
(mf/with-effect [selected] (mf/with-effect [selected shared-libs]
(let [colors' (cond (let [colors' (cond
(= selected :recent) (reverse recent-colors) (= selected :recent) (reverse recent-colors)
(= selected :file) (->> (vals file-colors) (sort-by :name)) (= selected :file) (->> (vals file-colors) (sort-by :name))

View file

@ -16,6 +16,7 @@
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.data.users :as du] [app.main.data.users :as du]
[app.main.data.workspace.colors :as mdc]
[app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.libraries :as dwl]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.render :refer [component-svg]] [app.main.render :refer [component-svg]]
@ -25,6 +26,7 @@
[app.main.ui.components.search-bar :refer [search-bar]] [app.main.ui.components.search-bar :refer [search-bar]]
[app.main.ui.components.tab-container :refer [tab-container tab-element]] [app.main.ui.components.tab-container :refer [tab-container tab-element]]
[app.main.ui.components.title-bar :refer [title-bar]] [app.main.ui.components.title-bar :refer [title-bar]]
[app.main.ui.hooks :as h]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.util.color :as uc] [app.util.color :as uc]
[app.util.dom :as dom] [app.util.dom :as dom]
@ -113,6 +115,7 @@
components (:components library) components (:components library)
media (:media library) media (:media library)
typographies (:typographies library) typographies (:typographies library)
selected (h/use-shared-state mdc/colorpalette-selected-broadcast-key :recent)
empty-library? (and empty-library? (and
(zero? (count colors)) (zero? (count colors))
@ -146,6 +149,7 @@
(let [library-id (some-> (dom/get-current-target event) (let [library-id (some-> (dom/get-current-target event)
(dom/get-data "library-id") (dom/get-data "library-id")
(parse-uuid))] (parse-uuid))]
(reset! selected library-id)
(st/emit! (dwl/link-file-to-library file-id library-id))))) (st/emit! (dwl/link-file-to-library file-id library-id)))))
unlink-library unlink-library
@ -155,6 +159,8 @@
(let [library-id (some-> (dom/get-current-target event) (let [library-id (some-> (dom/get-current-target event)
(dom/get-data "library-id") (dom/get-data "library-id")
(parse-uuid))] (parse-uuid))]
(when (= library-id @selected)
(reset! selected :file))
(st/emit! (dwl/unlink-file-from-library file-id library-id) (st/emit! (dwl/unlink-file-from-library file-id library-id)
(dwl/sync-file file-id library-id))))) (dwl/sync-file file-id library-id)))))