Merge remote-tracking branch 'origin/staging'

This commit is contained in:
Andrey Antukh 2024-04-15 14:27:46 +02:00
commit 36e66c4dd9
6 changed files with 59 additions and 22 deletions

View file

@ -21,6 +21,10 @@
flex-direction: column; flex-direction: column;
} }
.public-DraftStyleDefault-block {
white-space: pre;
}
&.align-top { &.align-top {
.DraftEditor-root { .DraftEditor-root {
justify-content: flex-start; justify-content: flex-start;

View file

@ -1711,8 +1711,14 @@
(process-entry [[type data]] (process-entry [[type data]]
(case type (case type
:text :text
(if (str/empty? data) (cond
(str/empty? data)
(rx/empty) (rx/empty)
(re-find #"<svg\s" data)
(rx/of (paste-svg-text data))
:else
(rx/of (paste-text data))) (rx/of (paste-text data)))
:transit :transit
@ -1757,8 +1763,7 @@
text-data (some-> pdata wapi/extract-text) text-data (some-> pdata wapi/extract-text)
transit-data (ex/ignoring (some-> text-data t/decode-str))] transit-data (ex/ignoring (some-> text-data t/decode-str))]
(cond (cond
(and (string? text-data) (and (string? text-data) (re-find #"<svg\s" text-data))
(str/includes? text-data "<svg "))
(rx/of (paste-svg-text text-data)) (rx/of (paste-svg-text text-data))
(seq image-data) (seq image-data)

View file

@ -1491,9 +1491,22 @@
container container
{:type :reg-objects {:type :reg-objects
:shapes all-parents})])))) :shapes all-parents})]))))
(let [roperation {:type :set (let [;; position-data is a special case because can be affected by :geometry-group and :content-group
;; so, if the position-data changes but the geometry is touched we need to reset the position-data
;; so it's calculated again
reset-pos-data?
(and (cfh/text-shape? origin-shape)
(= attr :position-data)
(not= (get origin-shape attr) (get dest-shape attr))
(touched :geometry-group))
roperation {:type :set
:attr attr :attr attr
:val (get origin-shape attr) :val (cond
;; If position data changes and the geometry group is touched
;; we need to put to nil so we can regenerate it
reset-pos-data? nil
:else (get origin-shape attr))
:ignore-touched true} :ignore-touched true}
uoperation {:type :set uoperation {:type :set
:attr attr :attr attr

View file

@ -46,6 +46,7 @@
@extend .button-icon; @extend .button-icon;
stroke: var(--tab-foreground-color); stroke: var(--tab-foreground-color);
} }
.content { .content {
@include headlineSmallTypography; @include headlineSmallTypography;
text-align: center; text-align: center;
@ -53,17 +54,21 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
&.current, &.current,
&.current:hover { &.current:hover {
background: var(--tab-background-color-selected); background: var(--tab-background-color-selected);
border-color: var(--tab-border-color-selected); border-color: var(--tab-border-color-selected);
color: var(--tab-foreground-color-selected); color: var(--tab-foreground-color-selected);
svg { svg {
stroke: var(--tab-foreground-color-selected); stroke: var(--tab-foreground-color-selected);
} }
} }
&:hover { &:hover {
color: var(--tab-foreground-color-hover); color: var(--tab-foreground-color-hover);
svg { svg {
stroke: var(--tab-foreground-color-hover); stroke: var(--tab-foreground-color-hover);
} }
@ -78,6 +83,7 @@
min-width: $s-24; min-width: $s-24;
padding: 0 $s-6; padding: 0 $s-6;
border-radius: $br-5; border-radius: $br-5;
svg { svg {
@include flexCenter; @include flexCenter;
height: $s-16; height: $s-16;
@ -87,6 +93,7 @@
fill: none; fill: none;
color: transparent; color: transparent;
} }
&:hover { &:hover {
svg { svg {
stroke: var(--icon-foreground-hover); stroke: var(--icon-foreground-hover);
@ -107,3 +114,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
//Firefox doesn't respect scrollbar-gutter
@supports (-moz-appearance: none) {
.tab-container-content {
padding-right: $s-8;
}
}

View file

@ -181,14 +181,14 @@
[:span {:class (stl/css :resalted-area)}]]] [:span {:class (stl/css :resalted-area)}]]]
[:div {:class (stl/css :constraints-center)} [:div {:class (stl/css :constraints-center)}
[:button {:class (stl/css-case :constraint-btn true [:button {:class (stl/css-case :constraint-btn true
:active (= constraints-h :center)) :active (= constraints-v :center))
:data-value "centerh" :data-value "centerv"
:on-click on-constraint-button-clicked} :on-click on-constraint-button-clicked}
[:span {:class (stl/css :resalted-area)}]] [:span {:class (stl/css :resalted-area)}]]
[:button {:class (stl/css-case :constraint-btn-special true [:button {:class (stl/css-case :constraint-btn-special true
:constraint-btn-rotated true :constraint-btn-rotated true
:active (= constraints-v :center)) :active (= constraints-h :center))
:data-value "centerv" :data-value "centerh"
:on-click on-constraint-button-clicked} :on-click on-constraint-button-clicked}
[:span {:class (stl/css :resalted-area)}]]] [:span {:class (stl/css :resalted-area)}]]]
[:div {:class (stl/css :constraints-right)} [:div {:class (stl/css :constraints-right)}

View file

@ -69,33 +69,34 @@
on-add on-add
(mf/use-fn (mf/use-fn
(mf/deps ids) (mf/deps ids fills)
(fn [_] (fn [_]
(st/emit! (dc/add-fill ids {:color default-color (st/emit! (dc/add-fill ids {:color default-color
:opacity 1})) :opacity 1}))
(when (not (some? (seq fills))) (open-content)))) (when (or (= :multiple fills)
(not (some? (seq fills))))
(open-content))))
on-change on-change
(mf/use-fn (fn [index]
(mf/deps ids) (fn [color]
(fn [index] (st/emit! (dc/change-fill ids color index))))
(fn [color]
(st/emit! (dc/change-fill ids color index)))))
on-reorder on-reorder
(mf/use-fn (fn [new-index]
(mf/deps ids) (fn [index]
(fn [new-index] (st/emit! (dc/reorder-fills ids index new-index))))
(fn [index]
(st/emit! (dc/reorder-fills ids index new-index)))))
on-remove on-remove
(fn [index] (fn [index]
(fn [] (fn []
(st/emit! (dc/remove-fill ids {:color default-color (st/emit! (dc/remove-fill ids {:color default-color
:opacity 1} index)) :opacity 1} index))
(when (= 1 (count (seq fills))) (close-content)))) (when (or (= :multiple fills)
(= 1 (count (seq fills))))
(close-content))))
on-remove-all on-remove-all
(fn [_] (fn [_]
(st/emit! (dc/remove-all-fills ids {:color clr/black (st/emit! (dc/remove-all-fills ids {:color clr/black