From 50fd44d3f2ffa6c6c04b08cd4a1320c102aefb64 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 10 Jan 2022 15:28:28 +0100 Subject: [PATCH 1/7] :bug: Fix division by zero in bool operation --- CHANGES.md | 1 + common/src/app/common/geom/shapes/path.cljc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 54c943951..497e4a110 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -150,6 +150,7 @@ - Remove button after import process finish [Taiga #2215](https://tree.taiga.io/project/penpot/issue/2215) - Fix problem with styles in the viewer [Taiga #2467](https://tree.taiga.io/project/penpot/issue/2467) - Fix default state in viewer [Taiga #2465](https://tree.taiga.io/project/penpot/issue/2465) +- Fix division by zero in bool operation [Taiga #2349](https://tree.taiga.io/project/penpot/issue/2349) ### :heart: Community contributions by (Thank you!) diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index 062f4ea46..b9fc403ba 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -119,7 +119,9 @@ ;; normalize value d (mth/sqrt (+ (* x x) (* y y)))] - (gpt/point (/ x d) (/ y d)))) + (if (mth/almost-zero? d) + (gpt/point 0 0) + (gpt/point (/ x d) (/ y d))))) (defn curve-windup [curve t] From e5430259e9721355d5f7f2f0eb4ec4add1a8ee4c Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 10 Jan 2022 18:18:07 +0100 Subject: [PATCH 2/7] :bug: Changing pages while comments activated will not close the panel --- CHANGES.md | 1 + frontend/src/app/main/data/workspace.cljs | 19 +++++++++++-------- .../src/app/main/data/workspace/comments.cljs | 8 +++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 497e4a110..8905d9746 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ - Right click over artboard name to open its menu [Taiga #1679](https://tree.taiga.io/project/penpot/issue/1679) - Make the default session cookue use SameSite=Lax instead of Strict (causes some issues in latest versions of Chrome). - Fix "open in new tab" on dashboard [Taiga #2235](https://tree.taiga.io/project/penpot/issue/2355) +- Changing pages while comments activated will not close the panel [#1350](https://github.com/penpot/penpot/issues/1350) - Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 8146ef574..0be39e309 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -282,10 +282,13 @@ (let [local (-> (:workspace-local state) (dissoc :edition :edit-path - :selected))] - (-> state - (assoc-in [:workspace-cache page-id] local) - (dissoc :current-page-id :workspace-local :trimmed-page :workspace-drawing)))))) + :selected)) + exit-workspace? (not= :workspace (get-in state [:route :data :name]))] + (cond-> (assoc-in state [:workspace-cache page-id] local) + :always + (dissoc :current-page-id :workspace-local :trimmed-page) + exit-workspace? + (dissoc :workspace-drawing)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Workspace Page CRUD @@ -416,9 +419,9 @@ (-> local (assoc :vport size) (update :vbox (fn [vbox] - (-> vbox - (update :width #(/ % wprop)) - (update :height #(/ % hprop)))))))) + (-> vbox + (update :width #(/ % wprop)) + (update :height #(/ % hprop)))))))) (initialize [state local] (let [page-id (:current-page-id state) @@ -445,7 +448,7 @@ :y (+ (:y srect) (/ (- (:height srect) height) 2))))))) (setup [state local] - (if (and (:vbox local) (:vport local)) + (if (and (:vport local) (:vbox local)) (update* local) (initialize state local)))] diff --git a/frontend/src/app/main/data/workspace/comments.cljs b/frontend/src/app/main/data/workspace/comments.cljs index a064b0d0a..ede10867f 100644 --- a/frontend/src/app/main/data/workspace/comments.cljs +++ b/frontend/src/app/main/data/workspace/comments.cljs @@ -76,15 +76,13 @@ (update [_ state] (update state :workspace-local (fn [{:keys [vbox zoom] :as local}] - (let [pw (/ 50 zoom) - ph (/ 200 zoom) + (let [pw (/ 160 zoom) + ph (/ 160 zoom) nw (mth/round (- (/ (:width vbox) 2) pw)) nh (mth/round (- (/ (:height vbox) 2) ph)) nx (- (:x position) nw) ny (- (:y position) nh)] - - - (update local :vbox assoc :x nx :y ny))))))) + (update local :vbox assoc :x nx :y ny))))))) (defn navigate [thread] From badb5c6a9b24051d1ad59b2e2da4f87540989c55 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 11 Jan 2022 12:40:23 +0100 Subject: [PATCH 3/7] :bug: Fix keep name of component equal to the shape name --- CHANGES.md | 1 + .../main/data/workspace/libraries_helpers.cljs | 7 ++++--- frontend/test/app/components_basic_test.cljs | 15 +++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8905d9746..967a1314d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -46,6 +46,7 @@ - Fix "open in new tab" on dashboard [Taiga #2235](https://tree.taiga.io/project/penpot/issue/2355) - Changing pages while comments activated will not close the panel [#1350](https://github.com/penpot/penpot/issues/1350) - Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163) +- Fix keep name of component equal to the shape name [Taiga #2341](https://tree.taiga.io/project/penpot/issue/2341) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 852afb94c..b917a971d 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -130,11 +130,12 @@ (if (and (= (count shapes) 1) (:component-id (first shapes))) empty-changes - (let [[group rchanges uchanges] + (let [name (if (= 1 (count shapes)) (:name (first shapes)) "Component-1") + [group rchanges uchanges] (if (and (= (count shapes) 1) (= (:type (first shapes)) :group)) [(first shapes) [] []] - (dwg/prepare-create-group objects page-id shapes "Component-1" true)) + (dwg/prepare-create-group objects page-id shapes name true)) ;; Asserts for documentation purposes _ (us/assert vector? rchanges) @@ -146,7 +147,7 @@ rchanges (conj rchanges {:type :add-component :id (:id new-shape) - :name (:name new-shape) + :name name :shapes new-shapes}) rchanges (into rchanges diff --git a/frontend/test/app/components_basic_test.cljs b/frontend/test/app/components_basic_test.cljs index 30def79e5..6a22c61be 100644 --- a/frontend/test/app/components_basic_test.cljs +++ b/frontend/test/app/components_basic_test.cljs @@ -215,7 +215,7 @@ (let [state (-> thp/initial-state (thp/sample-page) (thp/sample-shape :shape1 :rect - {:name "Rect 1"}) + {:name "Rect-1"}) (thp/make-component :instance1 [(thp/id :shape1)])) @@ -247,8 +247,7 @@ new-state new-component-id)] - (t/is (= (:name component2) - "Component-2"))))) + (t/is (= (:name component2) "Rect-2"))))) (rx/subs done #(throw %)))))) @@ -292,7 +291,7 @@ (let [state (-> thp/initial-state (thp/sample-page) (thp/sample-shape :shape1 :rect - {:name "Rect 1"}) + {:name "Rect-1"}) (thp/make-component :instance1 [(thp/id :shape1)])) @@ -320,10 +319,10 @@ (t/is (not= (:id instance1) (:id instance2))) (t/is (= (:id component) component-id)) - (t/is (= (:name instance2) "Component-2")) - (t/is (= (:name shape2) "Rect 1")) - (t/is (= (:name c-instance2) "Component-1")) - (t/is (= (:name c-shape2) "Rect 1"))))) + (t/is (= (:name instance2) "Rect-3")) + (t/is (= (:name shape2) "Rect-1")) + (t/is (= (:name c-instance2) "Rect-2")) + (t/is (= (:name c-shape2) "Rect-1"))))) (rx/subs done #(throw %)))))) From 9403f8fd6eaa13584f2e31587e8e21fbb713f491 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 11 Jan 2022 17:21:10 +0100 Subject: [PATCH 4/7] :bug: Fix lossing changes when changing selection and an input was already changed --- CHANGES.md | 1 + .../app/main/ui/components/color_input.cljs | 31 ++++++++++++++++--- .../app/main/ui/components/numeric_input.cljs | 17 ++++++++++ .../sidebar/options/menus/stroke.cljs | 12 ++++--- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 967a1314d..476c024f5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -47,6 +47,7 @@ - Changing pages while comments activated will not close the panel [#1350](https://github.com/penpot/penpot/issues/1350) - Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163) - Fix keep name of component equal to the shape name [Taiga #2341](https://tree.taiga.io/project/penpot/issue/2341) +- Fix lossing changes when changing selection and an input was already changed [Taiga #2329](https://tree.taiga.io/project/penpot/issue/2329), [Taiga #2330](https://tree.taiga.io/project/penpot/issue/2330) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/components/color_input.cljs b/frontend/src/app/main/ui/components/color_input.cljs index 254a6c25f..f4cf702d3 100644 --- a/frontend/src/app/main/ui/components/color_input.cljs +++ b/frontend/src/app/main/ui/components/color_input.cljs @@ -13,6 +13,13 @@ [app.util.object :as obj] [rumext.alpha :as mf])) +(defn clean-color + [value] + (-> value + (uc/expand-hex) + (uc/parse-color) + (uc/prepend-hash))) + (mf/defc color-input {::mf/wrap-props false ::mf/forward-ref true} @@ -26,16 +33,17 @@ local-ref (mf/use-ref) ref (or external-ref local-ref) + ;; We need to store the handle-blur ref so we can call it on unmount + handle-blur-ref (mf/use-ref nil) + dirty-ref (mf/use-ref false) + parse-value (mf/use-callback (mf/deps ref) (fn [] (let [input-node (mf/ref-val ref)] (try - (let [new-value (-> (dom/get-value input-node) - (uc/expand-hex) - (uc/parse-color) - (uc/prepend-hash))] + (let [new-value (clean-color (dom/get-value input-node))] (dom/set-validity! input-node "") new-value) (catch :default _e @@ -53,7 +61,8 @@ (mf/use-callback (mf/deps on-change update-input) (fn [new-value] - (when new-value + (mf/set-ref-val! dirty-ref false) + (when (and new-value (not= (uc/remove-hash new-value) value)) (when on-change (on-change new-value)) (update-input new-value)))) @@ -62,6 +71,7 @@ (mf/use-callback (mf/deps apply-value update-input) (fn [event] + (mf/set-ref-val! dirty-ref true) (let [enter? (kbd/enter? event) esc? (kbd/esc? event)] (when enter? @@ -98,6 +108,17 @@ (when-let [node (mf/ref-val ref)] (dom/set-value! node value)))) + (mf/use-effect + (mf/deps handle-blur) + (fn [] + (mf/set-ref-val! handle-blur-ref {:fn handle-blur}))) + + (mf/use-layout-effect + (fn [] + #(when (mf/ref-val dirty-ref) + (let [handle-blur (:fn (mf/ref-val handle-blur-ref))] + (handle-blur))))) + [:* [:> :input props] ;; FIXME: this causes some weird interactions because of using apply-value diff --git a/frontend/src/app/main/ui/components/numeric_input.cljs b/frontend/src/app/main/ui/components/numeric_input.cljs index f385796da..b03e0a780 100644 --- a/frontend/src/app/main/ui/components/numeric_input.cljs +++ b/frontend/src/app/main/ui/components/numeric_input.cljs @@ -42,6 +42,10 @@ local-ref (mf/use-ref) ref (or external-ref local-ref) + ;; We need to store the handle-blur ref so we can call it on unmount + handle-blur-ref (mf/use-ref nil) + dirty-ref (mf/use-ref false) + ;; This `value` represents the previous value and is used as ;; initil value for the simple math expression evaluation. value (d/parse-integer value-str default-val) @@ -104,6 +108,7 @@ (mf/use-callback (mf/deps on-change update-input value) (fn [new-value] + (mf/set-ref-val! dirty-ref false) (when (and (not= new-value value) (some? on-change)) (on-change new-value)) (update-input new-value))) @@ -142,6 +147,7 @@ (mf/use-callback (mf/deps set-delta apply-value update-input) (fn [event] + (mf/set-ref-val! dirty-ref true) (let [up? (kbd/up-arrow? event) down? (kbd/down-arrow? event) enter? (kbd/enter? event) @@ -188,5 +194,16 @@ (when-not (dom/active? input-node) (dom/set-value! input-node value-str))))) + (mf/use-effect + (mf/deps handle-blur) + (fn [] + (mf/set-ref-val! handle-blur-ref {:fn handle-blur}))) + + (mf/use-layout-effect + (fn [] + #(when (mf/ref-val dirty-ref) + (let [handle-blur (:fn (mf/ref-val handle-blur-ref))] + (handle-blur))))) + [:> :input props])) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs index 4bbe2c22c..07c7823e3 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/stroke.cljs @@ -14,6 +14,7 @@ [app.main.data.workspace.colors :as dc] [app.main.store :as st] [app.main.ui.components.dropdown :refer [dropdown]] + [app.main.ui.components.numeric-input :refer [numeric-input]] [app.main.ui.icons :as i] [app.main.ui.workspace.sidebar.options.rows.color-row :refer [color-row]] [app.util.dom :as dom] @@ -208,11 +209,12 @@ [:div.input-element {:class (dom/classnames :pixels (not= (:stroke-width values) :multiple)) :title (tr "workspace.options.stroke-width")} - [:input.input-text {:type "number" - :min "0" - :value (-> (:stroke-width values) width->string) - :placeholder (tr "settings.multiple") - :on-change on-stroke-width-change}]] + + [:> numeric-input + {:min 0 + :value (-> (:stroke-width values) width->string) + :placeholder (tr "settings.multiple") + :on-change on-stroke-width-change}]] [:select#style.input-select {:value (enum->string (:stroke-alignment values)) :on-change on-stroke-alignment-change} From 4663c296cdfd701f35d24585c4eae77200c67d55 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 12 Jan 2022 09:25:05 +0100 Subject: [PATCH 5/7] :bug: Fix blur input field when click on viewport --- CHANGES.md | 1 + .../app/main/ui/components/color_input.cljs | 22 +++++++++++++++++-- .../app/main/ui/components/numeric_input.cljs | 22 ++++++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 476c024f5..1cfbc1979 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,7 @@ - Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163) - Fix keep name of component equal to the shape name [Taiga #2341](https://tree.taiga.io/project/penpot/issue/2341) - Fix lossing changes when changing selection and an input was already changed [Taiga #2329](https://tree.taiga.io/project/penpot/issue/2329), [Taiga #2330](https://tree.taiga.io/project/penpot/issue/2330) +- Fix blur input field when click on viewport [Taiga #2164](https://tree.taiga.io/project/penpot/issue/2164) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/components/color_input.cljs b/frontend/src/app/main/ui/components/color_input.cljs index f4cf702d3..779e8187e 100644 --- a/frontend/src/app/main/ui/components/color_input.cljs +++ b/frontend/src/app/main/ui/components/color_input.cljs @@ -8,10 +8,13 @@ (:require [app.util.color :as uc] [app.util.dom :as dom] + [app.util.globals :as globals] [app.util.i18n :as i18n :refer [tr]] [app.util.keyboard :as kbd] [app.util.object :as obj] - [rumext.alpha :as mf])) + [goog.events :as events] + [rumext.alpha :as mf]) + (:import goog.events.EventType)) (defn clean-color [value] @@ -91,7 +94,14 @@ (apply-value new-value) (update-input value))))) - ;; list-id (str "colors-" (uuid/next)) + on-click + (mf/use-callback + (fn [event] + (let [target (dom/get-target event)] + (when (some? ref) + (let [current (mf/ref-val ref)] + (when (and (some? current) (not (.contains current target))) + (dom/blur! current))))))) props (-> props (obj/without ["value" "onChange"]) @@ -119,6 +129,14 @@ (let [handle-blur (:fn (mf/ref-val handle-blur-ref))] (handle-blur))))) + (mf/use-layout-effect + (fn [] + (let [keys [(events/listen globals/window EventType.POINTERDOWN on-click) + (events/listen globals/window EventType.MOUSEDOWN on-click) + (events/listen globals/window EventType.CLICK on-click)]] + #(doseq [key keys] + (events/unlistenByKey key))))) + [:* [:> :input props] ;; FIXME: this causes some weird interactions because of using apply-value diff --git a/frontend/src/app/main/ui/components/numeric_input.cljs b/frontend/src/app/main/ui/components/numeric_input.cljs index b03e0a780..258fe0035 100644 --- a/frontend/src/app/main/ui/components/numeric_input.cljs +++ b/frontend/src/app/main/ui/components/numeric_input.cljs @@ -10,11 +10,14 @@ [app.common.math :as math] [app.common.spec :as us] [app.util.dom :as dom] + [app.util.globals :as globals] [app.util.keyboard :as kbd] [app.util.object :as obj] [app.util.simple-math :as sm] [app.util.strings :as ust] - [rumext.alpha :as mf])) + [goog.events :as events] + [rumext.alpha :as mf]) + (:import goog.events.EventType)) (defn num? [val] (and (number? val) @@ -176,6 +179,15 @@ (update-input new-value))) (when on-blur (on-blur)))) + on-click + (mf/use-callback + (fn [event] + (let [target (dom/get-target event)] + (when (some? ref) + (let [current (mf/ref-val ref)] + (when (and (some? current) (not (.contains current target))) + (dom/blur! current))))))) + props (-> props (obj/without ["value" "onChange"]) (obj/set! "className" "input-text") @@ -205,5 +217,13 @@ (let [handle-blur (:fn (mf/ref-val handle-blur-ref))] (handle-blur))))) + (mf/use-layout-effect + (fn [] + (let [keys [(events/listen globals/window EventType.POINTERDOWN on-click) + (events/listen globals/window EventType.MOUSEDOWN on-click) + (events/listen globals/window EventType.CLICK on-click)]] + #(doseq [key keys] + (events/unlistenByKey key))))) + [:> :input props])) From 2927b0cfc6d769ccbdd88ef8b7a62c4ae8bf7fa0 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 12 Jan 2022 12:54:59 +0100 Subject: [PATCH 6/7] :bug: Fix default page id in workspace --- CHANGES.md | 1 + frontend/src/app/main/data/workspace.cljs | 9 ++++++++- frontend/src/app/main/ui/workspace.cljs | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1cfbc1979..3af59a49d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -49,6 +49,7 @@ - Fix keep name of component equal to the shape name [Taiga #2341](https://tree.taiga.io/project/penpot/issue/2341) - Fix lossing changes when changing selection and an input was already changed [Taiga #2329](https://tree.taiga.io/project/penpot/issue/2329), [Taiga #2330](https://tree.taiga.io/project/penpot/issue/2330) - Fix blur input field when click on viewport [Taiga #2164](https://tree.taiga.io/project/penpot/issue/2164) +- Fix default page id in workspace [Taiga #2205](https://tree.taiga.io/project/penpot/issue/2205) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 0be39e309..bcf1bb0ac 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -253,17 +253,24 @@ (->> (rx/of ::dwp/finalize) (rx/observe-on :async)))))) +(declare go-to-page) (defn initialize-page [page-id] (us/assert ::us/uuid page-id) (ptk/reify ::initialize-page + ptk/WatchEvent + (watch [_ state _] + (when-not (contains? (get-in state [:workspace-data :pages-index]) page-id) + (let [default-page-id (get-in state [:workspace-data :pages 0])] + (rx/of (go-to-page default-page-id))))) + ptk/UpdateEvent (update [_ state] (let [;; we maintain a cache of page state for user convenience ;; with the exception of the selection; when user abandon ;; the current page, the selection is lost - page (get-in state [:workspace-data :pages-index page-id]) + page-id (:id page) local (-> state (get-in [:workspace-cache page-id] workspace-local-default) (assoc :selected (d/ordered-set)))] diff --git a/frontend/src/app/main/ui/workspace.cljs b/frontend/src/app/main/ui/workspace.cljs index 1ccc80d5b..7181f147f 100644 --- a/frontend/src/app/main/ui/workspace.cljs +++ b/frontend/src/app/main/ui/workspace.cljs @@ -87,7 +87,8 @@ (mf/defc workspace-page [{:keys [file layout page-id] :as props}] - (mf/use-layout-effect + + (mf/use-layout-effect (mf/deps page-id) (fn [] (if (nil? page-id) From 8da66e159944bc41a2119b03ec89554b5159697a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 12 Jan 2022 13:47:50 +0100 Subject: [PATCH 7/7] :bug: Fix problem when importing a file with grids --- CHANGES.md | 1 + common/src/app/common/types/page_options.cljc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3af59a49d..05299ba03 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,6 +50,7 @@ - Fix lossing changes when changing selection and an input was already changed [Taiga #2329](https://tree.taiga.io/project/penpot/issue/2329), [Taiga #2330](https://tree.taiga.io/project/penpot/issue/2330) - Fix blur input field when click on viewport [Taiga #2164](https://tree.taiga.io/project/penpot/issue/2164) - Fix default page id in workspace [Taiga #2205](https://tree.taiga.io/project/penpot/issue/2205) +- Fix problem when importing a file with grids [Taiga #2314](https://tree.taiga.io/project/penpot/issue/2314) ### :arrow_up: Deps updates diff --git a/common/src/app/common/types/page_options.cljc b/common/src/app/common/types/page_options.cljc index 968be643c..4901b8722 100644 --- a/common/src/app/common/types/page_options.cljc +++ b/common/src/app/common/types/page_options.cljc @@ -29,12 +29,12 @@ :artboard-grid/color])) (s/def :artboard-grid/column - (s/keys :req-un [:artboard-grid/size - :artboard-grid/color + (s/keys :req-un [:artboard-grid/color] + :opt-un [:artboard-grid/size + :artboard-grid/type + :artboard-grid/item-length :artboard-grid/margin - :artboard-grid/gutter] - :opt-un [:artboard-grid/type - :artboard-grid/item-length])) + :artboard-grid/gutter])) (s/def :artboard-grid/row :artboard-grid/column)