Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

technote-space/gutenberg-utils

Repository files navigation

Gutenberg Utils

npm version CI Status codecov CodeFactor License: GPL v2+ WordPress: >=5.4

This is a gutenberg's utils.

Table of Contents

Details

Usage

  1. Install

    yarn add @technote-space/gutenberg-utils
  2. Use
    e.g. assets/gutenberg.js

    import { Components, Helpers } from '@technote-space/gutenberg-utils';
    
    const { Icon, DropdownButton } = Components;
    const { getActiveStyle, addActiveAttributes, setActiveStyle, onChangeStyle } = Helpers;
    const { isValidCustomColors, isValidCustomFontSizes, getColors, getFontSizes } = Helpers;
  3. Compile and enqueue script

    <script type="text/javascript" src="/assets/gutenberg.js"></script>

dependencies

  • wp-block-editor
  • wp-components
  • wp-data
  • wp-element
  • wp-i18n
  • wp-rich-text
  • wp-url
  • lodash

Author

GitHub (Technote)
Blog