Package-level declarations

Types

Link copied to clipboard

A simple Add button.

Link copied to clipboard
class HeaderDrawer(modifier: Modifier = Modifier, headerClick: () -> Unit = {}, drawer: BoxScope.() -> SimpleTextDrawer) : StoryStepDrawer

The header for the Document. It applies some stylish to the title of the document.

Link copied to clipboard
class JsTextDrawer(modifier: Modifier = Modifier, textStyle: TextStyle? = null, focusRequester: FocusRequester? = null, onKeyEvent: (KeyEvent, TextFieldValue, StoryStep, Int) -> Boolean = { _, _, _, _ -> false }, onTextEdit: (Action.StoryStateChange) -> Unit = { }, commandHandler: TextCommandHandler = TextCommandHandler(emptyMap()), var onFocusChanged: (FocusState) -> Unit = {}) : SimpleTextDrawer

Simple message drawer mostly intended to be used as a component for more complex drawers. This class contains the logic of the basic message of the SDK. As many other drawers need some text in it this Drawer can be used instead of duplicating this text logic.

Link copied to clipboard
class LastEmptySpace(modifier: Modifier = Modifier, height: Dp = 500.dp, moveRequest: (Action.Move) -> Unit = {}, click: () -> Unit = {}) : StoryStepDrawer

Draws an large empty space. This can be used to add a spacial action to the end of an document and hide this behaviour from the user. Indeed use is to move the focus to the available text drawer when clicked.

Link copied to clipboard
class RowGroupDrawer(stepDrawer: StoryStepDrawer, modifier: Modifier = Modifier) : StoryStepDrawer

Draws a scrollable list of images accordingly with the imageStepDrawer provided.

Link copied to clipboard
class SpaceDrawer(moveRequest: (Action.Move) -> Unit = {}) : StoryStepDrawer

Draws a white space. This Drawer is very important for accepting drop os other Composables for reorder purposes. A space create a move request when dropping Composables in it while the other story units create a mergeRequest.

Link copied to clipboard
class TextDrawer(modifier: Modifier = Modifier, onKeyEvent: (KeyEvent, TextFieldValue, StoryStep, Int) -> Boolean = { _, _, _, _ -> false }, textStyle: @Composable (StoryStep) -> TextStyle = { defaultTextStyle(it) }, onTextEdit: (Action.StoryStateChange) -> Unit = { }, commandHandler: TextCommandHandler = TextCommandHandler(emptyMap()), allowLineBreaks: Boolean = false, onLineBreak: (Action.LineBreak) -> Unit = {}, var onFocusChanged: (FocusState) -> Unit = {}) : SimpleTextDrawer

Simple message drawer intended to be used as a component for more complex drawers. This class contains the logic of the basic message of the SDK. As many other drawers need some text in it this Drawer can be used instead of duplicating this text logic.

Link copied to clipboard
actual class TextItemDrawer(modifier: Modifier, customBackgroundColor: Color, clickable: Boolean, onSelected: (Boolean, Int) -> Unit, dragIconWidth: Dp, startContent: (StoryStep, DrawInfo) -> Unit?, messageDrawer: RowScope.() -> SimpleTextDrawer) : StoryStepDrawer

Drawer for a complex message with swipe action, drag and drop logic and a start content to add functionality like a checkbox or a different Composable.

expect class TextItemDrawer(modifier: Modifier = Modifier, customBackgroundColor: Color = Color.Transparent, clickable: Boolean = true, onSelected: (Boolean, Int) -> Unit = { _, _ -> }, dragIconWidth: Dp = 16.dp, startContent: @Composable (StoryStep, DrawInfo) -> Unit?, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer) : StoryStepDrawer

Drawer for a complex message with swipe action, drag and drop logic and a start content to add functionality like a checkbox or a different Composable.

actual class TextItemDrawer(modifier: Modifier, customBackgroundColor: Color, clickable: Boolean, onSelected: (Boolean, Int) -> Unit, dragIconWidth: Dp, startContent: (StoryStep, DrawInfo) -> Unit?, messageDrawer: RowScope.() -> SimpleTextDrawer) : StoryStepDrawer

Drawer for a complex message with swipe action, drag and drop logic and a start content to add functionality like a checkbox or a different Composable.

actual class TextItemDrawer(modifier: Modifier, customBackgroundColor: Color, clickable: Boolean, onSelected: (Boolean, Int) -> Unit, dragIconWidth: Dp, startContent: (StoryStep, DrawInfo) -> Unit?, messageDrawer: RowScope.() -> SimpleTextDrawer) : StoryStepDrawer

Drawer for a complex message with swipe action, drag and drop logic and a start content to add functionality like a checkbox or a different Composable.

Functions

Link copied to clipboard
fun checkItemDrawer(manager: WriteopiaStateManager, modifier: Modifier = Modifier, dragIconWidth: Dp = 16.dp, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer

fun checkItemDrawer(modifier: Modifier = Modifier, customBackgroundColor: Color = Color.Transparent, clickable: Boolean = true, onSelected: (Boolean, Int) -> Unit = { _, _ -> }, dragIconWidth: Dp = 16.dp, onCheckedChange: (Action.StoryStateChange) -> Unit = {}, startContent: @Composable (StoryStep, DrawInfo) -> Unit? = { step, drawInfo -> CompositionLocalProvider(LocalMinimumInteractiveComponentEnforcement provides false) { Spacer(modifier = Modifier.width(8.dp)) Checkbox( checked = step.checked ?: false, onCheckedChange = { checked -> onCheckedChange( Action.StoryStateChange( step.copy(checked = checked), drawInfo.position ) ) }, modifier.padding(vertical = 4.dp), enabled = drawInfo.editable, ) } }, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer

Check item drawer. Draws a checkbox followed by a text.

Link copied to clipboard
fun headerDrawer(manager: WriteopiaStateManager, headerClick: () -> Unit, onKeyEvent: (KeyEvent, TextFieldValue, StoryStep, Int) -> Boolean, modifier: Modifier = Modifier): StoryStepDrawer
Link copied to clipboard
fun swipeTextDrawer(manager: WriteopiaStateManager, modifier: Modifier = Modifier, dragIconWidth: Dp = 16.dp, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer

fun swipeTextDrawer(modifier: Modifier = Modifier, customBackgroundColor: Color = Color.Transparent, clickable: Boolean = true, dragIconWidth: Dp = 16.dp, onSelected: (Boolean, Int) -> Unit = { _, _ -> }, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer

Draw a text that can be edited with a swipe effect to trigger edition.

Link copied to clipboard
fun unOrderedListItemDrawer(manager: WriteopiaStateManager, modifier: Modifier = Modifier, dragIconWidth: Dp = 16.dp, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer

Drawer for a unordered list. This type of item it just a normal message with some decoration at the start of Composable to show that this is part of a list.

fun unOrderedListItemDrawer(modifier: Modifier = Modifier, customBackgroundColor: Color = Color.Transparent, clickable: Boolean = true, onSelected: (Boolean, Int) -> Unit = { _, _ -> }, dragIconWidth: Dp = 16.dp, startContent: @Composable (StoryStep, DrawInfo) -> Unit? = { _, _ -> Spacer(modifier = Modifier.width(8.dp)) Text( modifier = Modifier.padding(horizontal = 2.dp), text = "-", ) }, messageDrawer: @Composable RowScope.() -> SimpleTextDrawer): StoryStepDrawer