mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
📎 Fix linter issues
Related to the linter update on devenv
This commit is contained in:
parent
97bf20dd4c
commit
65e99cabbf
13 changed files with 33 additions and 31 deletions
|
@ -213,7 +213,7 @@
|
|||
[& args]
|
||||
`(jdbc/with-transaction ~@args))
|
||||
|
||||
(defn ^Connection open
|
||||
(defn open
|
||||
[pool]
|
||||
(jdbc/get-connection pool))
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
(s/def ::info-data
|
||||
(s/keys :req-un [::fullname ::email ::backend]))
|
||||
|
||||
(defn ^java.lang.AutoCloseable connect
|
||||
(defn connect
|
||||
^java.lang.AutoCloseable
|
||||
[]
|
||||
(let [params {:ssl? (cfg/get :ldap-ssl)
|
||||
:startTLS? (cfg/get :ldap-starttls)
|
||||
|
|
|
@ -130,7 +130,8 @@
|
|||
(def default-timeout
|
||||
(dt/duration {:seconds 30}))
|
||||
|
||||
(defn- ^Region lookup-region
|
||||
(defn- lookup-region
|
||||
^Region
|
||||
[region]
|
||||
(Region/of (name region)))
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
[v]
|
||||
(InternetAddress/parse ^String v))
|
||||
|
||||
(defn- ^Message$RecipientType resolve-recipient-type
|
||||
(defn- resolve-recipient-type
|
||||
^Message$RecipientType
|
||||
[type]
|
||||
(case type
|
||||
:to Message$RecipientType/TO
|
||||
|
@ -157,7 +158,8 @@
|
|||
(.setDebug session debug)
|
||||
session))
|
||||
|
||||
(defn ^MimeMessage smtp-message
|
||||
(defn smtp-message
|
||||
^MimeMessage
|
||||
[cfg message]
|
||||
(let [^Session session (smtp-session cfg)]
|
||||
(build-message cfg session message)))
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
[svg-attrs svg-styles]
|
||||
(extract-svg-attrs render-id svg-defs svg-attrs)
|
||||
|
||||
styles (-> (obj/get props "style" (obj/new))
|
||||
styles (-> (obj/get props "style" (obj/create))
|
||||
(obj/merge! svg-styles)
|
||||
(add-layer-props shape))
|
||||
|
||||
|
@ -211,24 +211,24 @@
|
|||
|
||||
(defn extract-style-attrs
|
||||
[shape]
|
||||
(-> (obj/new)
|
||||
(-> (obj/create)
|
||||
(add-style-attrs shape)))
|
||||
|
||||
(defn extract-fill-attrs
|
||||
[fill-data render-id index type]
|
||||
(let [fill-styles (-> (obj/get fill-data "style" (obj/new))
|
||||
(let [fill-styles (-> (obj/get fill-data "style" (obj/create))
|
||||
(add-fill fill-data render-id index type))]
|
||||
(-> (obj/new)
|
||||
(-> (obj/create)
|
||||
(obj/set! "style" fill-styles))))
|
||||
|
||||
(defn extract-stroke-attrs
|
||||
[stroke-data index render-id]
|
||||
(let [stroke-styles (-> (obj/get stroke-data "style" (obj/new))
|
||||
(let [stroke-styles (-> (obj/get stroke-data "style" (obj/create))
|
||||
(add-stroke stroke-data render-id index))]
|
||||
(-> (obj/new)
|
||||
(-> (obj/create)
|
||||
(obj/set! "style" stroke-styles))))
|
||||
|
||||
(defn extract-border-radius-attrs
|
||||
[shape]
|
||||
(-> (obj/new)
|
||||
(-> (obj/create)
|
||||
(add-border-radius shape)))
|
||||
|
|
|
@ -428,7 +428,7 @@
|
|||
elem-name (obj/get child "type")
|
||||
render-id (or (obj/get props "render-id") (mf/use-ctx muc/render-ctx))
|
||||
stroke-id (dm/fmt "strokes-%" (:id shape))
|
||||
stroke-props (-> (obj/new)
|
||||
stroke-props (-> (obj/create)
|
||||
(obj/set! "id" stroke-id)
|
||||
(cond->
|
||||
;; There is a blur
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
(when (= (:type shape) :svg-raw)
|
||||
(let [shape (-> shape (d/update-in-when [:content :attrs :style] str->style))
|
||||
props
|
||||
(-> (obj/new)
|
||||
(-> (obj/create)
|
||||
(obj/set! "penpot:x" (:x shape))
|
||||
(obj/set! "penpot:y" (:y shape))
|
||||
(obj/set! "penpot:width" (:width shape))
|
||||
|
@ -328,7 +328,7 @@
|
|||
|
||||
(mf/defc export-data
|
||||
[{:keys [shape]}]
|
||||
(let [props (-> (obj/new) (add-data shape) (add-library-refs shape))]
|
||||
(let [props (-> (obj/create) (add-data shape) (add-library-refs shape))]
|
||||
[:> "penpot:shape" props
|
||||
(export-shadow-data shape)
|
||||
(export-blur-data shape)
|
||||
|
|
|
@ -34,18 +34,18 @@
|
|||
; Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1734805
|
||||
[clip-wrapper clip-props]
|
||||
(if masked-group?
|
||||
["g" (-> (obj/new)
|
||||
["g" (-> (obj/create)
|
||||
(obj/set! "clipPath" (clip-url render-id mask)))]
|
||||
[mf/Fragment nil])
|
||||
|
||||
[mask-wrapper mask-props]
|
||||
(if masked-group?
|
||||
["g" (-> (obj/new)
|
||||
(obj/set! "mask" (mask-url render-id mask)))]
|
||||
["g" (-> (obj/create)
|
||||
(obj/set! "mask" (mask-url render-id mask)))]
|
||||
[mf/Fragment nil])
|
||||
|
||||
;; This factory is generic, it's used for viewer, workspace and handoff.
|
||||
;; These props are generated in viewer wrappers only, in the rest of the
|
||||
;; These props are generated in viewer wrappers only, in the rest of the
|
||||
;; cases these props will be nil, not affecting the code.
|
||||
delta (unchecked-get props "delta")
|
||||
fixed? (unchecked-get props "fixed?")]
|
||||
|
|
|
@ -55,9 +55,8 @@
|
|||
type (:type shape)
|
||||
render-id (mf/use-memo #(str (uuid/next)))
|
||||
filter-id (str "filter_" render-id)
|
||||
styles (-> (obj/new)
|
||||
styles (-> (obj/create)
|
||||
(obj/set! "pointerEvents" pointer-events)
|
||||
|
||||
(cond-> (and (:blend-mode shape) (not= (:blend-mode shape) :normal))
|
||||
(obj/set! "mixBlendMode" (d/name (:blend-mode shape)))))
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
[app.common.geom.matrix :as gmt]
|
||||
[app.common.geom.shapes :as gsh]
|
||||
[app.main.ui.shapes.filters :as f]
|
||||
[app.util.object :as obj]
|
||||
[app.util.svg :as usvg]
|
||||
[rumext.alpha :as mf]))
|
||||
|
||||
|
@ -68,7 +67,7 @@
|
|||
[wrapper wrapper-props] (if (= tag :mask)
|
||||
["g" #js {:className "svg-mask-wrapper"
|
||||
:transform (str transform)}]
|
||||
[mf/Fragment (obj/new)])]
|
||||
[mf/Fragment #js {}])]
|
||||
|
||||
[:> (name tag) (clj->js attrs)
|
||||
[:> wrapper wrapper-props
|
||||
|
|
|
@ -212,11 +212,11 @@
|
|||
:y y
|
||||
:id id
|
||||
:data-colors (->> colors (str/join ","))
|
||||
:data-mapping (-> color-mapping-inverse (clj->js) (js/JSON.stringify))
|
||||
:data-mapping (-> color-mapping-inverse clj->js js/JSON.stringify)
|
||||
:transform transform
|
||||
:width (if (#{:auto-width} grow-type) 100000 width)
|
||||
:height (if (#{:auto-height :auto-width} grow-type) 100000 height)
|
||||
:style (-> (obj/new) (attrs/add-layer-props shape))
|
||||
:style (-> (obj/create) (attrs/add-layer-props shape))
|
||||
:ref ref}
|
||||
;; We use a class here because react has a bug that won't use the appropriate selector for
|
||||
;; `background-clip`
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
childs (mapv #(get objects %) (:shapes shape))
|
||||
shape (geom/transform-shape shape)
|
||||
|
||||
props (-> (obj/new)
|
||||
props (-> (obj/create)
|
||||
(obj/merge! props)
|
||||
(obj/merge! #js {:shape shape
|
||||
:childs childs}))]
|
||||
|
@ -105,7 +105,7 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
childs (mapv #(get objects %) (:shapes shape))
|
||||
props (-> (obj/new)
|
||||
props (-> (obj/create)
|
||||
(obj/merge! props)
|
||||
(obj/merge! #js {:childs childs}))]
|
||||
[:> group-wrapper props]))))
|
||||
|
@ -121,7 +121,7 @@
|
|||
(let [shape (unchecked-get props "shape")
|
||||
children (->> (cph/get-children-ids objects (:id shape))
|
||||
(select-keys objects))
|
||||
props (-> (obj/new)
|
||||
props (-> (obj/create)
|
||||
(obj/merge! props)
|
||||
(obj/merge! #js {:childs children}))]
|
||||
[:> bool-wrapper props]))))
|
||||
|
@ -136,7 +136,7 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
childs (mapv #(get objects %) (:shapes shape))
|
||||
props (-> (obj/new)
|
||||
props (-> (obj/create)
|
||||
(obj/merge! props)
|
||||
(obj/merge! #js {:childs childs}))]
|
||||
[:> svg-raw-wrapper props]))))
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
(ns app.util.object
|
||||
"A collection of helpers for work with javascript objects."
|
||||
(:refer-clojure :exclude [set! get get-in merge clone contains?])
|
||||
(:refer-clojure :exclude [set! new get get-in merge clone contains?])
|
||||
(:require
|
||||
["lodash/omit" :as omit]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(defn new [] #js {})
|
||||
(defn create [] #js {})
|
||||
|
||||
(defn get
|
||||
([obj k]
|
||||
|
|
Loading…
Add table
Reference in a new issue