Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font library: lib-font as npm dependency #54440

Open
wants to merge 119 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
34dd73e
adding files from original branch try/font-library
matiasbenedetto Aug 14, 2023
d56b8fd
importing remaining files
matiasbenedetto Aug 16, 2023
a57e99a
renaming font library to fonts library
matiasbenedetto Aug 16, 2023
e1588ea
renaming FontLibraryModal to FontsLibraryModal
matiasbenedetto Aug 16, 2023
5df8f78
Merge branch 'trunk' into try/fonts-library-frontend
matiasbenedetto Aug 16, 2023
051756c
update frontend based on backend changes
matiasbenedetto Aug 16, 2023
28ae9b8
TEMPORAL FIX: Adding Google fonts endpoint a font families list
matiasbenedetto Aug 16, 2023
6f4edd0
update uninstall functionality to latest backend implementation
matiasbenedetto Aug 16, 2023
0cc9566
fix loadedUrls state
matiasbenedetto Aug 17, 2023
9697545
fixing library not refreshing after uninstall
matiasbenedetto Aug 17, 2023
3a6d6e2
move uninstall notification functionality to context
matiasbenedetto Aug 17, 2023
953f2c1
Add notification on snackbar when installing fonts
matiasbenedetto Aug 17, 2023
626b04c
lint js
matiasbenedetto Aug 17, 2023
5e9b771
Merge branch trunk into try/fonts-library-frontend
matiasbenedetto Aug 17, 2023
460eb66
merge with trunk
matiasbenedetto Aug 22, 2023
de8c186
renaming FontS Library to Font Library
matiasbenedetto Aug 22, 2023
cf3785d
Removing google_fonts api endpoint
matiasbenedetto Aug 22, 2023
bab1793
Removing Google fonts specific code
matiasbenedetto Aug 23, 2023
c068c4b
refresh library after local fonts upload
matiasbenedetto Aug 23, 2023
0cf4510
remove unwanted console.log
matiasbenedetto Aug 23, 2023
626c321
css fix
matiasbenedetto Aug 23, 2023
4bfae33
removing file key from fontface data sent to the server
matiasbenedetto Aug 23, 2023
2290c98
open local fonts tab when click the + button
matiasbenedetto Aug 23, 2023
c3a31d8
remove font slug prefix
matiasbenedetto Aug 23, 2023
8c3d7b6
removing empty line
matiasbenedetto Aug 23, 2023
26bf51a
check by source (theme and custom)if fonts are activated
matiasbenedetto Aug 24, 2023
3e7eba8
delete demo related component and function
matiasbenedetto Aug 28, 2023
e5b720c
remove font family previews
matiasbenedetto Aug 28, 2023
c0db410
modal width
matiasbenedetto Aug 28, 2023
6d9714b
implementing mockups look for library font variants
matiasbenedetto Aug 28, 2023
0141571
reduce margin
matiasbenedetto Aug 28, 2023
84c2e32
display unintall button disabled when the font can not be uninstalled
matiasbenedetto Aug 28, 2023
a86f1b6
removing preview controls link
matiasbenedetto Aug 28, 2023
5814e03
removing unused imports
matiasbenedetto Aug 28, 2023
a28d2db
lint css
matiasbenedetto Aug 29, 2023
79f71de
lint css
matiasbenedetto Aug 29, 2023
af387ed
fix import
matiasbenedetto Aug 29, 2023
2efb763
deactivate font families before uninstalling them
matiasbenedetto Aug 31, 2023
7e4a414
flip buttons order
matiasbenedetto Aug 31, 2023
559bcb0
Merge branch 'trunk' into try/fonts-library-frontend-stage1
matiasbenedetto Sep 1, 2023
c59f2e1
Moving uninstall button to modal footer
matiasbenedetto Sep 1, 2023
f77066d
be able to indicate nested paths on __experimentalSaveSpecifiedEntity…
matiasbenedetto Sep 4, 2023
efe375a
save only fontFamilies when persisting global styles from font librar…
matiasbenedetto Sep 5, 2023
99dc420
Add edits data to the useEntityRecord
matiasbenedetto Sep 5, 2023
595b3bf
disable save button when there are no changes to be saved
matiasbenedetto Sep 5, 2023
6b0ce78
add notification when font families are updated
matiasbenedetto Sep 5, 2023
4f029a5
upload local fonts just after selecting them
matiasbenedetto Sep 5, 2023
0669eea
Removing upload local fonts tab from modal
matiasbenedetto Sep 5, 2023
559dbe2
drop zone background color
matiasbenedetto Sep 5, 2023
53d7c5c
remove unused import
matiasbenedetto Sep 5, 2023
5de552a
activate fonts just after installed
matiasbenedetto Sep 6, 2023
7c0f5f5
fix typo
matiasbenedetto Sep 6, 2023
82cee5c
hide confirm dialog after deleting font
matiasbenedetto Sep 6, 2023
3de8efa
remove + button
matiasbenedetto Sep 6, 2023
85fdafa
Merge branch 'trunk' into try/fonts-library-frontend-stage1
matiasbenedetto Sep 6, 2023
4496b4d
Merge branch 'trunk' into try/fonts-library-frontend-stage1
matiasbenedetto Sep 6, 2023
a2017c0
fix merging font families functions
matiasbenedetto Sep 6, 2023
1993c3a
add tests for mergeFontFamilies and mergeFontFaces functions
matiasbenedetto Sep 6, 2023
bcbd8f1
add tests for getFontFaceVariantName
matiasbenedetto Sep 6, 2023
93261a8
fix logic bug and add tests for isUrlEnconded function
matiasbenedetto Sep 6, 2023
3d3a191
fix logic bug in setUIValuesNeeded function
matiasbenedetto Sep 6, 2023
7496d89
add tests for setUIValuesNeeded function
matiasbenedetto Sep 6, 2023
bc5289a
move utils and utils tests
matiasbenedetto Sep 6, 2023
8297ed9
remove import not needed
matiasbenedetto Sep 6, 2023
670cd90
remove default demo config
matiasbenedetto Sep 6, 2023
43fd8ee
fix typo
matiasbenedetto Sep 6, 2023
ebd765f
update file extensions allowed in file dialog on mac
matiasbenedetto Sep 6, 2023
27868b0
remove extra space
matiasbenedetto Sep 6, 2023
09bc77d
Apply coding standards
mikachan Sep 7, 2023
4cd05a4
Make font cards buttons
mikachan Sep 7, 2023
8d4ed5f
Fix linter errors
mikachan Sep 7, 2023
71e651d
Fix max depth error
mikachan Sep 7, 2023
c841f0b
Revert font lib formatting
mikachan Sep 7, 2023
47cc979
Fix linter errors
mikachan Sep 7, 2023
3f86b10
Undo e2e test linter fixes
mikachan Sep 7, 2023
7225cc9
Remove more e2e test changes
mikachan Sep 7, 2023
5f8e955
fixing error persisting activation changes
matiasbenedetto Sep 7, 2023
8745fd4
improving font previews
matiasbenedetto Sep 7, 2023
23a3608
adding unit tests for getPreviewStyle util
matiasbenedetto Sep 7, 2023
304921f
lint fix
matiasbenedetto Sep 7, 2023
f649f8b
fix accepted file extensions not working properly on firefox
matiasbenedetto Sep 7, 2023
1800e50
sort font faces by weight
matiasbenedetto Sep 7, 2023
77b6201
move the code of toggleActivatedFont to a another file to reduce thei…
matiasbenedetto Sep 7, 2023
4828788
adding tests for toggleFont
matiasbenedetto Sep 7, 2023
cf1f38e
lint
matiasbenedetto Sep 7, 2023
b3e2c4e
avoid resetting theme font families when activating or deactivating f…
matiasbenedetto Sep 7, 2023
c54fda0
fix issue where fontFace length is zero
madhusudhand Sep 8, 2023
5242b85
Add deps comment to toggleFont file
mikachan Sep 8, 2023
6161311
Fix theme and custom undefined errors
mikachan Sep 8, 2023
6ca4bc4
Add initial e2e tests
mikachan Sep 8, 2023
7359c40
Merge branch 'trunk' into try/fonts-library-frontend-stage1
mikachan Sep 8, 2023
f2f228f
Refactor e2e test order
mikachan Sep 8, 2023
14aa39a
avoid re-activating all the font faces of a installed font when a new…
matiasbenedetto Sep 8, 2023
d216f30
adding tests for utils functions
matiasbenedetto Sep 8, 2023
b337852
renaming parameters
matiasbenedetto Sep 8, 2023
1c20021
adding jsdoc for function
matiasbenedetto Sep 8, 2023
61f7db3
remove code no longer needed
matiasbenedetto Sep 8, 2023
43dae16
avoid potential errors with non existing fontFace array
matiasbenedetto Sep 8, 2023
17d5885
Revert "avoid potential errors with non existing fontFace array"
matiasbenedetto Sep 8, 2023
83ae921
fix error uploading several font faces from different font families
matiasbenedetto Sep 8, 2023
e0f3f70
Fix font library modal prop typo
Sep 10, 2023
94e714c
activate the right font faces (the installed ones instead of the loca…
matiasbenedetto Sep 11, 2023
6bb6a98
Font library: load font assets on editor canvas (#54334)
vcanales Sep 11, 2023
99cbc39
removing success snackbar notifications
matiasbenedetto Sep 11, 2023
e44b58b
update uninstall font family button look
matiasbenedetto Sep 11, 2023
326065e
delete any change to save-button component
matiasbenedetto Sep 11, 2023
7ec227c
use a simple file id for uploaded files
matiasbenedetto Sep 12, 2023
31b16fd
Update delete button to be tertiary.
jasmussen Sep 12, 2023
4f0abf7
fix test
matiasbenedetto Sep 12, 2023
d01a98d
use FONT_LIBRARY_DISABLE constant to disable Font Library and Font Fa…
matiasbenedetto Sep 12, 2023
3f626b7
move confirm uninstall dialog to a new component
matiasbenedetto Sep 12, 2023
ac848dd
Merge branch 'trunk' into try/fonts-library-frontend-stage1
matiasbenedetto Sep 13, 2023
d1a98bc
Merge branch 'trunk' into try/fonts-library-frontend-stage1
matiasbenedetto Sep 13, 2023
a71eedc
adding progress bar while installing fonts
matiasbenedetto Sep 13, 2023
bb4f403
add early return
matiasbenedetto Sep 13, 2023
8736452
format php
matiasbenedetto Sep 13, 2023
f9f2f0d
Deps: use lib-font as an npm dependency
Sep 13, 2023
55e4ff4
remove local lib-font copy
Sep 15, 2023
1361066
Merge branch 'trunk' into try/lib-font-as-npm-dep
vcanales Sep 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/edit-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
9 changes: 2 additions & 7 deletions packages/edit-site/src/components/save-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } =
Expand Down Expand Up @@ -108,7 +107,6 @@ export default function SaveHub() {
const saveCurrentEntity = async () => {
if ( ! dirtyCurrentEntity ) return;

removeNotice( saveNoticeId );
const { kind, name, key, property } = dirtyCurrentEntity;

try {
Expand All @@ -134,7 +132,6 @@ export default function SaveHub() {

createSuccessNotice( __( 'Site updated.' ), {
type: 'snackbar',
id: saveNoticeId,
} );
} catch ( error ) {
createErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` );
Expand All @@ -151,7 +148,6 @@ export default function SaveHub() {
disabled={ isSaving }
aria-disabled={ isSaving }
className="edit-site-save-hub__button"
__next40pxDefaultSize
>
{ label }
</Button>
Expand All @@ -161,8 +157,7 @@ export default function SaveHub() {
variant={ disabled ? null : 'primary' }
showTooltip={ false }
icon={ disabled && ! isSaving ? check : null }
defaultLabel={ label }
__next40pxDefaultSize
textForDefaultState={ label }
/>
) }
</HStack>
Expand Down
6 changes: 6 additions & 0 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ module.exports = {
endYear: 2040,
} ),
].filter( Boolean ),
resolve: {
fallback: {
fs: false,
zlib: false,
},
},
};
Loading