0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-15 16:31:25 -05:00

Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
alonso.torres 2022-06-21 09:30:54 +02:00
commit 6d4e898f79
6 changed files with 69 additions and 53 deletions
CHANGES.md
frontend/src/app/main
data
errors.cljs
ui/workspace
shapes/text
sidebar

View file

@ -5,6 +5,7 @@
### :sparkles: New features
- Allow for nested and rotated boards inside other boards and groups [Taiga #2874](https://tree.taiga.io/project/penpot/us/2874?milestone=319982)
- View mode improvements to enable access and use in different conditions [Taiga #3023](https://tree.taiga.io/project/penpot/us/3023)
### :bug: Bugs fixed
### :arrow_up: Deps updates
@ -20,12 +21,13 @@
- Multiple team invitations on onboarding [Taiga #3084](https://tree.taiga.io/project/penpot/us/3084)
- Change text properties position at the sidebar [Taiga #3047](https://tree.taiga.io/project/penpot/us/3047)
- Group assets by drag and drop [Taiga #2831](https://tree.taiga.io/project/penpot/us/2831)
- View mode improvements to enable access and use in different conditions [Taiga #3023](https://tree.taiga.io/project/penpot/us/3023)
- Navigate to the original link after log in [Taiga #3624](https://tree.taiga.io/project/penpot/issue/3624)
### :bug: Bugs fixed
- Fix menu file not accessible in certain conditions [Taiga #3385](https://tree.taiga.io/project/penpot/issue/3385)
- Remove deprecated menu options [Taiga #3333](https://tree.taiga.io/project/penpot/issue/3333)
- Prototype connection should be under the rules [Taiga #3384](https://tree.taiga.io/project/penpot/issue/3384)
- Fix problem with empty text boxes events [Taiga #3627](https://tree.taiga.io/project/penpot/issue/3627)
## 1.13.5-beta

View file

@ -157,8 +157,13 @@
accepting invitation, or third party auth signup or singin."
[profile]
(letfn [(get-redirect-event []
(let [team-id (:default-team-id profile)]
(rt/nav' :dashboard-projects {:team-id team-id})))]
(let [team-id (:default-team-id profile)
redirect-url (:redirect-url @storage)]
(if (some? redirect-url)
(do
(swap! storage dissoc :redirect-url)
(.replace js/location redirect-url))
(rt/nav' :dashboard-projects {:team-id team-id}))))]
(ptk/reify ::logged-in
IDeref
(-deref [_] profile)

View file

@ -308,7 +308,7 @@
(assoc-in [:workspace-local :edition] (-> selected first :id)))))))
(defn not-changed? [old-dim new-dim]
(> (mth/abs (- old-dim new-dim)) 0.1))
(> (mth/abs (- old-dim new-dim)) 1))
(defn resize-text
[id new-width new-height]

View file

@ -19,6 +19,7 @@
[app.util.globals :as glob]
[app.util.i18n :refer [tr]]
[app.util.router :as rt]
[app.util.storage :refer [storage]]
[app.util.timers :as ts]
[cuerdas.core :as str]
[potok.core :as ptk]))
@ -50,9 +51,11 @@
;; here and not in app.main.errors because of circular dependency.
(defmethod ptk/handle-error :authentication
[_]
(let [msg (tr "errors.auth.unable-to-login")]
(let [msg (tr "errors.auth.unable-to-login")
uri (. (. js/document -location) -href)]
(st/emit! (du/logout {:capture-redirect true}))
(ts/schedule 500 #(st/emit! (msg/warn msg)))))
(ts/schedule 500 #(st/emit! (msg/warn msg)))
(ts/schedule 1000 #(swap! storage assoc :redirect-url uri))))
;; Error that happens on an active business model validation does not
;; passes an validation (example: profile can't leave a team). From

View file

@ -271,20 +271,24 @@
(mf/deref text-modifier-ref)
bounding-box
(gsht/position-data-bounding-box text-modifier)]
(gsht/position-data-bounding-box text-modifier)
x (min (:x bounding-box) (:x shape))
y (min (:y bounding-box) (:y shape))
width (max (:width bounding-box) (:width shape))
height (max (:height bounding-box) (:height shape))]
[:g.text-editor {:clip-path (dm/fmt "url(#%)" clip-id)
:transform (dm/str (gsh/transform-matrix shape))}
[:defs
[:clipPath {:id clip-id}
[:rect {:x (min (:x bounding-box) (:x shape))
:y (min (:y bounding-box) (:y shape))
:width (max (:width bounding-box) (:width shape))
:height (max (:height bounding-box) (:height shape))
[:rect {:x (or x (:x shape))
:y (or y (:y shape))
:width (or width (:width shape))
:height (or height (:height shape))
:fill "red"}]]]
[:foreignObject {:x (:x shape) :y (:y shape) :width "100%" :height "100%"
:externalResourcesRequired true}
[:foreignObject {:x (:x shape) :y (:y shape) :width "100%" :height "100%"}
[:div {:style {:position "absolute"
:left 0
:top 0

View file

@ -375,7 +375,7 @@
[{:keys [component renaming listing-thumbs? selected-components
on-asset-click on-context-menu on-drag-start do-rename
cancel-rename selected-components-full selected-components-paths]}]
(let [item-ref (mf/use-ref)
(let [item-ref (mf/use-ref)
dragging? (mf/use-state false)
@ -407,8 +407,7 @@
(fn [event]
(on-asset-drag-start event component selected-components item-ref :components on-drag-start)))]
[:div {:key (:id component)
:ref item-ref
[:div {:ref item-ref
:class (dom/classnames
:selected (contains? selected-components (:id component))
:grid-cell @listing-thumbs?
@ -426,23 +425,24 @@
[:& component-svg {:group (get-in component [:objects (:id component)])
:objects (:objects component)}]
(let [renaming? (= renaming (:id component))]
[:& editable-label
{:class (dom/classnames
:cell-name @listing-thumbs?
:item-name (not @listing-thumbs?)
:editing renaming?)
:value (cph/merge-path-item (:path component) (:name component))
:tooltip (cph/merge-path-item (:path component) (:name component))
:display-value (if @listing-thumbs?
(:name component)
(cph/compact-name (:path component)
(:name component)))
:editing? renaming?
:disable-dbl-click? true
:on-change do-rename
:on-cancel cancel-rename}]
(when @dragging?
[:div.dragging]))]))
[:*
[:& editable-label
{:class-name (dom/classnames
:cell-name @listing-thumbs?
:item-name (not @listing-thumbs?)
:editing renaming?)
:value (cph/merge-path-item (:path component) (:name component))
:tooltip (cph/merge-path-item (:path component) (:name component))
:display-value (if @listing-thumbs?
(:name component)
(cph/compact-name (:path component)
(:name component)))
:editing? renaming?
:disable-dbl-click? true
:on-change do-rename
:on-cancel cancel-rename}]
(when @dragging?
[:div.dragging])])]))
(mf/defc components-group
[{:keys [file-id prefix groups open-groups renaming listing-thumbs? selected-components on-asset-click
@ -510,6 +510,7 @@
[:div.drop-space])
(for [component components]
[:& components-item {:component component
:key (:id component)
:renaming renaming
:listing-thumbs? listing-thumbs?
:selected-components selected-components
@ -751,8 +752,7 @@
(fn [event]
(on-asset-drag-start event object selected-objects item-ref :graphics on-drag-start)))]
[:div {:key (:id object)
:ref item-ref
[:div {:ref item-ref
:class-name (dom/classnames
:selected (contains? selected-objects (:id object))
:grid-cell @listing-thumbs?
@ -769,23 +769,24 @@
:draggable false}] ;; Also need to add css pointer-events: none
(let [renaming? (= renaming (:id object))]
[:& editable-label
{:class-name (dom/classnames
:cell-name @listing-thumbs?
:item-name (not @listing-thumbs?)
:editing renaming?)
:value (cph/merge-path-item (:path object) (:name object))
:tooltip (cph/merge-path-item (:path object) (:name object))
:display-value (if @listing-thumbs?
(:name object)
(cph/compact-name (:path object)
(:name object)))
:editing? renaming?
:disable-dbl-click? true
:on-change do-rename
:on-cancel cancel-rename}]
(when @dragging?
[:div.dragging]))]))
[:*
[:& editable-label
{:class-name (dom/classnames
:cell-name @listing-thumbs?
:item-name (not @listing-thumbs?)
:editing renaming?)
:value (cph/merge-path-item (:path object) (:name object))
:tooltip (cph/merge-path-item (:path object) (:name object))
:display-value (if @listing-thumbs?
(:name object)
(cph/compact-name (:path object)
(:name object)))
:editing? renaming?
:disable-dbl-click? true
:on-change do-rename
:on-cancel cancel-rename}]
(when @dragging?
[:div.dragging])])]))
(mf/defc graphics-group
[{:keys [file-id prefix groups open-groups renaming listing-thumbs? selected-objects on-asset-click
@ -852,7 +853,8 @@
(some? groups))
[:div.drop-space])
(for [object objects]
[:& graphics-item {:object object
[:& graphics-item {:key (:id object)
:object object
:renaming renaming
:listing-thumbs? listing-thumbs?
:selected-objects selected-objects