@wordpress/edit-site 5.28.3 → 5.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +51 -58
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +10 -15
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +115 -62
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +29 -8
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +17 -4
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +8 -14
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +11 -4
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +2 -2
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/ui.js +27 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/index.js +1 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -14
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +2 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/style-book/index.js +2 -0
- package/build/components/style-book/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +51 -58
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +11 -16
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +118 -65
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -9
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +17 -4
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +9 -15
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +11 -4
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +2 -2
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/ui.js +27 -2
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +1 -1
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -14
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +2 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +3 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/style-book/index.js +2 -0
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-style/style-rtl.css +36 -23
- package/build-style/style.css +36 -23
- package/package.json +18 -18
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
- package/src/components/global-styles/font-library-modal/context.js +92 -104
- package/src/components/global-styles/font-library-modal/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +307 -211
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- package/src/components/global-styles/font-library-modal/index.js +21 -14
- package/src/components/global-styles/font-library-modal/installed-fonts.js +243 -114
- package/src/components/global-styles/font-library-modal/library-font-variant.js +4 -4
- package/src/components/global-styles/font-library-modal/style.scss +15 -8
- package/src/components/global-styles/font-library-modal/upload-fonts.js +16 -18
- package/src/components/global-styles/font-library-modal/utils/index.js +10 -4
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +7 -18
- package/src/components/global-styles/screen-revisions/index.js +5 -2
- package/src/components/global-styles/ui.js +26 -2
- package/src/components/header-edit-mode/index.js +3 -1
- package/src/components/page-patterns/index.js +20 -20
- package/src/components/resizable-frame/index.js +1 -0
- package/src/components/sidebar/index.js +2 -1
- package/src/components/sidebar-dataviews/default-views.js +3 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
- package/src/components/style-book/index.js +5 -1
- package/build/components/global-styles/font-library-modal/collection-font-details.js +0 -50
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
- package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
- package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __experimentalVStack as VStack, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import CollectionFontVariant from './collection-font-variant';
|
|
11
|
-
import { isFontFontFaceInOutline } from './utils/fonts-outline';
|
|
12
|
-
import { sortFontFaces } from './utils/sort-font-faces';
|
|
13
|
-
function CollectionFontDetails({
|
|
14
|
-
font,
|
|
15
|
-
handleToggleVariant,
|
|
16
|
-
fontToInstallOutline
|
|
17
|
-
}) {
|
|
18
|
-
const fontFaces = font.fontFace && font.fontFace.length ? sortFontFaces(font.fontFace) : [{
|
|
19
|
-
fontFamily: font.fontFamily,
|
|
20
|
-
fontStyle: 'normal',
|
|
21
|
-
fontWeight: '400'
|
|
22
|
-
}];
|
|
23
|
-
return createElement(Fragment, null, createElement(Spacer, {
|
|
24
|
-
margin: 4
|
|
25
|
-
}), createElement(VStack, {
|
|
26
|
-
spacing: 0
|
|
27
|
-
}, createElement(Spacer, {
|
|
28
|
-
margin: 8
|
|
29
|
-
}), fontFaces.map((face, i) => createElement(CollectionFontVariant, {
|
|
30
|
-
font: font,
|
|
31
|
-
face: face,
|
|
32
|
-
key: `face${i}`,
|
|
33
|
-
handleToggleVariant: handleToggleVariant,
|
|
34
|
-
selected: isFontFontFaceInOutline(font.slug, font.fontFace ? face : null,
|
|
35
|
-
// If the font has no fontFace, we want to check if the font is in the outline
|
|
36
|
-
fontToInstallOutline)
|
|
37
|
-
}))), createElement(Spacer, {
|
|
38
|
-
margin: 16
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
export default CollectionFontDetails;
|
|
42
|
-
//# sourceMappingURL=collection-font-details.js.map
|
package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalVStack","VStack","__experimentalSpacer","Spacer","CollectionFontVariant","isFontFontFaceInOutline","sortFontFaces","CollectionFontDetails","font","handleToggleVariant","fontToInstallOutline","fontFaces","fontFace","length","fontFamily","fontStyle","fontWeight","createElement","Fragment","margin","spacing","map","face","i","key","selected","slug"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/collection-font-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport CollectionFontVariant from './collection-font-variant';\nimport { isFontFontFaceInOutline } from './utils/fonts-outline';\nimport { sortFontFaces } from './utils/sort-font-faces';\n\nfunction CollectionFontDetails( {\n\tfont,\n\thandleToggleVariant,\n\tfontToInstallOutline,\n} ) {\n\tconst fontFaces =\n\t\tfont.fontFace && font.fontFace.length\n\t\t\t? sortFontFaces( font.fontFace )\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfontFamily: font.fontFamily,\n\t\t\t\t\t\tfontStyle: 'normal',\n\t\t\t\t\t\tfontWeight: '400',\n\t\t\t\t\t},\n\t\t\t ];\n\n\treturn (\n\t\t<>\n\t\t\t<Spacer margin={ 4 } />\n\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t<Spacer margin={ 8 } />\n\t\t\t\t{ fontFaces.map( ( face, i ) => (\n\t\t\t\t\t<CollectionFontVariant\n\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\tface={ face }\n\t\t\t\t\t\tkey={ `face${ i }` }\n\t\t\t\t\t\thandleToggleVariant={ handleToggleVariant }\n\t\t\t\t\t\tselected={ isFontFontFaceInOutline(\n\t\t\t\t\t\t\tfont.slug,\n\t\t\t\t\t\t\tfont.fontFace ? face : null, // If the font has no fontFace, we want to check if the font is in the outline\n\t\t\t\t\t\t\tfontToInstallOutline\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t\t<Spacer margin={ 16 } />\n\t\t</>\n\t);\n}\n\nexport default CollectionFontDetails;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,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
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
-
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
7
|
-
function ConfirmDeleteDialog({
|
|
8
|
-
font,
|
|
9
|
-
isConfirmDeleteOpen,
|
|
10
|
-
handleConfirmUninstall,
|
|
11
|
-
handleCancelUninstall
|
|
12
|
-
}) {
|
|
13
|
-
return createElement(ConfirmDialog, {
|
|
14
|
-
isOpen: isConfirmDeleteOpen,
|
|
15
|
-
cancelButtonText: __('Cancel'),
|
|
16
|
-
confirmButtonText: __('Delete'),
|
|
17
|
-
onCancel: handleCancelUninstall,
|
|
18
|
-
onConfirm: handleConfirmUninstall
|
|
19
|
-
}, font && sprintf( /* translators: %s: Name of the font. */
|
|
20
|
-
__('Are you sure you want to delete "%s" font and all its variants and assets?'), font.name));
|
|
21
|
-
}
|
|
22
|
-
export default ConfirmDeleteDialog;
|
|
23
|
-
//# sourceMappingURL=confirm-delete-dialog.js.map
|
package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","__experimentalConfirmDialog","ConfirmDialog","ConfirmDeleteDialog","font","isConfirmDeleteOpen","handleConfirmUninstall","handleCancelUninstall","createElement","isOpen","cancelButtonText","confirmButtonText","onCancel","onConfirm","name"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/confirm-delete-dialog.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\nfunction ConfirmDeleteDialog( {\n\tfont,\n\tisConfirmDeleteOpen,\n\thandleConfirmUninstall,\n\thandleCancelUninstall,\n} ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isConfirmDeleteOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\tonCancel={ handleCancelUninstall }\n\t\t\tonConfirm={ handleConfirmUninstall }\n\t\t>\n\t\t\t{ font &&\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Name of the font. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Are you sure you want to delete \"%s\" font and all its variants and assets?'\n\t\t\t\t\t),\n\t\t\t\t\tfont.name\n\t\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmDeleteDialog;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AAEpF,SAASC,mBAAmBA,CAAE;EAC7BC,IAAI;EACJC,mBAAmB;EACnBC,sBAAsB;EACtBC;AACD,CAAC,EAAG;EACH,OACCC,aAAA,CAACN,aAAa;IACbO,MAAM,EAAGJ,mBAAqB;IAC9BK,gBAAgB,EAAGX,EAAE,CAAE,QAAS,CAAG;IACnCY,iBAAiB,EAAGZ,EAAE,CAAE,QAAS,CAAG;IACpCa,QAAQ,EAAGL,qBAAuB;IAClCM,SAAS,EAAGP;EAAwB,GAElCF,IAAI,IACLJ,OAAO,EACN;EACAD,EAAE,CACD,4EACD,CAAC,EACDK,IAAI,CAACU,IACN,CACa,CAAC;AAElB;AAEA,eAAeX,mBAAmB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
-
import { useContext } from '@wordpress/element';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import FontCard from './font-card';
|
|
12
|
-
import { FontLibraryContext } from './context';
|
|
13
|
-
function LibraryFontCard({
|
|
14
|
-
font,
|
|
15
|
-
...props
|
|
16
|
-
}) {
|
|
17
|
-
const {
|
|
18
|
-
getFontFacesActivated
|
|
19
|
-
} = useContext(FontLibraryContext);
|
|
20
|
-
const variantsInstalled = font?.fontFace?.length > 0 ? font.fontFace.length : 1;
|
|
21
|
-
const variantsActive = getFontFacesActivated(font.slug, font.source).length;
|
|
22
|
-
const variantsText = sprintf( /* translators: 1: Active font variants, 2: Total font variants. */
|
|
23
|
-
__('%1$s/%2$s variants active'), variantsActive, variantsInstalled);
|
|
24
|
-
return createElement(FontCard, {
|
|
25
|
-
font: font,
|
|
26
|
-
variantsText: variantsText,
|
|
27
|
-
...props
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export default LibraryFontCard;
|
|
31
|
-
//# sourceMappingURL=library-font-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","useContext","FontCard","FontLibraryContext","LibraryFontCard","font","props","getFontFacesActivated","variantsInstalled","fontFace","length","variantsActive","slug","source","variantsText","createElement"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/library-font-card.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontCard from './font-card';\nimport { FontLibraryContext } from './context';\n\nfunction LibraryFontCard( { font, ...props } ) {\n\tconst { getFontFacesActivated } = useContext( FontLibraryContext );\n\n\tconst variantsInstalled =\n\t\tfont?.fontFace?.length > 0 ? font.fontFace.length : 1;\n\tconst variantsActive = getFontFacesActivated(\n\t\tfont.slug,\n\t\tfont.source\n\t).length;\n\tconst variantsText = sprintf(\n\t\t/* translators: 1: Active font variants, 2: Total font variants. */\n\t\t__( '%1$s/%2$s variants active' ),\n\t\tvariantsActive,\n\t\tvariantsInstalled\n\t);\n\n\treturn (\n\t\t<FontCard font={ font } variantsText={ variantsText } { ...props } />\n\t);\n}\n\nexport default LibraryFontCard;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,SAASC,eAAeA,CAAE;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC9C,MAAM;IAAEC;EAAsB,CAAC,GAAGN,UAAU,CAAEE,kBAAmB,CAAC;EAElE,MAAMK,iBAAiB,GACtBH,IAAI,EAAEI,QAAQ,EAAEC,MAAM,GAAG,CAAC,GAAGL,IAAI,CAACI,QAAQ,CAACC,MAAM,GAAG,CAAC;EACtD,MAAMC,cAAc,GAAGJ,qBAAqB,CAC3CF,IAAI,CAACO,IAAI,EACTP,IAAI,CAACQ,MACN,CAAC,CAACH,MAAM;EACR,MAAMI,YAAY,GAAGd,OAAO,EAC3B;EACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCY,cAAc,EACdH,iBACD,CAAC;EAED,OACCO,aAAA,CAACb,QAAQ;IAACG,IAAI,EAAGA,IAAM;IAACS,YAAY,EAAGA,YAAc;IAAA,GAAMR;EAAK,CAAI,CAAC;AAEvE;AAEA,eAAeF,eAAe"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useContext } from '@wordpress/element';
|
|
6
|
-
import { __experimentalText as Text, __experimentalHeading as Heading, __experimentalVStack as VStack, __experimentalSpacer as Spacer, __experimentalHStack as HStack, Button, Notice, FlexBlock } from '@wordpress/components';
|
|
7
|
-
import { chevronLeft } from '@wordpress/icons';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { FontLibraryContext } from './context';
|
|
14
|
-
function TabPanelLayout({
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
notice,
|
|
18
|
-
handleBack,
|
|
19
|
-
children,
|
|
20
|
-
footer
|
|
21
|
-
}) {
|
|
22
|
-
const {
|
|
23
|
-
setNotice
|
|
24
|
-
} = useContext(FontLibraryContext);
|
|
25
|
-
return createElement("div", {
|
|
26
|
-
className: "font-library-modal__tabpanel-layout"
|
|
27
|
-
}, createElement(Spacer, {
|
|
28
|
-
margin: 4
|
|
29
|
-
}), createElement(VStack, {
|
|
30
|
-
spacing: 4,
|
|
31
|
-
justify: "space-between"
|
|
32
|
-
}, createElement(VStack, {
|
|
33
|
-
spacing: 2
|
|
34
|
-
}, createElement(HStack, {
|
|
35
|
-
justify: "flex-start"
|
|
36
|
-
}, !!handleBack && createElement(Button, {
|
|
37
|
-
variant: "tertiary",
|
|
38
|
-
onClick: handleBack,
|
|
39
|
-
icon: chevronLeft,
|
|
40
|
-
size: "small",
|
|
41
|
-
label: __('Back')
|
|
42
|
-
}), title && createElement(Heading, {
|
|
43
|
-
level: 2,
|
|
44
|
-
size: 13,
|
|
45
|
-
className: "edit-site-global-styles-header"
|
|
46
|
-
}, title)), description && createElement(Text, null, description), notice && createElement(FlexBlock, null, createElement(Spacer, {
|
|
47
|
-
margin: 1
|
|
48
|
-
}), createElement(Notice, {
|
|
49
|
-
status: notice.type,
|
|
50
|
-
onRemove: () => setNotice(null)
|
|
51
|
-
}, notice.message), createElement(Spacer, {
|
|
52
|
-
margin: 1
|
|
53
|
-
}))), createElement("div", {
|
|
54
|
-
className: "font-library-modal__tabpanel-layout__main"
|
|
55
|
-
}, children), footer && createElement("div", {
|
|
56
|
-
className: "font-library-modal__tabpanel-layout__footer"
|
|
57
|
-
}, footer)));
|
|
58
|
-
}
|
|
59
|
-
export default TabPanelLayout;
|
|
60
|
-
//# sourceMappingURL=tab-panel-layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","__experimentalText","Text","__experimentalHeading","Heading","__experimentalVStack","VStack","__experimentalSpacer","Spacer","__experimentalHStack","HStack","Button","Notice","FlexBlock","chevronLeft","__","FontLibraryContext","TabPanelLayout","title","description","notice","handleBack","children","footer","setNotice","createElement","className","margin","spacing","justify","variant","onClick","icon","size","label","level","status","type","onRemove","message"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/tab-panel-layout.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport {\n\t__experimentalText as Text,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHStack as HStack,\n\tButton,\n\tNotice,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { chevronLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { FontLibraryContext } from './context';\n\nfunction TabPanelLayout( {\n\ttitle,\n\tdescription,\n\tnotice,\n\thandleBack,\n\tchildren,\n\tfooter,\n} ) {\n\tconst { setNotice } = useContext( FontLibraryContext );\n\n\treturn (\n\t\t<div className=\"font-library-modal__tabpanel-layout\">\n\t\t\t<Spacer margin={ 4 } />\n\t\t\t<VStack spacing={ 4 } justify=\"space-between\">\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t{ !! handleBack && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\tonClick={ handleBack }\n\t\t\t\t\t\t\t\ticon={ chevronLeft }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-header\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t\t{ description && <Text>{ description }</Text> }\n\t\t\t\t\t{ notice && (\n\t\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t\t<Spacer margin={ 1 } />\n\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\tstatus={ notice.type }\n\t\t\t\t\t\t\t\tonRemove={ () => setNotice( null ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ notice.message }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t<Spacer margin={ 1 } />\n\t\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t\t<div className=\"font-library-modal__tabpanel-layout__main\">\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t\t{ footer && (\n\t\t\t\t\t<div className=\"font-library-modal__tabpanel-layout__footer\">\n\t\t\t\t\t\t{ footer }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default TabPanelLayout;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SACCC,kBAAkB,IAAIC,IAAI,EAC1BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,MAAM,EACNC,SAAS,QACH,uBAAuB;AAC9B,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,SAASC,cAAcA,CAAE;EACxBC,KAAK;EACLC,WAAW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E,aAAA;IAAKC,SAAS,EAAC;EAA6C,GACzDH,MACE,CAEC,CACJ,CAAC;AAER;AAEA,eAAeN,cAAc"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalVStack as VStack,
|
|
6
|
-
__experimentalSpacer as Spacer,
|
|
7
|
-
} from '@wordpress/components';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import CollectionFontVariant from './collection-font-variant';
|
|
13
|
-
import { isFontFontFaceInOutline } from './utils/fonts-outline';
|
|
14
|
-
import { sortFontFaces } from './utils/sort-font-faces';
|
|
15
|
-
|
|
16
|
-
function CollectionFontDetails( {
|
|
17
|
-
font,
|
|
18
|
-
handleToggleVariant,
|
|
19
|
-
fontToInstallOutline,
|
|
20
|
-
} ) {
|
|
21
|
-
const fontFaces =
|
|
22
|
-
font.fontFace && font.fontFace.length
|
|
23
|
-
? sortFontFaces( font.fontFace )
|
|
24
|
-
: [
|
|
25
|
-
{
|
|
26
|
-
fontFamily: font.fontFamily,
|
|
27
|
-
fontStyle: 'normal',
|
|
28
|
-
fontWeight: '400',
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<>
|
|
34
|
-
<Spacer margin={ 4 } />
|
|
35
|
-
<VStack spacing={ 0 }>
|
|
36
|
-
<Spacer margin={ 8 } />
|
|
37
|
-
{ fontFaces.map( ( face, i ) => (
|
|
38
|
-
<CollectionFontVariant
|
|
39
|
-
font={ font }
|
|
40
|
-
face={ face }
|
|
41
|
-
key={ `face${ i }` }
|
|
42
|
-
handleToggleVariant={ handleToggleVariant }
|
|
43
|
-
selected={ isFontFontFaceInOutline(
|
|
44
|
-
font.slug,
|
|
45
|
-
font.fontFace ? face : null, // If the font has no fontFace, we want to check if the font is in the outline
|
|
46
|
-
fontToInstallOutline
|
|
47
|
-
) }
|
|
48
|
-
/>
|
|
49
|
-
) ) }
|
|
50
|
-
</VStack>
|
|
51
|
-
<Spacer margin={ 16 } />
|
|
52
|
-
</>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default CollectionFontDetails;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
6
|
-
|
|
7
|
-
function ConfirmDeleteDialog( {
|
|
8
|
-
font,
|
|
9
|
-
isConfirmDeleteOpen,
|
|
10
|
-
handleConfirmUninstall,
|
|
11
|
-
handleCancelUninstall,
|
|
12
|
-
} ) {
|
|
13
|
-
return (
|
|
14
|
-
<ConfirmDialog
|
|
15
|
-
isOpen={ isConfirmDeleteOpen }
|
|
16
|
-
cancelButtonText={ __( 'Cancel' ) }
|
|
17
|
-
confirmButtonText={ __( 'Delete' ) }
|
|
18
|
-
onCancel={ handleCancelUninstall }
|
|
19
|
-
onConfirm={ handleConfirmUninstall }
|
|
20
|
-
>
|
|
21
|
-
{ font &&
|
|
22
|
-
sprintf(
|
|
23
|
-
/* translators: %s: Name of the font. */
|
|
24
|
-
__(
|
|
25
|
-
'Are you sure you want to delete "%s" font and all its variants and assets?'
|
|
26
|
-
),
|
|
27
|
-
font.name
|
|
28
|
-
) }
|
|
29
|
-
</ConfirmDialog>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default ConfirmDeleteDialog;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import { useContext } from '@wordpress/element';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import FontCard from './font-card';
|
|
11
|
-
import { FontLibraryContext } from './context';
|
|
12
|
-
|
|
13
|
-
function LibraryFontCard( { font, ...props } ) {
|
|
14
|
-
const { getFontFacesActivated } = useContext( FontLibraryContext );
|
|
15
|
-
|
|
16
|
-
const variantsInstalled =
|
|
17
|
-
font?.fontFace?.length > 0 ? font.fontFace.length : 1;
|
|
18
|
-
const variantsActive = getFontFacesActivated(
|
|
19
|
-
font.slug,
|
|
20
|
-
font.source
|
|
21
|
-
).length;
|
|
22
|
-
const variantsText = sprintf(
|
|
23
|
-
/* translators: 1: Active font variants, 2: Total font variants. */
|
|
24
|
-
__( '%1$s/%2$s variants active' ),
|
|
25
|
-
variantsActive,
|
|
26
|
-
variantsInstalled
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<FontCard font={ font } variantsText={ variantsText } { ...props } />
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default LibraryFontCard;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useContext } from '@wordpress/element';
|
|
5
|
-
import {
|
|
6
|
-
__experimentalText as Text,
|
|
7
|
-
__experimentalHeading as Heading,
|
|
8
|
-
__experimentalVStack as VStack,
|
|
9
|
-
__experimentalSpacer as Spacer,
|
|
10
|
-
__experimentalHStack as HStack,
|
|
11
|
-
Button,
|
|
12
|
-
Notice,
|
|
13
|
-
FlexBlock,
|
|
14
|
-
} from '@wordpress/components';
|
|
15
|
-
import { chevronLeft } from '@wordpress/icons';
|
|
16
|
-
import { __ } from '@wordpress/i18n';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
import { FontLibraryContext } from './context';
|
|
22
|
-
|
|
23
|
-
function TabPanelLayout( {
|
|
24
|
-
title,
|
|
25
|
-
description,
|
|
26
|
-
notice,
|
|
27
|
-
handleBack,
|
|
28
|
-
children,
|
|
29
|
-
footer,
|
|
30
|
-
} ) {
|
|
31
|
-
const { setNotice } = useContext( FontLibraryContext );
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div className="font-library-modal__tabpanel-layout">
|
|
35
|
-
<Spacer margin={ 4 } />
|
|
36
|
-
<VStack spacing={ 4 } justify="space-between">
|
|
37
|
-
<VStack spacing={ 2 }>
|
|
38
|
-
<HStack justify="flex-start">
|
|
39
|
-
{ !! handleBack && (
|
|
40
|
-
<Button
|
|
41
|
-
variant="tertiary"
|
|
42
|
-
onClick={ handleBack }
|
|
43
|
-
icon={ chevronLeft }
|
|
44
|
-
size="small"
|
|
45
|
-
label={ __( 'Back' ) }
|
|
46
|
-
/>
|
|
47
|
-
) }
|
|
48
|
-
{ title && (
|
|
49
|
-
<Heading
|
|
50
|
-
level={ 2 }
|
|
51
|
-
size={ 13 }
|
|
52
|
-
className="edit-site-global-styles-header"
|
|
53
|
-
>
|
|
54
|
-
{ title }
|
|
55
|
-
</Heading>
|
|
56
|
-
) }
|
|
57
|
-
</HStack>
|
|
58
|
-
{ description && <Text>{ description }</Text> }
|
|
59
|
-
{ notice && (
|
|
60
|
-
<FlexBlock>
|
|
61
|
-
<Spacer margin={ 1 } />
|
|
62
|
-
<Notice
|
|
63
|
-
status={ notice.type }
|
|
64
|
-
onRemove={ () => setNotice( null ) }
|
|
65
|
-
>
|
|
66
|
-
{ notice.message }
|
|
67
|
-
</Notice>
|
|
68
|
-
<Spacer margin={ 1 } />
|
|
69
|
-
</FlexBlock>
|
|
70
|
-
) }
|
|
71
|
-
</VStack>
|
|
72
|
-
<div className="font-library-modal__tabpanel-layout__main">
|
|
73
|
-
{ children }
|
|
74
|
-
</div>
|
|
75
|
-
{ footer && (
|
|
76
|
-
<div className="font-library-modal__tabpanel-layout__footer">
|
|
77
|
-
{ footer }
|
|
78
|
-
</div>
|
|
79
|
-
) }
|
|
80
|
-
</VStack>
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default TabPanelLayout;
|