mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
✨ Add some missing text properties in plugins
This commit is contained in:
parent
b9e40b4d82
commit
84ecb99400
1 changed files with 62 additions and 1 deletions
|
@ -229,6 +229,19 @@
|
||||||
:else
|
:else
|
||||||
(st/emit! (dwt/update-text-range id start end {:direction value}))))}
|
(st/emit! (dwt/update-text-range id start end {:direction value}))))}
|
||||||
|
|
||||||
|
{:name "align"
|
||||||
|
:get #(let [range-data
|
||||||
|
(-> % u/proxy->shape :content (txt/content-range->text+styles start end))]
|
||||||
|
(->> range-data (map :text-align) mixed-value))
|
||||||
|
:set
|
||||||
|
(fn [_ value]
|
||||||
|
(cond
|
||||||
|
(not (string? value))
|
||||||
|
(u/display-not-valid :text-align value)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(st/emit! (dwt/update-text-range id start end {:text-align value}))))}
|
||||||
|
|
||||||
{:name "fills"
|
{:name "fills"
|
||||||
:get #(let [range-data
|
:get #(let [range-data
|
||||||
(-> % u/proxy->shape :content (txt/content-range->text+styles start end))]
|
(-> % u/proxy->shape :content (txt/content-range->text+styles start end))]
|
||||||
|
@ -1253,7 +1266,55 @@
|
||||||
(u/display-not-valid :textTransform value)
|
(u/display-not-valid :textTransform value)
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(st/emit! (dwt/update-attrs id {:text-transform value})))))}))
|
(st/emit! (dwt/update-attrs id {:text-transform value})))))}
|
||||||
|
|
||||||
|
{:name "textDecoration"
|
||||||
|
:get #(-> % u/proxy->shape text-props :text-decoration)
|
||||||
|
:set
|
||||||
|
(fn [self value]
|
||||||
|
(let [id (obj/get self "$id")]
|
||||||
|
(cond
|
||||||
|
(not (string? value))
|
||||||
|
(u/display-not-valid :textDecoration value)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(st/emit! (dwt/update-attrs id {:text-decoration value})))))}
|
||||||
|
|
||||||
|
{:name "direction"
|
||||||
|
:get #(-> % u/proxy->shape text-props :text-direction)
|
||||||
|
:set
|
||||||
|
(fn [self value]
|
||||||
|
(let [id (obj/get self "$id")]
|
||||||
|
(cond
|
||||||
|
(not (string? value))
|
||||||
|
(u/display-not-valid :textDecoration value)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(st/emit! (dwt/update-attrs id {:text-decoration value})))))}
|
||||||
|
|
||||||
|
{:name "align"
|
||||||
|
:get #(-> % u/proxy->shape text-props :text-align)
|
||||||
|
:set
|
||||||
|
(fn [self value]
|
||||||
|
(let [id (obj/get self "$id")]
|
||||||
|
(cond
|
||||||
|
(not (string? value))
|
||||||
|
(u/display-not-valid :align value)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(st/emit! (dwt/update-attrs id {:text-align value})))))}
|
||||||
|
|
||||||
|
{:name "verticalAlign"
|
||||||
|
:get #(-> % u/proxy->shape text-props :vertical-align)
|
||||||
|
:set
|
||||||
|
(fn [self value]
|
||||||
|
(let [id (obj/get self "$id")]
|
||||||
|
(cond
|
||||||
|
(not (string? value))
|
||||||
|
(u/display-not-valid :verticalAlign value)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(st/emit! (dwt/update-attrs id {:vertical-align value})))))}))
|
||||||
|
|
||||||
(cond-> (or (cfh/path-shape? data) (cfh/bool-shape? data))
|
(cond-> (or (cfh/path-shape? data) (cfh/bool-shape? data))
|
||||||
(crc/add-properties!
|
(crc/add-properties!
|
||||||
|
|
Loading…
Reference in a new issue