Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @schlechtenburg/core

Index

Type aliases

OnActivateNextCb: () => void

Type declaration

    • (): void
    • Callback type for activating the next block.

      props: {
      onActivateNext: {
      type: (null as unknown) as PropType<OnActivateNextCb>,
      default: () => {},
      },
      }
      see

      SbBlock

      Returns void

OnActivatePreviousCb: () => void

Type declaration

    • (): void
    • Callback type for activating the previous block.

      props: {
      onActivatePrevious: {
      type: (null as unknown) as PropType<OnActivatePreviousCb>,
      default: () => {},
      },
      }
      see

      SbBlock

      Returns void

OnAppendBlockCb: (block: IBlockData<any>) => void

Type declaration

    • Callback type for sending blocks that should be appended as a sibling after the current block

      props: {
      onAppendBlock: {
      type: (null as unknown) as PropType<OnAppendBlockCb<IComponentToBeAppendedData>>,
      default: () => {},
      },
      }
      see

      SbBlock

      Parameters

      Returns void

OnPrependBlockCb: (block: IBlockData<any>) => void

Type declaration

    • Callback type for sending blocks that should be prepended as a sibling before the current block

      props: {
      onPrependBlock: {
      type: (null as unknown) as PropType<OnPrependBlockCb<IComponentToBePrependedData>>,
      default: () => {},
      },
      }
      see

      SbBlock

      Parameters

      Returns void

OnRemoveSelfCb: () => void

Type declaration

    • (): void
    • Callback type for removing the current block.

      props: {
      onRemoveSelf: {
      type: (null as unknown) as PropType<OnRemoveSelfCb>,
      default: () => {},
      },
      }
      see

      SbBlock

      Returns void

OnUpdateBlockCb: (updated: IBlockData<any>) => void

Type declaration

    • Callback type for sending full block updates. SbBlock takes this as a prop.

      <SbBlock onUpdate={myFn as OnUpdateSelfCb}></SbBlock>
      
      see

      SbBlock

      Parameters

      Returns void

OnUpdateSelfCb<T>: (updated: Partial<T>) => void

Type parameters

  • T

Type declaration

    • (updated: Partial<T>): void
    • Callback type for sending partial self-updates in edit mode.

      props: {
      onUpdate: {
      type: (null as unknown) as PropType<OnUpdateSelfCb<IYourComponentData>>,
      default: () => {},
      },
      }
      see

      SbBlock

      Parameters

      • updated: Partial<T>

      Returns void

Variables

SbBlock: DefineComponent<{ block: { required: true; type: PropType<IBlockData<any>> }; onActivateNext: { default: () => void; type: PropType<OnActivateNextCb> }; onActivatePrevious: { default: () => void; type: PropType<OnActivatePreviousCb> }; onAppendBlock: { default: () => void; type: PropType<OnAppendBlockCb> }; onPrependBlock: { default: () => void; type: PropType<OnPrependBlockCb> }; onRemoveSelf: { default: () => void; type: PropType<OnRemoveSelfCb> }; onUpdate: { default: () => void; type: PropType<OnUpdateBlockCb> } }, () => Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, PublicProps, Readonly<ExtractPropTypes<{ block: { required: true; type: PropType<IBlockData<any>> }; onActivateNext: { default: () => void; type: PropType<OnActivateNextCb> }; onActivatePrevious: { default: () => void; type: PropType<OnActivatePreviousCb> }; onAppendBlock: { default: () => void; type: PropType<OnAppendBlockCb> }; onPrependBlock: { default: () => void; type: PropType<OnPrependBlockCb> }; onRemoveSelf: { default: () => void; type: PropType<OnRemoveSelfCb> }; onUpdate: { default: () => void; type: PropType<OnUpdateBlockCb> } }>>, { onActivateNext: OnActivateNextCb; onActivatePrevious: OnActivatePreviousCb; onAppendBlock: OnAppendBlockCb; onPrependBlock: OnPrependBlockCb; onRemoveSelf: OnRemoveSelfCb; onUpdate: OnUpdateBlockCb }> = ...

Displays a Schlechtenburg block either the mode of the schlechtenburg instance. You can use this to display child blocks inside your own blocks.

SbBlockOrdering: DefineComponent<{ onMoveBackward: { default: () => void; type: FunctionConstructor }; onMoveForward: { default: () => void; type: FunctionConstructor }; onRemove: { default: () => void; type: FunctionConstructor }; orientation: { default: null; type: StringConstructor } }, () => Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, PublicProps, Readonly<ExtractPropTypes<{ onMoveBackward: { default: () => void; type: FunctionConstructor }; onMoveForward: { default: () => void; type: FunctionConstructor }; onRemove: { default: () => void; type: FunctionConstructor }; orientation: { default: null; type: StringConstructor } }>>, { onMoveBackward: Function; onMoveForward: Function; onRemove: Function; orientation: string }> = ...
SbBlockPicker: DefineComponent<{ onPickedBlock: { default: () => void; type: FunctionConstructor } }, () => Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, PublicProps, Readonly<ExtractPropTypes<{ onPickedBlock: { default: () => void; type: FunctionConstructor } }>>, { onPickedBlock: Function }> = ...
SbBlockPlaceholder: DefineComponent<{ onInsertBlock: { default: () => void; type: FunctionConstructor } }, () => Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, PublicProps, Readonly<ExtractPropTypes<{ onInsertBlock: { default: () => void; type: FunctionConstructor } }>>, { onInsertBlock: Function }> = ...

A placeholder for a block. Displays a placeholder for a block, allowing the user to select a block to insert.

sbui
SbButton: DefineComponent<{}, () => Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, PublicProps, Readonly<ExtractPropTypes<{}>>, {}> = ...

A button in the schlechtenburg theme

sbui
SbMain: DefineComponent<{ availableBlocks: { default: () => never[]; type: PropType<IBlockDefinition<any>[]> }; block: { required: true; type: PropType<IBlockData<any>> }; mode: { default: SbMode; type: PropType<SbMode>; validator: any }; onUpdate: { default: () => void; type: PropType<OnUpdateBlockCb> } }, () => Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, PublicProps, Readonly<ExtractPropTypes<{ availableBlocks: { default: () => never[]; type: PropType<IBlockDefinition<any>[]> }; block: { required: true; type: PropType<IBlockData<any>> }; mode: { default: SbMode; type: PropType<SbMode>; validator: any }; onUpdate: { default: () => void; type: PropType<OnUpdateBlockCb> } }>>, { availableBlocks: IBlockDefinition<any>[]; mode: SbMode; onUpdate: OnUpdateBlockCb }> = ...
SbSelect: DefineComponent<{}, () => Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, PublicProps, Readonly<ExtractPropTypes<{}>>, {}> = ...

A select input in the schlechtenburg theme

sbui
SbToolbar: DefineComponent<{}, () => Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, PublicProps, Readonly<ExtractPropTypes<{}>>, {}> = ...

Toolbar in the schlechtenburg theme

sbui
SymActiveBlock: typeof SymActiveBlock = ...
SymBlockDimensions: typeof SymBlockDimensions = ...
SymBlockLibrary: typeof SymBlockLibrary = ...
SymEditorDimensions: typeof SymEditorDimensions = ...
SymMode: typeof SymMode = ...
blockProps: { blockId: { default: v4; type: StringConstructor } } = ...

Type declaration

  • blockId: { default: v4; type: StringConstructor }
    • default: v4
    • type: StringConstructor
model: { event: string; prop: string } = ...

Type declaration

  • event: string
  • prop: string

Functions

  • generateBlockId<T>(options: undefined | null | V4Options, buffer: T, offset?: number): T
  • generateBlockId(options?: V4Options): string
  • Type parameters

    • T: ArrayLike<number, T>

    Parameters

    • options: undefined | null | V4Options
    • buffer: T
    • Optional offset: number

    Returns T

  • Parameters

    • Optional options: V4Options

    Returns string

  • useActivation(currentBlockId?: null | string): { activate: (id?: null | string) => void; activeBlockId: Ref<null | string>; deactivate: (id?: null | string) => void; isActive: ComputedRef<boolean>; requestActivation: () => void }
  • Parameters

    • currentBlockId: null | string = null

    Returns { activate: (id?: null | string) => void; activeBlockId: Ref<null | string>; deactivate: (id?: null | string) => void; isActive: ComputedRef<boolean>; requestActivation: () => void }

    • activate: (id?: null | string) => void
        • (id?: null | string): void
        • Parameters

          • id: null | string = currentBlockId

          Returns void

    • activeBlockId: Ref<null | string>
    • deactivate: (id?: null | string) => void
        • (id?: null | string): void
        • Parameters

          • id: null | string = currentBlockId

          Returns void

    • isActive: ComputedRef<boolean>
    • requestActivation: () => void
        • (): void
        • Returns void

  • useBlockSizing(): { blockDimensions: Ref<null | BlockRect>; editorDimensions: Ref<null | BlockRect> }
  • Returns { blockDimensions: Ref<null | BlockRect>; editorDimensions: Ref<null | BlockRect> }

    • blockDimensions: Ref<null | BlockRect>
    • editorDimensions: Ref<null | BlockRect>
  • useResizeObserver(el: Ref<null | HTMLElement>, symbol: symbol): { dimensions: Ref<null | BlockRect>; triggerSizeCalculation: () => void }
  • Parameters

    • el: Ref<null | HTMLElement>
    • symbol: symbol

    Returns { dimensions: Ref<null | BlockRect>; triggerSizeCalculation: () => void }

    • dimensions: Ref<null | BlockRect>
    • triggerSizeCalculation: () => void
        • (): void
        • Returns void

Generated using TypeDoc