mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
@@ -76,6 +76,7 @@
|
|||||||
- Fix the context menu always closes after any action [Taiga #11624](https://tree.taiga.io/project/penpot/issue/11624)
|
- Fix the context menu always closes after any action [Taiga #11624](https://tree.taiga.io/project/penpot/issue/11624)
|
||||||
- Fix X & Y position do not sincronize with tokens [Taiga #11617](https://tree.taiga.io/project/penpot/issue/11617)
|
- Fix X & Y position do not sincronize with tokens [Taiga #11617](https://tree.taiga.io/project/penpot/issue/11617)
|
||||||
- Fix tooltip position after first time [Taiga #11688](https://tree.taiga.io/project/penpot/issue/11688)
|
- Fix tooltip position after first time [Taiga #11688](https://tree.taiga.io/project/penpot/issue/11688)
|
||||||
|
- Fix inconsistent ordering of pinned projects on dashboard sidebar [Taiga #11674](https://tree.taiga.io/project/penpot/issue/11674)
|
||||||
- Fix export button width on inspect tab [Taiga #11394](https://tree.taiga.io/project/penpot/issue/11394)
|
- Fix export button width on inspect tab [Taiga #11394](https://tree.taiga.io/project/penpot/issue/11394)
|
||||||
- Fix stroke width token application [Taiga #11724](https://tree.taiga.io/project/penpot/issue/11724)
|
- Fix stroke width token application [Taiga #11724](https://tree.taiga.io/project/penpot/issue/11724)
|
||||||
- Fix number token application on shape [Taiga #11331](https://tree.taiga.io/project/penpot/task/11331)
|
- Fix number token application on shape [Taiga #11331](https://tree.taiga.io/project/penpot/task/11331)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
"canceled"
|
"canceled"
|
||||||
"incomplete"
|
"incomplete"
|
||||||
"incomplete_expired"
|
"incomplete_expired"
|
||||||
"pass_due"
|
"past_due"
|
||||||
"paused"
|
"paused"
|
||||||
"trialing"
|
"trialing"
|
||||||
"unpaid"]]
|
"unpaid"]]
|
||||||
|
|||||||
@@ -148,18 +148,17 @@
|
|||||||
|
|
||||||
(defn- bind!
|
(defn- bind!
|
||||||
[shortcuts]
|
[shortcuts]
|
||||||
(let [msbind (fn [command callback type]
|
|
||||||
(let [command (if (vector? command)
|
|
||||||
(into-array command)
|
|
||||||
command)]
|
|
||||||
(if type
|
|
||||||
(mousetrap/bind command callback type)
|
|
||||||
(mousetrap/bind command callback))))]
|
|
||||||
(->> shortcuts
|
(->> shortcuts
|
||||||
(remove #(:disabled (second %)))
|
(remove #(:disabled (second %)))
|
||||||
(run! (fn [[key {:keys [command fn type]}]]
|
(run! (fn [[key {:keys [command fn type overwrite]}]]
|
||||||
(let [callback (wrap-cb key fn)]
|
(let [callback (wrap-cb key fn)
|
||||||
(msbind command callback type)))))))
|
undefined (js* "(void 0)")
|
||||||
|
commands (if (vector? command)
|
||||||
|
(into-array command)
|
||||||
|
#js [command])]
|
||||||
|
(if type
|
||||||
|
(mousetrap/bind commands callback type overwrite)
|
||||||
|
(mousetrap/bind commands callback undefined overwrite)))))))
|
||||||
|
|
||||||
(defn- reset!
|
(defn- reset!
|
||||||
([]
|
([]
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
[app.util.dom.dnd :as dnd]
|
[app.util.dom.dnd :as dnd]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.object :as obj]
|
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
@@ -194,7 +193,7 @@
|
|||||||
:on-edit on-edit-open
|
:on-edit on-edit-open
|
||||||
:on-close on-menu-close}]]))
|
:on-close on-menu-close}]]))
|
||||||
|
|
||||||
(mf/defc sidebar-search
|
(mf/defc sidebar-search*
|
||||||
[{:keys [search-term team-id] :as props}]
|
[{:keys [search-term team-id] :as props}]
|
||||||
(let [search-term (or search-term "")
|
(let [search-term (or search-term "")
|
||||||
focused? (mf/use-state false)
|
focused? (mf/use-state false)
|
||||||
@@ -468,7 +467,7 @@
|
|||||||
:data-testid "delete-team"}
|
:data-testid "delete-team"}
|
||||||
(tr "dashboard.delete-team")])]))
|
(tr "dashboard.delete-team")])]))
|
||||||
|
|
||||||
(mf/defc sidebar-team-switch
|
(mf/defc sidebar-team-switch*
|
||||||
[{:keys [team profile] :as props}]
|
[{:keys [team profile] :as props}]
|
||||||
(let [teams (mf/deref refs/teams)
|
(let [teams (mf/deref refs/teams)
|
||||||
|
|
||||||
@@ -588,8 +587,7 @@
|
|||||||
:profile profile}]]))
|
:profile profile}]]))
|
||||||
|
|
||||||
(mf/defc sidebar-content*
|
(mf/defc sidebar-content*
|
||||||
{::mf/private true
|
{::mf/private true}
|
||||||
::mf/props :obj}
|
|
||||||
[{:keys [projects profile section team project search-term default-project] :as props}]
|
[{:keys [projects profile section team project search-term default-project] :as props}]
|
||||||
(let [default-project-id
|
(let [default-project-id
|
||||||
(get default-project :id)
|
(get default-project :id)
|
||||||
@@ -602,6 +600,7 @@
|
|||||||
drafts? (and (= section :dashboard-files)
|
drafts? (and (= section :dashboard-files)
|
||||||
(= (:id project) default-project-id))
|
(= (:id project) default-project-id))
|
||||||
container (mf/use-ref nil)
|
container (mf/use-ref nil)
|
||||||
|
|
||||||
overflow* (mf/use-state false)
|
overflow* (mf/use-state false)
|
||||||
overflow? (deref overflow*)
|
overflow? (deref overflow*)
|
||||||
|
|
||||||
@@ -612,7 +611,8 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps team-id)
|
(mf/deps team-id)
|
||||||
(fn []
|
(fn []
|
||||||
(st/emit! (dcm/go-to-dashboard-recent :team-id team-id)
|
(st/emit!
|
||||||
|
(dcm/go-to-dashboard-recent :team-id team-id)
|
||||||
(ts/schedule-on-idle
|
(ts/schedule-on-idle
|
||||||
(fn []
|
(fn []
|
||||||
(when-let [projects-title (dom/get-element "dashboard-projects-title")]
|
(when-let [projects-title (dom/get-element "dashboard-projects-title")]
|
||||||
@@ -628,14 +628,17 @@
|
|||||||
go-fonts-with-key
|
go-fonts-with-key
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps team)
|
(mf/deps team)
|
||||||
#(st/emit! (dcm/go-to-dashboard-fonts :team-id team-id)
|
(fn []
|
||||||
|
(st/emit!
|
||||||
|
(dcm/go-to-dashboard-fonts :team-id team-id)
|
||||||
(ts/schedule-on-idle
|
(ts/schedule-on-idle
|
||||||
(fn []
|
(fn []
|
||||||
(let [font-title (dom/get-element "dashboard-fonts-title")]
|
(let [font-title (dom/get-element "dashboard-fonts-title")]
|
||||||
(when font-title
|
(when font-title
|
||||||
(dom/set-attribute! font-title "tabindex" "0")
|
(dom/set-attribute! font-title "tabindex" "0")
|
||||||
(dom/focus! font-title)
|
(dom/focus! font-title)
|
||||||
(dom/set-attribute! font-title "tabindex" "-1")))))))
|
(dom/set-attribute! font-title "tabindex" "-1"))))))))
|
||||||
|
|
||||||
go-drafts
|
go-drafts
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps team-id default-project-id)
|
(mf/deps team-id default-project-id)
|
||||||
@@ -657,38 +660,42 @@
|
|||||||
go-libs
|
go-libs
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps team-id)
|
(mf/deps team-id)
|
||||||
#(st/emit! (dcm/go-to-dashboard-libraries :team-id team-id)))
|
(fn [] (st/emit! (dcm/go-to-dashboard-libraries :team-id team-id))))
|
||||||
|
|
||||||
go-libs-with-key
|
go-libs-with-key
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps team-id)
|
(mf/deps team-id)
|
||||||
#(st/emit! (dcm/go-to-dashboard-libraries :team-id team-id)
|
(fn []
|
||||||
|
(st/emit!
|
||||||
|
(dcm/go-to-dashboard-libraries :team-id team-id)
|
||||||
(ts/schedule-on-idle
|
(ts/schedule-on-idle
|
||||||
(fn []
|
(fn []
|
||||||
(let [libs-title (dom/get-element "dashboard-libraries-title")]
|
(let [libs-title (dom/get-element "dashboard-libraries-title")]
|
||||||
(when libs-title
|
(when libs-title
|
||||||
(dom/set-attribute! libs-title "tabindex" "0")
|
(dom/set-attribute! libs-title "tabindex" "0")
|
||||||
(dom/focus! libs-title)
|
(dom/focus! libs-title)
|
||||||
(dom/set-attribute! libs-title "tabindex" "-1")))))))
|
(dom/set-attribute! libs-title "tabindex" "-1"))))))))
|
||||||
|
|
||||||
pinned-projects
|
pinned-projects
|
||||||
|
(mf/with-memo [projects]
|
||||||
(->> projects
|
(->> projects
|
||||||
(remove :is-default)
|
(remove :is-default)
|
||||||
(filter :is-pinned))]
|
(filter :is-pinned)
|
||||||
|
(sort-by :name)
|
||||||
|
(not-empty)))]
|
||||||
|
|
||||||
(mf/use-layout-effect
|
(mf/with-layout-effect [pinned-projects]
|
||||||
(mf/deps pinned-projects)
|
(let [node (mf/ref-val container)
|
||||||
(fn []
|
client-height (.-clientHeight ^js node)
|
||||||
(let [dom (mf/ref-val container)
|
scroll-height (.-scrollHeight ^js node)]
|
||||||
client-height (obj/get dom "clientHeight")
|
(reset! overflow* (> scroll-height client-height))))
|
||||||
scroll-height (obj/get dom "scrollHeight")]
|
|
||||||
(reset! overflow* (> scroll-height client-height)))))
|
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
[:div {:class (stl/css-case :sidebar-content true)
|
[:div {:class (stl/css-case :sidebar-content true)
|
||||||
:ref container}
|
:ref container}
|
||||||
[:& sidebar-team-switch {:team team :profile profile}]
|
[:> sidebar-team-switch* {:team team :profile profile}]
|
||||||
|
|
||||||
[:& sidebar-search {:search-term search-term
|
[:> sidebar-search* {:search-term search-term
|
||||||
:team-id (:id team)}]
|
:team-id (:id team)}]
|
||||||
|
|
||||||
[:div {:class (stl/css :sidebar-content-section)}
|
[:div {:class (stl/css :sidebar-content-section)}
|
||||||
@@ -733,7 +740,7 @@
|
|||||||
:data-testid "pinned-projects"}
|
:data-testid "pinned-projects"}
|
||||||
[:div {:class (stl/css :sidebar-section-title)}
|
[:div {:class (stl/css :sidebar-section-title)}
|
||||||
(tr "labels.pinned-projects")]
|
(tr "labels.pinned-projects")]
|
||||||
(if (seq pinned-projects)
|
(if (some? pinned-projects)
|
||||||
[:ul {:class (stl/css :sidebar-nav :pinned-projects)}
|
[:ul {:class (stl/css :sidebar-nav :pinned-projects)}
|
||||||
(for [item pinned-projects]
|
(for [item pinned-projects]
|
||||||
[:& sidebar-project
|
[:& sidebar-project
|
||||||
@@ -748,7 +755,6 @@
|
|||||||
[:div {:class (stl/css-case :separator true :overflow-separator overflow?)}]]))
|
[:div {:class (stl/css-case :separator true :overflow-separator overflow?)}]]))
|
||||||
|
|
||||||
(mf/defc profile-section*
|
(mf/defc profile-section*
|
||||||
{::mf/props :obj}
|
|
||||||
[{:keys [profile team]}]
|
[{:keys [profile team]}]
|
||||||
(let [show-profile-menu* (mf/use-state false)
|
(let [show-profile-menu* (mf/use-state false)
|
||||||
show-profile-menu? (deref show-profile-menu*)
|
show-profile-menu? (deref show-profile-menu*)
|
||||||
|
|||||||
@@ -251,6 +251,8 @@
|
|||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
margin-inline-start: var(--sp-xl);
|
margin-inline-start: var(--sp-xl);
|
||||||
margin-block: var(--sp-xxl);
|
margin-block: var(--sp-xxl);
|
||||||
|
max-height: $s-216;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-field {
|
.input-field {
|
||||||
|
|||||||
@@ -24,5 +24,6 @@
|
|||||||
{:delete-stop {:tooltip (ds/supr)
|
{:delete-stop {:tooltip (ds/supr)
|
||||||
:command ["del" "backspace"]
|
:command ["del" "backspace"]
|
||||||
:subsections [:edit]
|
:subsections [:edit]
|
||||||
|
:overwrite true
|
||||||
:fn #(st/emit! (dwc/remove-gradient-stop))}}))
|
:fn #(st/emit! (dwc/remove-gradient-stop))}}))
|
||||||
|
|
||||||
|
|||||||
16
frontend/vendor/mousetrap/index.js
vendored
16
frontend/vendor/mousetrap/index.js
vendored
@@ -821,7 +821,7 @@ function Mousetrap(targetElement) {
|
|||||||
* @param {number=} level - what part of the sequence the command is
|
* @param {number=} level - what part of the sequence the command is
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
function _bindSingle(combination, callback, action, sequenceName, level) {
|
function _bindSingle(combination, callback, action, sequenceName, level, overwrite) {
|
||||||
|
|
||||||
// store a direct mapped reference for use with Mousetrap.trigger
|
// store a direct mapped reference for use with Mousetrap.trigger
|
||||||
self._directMap[combination + ':' + action] = callback;
|
self._directMap[combination + ':' + action] = callback;
|
||||||
@@ -845,8 +845,10 @@ function Mousetrap(targetElement) {
|
|||||||
// a callback is added for this key
|
// a callback is added for this key
|
||||||
self._callbacks[info.key] = self._callbacks[info.key] || [];
|
self._callbacks[info.key] = self._callbacks[info.key] || [];
|
||||||
|
|
||||||
// // remove an existing match if there is one
|
// remove an existing match if there is one
|
||||||
// _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
|
if (overwrite) {
|
||||||
|
_getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
|
||||||
|
}
|
||||||
|
|
||||||
// add this call back to the array
|
// add this call back to the array
|
||||||
// if it is a sequence put it at the beginning
|
// if it is a sequence put it at the beginning
|
||||||
@@ -872,9 +874,9 @@ function Mousetrap(targetElement) {
|
|||||||
* @param {string|undefined} action
|
* @param {string|undefined} action
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
self._bindMultiple = function(combinations, callback, action) {
|
self._bindMultiple = function(combinations, callback, action, overwrite) {
|
||||||
for (var i = 0; i < combinations.length; ++i) {
|
for (var i = 0; i < combinations.length; ++i) {
|
||||||
_bindSingle(combinations[i], callback, action);
|
_bindSingle(combinations[i], callback, action, undefined, undefined, overwrite);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -899,10 +901,10 @@ function Mousetrap(targetElement) {
|
|||||||
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
Mousetrap.prototype.bind = function(keys, callback, action) {
|
Mousetrap.prototype.bind = function(keys, callback, action, overwrite) {
|
||||||
var self = this;
|
var self = this;
|
||||||
keys = keys instanceof Array ? keys : [keys];
|
keys = keys instanceof Array ? keys : [keys];
|
||||||
self._bindMultiple.call(self, keys, callback, action);
|
self._bindMultiple.call(self, keys, callback, action, overwrite);
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user