Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bodiless/layouts

Package Overview
Dependencies
Maintainers
5
Versions
520
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bodiless/layouts

Layout managers for BodilessJS.

  • 1.0.0-canary-2055-1134.0.0a6933a
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-60%
Maintainers
5
Weekly downloads
 
Created
Source

@bodiless/layouts

@bodiless/layouts

Table of contents

Namespaces

  • SlateSortableResizable

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
NameType
Pany
Defined in

bodiless-layouts/src/ComponentSelector/types.tsx:70


ComponentWithPartialMeta

Ƭ ComponentWithPartialMeta<P>: ComponentType<P> & Partial<Meta>

Type parameters
NameType
Pany
Defined in

bodiless-layouts/src/ComponentSelector/types.tsx:71


CreateFlowContainerItem

Ƭ CreateFlowContainerItem: (args: CreateFlowContainerItemArgs) => FlowContainerItem

Type declaration

▸ (args): FlowContainerItem

Parameters
NameType
argsCreateFlowContainerItemArgs
Returns

FlowContainerItem

Defined in

bodiless-layouts/src/deserializers/createFlowContainerItem.ts:28


CreateFlowContainerItemArgs

Ƭ CreateFlowContainerItemArgs: Object

Type declaration
NameType
elementElement | Element[]
elementIndexnumber
typestring
Defined in

bodiless-layouts/src/deserializers/createFlowContainerItem.ts:23


DeserializeElement

Ƭ DeserializeElement: (args: DeserializeElementArgs) => FlowContainerData

Type declaration

▸ (args): FlowContainerData

Parameters
NameType
argsDeserializeElementArgs
Returns

FlowContainerData

Defined in

bodiless-layouts/src/deserializers/htmlDeserializer.ts:35


Deserializer

Ƭ Deserializer: Object

Type declaration
NameType
mergeboolean
typestring
deserialize(item: FlowContainerItem, elements: Element[]) => FlowContainerItemData
map(elements: Element[], elementIndex: number) => FlowContainerItem
match(element: Element) => boolean
Defined in

bodiless-layouts/src/deserializers/deserializer.ts:21


FinalUI

Ƭ FinalUI: Object

Type declaration
NameType
AccordionCheckBoxComponentType<HTMLProps<HTMLInputElement>> | string
AccordionCheckboxLabelComponentType<HTMLProps<HTMLLabelElement>> | string
AccordionCheckboxLabelTextComponentType<HTMLProps<HTMLSpanElement>> | string
AccordionCheckboxWrapperComponentType<HTMLProps<HTMLDivElement>> | string
AccordionIconContractComponentType<HTMLProps<HTMLSpanElement>> | string
AccordionIconExpandComponentType<HTMLProps<HTMLSpanElement>> | string
AccordionItemWrapperComponentType<HTMLProps<HTMLAnchorElement>> | string
AccordionLabelComponentType<HTMLProps<HTMLLabelElement>> | string
AccordionWrapperComponentType<HTMLProps<HTMLDivElement>> | string
CloseMenuIconComponentType<HTMLProps<HTMLSpanElement>> | string
ComponentDescriptionIconComponentType<HTMLProps<HTMLDivElement>> | string
ComponentDescriptionStyleComponentType<HTMLProps<HTMLDivElement>> | string
ComponentDescriptionWrapperComponentType<HTMLProps<HTMLDivElement>> | string
ComponentLinkWrapperComponentType<HTMLProps<HTMLAnchorElement>> | string
ComponentPreviewStyleComponentType<HTMLProps<HTMLImageElement>> | string
ComponentSelectButtonComponentType<HTMLProps<HTMLButtonElement>> | string
ComponentSelectorWrapperComponentType<HTMLProps<HTMLDivElement>> | string
ComponentTitleWrapperComponentType<HTMLProps<HTMLHeadingElement>> | string
FlexSectionComponentType<HTMLProps<HTMLDivElement>> | string
FlexSectionFullComponentType<HTMLProps<HTMLDivElement>> | string
FlowContainerEmptyComponentType<HTMLProps<HTMLDivElement>> | string
GridListBoxComponentType<HTMLProps<HTMLDivElement>> | string
GridListBoxInnerComponentType<HTMLProps<HTMLDivElement>> | string
GridListBoxWrapperComponentType<HTMLProps<HTMLDivElement>> | string
IconWrapperComponentType<HTMLProps<HTMLSpanElement>> | string
ItemBoxComponentType<HTMLProps<HTMLDivElement>> | string
ItemBoxWrapperComponentType<HTMLProps<HTMLDivElement>> | string
MasterWrapperComponentType<HTMLProps<HTMLDivElement>> | string
ScalingButtonFullComponentType<HTMLProps<HTMLElement>> | string
ScalingButtonHalfComponentType<HTMLProps<HTMLElement>> | string
ScalingButtonQuarterComponentType<HTMLProps<HTMLElement>> | string
ScalingHeaderComponentType<HTMLProps<HTMLDivElement>> | string
SearchBarComponentType<HTMLProps<HTMLInputElement>> | string
SearchBarWrapperComponentType<HTMLProps<HTMLDivElement>> | string
SubmitButtonComponentType<HTMLProps<HTMLButtonElement>> | string
TitleWrapperComponentType<HTMLProps<HTMLSpanElement>> | string
Defined in

bodiless-layouts/src/ComponentSelector/types.tsx:95


FlowContainerItem

Ƭ FlowContainerItem: Object

Type declaration
NameType
typestring
uuidstring
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
NameType
itemCountnumber
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
NameTypeDescription
blacklistCategories?string[]List of categories which should never be shown in the filters.
componentsComponentWithMeta[]An array of components with metadata (at leassts displayName, title, description)
scale?ComponentSelectorScaleInitial scale
onSelect(names: string[]) => voidCallback 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
NameType
isLibraryItemboolean
setIsLibraryItemReact.Dispatch<React.SetStateAction<boolean>>
Defined in

bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:47


LibraryItemProviderProps

Ƭ LibraryItemProviderProps: Object

Flow Container Library Item Provider Props.

Type declaration
NameType
isLibraryboolean
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
NameTypeDescription
categories?CategoriesCategory and value pairs for facets
descriptionstringDescription to display in the item selector
displayNamestringdefault static prop for react component to distingush it in the render tree
titlestringTitle 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
NameTypeDescription
componentsDesignableComponentsThe components needed to render the flow container itself
selectableComponentsDesignableComponentsThe 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
NameType
DefaultComponentComponentOrTag<any>
designDesign
selectedComponentsstring[]
startComponents?DesignableComponents
Defined in

bodiless-layouts/src/ComponentSelector/SelectorComponents.tsx:41


SortableResizableProps

Ƭ SortableResizableProps: Object

Type declaration
NameType
childrenReact.ReactNode
classNamestring
defaultSize?{ height?: string | number ; width?: string | number }
defaultSize.height?string | number
defaultSize.width?string | number
direction?string
isEnabledboolean
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
NameTypeDescription
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?stringTerm separator
createTitleSegment?(category: string, term: string) => stringFunction 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
NameType
LTRLanguageDirection
RTLLanguageDirection
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
NameType
propsSlateSortableResizableProps
Returns

Element

Type declaration
NameType
defaultProps{ defaultSize: { height: string = ''; width: string = '' } ; onResize: () => void }
defaultProps.defaultSize{ height: string = ''; width: string = '' }
defaultProps.defaultSize.heightstring
defaultProps.defaultSize.widthstring
defaultProps.onResize() => void
displayNamestring
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
NameType
propsSortableChildProps
Returns

Element

Defined in

bodiless-layouts/src/FlowContainer/SortableChild.tsx:30


asPassThough

asPassThough(Component): CTWM

Parameters
NameType
ComponentCTWM
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
NameTypeDescription
propsComponentSelectorFormPropsProps passed to the edit flow container.
Returns

fn

▸ (props): Element

Parameters
NameType
propsOmit<ContextMenuFormProps, "children">
Returns

Element

Defined in

bodiless-layouts/src/ComponentSelector/componentSelectorForm.tsx:32


createDefaultDeserializer

createDefaultDeserializer(type): Deserializer

Parameters
NameType
typestring
Returns

Deserializer

Defined in

bodiless-layouts/src/deserializers/defaultDeserializers.ts:21


createFlowContainerItem

createFlowContainerItem(args): FlowContainerItem

Parameters
NameType
argsCreateFlowContainerItemArgs
Returns

FlowContainerItem

Defined in

bodiless-layouts/src/deserializers/createFlowContainerItem.ts:36


createListDeserializer

createListDeserializer(type, linkKey, titleKey): Deserializer

Parameters
NameType
typestring
linkKeystring
titleKeystring
Returns

Deserializer

Defined in

bodiless-layouts/src/deserializers/listDeserializer.ts:64


deserializeHtml

deserializeHtml(html, deserializers, domParser?): FlowContainerData

Parameters
NameType
htmlstring
deserializersDeserializer[]
domParser?DOMParser
Returns

FlowContainerData

Defined in

bodiless-layouts/src/deserializers/htmlDeserializer.ts:71


deserializeList

deserializeList(linkKey, titleKey): (item: FlowContainerItem, elements: Element[]) => ListData

Parameters
NameType
linkKeystring
titleKeystring
Returns

fn

▸ (item, elements): ListData

Parameters
NameType
itemFlowContainerItem
elementsElement[]
Returns

ListData

Defined in

bodiless-layouts/src/deserializers/listDeserializer.ts:23


generateUuid

generateUuid(content, index): string

Parameters
NameType
contentstring
indexnumber
Returns

string

Defined in

bodiless-layouts/src/deserializers/createFlowContainerItem.ts:30


getSnapFrom

getSnapFrom(...withTuples): SnapData

Parameters
NameType
...withTuplesWithTuples[]
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
NameType
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>
...tHOCDef<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
NameType
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>
...tHOCDef<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
NameTypeDescription
itemFlowContainerItemFlowContainerItem
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
NameTypeDescription
hocHOC<{}, {}, {}>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
NameType
propsPartial<SelectorComponentsProps>
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
NameTypeDescription
opsWithTitleFromTermsPropsOptions defining how the title should be created.
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
NameTypeDescription
newDescriptionstringthe 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
NameTypeDescription
newDisplayNamestringthe 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
NameType
newTitlestring
Returns

HOC<{}, {}, {}>

Defined in

bodiless-layouts/src/meta/index.tsx:56


withContentLibrary

withContentLibrary(options): <P>(Component: ComponentOrTag<P>) => any

Parameters
NameType
optionsContentLibraryOptions
Returns

fn

▸ <P>(Component): any

Type parameters
NameType
Pextends object
Parameters
NameType
ComponentComponentOrTag<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
NameTypeDescription
descriptionstringthe description to add
Returns

HOC<{}, {}, {}>

Defined in

bodiless-layouts/src/meta/index.tsx:85


withDirection

withDirection(langDirection): Injector<{ direction: Direction = langDirection }, object>

Parameters
NameType
langDirectionDirection
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
NameTypeDescription
displayNamestringThe 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
NameTypeDescription
catstringCategory that the Component will be apart
Returns

fn

▸ (term): (...hocs: HOC<{}, {}, {}>[]) => HOCWithMeta<{}, {}, {}>

Parameters
NameType
termstring
Returns

fn

▸ (...hocs): HOCWithMeta<{}, {}, {}>

Parameters
NameType
...hocsHOC<{}, {}, {}>[]
Returns

HOCWithMeta<{}, {}, {}>

Defined in

bodiless-layouts/src/meta/index.tsx:122


withFlowContainerDefaultHtml

withFlowContainerDefaultHtml(deserializers, html?): Enhancer<{ html?: string }, {}>

Parameters
NameType
deserializersDeserializer[]
html?string
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
NameTypeDefault valueDescription
pathLibraryNodePathDEFAULT_CONTENT_LIBRARY_PATHuser specified library node path for data storage.
collectionstringDEFAULT_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
NameType
Pextends any
Parameters
NameType
CComponentOrTag<P>
Returns

ComponentWithMeta<PP<P, {}, {}>>

Defined in

bodiless-layouts/src/ContentLibrary/withLibraryContext.tsx:95


withMandatoryCategories

withMandatoryCategories(categories): Injector<{ mandatoryCategories: string[] = categories }, object>

Parameters
NameType
categoriesstring[]
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
NameTypeDescription
metaObjectthe 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
NameTypeDescription
tailwindConfigConfigThe Tailwind config to use for extraction of size data
Returns

fn

▸ (classes): WithTuples

Parameters
NameType
classesstring
Returns

WithTuples

Defined in

bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:62


withTailwindWidthConstraints

withTailwindWidthConstraints(config): (classes: string) => Injector<{ snapData: SnapData }, object>

Parameters
NameType
configany
Returns

fn

▸ (classes): Injector<{ snapData: SnapData }, object>

Parameters
NameType
classesstring
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
NameTypeDescription
catstringthat category to use in adding a term
Returns

fn

▸ (term): HOC<{}, {}, {}>

Parameters
NameType
termstring
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
NameTypeDescription
titlestringThe 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
NameTypeDescription
opsWithTitleFromTermsPropsOptions for generating the title.
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
NameType
mediastring
Returns

fn

▸ (width): (className: string) => WithTuples

Parameters
NameType
widthnumber
Returns

fn

▸ (className): WithTuples

Parameters
NameType
classNamestring
Returns

WithTuples

Defined in

bodiless-layouts/src/FlowContainer/utils/appendTailwindWidthClass.ts:44

FAQs

Package last updated on 08 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc