Skip to content

Commit dacf253

Browse files
authored
Merge pull request #1 from kushidesign/0.4.0
0.4.0
2 parents 0fbf798 + c5910ee commit dacf253

File tree

17 files changed

+4763
-301
lines changed

17 files changed

+4763
-301
lines changed

.clj-kondo/config.edn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{:linters {:redundant-do {:level :off}}
2+
:lint-as {applied-science.js-interop/let clojure.core/let}}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ pom.xml.asc
1818
.vscode
1919
.idea
2020
kushi.workspace.code-workspace
21+
node_modules
22+
.shadow-cljs
23+
**/public/js/*
24+
.cpcache
25+

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
## Unreleased
55
-
66

7+
## 0.4.0
8+
2024-11-25
9+
10+
### Initial alpha release
11+
12+
713
## 0.1.0
814
2024-03-22
915

README.md

Lines changed: 124 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Domo
1+
<p align="left"><sub>どうもありがとう ミスターロボット</sub></p>
2+
3+
# domo
24

35
A ClojureScript DOM utility lib
46

@@ -42,7 +44,7 @@ There are many more -- checkout source of `domo.core` namespace.
4244
Add as a dependency to your project:
4345

4446
```clojure
45-
[design.kushi/domo "0.3.0"]
47+
[design.kushi/domo "0.4.0"]
4648
```
4749
<br>
4850

@@ -51,7 +53,7 @@ Require:
5153
```clojure
5254
(ns myns.core
5355
(:require
54-
[domo.core :as domo]))
56+
[domo.core :as d]))
5557
```
5658

5759
Domo bundles the excellent [`js-interop`](https://github.com/applied-science/js-interop),
@@ -60,14 +62,131 @@ so you can also require that if you need it.
6062
```clojure
6163
(ns myns.core
6264
(:require
63-
[domo.core :as domo]
65+
[domo.core :as d]
6466
[applied-science.js-interop :as j]))
6567
```
6668

69+
70+
<br>
71+
72+
## Macros
73+
There is a **`domo.macros`** namespace which includes macro counterparts for a subset of domo's public functions. These are available if you want to avoid the overhead of function calls for performance reasons.
74+
75+
```clojure
76+
(ns myns.core
77+
(:require
78+
[domo.core :as d]
79+
[domo.macros :as dm]))
80+
```
81+
6782
<br>
6883

6984
## API
70-
API docs coming soon. In the meantime you can checkout all the functions tagged `^:public` in the source `domo.core` namespace.
85+
API docs coming soon. In the meantime you can checkout all the functions tagged `^:public` in the source `domo.core` namespace. Here is an exhaustive list, with
86+
function signatures:
87+
88+
```Clojure
89+
dispatch-event! [el e]
90+
observe-intersection [m]
91+
current-event-target-value [e]
92+
class-list [el]
93+
mouse-down-a11y [var_args]
94+
viewport-y-fraction [vp y]
95+
keyboard-event! [var_args]
96+
mouse-event! [var_args]
97+
viewport []
98+
toggle-boolean-attribute! [el attr]
99+
dev-only [x]
100+
click! [el]
101+
set-style! [var_args]
102+
event-target-value->float [e]
103+
current-event-target-value [e]
104+
add-event-listener! [el nm f opts]
105+
has-class? [el classname]
106+
siblings-with-attribute [var_args]
107+
el-from-point [x y]
108+
client-rect [el]
109+
screen-quadrant [el]
110+
fade-in [var_args]
111+
qs-data= [var_args]
112+
event-target-value->int [e]
113+
value-selector= [v]
114+
event-xy [e]
115+
focus! [el]
116+
distance-between-els [a b]
117+
array-from [iterable]
118+
media-supports-touch? []
119+
previous-sibling [el]
120+
event-target-value->float [e]
121+
copy-to-clipboard! [var_args]
122+
scroll-into-view! [var_args]
123+
next-sibling [el]
124+
attribute-false? [el attr]
125+
add-class! [var_args]
126+
scroll-by! [m]
127+
qsa [var_args]
128+
nearest-ancestor [el sel]
129+
el-by-id [id]
130+
parent [el]
131+
round-by-dpr [n]
132+
css-custom-property-value [var_args]
133+
sibling-with-attribute [var_args]
134+
get-first-onscreen-child-from-top [el]
135+
media-supports-hover? []
136+
fade-out [var_args]
137+
css-style-string [m]
138+
toggle-attribute! [el attr a b]
139+
maybe [x pred]
140+
remove-class! [var_args]
141+
remove-attribute! [el attr]
142+
scroll-to-top! []
143+
attribute-true? [el attr]
144+
as-str [x]
145+
writing-direction []
146+
event-target [e]
147+
add-class-on-mouse-enter-attrs [s]
148+
dispatch-mousedown-event [var_args]
149+
event-target [e]
150+
css-custom-property-value-data [var_args]
151+
screen-quadrant-from-point [x y]
152+
duration-property-ms [var_args]
153+
zip-get [el steps]
154+
el-index [el]
155+
event-target-value [e]
156+
arrow-keycode? [e]
157+
event-target-value->int [e]
158+
data-attr [el nm]
159+
prefers-reduced-motion? []
160+
set-caret! [el i]
161+
object-assign [var_args]
162+
class-string [el]
163+
current-event-target [e]
164+
set-attribute! [el attr v]
165+
event-target-value [e]
166+
element-node? [el]
167+
data-selector= [attr v]
168+
toggle-class! [var_args]
169+
css-duration-value->int [s]
170+
has-attribute? [el attr]
171+
viewport-x-fraction [vp x]
172+
node-name [el]
173+
qs [var_args]
174+
add-class-on-mouse-enter-attrs-map [s]
175+
matches-media? [prop val]
176+
intersecting-client-rects? [a b]
177+
computed-style-value [var_args]
178+
current-event-target [e]
179+
click-xy [e]
180+
computed-style-value-data [var_args]
181+
grandparent [el]
182+
mouse-down-a11y-map [var_args]
183+
distance-between-points [x1 y1 x2 y2]
184+
viewport-map []
185+
token->ms [var_args]
186+
client-rect-map [el]
187+
prevent-default! [e]
188+
raf [f]
189+
```
71190

72191
<br>
73192

examples/browser/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Domo quickstart
2+
3+
This is simple browser app with many examples of functions in the domo core
4+
library. It is based on the Shadow CLJS quickstart browser template found [here](https://github.com/shadow-cljs/quickstart-browser).
5+
6+
You can uncomment and play with the various calls in the `src.main.starter.browser/start` function, to get of sense of Domo's API. There some messages and values printed to
7+
browser dev console that describe what is going on.
8+
9+
## Required Software
10+
11+
- [node.js (v6.0.0+)](https://nodejs.org/en/download/)
12+
- [Java JDK (8+)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or [Open JDK (8+)](http://jdk.java.net/10/)
13+
14+
## Running
15+
16+
```bash
17+
npm install
18+
npx shadow-cljs watch app
19+
```
20+
21+
This will begin the compilation of the configured `:app` build and re-compile whenever you change a file.
22+
23+
When you see a "Build completed." message your build is ready to be used.
24+
25+
```txt
26+
[:app] Build completed. (23 files, 4 compiled, 0 warnings, 7.41s)
27+
```
28+
29+
You can now then open [http://localhost:8020](http://localhost:8020).
30+
31+

examples/browser/deps.edn

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{:paths ["src/dev"
2+
"src/main"
3+
"src/test"]
4+
5+
:deps {binaryage/devtools {:mvn/version "1.0.6"}
6+
reagent/reagent {:mvn/version "1.1.1"}
7+
io.github.paintparty/fireworks {:mvn/version "0.16.0"}
8+
io.github.paintparty/bling {:mvn/version "0.8.8"}
9+
design.kushi/domo {:mvn/version "0.3.0"}}
10+
11+
:aliases {:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.26.2"}}}
12+
13+
;; you can make local git clones, or use :git/url deps here
14+
:local-dev {:override-deps {
15+
;; io.github.paintparty/fireworks {:local/root "../../../../cljc/fireworks"}
16+
;; io.github.paintparty/lasertag {:local/root "../../../../cljc/lasertag"}
17+
;; design.kushi/domo {:local/root "../../"}
18+
}
19+
:extra-deps {thheller/shadow-cljs {:mvn/version "2.26.2"}}}
20+
}}

0 commit comments

Comments
 (0)