Skip to content

Commit

Permalink
fixed Color Palette plugin saving custom colors, displaying default c…
Browse files Browse the repository at this point in the history
…olor picker dropdown
  • Loading branch information
nk-o committed Jun 5, 2024
1 parent 718885b commit 3c1436c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/gutenberg/editor-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/gutenberg/editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/gutenberg/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-rich-text', 'wp-token-list'), 'version' => 'c525ddb22a4c3a25f14a');
<?php return array('dependencies' => array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-rich-text', 'wp-token-list'), 'version' => '0c6f9293a853c3c6c0ab');
2 changes: 1 addition & 1 deletion build/gutenberg/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/gutenberg/plugins.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => 'b88f608c1e1dc1555346');
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '6861da5a16c3c8391dc1');
2 changes: 1 addition & 1 deletion build/gutenberg/plugins.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gutenberg/components/color-palette/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function useColors() {
export default function ColorPalette(props) {
const { value, alpha = false, palette = true, onChange = () => {} } = props;

const colors = palette ? useColors() : false;
const colors = palette ? useColors() : [];

return (
<ApplyFilters name="ghostkit.component.color-palette" props={props}>
Expand Down
8 changes: 7 additions & 1 deletion gutenberg/plugins/color-palette/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@
flex-wrap: wrap;

> .ghostkit-component-color-picker-wrapper {
margin-right: 10px;
margin-right: 5px;
margin-bottom: 0;

.ghostkit-component-color-toggle {
padding: 0;
border: none;
background: none;
}

> .components-base-control__field {
margin: 0;
}
Expand Down
3 changes: 2 additions & 1 deletion gutenberg/plugins/color-palette/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function () {

// Don't add custom palette if a block theme is activated.
if ( function_exists( 'wp_is_block_theme' ) && ! wp_is_block_theme() ) {
add_action( 'after_setup_theme', array( $this, 'add_palette' ), 9999 );
$this->add_palette();

add_action( 'enqueue_block_editor_assets', array( $this, 'add_palette_styles' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'add_palette_styles' ) );

Expand Down

0 comments on commit 3c1436c

Please sign in to comment.