🎉 Add malli based validation and coersion subsystem

This commit is contained in:
Andrey Antukh 2023-03-18 10:32:26 +01:00
parent dbc08ba80f
commit 5ca3d01ea1
125 changed files with 4984 additions and 2762 deletions

View file

@ -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)))

View file

@ -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})))))