@wordpress/edit-site 5.28.3 → 5.28.4
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/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 +113 -60
- 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/installed-fonts.js +142 -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 +6 -4
- package/build/components/global-styles/font-library-modal/upload-fonts.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/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/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 +116 -63
- 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/installed-fonts.js +142 -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 +7 -5
- package/build-module/components/global-styles/font-library-modal/upload-fonts.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/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 +28 -22
- package/build-style/style.css +28 -22
- 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/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +304 -210
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- package/src/components/global-styles/font-library-modal/installed-fonts.js +226 -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 +13 -5
- 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/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
|
@@ -74,8 +74,9 @@ function SidebarScreens() {
|
|
|
74
74
|
</SidebarScreenWrapper>
|
|
75
75
|
<SidebarScreenWrapper path="/pages">
|
|
76
76
|
<SidebarNavigationScreen
|
|
77
|
-
title={ __( '
|
|
77
|
+
title={ __( 'Manage pages' ) }
|
|
78
78
|
content={ <DataViewsSidebarContent /> }
|
|
79
|
+
backPath="/page"
|
|
79
80
|
/>
|
|
80
81
|
</SidebarScreenWrapper>
|
|
81
82
|
<SidebarScreenWrapper path="/page/:postId">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { trash } from '@wordpress/icons';
|
|
5
|
+
import { trash, pages, drafts } from '@wordpress/icons';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -51,11 +51,13 @@ export const DEFAULT_VIEWS = {
|
|
|
51
51
|
{
|
|
52
52
|
title: __( 'All pages' ),
|
|
53
53
|
slug: 'all',
|
|
54
|
+
icon: pages,
|
|
54
55
|
view: DEFAULT_PAGE_BASE,
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
title: __( 'Drafts' ),
|
|
58
59
|
slug: 'drafts',
|
|
60
|
+
icon: drafts,
|
|
59
61
|
view: {
|
|
60
62
|
...DEFAULT_PAGE_BASE,
|
|
61
63
|
filters: [
|
|
@@ -31,7 +31,7 @@ function TemplateDataviewItem( { template, isActive } ) {
|
|
|
31
31
|
export default function DataviewsTemplatesSidebarContent( {
|
|
32
32
|
activeView,
|
|
33
33
|
postType,
|
|
34
|
-
|
|
34
|
+
title,
|
|
35
35
|
} ) {
|
|
36
36
|
const { records } = useEntityRecords( 'postType', postType, {
|
|
37
37
|
per_page: -1,
|
|
@@ -54,7 +54,7 @@ export default function DataviewsTemplatesSidebarContent( {
|
|
|
54
54
|
<ItemGroup>
|
|
55
55
|
<DataViewItem
|
|
56
56
|
slug={ 'all' }
|
|
57
|
-
title={
|
|
57
|
+
title={ title }
|
|
58
58
|
icon={ layout }
|
|
59
59
|
isActive={ activeView === 'all' }
|
|
60
60
|
isCustom="false"
|
|
@@ -21,17 +21,19 @@ import DataviewsTemplatesSidebarContent from './content';
|
|
|
21
21
|
|
|
22
22
|
const config = {
|
|
23
23
|
[ TEMPLATE_POST_TYPE ]: {
|
|
24
|
-
title: __( '
|
|
24
|
+
title: __( 'Manage templates' ),
|
|
25
25
|
description: __(
|
|
26
26
|
'Create new templates, or reset any customizations made to the templates supplied by your theme.'
|
|
27
27
|
),
|
|
28
|
+
contentTitle: __( 'All templates' ),
|
|
28
29
|
},
|
|
29
30
|
[ TEMPLATE_PART_POST_TYPE ]: {
|
|
30
|
-
title: __( '
|
|
31
|
+
title: __( 'Manage template parts' ),
|
|
31
32
|
description: __(
|
|
32
33
|
'Create new template parts, or reset any customizations made to the template parts supplied by your theme.'
|
|
33
34
|
),
|
|
34
35
|
backPath: '/patterns',
|
|
36
|
+
contentTitle: __( 'All template parts' ),
|
|
35
37
|
},
|
|
36
38
|
};
|
|
37
39
|
|
|
@@ -62,7 +64,7 @@ export default function SidebarNavigationScreenTemplatesBrowse() {
|
|
|
62
64
|
<DataviewsTemplatesSidebarContent
|
|
63
65
|
activeView={ activeView }
|
|
64
66
|
postType={ postType }
|
|
65
|
-
|
|
67
|
+
title={ config[ postType ].contentTitle }
|
|
66
68
|
/>
|
|
67
69
|
}
|
|
68
70
|
/>
|
|
@@ -425,7 +425,11 @@ const Example = ( { id, title, blocks, isSelected, onClick } ) => {
|
|
|
425
425
|
[]
|
|
426
426
|
);
|
|
427
427
|
const settings = useMemo(
|
|
428
|
-
() => ( {
|
|
428
|
+
() => ( {
|
|
429
|
+
...originalSettings,
|
|
430
|
+
focusMode: false, // Disable "Spotlight mode".
|
|
431
|
+
__unstableIsPreviewMode: true,
|
|
432
|
+
} ),
|
|
429
433
|
[ originalSettings ]
|
|
430
434
|
);
|
|
431
435
|
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _collectionFontVariant = _interopRequireDefault(require("./collection-font-variant"));
|
|
11
|
-
var _fontsOutline = require("./utils/fonts-outline");
|
|
12
|
-
var _sortFontFaces = require("./utils/sort-font-faces");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function CollectionFontDetails({
|
|
22
|
-
font,
|
|
23
|
-
handleToggleVariant,
|
|
24
|
-
fontToInstallOutline
|
|
25
|
-
}) {
|
|
26
|
-
const fontFaces = font.fontFace && font.fontFace.length ? (0, _sortFontFaces.sortFontFaces)(font.fontFace) : [{
|
|
27
|
-
fontFamily: font.fontFamily,
|
|
28
|
-
fontStyle: 'normal',
|
|
29
|
-
fontWeight: '400'
|
|
30
|
-
}];
|
|
31
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
32
|
-
margin: 4
|
|
33
|
-
}), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
34
|
-
spacing: 0
|
|
35
|
-
}, (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
36
|
-
margin: 8
|
|
37
|
-
}), fontFaces.map((face, i) => (0, _react.createElement)(_collectionFontVariant.default, {
|
|
38
|
-
font: font,
|
|
39
|
-
face: face,
|
|
40
|
-
key: `face${i}`,
|
|
41
|
-
handleToggleVariant: handleToggleVariant,
|
|
42
|
-
selected: (0, _fontsOutline.isFontFontFaceInOutline)(font.slug, font.fontFace ? face : null,
|
|
43
|
-
// If the font has no fontFace, we want to check if the font is in the outline
|
|
44
|
-
fontToInstallOutline)
|
|
45
|
-
}))), (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
46
|
-
margin: 16
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
var _default = exports.default = CollectionFontDetails;
|
|
50
|
-
//# sourceMappingURL=collection-font-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_collectionFontVariant","_interopRequireDefault","_fontsOutline","_sortFontFaces","CollectionFontDetails","font","handleToggleVariant","fontToInstallOutline","fontFaces","fontFace","length","sortFontFaces","fontFamily","fontStyle","fontWeight","_react","createElement","Fragment","__experimentalSpacer","margin","__experimentalVStack","spacing","map","face","i","default","key","selected","isFontFontFaceInOutline","slug","_default","exports"],"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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAKA,SAASK,qBAAqBA,CAAE;EAC/BC,IAAI;EACJC,mBAAmB;EACnBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GACdH,IAAI,CAACI,QAAQ,IAAIJ,IAAI,CAACI,QAAQ,CAACC,MAAM,GAClC,IAAAC,4BAAa,EAAEN,IAAI,CAACI,QAAS,CAAC,GAC9B,CACA;IACCG,UAAU,EAAEP,IAAI,CAACO,UAAU;IAC3BC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE;EACb,CAAC,CACA;EAEL,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAoB,oBAAM;IAACC,MAAM,EAAG;EAAG,CAAE,CAAC,EACvB,IAAAJ,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAsB,oBAAM;IAACC,OAAO,EAAG;EAAG,GACpB,IAAAN,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAoB,oBAAM;IAACC,MAAM,EAAG;EAAG,CAAE,CAAC,EACrBX,SAAS,CAACc,GAAG,CAAE,CAAEC,IAAI,EAAEC,CAAC,KACzB,IAAAT,MAAA,CAAAC,aAAA,EAAChB,sBAAA,CAAAyB,OAAqB;IACrBpB,IAAI,EAAGA,IAAM;IACbkB,IAAI,EAAGA,IAAM;IACbG,GAAG,EAAI,OAAOF,CAAG,EAAG;IACpBlB,mBAAmB,EAAGA,mBAAqB;IAC3CqB,QAAQ,EAAG,IAAAC,qCAAuB,EACjCvB,IAAI,CAACwB,IAAI,EACTxB,IAAI,CAACI,QAAQ,GAAGc,IAAI,GAAG,IAAI;IAAE;IAC7BhB,oBACD;EAAG,CACH,CACA,CACK,CAAC,EACT,IAAAQ,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAoB,oBAAM;IAACC,MAAM,EAAG;EAAI,CAAE,CACtB,CAAC;AAEL;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcrB,qBAAqB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
function ConfirmDeleteDialog({
|
|
15
|
-
font,
|
|
16
|
-
isConfirmDeleteOpen,
|
|
17
|
-
handleConfirmUninstall,
|
|
18
|
-
handleCancelUninstall
|
|
19
|
-
}) {
|
|
20
|
-
return (0, _react.createElement)(_components.__experimentalConfirmDialog, {
|
|
21
|
-
isOpen: isConfirmDeleteOpen,
|
|
22
|
-
cancelButtonText: (0, _i18n.__)('Cancel'),
|
|
23
|
-
confirmButtonText: (0, _i18n.__)('Delete'),
|
|
24
|
-
onCancel: handleCancelUninstall,
|
|
25
|
-
onConfirm: handleConfirmUninstall
|
|
26
|
-
}, font && (0, _i18n.sprintf)( /* translators: %s: Name of the font. */
|
|
27
|
-
(0, _i18n.__)('Are you sure you want to delete "%s" font and all its variants and assets?'), font.name));
|
|
28
|
-
}
|
|
29
|
-
var _default = exports.default = ConfirmDeleteDialog;
|
|
30
|
-
//# sourceMappingURL=confirm-delete-dialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","ConfirmDeleteDialog","font","isConfirmDeleteOpen","handleConfirmUninstall","handleCancelUninstall","_react","createElement","__experimentalConfirmDialog","isOpen","cancelButtonText","__","confirmButtonText","onCancel","onConfirm","sprintf","name","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,mBAAmBA,CAAE;EAC7BC,IAAI;EACJC,mBAAmB;EACnBC,sBAAsB;EACtBC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,WAAA,CAAAQ,2BAAa;IACbC,MAAM,EAAGN,mBAAqB;IAC9BO,gBAAgB,EAAG,IAAAC,QAAE,EAAE,QAAS,CAAG;IACnCC,iBAAiB,EAAG,IAAAD,QAAE,EAAE,QAAS,CAAG;IACpCE,QAAQ,EAAGR,qBAAuB;IAClCS,SAAS,EAAGV;EAAwB,GAElCF,IAAI,IACL,IAAAa,aAAO,GACN;EACA,IAAAJ,QAAE,EACD,4EACD,CAAC,EACDT,IAAI,CAACc,IACN,CACa,CAAC;AAElB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclB,mBAAmB"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _fontCard = _interopRequireDefault(require("./font-card"));
|
|
12
|
-
var _context = require("./context");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function LibraryFontCard({
|
|
22
|
-
font,
|
|
23
|
-
...props
|
|
24
|
-
}) {
|
|
25
|
-
const {
|
|
26
|
-
getFontFacesActivated
|
|
27
|
-
} = (0, _element.useContext)(_context.FontLibraryContext);
|
|
28
|
-
const variantsInstalled = font?.fontFace?.length > 0 ? font.fontFace.length : 1;
|
|
29
|
-
const variantsActive = getFontFacesActivated(font.slug, font.source).length;
|
|
30
|
-
const variantsText = (0, _i18n.sprintf)( /* translators: 1: Active font variants, 2: Total font variants. */
|
|
31
|
-
(0, _i18n.__)('%1$s/%2$s variants active'), variantsActive, variantsInstalled);
|
|
32
|
-
return (0, _react.createElement)(_fontCard.default, {
|
|
33
|
-
font: font,
|
|
34
|
-
variantsText: variantsText,
|
|
35
|
-
...props
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
var _default = exports.default = LibraryFontCard;
|
|
39
|
-
//# sourceMappingURL=library-font-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_fontCard","_interopRequireDefault","_context","LibraryFontCard","font","props","getFontFacesActivated","useContext","FontLibraryContext","variantsInstalled","fontFace","length","variantsActive","slug","source","variantsText","sprintf","__","_react","createElement","default","_default","exports"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASK,eAAeA,CAAE;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC9C,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAC,mBAAU,EAAEC,2BAAmB,CAAC;EAElE,MAAMC,iBAAiB,GACtBL,IAAI,EAAEM,QAAQ,EAAEC,MAAM,GAAG,CAAC,GAAGP,IAAI,CAACM,QAAQ,CAACC,MAAM,GAAG,CAAC;EACtD,MAAMC,cAAc,GAAGN,qBAAqB,CAC3CF,IAAI,CAACS,IAAI,EACTT,IAAI,CAACU,MACN,CAAC,CAACH,MAAM;EACR,MAAMI,YAAY,GAAG,IAAAC,aAAO,GAC3B;EACA,IAAAC,QAAE,EAAE,2BAA4B,CAAC,EACjCL,cAAc,EACdH,iBACD,CAAC;EAED,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACnB,SAAA,CAAAoB,OAAQ;IAAChB,IAAI,EAAGA,IAAM;IAACW,YAAY,EAAGA,YAAc;IAAA,GAAMV;EAAK,CAAI,CAAC;AAEvE;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEcjB,eAAe"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _icons = require("@wordpress/icons");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _context = require("./context");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function TabPanelLayout({
|
|
22
|
-
title,
|
|
23
|
-
description,
|
|
24
|
-
notice,
|
|
25
|
-
handleBack,
|
|
26
|
-
children,
|
|
27
|
-
footer
|
|
28
|
-
}) {
|
|
29
|
-
const {
|
|
30
|
-
setNotice
|
|
31
|
-
} = (0, _element.useContext)(_context.FontLibraryContext);
|
|
32
|
-
return (0, _react.createElement)("div", {
|
|
33
|
-
className: "font-library-modal__tabpanel-layout"
|
|
34
|
-
}, (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
35
|
-
margin: 4
|
|
36
|
-
}), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
37
|
-
spacing: 4,
|
|
38
|
-
justify: "space-between"
|
|
39
|
-
}, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
40
|
-
spacing: 2
|
|
41
|
-
}, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
42
|
-
justify: "flex-start"
|
|
43
|
-
}, !!handleBack && (0, _react.createElement)(_components.Button, {
|
|
44
|
-
variant: "tertiary",
|
|
45
|
-
onClick: handleBack,
|
|
46
|
-
icon: _icons.chevronLeft,
|
|
47
|
-
size: "small",
|
|
48
|
-
label: (0, _i18n.__)('Back')
|
|
49
|
-
}), title && (0, _react.createElement)(_components.__experimentalHeading, {
|
|
50
|
-
level: 2,
|
|
51
|
-
size: 13,
|
|
52
|
-
className: "edit-site-global-styles-header"
|
|
53
|
-
}, title)), description && (0, _react.createElement)(_components.__experimentalText, null, description), notice && (0, _react.createElement)(_components.FlexBlock, null, (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
54
|
-
margin: 1
|
|
55
|
-
}), (0, _react.createElement)(_components.Notice, {
|
|
56
|
-
status: notice.type,
|
|
57
|
-
onRemove: () => setNotice(null)
|
|
58
|
-
}, notice.message), (0, _react.createElement)(_components.__experimentalSpacer, {
|
|
59
|
-
margin: 1
|
|
60
|
-
}))), (0, _react.createElement)("div", {
|
|
61
|
-
className: "font-library-modal__tabpanel-layout__main"
|
|
62
|
-
}, children), footer && (0, _react.createElement)("div", {
|
|
63
|
-
className: "font-library-modal__tabpanel-layout__footer"
|
|
64
|
-
}, footer)));
|
|
65
|
-
}
|
|
66
|
-
var _default = exports.default = TabPanelLayout;
|
|
67
|
-
//# sourceMappingURL=tab-panel-layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_icons","_i18n","_context","TabPanelLayout","title","description","notice","handleBack","children","footer","setNotice","useContext","FontLibraryContext","_react","createElement","className","__experimentalSpacer","margin","__experimentalVStack","spacing","justify","__experimentalHStack","Button","variant","onClick","icon","chevronLeft","size","label","__","__experimentalHeading","level","__experimentalText","FlexBlock","Notice","status","type","onRemove","message","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAUA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAeA;AACA;AACA;;AAGA,SAASK,cAAcA,CAAE;EACxBC,KAAK;EACLC,WAAW;EACXC,MAAM;EACNC,UAAU;EACVC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,mBAAU,EAAEC,2BAAmB,CAAC;EAEtD,OACC,IAAAC,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAqC,GACnD,IAAAF,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAiB,oBAAM;IAACC,MAAM,EAAG;EAAG,CAAE,CAAC,EACvB,IAAAJ,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAmB,oBAAM;IAACC,OAAO,EAAG,CAAG;IAACC,OAAO,EAAC;EAAe,GAC5C,IAAAP,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAmB,oBAAM;IAACC,OAAO,EAAG;EAAG,GACpB,IAAAN,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAsB,oBAAM;IAACD,OAAO,EAAC;EAAY,GACzB,CAAC,CAAEb,UAAU,IACd,IAAAM,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAuB,MAAM;IACNC,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGjB,UAAY;IACtBkB,IAAI,EAAGC,kBAAa;IACpBC,IAAI,EAAC,OAAO;IACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO;EAAG,CACtB,CACD,EACCzB,KAAK,IACN,IAAAS,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAA+B,qBAAO;IACPC,KAAK,EAAG,CAAG;IACXJ,IAAI,EAAG,EAAI;IACXZ,SAAS,EAAC;EAAgC,GAExCX,KACM,CAEH,CAAC,EACPC,WAAW,IAAI,IAAAQ,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAiC,kBAAI,QAAG3B,WAAmB,CAAC,EAC3CC,MAAM,IACP,IAAAO,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAkC,SAAS,QACT,IAAApB,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAiB,oBAAM;IAACC,MAAM,EAAG;EAAG,CAAE,CAAC,EACvB,IAAAJ,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAmC,MAAM;IACNC,MAAM,EAAG7B,MAAM,CAAC8B,IAAM;IACtBC,QAAQ,EAAGA,CAAA,KAAM3B,SAAS,CAAE,IAAK;EAAG,GAElCJ,MAAM,CAACgC,OACF,CAAC,EACT,IAAAzB,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAiB,oBAAM;IAACC,MAAM,EAAG;EAAG,CAAE,CACZ,CAEL,CAAC,EACT,IAAAJ,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA2C,GACvDP,QACE,CAAC,EACJC,MAAM,IACP,IAAAI,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA6C,GACzDN,MACE,CAEC,CACJ,CAAC;AAER;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctC,cAAc"}
|
|
@@ -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,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,qBAAqBA,CAAE;EAC/BC,IAAI;EACJC,mBAAmB;EACnBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GACdH,IAAI,CAACI,QAAQ,IAAIJ,IAAI,CAACI,QAAQ,CAACC,MAAM,GAClCP,aAAa,CAAEE,IAAI,CAACI,QAAS,CAAC,GAC9B,CACA;IACCE,UAAU,EAAEN,IAAI,CAACM,UAAU;IAC3BC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE;EACb,CAAC,CACA;EAEL,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACd,MAAM;IAACgB,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBF,aAAA,CAAChB,MAAM;IAACmB,OAAO,EAAG;EAAG,GACpBH,aAAA,CAACd,MAAM;IAACgB,MAAM,EAAG;EAAG,CAAE,CAAC,EACrBR,SAAS,CAACU,GAAG,CAAE,CAAEC,IAAI,EAAEC,CAAC,KACzBN,aAAA,CAACb,qBAAqB;IACrBI,IAAI,EAAGA,IAAM;IACbc,IAAI,EAAGA,IAAM;IACbE,GAAG,EAAI,OAAOD,CAAG,EAAG;IACpBd,mBAAmB,EAAGA,mBAAqB;IAC3CgB,QAAQ,EAAGpB,uBAAuB,CACjCG,IAAI,CAACkB,IAAI,EACTlB,IAAI,CAACI,QAAQ,GAAGU,IAAI,GAAG,IAAI;IAAE;IAC7BZ,oBACD;EAAG,CACH,CACA,CACK,CAAC,EACTO,aAAA,CAACd,MAAM;IAACgB,MAAM,EAAG;EAAI,CAAE,CACtB,CAAC;AAEL;AAEA,eAAeZ,qBAAqB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* 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;EACXC,MAAM;EACNC,UAAU;EACVC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAGxB,UAAU,CAAEgB,kBAAmB,CAAC;EAEtD,OACCS,aAAA;IAAKC,SAAS,EAAC;EAAqC,GACnDD,aAAA,CAACjB,MAAM;IAACmB,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBF,aAAA,CAACnB,MAAM;IAACsB,OAAO,EAAG,CAAG;IAACC,OAAO,EAAC;EAAe,GAC5CJ,aAAA,CAACnB,MAAM;IAACsB,OAAO,EAAG;EAAG,GACpBH,aAAA,CAACf,MAAM;IAACmB,OAAO,EAAC;EAAY,GACzB,CAAC,CAAER,UAAU,IACdI,aAAA,CAACd,MAAM;IACNmB,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGV,UAAY;IACtBW,IAAI,EAAGlB,WAAa;IACpBmB,IAAI,EAAC,OAAO;IACZC,KAAK,EAAGnB,EAAE,CAAE,MAAO;EAAG,CACtB,CACD,EACCG,KAAK,IACNO,aAAA,CAACrB,OAAO;IACP+B,KAAK,EAAG,CAAG;IACXF,IAAI,EAAG,EAAI;IACXP,SAAS,EAAC;EAAgC,GAExCR,KACM,CAEH,CAAC,EACPC,WAAW,IAAIM,aAAA,CAACvB,IAAI,QAAGiB,WAAmB,CAAC,EAC3CC,MAAM,IACPK,aAAA,CAACZ,SAAS,QACTY,aAAA,CAACjB,MAAM;IAACmB,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBF,aAAA,CAACb,MAAM;IACNwB,MAAM,EAAGhB,MAAM,CAACiB,IAAM;IACtBC,QAAQ,EAAGA,CAAA,KAAMd,SAAS,CAAE,IAAK;EAAG,GAElCJ,MAAM,CAACmB,OACF,CAAC,EACTd,aAAA,CAACjB,MAAM;IAACmB,MAAM,EAAG;EAAG,CAAE,CACZ,CAEL,CAAC,EACTF,aAAA;IAAKC,SAAS,EAAC;EAA2C,GACvDJ,QACE,CAAC,EACJC,MAAM,IACPE,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;
|