mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 21:08:34 +00:00
🐛 Fix props on text components (#9099)
This commit is contained in:
parent
d43d1f431f
commit
28b33b9acc
@ -27,7 +27,7 @@
|
|||||||
[app.main.ui.ds.foundations.assets.icon :as i]
|
[app.main.ui.ds.foundations.assets.icon :as i]
|
||||||
[app.main.ui.hooks :as hooks]
|
[app.main.ui.hooks :as hooks]
|
||||||
[app.main.ui.icons :as deprecated-icon]
|
[app.main.ui.icons :as deprecated-icon]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.typography :refer [text-options
|
[app.main.ui.workspace.sidebar.options.menus.typography :refer [text-options*
|
||||||
typography-entry]]
|
typography-entry]]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
@ -297,18 +297,19 @@
|
|||||||
|
|
||||||
multiple? (->> values vals (d/seek #(= % :multiple)))
|
multiple? (->> values vals (d/seek #(= % :multiple)))
|
||||||
|
|
||||||
opts #js {:ids ids
|
opts (mf/props
|
||||||
:values values
|
{:ids ids
|
||||||
:on-change on-change
|
:values values
|
||||||
:show-recent true
|
:on-change on-change
|
||||||
:on-blur
|
:show-recent true
|
||||||
(fn []
|
:on-blur
|
||||||
(ts/schedule
|
(fn []
|
||||||
100
|
(ts/schedule
|
||||||
(fn []
|
100
|
||||||
(when (not= "INPUT" (-> (dom/get-active) (dom/get-tag-name)))
|
(fn []
|
||||||
(let [node (txu/get-text-editor-content)]
|
(when (not= "INPUT" (-> (dom/get-active) (dom/get-tag-name)))
|
||||||
(dom/focus! node))))))}]
|
(let [node (txu/get-text-editor-content)]
|
||||||
|
(dom/focus! node))))))})]
|
||||||
|
|
||||||
(hooks/use-stream
|
(hooks/use-stream
|
||||||
expand-stream
|
expand-stream
|
||||||
@ -346,7 +347,7 @@
|
|||||||
deprecated-icon/detach]]
|
deprecated-icon/detach]]
|
||||||
|
|
||||||
:else
|
:else
|
||||||
[:> text-options opts])
|
[:> text-options* opts])
|
||||||
|
|
||||||
[:div {:class (stl/css :text-align-options)}
|
[:div {:class (stl/css :text-align-options)}
|
||||||
[:> text-align-options* opts]
|
[:> text-align-options* opts]
|
||||||
|
|||||||
@ -444,8 +444,7 @@
|
|||||||
:value "lowercase"
|
:value "lowercase"
|
||||||
:id "text-transform-lowercase"}]]]))
|
:id "text-transform-lowercase"}]]]))
|
||||||
|
|
||||||
(mf/defc text-options
|
(mf/defc text-options*
|
||||||
{::mf/wrap-props false}
|
|
||||||
[{:keys [ids editor values on-change on-blur show-recent]}]
|
[{:keys [ids editor values on-change on-blur show-recent]}]
|
||||||
(let [full-size-selector? (and show-recent (= (mf/use-ctx ctx/sidebar) :right))
|
(let [full-size-selector? (and show-recent (= (mf/use-ctx ctx/sidebar) :right))
|
||||||
opts #js {:editor editor
|
opts #js {:editor editor
|
||||||
@ -502,9 +501,9 @@
|
|||||||
:on-click on-close}
|
:on-click on-close}
|
||||||
deprecated-icon/tick]]
|
deprecated-icon/tick]]
|
||||||
|
|
||||||
[:& text-options {:values typography
|
[:> text-options* {:values typography
|
||||||
:on-change on-change
|
:on-change on-change
|
||||||
:show-recent false}]]
|
:show-recent false}]]
|
||||||
|
|
||||||
[:div {:class (stl/css :typography-info-wrapper)}
|
[:div {:class (stl/css :typography-info-wrapper)}
|
||||||
[:div {:class (stl/css :typography-name-wrapper)}
|
[:div {:class (stl/css :typography-name-wrapper)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user