Skip to content

Commit

Permalink
fix #824
Browse files Browse the repository at this point in the history
  • Loading branch information
inc2734 committed Sep 7, 2024
1 parent 476a4e1 commit 22c67a6
Show file tree
Hide file tree
Showing 15 changed files with 2 additions and 246 deletions.
9 changes: 0 additions & 9 deletions src/blocks/accordion/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import {

import { useSelect } from '@wordpress/data';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/accordion-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/accordion-item' ] ];

export default function ( { attributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/accordion--item',
newBlockName: 'snow-monkey-blocks/accordion-item',
},
] );

const { templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
19 changes: 1 addition & 18 deletions src/blocks/directory-structure/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [
'snow-monkey-blocks/directory-structure-item-directory',
'snow-monkey-blocks/directory-structure-item-file',
Expand All @@ -22,22 +20,7 @@ const ALLOWED_BLOCKS = [
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
const { iconColor } = attributes;

useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName:
'snow-monkey-blocks/directory-structure--item--directory',
newBlockName:
'snow-monkey-blocks/directory-structure-item-directory',
},
{
oldBlockName: 'snow-monkey-blocks/directory-structure--item--file',
newBlockName: 'snow-monkey-blocks/directory-structure-item-file',
},
] );

const { templateLock } = attributes;
const { iconColor, templateLock } = attributes;

const hasInnerBlocks = useSelect(
( select ) =>
Expand Down
14 changes: 0 additions & 14 deletions src/blocks/directory-structure/item/directory/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import FontAwesome from '@smb/component/font-awesome';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [
'snow-monkey-blocks/directory-structure-item-directory',
Expand All @@ -31,19 +30,6 @@ const ALLOWED_BLOCKS = [
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName:
'snow-monkey-blocks/directory-structure--item--directory',
newBlockName:
'snow-monkey-blocks/directory-structure-item-directory',
},
{
oldBlockName: 'snow-monkey-blocks/directory-structure--item--file',
newBlockName: 'snow-monkey-blocks/directory-structure-item-file',
},
] );

const hasInnerBlocks = useSelect(
( select ) =>
!! select( 'core/block-editor' ).getBlock( clientId )?.innerBlocks
Expand Down
9 changes: 0 additions & 9 deletions src/blocks/faq/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import {

import { useSelect } from '@wordpress/data';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/faq-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/faq-item' ] ];

export default function ( { attributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/faq--item',
newBlockName: 'snow-monkey-blocks/faq-item',
},
] );

const { templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
9 changes: 0 additions & 9 deletions src/blocks/information/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,12 @@ import {
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/information-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/information-item' ] ];

import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/information--item',
newBlockName: 'snow-monkey-blocks/information-item',
},
] );

const hasInnerBlocks = useSelect(
( select ) =>
!! select( 'core/block-editor' ).getBlock( clientId )?.innerBlocks
Expand Down
24 changes: 0 additions & 24 deletions src/blocks/items/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { toNumber } from '@smb/helper';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';
import ResponsiveTabPanel from '@smb/component/responsive-tab-panel';

const ALLOWED_BLOCKS = [
Expand All @@ -42,29 +41,6 @@ const HORIZONTAL_JUSTIFY_CONTROLS = [
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/items--item--standard',
newBlockName: 'snow-monkey-blocks/items-item-standard',
},
{
oldBlockName: 'snow-monkey-blocks/items--banner',
newBlockName: 'snow-monkey-blocks/items-banner',
},
{
oldBlockName: 'snow-monkey-blocks/items--item--block-link',
newBlockName: 'snow-monkey-blocks/items-item-block-link',
},
{
oldBlockName: 'snow-monkey-blocks/items--item--free',
newBlockName: 'snow-monkey-blocks/items-item-free',
},
{
oldBlockName: 'snow-monkey-blocks/items--item',
newBlockName: 'snow-monkey-blocks/items-item',
},
] );

const {
sm,
md,
Expand Down
16 changes: 0 additions & 16 deletions src/blocks/panels/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { toNumber } from '@smb/helper';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';
import ResponsiveTabPanel from '@smb/component/responsive-tab-panel';

const ALLOWED_BLOCKS = [
Expand All @@ -41,21 +40,6 @@ const HORIZONTAL_JUSTIFY_CONTROLS = [
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/panels--item--free',
newBlockName: 'snow-monkey-blocks/panels-item-free',
},
{
oldBlockName: 'snow-monkey-blocks/panels--item--horizontal',
newBlockName: 'snow-monkey-blocks/panels-item-horizontal',
},
{
oldBlockName: 'snow-monkey-blocks/panels--item',
newBlockName: 'snow-monkey-blocks/panels-item',
},
] );

const {
sm,
md,
Expand Down
9 changes: 0 additions & 9 deletions src/blocks/price-menu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import {

import { useSelect } from '@wordpress/data';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/price-menu-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/price-menu-item' ] ];

export default function ( { attributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/price-menu--item',
newBlockName: 'snow-monkey-blocks/price-menu-item',
},
] );

const { templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
9 changes: 0 additions & 9 deletions src/blocks/pricing-table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { useEffect } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/pricing-table-item' ];
const TEMPLATE = [
[ 'snow-monkey-blocks/pricing-table-item' ],
Expand All @@ -28,13 +26,6 @@ const TEMPLATE = [
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/pricing-table--item',
newBlockName: 'snow-monkey-blocks/pricing-table-item',
},
] );

const { columnSize, childrenCount, templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
9 changes: 0 additions & 9 deletions src/blocks/rating-box/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import {

import { useSelect } from '@wordpress/data';

import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/rating-box-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/rating-box-item' ] ];

export default function ( { attributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/rating-box--item',
newBlockName: 'snow-monkey-blocks/rating-box-item',
},
] );

const { templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
8 changes: 0 additions & 8 deletions src/blocks/slider/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { toNumber } from '@smb/helper';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';
import ResponsiveTabPanel from '@smb/component/responsive-tab-panel';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/slider-item' ];
Expand All @@ -28,13 +27,6 @@ const TEMPLATE = [ [ 'snow-monkey-blocks/slider-item' ] ];
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/slider--item',
newBlockName: 'snow-monkey-blocks/slider-item',
},
] );

const {
slidesToShow,
slidesToScroll,
Expand Down
13 changes: 1 addition & 12 deletions src/blocks/step/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,12 @@ import {
} from '@wordpress/block-editor';

import { useSelect } from '@wordpress/data';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [
// 'snow-monkey-blocks/step--item',
'snow-monkey-blocks/step-item-free',
];
const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/step-item-free' ];

const TEMPLATE = [ [ 'snow-monkey-blocks/step-item-free' ] ];

export default function ( { attributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/step--item--free',
newBlockName: 'snow-monkey-blocks/step-item-free',
},
] );

const { templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
8 changes: 0 additions & 8 deletions src/blocks/testimonial/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { toNumber } from '@smb/helper';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';
import ResponsiveTabPanel from '@smb/component/responsive-tab-panel';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/testimonial-item' ];
Expand All @@ -27,13 +26,6 @@ const TEMPLATE = [ [ 'snow-monkey-blocks/testimonial-item' ] ];
import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/testimonial--item',
newBlockName: 'snow-monkey-blocks/testimonial-item',
},
] );

const { md, lg, gap, templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
8 changes: 0 additions & 8 deletions src/blocks/thumbnail-gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,13 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

import { toNumber } from '@smb/helper';
import { useMigrateDoubleHyphenToSingleHyphen } from '@smb/hooks';

const ALLOWED_BLOCKS = [ 'snow-monkey-blocks/thumbnail-gallery-item' ];
const TEMPLATE = [ [ 'snow-monkey-blocks/thumbnail-gallery-item' ] ];

import metadata from './block.json';

export default function ( { attributes, setAttributes, className, clientId } ) {
useMigrateDoubleHyphenToSingleHyphen( clientId, [
{
oldBlockName: 'snow-monkey-blocks/thumbnail-gallery--item',
newBlockName: 'snow-monkey-blocks/thumbnail-gallery-item',
},
] );

const { arrows, speed, autoplaySpeed, templateLock } = attributes;

const hasInnerBlocks = useSelect(
Expand Down
Loading

0 comments on commit 22c67a6

Please sign in to comment.