Utility functions
The utility functions help with retrieving commonly stored data in a content type. For example, the getAdvanced(node)
wrapper function retrieves all the content type's Advanced form section settings so you do not have to worry about retrieving each one separately. Retrieving background images and associated properties is also made easy with the getBackgroundImages(node)
function.
Functions
- getBackgroundImages(node) ⇒
Object
Retrieve background images from a master format node
- getVerticalAlignment(node) ⇒
Object
Retrieve vertical alignment from a master format node
- verticalAlignmentToFlex(alignment) ⇒
\*
Convert vertical alignment values to flex values
- flexToVerticalAlignment(flex) ⇒
\*
Convert flex to vertical alignment values
- getAdvanced(node) ⇒
Object
Retrieve advanced props from content type node
- getPadding(node) ⇒
Object
Retrieve the padding from a content type node
- getMargin(node) ⇒
Object
Retrieve the margin from a content type node
- getBorder(node) ⇒
Object
Retrieve the border from a content type node
- getTextAlign(node) ⇒
Object
Retrieve the text align from a content type node
- getCssClasses(node) ⇒
Object
Retrieve the CSS classes from a content type node
- getIsHidden(node) ⇒
Object
Retrieve if CSS display property is set to none from a content type node
- cssToJSXStyle(style) ⇒
Object
Converts a CSS string style into a JSX object inline style
- getMediaQueries(node, mediaQueries) ⇒
Object
Retrieve media queries from a master format node
Retrieve background images from a master format node
Returns: Parameters
Name |
---|
node |
Retrieve vertical alignment from a master format node
Returns: Parameters
Name |
---|
node |
Convert vertical alignment values to flex values
Returns: Parameters
Name |
---|
alignment |
Convert flex to vertical alignment values
Returns: Parameters
Name |
---|
flex |
Retrieve advanced props from content type node
Returns: Parameters
Name |
---|
node |
Retrieve the padding from a content type node
Returns: Parameters
Name |
---|
node |
Retrieve the margin from a content type node
Returns: Parameters
Name |
---|
node |
Retrieve the border from a content type node
Returns: Parameters
Name |
---|
node |
Retrieve the text align from a content type node
Returns: Parameters
Name |
---|
node |
Retrieve the CSS classes from a content type node
Returns: Parameters
Name |
---|
node |
Retrieve if CSS display property is set to none from a content type node
Returns: Parameters
Name |
---|
node |
Converts a CSS string style into a JSX object inline style
Returns: Parameters
Name | Type |
---|---|
style | String |
Retrieve media queries from a master format node
Returns: Parameters
Name | Type |
---|---|
node | |
mediaQueries | Array |
Source Code: pwa-studio/packages/pagebuilder/lib/utils.js