|
428 | 428 | [triangle expanded?]] |
429 | 429 | [:span.group-hover:text-indigo-700 opening-paren]])) |
430 | 430 |
|
431 | | -(defn render-coll [xs {:as opts :keys [closing-paren path viewer !expanded-at] :or {path []}}] |
| 431 | +(defn render-coll [xs {:as opts :keys [closing-parens path viewer !expanded-at] :or {path []}}] |
432 | 432 | (let [expanded? (get @!expanded-at path) |
433 | | - {:keys [opening-paren]} viewer] |
| 433 | + {:keys [opening-paren closing-paren]} viewer] |
434 | 434 | [:span.inspected-value.whitespace-nowrap |
435 | 435 | {:class (when expanded? "inline-flex")} |
436 | 436 | [:span |
437 | | - (if (< 1 (count xs)) |
| 437 | + (if (expandable? xs) |
438 | 438 | [expand-button !expanded-at opening-paren path] |
439 | 439 | [:span opening-paren]) |
440 | 440 | (into [:<>] |
441 | 441 | (comp (inspect-children opts) |
442 | 442 | (interpose (if expanded? [:<> [:br] triangle-spacer nbsp (when (= 2 (count opening-paren)) nbsp)] " "))) |
443 | 443 | xs) |
444 | | - [:span |
445 | | - (cond->> closing-paren (list? closing-paren) (into [:<>]))]]])) |
| 444 | + (into [:span] (or closing-parens [closing-paren]))]])) |
446 | 445 |
|
447 | 446 | (defn render-elision [{:as fetch-opts :keys [total offset unbounded?]} _] |
448 | 447 | [view-context/consume :fetch-fn |
|
455 | 454 | :on-click #(when (fn? fetch-fn) |
456 | 455 | (fetch-fn fetch-opts))} (- total offset) (when unbounded? "+") (if (fn? fetch-fn) " more…" " more elided")])]) |
457 | 456 |
|
458 | | -(defn render-map [xs {:as opts :keys [closing-paren path viewer !expanded-at] :or {path []}}] |
459 | | - (let [expanded? (get @!expanded-at path)] |
460 | | - [:span.inspected-value.whitespace-nowrap |
461 | | - {:class (when expanded? "inline-flex")} |
462 | | - [:span |
463 | | - (if (expandable? xs) |
464 | | - [expand-button !expanded-at "{" path] |
465 | | - [:span "{"]) |
466 | | - (into [:<>] |
467 | | - (comp (inspect-children opts) |
468 | | - (interpose (if expanded? [:<> [:br] triangle-spacer nbsp #_(repeat (inc (count path)) nbsp)] " "))) |
469 | | - xs) |
470 | | - (cond->> closing-paren (list? closing-paren) (into [:<>]))]])) |
471 | | - |
472 | 457 |
|
473 | 458 | (defn render-string [s {:as opts :keys [path !expanded-at] :or {path []}}] |
474 | 459 | (let [expanded? (get @!expanded-at path)] |
|
480 | 465 | (inspect-presented opts %))) |
481 | 466 | (if (string? s) [s] s)))) |
482 | 467 |
|
483 | | -(defn render-quoted-string [s {:as opts :keys [closing-paren path viewer !expanded-at] :or {path []}}] |
484 | | - (let [{:keys [opening-paren]} viewer] |
| 468 | +(defn render-quoted-string [s {:as opts :keys [closing-parens path viewer !expanded-at] :or {path []}}] |
| 469 | + (let [{:keys [opening-paren closing-paren]} viewer] |
485 | 470 | [:span.inspected-value.inline-flex |
486 | 471 | [:span.cmt-string |
487 | 472 | (if (some #(and (string? %) (str/includes? % "\n")) (if (string? s) [s] s)) |
488 | 473 | [expand-button !expanded-at opening-paren path] |
489 | 474 | [:span opening-paren])] |
490 | | - [:div |
491 | | - [:span.cmt-string (viewer/->value (render-string s opts)) (first closing-paren)] |
492 | | - (when (list? closing-paren) (into [:<>] (rest closing-paren)))]])) |
| 475 | + (into [:div |
| 476 | + [:span.cmt-string (viewer/->value (render-string s opts)) (first closing-paren)] |
| 477 | + (rest closing-parens)])])) |
493 | 478 |
|
494 | 479 | (defn render-number [num] |
495 | 480 | [:span.cmt-number.inspected-value |
|
0 commit comments