|
252 | 252 | :height "100vh" |
253 | 253 | :padding-top "77px"}))} |
254 | 254 |
|
255 | | - ;; Button bar |
256 | | - (when (not collapsed?) |
257 | | - [:div.d-flex.justify-content-between.align-items-center |
258 | | - {:style {:flex "0 0 auto" |
259 | | - :order "0"}} |
260 | | - [:div.btn-group |
261 | | - [:button.btn.btn-outline-primary.btn-sm |
262 | | - {:on-click toggle!} |
263 | | - (if is-bottom? |
264 | | - [:i.bi.bi-chevron-bar-down] |
265 | | - [:i.bi.bi-chevron-bar-right]) |
266 | | - " Hide"] |
267 | | - [:button.btn.btn-outline-secondary.btn-sm |
268 | | - {:on-click switch-layout!} |
269 | | - "↕ Switch Layout"]] |
270 | | - [:small.text-muted "Ctrl+Enter to eval"]]) |
271 | | - |
272 | 255 | ;; Restore button |
273 | 256 | (when collapsed? |
274 | 257 | [:button.btn.btn-outline-primary.w-100.h-100 |
|
283 | 266 | {:style {:flex "1 1 auto" |
284 | 267 | :order "1" |
285 | 268 | :display "flex" |
286 | | - :flex-direction (if is-bottom? "row" "column")}} |
| 269 | + :flex-direction (if is-bottom? "row" "column") |
| 270 | + :min-height "0"}} |
287 | 271 |
|
288 | 272 | ;; Editor |
289 | | - [:div.position-relative |
290 | | - {:style {:flex "1 1 0" |
291 | | - :overflow "hidden"}} |
| 273 | + [:div.position-relative.d-flex.flex-column |
| 274 | + {:style {:flex "1 1 0" |
| 275 | + :overflow "hidden" |
| 276 | + :min-height "0" |
| 277 | + :min-width "0"}} |
| 278 | + [:div.d-flex.justify-content-between.align-items-center |
| 279 | + {:style {:flex "0 0 auto"}} |
| 280 | + [:div.btn-group |
| 281 | + [:button.btn.btn-outline-primary.btn-sm |
| 282 | + {:on-click toggle!} |
| 283 | + (if is-bottom? |
| 284 | + [:i.bi.bi-chevron-bar-down] |
| 285 | + [:i.bi.bi-chevron-bar-right]) |
| 286 | + " Hide"] |
| 287 | + [:button.btn.btn-outline-secondary.btn-sm |
| 288 | + {:on-click switch-layout!} |
| 289 | + "↕ Switch Layout"] |
| 290 | + [:button.btn.btn-primary.btn-sm |
| 291 | + {:on-click (fn [_] |
| 292 | + (when @editor-ref |
| 293 | + (eval-code! (.-value @editor-ref))))} |
| 294 | + "Eval (Ctrl+Enter)"]]] |
| 295 | + [:div {:style {:flex "1 1 0" :min-height "0"}} |
292 | 296 | [:textarea.form-control.border-0 |
293 | 297 | {:ref #(reset! editor-ref %) |
294 | 298 | :on-key-down (fn [e] |
|
302 | 306 | :font-family "var(--bs-font-monospace)" |
303 | 307 | :font-size "0.875rem" |
304 | 308 | :border-radius "0" |
305 | | - :overflow-y "auto"}}]] |
| 309 | + :overflow-y "auto"}}]]] |
306 | 310 |
|
307 | 311 | ;; REPL Output |
308 | 312 | [:div.position-relative |
309 | | - {:style {:flex "1 1 0" |
310 | | - :overflow "hidden"}} |
311 | | - |
312 | | - ;; Floating label in top-right |
313 | | - [:div.position-absolute.top-0.end-0.badge.bg-secondary.m-2 |
314 | | - {:style {:font-size "0.65rem" |
315 | | - :z-index "10"}} |
316 | | - "Output"] |
| 313 | + {:style {:flex "1 1 0" |
| 314 | + :overflow "hidden" |
| 315 | + :min-height "0" |
| 316 | + :min-width "0"}} |
| 317 | + |
| 318 | + ;; Output button overlay |
| 319 | + [:div.position-absolute.top-0.end-0 |
| 320 | + {:style {:z-index "10"}} |
| 321 | + [:button.btn.btn-outline-secondary.btn-sm |
| 322 | + {:on-click #(reset! repl-output [])} |
| 323 | + "Clear Output"]] |
317 | 324 |
|
318 | 325 | [:div#repl-output.sourceCode.border-start |
319 | 326 | {:ref #(reset! output-ref %) |
320 | 327 | :class (if is-bottom? "border-start" "border-top") |
321 | 328 | :style {:height "100%" |
322 | | - :padding "0.75rem" |
| 329 | + :margin 0 |
323 | 330 | :overflow-y "auto" |
| 331 | + :min-height "0" |
324 | 332 | :font-family "var(--bs-font-monospace)" |
325 | 333 | :font-size "0.8125rem" |
326 | 334 | :line-height "1.4"}} |
|
0 commit comments