Skip to content

Commit f9ce92d

Browse files
committed
Update ocamlformat-mlx
1 parent 3fc75b4 commit f9ce92d

File tree

7 files changed

+115
-103
lines changed

7 files changed

+115
-103
lines changed

dune-project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
(depends
6767
ocaml
6868
mlx
69-
ocamlmerlin-mlx
70-
ocamlformat-mlx
7169
melange
7270
melange-json
7371
melange-webapi
7472
reason-react
7573
reason-react-ppx
74+
(ocamlmerlin-mlx :with-dev-setup)
75+
(ocamlformat-mlx :with-dev-setup)
7676
))
7777

7878
(dialect

query-json-playground.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ depends: [
1616
"dune" {>= "3.17"}
1717
"ocaml"
1818
"mlx"
19-
"ocamlmerlin-mlx"
20-
"ocamlformat-mlx"
2119
"melange"
2220
"melange-json"
2321
"melange-webapi"
2422
"reason-react"
2523
"reason-react-ppx"
24+
"ocamlmerlin-mlx" {with-dev-setup}
25+
"ocamlformat-mlx" {with-dev-setup}
2626
"odoc" {with-doc}
2727
]
2828
build: [

website/App.mlx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,28 @@ let[@react.component] make () =
119119
| None -> Printf.eprintf "Error decoding"
120120
in
121121

122-
(* const downloadJson = () => {
123-
const dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(activeTab === "input" ? jsonInput : result)
124-
const downloadAnchorNode = document.createElement("a")
125-
downloadAnchorNode.setAttribute("href", dataStr)
126-
downloadAnchorNode.setAttribute("download", `json-playground-${activeTab === "input" ? "input" : "result"}.json`)
127-
document.body.appendChild(downloadAnchorNode)
128-
downloadAnchorNode.click()
129-
downloadAnchorNode.remove()
130-
} *)
131122
<div className=page>
132123
<Header onShareClick />
133124
<div className="w-full mb-2" />
134125
<div className=container>
135126
<div className="w-full mb-2">
136-
<TextInput value=state.query
137-
onChange=onQueryChange
138-
placeholder="Type the query to filter against the JSON \
139-
below. For example: '.store'" />
127+
<TextInput
128+
value=state.query
129+
onChange=onQueryChange
130+
placeholder="Type the query to filter against the JSON below. For \
131+
example: '.store'"
132+
/>
140133
</div>
141-
<div className="w-full h-full mx-auto flex justify-between items-center \
142-
gap-2">
134+
<div
135+
className="w-full h-full mx-auto flex justify-between items-center \
136+
gap-2">
143137
<div className=columnHalf>
144138
<span className="text-white text-xs">
145139
(React.string "Input JSON")
146140
</span>
147-
<Editor.Json value=(Option.value state.json ~default:"")
148-
onChange=onJsonChange />
141+
<Editor.Json
142+
value=(Option.value state.json ~default:"") onChange=onJsonChange
143+
/>
149144
</div>
150145
<div className=columnHalf>
151146
<span className="text-white text-xs">(React.string "Output")</span>

website/Header.mlx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ let[@react.component] make ~onShareClick =
1616
<Text color=`White kind=`H2>(React.string "query-json playground")</Text>
1717
<div className=distribute>
1818
<Text color=`Grey kind=`Label>(React.string "Made by")</Text>
19-
<a className=link
20-
href="https://twitter.com/davesnx"
21-
target="_blank"
22-
rel="noopener">
19+
<a
20+
className=link
21+
href="https://twitter.com/davesnx"
22+
target="_blank"
23+
rel="noopener">
2324
<div className=distribute>
2425
<Text color=`Grey kind=`Label>(React.string "davesnx")</Text>
2526
<Icons.Twitter />
2627
</div>
2728
</a>
2829
<Text color=`Grey kind=`Label>(React.string "Code in")</Text>
29-
<a className=iconlink
30-
href="https://github.com/davesnx/query-json"
31-
target="_blank"
32-
rel="noopener">
30+
<a
31+
className=iconlink
32+
href="https://github.com/davesnx/query-json"
33+
target="_blank"
34+
rel="noopener">
3335
<Icons.Github />
3436
</a>
3537
<span className="w-4" />

website/Icons.mlx

Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,79 +7,90 @@ let size_to_classname = function
77

88
module Twitter = struct
99
let[@react.component] make ?(size : size = Medium) ?(className = "") =
10-
<svg xmlns="http://www.w3.org/2000/svg"
11-
viewBox="0 0 24 24"
12-
className=(size_to_classname size ^ " " ^ className)>
13-
<path d="M24 4.557a9.83 9.83 0 01-2.828.775 4.932 4.932 0 002.165-2.724 \
14-
9.864 9.864 0 01-3.127 1.195 4.916 4.916 0 \
15-
00-3.594-1.555c-3.179 0-5.515 2.966-4.797 6.045A13.978 13.978 0 \
16-
011.671 3.149a4.93 4.93 0 001.523 6.574 4.903 4.903 0 \
17-
01-2.229-.616c-.054 2.281 1.581 4.415 3.949 4.89a4.935 4.935 0 \
18-
01-2.224.084 4.928 4.928 0 004.6 3.419A9.9 9.9 0 010 \
19-
19.54a13.94 13.94 0 007.548 2.212c9.142 0 14.307-7.721 \
20-
13.995-14.646A10.025 10.025 0 0024 4.557z" />
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
viewBox="0 0 24 24"
13+
className=(size_to_classname size ^ " " ^ className)>
14+
<path
15+
d="M24 4.557a9.83 9.83 0 01-2.828.775 4.932 4.932 0 002.165-2.724 \
16+
9.864 9.864 0 01-3.127 1.195 4.916 4.916 0 00-3.594-1.555c-3.179 \
17+
0-5.515 2.966-4.797 6.045A13.978 13.978 0 011.671 3.149a4.93 4.93 0 \
18+
001.523 6.574 4.903 4.903 0 01-2.229-.616c-.054 2.281 1.581 4.415 \
19+
3.949 4.89a4.935 4.935 0 01-2.224.084 4.928 4.928 0 004.6 3.419A9.9 \
20+
9.9 0 010 19.54a13.94 13.94 0 007.548 2.212c9.142 0 14.307-7.721 \
21+
13.995-14.646A10.025 10.025 0 0024 4.557z"
22+
/>
2123
</svg>
2224
end
2325

2426
module Github = struct
2527
let[@react.component] make ?(size : size = Medium) ?(className = "") =
26-
<svg xmlns="http://www.w3.org/2000/svg"
27-
viewBox="0 0 24 24"
28-
className=(size_to_classname size ^ " " ^ className)>
29-
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
30-
11.385.6.113.82-.258.82-.577 \
31-
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
32-
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 \
33-
1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
34-
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
35-
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
36-
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 \
37-
3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
38-
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
39-
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
40-
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
41-
12.297c0-6.627-5.373-12-12-12" />
28+
<svg
29+
xmlns="http://www.w3.org/2000/svg"
30+
viewBox="0 0 24 24"
31+
className=(size_to_classname size ^ " " ^ className)>
32+
<path
33+
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
34+
11.385.6.113.82-.258.82-.577 \
35+
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
36+
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 \
37+
1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
38+
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
39+
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
40+
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 \
41+
.405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
42+
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
43+
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
44+
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
45+
12.297c0-6.627-5.373-12-12-12"
46+
/>
4247
</svg>
4348
end
4449

4550
module Trash = struct
4651
let[@react.component] make ?(size : size = Medium) ?(className = "") =
47-
<svg xmlns="http://www.w3.org/2000/svg"
48-
viewBox="0 0 24 24"
49-
className=(size_to_classname size ^ " " ^ className)>
50-
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
51-
11.385.6.113.82-.258.82-.577 \
52-
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
53-
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 \
54-
1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
55-
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
56-
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
57-
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 \
58-
3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
59-
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
60-
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
61-
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
62-
12.297c0-6.627-5.373-12-12-12" />
52+
<svg
53+
xmlns="http://www.w3.org/2000/svg"
54+
viewBox="0 0 24 24"
55+
className=(size_to_classname size ^ " " ^ className)>
56+
<path
57+
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
58+
11.385.6.113.82-.258.82-.577 \
59+
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
60+
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 \
61+
1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
62+
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
63+
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
64+
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 \
65+
.405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
66+
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
67+
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
68+
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
69+
12.297c0-6.627-5.373-12-12-12"
70+
/>
6371
</svg>
6472
end
6573

6674
module Play = struct
6775
let[@react.component] make ?(size : size = Medium) ?(className = "") =
68-
<svg xmlns="http://www.w3.org/2000/svg"
69-
viewBox="0 0 24 24"
70-
className=(size_to_classname size ^ " " ^ className)>
71-
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
72-
11.385.6.113.82-.258.82-.577 \
73-
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
74-
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 \
75-
1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
76-
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
77-
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
78-
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 \
79-
3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
80-
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
81-
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
82-
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
83-
12.297c0-6.627-5.373-12-12-12" />
76+
<svg
77+
xmlns="http://www.w3.org/2000/svg"
78+
viewBox="0 0 24 24"
79+
className=(size_to_classname size ^ " " ^ className)>
80+
<path
81+
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 \
82+
11.385.6.113.82-.258.82-.577 \
83+
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 \
84+
18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 \
85+
1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 \
86+
3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 \
87+
0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 \
88+
1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 \
89+
.405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 \
90+
3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 \
91+
5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 \
92+
.315.21.69.825.57C20.565 22.092 24 17.592 24 \
93+
12.297c0-6.627-5.373-12-12-12"
94+
/>
8495
</svg>
8596
end

website/Monaco.mlx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ let[@react.component] make ~(value : string)
8989
| Write handler -> handler
9090
in
9191
let options = { options with readOnly = isReadOnly onChangeValue } in
92-
<External value
93-
onChange
94-
options
95-
theme="vs-dark"
96-
language=(mode_to_string mode)
97-
height="100%"
98-
style=(ReactDOM.Style.make ~padding:"8px" ~height:"100%" ()) />
92+
<External
93+
value
94+
onChange
95+
options
96+
theme="vs-dark"
97+
language=(mode_to_string mode)
98+
height="100%"
99+
style=(ReactDOM.Style.make ~padding:"8px" ~height:"100%" ())
100+
/>

website/TextInput.mlx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ let[@react.component] make ~value ~placeholder ~onChange =
1010
onChange target##value
1111
in
1212

13-
<div className="relative flex flex-row bg-zinc-200 border-zinc-500 p-2 \
14-
rounded-md focus:ring-2 focus:ring-blue-500">
15-
<Input type_="text"
16-
value
17-
onChange=onChangeHandler
18-
placeholder
19-
className="border-none w-full p-2 text-black focus:outline-none" />
13+
<div
14+
className="relative flex flex-row bg-zinc-200 border-zinc-500 p-2 \
15+
rounded-md focus:ring-2 focus:ring-blue-500">
16+
<Input
17+
type_="text"
18+
value
19+
onChange=onChangeHandler
20+
placeholder
21+
className="border-none w-full p-2 text-black focus:outline-none"
22+
/>
2023
<div className="absolute inset-y-0 right-3 flex items-center gap-2">
2124
<Button kind=Ghost onClick=clearInput>
22-
(* <Icons.Trash /> *)
2325
<span className="text-black text-xs">(React.string "Clear")</span>
2426
</Button>
2527
</div>

0 commit comments

Comments
 (0)