From 40fbb98a9147fd351d2e035e484d0dcb45a6a1cc Mon Sep 17 00:00:00 2001 From: d1snin Date: Mon, 23 Oct 2023 23:44:28 +0300 Subject: [PATCH] feat: add `ContentEntitiesBuilder.heading` --- .../dev/d1s/beam/client/BlockModificationBuilder.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/beam-client/src/commonMain/kotlin/dev/d1s/beam/client/BlockModificationBuilder.kt b/beam-client/src/commonMain/kotlin/dev/d1s/beam/client/BlockModificationBuilder.kt index 1e2c3a17..0a9001db 100644 --- a/beam-client/src/commonMain/kotlin/dev/d1s/beam/client/BlockModificationBuilder.kt +++ b/beam-client/src/commonMain/kotlin/dev/d1s/beam/client/BlockModificationBuilder.kt @@ -104,16 +104,20 @@ public fun ContentEntitiesBuilder.text(value: String, heading: String? = null) { } } +public fun ContentEntitiesBuilder.heading(value: String, level: TextContentEntityTypeDefinition.Heading) { + text(value, heading = level.key) +} + public fun ContentEntitiesBuilder.firstHeading(value: String) { - text(value, heading = TextContentEntityTypeDefinition.Heading.H1.name) + heading(value, level = TextContentEntityTypeDefinition.Heading.H1) } public fun ContentEntitiesBuilder.secondHeading(value: String) { - text(value, heading = TextContentEntityTypeDefinition.Heading.H2.name) + heading(value, level = TextContentEntityTypeDefinition.Heading.H2) } public fun ContentEntitiesBuilder.thirdHeading(value: String) { - text(value, heading = TextContentEntityTypeDefinition.Heading.H3.name) + heading(value, level = TextContentEntityTypeDefinition.Heading.H3) } public fun ContentEntitiesBuilder.buttonLink(