@wordpress/edit-site 5.27.0 → 5.27.2

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.
Files changed (114) hide show
  1. package/build/components/block-editor/back-button.js +2 -3
  2. package/build/components/block-editor/back-button.js.map +1 -1
  3. package/build/components/block-editor/site-editor-canvas.js +8 -2
  4. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  5. package/build/components/block-editor/use-post-link-props.js +5 -1
  6. package/build/components/block-editor/use-post-link-props.js.map +1 -1
  7. package/build/components/editor/index.js +7 -7
  8. package/build/components/editor/index.js.map +1 -1
  9. package/build/components/global-styles/font-library-modal/context.js +14 -0
  10. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  11. package/build/components/global-styles/font-library-modal/font-collection.js +17 -33
  12. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  13. package/build/components/global-styles/font-library-modal/font-demo.js +1 -1
  14. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  15. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  16. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  17. package/build/components/global-styles/font-library-modal/index.js +10 -3
  18. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  19. package/build/components/global-styles/font-library-modal/installed-fonts.js +8 -21
  20. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  22. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/resolvers.js +1 -1
  24. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/tab-panel-layout.js +14 -2
  26. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/upload-fonts.js +160 -4
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/utils/index.js +33 -31
  30. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  31. package/build/components/global-styles/screen-block.js +10 -0
  32. package/build/components/global-styles/screen-block.js.map +1 -1
  33. package/build/components/routes/link.js +1 -1
  34. package/build/components/routes/link.js.map +1 -1
  35. package/build/components/sidebar-edit-mode/index.js +1 -2
  36. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  37. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -36
  38. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  39. package/build/components/welcome-guide/template.js +2 -2
  40. package/build/components/welcome-guide/template.js.map +1 -1
  41. package/build/hooks/commands/use-edit-mode-commands.js +16 -6
  42. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  43. package/build-module/components/block-editor/back-button.js +2 -3
  44. package/build-module/components/block-editor/back-button.js.map +1 -1
  45. package/build-module/components/block-editor/site-editor-canvas.js +8 -2
  46. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  47. package/build-module/components/block-editor/use-post-link-props.js +5 -1
  48. package/build-module/components/block-editor/use-post-link-props.js.map +1 -1
  49. package/build-module/components/editor/index.js +7 -7
  50. package/build-module/components/editor/index.js.map +1 -1
  51. package/build-module/components/global-styles/font-library-modal/context.js +14 -0
  52. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  53. package/build-module/components/global-styles/font-library-modal/font-collection.js +19 -35
  54. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  55. package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -1
  56. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  57. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  58. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  59. package/build-module/components/global-styles/font-library-modal/index.js +10 -3
  60. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  61. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +9 -22
  62. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  63. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  64. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  65. package/build-module/components/global-styles/font-library-modal/resolvers.js +1 -1
  66. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  67. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +15 -3
  68. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  69. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +162 -6
  70. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  71. package/build-module/components/global-styles/font-library-modal/utils/index.js +32 -30
  72. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  73. package/build-module/components/global-styles/screen-block.js +10 -0
  74. package/build-module/components/global-styles/screen-block.js.map +1 -1
  75. package/build-module/components/routes/link.js +1 -1
  76. package/build-module/components/routes/link.js.map +1 -1
  77. package/build-module/components/sidebar-edit-mode/index.js +1 -2
  78. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  79. package/build-module/components/sidebar-edit-mode/settings-header/index.js +7 -36
  80. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  81. package/build-module/components/welcome-guide/template.js +2 -2
  82. package/build-module/components/welcome-guide/template.js.map +1 -1
  83. package/build-module/hooks/commands/use-edit-mode-commands.js +16 -6
  84. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  85. package/build-style/style-rtl.css +16 -31
  86. package/build-style/style.css +16 -31
  87. package/package.json +13 -13
  88. package/src/components/block-editor/back-button.js +6 -3
  89. package/src/components/block-editor/site-editor-canvas.js +19 -12
  90. package/src/components/block-editor/use-post-link-props.js +5 -1
  91. package/src/components/editor/index.js +4 -9
  92. package/src/components/global-styles/font-library-modal/context.js +14 -0
  93. package/src/components/global-styles/font-library-modal/font-collection.js +16 -40
  94. package/src/components/global-styles/font-library-modal/font-demo.js +1 -1
  95. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  96. package/src/components/global-styles/font-library-modal/index.js +8 -3
  97. package/src/components/global-styles/font-library-modal/installed-fonts.js +12 -31
  98. package/src/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  99. package/src/components/global-styles/font-library-modal/resolvers.js +1 -1
  100. package/src/components/global-styles/font-library-modal/style.scss +20 -43
  101. package/src/components/global-styles/font-library-modal/tab-panel-layout.js +45 -26
  102. package/src/components/global-styles/font-library-modal/upload-fonts.js +201 -6
  103. package/src/components/global-styles/font-library-modal/utils/index.js +44 -38
  104. package/src/components/global-styles/screen-block.js +10 -0
  105. package/src/components/routes/link.js +1 -1
  106. package/src/components/sidebar-edit-mode/index.js +1 -4
  107. package/src/components/sidebar-edit-mode/settings-header/index.js +12 -34
  108. package/src/components/welcome-guide/template.js +2 -2
  109. package/src/hooks/commands/use-edit-mode-commands.js +26 -14
  110. package/build/components/global-styles/font-library-modal/local-fonts.js +0 -196
  111. package/build/components/global-styles/font-library-modal/local-fonts.js.map +0 -1
  112. package/build-module/components/global-styles/font-library-modal/local-fonts.js +0 -187
  113. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +0 -1
  114. package/src/components/global-styles/font-library-modal/local-fonts.js +0 -239
@@ -12,7 +12,6 @@ import {
12
12
  FlexItem,
13
13
  Flex,
14
14
  Button,
15
- Notice,
16
15
  } from '@wordpress/components';
17
16
  import { debounce } from '@wordpress/compose';
18
17
  import { __ } from '@wordpress/i18n';
@@ -30,31 +29,30 @@ import CollectionFontDetails from './collection-font-details';
30
29
  import { toggleFont } from './utils/toggleFont';
31
30
  import { getFontsOutline } from './utils/fonts-outline';
32
31
  import GoogleFontsConfirmDialog from './google-fonts-confirm-dialog';
33
- import { downloadFontFaceAsset } from './utils';
32
+ import { downloadFontFaceAssets } from './utils';
34
33
 
35
34
  const DEFAULT_CATEGORY = {
36
35
  slug: 'all',
37
36
  name: __( 'All' ),
38
37
  };
39
38
  function FontCollection( { slug } ) {
40
- const requiresPermission = slug === 'default-font-collection';
39
+ const requiresPermission = slug === 'google-fonts';
41
40
 
42
41
  const getGoogleFontsPermissionFromStorage = () => {
43
42
  return (
44
43
  window.localStorage.getItem(
45
- 'wp-font-library-default-font-collection-permission'
44
+ 'wp-font-library-google-fonts-permission'
46
45
  ) === 'true'
47
46
  );
48
47
  };
49
48
 
50
- const [ notice, setNotice ] = useState( null );
51
49
  const [ selectedFont, setSelectedFont ] = useState( null );
52
50
  const [ fontsToInstall, setFontsToInstall ] = useState( [] );
53
51
  const [ filters, setFilters ] = useState( {} );
54
52
  const [ renderConfirmDialog, setRenderConfirmDialog ] = useState(
55
53
  requiresPermission && ! getGoogleFontsPermissionFromStorage()
56
54
  );
57
- const { collections, getFontCollection, installFont } =
55
+ const { collections, getFontCollection, installFont, notice, setNotice } =
58
56
  useContext( FontLibraryContext );
59
57
  const selectedCollection = collections.find(
60
58
  ( collection ) => collection.slug === slug
@@ -77,36 +75,27 @@ function FontCollection( { slug } ) {
77
75
  await getFontCollection( slug );
78
76
  resetFilters();
79
77
  } catch ( e ) {
80
- setNotice( {
81
- type: 'error',
82
- message: e?.message,
83
- duration: 0, // Don't auto-hide.
84
- } );
78
+ if ( ! notice ) {
79
+ setNotice( {
80
+ type: 'error',
81
+ message: e?.message,
82
+ } );
83
+ }
85
84
  }
86
85
  };
87
86
  fetchFontCollection();
88
- }, [ slug, getFontCollection ] );
87
+ }, [ slug, getFontCollection, setNotice, notice ] );
89
88
 
90
89
  useEffect( () => {
91
90
  setSelectedFont( null );
92
91
  setNotice( null );
93
- }, [ slug ] );
92
+ }, [ slug, setNotice ] );
94
93
 
95
94
  useEffect( () => {
96
95
  // If the selected fonts change, reset the selected fonts to install
97
96
  setFontsToInstall( [] );
98
97
  }, [ selectedFont ] );
99
98
 
100
- // Reset notice after 5 seconds
101
- useEffect( () => {
102
- if ( notice && notice?.duration !== 0 ) {
103
- const timeout = setTimeout( () => {
104
- setNotice( null );
105
- }, notice.duration ?? 5000 );
106
- return () => clearTimeout( timeout );
107
- }
108
- }, [ notice ] );
109
-
110
99
  const collectionFonts = useMemo(
111
100
  () => selectedCollection?.font_families ?? [],
112
101
  [ selectedCollection ]
@@ -154,6 +143,8 @@ function FontCollection( { slug } ) {
154
143
  };
155
144
 
156
145
  const handleInstall = async () => {
146
+ setNotice( null );
147
+
157
148
  const fontFamily = fontsToInstall[ 0 ];
158
149
 
159
150
  try {
@@ -161,7 +152,7 @@ function FontCollection( { slug } ) {
161
152
  await Promise.all(
162
153
  fontFamily.fontFace.map( async ( fontFace ) => {
163
154
  if ( fontFace.src ) {
164
- fontFace.file = await downloadFontFaceAsset(
155
+ fontFace.file = await downloadFontFaceAssets(
165
156
  fontFace.src
166
157
  );
167
158
  }
@@ -205,6 +196,7 @@ function FontCollection( { slug } ) {
205
196
  ? selectedCollection.description
206
197
  : __( 'Select font variants to install.' )
207
198
  }
199
+ notice={ notice }
208
200
  handleBack={ !! selectedFont && handleUnselectFont }
209
201
  footer={
210
202
  fontsToInstall.length > 0 && (
@@ -219,22 +211,6 @@ function FontCollection( { slug } ) {
219
211
  </>
220
212
  ) }
221
213
 
222
- { notice && (
223
- <>
224
- <FlexItem>
225
- <Spacer margin={ 2 } />
226
- <Notice
227
- isDismissible={ false }
228
- status={ notice.type }
229
- className="font-library-modal__font-collection__notice"
230
- >
231
- { notice.message }
232
- </Notice>
233
- </FlexItem>
234
- <Spacer margin={ 2 } />
235
- </>
236
- ) }
237
-
238
214
  { ! renderConfirmDialog && ! selectedFont && (
239
215
  <Flex>
240
216
  <FlexItem>
@@ -62,7 +62,7 @@ function FontFaceDemo( { customPreviewUrl, fontFace, text, style = {} } ) {
62
62
  }
63
63
  };
64
64
  loadAsset();
65
- }, [ fontFace, isIntersecting, loadFontFaceAsset ] );
65
+ }, [ fontFace, isIntersecting, loadFontFaceAsset, isPreviewImage ] );
66
66
 
67
67
  return (
68
68
  <div ref={ ref }>
@@ -14,7 +14,7 @@ function GoogleFontsConfirmDialog() {
14
14
  const handleConfirm = () => {
15
15
  // eslint-disable-next-line no-undef
16
16
  window.localStorage.setItem(
17
- 'wp-font-library-default-font-collection-permission',
17
+ 'wp-font-library-google-fonts-permission',
18
18
  'true'
19
19
  );
20
20
  window.dispatchEvent( new Event( 'storage' ) );
@@ -34,7 +34,7 @@ const tabsFromCollections = ( collections ) =>
34
34
  collections.map( ( { slug, name } ) => ( {
35
35
  id: slug,
36
36
  title:
37
- collections.length === 1 && slug === 'default-font-collection'
37
+ collections.length === 1 && slug === 'google-fonts'
38
38
  ? __( 'Install Fonts' )
39
39
  : name,
40
40
  } ) );
@@ -43,13 +43,18 @@ function FontLibraryModal( {
43
43
  onRequestClose,
44
44
  initialTabId = 'installed-fonts',
45
45
  } ) {
46
- const { collections } = useContext( FontLibraryContext );
46
+ const { collections, setNotice } = useContext( FontLibraryContext );
47
47
 
48
48
  const tabs = [
49
49
  ...DEFAULT_TABS,
50
50
  ...tabsFromCollections( collections || [] ),
51
51
  ];
52
52
 
53
+ // Reset notice when new tab is selected.
54
+ const onSelect = () => {
55
+ setNotice( null );
56
+ };
57
+
53
58
  return (
54
59
  <Modal
55
60
  title={ __( 'Fonts' ) }
@@ -58,7 +63,7 @@ function FontLibraryModal( {
58
63
  className="font-library-modal"
59
64
  >
60
65
  <div className="font-library-modal__tabs">
61
- <Tabs initialTabId={ initialTabId }>
66
+ <Tabs initialTabId={ initialTabId } onSelect={ onSelect }>
62
67
  <Tabs.TabList>
63
68
  { tabs.map( ( { id, title } ) => (
64
69
  <Tabs.Tab key={ id } tabId={ id }>
@@ -9,7 +9,6 @@ import {
9
9
  __experimentalSpacer as Spacer,
10
10
  Button,
11
11
  Spinner,
12
- Notice,
13
12
  FlexItem,
14
13
  } from '@wordpress/components';
15
14
 
@@ -34,6 +33,8 @@ function InstalledFonts() {
34
33
  refreshLibrary,
35
34
  uninstallFontFamily,
36
35
  isResolvingLibrary,
36
+ notice,
37
+ setNotice,
37
38
  } = useContext( FontLibraryContext );
38
39
  const [ isConfirmDeleteOpen, setIsConfirmDeleteOpen ] = useState( false );
39
40
 
@@ -45,9 +46,9 @@ function InstalledFonts() {
45
46
  handleSetLibraryFontSelected( font );
46
47
  };
47
48
 
48
- const [ notice, setNotice ] = useState( null );
49
-
50
49
  const handleConfirmUninstall = async () => {
50
+ setNotice( null );
51
+
51
52
  try {
52
53
  await uninstallFontFamily( libraryFontSelected );
53
54
  setNotice( {
@@ -91,20 +92,11 @@ function InstalledFonts() {
91
92
  // eslint-disable-next-line react-hooks/exhaustive-deps
92
93
  }, [] );
93
94
 
94
- // Reset notice after 5 seconds
95
- useEffect( () => {
96
- if ( notice ) {
97
- const timeout = setTimeout( () => {
98
- setNotice( null );
99
- }, 5000 );
100
- return () => clearTimeout( timeout );
101
- }
102
- }, [ notice ] );
103
-
104
95
  return (
105
96
  <TabPanelLayout
106
97
  title={ libraryFontSelected?.name || '' }
107
98
  description={ tabDescription }
99
+ notice={ notice }
108
100
  handleBack={ !! libraryFontSelected && handleUnselectFont }
109
101
  footer={
110
102
  <Footer
@@ -120,28 +112,17 @@ function InstalledFonts() {
120
112
  handleCancelUninstall={ handleCancelUninstall }
121
113
  />
122
114
 
123
- { notice && (
124
- <>
125
- <FlexItem>
126
- <Spacer margin={ 2 } />
127
- <Notice
128
- isDismissible={ false }
129
- status={ notice.type }
130
- className="font-library-modal__font-collection__notice"
131
- >
132
- { notice.message }
133
- </Notice>
134
- </FlexItem>
135
- <Spacer margin={ 4 } />
136
- </>
137
- ) }
138
-
139
115
  { ! libraryFontSelected && (
140
116
  <>
141
- { isResolvingLibrary && <Spinner /> }
117
+ { isResolvingLibrary && (
118
+ <FlexItem>
119
+ <Spacer margin={ 2 } />
120
+ <Spinner />
121
+ <Spacer margin={ 2 } />
122
+ </FlexItem>
123
+ ) }
142
124
  { baseCustomFonts.length > 0 && (
143
125
  <>
144
- <Spacer margin={ 2 } />
145
126
  <FontsGrid>
146
127
  { baseCustomFonts.map( ( font ) => (
147
128
  <LibraryFontCard
@@ -20,7 +20,7 @@ function LibraryFontVariant( { face, font } ) {
20
20
  const { isFontActivated, toggleActivateFont } =
21
21
  useContext( FontLibraryContext );
22
22
 
23
- const isIstalled =
23
+ const isInstalled =
24
24
  font?.fontFace?.length > 0
25
25
  ? isFontActivated(
26
26
  font.slug,
@@ -52,7 +52,7 @@ function LibraryFontVariant( { face, font } ) {
52
52
  <Flex justify="space-between" align="center" gap="1rem">
53
53
  <FontFaceDemo fontFace={ face } text={ displayName } />
54
54
  <CheckboxControl
55
- checked={ isIstalled }
55
+ checked={ isInstalled }
56
56
  onChange={ handleToggleActivation }
57
57
  __nextHasNoMarginBottom={ true }
58
58
  id={ checkboxId }
@@ -63,7 +63,7 @@ export async function fetchUninstallFontFamily( fontFamilyId ) {
63
63
 
64
64
  export async function fetchFontCollections() {
65
65
  const config = {
66
- path: FONT_COLLECTIONS_URL,
66
+ path: `${ FONT_COLLECTIONS_URL }?_fields=slug,name,description`,
67
67
  method: 'GET',
68
68
  };
69
69
  return await apiFetch( config );
@@ -25,21 +25,15 @@
25
25
  }
26
26
 
27
27
  .font-library-modal__tabpanel-layout {
28
-
29
- main {
30
- padding-bottom: 4rem;
31
- }
32
-
33
- footer {
34
- border-top: 1px solid #e5e5e5;
35
- margin: 0 -32px -32px;
36
- padding: 16px 32px;
28
+ .font-library-modal__tabpanel-layout__footer {
29
+ border-top: 1px solid $gray-300;
30
+ margin: 0 #{$grid-unit-40 * -1} #{$grid-unit-40 * -1};
31
+ padding: $grid-unit-20 $grid-unit-40;
37
32
  position: absolute;
38
- bottom: 32px;
33
+ bottom: $grid-unit-40;
39
34
  width: 100%;
40
- background-color: #fff;
35
+ background-color: $white;
41
36
  }
42
-
43
37
  }
44
38
 
45
39
  .font-library-modal__fonts-grid {
@@ -50,10 +44,10 @@
50
44
  }
51
45
 
52
46
  .font-library-modal__font-card {
53
- border: 1px solid #e5e5e5;
47
+ border: 1px solid $gray-200;
54
48
  width: 100%;
55
49
  height: auto;
56
- padding: 1rem;
50
+ padding: $grid-unit-20;
57
51
  margin-top: -1px; /* To collapse the margin with the previous element */
58
52
 
59
53
  .font-library-modal__font-card__name {
@@ -61,30 +55,29 @@
61
55
  }
62
56
 
63
57
  .font-library-modal__font-card__count {
64
- color: #6e6e6e;
58
+ color: $gray-700;
65
59
  }
66
60
  }
67
61
 
68
62
  .font-library-modal__library-font-variant {
69
- border: 1px solid #e5e5e5;
70
- padding: 1rem;
63
+ border: 1px solid $gray-200;
64
+ padding: $grid-unit-20;
71
65
  margin-top: -1px; /* To collapse the margin with the previous element */
72
66
  }
73
67
 
74
68
  .font-library-modal__font-variant {
75
- border-bottom: 1px solid #e5e5e5;
76
- padding-bottom: 1rem;
69
+ border-bottom: 1px solid $gray-200;
70
+ padding-bottom: $grid-unit-20;
77
71
  }
78
72
 
79
73
  .font-library-modal__tabs {
80
74
  [role="tablist"] {
81
75
  position: sticky;
82
76
  top: 0;
83
- width: calc(100% + 64px);
84
- border-bottom: 1px solid #e6e6e6;
85
- background: #fff;
86
- margin: 0 -32px;
87
- padding: 0 16px;
77
+ border-bottom: 1px solid $gray-300;
78
+ background: $white;
79
+ margin: 0 #{$grid-unit-40 * -1};
80
+ padding: 0 $grid-unit-20;
88
81
  z-index: 1;
89
82
  }
90
83
  }
@@ -93,12 +86,12 @@
93
86
  align-items: center;
94
87
  display: flex;
95
88
  justify-content: center;
96
- height: 250px;
89
+ height: $grid-unit-80 * 4; // 256px
97
90
  width: 100%;
98
91
  }
99
92
 
100
93
  button.font-library-modal__upload-area {
101
- background-color: #f0f0f0;
94
+ background-color: $gray-100;
102
95
  }
103
96
 
104
97
  .font-library-modal__local-fonts {
@@ -106,22 +99,10 @@ button.font-library-modal__upload-area {
106
99
  width: 80%;
107
100
 
108
101
  .font-library-modal__upload-area__text {
109
- color: #6e6e6e;
110
- }
111
-
112
- .font-library-modal__upload-area__notice {
113
- margin: 0;
102
+ color: $gray-700;
114
103
  }
115
104
  }
116
105
 
117
- .font-library-modal__font-name {
118
- font-weight: bold;
119
- }
120
-
121
- .font-library-modal__font-filename {
122
- color: #6e6e6e;
123
- }
124
-
125
106
  .font-library-modal__font-variant_demo-wrapper {
126
107
  white-space: nowrap;
127
108
  overflow: hidden;
@@ -154,7 +135,3 @@ button.font-library-modal__upload-area {
154
135
  max-width: 350px;
155
136
  }
156
137
  }
157
-
158
- .font-library-modal__font-collection__notice {
159
- margin: 0;
160
- }
@@ -8,12 +8,15 @@ import {
8
8
  __experimentalSpacer as Spacer,
9
9
  __experimentalHStack as HStack,
10
10
  Button,
11
+ Notice,
12
+ FlexBlock,
11
13
  } from '@wordpress/components';
12
14
  import { chevronLeft } from '@wordpress/icons';
13
15
 
14
16
  function TabPanelLayout( {
15
17
  title,
16
18
  description,
19
+ notice,
17
20
  handleBack,
18
21
  children,
19
22
  footer,
@@ -22,32 +25,48 @@ function TabPanelLayout( {
22
25
  <div className="font-library-modal__tabpanel-layout">
23
26
  <Spacer margin={ 4 } />
24
27
  <VStack spacing={ 4 } justify="space-between">
25
- <header>
26
- <VStack spacing={ 2 }>
27
- <HStack justify="flex-start">
28
- { !! handleBack && (
29
- <Button
30
- variant="tertiary"
31
- onClick={ handleBack }
32
- icon={ chevronLeft }
33
- size="small"
34
- />
35
- ) }
36
- { title && (
37
- <Heading
38
- level={ 2 }
39
- size={ 13 }
40
- className="edit-site-global-styles-header"
41
- >
42
- { title }
43
- </Heading>
44
- ) }
45
- </HStack>
46
- { description && <Text>{ description }</Text> }
47
- </VStack>
48
- </header>
49
- <main>{ children }</main>
50
- { footer && <footer>{ footer }</footer> }
28
+ <VStack spacing={ 2 }>
29
+ <HStack justify="flex-start">
30
+ { !! handleBack && (
31
+ <Button
32
+ variant="tertiary"
33
+ onClick={ handleBack }
34
+ icon={ chevronLeft }
35
+ size="small"
36
+ />
37
+ ) }
38
+ { title && (
39
+ <Heading
40
+ level={ 2 }
41
+ size={ 13 }
42
+ className="edit-site-global-styles-header"
43
+ >
44
+ { title }
45
+ </Heading>
46
+ ) }
47
+ </HStack>
48
+ { description && <Text>{ description }</Text> }
49
+ { notice && (
50
+ <FlexBlock>
51
+ <Spacer margin={ 1 } />
52
+ <Notice
53
+ status={ notice.type }
54
+ onRemove={ notice.onRemove }
55
+ >
56
+ { notice.message }
57
+ </Notice>
58
+ <Spacer margin={ 1 } />
59
+ </FlexBlock>
60
+ ) }
61
+ </VStack>
62
+ <div className="font-library-modal__tabpanel-layout__main">
63
+ { children }
64
+ </div>
65
+ { footer && (
66
+ <div className="font-library-modal__tabpanel-layout__footer">
67
+ { footer }
68
+ </div>
69
+ ) }
51
70
  </VStack>
52
71
  </div>
53
72
  );