:construction-worker: Add text placeholders

This commit is contained in:
Eva Marco 2026-04-23 16:13:28 +02:00
parent 3e9da023f0
commit 35a60c4c8d
2 changed files with 18 additions and 10 deletions

View File

@ -292,7 +292,7 @@
(csu/get-token-dropdown-options typography-tokens nil))
selected-token-id*
(mf/use-state #(when current-token-name
(mf/use-state #(when (and (not= :multiple current-token-name) current-token-name)
(:id (get-option-by-name dropdown-options current-token-name))))
selected-token-id (deref selected-token-id*)
@ -443,7 +443,7 @@
(mf/with-effect [applied-token-name dropdown-options]
(reset! selected-token-id*
(when applied-token-name
(when (and (not= :multiple applied-token-name)applied-token-name)
(:id (get-option-by-name dropdown-options applied-token-name)))))
(mf/with-effect [token-dropdown-open?]
@ -475,18 +475,17 @@
(when main-menu-open?
[:div {:class (stl/css :element-content)}
(cond
(and token-typography-row-enabled? (= :multiple current-token-name) (= typography-id :multiple))
[:div "Texts have multiple typography assets and typography tokens applied"]
(and token-typography-row-enabled? (= :multiple current-token-name))
[:div "token-multiple"]
(and token-typography-row-enabled? current-token-name)
[:> token-typography-row* {:token-name current-token-name
:detach-token detach-token
:active-tokens (resolve-delay typography-tokens)}]
typography
[:& typography-entry {:file-id typography-file-id
:typography typography
:local? (= typography-file-id file-id)
:on-detach handle-detach-typography
:on-change handle-change-typography}]
(= typography-id :multiple)
[:div {:class (stl/css :multiple-typography)}
[:span {:class (stl/css :multiple-text)} (tr "workspace.libraries.text.multiple-typography")]
@ -495,6 +494,15 @@
:on-click handle-detach-typography
:icon i/detach}]]
typography
[:& typography-entry {:file-id typography-file-id
:typography typography
:local? (= typography-file-id file-id)
:on-detach handle-detach-typography
:on-change handle-change-typography}]
:else
[:> text-options #js {:ids ids
:values values

View File

@ -274,7 +274,7 @@
(merge-attrs shape-attrs)
(merge-attrs content-attrs))
new-token-acc (merge-token-values token-acc content-attrs applied-tokens)]
new-token-acc (merge-token-values token-acc editable-attrs applied-tokens)]
[(conj ids id)
new-values
new-token-acc])