Skip to content

Commit 122d6ed

Browse files
committed
fix: simplify ui Source tab for literal data blocks
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 64bd2fe commit 122d6ed

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/assets/pdl-ui-3.png

-13.5 KB
Loading

pdl-live-react/src/pdl_ast_utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ export function map_block_children(
5555
return { ...block, code: code }
5656
})
5757
.with({ kind: "get" }, (block) => block)
58+
.with(
59+
{ kind: "data", data: P.union(P.number, P.boolean, P.string) },
60+
({ data }) => data, // { kind: "data", data: "hello" } -> "hello"
61+
)
5862
.with({ kind: "data" }, (block) => block)
5963
.with({ kind: "text" }, (block) => {
6064
let text

0 commit comments

Comments
 (0)