-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
262 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
gen-src/day8/re_frame_10x/inlined_deps/spade/git_sha_5197e54/container.cljc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns day8.re-frame-10x.inlined-deps.spade.git-sha-5197e54.container) | ||
|
||
(defprotocol IStyleContainer | ||
"The IStyleContainer represents anything that can be used by Spade to | ||
'mount' styles for access by Spade style components." | ||
(mounted-info | ||
[this style-name] | ||
"Given a style-name, return the info object that was passed when style-name | ||
was mounted, or nil if that style is not currently mounted.") | ||
(mount-style! | ||
[this style-name css info] | ||
"Ensure the style with the given name and CSS is available. [info] | ||
should be stored somewhere in-memory to be quickly retrieved | ||
by a call to [mounted-info].")) |
17 changes: 17 additions & 0 deletions
17
gen-src/day8/re_frame_10x/inlined_deps/spade/git_sha_5197e54/container/alternate.cljc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns day8.re-frame-10x.inlined-deps.spade.git-sha-5197e54.container.alternate | ||
"The AlternateStyleContainer may be used when a preferred container | ||
is not always available." | ||
(:require [day8.re-frame-10x.inlined-deps.spade.git-sha-5197e54.container :as sc :refer [IStyleContainer]])) | ||
|
||
(deftype AlternateStyleContainer [get-preferred fallback] | ||
IStyleContainer | ||
(mounted-info | ||
[_ style-name] | ||
(or (when-let [preferred (get-preferred)] | ||
(sc/mounted-info preferred style-name)) | ||
(sc/mounted-info fallback style-name))) | ||
(mount-style! | ||
[_ style-name css info] | ||
(or (when-let [preferred (get-preferred)] | ||
(sc/mount-style! preferred style-name css info)) | ||
(sc/mount-style! fallback style-name css info)))) |
16 changes: 16 additions & 0 deletions
16
gen-src/day8/re_frame_10x/inlined_deps/spade/git_sha_5197e54/container/atom.cljc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns day8.re-frame-10x.inlined-deps.spade.git-sha-5197e54.container.atom | ||
"The AtomStyleContainer renders styles into an atom it is provided with." | ||
(:require [day8.re-frame-10x.inlined-deps.spade.git-sha-5197e54.container :refer [IStyleContainer]])) | ||
|
||
(deftype AtomStyleContainer [styles-atom info-atom] | ||
IStyleContainer | ||
(mounted-info [_ style-name] | ||
(get @info-atom style-name)) | ||
(mount-style! [_ style-name css info] | ||
(swap! styles-atom assoc style-name css) | ||
(swap! info-atom assoc style-name info))) | ||
|
||
(defn create-container | ||
([] (create-container (atom nil))) | ||
([styles-atom] (create-container styles-atom (atom nil))) | ||
([styles-atom info-atom] (->AtomStyleContainer styles-atom info-atom))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.