Skip to main content

Aliases

docs-source

We have created a lot of helpful aliases that you can use in your project.

EightshiftBlocksWhatwgFetch

Alias providing Whatwg-fetch.

import 'EightshiftBlocksWhatwgFetch';

EightshiftBlocksSwiper

Alias providing Swiper.

import 'EightshiftBlocksSwiper';

EightshiftBlocksSwiperIE

Alias providing Swiper but for IE11 version.

import 'EightshiftBlocksSwiperIE';

EightshiftBlocksBabelPolyfill

Alias providing Babel Polyfill.

import 'EightshiftBlocksBabelPolyfill';

EightshiftBlocksAutoprefixer

Alias providing Autoprefixer.

import 'EightshiftBlocksAutoprefixer';

EightshiftBlocksNormalize

Alias providing Normalize. Check documentation for more details.

@import 'EightshiftBlocksNormalize';
@include normalize(); // stylelint-disable-line at-rule-empty-line-before

EightshiftBlocksMediaBlender

Alias providing Media Blender. Check documentation for more details.

@import 'EightshiftBlocksMediaBlender';

EightshiftBlocksSwiperStyle

Alias providing Swiper.

@import 'EightshiftBlocksSwiperStyle';

EightshiftBlocksDynamicImport

To get (require) all the files using the require.context method, we created a helper located here.

It will find all files recursively in the folder using a regex. The following example will require all assets/index.js files inside the custom folder, so there is no need to add the files to the build manually.

import { dynamicImport } from 'EightshiftBlocksDynamicImport';

dynamicImport(require.context('./../../custom', true, /assets\/index.js$/));

EightshiftBlocksRegisterBlocks

Alias providing blocks registration. For more details check here.

EightshiftBlocksUcfirst

Converts the first letter of a string to uppercase.

import { ucfirst } from 'EightshiftBlocksUcfirst';

ucfirst('custom string');

EightshiftBlocksGetActions

Alias providing blocks actions helper. For more details check here.

EightshiftBlocksUtilityHelpersPath

We have also created a bunch of JavaScript helpers located in the helpers folder.

This alias provides only path to the helpers folder.

import { media } from 'EightshiftBlocksUtilityHelpersPath/media';

EightshiftFrontendLibs

Alias providing Eightshift Frontend Libs.

@import 'EightshiftFrontendLibs';

EightshiftEditorStyleOverride

It provides the Block Editor overrides on some styles to give better UX for our block.

@import 'EightshiftEditorStyleOverride';

EightshiftComponentColorPalette

Alias providing custom React component. For more details check here.

EightshiftComponentHeadingLevel

Alias providing custom React component. For more details check here.