diff --git a/package-lock.json b/package-lock.json index 124be7f72bd69c..6011aa04bf689d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37128,6 +37128,11 @@ "node": ">= 0.8.0" } }, + "node_modules/lib-font": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/lib-font/-/lib-font-2.4.0.tgz", + "integrity": "sha512-j2Hyn12JjMLe9JkFDRq40q4+tOeDg276Z9Ezxyhas8HEv0jNLbRXyzG7r7n6QdLbWRtL2RYQtgVlIt3Q4ur6nQ==" + }, "node_modules/lib0": { "version": "0.2.79", "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.79.tgz", @@ -55402,6 +55407,7 @@ "downloadjs": "^1.4.7", "fast-deep-equal": "^3.1.3", "is-plain-object": "^5.0.0", + "lib-font": "2.4.0", "memize": "^2.1.0", "react-autosize-textarea": "^7.1.0", "rememo": "^4.0.2", @@ -68178,6 +68184,7 @@ "downloadjs": "^1.4.7", "fast-deep-equal": "^3.1.3", "is-plain-object": "^5.0.0", + "lib-font": "2.4.0", "memize": "^2.1.0", "react-autosize-textarea": "^7.1.0", "rememo": "^4.0.2", @@ -86998,6 +87005,11 @@ "type-check": "~0.3.2" } }, + "lib-font": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/lib-font/-/lib-font-2.4.0.tgz", + "integrity": "sha512-j2Hyn12JjMLe9JkFDRq40q4+tOeDg276Z9Ezxyhas8HEv0jNLbRXyzG7r7n6QdLbWRtL2RYQtgVlIt3Q4ur6nQ==" + }, "lib0": { "version": "0.2.79", "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.79.tgz", diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json index a74742def329cf..927b4261ce6471 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -72,6 +72,7 @@ "downloadjs": "^1.4.7", "fast-deep-equal": "^3.1.3", "is-plain-object": "^5.0.0", + "lib-font": "2.4.0", "memize": "^2.1.0", "react-autosize-textarea": "^7.1.0", "rememo": "^4.0.2", diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js b/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js index 7d5f7a2f79b169..25d4a780f7be32 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js @@ -16,9 +16,12 @@ import { useContext } from '@wordpress/element'; */ import { ALLOWED_FILE_EXTENSIONS } from './utils/constants'; import { FontLibraryContext } from './context'; -import { Font } from '../../../../lib/lib-font.browser'; import makeFamiliesFromFaces from './utils/make-families-from-faces'; import { loadFontFaceInBrowser } from './utils'; +/** + * External dependencies + */ +import { Font } from 'lib-font'; function LocalFonts() { const { installFonts } = useContext( FontLibraryContext ); diff --git a/packages/edit-site/src/components/save-hub/index.js b/packages/edit-site/src/components/save-hub/index.js index 9154429f770b0b..327c3d6b0b9619 100644 --- a/packages/edit-site/src/components/save-hub/index.js +++ b/packages/edit-site/src/components/save-hub/index.js @@ -27,13 +27,12 @@ const PUBLISH_ON_SAVE_ENTITIES = [ ]; export default function SaveHub() { - const saveNoticeId = 'site-edit-save-notice'; const { params } = useLocation(); const { __unstableMarkLastChangeAsPersistent } = useDispatch( blockEditorStore ); - const { createSuccessNotice, createErrorNotice, removeNotice } = + const { createSuccessNotice, createErrorNotice } = useDispatch( noticesStore ); const { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } = @@ -108,7 +107,6 @@ export default function SaveHub() { const saveCurrentEntity = async () => { if ( ! dirtyCurrentEntity ) return; - removeNotice( saveNoticeId ); const { kind, name, key, property } = dirtyCurrentEntity; try { @@ -134,7 +132,6 @@ export default function SaveHub() { createSuccessNotice( __( 'Site updated.' ), { type: 'snackbar', - id: saveNoticeId, } ); } catch ( error ) { createErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` ); @@ -151,7 +148,6 @@ export default function SaveHub() { disabled={ isSaving } aria-disabled={ isSaving } className="edit-site-save-hub__button" - __next40pxDefaultSize > { label } @@ -161,8 +157,7 @@ export default function SaveHub() { variant={ disabled ? null : 'primary' } showTooltip={ false } icon={ disabled && ! isSaving ? check : null } - defaultLabel={ label } - __next40pxDefaultSize + textForDefaultState={ label } /> ) } diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 3dc8407d7974b9..a62e9235b18fd8 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -167,4 +167,10 @@ module.exports = { endYear: 2040, } ), ].filter( Boolean ), + resolve: { + fallback: { + fs: false, + zlib: false, + }, + }, };