p.value === presetValue );
- if ( ! presetConfig ) return null;
+ if ( ! presetConfig ) {
+ return null;
+ }
const [ start, end ] = presetConfig.getRange();
return [ format( start, DATE_FORMAT ), format( end, DATE_FORMAT ) ];
}
diff --git a/src/resources/packages/admin/components/ui/calendar.tsx b/src/resources/packages/admin/components/ui/calendar.tsx
index d241e209..66a6fe7f 100644
--- a/src/resources/packages/admin/components/ui/calendar.tsx
+++ b/src/resources/packages/admin/components/ui/calendar.tsx
@@ -139,22 +139,33 @@ function Calendar( {
...classNames,
} }
components={ {
- Root: ( { className, rootRef, ...props } ) => {
+ Root: ( {
+ className: rootClassName,
+ rootRef,
+ ...rootProps
+ } ) => {
return (
);
},
- Chevron: ( { className, orientation, ...props } ) => {
+ Chevron: ( {
+ className: chevronClassName,
+ orientation,
+ ...chevronProps
+ } ) => {
if ( orientation === 'left' ) {
return (
);
}
@@ -162,23 +173,26 @@ function Calendar( {
if ( orientation === 'right' ) {
return (
);
}
return (
);
},
DayButton: CalendarDayButton,
- WeekNumber: ( { children, ...props } ) => {
+ WeekNumber: ( { children, ...weekNumberProps } ) => {
return (
- |
+ |
{ children }
@@ -202,7 +216,9 @@ function CalendarDayButton( {
const ref = React.useRef< HTMLButtonElement >( null );
React.useEffect( () => {
- if ( modifiers.focused ) ref.current?.focus();
+ if ( modifiers.focused ) {
+ ref.current?.focus();
+ }
}, [ modifiers.focused ] );
return (
diff --git a/src/resources/packages/admin/components/ui/slider.tsx b/src/resources/packages/admin/components/ui/slider.tsx
index 957e75f3..c62a68b4 100644
--- a/src/resources/packages/admin/components/ui/slider.tsx
+++ b/src/resources/packages/admin/components/ui/slider.tsx
@@ -11,15 +11,15 @@ function Slider( {
max = 100,
...props
}: React.ComponentProps< typeof SliderPrimitive.Root > ) {
- const _values = React.useMemo(
- () =>
- Array.isArray( value )
- ? value
- : Array.isArray( defaultValue )
- ? defaultValue
- : [ min, max ],
- [ value, defaultValue, min, max ]
- );
+ const _values = React.useMemo( () => {
+ if ( Array.isArray( value ) ) {
+ return value;
+ }
+ if ( Array.isArray( defaultValue ) ) {
+ return defaultValue;
+ }
+ return [ min, max ];
+ }, [ value, defaultValue, min, max ] );
return (
@@ -136,7 +136,7 @@ export default function CommentsPage() {
onChange={ field.onChange }
options={ postTypeOptions }
placeholder={ __(
- 'Select post types...',
+ 'Select post types…',
'fakerpress'
) }
/>
@@ -263,7 +263,7 @@ export default function CommentsPage() {
onChange={ field.onChange }
options={ htmlTagOptions }
placeholder={ __(
- 'Select HTML tags...',
+ 'Select HTML tags…',
'fakerpress'
) }
allowCreate
diff --git a/src/resources/packages/admin/pages/posts.tsx b/src/resources/packages/admin/pages/posts.tsx
index d4faf683..c66bf385 100644
--- a/src/resources/packages/admin/pages/posts.tsx
+++ b/src/resources/packages/admin/pages/posts.tsx
@@ -47,6 +47,10 @@ interface PostsFormData {
* Defaults are added non-destructively: a default whose meta `name` already
* exists in `current` is skipped, and existing rules are never removed or
* overwritten. Returns the same array reference when nothing is added.
+ *
+ * @param current Meta rules currently in the form.
+ * @param postTypes Selected post types.
+ * @param byType Default meta rules keyed by post type.
*/
function mergeDefaultMeta(
current: MetaRule[],
@@ -309,7 +313,7 @@ export default function PostsPage() {
onChange={ field.onChange }
options={ postTypeOptions }
placeholder={ __(
- 'Select post types...',
+ 'Select post types…',
'fakerpress'
) }
/>
@@ -334,7 +338,7 @@ export default function PostsPage() {
field.onChange( vals.map( Number ) )
}
placeholder={ __(
- 'Search for posts...',
+ 'Search for posts…',
'fakerpress'
) }
onSearch={ parentSearch.search }
@@ -361,7 +365,7 @@ export default function PostsPage() {
onChange={ field.onChange }
options={ commentStatusOptions }
placeholder={ __(
- 'Select comment status...',
+ 'Select comment status…',
'fakerpress'
) }
/>
@@ -386,7 +390,7 @@ export default function PostsPage() {
field.onChange( vals.map( Number ) )
}
placeholder={ __(
- 'Search for authors...',
+ 'Search for authors…',
'fakerpress'
) }
onSearch={ authorSearch.search }
@@ -471,7 +475,7 @@ export default function PostsPage() {
onChange={ field.onChange }
options={ htmlTagOptions }
placeholder={ __(
- 'Select HTML tags...',
+ 'Select HTML tags…',
'fakerpress'
) }
allowCreate
@@ -498,7 +502,7 @@ export default function PostsPage() {
onChange={ field.onChange }
options={ imageProviderOptions }
placeholder={ __(
- 'Select image providers...',
+ 'Select image providers…',
'fakerpress'
) }
/>
diff --git a/src/resources/packages/admin/pages/settings.tsx b/src/resources/packages/admin/pages/settings.tsx
index 58591733..1df7aae5 100644
--- a/src/resources/packages/admin/pages/settings.tsx
+++ b/src/resources/packages/admin/pages/settings.tsx
@@ -146,7 +146,7 @@ export default function SettingsPage() {
disabled={ isSubmitting }
>
{ isSubmitting
- ? __( 'Deleting...', 'fakerpress' )
+ ? __( 'Deleting…', 'fakerpress' )
: __( 'Delete All Data', 'fakerpress' ) }
diff --git a/src/resources/packages/admin/pages/terms.tsx b/src/resources/packages/admin/pages/terms.tsx
index 5b0fa353..3ec606a7 100644
--- a/src/resources/packages/admin/pages/terms.tsx
+++ b/src/resources/packages/admin/pages/terms.tsx
@@ -149,7 +149,7 @@ export default function TermsPage() {
onChange={ field.onChange }
options={ taxonomyOptions }
placeholder={ __(
- 'Select taxonomies...',
+ 'Select taxonomies…',
'fakerpress'
) }
/>
diff --git a/src/resources/packages/admin/pages/users.tsx b/src/resources/packages/admin/pages/users.tsx
index 9a46e2aa..71760860 100644
--- a/src/resources/packages/admin/pages/users.tsx
+++ b/src/resources/packages/admin/pages/users.tsx
@@ -125,7 +125,7 @@ export default function UsersPage() {
onChange={ field.onChange }
options={ roleOptions }
placeholder={ __(
- 'Select roles...',
+ 'Select roles…',
'fakerpress'
) }
/>
@@ -207,7 +207,7 @@ export default function UsersPage() {
onChange={ field.onChange }
options={ htmlTagOptions }
placeholder={ __(
- 'Select HTML tags...',
+ 'Select HTML tags…',
'fakerpress'
) }
allowCreate
diff --git a/src/resources/packages/admin/schemas/meta-rules.ts b/src/resources/packages/admin/schemas/meta-rules.ts
index 8074e1c2..be3a1cad 100644
--- a/src/resources/packages/admin/schemas/meta-rules.ts
+++ b/src/resources/packages/admin/schemas/meta-rules.ts
@@ -3,7 +3,7 @@ import { z } from 'zod';
export const metaRuleSchema = z.object( {
type: z.string().min( 1 ),
name: z.string().min( 1 ),
- config: z.record( z.unknown() ).default( {} ),
+ config: z.record( z.string(), z.unknown() ).default( {} ),
} );
export type MetaRuleSchema = z.infer< typeof metaRuleSchema >;
|