Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'fix/cleanup' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
admturner committed Sep 9, 2022
2 parents e3626ee + f59e43d commit acb2694
Show file tree
Hide file tree
Showing 27 changed files with 62 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/blocks/accordion-heading/icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';
import { Path, SVG } from '@wordpress/components';

const icon = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
Expand Down
12 changes: 6 additions & 6 deletions src/blocks/button/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const {
import {
RichText,
getColorClassName,
useBlockProps,
__experimentalGetGradientClass,
__experimentalGetBorderClassesAndStyles: getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles: getColorClassesAndStyles,
__experimentalGetSpacingClassesAndStyles: getSpacingClassesAndStyles,
} = wp.blockEditor;
const { compose } = wp.compose;
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
} from '@wordpress/block-editor';
import { compose } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down
30 changes: 18 additions & 12 deletions src/blocks/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { useCallback, useEffect, useState, useRef } = wp.element;
const { Button, ButtonGroup, PanelBody, TextControl, ToolbarButton, Popover } =
wp.components;
const {
import { __ } from '@wordpress/i18n';
import { useCallback, useEffect, useState, useRef } from '@wordpress/element';
import {
Button,
ButtonGroup,
PanelBody,
TextControl,
ToolbarButton,
Popover,
} from '@wordpress/components';
import {
BlockControls,
InspectorControls,
RichText,
useBlockProps,
__experimentalUseBorderProps: useBorderProps,
__experimentalUseColorProps: useColorProps,
__experimentalGetSpacingClassesAndStyles: useSpacingProps,
__experimentalLinkControl: LinkControl,
} = wp.blockEditor;
const { displayShortcut, isKeyboardEvent } = wp.keycodes;
const { createBlock } = wp.blocks;
__experimentalUseBorderProps as useBorderProps,
__experimentalUseColorProps as useColorProps,
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
__experimentalLinkControl as LinkControl,
} from '@wordpress/block-editor';
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
import { createBlock } from '@wordpress/blocks';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/button/icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { Path, SVG } = wp.primitives;
import { Path, SVG } from '@wordpress/components';

export const icon = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/button/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down
10 changes: 5 additions & 5 deletions src/blocks/button/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const {
import {
RichText,
useBlockProps,
__experimentalGetBorderClassesAndStyles: getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles: getColorClassesAndStyles,
__experimentalGetSpacingClassesAndStyles: getSpacingClassesAndStyles,
} = wp.blockEditor;
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
} from '@wordpress/block-editor';

export default function save( { attributes, className } ) {
const { fontSize, linkTarget, rel, style, text, title, url, width } =
Expand Down
2 changes: 0 additions & 2 deletions src/blocks/button/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* stylelint-disable selector-class-pattern */
.wp-block-hrswp-button {
box-sizing: border-box;
}
Expand Down Expand Up @@ -139,4 +138,3 @@ main input[type="reset"] {
box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.1);
}
}
/* stylelint-enable selector-class-pattern */
2 changes: 1 addition & 1 deletion src/blocks/buttons/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const { InnerBlocks, useBlockProps } = wp.blockEditor;
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';

/**
* @param {Object} attributes Block's attributes.
Expand Down
8 changes: 4 additions & 4 deletions src/blocks/buttons/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const {
import {
useBlockProps,
useInnerBlocksProps,
store: blockEditorStore,
} = wp.blockEditor;
const { useSelect } = wp.data;
store as blockEditorStore,
} from '@wordpress/block-editor';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
Expand Down
2 changes: 0 additions & 2 deletions src/blocks/buttons/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
align-items: center;
}

/* stylelint-disable selector-class-pattern */
.wp-block-hrswp-buttons.is-vertical > .block-list-appender .block-list-appender__toggle {
justify-content: flex-start;
}
/* stylelint-enable selector-class-pattern */

.wp-block-hrswp-buttons > .wp-block-hrswp-button:focus {
box-shadow: none;
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/buttons/icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { Path, SVG } = wp.primitives;
import { Path, SVG } from '@wordpress/components';

export const buttons = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/buttons/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/buttons/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
const { useBlockProps, useInnerBlocksProps } = wp.blockEditor;
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';

export default function save( props ) {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/buttons/transforms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { createBlock } = wp.blocks;
import { createBlock } from '@wordpress/blocks';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/callout/icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { Path, SVG } = wp.components;
import { Path, SVG } from '@wordpress/components';

export default (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
Expand Down
4 changes: 4 additions & 0 deletions src/blocks/filter-section/block.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "hrswp/filter-section",
"title": "Filter Section",
"category": "widgets",
"description": "A single section of content to search within.",
"parent": [ "hrswp/filter" ],
"textdomain": "default",
"supports": {
"reusable": false
},
Expand Down
10 changes: 5 additions & 5 deletions src/blocks/filter-section/edit.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* WordPress dependencies
*/
const { sprintf, __ } = wp.i18n;
const { useSelect } = wp.data;
const {
import { sprintf, __ } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';
import {
InnerBlocks,
useBlockProps,
useInnerBlocksProps,
store: blockEditorStore,
} = wp.blockEditor;
store as blockEditorStore,
} from '@wordpress/block-editor';

function SearchFilterSectionEdit( { clientId } ) {
const { searchSectionIds, hasChildBlocks } = useSelect(
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/filter-section/icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { Path, SVG } = wp.components;
import { Path, SVG } from '@wordpress/components';

const search = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
Expand Down
7 changes: 0 additions & 7 deletions src/blocks/filter-section/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* WordPress dependencies
*/
const { __, _x } = wp.i18n;

/**
* Internal dependencies
*/
Expand All @@ -16,8 +11,6 @@ const { name } = metadata;
export { metadata, name };

export const settings = {
title: _x( 'Filter Section', 'block title' ),
description: __( 'A single section of content to search within.' ),
icon,
edit,
save,
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/filter-section/save.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { useInnerBlocksProps, useBlockProps } = wp.blockEditor;
import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';

export default function save() {
const blockProps = useBlockProps.save();
Expand Down
5 changes: 5 additions & 0 deletions src/blocks/filter/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "hrswp/filter",
"title": "Filter",
"category": "widgets",
"description": "Search and filter a section of content by full text.",
"keywords": [ "filter", "search" ],
"textdomain": "default",
"attributes": {
"retainHeadings": {
"type": "boolean",
Expand Down
5 changes: 1 addition & 4 deletions src/blocks/filter/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { __, _x } = wp.i18n;
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -15,10 +15,7 @@ const { name } = metadata;
export { metadata, name };

export const settings = {
title: _x( 'Filter', 'block title' ),
icon: 'filter',
description: __( 'Search and filter a section of content by full text.' ),
keywords: [ __( 'filter search' ) ],
example: {
innerBlocks: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/notification/icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { Path, SVG, Circle } = wp.components;
import { Path, SVG, Circle } from '@wordpress/components';

export default (
<SVG viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
Expand Down
2 changes: 0 additions & 2 deletions src/blocks/posts-list/editor.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* stylelint-disable selector-class-pattern */
.components-panel__body.hrswp-block-posts-list.taxonomy-filter {

& .taxonomy-filter--body {
Expand Down Expand Up @@ -72,4 +71,3 @@
}

}
/* stylelint-enable selector-class-pattern */
2 changes: 1 addition & 1 deletion src/blocks/posts-list/icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';
import { Path, SVG } from '@wordpress/components';

export const icon = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/blocks/posts-list/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* stylelint-disable selector-class-pattern */
.hrswp-block-posts-list__list-item {
margin-bottom: 0.7rem;
position: relative;
Expand Down Expand Up @@ -337,4 +336,3 @@
}

}
/* stylelint-enable selector-class-pattern */
2 changes: 1 addition & 1 deletion src/blocks/sidebar/transforms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
const { createBlock } = wp.blocks;
import { createBlock } from '@wordpress/blocks';

const transforms = {
from: [
Expand Down

0 comments on commit acb2694

Please sign in to comment.