@bodiless/layouts
@bodiless/layouts
Table of contents
Namespaces
Enumerations
Classes
Component Interfaces
Type aliases
Variables
Functions
Type aliases
Categories
Ƭ Categories: Object
Index signature
▪ [key: string
]: string
[]
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:43
ComponentSelectorFormProps
Ƭ ComponentSelectorFormProps: Omit
<ComponentSelectorProps
, "closeForm"
| "components"
| "mode"
> & { components
: DesignableComponents
}
Defined in
bodiless-layouts/src/ComponentSelector/componentSelectorForm.tsx:21
ComponentSelectorOptions
Ƭ ComponentSelectorOptions: Pick
<ComponentSelectorProps
, "mandatoryCategories"
| "blacklistCategories"
>
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:174
ComponentSelectorProps
Ƭ ComponentSelectorProps: ItemListProps
& { mandatoryCategories?
: string
[] ; mode?
: ComponentDisplayMode
; ui?
: ComponentSelectorUI
; closeForm?
: (e?
: any
) => void
}
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:24
ComponentSelectorUI
Ƭ ComponentSelectorUI: Partial
<FinalUI
>
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:172
ComponentWithMeta
Ƭ ComponentWithMeta<P
>: ComponentType
<P
> & Meta
Type parameters
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:70
ComponentWithPartialMeta
Ƭ ComponentWithPartialMeta<P
>: ComponentType
<P
> & Partial
<Meta
>
Type parameters
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:71
CreateFlowContainerItem
Ƭ CreateFlowContainerItem: (args
: CreateFlowContainerItemArgs
) => FlowContainerItem
Type declaration
▸ (args
): FlowContainerItem
Parameters
Returns
FlowContainerItem
Defined in
bodiless-layouts/src/deserializers/createFlowContainerItem.ts:28
CreateFlowContainerItemArgs
Ƭ CreateFlowContainerItemArgs: Object
Type declaration
Name | Type |
---|
element | Element | Element [] |
elementIndex | number |
type | string |
Defined in
bodiless-layouts/src/deserializers/createFlowContainerItem.ts:23
DeserializeElement
Ƭ DeserializeElement: (args
: DeserializeElementArgs
) => FlowContainerData
Type declaration
▸ (args
): FlowContainerData
Parameters
Name | Type |
---|
args | DeserializeElementArgs |
Returns
FlowContainerData
Defined in
bodiless-layouts/src/deserializers/htmlDeserializer.ts:35
Deserializer
Ƭ Deserializer: Object
Type declaration
Defined in
bodiless-layouts/src/deserializers/deserializer.ts:21
FinalUI
Ƭ FinalUI: Object
Type declaration
Name | Type |
---|
AccordionCheckBox | ComponentType <HTMLProps <HTMLInputElement >> | string |
AccordionCheckboxLabel | ComponentType <HTMLProps <HTMLLabelElement >> | string |
AccordionCheckboxLabelText | ComponentType <HTMLProps <HTMLSpanElement >> | string |
AccordionCheckboxWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
AccordionIconContract | ComponentType <HTMLProps <HTMLSpanElement >> | string |
AccordionIconExpand | ComponentType <HTMLProps <HTMLSpanElement >> | string |
AccordionItemWrapper | ComponentType <HTMLProps <HTMLAnchorElement >> | string |
AccordionLabel | ComponentType <HTMLProps <HTMLLabelElement >> | string |
AccordionWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
CloseMenuIcon | ComponentType <HTMLProps <HTMLSpanElement >> | string |
ComponentDescriptionIcon | ComponentType <HTMLProps <HTMLDivElement >> | string |
ComponentDescriptionStyle | ComponentType <HTMLProps <HTMLDivElement >> | string |
ComponentDescriptionWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
ComponentLinkWrapper | ComponentType <HTMLProps <HTMLAnchorElement >> | string |
ComponentPreviewStyle | ComponentType <HTMLProps <HTMLImageElement >> | string |
ComponentSelectButton | ComponentType <HTMLProps <HTMLButtonElement >> | string |
ComponentSelectorWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
ComponentTitleWrapper | ComponentType <HTMLProps <HTMLHeadingElement >> | string |
FlexSection | ComponentType <HTMLProps <HTMLDivElement >> | string |
FlexSectionFull | ComponentType <HTMLProps <HTMLDivElement >> | string |
FlowContainerEmpty | ComponentType <HTMLProps <HTMLDivElement >> | string |
GridListBox | ComponentType <HTMLProps <HTMLDivElement >> | string |
GridListBoxInner | ComponentType <HTMLProps <HTMLDivElement >> | string |
GridListBoxWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
IconWrapper | ComponentType <HTMLProps <HTMLSpanElement >> | string |
ItemBox | ComponentType <HTMLProps <HTMLDivElement >> | string |
ItemBoxWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
MasterWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
ScalingButtonFull | ComponentType <HTMLProps <HTMLElement >> | string |
ScalingButtonHalf | ComponentType <HTMLProps <HTMLElement >> | string |
ScalingButtonQuarter | ComponentType <HTMLProps <HTMLElement >> | string |
ScalingHeader | ComponentType <HTMLProps <HTMLDivElement >> | string |
SearchBar | ComponentType <HTMLProps <HTMLInputElement >> | string |
SearchBarWrapper | ComponentType <HTMLProps <HTMLDivElement >> | string |
SubmitButton | ComponentType <HTMLProps <HTMLButtonElement >> | string |
TitleWrapper | ComponentType <HTMLProps <HTMLSpanElement >> | string |
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:95
FlowContainerItem
Ƭ FlowContainerItem: Object
Type declaration
Name | Type |
---|
type | string |
uuid | string |
wrapperProps | { [key: string] : string ; } |
Defined in
bodiless-layouts/src/deserializers/createFlowContainerItem.ts:17
FlowContainerItemData
Ƭ FlowContainerItemData: Object
Index signature
▪ [itemNodeKey: string
]: any
Defined in
bodiless-layouts/src/deserializers/deserializer.ts:17
FlowContainerProps
Ƭ FlowContainerProps: Omit
<FlowContainerBaseProps
, "components"
> & DesignableProps
Defined in
bodiless-layouts/src/FlowContainer/types.ts:56
FlowContainerWrapperProps
Ƭ FlowContainerWrapperProps: Object
Type declaration
Defined in
bodiless-layouts/src/FlowContainer/types.ts:86
ItemListProps
Ƭ ItemListProps: Object
Props passed to the list of items within the component selector.
Type declaration
Name | Type | Description |
---|
blacklistCategories? | string [] | List of categories which should never be shown in the filters. |
components | ComponentWithMeta [] | An array of components with metadata (at leassts displayName, title, description) |
scale? | ComponentSelectorScale | Initial scale |
onSelect | (names : string []) => void | Callback when one or more components are selected. |
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:76
LibraryItemContextProps
Ƭ LibraryItemContextProps: Object
Flow Container Library Item Context Props where isLibraryItem
defaults to true
if FlowContainerItem is actually a Library Item.
Type declaration
Name | Type |
---|
isLibraryItem | boolean |
setIsLibraryItem | React.Dispatch <React.SetStateAction <boolean >> |
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:47
LibraryItemProviderProps
Ƭ LibraryItemProviderProps: Object
Flow Container Library Item Provider Props.
Type declaration
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:39
Meta
Ƭ Meta: Object
Component metadata used to search, filter and display
information about a component,
Type declaration
Name | Type | Description |
---|
categories? | Categories | Category and value pairs for facets |
description | string | Description to display in the item selector |
displayName | string | default static prop for react component to distingush it in the render tree |
title | string | Title to show in the item selector menu |
Defined in
bodiless-layouts/src/ComponentSelector/types.tsx:51
SelectorComponentsInterface
Ƭ SelectorComponentsInterface: Object
Interface for an object which exposes two sets of components: those
needed to render the flow container or chameleon, and those needed to
render the component selector.
Type declaration
Name | Type | Description |
---|
components | DesignableComponents | The components needed to render the flow container itself |
selectableComponents | DesignableComponents | The components neededd to render the component selector. |
Defined in
bodiless-layouts/src/ComponentSelector/SelectorComponents.tsx:26
SelectorComponentsProps
Ƭ SelectorComponentsProps: Object
Properties which must be passed to the constructor of the
SelectorComponents class.
Type declaration
Name | Type |
---|
DefaultComponent | ComponentOrTag <any > |
design | Design |
selectedComponents | string [] |
startComponents? | DesignableComponents |
Defined in
bodiless-layouts/src/ComponentSelector/SelectorComponents.tsx:41
SortableResizableProps
Ƭ SortableResizableProps: Object
Type declaration
Name | Type |
---|
children | React.ReactNode |
className | string |
defaultSize? | { height? : string | number ; width? : string | number } |
defaultSize.height? | string | number |
defaultSize.width? | string | number |
direction? | string |
isEnabled | boolean |
onClick? | React.MouseEventHandler |
onResize? | ResizeCallback |
onResizeStop? | ResizeCallback |
snapData? | SnapData |
ui? | SortableResizableUI |
Defined in
bodiless-layouts/src/SortableResizableWrapper/index.tsx:39
SortableResizableUI
Ƭ SortableResizableUI: Partial
<FinalUI
>
Defined in
bodiless-layouts/src/SortableResizableWrapper/index.tsx:28
WithTitleFromTermsProps
Ƭ WithTitleFromTermsProps: Object
Type of the options for withTitleFromTerms
Type declaration
Name | Type | Description |
---|
blacklistCategories? | string [] | List of categories which should be excluded when creating the title. |
blacklistTerms? | string [] | List of terms which should be exclued when building the title. |
separator? | string | Term separator |
createTitleSegment? | (category : string , term : string ) => string | Function which takes a category and term and returns the string which should be used for that segment of the title. |
Defined in
bodiless-layouts/src/meta/withTitleFromTerms.tsx:23
Variables
CONTENT_LIBRARY_TYPE_PREFIX
• Const
CONTENT_LIBRARY_TYPE_PREFIX: "ContentLibrary"
Default Prefix for the Library Item Flow Container Item type.
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:25
ComponentSelector
• Const
ComponentSelector: React.FC
<ComponentSelectorProps
>
Defined in
bodiless-layouts/src/ComponentSelector/index.tsx:85
DIRECTIONS
• Const
DIRECTIONS: Object
Type declaration
Name | Type |
---|
LTR | LanguageDirection |
RTL | LanguageDirection |
Defined in
bodiless-layouts/src/withDirection/withDirection.tsx:22
FlowContainer
• Const
FlowContainer: ComponentType
<FlowContainerProps
>
Defined in
bodiless-layouts/src/FlowContainer/index.tsx:49
LibraryItemContext
• Const
LibraryItemContext: Context
<LibraryItemContextProps
>
Flow Container Library Item Context.
see
LibraryItemContextProps
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:56
LibraryItemProvider
• Const
LibraryItemProvider: FC
<LibraryItemProviderProps
>
A LibraryItemProvider
indicates whether the current Flow Container Item is a Library Item.
see
LibraryItemProviderProps.
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:79
SlateSortableResizable
• Const
SlateSortableResizable: Object
Call signature
▸ (props
): Element
Parameters
Name | Type |
---|
props | SlateSortableResizableProps |
Returns
Element
Type declaration
Name | Type |
---|
defaultProps | { defaultSize : { height : string = ''; width : string = '' } ; onResize : () => void } |
defaultProps.defaultSize | { height : string = ''; width : string = '' } |
defaultProps.defaultSize.height | string |
defaultProps.defaultSize.width | string |
defaultProps.onResize | () => void |
displayName | string |
Defined in
bodiless-layouts/src/SlateSortableResizable.tsx:120
SortableResizableWrapper
• Const
SortableResizableWrapper: ComponentClass
<SortableResizableProps
& SortableElementProps
, any
>
Defined in
bodiless-layouts/src/SortableResizableWrapper/index.tsx:59
Functions
SortableChild
▸ SortableChild(props
): Element
This is the component which wraps all items in the flow container. You probably
only need to use it directly if you are customizing the Admin UI.
Parameters
Name | Type |
---|
props | SortableChildProps |
Returns
Element
Defined in
bodiless-layouts/src/FlowContainer/SortableChild.tsx:30
asPassThough
▸ asPassThough(Component
): CTWM
Parameters
Returns
CTWM
Defined in
bodiless-layouts/src/meta/index.tsx:30
componentSelectorForm
▸ componentSelectorForm(props
): (props
: Omit
<ContextMenuFormProps
, "children"
>) => Element
Returns a component selector wrapped in a context menu form.
Parameters
Returns
fn
▸ (props
): Element
Parameters
Name | Type |
---|
props | Omit <ContextMenuFormProps , "children" > |
Returns
Element
Defined in
bodiless-layouts/src/ComponentSelector/componentSelectorForm.tsx:32
createDefaultDeserializer
▸ createDefaultDeserializer(type
): Deserializer
Parameters
Returns
Deserializer
Defined in
bodiless-layouts/src/deserializers/defaultDeserializers.ts:21
createFlowContainerItem
▸ createFlowContainerItem(args
): FlowContainerItem
Parameters
Returns
FlowContainerItem
Defined in
bodiless-layouts/src/deserializers/createFlowContainerItem.ts:36
createListDeserializer
▸ createListDeserializer(type
, linkKey
, titleKey
): Deserializer
Parameters
Name | Type |
---|
type | string |
linkKey | string |
titleKey | string |
Returns
Deserializer
Defined in
bodiless-layouts/src/deserializers/listDeserializer.ts:64
deserializeHtml
▸ deserializeHtml(html
, deserializers
, domParser?
): FlowContainerData
Parameters
Name | Type |
---|
html | string |
deserializers | Deserializer [] |
domParser? | DOMParser |
Returns
FlowContainerData
Defined in
bodiless-layouts/src/deserializers/htmlDeserializer.ts:71
deserializeList
▸ deserializeList(linkKey
, titleKey
): (item
: FlowContainerItem
, elements
: Element
[]) => ListData
Parameters
Name | Type |
---|
linkKey | string |
titleKey | string |
Returns
fn
▸ (item
, elements
): ListData
Parameters
Returns
ListData
Defined in
bodiless-layouts/src/deserializers/listDeserializer.ts:23
generateUuid
▸ generateUuid(content
, index
): string
Parameters
Name | Type |
---|
content | string |
index | number |
Returns
string
Defined in
bodiless-layouts/src/deserializers/createFlowContainerItem.ts:30
getSnapFrom
▸ getSnapFrom(...withTuples
): SnapData
Parameters
Name | Type |
---|
...withTuples | WithTuples [] |
Returns
SnapData
Defined in
bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:140
ifComponentSelector
▸ ifComponentSelector<B1
, A1
, R1
, A2
, R2
, A3
, R3
, A4
, R4
, A5
, R5
, A6
, R6
, A7
, R7
, A8
, R8
, A9
, R9
>(t1?
, t2?
, t3?
, t4?
, t5?
, t6?
, t7?
, t8?
, t9?
, ...t
): HOCWithMeta
<B1
, object
& A1
& A2
& A3
& A4
& A5
& A6
& A7
& A8
& A9
, R1
& R2
& R3
& R4
& R5
& R6
& R7
& R8
& R9
>
Type parameters
Name |
---|
B1 |
A1 |
R1 |
A2 |
R2 |
A3 |
R3 |
A4 |
R4 |
A5 |
R5 |
A6 |
R6 |
A7 |
R7 |
A8 |
R8 |
A9 |
R9 |
Parameters
Name | Type |
---|
t1? | HOCDef <B1 , A1 , R1 > |
t2? | HOCDef <{}, A2 , R2 > |
t3? | HOCDef <{}, A3 , R3 > |
t4? | HOCDef <{}, A4 , R4 > |
t5? | HOCDef <{}, A5 , R5 > |
t6? | HOCDef <{}, A6 , R6 > |
t7? | HOCDef <{}, A7 , R7 > |
t8? | HOCDef <{}, A8 , R8 > |
t9? | HOCDef <{}, A9 , R9 > |
...t | HOCDef <any , any , any >[] |
Returns
HOCWithMeta
<B1
, object
& A1
& A2
& A3
& A4
& A5
& A6
& A7
& A8
& A9
, R1
& R2
& R3
& R4
& R5
& R6
& R7
& R8
& R9
>
Defined in
bodiless-layouts/src/FlowContainer/ComponentDisplayMode.tsx:50
ifNotComponentSelector
▸ ifNotComponentSelector<B1
, A1
, R1
, A2
, R2
, A3
, R3
, A4
, R4
, A5
, R5
, A6
, R6
, A7
, R7
, A8
, R8
, A9
, R9
>(t1?
, t2?
, t3?
, t4?
, t5?
, t6?
, t7?
, t8?
, t9?
, ...t
): HOCWithMeta
<B1
, object
& A1
& A2
& A3
& A4
& A5
& A6
& A7
& A8
& A9
, R1
& R2
& R3
& R4
& R5
& R6
& R7
& R8
& R9
>
Type parameters
Name |
---|
B1 |
A1 |
R1 |
A2 |
R2 |
A3 |
R3 |
A4 |
R4 |
A5 |
R5 |
A6 |
R6 |
A7 |
R7 |
A8 |
R8 |
A9 |
R9 |
Parameters
Name | Type |
---|
t1? | HOCDef <B1 , A1 , R1 > |
t2? | HOCDef <{}, A2 , R2 > |
t3? | HOCDef <{}, A3 , R3 > |
t4? | HOCDef <{}, A4 , R4 > |
t5? | HOCDef <{}, A5 , R5 > |
t6? | HOCDef <{}, A6 , R6 > |
t7? | HOCDef <{}, A7 , R7 > |
t8? | HOCDef <{}, A8 , R8 > |
t9? | HOCDef <{}, A9 , R9 > |
...t | HOCDef <any , any , any >[] |
Returns
HOCWithMeta
<B1
, object
& A1
& A2
& A3
& A4
& A5
& A6
& A7
& A8
& A9
, R1
& R2
& R3
& R4
& R5
& R6
& R7
& R8
& R9
>
Defined in
bodiless-layouts/src/FlowContainer/ComponentDisplayMode.tsx:51
isLibraryItem
▸ isLibraryItem(item
): boolean
Check if the current Flow Container Item is Library Item
Parameters
Name | Type | Description |
---|
item | FlowContainerItem | FlowContainerItem |
Returns
boolean
boolean
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:33
perserveMeta
▸ perserveMeta(hoc
): HOC
<{}, {}, {}>
preserveMeta returns takes an hoc and returns another one that will apply the hoc but preserve
theMeta data from the component.
Parameters
Name | Type | Description |
---|
hoc | HOC <{}, {}, {}> | the hoc to wrap. |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:111
useIsLibraryItem
▸ useIsLibraryItem(): boolean
Hook to check if the current Flow Container Item is Library Item
Must only be used on FlowContainerItem
.
Returns
boolean
boolean
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:73
useLibraryItemContext
▸ useLibraryItemContext(): LibraryItemContextProps
Hook that can be used to access the Flow Container Library Item Context.
Component must be within a LibraryItemProvider
.
see
LibraryItemContextProps
Returns
LibraryItemContextProps
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:66
useSelectorComponents
▸ useSelectorComponents(props
): SelectorComponents
Parameters
Returns
SelectorComponents
Defined in
bodiless-layouts/src/ComponentSelector/SelectorComponents.tsx:125
withAllTitlesFromTerms
▸ withAllTitlesFromTerms(ops?
): HOC
<{}, {}, {}>
Creates a token which can be applied to a flow container so that
all its components will have a default title generated based on
their metadata.
Parameters
Returns
HOC
<{}, {}, {}>
HOC which adds a default title to all components in the flow container.
Defined in
bodiless-layouts/src/meta/withTitleFromTerms.tsx:98
withAppendDesc
▸ withAppendDesc(newDescription
): HOC
<{}, {}, {}>
withAppendDesc returns an HOC that appends a description to the component sideload description.
Parameters
Name | Type | Description |
---|
newDescription | string | the description to be appended |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:92
withAppendDisplayName
▸ withAppendDisplayName(newDisplayName
): HOC
<{}, {}, {}>
withAppendDisplayName returns a HOC that appends a name to the sideloaded DisplayName
Parameters
Name | Type | Description |
---|
newDisplayName | string | the Display name to append |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:74
withAppendTitle
▸ withAppendTitle(newTitle
): HOC
<{}, {}, {}>
withAppendTitle returns an HOC that appends to the sideload title of the component
Note it appends to the title with a space.
Parameters
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:56
withContentLibrary
▸ withContentLibrary(options
): <P>(Component
: ComponentOrTag
<P
>) => any
Parameters
Name | Type |
---|
options | ContentLibraryOptions |
Returns
fn
▸ <P
>(Component
): any
Type parameters
Parameters
Name | Type |
---|
Component | ComponentOrTag <P > |
Returns
any
Defined in
bodiless-layouts/src/ContentLibrary/withContentLibrary.tsx:36
withDesc
▸ withDesc(description
): HOC
<{}, {}, {}>
withDesc returns an HOC that sideloads the provided description to the component.
Parameters
Name | Type | Description |
---|
description | string | the description to add |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:85
withDirection
▸ withDirection(langDirection
): Injector
<{ direction
: Direction
= langDirection }, object
>
Parameters
Name | Type |
---|
langDirection | Direction |
Returns
Injector
<{ direction
: Direction
= langDirection }, object
>
Defined in
bodiless-layouts/src/withDirection/withDirection.tsx:27
withDisplayName
▸ withDisplayName(displayName
): HOC
<{}, {}, {}>
withDisplayName returns an HOC that sideloads a displayName to a component
Parameters
Name | Type | Description |
---|
displayName | string | The displayName to be added |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:67
withFacet
▸ withFacet(cat
): (term
: string
) => (...hocs
: HOC
<{}, {}, {}>[]) => HOCWithMeta
<{}, {}, {}>
withFacet is expect to be passed to an on function and takes a term and and hoc (using curring)
and returns a Variant that can be used in the on function
Parameters
Name | Type | Description |
---|
cat | string | Category that the Component will be apart |
Returns
fn
▸ (term
): (...hocs
: HOC
<{}, {}, {}>[]) => HOCWithMeta
<{}, {}, {}>
Parameters
Returns
fn
▸ (...hocs
): HOCWithMeta
<{}, {}, {}>
Parameters
Name | Type |
---|
...hocs | HOC <{}, {}, {}>[] |
Returns
HOCWithMeta
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:122
withFlowContainerDefaultHtml
▸ withFlowContainerDefaultHtml(deserializers
, html?
): Enhancer
<{ html?
: string
}, {}>
Parameters
Returns
Enhancer
<{ html?
: string
}, {}>
Defined in
bodiless-layouts/src/deserializers/withFlowContainerDefaultHtml.tsx:24
withLibraryComponents
▸ withLibraryComponents(path?
, collection?
): HOCWithMeta
<{}, {}, {}>
Adds content library support to Bodiless flow container component to allow saving
item component with all its content.
withLibraryComponents provides flow container menu options for adding library name
and description. Also adding library design to flow container so it displays item component
with saved library type.
Parameters
Name | Type | Default value | Description |
---|
path | LibraryNodePath | DEFAULT_CONTENT_LIBRARY_PATH | user specified library node path for data storage. |
collection | string | DEFAULT_CONTENT_LIBRARY_COLLECTION | - |
Returns
HOCWithMeta
<{}, {}, {}>
Token
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryComponents.tsx:322
withLibraryItemContext
▸ withLibraryItemContext<P
>(C
): ComponentWithMeta
<PP
<P
, {}, {}>>
HOC that wraps component in LibraryItemProvider.
When wrapped in LibraryItemProvider
, it checks whether FlowContainerItem
is actually a Library Item by checking its FlowContainerItem.type
prefix.
see
LibraryItemContextProps
Type parameters
Parameters
Name | Type |
---|
C | ComponentOrTag <P > |
Returns
ComponentWithMeta
<PP
<P
, {}, {}>>
Defined in
bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:95
withMandatoryCategories
▸ withMandatoryCategories(categories
): Injector
<{ mandatoryCategories
: string
[] = categories }, object
>
Parameters
Name | Type |
---|
categories | string [] |
Returns
Injector
<{ mandatoryCategories
: string
[] = categories }, object
>
Defined in
bodiless-layouts/src/FlowContainer/index.tsx:45
withMeta
▸ withMeta(meta
): HOC
<{}, {}, {}>
withMeta creates an HOC that will add meta data to a React Component
Parameters
Name | Type | Description |
---|
meta | Object | the data to be side loaded in to the component |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:40
withTailwindClasses
▸ withTailwindClasses(tailwindConfig
): (classes
: string
) => WithTuples
withTailwindClasses returns a withTuple function that take the tailwind class and creates
tuples for each one of them.
Parameters
Name | Type | Description |
---|
tailwindConfig | Config | The Tailwind config to use for extraction of size data |
Returns
fn
▸ (classes
): WithTuples
Parameters
Returns
WithTuples
Defined in
bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:62
withTailwindWidthConstraints
▸ withTailwindWidthConstraints(config
): (classes
: string
) => Injector
<{ snapData
: SnapData
}, object
>
Parameters
Returns
fn
▸ (classes
): Injector
<{ snapData
: SnapData
}, object
>
Parameters
Returns
Injector
<{ snapData
: SnapData
}, object
>
Defined in
bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:185
withTerm
▸ withTerm(cat
): (term
: string
) => HOC
<{}, {}, {}>
withTerm returns a function that then takes a term and that returns an HOC that side loads
the category and term on to the component.
Parameters
Name | Type | Description |
---|
cat | string | that category to use in adding a term |
Returns
fn
▸ (term
): HOC
<{}, {}, {}>
Parameters
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:103
withTitle
▸ withTitle(title
): HOC
<{}, {}, {}>
with Title returns an HOC that sideloads a title to a component
Parameters
Name | Type | Description |
---|
title | string | The title to be added |
Returns
HOC
<{}, {}, {}>
Defined in
bodiless-layouts/src/meta/index.tsx:48
withTitleFromTerms
▸ withTitleFromTerms(ops?
): HOC
<{}, {}, {}>
Creates a token which adds a title
property to a component. This is derived from all
terms which have been applied to that component.
The new title will only be added if the component does not already have a title.
Parameters
Returns
HOC
<{}, {}, {}>
A token which adds a title.
Defined in
bodiless-layouts/src/meta/withTitleFromTerms.tsx:81
withTuple
▸ withTuple(media
): (width
: number
) => (className
: string
) => WithTuples
Curry function that returns a withTuple to be used a snapOptions function.
returns:
a Tuple with the given information
see
snapOptions
Parameters
Returns
fn
▸ (width
): (className
: string
) => WithTuples
Parameters
Returns
fn
▸ (className
): WithTuples
Parameters
Returns
WithTuples
Defined in
bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:44