diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 296cd7c92..75fb6945a 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -1521,11 +1521,26 @@ (defn- update-flex-child-copy-attrs "Synchronizes the attributes inside the flex-child items (main->copy)" - [changes _shape-main shape-copy main-container main-component copy-container omit-touched?] + [changes shape-main shape-copy main-container main-component copy-container omit-touched?] + (let [new-changes (-> (pcb/empty-changes) (pcb/with-container copy-container) (pcb/with-objects (:objects copy-container)) + + ;; The layout-item-sizing needs to be update when the parent is auto or fix + (pcb/update-shapes + [(:id shape-copy)] + (fn [shape-copy] + (cond-> shape-copy + (contains? #{:auto :fix} (:layout-item-h-sizing shape-main)) + (propagate-attrs shape-main #{:layout-item-h-sizing} omit-touched?) + + (contains? #{:auto :fix} (:layout-item-h-sizing shape-main)) + (propagate-attrs shape-main #{:layout-item-v-sizing} omit-touched?))) + {:ignore-touched true}) + + ;; Update the child flex properties from the parent (pcb/update-shapes (:shapes shape-copy) (fn [child-copy] @@ -1542,6 +1557,20 @@ (-> (pcb/empty-changes) (pcb/with-page main-container) (pcb/with-objects (:objects main-container)) + + ;; The layout-item-sizing needs to be update when the parent is auto or fix + (pcb/update-shapes + [(:id shape-main)] + (fn [shape-main] + (cond-> shape-main + (contains? #{:auto :fix} (:layout-item-h-sizing shape-copy)) + (propagate-attrs shape-copy #{:layout-item-h-sizing} omit-touched?) + + (contains? #{:auto :fix} (:layout-item-h-sizing shape-copy)) + (propagate-attrs shape-copy #{:layout-item-v-sizing} omit-touched?))) + {:ignore-touched true}) + + ;; Updates the children properties from the parent (pcb/update-shapes (:shapes shape-main) (fn [child-main] @@ -1620,4 +1649,3 @@ (if (cfh/page? container) (assoc change :page-id (:id container)) (assoc change :component-id (:id container)))) - diff --git a/frontend/src/app/main/ui/comments.scss b/frontend/src/app/main/ui/comments.scss index ddad36a6b..12890644d 100644 --- a/frontend/src/app/main/ui/comments.scss +++ b/frontend/src/app/main/ui/comments.scss @@ -196,6 +196,7 @@ position: relative; .text { @include bodySmallTypography; + white-space: pre; } } } diff --git a/frontend/src/app/main/ui/components/numeric_input.cljs b/frontend/src/app/main/ui/components/numeric_input.cljs index 308ef8e42..54965605e 100644 --- a/frontend/src/app/main/ui/components/numeric_input.cljs +++ b/frontend/src/app/main/ui/components/numeric_input.cljs @@ -152,7 +152,7 @@ handle-key-down (mf/use-fn - (mf/deps set-delta apply-value update-input) + (mf/deps set-delta apply-value update-input parse-value) (fn [event] (mf/set-ref-val! dirty-ref true) (let [up? (kbd/up-arrow? event) @@ -162,19 +162,13 @@ node (mf/ref-val ref)] (when (or up? down?) (set-delta event up? down?)) + (reset! last-value* (parse-value)) (when enter? (dom/blur! node)) (when esc? (update-input value-str) (dom/blur! node))))) - handle-key-up - (mf/use-fn - (mf/deps parse-value) - (fn [] - ;; Store the last value inputed - (reset! last-value* (parse-value)))) - handle-mouse-wheel (mf/use-fn (mf/deps set-delta) @@ -231,7 +225,6 @@ (obj/set! "defaultValue" (fmt/format-number value)) (obj/set! "title" title) (obj/set! "onKeyDown" handle-key-down) - (obj/set! "onKeyUp" handle-key-up) (obj/set! "onBlur" handle-blur) (obj/set! "onFocus" handle-focus))] diff --git a/frontend/src/app/main/ui/dashboard/import.cljs b/frontend/src/app/main/ui/dashboard/import.cljs index d51195184..14f0318e3 100644 --- a/frontend/src/app/main/ui/dashboard/import.cljs +++ b/frontend/src/app/main/ui/dashboard/import.cljs @@ -345,18 +345,21 @@ edition* (mf/use-state nil) edition (deref edition*) + template-finished* (mf/use-state nil) + template-finished (deref template-finished*) + on-template-cloned-success (mf/use-fn (fn [] - (swap! status* (constantly :importing)) - ;; (swap! state assoc :status :importing :importing-templates 0) + (reset! status* :importing) + (reset! template-finished* true) (st/emit! (dd/fetch-recent-files)))) on-template-cloned-error (mf/use-fn (fn [cause] - (swap! status* (constantly :error)) - ;; (swap! state assoc :status :error :importing-templates 0) + (reset! status* :error) + (reset! template-finished* true) (errors/print-error! cause) (rx/of (modal/hide) (msg/error (tr "dashboard.libraries-and-templates.import-error"))))) @@ -434,15 +437,29 @@ 1 (count (filterv has-status-success? entries))) - errors? (or (some has-status-error? entries) - (zero? (count entries))) - + errors? (if (some? template) + (= status :error) + (or (some has-status-error? entries) + (zero? (count entries)))) pending-analysis? (some has-status-analyzing? entries) - pending-import? (pos? num-importing) - valid-all-entries? (or (some? template) - (not (some has-status-analyze-error? entries)))] + pending-import? (and (or (nil? template) + (not template-finished)) + (pos? num-importing)) + valid-all-entries? (or (some? template) + (not (some has-status-analyze-error? entries))) + + template-status + (cond + (and (= :importing status) pending-import?) + :importing + + (and (= :importing status) (not ^boolean pending-import?)) + :import-finish + + :else + :ready)] ;; Run analyze operation on component mount (mf/with-effect [] @@ -486,7 +503,7 @@ :can-be-deleted (> (count entries) 1)}]) (when (some? template) - [:& import-entry {:entry (assoc template :status :ready) + [:& import-entry {:entry (assoc template :status template-status) :can-be-deleted false}])] [:div {:class (stl/css :modal-footer)} diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs index fc31dc4f0..b7a5dde44 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs @@ -480,6 +480,7 @@ [:button {:class (stl/css-case :padding-toggle true :selected (= type :multiple)) + :title (tr "workspace.layout_grid.editor.padding.expand") :data-type (d/name type) :on-click on-type-change'} i/padding-extended]])) diff --git a/frontend/translations/en.po b/frontend/translations/en.po index df15b1c17..d4b3e9527 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -3520,6 +3520,9 @@ msgstr "Edit grid" msgid "workspace.layout_grid.editor.options.exit" msgstr "Exit" +msgid "workspace.layout_grid.editor.padding.expand" +msgstr "Show 4 sided padding options" + #: src/app/main/ui/workspace/libraries.cljs msgid "workspace.libraries.add" msgstr "Add" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 5ce93d9b9..e2072c81d 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -3582,6 +3582,9 @@ msgstr "Editar rejilla" msgid "workspace.layout_grid.editor.options.exit" msgstr "Salir" +msgid "workspace.layout_grid.editor.padding.expand" +msgstr "Mostrar el padding a 4 lados" + #: src/app/main/ui/workspace/libraries.cljs msgid "workspace.libraries.add" msgstr "AƱadir"