mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 16:37:16 +02:00
🎉 Add malli based validation and coersion subsystem
This commit is contained in:
parent
dbc08ba80f
commit
5ca3d01ea1
125 changed files with 4984 additions and 2762 deletions
|
@ -155,13 +155,13 @@
|
|||
(impl/insertText state text (clj->js attrs) (clj->js style))))
|
||||
|
||||
(defn get-style-override [state]
|
||||
(.getInlineStyleOverride state))
|
||||
(.getInlineStyleOverride ^js state))
|
||||
|
||||
(defn set-style-override [state inline-style]
|
||||
(impl/setInlineStyleOverride state inline-style))
|
||||
|
||||
(defn content-equals [state other]
|
||||
(.equals (.getCurrentContent state) (.getCurrentContent other)))
|
||||
(.equals (.getCurrentContent ^js state) (.getCurrentContent ^js other)))
|
||||
|
||||
(defn selection-equals [state other]
|
||||
(impl/selectionEquals (.getSelection state) (.getSelection other)))
|
||||
|
|
|
@ -163,11 +163,11 @@
|
|||
(extend-protocol IPrintWithWriter
|
||||
DateTime
|
||||
(-pr-writer [p writer _]
|
||||
(-write writer (str/fmt "#stks/datetime \"%s\"" (format p :iso))))
|
||||
(-write writer (str/fmt "#app/instant \"%s\"" (format p :iso))))
|
||||
|
||||
Duration
|
||||
(-pr-writer [p writer _]
|
||||
(-write writer (str/fmt "#stks/duration \"%s\"" (format p :iso)))))
|
||||
(-write writer (str/fmt "#app/duration \"%s\"" (format p :iso)))))
|
||||
|
||||
(defn- resolve-format
|
||||
[v]
|
||||
|
@ -239,6 +239,6 @@
|
|||
(when v
|
||||
(let [v (if (datetime? v) (format v :date) v)
|
||||
locale (obj/get locales locale)
|
||||
f (.date (.-formatLong locale) v)]
|
||||
(->> #js {:locale locale}
|
||||
(dateFnsFormat v f))))))
|
||||
f (-> (.-formatLong ^js locale)
|
||||
(.date v))]
|
||||
(dateFnsFormat v f #js {:locale locale})))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue