schlechtenburg/packages/docs/lib/api/@schlechtenburg/core.md

341 lines
2.6 KiB
Markdown
Raw Normal View History

2022-03-21 23:58:05 +00:00
# @schlechtenburg/core
2022-03-21 00:53:25 +00:00
2022-03-21 23:58:05 +00:00
## SbBlock
Displays a Schlechtenburg block either the mode of the schlechtenburg instance.
You can use this to display child blocks inside your own blocks.
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
#### block
The state for the block.
2022-03-22 20:16:26 +00:00
- **Type** `IBlockData<any>`
2022-03-21 23:58:05 +00:00
#### onUpdate
Called when the block should be updated.
2022-03-22 20:16:26 +00:00
- **Type** `OnUpdateBlockCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onPrependBlock
Called when a sibling block should be inserted before the block
2022-03-22 20:16:26 +00:00
- **Type** `OnPrependBlockCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onAppendBlock
Called when a sibling block should be inserted after the block
2022-03-22 20:16:26 +00:00
- **Type** `OnAppendBlockCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onRemoveSelf
Called when the block should be removed
2022-03-22 20:16:26 +00:00
- **Type** `OnRemoveSelfCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onActivatePrevious
Called when the previous sibling block should be activated
2022-03-22 20:16:26 +00:00
- **Type** `OnActivatePreviousCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onActivateNext
Called when the next sibling block should be activated
2022-03-22 20:16:26 +00:00
- **Type** `OnActivateNextCb`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
## SbBlockOrdering
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
#### orientation
2022-03-22 20:16:26 +00:00
- **Type** `string`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `null`
2022-03-21 23:58:05 +00:00
#### onRemove
2022-03-22 20:16:26 +00:00
- **Type** `func`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onMoveBackward
2022-03-22 20:16:26 +00:00
- **Type** `func`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
#### onMoveForward
2022-03-22 20:16:26 +00:00
- **Type** `func`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
## SbBlockPicker
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
#### onPickedBlock
2022-03-22 20:16:26 +00:00
- **Type** `func`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
## SbBlockPlaceholder
A placeholder for a block.
Displays a placeholder for a block, allowing the user to select a block to insert.
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
#### onInsertBlock
Called when the user picked a block that should be inserted here.
2022-03-22 20:16:26 +00:00
- **Type** `func`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Default value** `() => {}`
2022-03-21 23:58:05 +00:00
## SbButton
A button in the schlechtenburg theme
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
## SbSelect
A select input in the schlechtenburg theme
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
## SbToolbar
Toolbar in the schlechtenburg theme
2022-03-22 20:16:26 +00:00
- **Type**: `Component`
2022-03-21 23:58:05 +00:00
### Props
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-22 20:07:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 20:16:26 +00:00
- **Type** `Variable`
2022-03-21 23:58:05 +00:00
2022-03-22 22:02:56 +00:00
2022-03-21 23:58:05 +00:00
## generateBlockId
2022-03-22 22:02:56 +00:00
- **Params**
2022-03-21 23:58:05 +00:00
## useActivation
2022-03-22 22:02:56 +00:00
- **Params**
2022-03-21 23:58:05 +00:00
## useBlockSizing
2022-03-22 22:02:56 +00:00
- **Params**
2022-03-21 23:58:05 +00:00
## useDynamicBlocks
2022-03-22 22:02:56 +00:00
- **Params**
2022-03-21 23:58:05 +00:00
## useResizeObserver
2022-03-22 22:02:56 +00:00
- **Params**