+
{ category.label }
) : (
diff --git a/src/animation/editor.js b/src/animation/editor.js
index c66843523..c23c58d3d 100644
--- a/src/animation/editor.js
+++ b/src/animation/editor.js
@@ -7,22 +7,22 @@ import {
Button,
PanelBody,
SelectControl,
- ToggleControl
+ ToggleControl,
+ __experimentalUnitControl as UnitControl
} from '@wordpress/components';
import {
Fragment,
useState,
- useEffect
+ useEffect,
+ memo
} from '@wordpress/element';
import { applyFilters } from '@wordpress/hooks';
-import { __experimentalUnitControl as UnitControl } from '@wordpress/components';
-
/**
- * Internal dependencies.
- */
+ * Internal dependencies.
+ */
import {
animationsList,
delayList,
@@ -44,17 +44,16 @@ const AnimationType = {
default: 'default'
};
-import { memo } from '@wordpress/element';
import { useCSSNode } from '../blocks/helpers/block-utility.js';
/**
* Update the animation config.
*
- * @param {string} type The type of animation. (e.g. count, typing, default)
- * @param {string|undefined} oldValue The old value of the animation.
- * @param {string|undefined} newValue The new value of the animation.
- * @param {Function|undefined} callback The callback function which will be called after the animation is updated.
- * @param {Object} attributes The attributes of the block.
+ * @param {string} type The type of animation. (e.g. count, typing, default)
+ * @param {string|undefined} oldValue The old value of the animation.
+ * @param {string|undefined} newValue The new value of the animation.
+ * @param {Function|undefined} callback The callback function which will be called after the animation is updated.
+ * @param {Object} attributes The attributes of the block.
* @param {(x: Object) => void} setAttributes The setAttributes function of the block.
*/
export const updateAnimConfig = ( type, oldValue, newValue, callback, attributes, setAttributes ) => {
@@ -136,7 +135,7 @@ function AnimationControls({
const updateAnimation = ( e ) => {
let classes;
- let animationValue = 'none' !== e ? e : '';
+ const animationValue = 'none' !== e ? e : '';
if ( attributes.className ) {
classes = attributes.className;
@@ -179,7 +178,7 @@ function AnimationControls({
setAnimation( e );
setAttributes({ className: classes });
- let block = document.querySelector( `#block-${ clientId } .animated` ) || document.querySelector( `#block-${ clientId }.animated` );
+ const block = document.querySelector( `#block-${ clientId } .animated` ) || document.querySelector( `#block-${ clientId }.animated` );
if ( block ) {
outAnimation.forEach( ( i ) => {
diff --git a/src/animation/frontend.js b/src/animation/frontend.js
index 0025671f0..614a2ac6c 100644
--- a/src/animation/frontend.js
+++ b/src/animation/frontend.js
@@ -272,7 +272,7 @@ const animateElements = () => {
};
const isElementInViewport = ( el ) => {
- let scroll = window.scrollY || window.pageYOffset;
+ const scroll = window.scrollY || window.pageYOffset;
const offset = calculateOffset( getTriggerOffset( el ) );
const boundsTop = el.getBoundingClientRect().top + scroll + offset;
diff --git a/src/animation/frontend/count/index.js b/src/animation/frontend/count/index.js
index 7ebbc74aa..c510ce8be 100644
--- a/src/animation/frontend/count/index.js
+++ b/src/animation/frontend/count/index.js
@@ -19,10 +19,10 @@ const speedConfig = {
/**
* Get the configuration option from the element CSS classes.
* @param {HTMLDivElement} elem
- * @returns Configuration options.
+ * @return Configuration options.
*/
const getConfiguration = ( elem ) => {
- let parent = elem.parentElement;
+ const parent = elem.parentElement;
for ( let i = 0; i < MAX_PARENT_SEARCH; ++i ) {
if ( Array.from( parent.classList ).some( o => o.includes( 'o-count-' ) ) ) {
const arr = Array.from( parent.classList );
@@ -52,7 +52,7 @@ const NUMBER_EXTRA_FORMAT = new Set( Array.from( ',' ) );
/**
* Extract the number, prefix, and suffix.
* @param {string} text The selected text
- * @returns An object with the number, prefix and suffix
+ * @return An object with the number, prefix and suffix
*/
const extract = ( text ) => {
const arr = Array.from( text );
@@ -64,7 +64,7 @@ const extract = ( text ) => {
let isPrefix = true;
let isSuffix = false;
- for ( let x of arr ) {
+ for ( const x of arr ) {
if ( NUMERIC_FORMATS.has( x ) ) {
if ( isPrefix ) {
isPrefix = false;
@@ -76,15 +76,13 @@ const extract = ( text ) => {
} else {
number.push( x );
}
+ } else if ( isPrefix ) {
+ prefix.push( x );
} else {
- if ( isPrefix ) {
- prefix.push( x );
- } else {
- if ( ! isSuffix ) {
- isSuffix = true;
- }
- suffix.push( x );
+ if ( ! isSuffix ) {
+ isSuffix = true;
}
+ suffix.push( x );
}
}
diff --git a/src/animation/frontend/typing/index.js b/src/animation/frontend/typing/index.js
index cd4fae4fd..381c99e59 100644
--- a/src/animation/frontend/typing/index.js
+++ b/src/animation/frontend/typing/index.js
@@ -22,10 +22,10 @@ const speedConfig = {
/**
* Get the configuration option from the element CSS classes.
* @param {HTMLDivElement} elem
- * @returns Configuration options.
+ * @return Configuration options.
*/
const getConfiguration = ( elem ) => {
- let parent = elem.parentElement;
+ const parent = elem.parentElement;
for ( let i = 0; i < MAX_PARENT_SEARCH; ++i ) {
if ( Array.from( parent.classList ).some( o => o.includes( 'o-typing-' ) ) ) {
const arr = Array.from( parent.classList );
diff --git a/src/animation/index.js b/src/animation/index.js
index a80ae6971..b21fea478 100644
--- a/src/animation/index.js
+++ b/src/animation/index.js
@@ -18,8 +18,8 @@ import { addFilter } from '@wordpress/hooks';
import { select } from '@wordpress/data';
/**
- * Internal dependencies.
- */
+ * Internal dependencies.
+ */
import './editor.scss';
import Edit from './editor.js';
diff --git a/src/animation/utils.js b/src/animation/utils.js
index 018f5ae1d..edb3e12a2 100644
--- a/src/animation/utils.js
+++ b/src/animation/utils.js
@@ -1,8 +1,8 @@
/**
* Create utility functions for an interval timer.
- * @param {number} duration The duration, in seconds.
+ * @param {number} duration The duration, in seconds.
* @param {number} deltaTime The time between two time ticks, in seconds.
- * @returns Utility functions.
+ * @return Utility functions.
*/
export const makeInterval = ( duration, deltaTime ) => {
@@ -21,7 +21,7 @@ export const makeInterval = ( duration, deltaTime ) => {
/**
* Start the interval. Get a callback function that execute at every tick and the one that execute at the end.
- * @param {Function} callback Function that execute at every tick.
+ * @param {Function} callback Function that execute at every tick.
* @param {Function} endCallback Function that execute at the end.
*/
const start = ( callback, endCallback ) => {
@@ -45,7 +45,7 @@ export const makeInterval = ( duration, deltaTime ) => {
/**
* Specify a function to execute when the DOM is fully loaded.
*
- * @param {Callback} callback A function to execute after the DOM is ready.
+ * @param {()=>{}} callback A function to execute after the DOM is ready.
* @return {void}
*/
export const domReady = ( callback ) => {
diff --git a/src/blocks/blocks/accordion/group/edit.js b/src/blocks/blocks/accordion/group/edit.js
index a1096d140..5399ca46a 100644
--- a/src/blocks/blocks/accordion/group/edit.js
+++ b/src/blocks/blocks/accordion/group/edit.js
@@ -42,7 +42,7 @@ const PREFIX_TO_FAMILY = {
/**
* Accordion Group component
* @param {import('./types').AccordionGroupProps} props
- * @returns
+ * @return
*/
const Edit = ({
name,
diff --git a/src/blocks/blocks/accordion/group/inspector.js b/src/blocks/blocks/accordion/group/inspector.js
index 4029e35c0..efc7a6c48 100644
--- a/src/blocks/blocks/accordion/group/inspector.js
+++ b/src/blocks/blocks/accordion/group/inspector.js
@@ -72,7 +72,7 @@ const gapCompatibility = {
/**
*
* @param {import('./types.js').AccordionGroupInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
clientId,
@@ -137,7 +137,7 @@ const Inspector = ({
const changeBoxShadow = data => {
const boxShadow = { ...attributes.boxShadow };
- Object.entries( data ).map( ([ key, val ] = data ) => {
+ Object.entries( data ).forEach( ([ key, val ] = data ) => {
boxShadow[key] = val;
});
diff --git a/src/blocks/blocks/accordion/item/edit.js b/src/blocks/blocks/accordion/item/edit.js
index 2eec9702c..221a4e8f7 100644
--- a/src/blocks/blocks/accordion/item/edit.js
+++ b/src/blocks/blocks/accordion/item/edit.js
@@ -28,7 +28,7 @@ import { select } from '@wordpress/data';
/**
* Accordion Item component
* @param {import('./types.js').AccordionItemProps} props
- * @returns
+ * @return
*/
const Edit = ({
clientId,
@@ -50,7 +50,7 @@ const Edit = ({
const parentClientId = select( 'core/block-editor' ).getBlockParents( clientId ).at( -1 );
const parentBlock = select( 'core/block-editor' ).getBlock( parentClientId );
- setAttributes({ title: __( 'Accordion item ', 'otter-blocks' ) + parentBlock.innerBlocks.length });
+ setAttributes({ title: __( 'Accordion item', 'otter-blocks' ) + parentBlock.innerBlocks.length });
}
}, []);
diff --git a/src/blocks/blocks/advanced-heading/edit.js b/src/blocks/blocks/advanced-heading/edit.js
index 66ec6b6be..2cfab5e84 100644
--- a/src/blocks/blocks/advanced-heading/edit.js
+++ b/src/blocks/blocks/advanced-heading/edit.js
@@ -45,7 +45,7 @@ const { attributes: defaultAttributes } = metadata;
/**
* Advanced Heading component
* @param {import('./types').AdvancedHeadingProps} props
- * @returns
+ * @return
*/
const Edit = ({
attributes,
diff --git a/src/blocks/blocks/advanced-heading/inspector.js b/src/blocks/blocks/advanced-heading/inspector.js
index 84796c726..4bde8e75e 100644
--- a/src/blocks/blocks/advanced-heading/inspector.js
+++ b/src/blocks/blocks/advanced-heading/inspector.js
@@ -65,7 +65,7 @@ const fieldMapping = {
/**
*
* @param {import('./types.js').AdvancedHeadingInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/button-group/button/edit.js b/src/blocks/blocks/button-group/button/edit.js
index 3def04c01..0361c8668 100644
--- a/src/blocks/blocks/button-group/button/edit.js
+++ b/src/blocks/blocks/button-group/button/edit.js
@@ -39,7 +39,7 @@ const { attributes: defaultAttributes } = metadata;
/**
* Button component
* @param {import('./types').ButtonGroupButtonProps} props
- * @returns
+ * @return
*/
const Edit = ( props ) => {
const {
diff --git a/src/blocks/blocks/button-group/button/inspector.js b/src/blocks/blocks/button-group/button/inspector.js
index 6d7520731..b85d8bbc9 100644
--- a/src/blocks/blocks/button-group/button/inspector.js
+++ b/src/blocks/blocks/button-group/button/inspector.js
@@ -54,7 +54,7 @@ const styles = [
/**
*
* @param {import('./types.js').ButtonGroupButtonInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
@@ -301,7 +301,7 @@ const Inspector = ({
label={ __( 'Background', 'otter-blocks' ) }
colorValue={ attributes.background }
gradientValue={ attributes.backgroundGradient }
- onColorChange={ background => setAttributes({ background: background })}
+ onColorChange={ background => setAttributes({ background })}
onGradientChange={ backgroundGradient => setAttributes({ backgroundGradient })}
className="is-list"
/>
diff --git a/src/blocks/blocks/button-group/group/controls.tsx b/src/blocks/blocks/button-group/group/controls.tsx
index 3e5d745ce..7d843cb48 100644
--- a/src/blocks/blocks/button-group/group/controls.tsx
+++ b/src/blocks/blocks/button-group/group/controls.tsx
@@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { AlignmentToolbar, BlockControls } from '@wordpress/block-editor';
+import { BlockControls } from '@wordpress/block-editor';
import { DropdownMenu, ToolbarGroup } from '@wordpress/components';
/**
* Internal dependencies
*/
-import { ButtonGroupInspectorProps } from './types';
+import type { ButtonGroupInspectorProps } from './types.d.ts';
import { useResponsiveAttributes } from '../../../helpers/utility-hooks';
import { alignCenter, alignLeft, alignRight, menu } from '@wordpress/icons';
diff --git a/src/blocks/blocks/button-group/group/deprecated.js b/src/blocks/blocks/button-group/group/deprecated.js
index 8e85d08e7..172396a2d 100644
--- a/src/blocks/blocks/button-group/group/deprecated.js
+++ b/src/blocks/blocks/button-group/group/deprecated.js
@@ -161,7 +161,7 @@ const deprecated = [{
'wp-block-themeisle-blocks-button',
`wp-block-themeisle-blocks-button-${ i }`
) }
- style={ buttonStyle }
+ style={ buttonStyle } rel="noreferrer"
>
{ ( 'left' === attributes.data[i].iconType || 'only' === attributes.data[i].iconType ) && (
} block The block to copy.
- * @returns {import('../../helpers/blocks.js').BlockProps} The copied block.
+ * @return {import('../../helpers/blocks.js').BlockProps|void} The copied block.
*/
const makeBlockCopy = ( block ) => {
if ( undefined === block ) {
@@ -185,7 +185,7 @@ const ContentGenerator = ({
const PRESETS = {
form: {
title: __( 'AI Form generator', 'otter-blocks' ),
- placeholder: __( 'Start describing what form you need...', 'otter-blocks' ),
+ placeholder: __( 'Start describing what form you need…', 'otter-blocks' ),
actions: ( props ) => {
return (
@@ -209,7 +209,7 @@ const ContentGenerator = ({
},
textTransformation: {
title: __( 'AI Content generator', 'otter-blocks' ),
- placeholder: __( 'Start describing what content you need...', 'otter-blocks' ),
+ placeholder: __( 'Start describing what content you need…', 'otter-blocks' ),
actions: ( props ) => {
return (
diff --git a/src/blocks/blocks/content-generator/inspector.js b/src/blocks/blocks/content-generator/inspector.js
index 948f8f815..7a88f8c77 100644
--- a/src/blocks/blocks/content-generator/inspector.js
+++ b/src/blocks/blocks/content-generator/inspector.js
@@ -8,7 +8,7 @@ import {
/**
*
* @param {import('./types').ContentGeneratorInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/countdown/common.ts b/src/blocks/blocks/countdown/common.ts
index bd52d0d94..56a533d11 100644
--- a/src/blocks/blocks/countdown/common.ts
+++ b/src/blocks/blocks/countdown/common.ts
@@ -1,4 +1,4 @@
-import { CountdownTimer } from './types';
+import type { CountdownTimer } from './types.d.ts';
import { __ } from '@wordpress/i18n';
const _MS_PER_SECONDS = 1000;
@@ -10,7 +10,7 @@ const _MS_PER_DAY = _MS_PER_HOURS * 24;
* Get the time from a timer structure
*
* @param timer The timer data strcture.
- * @returns The time in miliseconds
+ * @return The time in miliseconds
*/
export const toTimer = ( timer: CountdownTimer = {}): number => {
return ( parseInt( timer?.days || '0' ) * _MS_PER_DAY + parseInt( timer?.hours || '0' ) * _MS_PER_HOURS + parseInt( timer?.minutes || '0' ) * _MS_PER_MINUTES + parseInt( timer?.seconds || '0' ) * _MS_PER_SECONDS ) ?? 0;
@@ -20,8 +20,8 @@ export const toTimer = ( timer: CountdownTimer = {}): number => {
* Get the time interval from two dates.
*
* @param start The start date.
- * @param end The end date.
- * @returns
+ * @param end The end date.
+ * @return
*/
export const fromInterval = ( start?: string, end?: string ): number => {
if ( ! start || ! end ) {
@@ -36,9 +36,11 @@ export const fromInterval = ( start?: string, end?: string ): number => {
/**
* Get the time interval from the unix time
*
- * @param unixTime Time as UNIX
- * @param settings Options to keep a components or/and allow negative time
- * @returns An object with the values for days, hours, minutes, seconds
+ * @param unixTime Time as UNIX
+ * @param settings Options to keep a components or/and allow negative time
+ * @param settings.exclude
+ * @param settings.keepNeg
+ * @return An object with the values for days, hours, minutes, seconds
*/
export const getIntervalFromUnix = ( unixTime: number, settings: { exclude?: string[], keepNeg?: boolean }) => {
unixTime ??= 0; // Check for null/undefined
diff --git a/src/blocks/blocks/countdown/edit.tsx b/src/blocks/blocks/countdown/edit.tsx
index 41bc082bf..accdf6976 100644
--- a/src/blocks/blocks/countdown/edit.tsx
+++ b/src/blocks/blocks/countdown/edit.tsx
@@ -43,7 +43,7 @@ import {
} from '../../helpers/helper-functions.js';
import DisplayTime from './components/display-time';
import { fromInterval, toTimer } from './common';
-import { CountdownProps } from './types';
+import type { CountdownProps } from './types.d.ts';
const { attributes: defaultAttributes } = metadata;
diff --git a/src/blocks/blocks/countdown/inspector.js b/src/blocks/blocks/countdown/inspector.js
index 35e1d25ac..63d89803c 100644
--- a/src/blocks/blocks/countdown/inspector.js
+++ b/src/blocks/blocks/countdown/inspector.js
@@ -143,7 +143,7 @@ const EndActionPanel = () => (
/**
*
* @param {import('./types.js').CountdownInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
@@ -193,7 +193,7 @@ const Inspector = ({
- { applyFilters( 'otter.countdown.controls.settings', , { attributes: attributes, setAttributes: setAttributes }) }
+ { applyFilters( 'otter.countdown.controls.settings', , { attributes, setAttributes }) }
{ attributes.mode === undefined && (
- { applyFilters( 'otter.countdown.controls.end', , { attributes: attributes, setAttributes: setAttributes }) }
+ { applyFilters( 'otter.countdown.controls.end', , { attributes, setAttributes }) }
diff --git a/src/blocks/blocks/countdown/save.tsx b/src/blocks/blocks/countdown/save.tsx
index 7f275f9b8..bbab5f270 100644
--- a/src/blocks/blocks/countdown/save.tsx
+++ b/src/blocks/blocks/countdown/save.tsx
@@ -18,7 +18,7 @@ import {
} from '../../helpers/helper-functions.js';
import { getIntervalFromUnix, timerSerialization } from './common';
import { isEmpty } from 'lodash';
-import { CountdownProps } from './types.js';
+import type { CountdownProps } from './types.d.ts';
const DisplayTimeComponent = ({
name,
diff --git a/src/blocks/blocks/flip/edit.tsx b/src/blocks/blocks/flip/edit.tsx
index 799cf1767..d56abfad1 100644
--- a/src/blocks/blocks/flip/edit.tsx
+++ b/src/blocks/blocks/flip/edit.tsx
@@ -36,7 +36,7 @@ import {
} from '../../helpers/block-utility.js';
import { boxToCSS, getChoice, mergeBoxDefaultValues, stringToBox, _px } from '../../helpers/helper-functions.js';
import { isNumber } from 'lodash';
-import { type FlipProps } from './types';
+import type { FlipProps } from './types.d.ts';
import {
useDarkBackground,
useResponsiveAttributes
@@ -47,7 +47,11 @@ const { attributes: defaultAttributes } = metadata;
/**
* Flip component
* @param props
- * @returns
+ * @param props.attributes
+ * @param props.setAttributes
+ * @param props.clientId
+ * @param props.isSelected
+ * @return
*/
const Edit = ({
attributes,
@@ -162,8 +166,7 @@ const Edit = ({
currentSide={ currentSide }
setSide={ setSide }
/>
-
- {/** @ts-ignore */}
+
) }
diff --git a/src/blocks/blocks/flip/inspector.js b/src/blocks/blocks/flip/inspector.js
index e9cc8e8d5..dbb35c029 100644
--- a/src/blocks/blocks/flip/inspector.js
+++ b/src/blocks/blocks/flip/inspector.js
@@ -95,7 +95,7 @@ const defaultFontSizes = [
/**
*
* @param {import('./types.js').FlipInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/font-awesome-icons/edit.js b/src/blocks/blocks/font-awesome-icons/edit.js
index 02e2d31b3..5fe413a5e 100644
--- a/src/blocks/blocks/font-awesome-icons/edit.js
+++ b/src/blocks/blocks/font-awesome-icons/edit.js
@@ -44,7 +44,7 @@ export const alignHandler = ( align ) => {
/**
* Icons Component
* @param {import('./types').IconsProps} props
- * @returns
+ * @return
*/
const Edit = ({
name,
diff --git a/src/blocks/blocks/font-awesome-icons/inspector.js b/src/blocks/blocks/font-awesome-icons/inspector.js
index b8b6bd06f..1627f4d9f 100644
--- a/src/blocks/blocks/font-awesome-icons/inspector.js
+++ b/src/blocks/blocks/font-awesome-icons/inspector.js
@@ -64,7 +64,7 @@ const defaultFontSizes = [
/**
*
* @param {import('./types.js').IconInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/form/common.tsx b/src/blocks/blocks/form/common.tsx
index d9c71b88c..73c61f01a 100644
--- a/src/blocks/blocks/form/common.tsx
+++ b/src/blocks/blocks/form/common.tsx
@@ -12,7 +12,7 @@ import { omit } from 'lodash';
import { createBlock } from '@wordpress/blocks';
import { dispatch } from '@wordpress/data';
-import { BlockProps } from '../../helpers/blocks';
+import type { BlockProps } from '../../helpers/blocks';
import { changeActiveStyle, getActiveStyle, getChoice } from '../../helpers/helper-functions';
import { Fragment } from '@wordpress/element';
import { SortableElement, SortableHandle } from 'react-sortable-hoc';
@@ -160,7 +160,7 @@ export const switchFormFieldTo = ( type?: string, clientId ?:string, attributes?
const newBlock = createBlock( `themeisle-blocks/${ blockName }`,
- omit({ ...attributes, type: type }, 'form-textarea' === blockName ? [ 'multipleSelection', 'options', 'type' ] : [ 'multipleSelection', 'options' ])
+ omit({ ...attributes, type }, 'form-textarea' === blockName ? [ 'multipleSelection', 'options', 'type' ] : [ 'multipleSelection', 'options' ])
);
replaceBlock( clientId, newBlock );
diff --git a/src/blocks/blocks/form/edit.js b/src/blocks/blocks/form/edit.js
index 8cf33231c..5478ad261 100644
--- a/src/blocks/blocks/form/edit.js
+++ b/src/blocks/blocks/form/edit.js
@@ -88,7 +88,7 @@ const formOptionsMap = {
/**
* Form component
* @param {import('./type').FormProps} props
- * @returns
+ * @return
*/
const Edit = ({
attributes,
@@ -118,7 +118,7 @@ const Edit = ({
/**
* Get global value if it is the case.
* @param {import('../../common').SyncAttrs
} field
- * @returns
+ * @return
*/
const getSyncValue = field => {
if ( attributes?.isSynced?.includes( field ) ) {
@@ -651,7 +651,7 @@ const Edit = ({
} else {
createNotice(
'error',
- __( 'An error has occurred: ', 'otter-blocks' ) + ( res?.error || __( 'unknown', 'otter-blocks' ) ),
+ __( 'An error has occurred:', 'otter-blocks' ) + ( res?.error || __( 'unknown', 'otter-blocks' ) ),
{
isDismissible: true,
type: 'snackbar'
@@ -700,7 +700,7 @@ const Edit = ({
} else {
createNotice(
'error',
- __( 'An error has occurred: ', 'otter-blocks' ) + ( res?.error || __( 'unknown', 'otter-blocks' ) + __( '. Check your provider for confirmation.', 'otter-blocks' ) ),
+ __( 'An error has occurred:', 'otter-blocks' ) + ( res?.error || __( 'unknown', 'otter-blocks' ) + __( '. Check your provider for confirmation.', 'otter-blocks' ) ),
{
isDismissible: true,
type: 'snackbar'
diff --git a/src/blocks/blocks/form/file/index.js b/src/blocks/blocks/form/file/index.js
index 8807192f3..fb9452045 100644
--- a/src/blocks/blocks/form/file/index.js
+++ b/src/blocks/blocks/form/file/index.js
@@ -2,11 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-
-import { registerBlockType } from '@wordpress/blocks';
-
-import { createBlock } from '@wordpress/blocks';
-
+import { registerBlockType, createBlock } from '@wordpress/blocks';
import { omit } from 'lodash';
/**
diff --git a/src/blocks/blocks/form/file/inspector.js b/src/blocks/blocks/form/file/inspector.js
index ec3980e92..acd93bd25 100644
--- a/src/blocks/blocks/form/file/inspector.js
+++ b/src/blocks/blocks/form/file/inspector.js
@@ -103,7 +103,7 @@ const ProPreview = ({ attributes }) => {
{ ! Boolean( window.themeisleGutenberg.hasPro ) && (
{ __( 'Get more options with Otter Pro. ', 'otter-blocks' ) } }
+ notice={ { __( 'Get more options with Otter Pro.', 'otter-blocks' ) } }
variant="upsell"
/> ) }
@@ -113,7 +113,7 @@ const ProPreview = ({ attributes }) => {
/**
*
* @param {import('./types').FormFileInspectorProps} props
- * @returns {JSX.Element}
+ * @return {JSX.Element}
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/form/hidden-field/inspector.js b/src/blocks/blocks/form/hidden-field/inspector.js
index 4c01493d1..3be46e681 100644
--- a/src/blocks/blocks/form/hidden-field/inspector.js
+++ b/src/blocks/blocks/form/hidden-field/inspector.js
@@ -30,7 +30,7 @@ import { fieldTypesOptions, mappedNameInfo, switchFormFieldTo } from '../common'
/**
*
* @param {import('./types').FormHiddenFieldInspectorPros} props
- * @returns {JSX.Element}
+ * @return {JSX.Element}
*/
const Inspector = ({
attributes,
@@ -92,7 +92,7 @@ const Inspector = ({
/>
{ __( 'Get more options with Otter Pro. ', 'otter-blocks' ) } }
+ notice={ { __( 'Get more options with Otter Pro.', 'otter-blocks' ) } }
variant="upsell"
/>
diff --git a/src/blocks/blocks/form/input/edit.js b/src/blocks/blocks/form/input/edit.js
index 945238aae..82d02cd4f 100644
--- a/src/blocks/blocks/form/input/edit.js
+++ b/src/blocks/blocks/form/input/edit.js
@@ -26,7 +26,7 @@ const { attributes: defaultAttributes } = metadata;
/**
* Form Input component
* @param {import('./types').FormInputProps} props
- * @returns
+ * @return
*/
const Edit = ({
attributes,
diff --git a/src/blocks/blocks/form/input/index.js b/src/blocks/blocks/form/input/index.js
index 830d35a3b..90c5043c9 100644
--- a/src/blocks/blocks/form/input/index.js
+++ b/src/blocks/blocks/form/input/index.js
@@ -2,11 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-
-import { registerBlockType } from '@wordpress/blocks';
-
-import { createBlock } from '@wordpress/blocks';
-
+import { registerBlockType, createBlock } from '@wordpress/blocks';
import { omit } from 'lodash';
/**
@@ -39,7 +35,7 @@ registerBlockType( name, {
{
name: 'themeisle-blocks/form-input-email',
description: __( 'Insert an email field', 'otter-blocks' ),
- icon: icon,
+ icon,
title: __( 'Email Field', 'otter-blocks' ),
attributes: {
type: 'email'
@@ -48,7 +44,7 @@ registerBlockType( name, {
{
name: 'themeisle-blocks/form-input-date',
description: __( 'Insert a date field', 'otter-blocks' ),
- icon: icon,
+ icon,
title: __( 'Date Field', 'otter-blocks' ),
attributes: {
type: 'date'
@@ -57,7 +53,7 @@ registerBlockType( name, {
{
name: 'themeisle-blocks/form-input-number',
description: __( 'Insert a number field', 'otter-blocks' ),
- icon: icon,
+ icon,
title: __( 'Number Field', 'otter-blocks' ),
attributes: {
type: 'number'
@@ -66,7 +62,7 @@ registerBlockType( name, {
{
name: 'themeisle-blocks/form-input-url',
description: __( 'Insert an URL field', 'otter-blocks' ),
- icon: icon,
+ icon,
title: __( 'URL Field', 'otter-blocks' ),
attributes: {
type: 'url',
diff --git a/src/blocks/blocks/form/input/inspector.js b/src/blocks/blocks/form/input/inspector.js
index c77ea273d..e03dae1c2 100644
--- a/src/blocks/blocks/form/input/inspector.js
+++ b/src/blocks/blocks/form/input/inspector.js
@@ -28,7 +28,7 @@ import { HTMLAnchorControl } from '../../../components';
/**
*
* @param {import('./types').FormInputProps} props
- * @returns {JSX.Element}
+ * @return {JSX.Element}
*/
const Inspector = ({
attributes,
diff --git a/src/blocks/blocks/form/inspector.js b/src/blocks/blocks/form/inspector.js
index fb68a7bfa..0f1af355a 100644
--- a/src/blocks/blocks/form/inspector.js
+++ b/src/blocks/blocks/form/inspector.js
@@ -340,7 +340,7 @@ const FormOptions = ({ formOptions, setFormOption, attributes, setAttributes })
/**
*
* @param {import('./type.js').FormInspectorProps} props
- * @returns
+ * @return
*/
const Inspector = ({
attributes,
@@ -454,7 +454,7 @@ const Inspector = ({
{ 'loading' === loadingState?.formOptions && (
- { __( 'Loading the options. Please wait...', 'otter-blocks' ) }
+ { __( 'Loading the options. Please wait…', 'otter-blocks' ) }
) }
diff --git a/src/blocks/blocks/form/multiple-choice/edit.js b/src/blocks/blocks/form/multiple-choice/edit.js
index e7827fbcc..3160178d0 100644
--- a/src/blocks/blocks/form/multiple-choice/edit.js
+++ b/src/blocks/blocks/form/multiple-choice/edit.js
@@ -36,7 +36,7 @@ const Field = ({ fieldType, label, position, attributes, checked, onChange }) =>
-
- { /** translators: %s Rating score. */ sprintf( __( '%f out of %f', 'otter-blocks' ), Math.max( Math.abs( feature.rating / divide ).toFixed( 1 ) || 0, 1 ), 10 / divide ) }
+ {
+ sprintf(
+ /** translators: %1$f: Rating score, %2$f: Maximum possible score. */
+ __( '%1$f out of %2$f', 'otter-blocks' ),
+ Math.max( Math.abs( feature.rating / divide ).toFixed( 1 ) || 0, 1 ),
+ 10 / divide
+ )
+ }
{ ( isSelected || feature.description ) && (