mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 14:41:38 +02:00
Merge pull request #2748 from penpot/eva-workspace-visual-changes
Bugfixing
This commit is contained in:
commit
553f2f5576
23 changed files with 163 additions and 27 deletions
|
@ -13,7 +13,7 @@
|
||||||
width: 65px;
|
width: 65px;
|
||||||
|
|
||||||
.color-bullet {
|
.color-bullet {
|
||||||
border: 2px solid $color-gray-60;
|
border: 2px solid $color-gray-30;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: var(--bullet-size);
|
width: var(--bullet-size);
|
||||||
height: var(--bullet-size);
|
height: var(--bullet-size);
|
||||||
|
@ -30,21 +30,21 @@
|
||||||
|
|
||||||
.color-cell.current {
|
.color-cell.current {
|
||||||
.color-bullet {
|
.color-bullet {
|
||||||
border-color: $color-gray-50;
|
border-color: $color-gray-30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.palette-menu .color-bullet {
|
ul.palette-menu .color-bullet {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border: 1px solid $color-gray-10;
|
border: 1px solid $color-gray-30;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
background-size: 8px;
|
background-size: 8px;
|
||||||
}
|
}
|
||||||
.color-cell.add-color .color-bullet {
|
.color-cell.add-color .color-bullet {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: $color-gray-50;
|
background-color: $color-gray-50;
|
||||||
border: 3px dashed $color-gray-10;
|
border: 3px dashed $color-gray-30;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -62,17 +62,24 @@ ul.palette-menu .color-bullet {
|
||||||
grid-area: color;
|
grid-area: color;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border: 1px solid $color-gray-10;
|
border: 1px solid $color-gray-30;
|
||||||
background-size: 8px;
|
background-size: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-section .asset-list-item .color-bullet {
|
.asset-section .asset-list-item .color-bullet {
|
||||||
border: 1px solid $color-gray-20;
|
border: 1px solid $color-gray-30;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin-right: $size-1;
|
margin-right: $size-1;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
|
.asset-list .asset-list-item {
|
||||||
|
&:hover {
|
||||||
|
.color-bullet {
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.color-cell.add-color:hover .color-bullet {
|
.color-cell.add-color:hover .color-bullet {
|
||||||
border-color: $color-gray-30;
|
border-color: $color-gray-30;
|
||||||
|
|
|
@ -522,6 +522,7 @@
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: $color-primary !important;
|
border-color: $color-primary !important;
|
||||||
color: $color-white;
|
color: $color-white;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
padding: $size-1 $size-4 $size-1 $size-2;
|
padding: $size-1 $size-4 $size-1 $size-2;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
user-select: none;
|
||||||
&.team {
|
&.team {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 20% 1fr 20%;
|
grid-template-columns: 20% 1fr 20%;
|
||||||
|
@ -85,6 +86,7 @@
|
||||||
font-size: $fs22;
|
font-size: $fs22;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
user-select: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.context-menu.is-open {
|
.context-menu.is-open {
|
||||||
|
|
|
@ -186,6 +186,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
// TODO: should be deprecated / unclear name
|
// TODO: should be deprecated / unclear name
|
||||||
&.dashboard-common {
|
&.dashboard-common {
|
||||||
|
@ -223,7 +224,6 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
user-select: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
|
|
|
@ -106,6 +106,9 @@
|
||||||
border: 1px dashed $color-gray-20;
|
border: 1px dashed $color-gray-20;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
.table-header {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
|
@ -148,9 +151,11 @@
|
||||||
|
|
||||||
&.roles {
|
&.roles {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
user-select: none;
|
|
||||||
cursor: default;
|
cursor: default;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.rol-label {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
.rol-selector {
|
.rol-selector {
|
||||||
&.has-priv {
|
&.has-priv {
|
||||||
border: 1px solid $color-gray-20;
|
border: 1px solid $color-gray-20;
|
||||||
|
|
|
@ -164,8 +164,10 @@
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
margin-right: $size-4;
|
margin-right: $size-4;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
user-select: none;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
&.dashboard-projects {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
&.no-bg {
|
&.no-bg {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid $color-gray-60;
|
border: 1px solid $color-gray-30;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide-color .color-bullet {
|
.hide-color .color-bullet {
|
||||||
|
@ -173,6 +173,11 @@
|
||||||
background-position: 95% 48%;
|
background-position: 95% 48%;
|
||||||
background-size: 10px;
|
background-size: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
option {
|
option {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 448px;
|
width: 448px;
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
|
max-height: 700px;
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -104,6 +105,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.component-list {
|
||||||
|
max-height: 408px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-item-element {
|
.modal-item-element {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
color: lighten($color-gray-10, 8%);
|
color: lighten($color-gray-10, 8%);
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +100,10 @@
|
||||||
color: lighten($color-gray-10, 8%);
|
color: lighten($color-gray-10, 8%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
border-color: $color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
option {
|
option {
|
||||||
background: $color-white;
|
background: $color-white;
|
||||||
color: $color-gray-60;
|
color: $color-gray-60;
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
color: lighten($color-gray-10, 8%);
|
color: lighten($color-gray-10, 8%);
|
||||||
|
border-color: $color-primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
option {
|
option {
|
||||||
|
@ -312,6 +313,14 @@
|
||||||
border: 1px solid $color-gray-20;
|
border: 1px solid $color-gray-20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.opened {
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.custom-select-dropdown {
|
.custom-select-dropdown {
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
|
@ -549,6 +558,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.presets {
|
.presets {
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
.custom-select-dropdown {
|
.custom-select-dropdown {
|
||||||
width: 237px;
|
width: 237px;
|
||||||
|
|
||||||
|
@ -968,6 +982,15 @@
|
||||||
input {
|
input {
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
width: 74px;
|
width: 74px;
|
||||||
|
&:focus {
|
||||||
|
border-color: $color-primary !important;
|
||||||
|
color: $color-white;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: $color-gray-20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,9 @@
|
||||||
span {
|
span {
|
||||||
color: $color-gray-60;
|
color: $color-gray-60;
|
||||||
}
|
}
|
||||||
|
input {
|
||||||
|
color: $color-white !important;
|
||||||
|
}
|
||||||
|
|
||||||
.toggle-content {
|
.toggle-content {
|
||||||
svg {
|
svg {
|
||||||
|
@ -149,6 +152,9 @@
|
||||||
span.element-name {
|
span.element-name {
|
||||||
color: $color-gray-60;
|
color: $color-gray-60;
|
||||||
}
|
}
|
||||||
|
input.element-name {
|
||||||
|
color: $color-white !important;
|
||||||
|
}
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
fill: $color-gray-60;
|
fill: $color-gray-60;
|
||||||
|
@ -203,6 +209,14 @@
|
||||||
|
|
||||||
input.element-name {
|
input.element-name {
|
||||||
max-width: 75%;
|
max-width: 75%;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: $color-gray-50;
|
||||||
|
color: $color-white;
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
outline: none;
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
span.element-name {
|
span.element-name {
|
||||||
|
@ -225,7 +239,6 @@ span.element-name {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
right: 20px;
|
|
||||||
|
|
||||||
&.is-parent {
|
&.is-parent {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
@ -306,12 +319,16 @@ span.element-name {
|
||||||
|
|
||||||
&.search {
|
&.search {
|
||||||
.search-box {
|
.search-box {
|
||||||
border: 1px solid $color-primary;
|
border: 1px solid $color-gray-20;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
&:active,
|
||||||
|
&:focus-within {
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
input {
|
input {
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -319,6 +336,9 @@ span.element-name {
|
||||||
color: $color-white;
|
color: $color-white;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|
|
@ -390,6 +390,7 @@ button.collapse-sidebar {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 12px 10px;
|
padding: 12px 10px;
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -397,6 +398,9 @@ button.collapse-sidebar {
|
||||||
border: 1px solid $color-gray-30;
|
border: 1px solid $color-gray-30;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
&:focus-within {
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
.input-text {
|
.input-text {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: $color-gray-50;
|
background: $color-gray-50;
|
||||||
|
|
|
@ -145,6 +145,12 @@
|
||||||
background: $color-gray-50;
|
background: $color-gray-50;
|
||||||
color: $color-gray-10;
|
color: $color-gray-10;
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
outline: none;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid $color-primary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,8 @@
|
||||||
(dom/blur! input-node)))
|
(dom/blur! input-node)))
|
||||||
(when esc?
|
(when esc?
|
||||||
(dom/prevent-default event)
|
(dom/prevent-default event)
|
||||||
(update-input value)))))
|
(update-input value)
|
||||||
|
(dom/blur! input-node)))))
|
||||||
|
|
||||||
handle-blur
|
handle-blur
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
|
|
@ -163,7 +163,8 @@
|
||||||
(when enter?
|
(when enter?
|
||||||
(dom/blur! input-node))
|
(dom/blur! input-node))
|
||||||
(when esc?
|
(when esc?
|
||||||
(update-input value-str)))))
|
(update-input value-str)
|
||||||
|
(dom/blur! input-node)))))
|
||||||
|
|
||||||
handle-mouse-wheel
|
handle-mouse-wheel
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
(when (> (count items) 0)
|
(when (> (count items) 0)
|
||||||
[:*
|
[:*
|
||||||
[:p (tr "ds.component-subtitle")]
|
[:p (tr "ds.component-subtitle")]
|
||||||
[:ul
|
[:ul.component-list
|
||||||
(for [item items]
|
(for [item items]
|
||||||
[:li.modal-item-element
|
[:li.modal-item-element
|
||||||
[:span.modal-component-icon i/component]
|
[:span.modal-component-icon i/component]
|
||||||
|
|
|
@ -407,7 +407,7 @@
|
||||||
[:& interface-walkthrough
|
[:& interface-walkthrough
|
||||||
{:close-walkthrough close-walkthrough}])])
|
{:close-walkthrough close-walkthrough}])])
|
||||||
|
|
||||||
[:div.dashboard-container.no-bg
|
[:div.dashboard-container.no-bg.dashboard-projects
|
||||||
(for [{:keys [id] :as project} projects]
|
(for [{:keys [id] :as project} projects]
|
||||||
(let [files (when recent-map
|
(let [files (when recent-map
|
||||||
(->> (vals recent-map)
|
(->> (vals recent-map)
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
(when-not (:gradient color) [:div (str (* 100 (:opacity color)) "%")])]))
|
(when-not (:gradient color) [:div (str (* 100 (:opacity color)) "%")])]))
|
||||||
|
|
||||||
(when-not (and on-change-format (:gradient color))
|
(when-not (and on-change-format (:gradient color))
|
||||||
[:select {:on-change #(-> (dom/get-target-val %) keyword on-change-format)}
|
[:select.color-format-select {:on-change #(-> (dom/get-target-val %) keyword on-change-format)}
|
||||||
[:option {:value "hex"}
|
[:option {:value "hex"}
|
||||||
(tr "inspect.attributes.color.hex")]
|
(tr "inspect.attributes.color.hex")]
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.strings :refer [matches-search]]
|
[app.util.strings :refer [matches-search]]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
|
@ -93,11 +94,22 @@
|
||||||
(st/emit! (modal/show
|
(st/emit! (modal/show
|
||||||
{:type :delete-shared
|
{:type :delete-shared
|
||||||
:origin :unpublish
|
:origin :unpublish
|
||||||
:on-accept (fn[]
|
:on-accept (fn []
|
||||||
(st/emit! (dwl/set-file-shared (:id file) false))
|
(st/emit! (dwl/set-file-shared (:id file) false))
|
||||||
(modal/show! :libraries-dialog {}))
|
(modal/show! :libraries-dialog {}))
|
||||||
:on-cancel #(modal/show! :libraries-dialog {})
|
:on-cancel #(modal/show! :libraries-dialog {})
|
||||||
:count-libraries 1}))))]
|
:count-libraries 1}))))
|
||||||
|
handle-key-down
|
||||||
|
(mf/use-callback
|
||||||
|
(fn [event]
|
||||||
|
(let [enter? (kbd/enter? event)
|
||||||
|
esc? (kbd/esc? event)
|
||||||
|
input-node (dom/event->target event)]
|
||||||
|
|
||||||
|
(when enter?
|
||||||
|
(dom/blur! input-node))
|
||||||
|
(when esc?
|
||||||
|
(dom/blur! input-node)))))]
|
||||||
[:*
|
[:*
|
||||||
[:div.section
|
[:div.section
|
||||||
[:div.section-title (tr "workspace.libraries.in-this-file")]
|
[:div.section-title (tr "workspace.libraries.in-this-file")]
|
||||||
|
@ -130,7 +142,8 @@
|
||||||
{:placeholder (tr "workspace.libraries.search-shared-libraries")
|
{:placeholder (tr "workspace.libraries.search-shared-libraries")
|
||||||
:type "text"
|
:type "text"
|
||||||
:value @search-term
|
:value @search-term
|
||||||
:on-change on-search-term-change}]
|
:on-change on-search-term-change
|
||||||
|
:on-key-down handle-key-down}]
|
||||||
(if (str/empty? @search-term)
|
(if (str/empty? @search-term)
|
||||||
[:div.search-icon
|
[:div.search-icon
|
||||||
i/search]
|
i/search]
|
||||||
|
|
|
@ -2243,7 +2243,19 @@
|
||||||
(let [value (-> (dom/get-target event)
|
(let [value (-> (dom/get-target event)
|
||||||
(dom/get-value)
|
(dom/get-value)
|
||||||
(d/read-string))]
|
(d/read-string))]
|
||||||
(swap! filters assoc :box value))))]
|
(swap! filters assoc :box value))))
|
||||||
|
|
||||||
|
handle-key-down
|
||||||
|
(mf/use-callback
|
||||||
|
(fn [event]
|
||||||
|
(let [enter? (kbd/enter? event)
|
||||||
|
esc? (kbd/esc? event)
|
||||||
|
input-node (dom/event->target event)]
|
||||||
|
|
||||||
|
(when enter?
|
||||||
|
(dom/blur! input-node))
|
||||||
|
(when esc?
|
||||||
|
(dom/blur! input-node)))))]
|
||||||
|
|
||||||
[:div.assets-bar
|
[:div.assets-bar
|
||||||
[:div.tool-window
|
[:div.tool-window
|
||||||
|
@ -2260,7 +2272,8 @@
|
||||||
{:placeholder (tr "workspace.assets.search")
|
{:placeholder (tr "workspace.assets.search")
|
||||||
:type "text"
|
:type "text"
|
||||||
:value (:term @filters)
|
:value (:term @filters)
|
||||||
:on-change on-search-term-change}]
|
:on-change on-search-term-change
|
||||||
|
:on-key-down handle-key-down}]
|
||||||
(if (str/empty? (:term @filters))
|
(if (str/empty? (:term @filters))
|
||||||
[:div.search-icon
|
[:div.search-icon
|
||||||
i/search]
|
i/search]
|
||||||
|
|
|
@ -468,7 +468,19 @@
|
||||||
handle-show-more
|
handle-show-more
|
||||||
(fn []
|
(fn []
|
||||||
(when (<= (:num-items @filter-state) (count filtered-objects-total))
|
(when (<= (:num-items @filter-state) (count filtered-objects-total))
|
||||||
(swap! filter-state update :num-items + 100)))]
|
(swap! filter-state update :num-items + 100)))
|
||||||
|
|
||||||
|
handle-key-down
|
||||||
|
(mf/use-callback
|
||||||
|
(fn [event]
|
||||||
|
(let [enter? (kbd/enter? event)
|
||||||
|
esc? (kbd/esc? event)
|
||||||
|
input-node (dom/event->target event)]
|
||||||
|
|
||||||
|
(when enter?
|
||||||
|
(dom/blur! input-node))
|
||||||
|
(when esc?
|
||||||
|
(dom/blur! input-node)))))]
|
||||||
|
|
||||||
[filtered-objects
|
[filtered-objects
|
||||||
handle-show-more
|
handle-show-more
|
||||||
|
@ -483,7 +495,8 @@
|
||||||
[:input {:on-change update-search-text
|
[:input {:on-change update-search-text
|
||||||
:value (:search-text @filter-state)
|
:value (:search-text @filter-state)
|
||||||
:auto-focus (:show-search-box @filter-state)
|
:auto-focus (:show-search-box @filter-state)
|
||||||
:placeholder (tr "workspace.sidebar.layers.search")}]]
|
:placeholder (tr "workspace.sidebar.layers.search")
|
||||||
|
:on-key-down handle-key-down}]]
|
||||||
(when (not (= "" (:search-text @filter-state)))
|
(when (not (= "" (:search-text @filter-state)))
|
||||||
[:span.clear {:on-click clear-search-text} i/exclude])]
|
[:span.clear {:on-click clear-search-text} i/exclude])]
|
||||||
[:span {:on-click toggle-search} i/cross]]
|
[:span {:on-click toggle-search} i/cross]]
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :refer [tr c]]
|
[app.util.i18n :refer [tr c]]
|
||||||
|
[app.util.keyboard :as kbd]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(def exports-attrs
|
(def exports-attrs
|
||||||
|
@ -123,7 +124,13 @@
|
||||||
(fn []
|
(fn []
|
||||||
(st/emit! (dch/update-shapes ids
|
(st/emit! (dch/update-shapes ids
|
||||||
(fn [shape]
|
(fn [shape]
|
||||||
(assoc shape :exports []))))))]
|
(assoc shape :exports []))))))
|
||||||
|
manage-key-down
|
||||||
|
(mf/use-callback
|
||||||
|
(fn [event]
|
||||||
|
(let [esc? (kbd/esc? event)]
|
||||||
|
(when esc?
|
||||||
|
(dom/blur! (dom/get-target event))))))]
|
||||||
|
|
||||||
[:div.element-set.exports-options
|
[:div.element-set.exports-options
|
||||||
[:div.element-set-title
|
[:div.element-set-title
|
||||||
|
@ -156,7 +163,8 @@
|
||||||
[:option {:value "6"} "6x"]])
|
[:option {:value "6"} "6x"]])
|
||||||
[:input.input-text {:value (:suffix export)
|
[:input.input-text {:value (:suffix export)
|
||||||
:placeholder (tr "workspace.options.export.suffix")
|
:placeholder (tr "workspace.options.export.suffix")
|
||||||
:on-change (partial on-suffix-change index)}]
|
:on-change (partial on-suffix-change index)
|
||||||
|
:on-key-down manage-key-down}]
|
||||||
[:select.input-select {:value (name (:type export))
|
[:select.input-select {:value (name (:type export))
|
||||||
:on-change (partial on-type-change index)}
|
:on-change (partial on-type-change index)}
|
||||||
[:option {:value "png"} "PNG"]
|
[:option {:value "png"} "PNG"]
|
||||||
|
|
|
@ -282,7 +282,8 @@
|
||||||
(when (and (options :presets)
|
(when (and (options :presets)
|
||||||
(or (nil? all-types) (= (count all-types) 1))) ;; Don't show presets if multi selected
|
(or (nil? all-types) (= (count all-types) 1))) ;; Don't show presets if multi selected
|
||||||
[:div.row-flex ;; some frames and some non frames
|
[:div.row-flex ;; some frames and some non frames
|
||||||
[:div.presets.custom-select.flex-grow {:on-click #(reset! show-presets-dropdown? true)}
|
[:div.presets.custom-select.flex-grow {:class (when @show-presets-dropdown? "opened")
|
||||||
|
:on-click #(reset! show-presets-dropdown? true)}
|
||||||
[:span (tr "workspace.options.size-presets")]
|
[:span (tr "workspace.options.size-presets")]
|
||||||
[:span.dropdown-button i/arrow-down]
|
[:span.dropdown-button i/arrow-down]
|
||||||
[:& dropdown {:show @show-presets-dropdown?
|
[:& dropdown {:show @show-presets-dropdown?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue