Skip to content

Commit 82c0c0e

Browse files
authored
Merge pull request #81 from repath-project/upgrade-tailwind
Upgrade tailwind
2 parents 8f9bad7 + 7ffcd36 commit 82c0c0e

29 files changed

+1937
-2294
lines changed

package-lock.json

+1,449-1,753
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+21-24
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"scripts": {
1010
"upgrade": "npx npm-check-updates -u -x 'codemirror'",
1111
"postinstall": "electron-builder install-app-deps",
12-
"postcss:build": "npx postcss src/renderer/main.css -o resources/public/css/main.css --verbose",
13-
"postcss:watch": "npx postcss src/renderer/main.css -o resources/public/css/main.css --verbose -w",
12+
"tailwindcss:build": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --minify",
13+
"tailwindcss:watch": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --watch=always",
1414
"shadow:build": "npx shadow-cljs release main preload renderer bootstrap",
1515
"shadow:watch": "npx shadow-cljs watch main preload renderer bootstrap browser-test karma-test",
16-
"dev": "npm run postcss:watch & npm run shadow:watch",
17-
"build": "npm run postcss:build & npm run shadow:build",
18-
"portfolio": "npx shadow-cljs watch portfolio & npm run postcss:watch",
16+
"dev": "npm run tailwindcss:watch & npm run shadow:watch",
17+
"build": "npm run tailwindcss:build & npm run shadow:build",
18+
"portfolio": "npx shadow-cljs watch portfolio & npm run tailwindcss:watch",
1919
"electron": "npx electron .",
2020
"dist": "npx electron-builder",
2121
"format": "clojure -M:format -m cljfmt.main fix src test portfolio",
@@ -63,7 +63,7 @@
6363
},
6464
"main": "resources/main.js",
6565
"devDependencies": {
66-
"@mdn/browser-compat-data": "5.6.43",
66+
"@mdn/browser-compat-data": "6.0.1",
6767
"@radix-ui/react-context-menu": "2.2.6",
6868
"@radix-ui/react-dialog": "1.1.6",
6969
"@radix-ui/react-dropdown-menu": "2.1.6",
@@ -76,16 +76,17 @@
7676
"@radix-ui/react-switch": "1.1.3",
7777
"@radix-ui/react-tooltip": "1.1.8",
7878
"@repath-project/react-color": "2.19.4",
79+
"@tailwindcss/cli": "4.0.17",
7980
"@xzdarcy/react-timeline-editor": "0.1.9",
80-
"acorn": "8.14.0",
81-
"autoprefixer": "10.4.20",
81+
"acorn": "8.14.1",
82+
"autoprefixer": "10.4.21",
8283
"blobs": "2.3.0-beta.2",
8384
"buffer": "6.0.3",
84-
"cmdk": "1.0.4",
85+
"cmdk": "1.1.1",
8586
"codemirror": "5.65.15",
8687
"create-react-class": "15.7.0",
87-
"electron": "34.3.0",
88-
"electron-builder": "25.1.8",
88+
"electron": "35.1.2",
89+
"electron-builder": "26.0.12",
8990
"highlight.js": "11.11.1",
9091
"imagetracerjs": "1.2.6",
9192
"js-beautify": "1.15.4",
@@ -94,19 +95,15 @@
9495
"karma-cljs-test": "0.1.0",
9596
"karma-electron": "7.3.0",
9697
"karma-junit-reporter": "2.0.1",
97-
"mdn-data": "2.17.0",
98+
"mdn-data": "2.18.0",
9899
"paper": "0.12.18",
99100
"paperjs-offset": "1.0.8",
100101
"path-browserify": "1.0.1",
101102
"perfect-freehand": "1.2.2",
102-
"postcss": "8.5.3",
103-
"postcss-cli": "11.0.0",
104-
"postcss-import": "16.1.0",
105-
"postcss-nested": "7.0.2",
106-
"puppeteer": "24.3.0",
107-
"react": "19.0.0",
103+
"puppeteer": "24.4.0",
104+
"react": "19.1.0",
108105
"react-d3-tree": "3.6.6",
109-
"react-dom": "19.0.0",
106+
"react-dom": "19.1.0",
110107
"react-frame-component": "5.2.7",
111108
"react-resizable-panels": "2.1.7",
112109
"react-svg": "16.3.0",
@@ -116,18 +113,18 @@
116113
"style-to-object": "1.0.8",
117114
"svg-path-bbox": "2.1.0",
118115
"svgpath": "2.6.0",
119-
"tailwind-merge": "2.6.0",
120-
"tailwindcss": "3.4.17"
116+
"tailwind-merge": "3.0.2",
117+
"tailwindcss": "4.0.17"
121118
},
122119
"dependencies": {
123-
"electron-log": "5.3.1",
120+
"electron-log": "5.3.3",
124121
"electron-reloader": "1.2.3",
125122
"electron-window-state": "5.0.3",
126123
"font-scanner": "0.2.1",
127124
"opentype.js": "1.3.4"
128125
},
129126
"overrides": {
130-
"react": "19.0.0",
131-
"react-dom": "19.0.0"
127+
"react": "19.1.0",
128+
"react-dom": "19.1.0"
132129
}
133130
}

postcss.config.js

-9
This file was deleted.

resources/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" href="css/main.css">
1111
</head>
1212

13-
<body>
13+
<body class="absolute inset-0 m-0 p-0 bg-secondary overflow-hidden select-none font-sans">
1414
<div id="app">
1515
<div class="loader"></div>
1616
</div>

src/renderer/app/views.cljs

+18-12
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
[m]
4444
(interpose ", " (map (fn [[k v]]
4545
^{:key k}
46-
[:span (str (name k) ": " (if (number? v)
47-
(.toFixed v 2)
48-
(coll->str v)))]) m)))
46+
[:span (str (name k) ": " (if (number? v)
47+
(.toFixed v 2)
48+
(coll->str v)))]) m)))
4949

5050
(defn debug-rows
5151
[]
@@ -189,12 +189,15 @@
189189
9 [105 147]
190190
10 [74 105]})
191191

192-
(defn home [recent-documents]
192+
(defn home
193+
[recent-documents]
193194
[:div.flex.overflow-hidden
194195
[ui/scroll-area
195196
[:div.flex.justify-center.p-2
196-
[:div.justify-between.flex.w-full.lg:w-auto
197-
[:div.bg-primary.p-6.lg:p-12.flex.max-w-screen-xl.w-full.gap-8
197+
[:div.justify-between.flex.w-full
198+
{:class "lg:w-auto"}
199+
[:div.bg-primary.p-6.flex.w-full.gap-8
200+
{:class "lg:p-12 max-w-(--breakpoint-xl)"}
198201
[:div.flex-1
199202
[:h1.text-4xl.mb-1.font-light config/app-name]
200203

@@ -215,15 +218,15 @@
215218
{:onValueChange #(rf/dispatch [::document.e/new-from-template
216219
(get paper-size %)])}
217220
[:> Select/Trigger
218-
{:class "button px-2 overlay rounded"
221+
{:class "button px-2 overlay rounded-sm"
219222
:aria-label "Select size"}
220223
[:div.flex.items-center.gap-2
221224
[:> Select/Value {:placeholder "Select template"}]
222225
[:> Select/Icon
223226
[ui/icon "chevron-down"]]]]
224227
[:> Select/Portal
225228
[:> Select/Content
226-
{:class "menu-content rounded select-content"
229+
{:class "menu-content rounded-sm select-content"
227230
:style {:min-width "auto"}}
228231

229232
[:> Select/Viewport {:class "select-viewport"}
@@ -286,7 +289,8 @@
286289
"https://repath.studio/roadmap/changelog/"])}
287290
"Changelog"]]]
288291

289-
[:div.hidden.md:block.flex-1
292+
[:div.hidden.flex-1
293+
{:class "md:block"}
290294
[:img {:src "./img/icon.svg"}]]]]]]])
291295

292296
(defn root
@@ -302,8 +306,9 @@
302306
(if (seq @documents)
303307
[:div.flex.h-full.flex-1.overflow-hidden.gap-px
304308
(when @tree-visible
305-
[:div.flex-col.hidden.md:flex.overflow-hidden
306-
{:style {:width "227px"}}
309+
[:div.flex-col.hidden.overflow-hidden
310+
{:class "md:flex"
311+
:style {:width "227px"}}
307312
[document.v/actions]
308313
[tree.v/root]])
309314
[:div.flex.flex-col.flex-1.overflow-hidden.h-full
@@ -313,7 +318,8 @@
313318
[editor]]
314319
[:div.flex
315320
(when @properties-visible
316-
[:div.hidden.md:flex
321+
[:div.hidden
322+
{:class "md:flex"}
317323
[:div.flex.flex-col.h-full.w-80
318324
[ui/scroll-area
319325
(tool.hierarchy/right-panel @active-tool)]

src/renderer/attribute/impl/d.cljs

+20-20
Original file line numberDiff line numberDiff line change
@@ -52,51 +52,51 @@
5252
(defmethod segment-form :default
5353
[segment i]
5454
[:div.grid.grid-cols-4.gap-px
55-
[:label.px-1 "x"]
56-
[:input
55+
[:label.form-element.px-1 "x"]
56+
[:input.form-element
5757
{:key (str "x-" i) :default-value (nth segment 1)}]
58-
[:label.px-1 "y"]
59-
[:input
58+
[:label.form-element.px-1 "y"]
59+
[:input.form-element
6060
{:key (str "y-" i) :default-value (nth segment 2)}]])
6161

6262
(defmethod segment-form :h
6363
[segment i]
64-
[:input {:key (str "width-" i) :default-value (nth segment 1)}])
64+
[:input.form-element {:key (str "width-" i) :default-value (nth segment 1)}])
6565

6666
(defmethod segment-form :v
6767
[segment i]
68-
[:input {:key (str "height-" i) :default-value (nth segment 1)}])
68+
[:input.form-element {:key (str "height-" i) :default-value (nth segment 1)}])
6969

7070
(defmethod segment-form :z [_segment _i])
7171

7272
(defmethod segment-form :a
7373
[segment i]
7474
[:div
7575
[:div.grid.grid-cols-4.gap-px
76-
[:label.px-1 "rx"]
77-
[:input
76+
[:label.form-element.px-1 "rx"]
77+
[:input.form-element
7878
{:key (str "rx-" i) :default-value (nth segment 1)}]
79-
[:label.px-1 "ry"]
80-
[:input
79+
[:label.form-element.px-1 "ry"]
80+
[:input.form-element
8181
{:key (str "ry-" i) :default-value (nth segment 2)}]]
8282
[:div.grid.grid-cols-2.gap-px
83-
[:label.px-1.text-nowrap "x-axis-rotation"]
84-
[:input
83+
[:label.form-element.px-1.text-nowrap "x-axis-rotation"]
84+
[:input.form-element
8585
{:key (str "x-axis-rotation-" i) :default-value (nth segment 3)}]]
8686
[:div.grid.grid-cols-2.gap-px
87-
[:label.px-1.text-nowrap "large-arc-flag"]
88-
[:input
87+
[:label.form-element.px-1.text-nowrap "large-arc-flag"]
88+
[:input.form-element
8989
{:key (str "large-arc-flag-" i) :default-value (nth segment 4)}]]
9090
[:div.grid.grid-cols-2.gap-px
91-
[:label.px-1.text-nowrap "sweep-flag"]
92-
[:input
91+
[:label.form-element.px-1.text-nowrap "sweep-flag"]
92+
[:input.form-element
9393
{:key (str "sweep-flag" i) :default-value (nth segment 5)}]]
9494
[:div.grid.grid-cols-4.gap-px
95-
[:label.px-1 "x"]
96-
[:input
95+
[:label.form-element.px-1 "x"]
96+
[:input.form-element
9797
{:key (str "x-" i) :default-value (nth segment 6)}]
98-
[:label.px-1. "y"]
99-
[:input
98+
[:label.form-element.px-1. "y"]
99+
[:input.form-element
100100
{:key (str "y-" i) :default-value (nth segment 7)}]]])
101101

102102
(defn segment-row

src/renderer/attribute/impl/points.cljs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
[i [x y] points]
2929
[:div.grid.grid-flow-col.gap-px
3030
{:style {:grid-template-columns "minmax(0, 40px) 3fr 3fr 26px"}}
31-
[:label.px-1.bg-transparent i]
32-
[:input.bg-transparent
31+
[:label.form-element.px-1.bg-transparent i]
32+
[:input.form-element.bg-transparent
3333
{:key (str "x-" i) :default-value x}]
34-
[:input.bg-transparent
34+
[:input.form-element.bg-transparent
3535
{:key (str "y-" i) :default-value y}]
3636
[:button.button.bg-transparent.text-muted.h-full.rounded
3737
{:on-click #(remove-nth points i)}

src/renderer/attribute/views.cljs

+10-8
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
[support-data]
4141
[:<>
4242
[:h4.font-bold.mb-1 "Browser compatibility"]
43-
[:div.flex.mb-4.gap-px
44-
(for [[browser {:keys [version_added]}] support-data]
45-
^{:key browser} [browser-support browser version_added])]])
43+
[ui/scroll-area
44+
[:div.flex.mb-4.gap-px
45+
(for [[browser {:keys [version_added]}] support-data]
46+
^{:key browser} [browser-support browser version_added])]]])
4647

4748
(defn info-button
4849
[url label]
@@ -83,7 +84,7 @@
8384
(defn form-input
8485
[k v {:keys [disabled placeholder] :as attrs}]
8586
[:div.relative.flex.form-input.flex-1
86-
[:input
87+
[:input.form-element
8788
(merge attrs
8889
{:key v
8990
:id (name k)
@@ -92,8 +93,9 @@
9293
:on-blur #(on-change-handler! % k v)
9394
:on-key-down #(keyb/input-key-down-handler! % v on-change-handler! k v)})]
9495
(when-not (or (empty? (str v)) disabled)
95-
[:button.button.bg-primary.text-muted.absolute.h-full.right-0.clear-input-button.hover:bg-transparent.invisible.p-1
96-
{:on-pointer-down #(rf/dispatch [::element.e/remove-attr k])}
96+
[:button.button.bg-primary.text-muted.absolute.h-full.right-0.clear-input-button.invisible.p-1
97+
{:class "hover:bg-transparent"
98+
:on-pointer-down #(rf/dispatch [::element.e/remove-attr k])}
9799
[ui/icon "times"]])])
98100

99101
(defmethod hierarchy/form-element :default
@@ -134,7 +136,7 @@
134136
[ui/icon "chevron-down"]]]
135137
[:> Select/Portal
136138
[:> Select/Content
137-
{:class "menu-content rounded select-content"
139+
{:class "menu-content rounded-sm select-content"
138140
:on-key-down #(.stopPropagation %)}
139141
[:> Select/ScrollUpButton
140142
{:class "select-scroll-button"}
@@ -178,7 +180,7 @@
178180
(= (:key clicked-element) key))]
179181
[:> HoverCard/Root
180182
[:> HoverCard/Trigger
181-
[:label.w-28.truncate
183+
[:label.form-element.w-28.truncate
182184
{:for (name k)
183185
:class (when active "text-active")} k]]
184186
[:> HoverCard/Portal

0 commit comments

Comments
 (0)