From 6c8207541af91c6ed503dda9c6f4027eea40d74d Mon Sep 17 00:00:00 2001
From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
Date: Sat, 9 Dec 2023 12:08:16 -0800
Subject: [PATCH] Resolved Type Errors
---
.../js/data/src/user/use-user-preferences.ts | 5 +-
packages/js/data/src/user/use-user.ts | 1 -
.../src/user/with-current-user-hydration.tsx | 3 -
packages/js/product-editor/package.json | 5 +-
.../src/blocks/generic/conditional/edit.tsx | 1 +
.../taxonomy/create-taxonomy-modal.tsx | 2 +
.../src/blocks/generic/taxonomy/edit.tsx | 1 +
.../src/blocks/product-fields/name/edit.tsx | 3 +
.../notice-edit-single-variation/edit.tsx | 1 +
.../src/components/block-icon/block-icon.tsx | 2 +-
.../src/components/header/header.tsx | 14 +--
.../header/hooks/use-preview/use-preview.tsx | 2 +
.../header/hooks/use-publish/use-publish.tsx | 4 +
.../hooks/use-save-draft/use-save-draft.tsx | 3 +
.../src/components/tabs/tabs.tsx | 1 +
.../variation-switcher-footer.tsx | 4 +-
.../use-variations/use-variations.ts | 5 +
.../use-confirm-unsaved-product-changes.ts | 1 +
.../src/hooks/use-product-edits.ts | 1 +
.../hooks/use-product-variations-helper.ts | 2 +
.../src/hooks/use-variation-switcher.ts | 3 +-
.../register-product-editor-block-type.ts | 1 +
.../assembler-hub/sidebar/save-hub.tsx | 2 +
.../sidebar-navigation-screen-logo.tsx | 1 +
pnpm-lock.yaml | 101 ++++++++++--------
25 files changed, 104 insertions(+), 65 deletions(-)
diff --git a/packages/js/data/src/user/use-user-preferences.ts b/packages/js/data/src/user/use-user-preferences.ts
index 5a49d1fe856..cd87741ee55 100644
--- a/packages/js/data/src/user/use-user-preferences.ts
+++ b/packages/js/data/src/user/use-user-preferences.ts
@@ -118,7 +118,6 @@ export const useUserPreferences = () => {
// Get our dispatch methods now - this can't happen inside the callback below.
const dispatch = useDispatch( STORE_NAME );
const { addEntities, receiveCurrentUser, saveEntityRecord } = dispatch;
- // @ts-expect-error WP 5.3.x doesn't have the User entity defined.
let { saveUser } = dispatch;
const userData = useSelect( ( select ) => {
@@ -126,11 +125,8 @@ export const useUserPreferences = () => {
getCurrentUser,
getEntity,
getEntityRecord,
- // @ts-expect-error type definition is missing.
getLastEntitySaveError,
- // @ts-expect-error type definition is missing.
hasStartedResolution,
- // @ts-expect-error type definition is missing.
hasFinishedResolution,
} = select( STORE_NAME );
@@ -154,6 +150,7 @@ export const useUserPreferences = () => {
// WP 5.3.x doesn't have the User entity defined.
if ( typeof saveUser !== 'function' ) {
// Polyfill saveUser() - wrapper of saveEntityRecord.
+ // @ts-expect-error No types exist.
saveUser = async ( userToSave: {
id: number;
woocommerce_meta: { [ key: string ]: boolean };
diff --git a/packages/js/data/src/user/use-user.ts b/packages/js/data/src/user/use-user.ts
index 40bdaed104a..6ade4c27c36 100644
--- a/packages/js/data/src/user/use-user.ts
+++ b/packages/js/data/src/user/use-user.ts
@@ -17,7 +17,6 @@ import { WCUser } from './types';
export const useUser = () => {
const userData = useSelect( ( select ) => {
// TODO: Update @types/wordpress__core-data to include the 'hasStartedResolution', 'hasFinishedResolution' method.
- // @ts-expect-errors Property 'hasStartedResolution', 'hasFinishedResolution' does not exist on type @types/wordpress__core-data
const { getCurrentUser, hasStartedResolution, hasFinishedResolution } =
select( STORE_NAME );
diff --git a/packages/js/data/src/user/with-current-user-hydration.tsx b/packages/js/data/src/user/with-current-user-hydration.tsx
index c02e9646706..c03f1a2643f 100644
--- a/packages/js/data/src/user/with-current-user-hydration.tsx
+++ b/packages/js/data/src/user/with-current-user-hydration.tsx
@@ -25,7 +25,6 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) =>
if ( ! currentUser ) {
return;
}
- // @ts-expect-error both functions are not defined in the wp.data typings
const { isResolving, hasFinishedResolution } =
select( STORE_NAME );
return (
@@ -35,9 +34,7 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) =>
} );
const {
- // @ts-expect-error startResolution is not defined in the wp.data typings
startResolution,
- // @ts-expect-error finishResolution is not defined in the wp.data typings
finishResolution,
receiveCurrentUser,
} = useDispatch( STORE_NAME );
diff --git a/packages/js/product-editor/package.json b/packages/js/product-editor/package.json
index b35d18339ef..0653f2bb203 100644
--- a/packages/js/product-editor/package.json
+++ b/packages/js/product-editor/package.json
@@ -106,6 +106,7 @@
"eslint": "^8.55.0",
"jest": "~27.5.1",
"jest-cli": "~27.5.1",
+ "mini-css-extract-plugin": "^2.7.6",
"postcss": "^8.4.32",
"postcss-loader": "^4.3.0",
"react": "^17.0.2",
@@ -115,7 +116,9 @@
"ts-jest": "~29.1.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
- "webpack-cli": "^3.3.12"
+ "webpack-cli": "^3.3.12",
+ "webpack-remove-empty-scripts": "^0.7.3",
+ "webpack-rtl-plugin": "^2.0.0"
},
"scripts": {
"turbo:build": "pnpm run build:js && pnpm run build:css",
diff --git a/packages/js/product-editor/src/blocks/generic/conditional/edit.tsx b/packages/js/product-editor/src/blocks/generic/conditional/edit.tsx
index e4dbec2d398..fa55b8e0a0f 100644
--- a/packages/js/product-editor/src/blocks/generic/conditional/edit.tsx
+++ b/packages/js/product-editor/src/blocks/generic/conditional/edit.tsx
@@ -39,6 +39,7 @@ export function Edit( {
const displayBlocks = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const product: Product = select( 'core' ).getEditedEntityRecord(
'postType',
postType,
diff --git a/packages/js/product-editor/src/blocks/generic/taxonomy/create-taxonomy-modal.tsx b/packages/js/product-editor/src/blocks/generic/taxonomy/create-taxonomy-modal.tsx
index 84d4ebd38fe..e4a1e93c611 100644
--- a/packages/js/product-editor/src/blocks/generic/taxonomy/create-taxonomy-modal.tsx
+++ b/packages/js/product-editor/src/blocks/generic/taxonomy/create-taxonomy-modal.tsx
@@ -73,6 +73,7 @@ export const CreateTaxonomyModal: React.FC< CreateTaxonomyModalProps > = ( {
setErrorMessage( null );
setIsCreating( true );
try {
+ // @ts-expect-error There are no types for this.
const newTaxonomy: Taxonomy = await saveEntityRecord(
'taxonomy',
slug,
@@ -80,6 +81,7 @@ export const CreateTaxonomyModal: React.FC< CreateTaxonomyModalProps > = ( {
name,
parent: parent ? parent.id : null,
},
+ // @ts-expect-error There are no types for this.
{
throwOnError: true,
}
diff --git a/packages/js/product-editor/src/blocks/generic/taxonomy/edit.tsx b/packages/js/product-editor/src/blocks/generic/taxonomy/edit.tsx
index 9b1d94cf461..534d3816c1c 100644
--- a/packages/js/product-editor/src/blocks/generic/taxonomy/edit.tsx
+++ b/packages/js/product-editor/src/blocks/generic/taxonomy/edit.tsx
@@ -40,6 +40,7 @@ export function Edit( {
const blockProps = useWooBlockProps( attributes );
const { hierarchical }: TaxonomyMetadata = useSelect(
( select ) =>
+ // @ts-expect-error There are no types for this.
select( 'core' ).getTaxonomy( attributes.slug ) || {
hierarchical: false,
}
diff --git a/packages/js/product-editor/src/blocks/product-fields/name/edit.tsx b/packages/js/product-editor/src/blocks/product-fields/name/edit.tsx
index 77beb8e40ee..cd2efad092d 100644
--- a/packages/js/product-editor/src/blocks/product-fields/name/edit.tsx
+++ b/packages/js/product-editor/src/blocks/product-fields/name/edit.tsx
@@ -47,6 +47,7 @@ export function Edit( {
}: ProductEditorBlockEditProps< NameBlockAttributes > ) {
const blockProps = useWooBlockProps( attributes );
+ // @ts-expect-error There are no types for this.
const { editEntityRecord, saveEntityRecord } = useDispatch( 'core' );
const { hasEdit } = useProductEdits();
@@ -56,6 +57,7 @@ export function Edit( {
const productId = useEntityId( 'postType', 'product' );
const product: Product = useSelect( ( select ) =>
+ // @ts-expect-error There are no types for this.
select( 'core' ).getEditedEntityRecord(
'postType',
'product',
@@ -198,6 +200,7 @@ export function Edit( {
onCancel={ () => setShowProductLinkEditModal( false ) }
onSaved={ () => setShowProductLinkEditModal( false ) }
saveHandler={ async ( updatedSlug ) => {
+ // @ts-expect-error There are no types for this.
const { slug, permalink }: Product =
await saveEntityRecord( 'postType', 'product', {
id: product.id,
diff --git a/packages/js/product-editor/src/blocks/product-fields/notice-edit-single-variation/edit.tsx b/packages/js/product-editor/src/blocks/product-fields/notice-edit-single-variation/edit.tsx
index b5efbc8263b..7119797c2b7 100644
--- a/packages/js/product-editor/src/blocks/product-fields/notice-edit-single-variation/edit.tsx
+++ b/packages/js/product-editor/src/blocks/product-fields/notice-edit-single-variation/edit.tsx
@@ -37,6 +37,7 @@ export function Edit( {
isParentResolving,
}: { parentName: string; isParentResolving: boolean } = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const { getEditedEntityRecord, hasFinishedResolution } =
select( 'core' );
const { name }: Product = getEditedEntityRecord(
diff --git a/packages/js/product-editor/src/components/block-icon/block-icon.tsx b/packages/js/product-editor/src/components/block-icon/block-icon.tsx
index 39397253dfc..a2362ad7d61 100644
--- a/packages/js/product-editor/src/components/block-icon/block-icon.tsx
+++ b/packages/js/product-editor/src/components/block-icon/block-icon.tsx
@@ -26,7 +26,7 @@ export function BlockIcon( { clientId }: BlockIconProps ) {
// Then try to get icon from block's metadata
const { getBlockType } = select( 'core/blocks' );
const blockName = getBlockName( clientId );
- const block = getBlockType< Block >( blockName );
+ const block = getBlockType< Block >( blockName ?? undefined );
return block?.icon;
},
[ clientId ]
diff --git a/packages/js/product-editor/src/components/header/header.tsx b/packages/js/product-editor/src/components/header/header.tsx
index 00b4689a45b..e77c7ed99ff 100644
--- a/packages/js/product-editor/src/components/header/header.tsx
+++ b/packages/js/product-editor/src/components/header/header.tsx
@@ -46,7 +46,7 @@ export function Header( {
const lastPersistedProduct = useSelect(
( select ) => {
const { getEntityRecord } = select( 'core' );
- return getEntityRecord< Product | ProductVariation >(
+ return getEntityRecord(
'postType',
productType,
productId
@@ -95,7 +95,7 @@ export function Header( {
);
const url = getNewPath(
{ tab: 'variations' },
- `/product/${ lastPersistedProduct.parent_id }`
+ `/product/${ lastPersistedProduct?.parent_id }`
);
navigateTo( { url } );
} }
@@ -117,13 +117,13 @@ export function Header( {
{ lastPersistedProduct?.name }
- # { lastPersistedProduct.id }
+ # { lastPersistedProduct?.id }
) : (
getHeaderTitle(
editedProductName,
- lastPersistedProduct.name
+ lastPersistedProduct?.name
)
) }
@@ -132,18 +132,18 @@ export function Header( {
{ ! isVariation && (
) }
diff --git a/packages/js/product-editor/src/components/header/hooks/use-preview/use-preview.tsx b/packages/js/product-editor/src/components/header/hooks/use-preview/use-preview.tsx
index 8d23f71eed5..2bf03e4fb8f 100644
--- a/packages/js/product-editor/src/components/header/hooks/use-preview/use-preview.tsx
+++ b/packages/js/product-editor/src/components/header/hooks/use-preview/use-preview.tsx
@@ -44,6 +44,7 @@ export function usePreview( {
const { hasEdits, isDisabled } = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const { hasEditsForEntityRecord, isSavingEntityRecord } =
select( 'core' );
const isSaving = isSavingEntityRecord< boolean >(
@@ -68,6 +69,7 @@ export function usePreview( {
const ariaDisabled = disabled || isDisabled || isValidating;
+ // @ts-expect-error There are no types for this.
const { editEntityRecord, saveEditedEntityRecord } = useDispatch( 'core' );
let previewLink: URL | undefined;
diff --git a/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx b/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx
index 700dfa9d1b6..b616150a083 100644
--- a/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx
+++ b/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx
@@ -38,8 +38,11 @@ export function usePublish( {
const { isSaving, isDirty } = useSelect(
( select ) => {
const {
+ // @ts-expect-error There are no types for this.
isSavingEntityRecord,
+ // @ts-expect-error There are no types for this.
hasEditsForEntityRecord,
+ // @ts-expect-error There are no types for this.
getRawEntityRecord,
} = select( 'core' );
@@ -70,6 +73,7 @@ export function usePublish( {
const isPublished =
productType === 'product' ? productStatus === 'publish' : true;
+ // @ts-expect-error There are no types for this.
const { editEntityRecord, saveEditedEntityRecord } = useDispatch( 'core' );
async function handleClick( event: MouseEvent< HTMLButtonElement > ) {
diff --git a/packages/js/product-editor/src/components/header/hooks/use-save-draft/use-save-draft.tsx b/packages/js/product-editor/src/components/header/hooks/use-save-draft/use-save-draft.tsx
index 0f73efbdd35..83562841292 100644
--- a/packages/js/product-editor/src/components/header/hooks/use-save-draft/use-save-draft.tsx
+++ b/packages/js/product-editor/src/components/header/hooks/use-save-draft/use-save-draft.tsx
@@ -37,6 +37,7 @@ export function useSaveDraft( {
const { hasEdits, isDisabled } = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const { hasEditsForEntityRecord, isSavingEntityRecord } =
select( 'core' );
const isSaving = isSavingEntityRecord< boolean >(
@@ -65,6 +66,7 @@ export function useSaveDraft( {
( productStatus !== 'publish' && ! hasEdits ) ||
isValidating;
+ // @ts-expect-error There are no types for this.
const { editEntityRecord, saveEditedEntityRecord } = useDispatch( 'core' );
async function handleClick( event: MouseEvent< HTMLButtonElement > ) {
@@ -82,6 +84,7 @@ export function useSaveDraft( {
await editEntityRecord( 'postType', productType, productId, {
status: 'draft',
} );
+ // @ts-expect-error There are no types for this.
const publishedProduct = await saveEditedEntityRecord< Product >(
'postType',
productType,
diff --git a/packages/js/product-editor/src/components/tabs/tabs.tsx b/packages/js/product-editor/src/components/tabs/tabs.tsx
index 0a57b2cad77..bd1562f4cdf 100644
--- a/packages/js/product-editor/src/components/tabs/tabs.tsx
+++ b/packages/js/product-editor/src/components/tabs/tabs.tsx
@@ -37,6 +37,7 @@ export function Tabs( { onChange = () => {} }: TabsProps ) {
'id'
);
const product: Product = useSelect( ( select ) =>
+ // @ts-expect-error There are no types for this.
select( 'core' ).getEditedEntityRecord(
'postType',
'product',
diff --git a/packages/js/product-editor/src/components/variation-switcher-footer/variation-switcher-footer.tsx b/packages/js/product-editor/src/components/variation-switcher-footer/variation-switcher-footer.tsx
index 8f7392a7244..861db0a75f0 100644
--- a/packages/js/product-editor/src/components/variation-switcher-footer/variation-switcher-footer.tsx
+++ b/packages/js/product-editor/src/components/variation-switcher-footer/variation-switcher-footer.tsx
@@ -48,14 +48,14 @@ export function VariationSwitcherFooter( {
return {
previousVariation:
previousVariationId !== null &&
- getEntityRecord< ProductVariation >(
+ getEntityRecord(
'postType',
'product_variation',
previousVariationId
),
nextVariation:
nextVariationId !== null &&
- getEntityRecord< ProductVariation >(
+ getEntityRecord(
'postType',
'product_variation',
nextVariationId
diff --git a/packages/js/product-editor/src/components/variations-table/use-variations/use-variations.ts b/packages/js/product-editor/src/components/variations-table/use-variations/use-variations.ts
index 271b8e450c0..4d4ec58ea81 100644
--- a/packages/js/product-editor/src/components/variations-table/use-variations/use-variations.ts
+++ b/packages/js/product-editor/src/components/variations-table/use-variations/use-variations.ts
@@ -266,6 +266,7 @@ export function useVariations( { productId }: UseVariationsProps ) {
{ product_id: productId, id: variationId },
variation
).then( async ( response: ProductVariation ) => {
+ // @ts-expect-error There are no types for this.
await dispatch( 'core' ).invalidateResolution( 'getEntityRecord', [
'postType',
'product_variation',
@@ -293,12 +294,14 @@ export function useVariations( { productId }: UseVariationsProps ) {
} ).then( async ( response: ProductVariation ) => {
onSelect( response )( false );
+ // @ts-expect-error There are no types for this.
await dispatch( 'core' ).invalidateResolution( 'getEntityRecord', [
'postType',
'product',
productId,
] );
+ // @ts-expect-error There are no types for this.
await dispatch( 'core' ).invalidateResolution( 'getEntityRecord', [
'postType',
'product_variation',
@@ -317,6 +320,7 @@ export function useVariations( { productId }: UseVariationsProps ) {
}
async function onBatchUpdate( values: Partial< ProductVariation >[] ) {
+ // @ts-expect-error There are no types for this.
const { invalidateResolution: coreInvalidateResolution } =
dispatch( 'core' );
@@ -377,6 +381,7 @@ export function useVariations( { productId }: UseVariationsProps ) {
}
async function onBatchDelete( values: Pick< ProductVariation, 'id' >[] ) {
+ // @ts-expect-error There are no types for this.
const { invalidateResolution: coreInvalidateResolution } =
dispatch( 'core' );
diff --git a/packages/js/product-editor/src/hooks/use-confirm-unsaved-product-changes.ts b/packages/js/product-editor/src/hooks/use-confirm-unsaved-product-changes.ts
index ec3de0050e1..3dd51587a6a 100644
--- a/packages/js/product-editor/src/hooks/use-confirm-unsaved-product-changes.ts
+++ b/packages/js/product-editor/src/hooks/use-confirm-unsaved-product-changes.ts
@@ -22,6 +22,7 @@ export function useConfirmUnsavedProductChanges(
const { hasEdits } = useProductEdits( productType );
const { isSaving } = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const { isSavingEntityRecord } = select( 'core' );
return {
diff --git a/packages/js/product-editor/src/hooks/use-product-edits.ts b/packages/js/product-editor/src/hooks/use-product-edits.ts
index bea5cbe10b6..06c36e75bde 100644
--- a/packages/js/product-editor/src/hooks/use-product-edits.ts
+++ b/packages/js/product-editor/src/hooks/use-product-edits.ts
@@ -30,6 +30,7 @@ export function useProductEdits( productType = 'product' ) {
const { edits } = useSelect(
( select ) => {
+ // @ts-expect-error There are no types for this.
const { getEntityRecordNonTransientEdits } = select( 'core' );
const _edits = getEntityRecordNonTransientEdits(
diff --git a/packages/js/product-editor/src/hooks/use-product-variations-helper.ts b/packages/js/product-editor/src/hooks/use-product-variations-helper.ts
index e03342c6774..0f49693c09f 100644
--- a/packages/js/product-editor/src/hooks/use-product-variations-helper.ts
+++ b/packages/js/product-editor/src/hooks/use-product-variations-helper.ts
@@ -104,6 +104,7 @@ export function useProductVariationsHelper() {
await Promise.all(
variations.map( ( variationId ) =>
+ // @ts-expect-error There are no types for this.
dispatch( 'core' ).invalidateResolution( 'getEntityRecord', [
'postType',
'product_variation',
@@ -135,6 +136,7 @@ export function useProductVariationsHelper() {
}
)
.then( async ( response ) => {
+ // @ts-expect-error There are no types for this.
await dispatch( 'core' ).invalidateResolution(
'getEntityRecord',
[ 'postType', 'product', productId ]
diff --git a/packages/js/product-editor/src/hooks/use-variation-switcher.ts b/packages/js/product-editor/src/hooks/use-variation-switcher.ts
index dcbac65c13d..3d003000b91 100644
--- a/packages/js/product-editor/src/hooks/use-variation-switcher.ts
+++ b/packages/js/product-editor/src/hooks/use-variation-switcher.ts
@@ -19,6 +19,7 @@ export function useVariationSwitcher( {
parentId,
parentProductType,
}: VariationSwitcherProps ) {
+ // @ts-expect-error There are no types for this.
const { invalidateResolution } = useDispatch( 'core' );
const { invalidateResolutionForStoreSelector } = useDispatch(
EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME
@@ -29,7 +30,7 @@ export function useVariationSwitcher( {
return {};
}
const { getEntityRecord } = select( 'core' );
- const parentProduct = getEntityRecord< Product >(
+ const parentProduct = getEntityRecord(
'postType',
parentProductType || 'product',
parentId
diff --git a/packages/js/product-editor/src/utils/register-product-editor-block-type.ts b/packages/js/product-editor/src/utils/register-product-editor-block-type.ts
index eccb71b1603..29c5415c935 100644
--- a/packages/js/product-editor/src/utils/register-product-editor-block-type.ts
+++ b/packages/js/product-editor/src/utils/register-product-editor-block-type.ts
@@ -21,6 +21,7 @@ function useEvaluationContext( context: Record< string, unknown > ) {
const productId = useEntityId( 'postType', postType );
const getEvaluationContext = ( select: typeof WPSelect ) => {
+ // @ts-expect-error There are no types for this.
const editedProduct = select( 'core' ).getEditedEntityRecord(
'postType',
postType,
diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/save-hub.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/save-hub.tsx
index bbdd123c386..b894cc35f93 100644
--- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/save-hub.tsx
+++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/save-hub.tsx
@@ -165,6 +165,7 @@ export const SaveHub = () => {
resetHighlightedBlockIndex();
navigator.goToParent();
} catch ( error ) {
+ // @ts-expect-error The types for this are wrong.
createErrorNotice(
`${ __( 'Saving failed.', 'woocommerce' ) } ${ error }`
);
@@ -179,6 +180,7 @@ export const SaveHub = () => {
await save();
sendEvent( 'FINISH_CUSTOMIZATION' );
} catch ( error ) {
+ // @ts-expect-error The types for this are wrong.
createErrorNotice(
`${ __( 'Saving failed.', 'woocommerce' ) } ${ error }`
);
diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx
index f9d9c181fc3..b7eef40dc04 100644
--- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx
+++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx
@@ -130,6 +130,7 @@ const useLogoEdit = ( {
const { createErrorNotice } = useDispatch( noticesStore );
const onUploadError = ( message: string ) => {
+ // @ts-expect-error The types for this are wrong.
createErrorNotice( message, { type: 'snackbar' } );
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1e2d02fb991..cb735852549 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2649,6 +2649,9 @@ importers:
jest-cli:
specifier: ~27.5.1
version: 27.5.1
+ mini-css-extract-plugin:
+ specifier: ^2.7.6
+ version: 2.7.6(webpack@5.89.0)
postcss:
specifier: ^8.4.32
version: 8.4.32
@@ -2679,6 +2682,12 @@ importers:
webpack-cli:
specifier: ^3.3.12
version: 3.3.12(webpack@5.89.0)
+ webpack-remove-empty-scripts:
+ specifier: ^0.7.3
+ version: 0.7.3(webpack@5.89.0)
+ webpack-rtl-plugin:
+ specifier: ^2.0.0
+ version: 2.0.0
packages/js/tracks:
dependencies:
@@ -3357,7 +3366,7 @@ importers:
version: 20.0.3(postcss@8.4.32)(stylelint@14.16.1)
'@xstate/inspect':
specifier: 0.8.0
- version: 0.8.0(ws@8.14.2)(xstate@4.37.1)
+ version: 0.8.0(ws@8.15.0)(xstate@4.37.1)
'@xstate/test':
specifier: 0.5.1
version: 0.5.1(xstate@4.37.1)
@@ -4833,28 +4842,28 @@ packages:
'@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.20
- /@ariakit/core@0.3.7:
- resolution: {integrity: sha512-xp3+vofiIzXAocQIDx6vEQk0u2fgqn474NjM90mNCd9Kz7hi6Ks/VJwOlRaNV1oJyuPJALd6Mc6kUjz/fJRfow==}
+ /@ariakit/core@0.3.8:
+ resolution: {integrity: sha512-LlSCwbyyozMX4ZEobpYGcv1LFqOdBTdTYPZw3lAVgLcFSNivsazi3NkKM9qNWNIu00MS+xTa0+RuIcuWAjlB2Q==}
- /@ariakit/react-core@0.3.8(react-dom@17.0.2)(react@17.0.2):
- resolution: {integrity: sha512-uWCpUSYvehrY6hiU+wUbtAPmQ21yfEgzaw2THhU9sAIMXFxceV1f2MSbKdeuQ8lgumkNGh14N1r5uR4VbujGPQ==}
+ /@ariakit/react-core@0.3.9(react-dom@17.0.2)(react@17.0.2):
+ resolution: {integrity: sha512-K1Rcxr6FpF0n3L7Uvo+e5hm+zqoZmXLRcYF/skI+/j+ole+uNbnsnfGhG1avqJlklqH4bmkFkjZzmMdOnUC0Ig==}
peerDependencies:
react: ^17.0.2
react-dom: ^17.0.0 || ^18.0.0
dependencies:
- '@ariakit/core': 0.3.7
+ '@ariakit/core': 0.3.8
'@floating-ui/dom': 1.5.3
react: 17.0.2
react-dom: 17.0.2(react@17.0.2)
use-sync-external-store: 1.2.0(react@17.0.2)
- /@ariakit/react@0.3.8(react-dom@17.0.2)(react@17.0.2):
- resolution: {integrity: sha512-3nvjL2RSTiWjFsaTeRm5/RBZjGsMAUMPdxne1LNTFpwVEwbgVUDnoTsf1yQp9TwB1cldHDJiDDSKC4Cvza7YfA==}
+ /@ariakit/react@0.3.9(react-dom@17.0.2)(react@17.0.2):
+ resolution: {integrity: sha512-gC+gibh2go8wvBqzYXavlHKwAfmee5GUMrPSQ9WBBLIfm9nQElujxcHJydaRx+ULR5FbOnbZVC3vU2ic8hSrNw==}
peerDependencies:
react: ^17.0.2
react-dom: ^17.0.0 || ^18.0.0
dependencies:
- '@ariakit/react-core': 0.3.8(react-dom@17.0.2)(react@17.0.2)
+ '@ariakit/react-core': 0.3.9(react-dom@17.0.2)(react@17.0.2)
react: 17.0.2
react-dom: 17.0.2(react@17.0.2)
@@ -15678,7 +15687,7 @@ packages:
util-deprecate: 1.0.2
watchpack: 2.4.0
webpack: 4.47.0(webpack-cli@3.3.12)
- ws: 8.14.2
+ ws: 8.15.0
x-default-browser: 0.4.0
transitivePeerDependencies:
- '@storybook/mdx2-csf'
@@ -15755,7 +15764,7 @@ packages:
util-deprecate: 1.0.2
watchpack: 2.4.0
webpack: 4.47.0(webpack-cli@3.3.12)
- ws: 8.14.2
+ ws: 8.15.0
x-default-browser: 0.4.0
transitivePeerDependencies:
- '@storybook/mdx2-csf'
@@ -15813,7 +15822,7 @@ packages:
util: 0.12.5
util-deprecate: 1.0.2
watchpack: 2.4.0
- ws: 8.14.2
+ ws: 8.15.0
transitivePeerDependencies:
- bufferutil
- encoding
@@ -18599,9 +18608,9 @@ packages:
dependencies:
'@types/react': 17.0.71
'@types/wordpress__blocks': 11.0.7(react-dom@17.0.2)(react@17.0.2)
- '@types/wordpress__components': 19.10.5(react-dom@17.0.2)(react@17.0.2)
- '@types/wordpress__data': 6.0.2
- '@types/wordpress__keycodes': 2.3.1
+ '@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2)
+ '@types/wordpress__data': 7.0.0(react@17.0.2)
+ '@types/wordpress__keycodes': 2.3.3
'@wordpress/element': 4.4.1
react-autosize-textarea: 7.1.0(react-dom@17.0.2)(react@17.0.2)
transitivePeerDependencies:
@@ -18637,7 +18646,6 @@ packages:
dependencies:
'@types/react': 17.0.71
'@types/tinycolor2': 1.4.6
- '@types/wordpress__components': 23.0.10(react-dom@16.14.0)(react@17.0.2)
'@types/wordpress__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 6.4.5(react@17.0.2)
'@wordpress/element': 4.4.1
@@ -18653,7 +18661,6 @@ packages:
dependencies:
'@types/react': 17.0.71
'@types/tinycolor2': 1.4.6
- '@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2)
'@types/wordpress__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 6.4.5(react@17.0.2)
'@wordpress/element': 4.4.1
@@ -18663,21 +18670,6 @@ packages:
- react
- react-dom
- /@types/wordpress__components@23.0.10(react-dom@16.14.0)(react@17.0.2):
- resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==}
- dependencies:
- '@types/react': 17.0.71
- '@types/tinycolor2': 1.4.6
- '@types/wordpress__notices': 3.27.6(react@17.0.2)
- '@types/wordpress__rich-text': 3.4.6
- '@wordpress/element': 5.22.0
- downshift: 6.1.12(react@17.0.2)
- re-resizable: 6.9.11(react-dom@16.14.0)(react@17.0.2)
- transitivePeerDependencies:
- - react
- - react-dom
- dev: true
-
/@types/wordpress__components@23.0.10(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==}
dependencies:
@@ -18731,6 +18723,15 @@ packages:
dependencies:
'@types/react': 17.0.71
redux: 4.2.1
+ dev: true
+
+ /@types/wordpress__data@7.0.0(react@17.0.2):
+ resolution: {integrity: sha512-d3IBynESbBBEFNl9xwlbZvNB1uy1+yw17YpFGAnfp6vk78e28fD6wnlIVyfWN8xsDcAVPakTmcRvJ57ycoubAQ==}
+ deprecated: This is a stub types definition. @wordpress/data provides its own type definitions, so you do not need this installed.
+ dependencies:
+ '@wordpress/data': 6.6.1(react@17.0.2)
+ transitivePeerDependencies:
+ - react
/@types/wordpress__date@3.3.2:
resolution: {integrity: sha512-8ZW580Rn/NMVNC0uTHaPyWEMgtvymBDXybiJY6mufX5PdWGn4TGMik9ev3+nvwSXlOlz4Wsug/6jUwLfGJJH0w==}
@@ -18792,10 +18793,10 @@ packages:
/@types/wordpress__keycodes@2.3.1:
resolution: {integrity: sha512-CUZv3WdPvWqnEwojbc4yEttwZlvsMGI8YurgB9CHVJXx6nQ4U2RU6PB0Mv7nxATufduFDMKq8TNpCHBenZqEjQ==}
+ dev: true
/@types/wordpress__keycodes@2.3.3:
resolution: {integrity: sha512-jOI0L5NbLc0Ht/vkbZwgBfgWZbPKexXS+nxlYZ0kHQCjVCM7tdSwptItksCY3Qc9IV2nRc1pTnj/UJC2E2cUQw==}
- dev: true
/@types/wordpress__media-utils@3.0.0(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-iNQoyc9BD8HevjABZPh4L2bKEy/UYMb8+iswjn8AgUYjBpu8Y1x+9f+Zc6JRu/HEsFyEprY5LjSOxRLjti1gRQ==}
@@ -21254,7 +21255,7 @@ packages:
react: ^17.0.2
react-dom: ^18.0.0
dependencies:
- '@ariakit/react': 0.3.8(react-dom@17.0.2)(react@17.0.2)
+ '@ariakit/react': 0.3.9(react-dom@17.0.2)(react@17.0.2)
'@babel/runtime': 7.23.5
'@emotion/cache': 11.11.0
'@emotion/css': 11.11.2
@@ -24693,7 +24694,7 @@ packages:
xstate: 4.37.1
dev: true
- /@xstate/inspect@0.8.0(ws@8.14.2)(xstate@4.37.1):
+ /@xstate/inspect@0.8.0(ws@8.15.0)(xstate@4.37.1):
resolution: {integrity: sha512-wSkFeOnp+7dhn+zTThO0M4D2FEqZN9lGIWowJu5JLa2ojjtlzRwK8SkjcHZ4rLX8VnMev7kGjgQLrGs8kxy+hw==}
peerDependencies:
'@types/ws': ^8.0.0
@@ -24704,7 +24705,7 @@ packages:
optional: true
dependencies:
fast-safe-stringify: 2.1.1
- ws: 8.14.2
+ ws: 8.15.0
xstate: 4.37.1
dev: true
@@ -25164,7 +25165,6 @@ packages:
/ansis@1.5.6:
resolution: {integrity: sha512-vKn0k5V0oiaOClcUMNDFb7DvI3+asAozhg1wI8bLkYxV0lhfPtIuwjUa1wG9/YaUY/KwO9U2B7m0FMqzn/jXUQ==}
engines: {node: '>=12.13'}
- dev: false
/anymatch@2.0.0:
resolution: {integrity: sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==}
@@ -39124,7 +39124,7 @@ packages:
whatwg-encoding: 2.0.0
whatwg-mimetype: 3.0.0
whatwg-url: 11.0.0
- ws: 8.14.2
+ ws: 8.15.0
xml-name-validator: 4.0.0
transitivePeerDependencies:
- bufferutil
@@ -43619,7 +43619,7 @@ packages:
postcss: 8.4.32
schema-utils: 3.3.0
semver: 7.5.4
- webpack: 5.89.0(webpack-cli@3.3.12)
+ webpack: 5.89.0(webpack-cli@5.1.4)
/postcss-loader@6.2.1(postcss@8.4.31)(webpack@5.88.2):
resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==}
@@ -47660,7 +47660,7 @@ packages:
sass: 1.69.5
schema-utils: 3.3.0
semver: 7.5.4
- webpack: 5.89.0(webpack-cli@3.3.12)
+ webpack: 5.89.0(webpack-cli@5.1.4)
/sass-loader@12.6.0(sass@1.69.5)(webpack@5.88.2):
resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==}
@@ -52293,7 +52293,7 @@ packages:
webpack: 5.89.0(webpack-cli@4.10.0)
webpack-cli: 4.10.0(webpack-bundle-analyzer@3.9.0)(webpack-dev-server@4.15.1)(webpack@5.89.0)
webpack-dev-middleware: 5.3.3(webpack@5.89.0)
- ws: 8.14.2
+ ws: 8.15.0
transitivePeerDependencies:
- bufferutil
- debug
@@ -52344,7 +52344,7 @@ packages:
webpack: 5.88.2(@swc/core@1.3.100)(esbuild@0.18.20)(webpack-cli@4.10.0)
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.7.0)(webpack-dev-server@4.15.1)(webpack@5.88.2)
webpack-dev-middleware: 5.3.3(webpack@5.88.2)
- ws: 8.14.2
+ ws: 8.15.0
transitivePeerDependencies:
- bufferutil
- debug
@@ -52396,7 +52396,7 @@ packages:
webpack: 5.89.0(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.1)(webpack-dev-server@4.15.1)(webpack@5.89.0)
webpack-dev-middleware: 5.3.3(webpack@5.89.0)
- ws: 8.14.2
+ ws: 8.15.0
transitivePeerDependencies:
- bufferutil
- debug
@@ -52473,7 +52473,6 @@ packages:
dependencies:
ansis: 1.5.6
webpack: 5.89.0(webpack-cli@5.1.4)
- dev: false
/webpack-rtl-plugin@2.0.0:
resolution: {integrity: sha512-lROgFkiPjapg9tcZ8FiLWeP5pJoG00018aEjLTxSrVldPD1ON+LPlhKPHjb7eE8Bc0+KL23pxcAjWDGOv9+UAw==}
@@ -53332,6 +53331,18 @@ packages:
utf-8-validate:
optional: true
+ /ws@8.15.0:
+ resolution: {integrity: sha512-H/Z3H55mrcrgjFwI+5jKavgXvwQLtfPCUEp6pi35VhoB0pfcHnSoyuTzkBEZpzq49g1193CUEwIvmsjcotenYw==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: '>=5.0.2'
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+
/ws@8.5.0:
resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==}
engines: {node: '>=10.0.0'}
@@ -53455,7 +53466,7 @@ packages:
y-protocols: 1.0.6(yjs@13.6.10)
yjs: 13.6.10
optionalDependencies:
- ws: 8.14.2
+ ws: 8.15.0
transitivePeerDependencies:
- bufferutil
- supports-color