diff --git a/frontend/src/app/main/ui/inspect/attributes/blur.cljs b/frontend/src/app/main/ui/inspect/attributes/blur.cljs index 6694af6769..979eeaf0fb 100644 --- a/frontend/src/app/main/ui/inspect/attributes/blur.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/blur.cljs @@ -14,7 +14,7 @@ [app.util.i18n :refer [tr]] [rumext.v2 :as mf])) -(defn has-blur? [shape] +(defn- has-blur? [shape] (:blur shape)) (mf/defc blur-panel diff --git a/frontend/src/app/main/ui/inspect/attributes/fill.cljs b/frontend/src/app/main/ui/inspect/attributes/fill.cljs index a1d8afeae5..7a40aefa56 100644 --- a/frontend/src/app/main/ui/inspect/attributes/fill.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/fill.cljs @@ -14,9 +14,9 @@ [app.util.i18n :refer [tr]] [rumext.v2 :as mf])) -(def properties [:background :background-color :background-image]) +(def ^:private properties [:background :background-color :background-image]) -(defn has-fill? [shape] +(defn- has-fill? [shape] (and (not (contains? #{:text :group} (:type shape))) (or (:fill-color shape) diff --git a/frontend/src/app/main/ui/inspect/attributes/geometry.cljs b/frontend/src/app/main/ui/inspect/attributes/geometry.cljs index afe68b5442..78828abdba 100644 --- a/frontend/src/app/main/ui/inspect/attributes/geometry.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/geometry.cljs @@ -16,7 +16,7 @@ [app.util.i18n :refer [tr]] [rumext.v2 :as mf])) -(def properties +(def ^:private properties [:width :height :left diff --git a/frontend/src/app/main/ui/inspect/attributes/layout.cljs b/frontend/src/app/main/ui/inspect/attributes/layout.cljs index 3017c589e2..6a697f2425 100644 --- a/frontend/src/app/main/ui/inspect/attributes/layout.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/layout.cljs @@ -16,7 +16,7 @@ [app.util.code-gen.style-css :as css] [rumext.v2 :as mf])) -(def properties +(def ^:private properties [:display :flex-direction :flex-wrap diff --git a/frontend/src/app/main/ui/inspect/attributes/layout_element.cljs b/frontend/src/app/main/ui/inspect/attributes/layout_element.cljs index 0d913a4c7b..190a53ee75 100644 --- a/frontend/src/app/main/ui/inspect/attributes/layout_element.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/layout_element.cljs @@ -16,7 +16,7 @@ [app.util.code-gen.style-css :as css] [rumext.v2 :as mf])) -(def properties +(def ^:private properties [:margin :max-height :min-height diff --git a/frontend/src/app/main/ui/inspect/attributes/shadow.cljs b/frontend/src/app/main/ui/inspect/attributes/shadow.cljs index 1ca32271fc..212f384795 100644 --- a/frontend/src/app/main/ui/inspect/attributes/shadow.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/shadow.cljs @@ -14,16 +14,12 @@ [app.main.ui.inspect.attributes.common :refer [color-row]] [app.util.code-gen.style-css :as css] [app.util.i18n :refer [tr]] - [cuerdas.core :as str] [rumext.v2 :as mf])) -(defn has-shadow? [shape] +(defn- has-shadow? [shape] (:shadow shape)) -(defn shape-copy-data [shape] - (str/join ", " (map css/shadow->css (:shadow shape)))) - -(defn shadow-copy-data [shadow] +(defn- shadow-copy-data [shadow] (css/shadow->css shadow)) (mf/defc shadow-block [{:keys [shadow]}] diff --git a/frontend/src/app/main/ui/inspect/attributes/stroke.cljs b/frontend/src/app/main/ui/inspect/attributes/stroke.cljs index bff426e6fa..e276172a81 100644 --- a/frontend/src/app/main/ui/inspect/attributes/stroke.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/stroke.cljs @@ -13,9 +13,9 @@ [app.util.i18n :refer [tr]] [rumext.v2 :as mf])) -(def properties [:border]) +(def ^:private properties [:border]) -(defn stroke->color [shape] +(defn- stroke->color [shape] {:color (:stroke-color shape) :opacity (:stroke-opacity shape) :gradient (:stroke-color-gradient shape) @@ -23,7 +23,7 @@ :file-id (:stroke-color-ref-file shape) :image (:stroke-image shape)}) -(defn has-stroke? [shape] +(defn- has-stroke? [shape] (seq (:strokes shape))) (mf/defc stroke-block diff --git a/frontend/src/app/main/ui/inspect/attributes/svg.cljs b/frontend/src/app/main/ui/inspect/attributes/svg.cljs index c72c5466c9..798a1b0849 100644 --- a/frontend/src/app/main/ui/inspect/attributes/svg.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/svg.cljs @@ -14,7 +14,7 @@ [cuerdas.core :as str] [rumext.v2 :as mf])) -(defn map->css [attr] +(defn- map->css [attr] (->> attr (map (fn [[attr-key attr-value]] (str (d/name attr-key) ":" attr-value))) (str/join "; "))) diff --git a/frontend/src/app/main/ui/inspect/attributes/text.cljs b/frontend/src/app/main/ui/inspect/attributes/text.cljs index 82ef17f97d..742ab0cb5e 100644 --- a/frontend/src/app/main/ui/inspect/attributes/text.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/text.cljs @@ -23,19 +23,19 @@ [okulary.core :as l] [rumext.v2 :as mf])) -(defn has-text? [shape] +(defn- has-text? [shape] (:content shape)) -(def file-typographies-ref +(def ^:private file-typographies-ref (l/derived (l/in [:viewer :file :data :typographies]) st/state)) -(defn make-typographies-library-ref [file-id] +(defn- make-typographies-library-ref [file-id] (let [get-library (fn [state] (get-in state [:viewer-libraries file-id :data :typographies]))] #(l/derived get-library st/state))) -(defn copy-style-data +(defn- copy-style-data [style & properties] (->> properties (map #(dm/str (d/name %) ": " (get style %) ";")) diff --git a/frontend/src/app/main/ui/inspect/attributes/visibility.cljs b/frontend/src/app/main/ui/inspect/attributes/visibility.cljs index 672bb60a0c..b89e165501 100644 --- a/frontend/src/app/main/ui/inspect/attributes/visibility.cljs +++ b/frontend/src/app/main/ui/inspect/attributes/visibility.cljs @@ -14,12 +14,12 @@ [app.util.code-gen.style-css :as css] [rumext.v2 :as mf])) -(def properties +(def ^:private properties [:opacity :blend-mode :visibility]) -(defn has-visibility-props? [shape] +(defn- has-visibility-props? [shape] (let [shape-type (:type shape)] (and (not (or (= shape-type :text) (= shape-type :group))) @@ -44,7 +44,8 @@ (mf/defc visibility-panel* [{:keys [objects shapes]}] - (let [shapes (mf/with-memo (filter has-visibility-props? shapes))] + (let [shapes (mf/with-memo [shapes] + (filter has-visibility-props? shapes))] (when (seq shapes) [:div {:class (stl/css :attributes-block)}