@wordpress/edit-site 5.28.2 → 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.
Files changed (162) hide show
  1. package/build/components/add-new-pattern/index.js +18 -8
  2. package/build/components/add-new-pattern/index.js.map +1 -1
  3. package/build/components/editor/index.js +1 -1
  4. package/build/components/editor/index.js.map +1 -1
  5. package/build/components/global-styles/block-preview-panel.js +2 -2
  6. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  7. package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -2
  8. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  9. package/build/components/global-styles/font-library-modal/font-card.js +10 -15
  10. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  11. package/build/components/global-styles/font-library-modal/font-collection.js +167 -37
  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 +29 -8
  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/installed-fonts.js +149 -83
  18. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  19. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  20. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/upload-fonts.js +6 -4
  22. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  23. package/build/components/global-styles/screen-revisions/index.js +2 -2
  24. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  25. package/build/components/global-styles/ui.js +27 -2
  26. package/build/components/global-styles/ui.js.map +1 -1
  27. package/build/components/header-edit-mode/index.js +1 -1
  28. package/build/components/header-edit-mode/index.js.map +1 -1
  29. package/build/components/layout/index.js +8 -3
  30. package/build/components/layout/index.js.map +1 -1
  31. package/build/components/layout/router.js +26 -5
  32. package/build/components/layout/router.js.map +1 -1
  33. package/build/components/page-patterns/index.js +14 -14
  34. package/build/components/page-patterns/index.js.map +1 -1
  35. package/build/components/page-patterns/use-patterns.js +10 -5
  36. package/build/components/page-patterns/use-patterns.js.map +1 -1
  37. package/build/components/page-templates-template-parts/index.js +1 -0
  38. package/build/components/page-templates-template-parts/index.js.map +1 -1
  39. package/build/components/sidebar/index.js +6 -3
  40. package/build/components/sidebar/index.js.map +1 -1
  41. package/build/components/sidebar-dataviews/default-views.js +2 -0
  42. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  43. package/build/components/sidebar-navigation-screen-pages/index.js +3 -1
  44. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  45. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  46. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  47. package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
  48. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  49. package/build/components/style-book/index.js +2 -0
  50. package/build/components/style-book/index.js.map +1 -1
  51. package/build/store/private-actions.js +3 -1
  52. package/build/store/private-actions.js.map +1 -1
  53. package/build-module/components/add-new-pattern/index.js +18 -8
  54. package/build-module/components/add-new-pattern/index.js.map +1 -1
  55. package/build-module/components/editor/index.js +1 -1
  56. package/build-module/components/editor/index.js.map +1 -1
  57. package/build-module/components/global-styles/block-preview-panel.js +2 -2
  58. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  59. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
  60. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  61. package/build-module/components/global-styles/font-library-modal/font-card.js +11 -16
  62. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  63. package/build-module/components/global-styles/font-library-modal/font-collection.js +172 -42
  64. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  65. package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -9
  66. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  67. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  68. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  69. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +149 -83
  70. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  71. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +4 -4
  72. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  73. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +7 -5
  74. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  75. package/build-module/components/global-styles/screen-revisions/index.js +2 -2
  76. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  77. package/build-module/components/global-styles/ui.js +27 -2
  78. package/build-module/components/global-styles/ui.js.map +1 -1
  79. package/build-module/components/header-edit-mode/index.js +1 -1
  80. package/build-module/components/header-edit-mode/index.js.map +1 -1
  81. package/build-module/components/layout/index.js +8 -3
  82. package/build-module/components/layout/index.js.map +1 -1
  83. package/build-module/components/layout/router.js +26 -5
  84. package/build-module/components/layout/router.js.map +1 -1
  85. package/build-module/components/page-patterns/index.js +14 -14
  86. package/build-module/components/page-patterns/index.js.map +1 -1
  87. package/build-module/components/page-patterns/use-patterns.js +10 -5
  88. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  89. package/build-module/components/page-templates-template-parts/index.js +1 -0
  90. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  91. package/build-module/components/sidebar/index.js +6 -3
  92. package/build-module/components/sidebar/index.js.map +1 -1
  93. package/build-module/components/sidebar-dataviews/default-views.js +3 -1
  94. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  95. package/build-module/components/sidebar-navigation-screen-pages/index.js +3 -1
  96. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  97. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  98. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  99. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
  100. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  101. package/build-module/components/style-book/index.js +2 -0
  102. package/build-module/components/style-book/index.js.map +1 -1
  103. package/build-module/store/private-actions.js +3 -1
  104. package/build-module/store/private-actions.js.map +1 -1
  105. package/build-style/style-rtl.css +52 -25
  106. package/build-style/style.css +52 -25
  107. package/package.json +18 -18
  108. package/src/components/add-new-pattern/index.js +27 -11
  109. package/src/components/editor/index.js +1 -0
  110. package/src/components/global-styles/block-preview-panel.js +2 -2
  111. package/src/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
  112. package/src/components/global-styles/font-library-modal/font-card.js +11 -26
  113. package/src/components/global-styles/font-library-modal/font-collection.js +328 -129
  114. package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
  115. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  116. package/src/components/global-styles/font-library-modal/installed-fonts.js +246 -132
  117. package/src/components/global-styles/font-library-modal/library-font-variant.js +4 -4
  118. package/src/components/global-styles/font-library-modal/style.scss +17 -13
  119. package/src/components/global-styles/font-library-modal/upload-fonts.js +13 -5
  120. package/src/components/global-styles/screen-revisions/index.js +5 -2
  121. package/src/components/global-styles/ui.js +26 -2
  122. package/src/components/header-edit-mode/index.js +3 -1
  123. package/src/components/layout/index.js +47 -30
  124. package/src/components/layout/router.js +31 -2
  125. package/src/components/layout/style.scss +7 -0
  126. package/src/components/page-patterns/index.js +20 -20
  127. package/src/components/page-patterns/style.scss +10 -0
  128. package/src/components/page-patterns/use-patterns.js +13 -5
  129. package/src/components/page-templates-template-parts/index.js +1 -0
  130. package/src/components/page-templates-template-parts/style.scss +6 -0
  131. package/src/components/sidebar/index.js +9 -4
  132. package/src/components/sidebar-dataviews/default-views.js +3 -1
  133. package/src/components/sidebar-navigation-screen-pages/index.js +10 -6
  134. package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  135. package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
  136. package/src/components/style-book/index.js +5 -1
  137. package/src/store/private-actions.js +4 -0
  138. package/build/components/global-styles/font-library-modal/collection-font-details.js +0 -50
  139. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
  140. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
  141. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
  142. package/build/components/global-styles/font-library-modal/fonts-grid.js +0 -57
  143. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +0 -1
  144. package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
  145. package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
  146. package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
  147. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
  148. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
  149. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
  150. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
  151. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
  152. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +0 -50
  153. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +0 -1
  154. package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
  155. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
  156. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
  157. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
  158. package/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
  159. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
  160. package/src/components/global-styles/font-library-modal/fonts-grid.js +0 -59
  161. package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
  162. package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
@@ -251,47 +251,64 @@ export default function Layout() {
251
251
  The NavigableRegion must always be rendered and not use
252
252
  `inert` otherwise `useNavigateRegions` will fail.
253
253
  */ }
254
- <NavigableRegion
255
- ariaLabel={ __( 'Navigation' ) }
256
- className="edit-site-layout__sidebar-region"
257
- >
258
- <AnimatePresence>
259
- { canvasMode === 'view' && (
260
- <motion.div
261
- initial={ { opacity: 0 } }
262
- animate={ { opacity: 1 } }
263
- exit={ { opacity: 0 } }
264
- transition={ {
265
- type: 'tween',
266
- duration:
267
- // Disable transition in mobile to emulate a full page transition.
268
- disableMotion || isMobileViewport
269
- ? 0
270
- : ANIMATION_DURATION,
271
- ease: 'easeOut',
272
- } }
273
- className="edit-site-layout__sidebar"
274
- >
275
- <Sidebar />
276
- </motion.div>
277
- ) }
278
- </AnimatePresence>
279
- </NavigableRegion>
254
+ { ( ! isMobileViewport ||
255
+ ( isMobileViewport && ! areas.mobile ) ) && (
256
+ <NavigableRegion
257
+ ariaLabel={ __( 'Navigation' ) }
258
+ className="edit-site-layout__sidebar-region"
259
+ >
260
+ <AnimatePresence>
261
+ { canvasMode === 'view' && (
262
+ <motion.div
263
+ initial={ { opacity: 0 } }
264
+ animate={ { opacity: 1 } }
265
+ exit={ { opacity: 0 } }
266
+ transition={ {
267
+ type: 'tween',
268
+ duration:
269
+ // Disable transition in mobile to emulate a full page transition.
270
+ disableMotion ||
271
+ isMobileViewport
272
+ ? 0
273
+ : ANIMATION_DURATION,
274
+ ease: 'easeOut',
275
+ } }
276
+ className="edit-site-layout__sidebar"
277
+ >
278
+ <Sidebar />
279
+ </motion.div>
280
+ ) }
281
+ </AnimatePresence>
282
+ </NavigableRegion>
283
+ ) }
280
284
 
281
285
  <SavePanel />
282
286
 
283
- { areas.content && canvasMode !== 'edit' && (
287
+ { isMobileViewport && areas.mobile && (
284
288
  <div
285
- className="edit-site-layout__area"
289
+ className="edit-site-layout__mobile"
286
290
  style={ {
287
291
  maxWidth: widths?.content,
288
292
  } }
289
293
  >
290
- { areas.content }
294
+ { areas.mobile }
291
295
  </div>
292
296
  ) }
293
297
 
294
- { areas.preview && (
298
+ { ! isMobileViewport &&
299
+ areas.content &&
300
+ canvasMode !== 'edit' && (
301
+ <div
302
+ className="edit-site-layout__area"
303
+ style={ {
304
+ maxWidth: widths?.content,
305
+ } }
306
+ >
307
+ { areas.content }
308
+ </div>
309
+ ) }
310
+
311
+ { ! isMobileViewport && areas.preview && (
295
312
  <div className="edit-site-layout__canvas-container">
296
313
  { canvasResizer }
297
314
  { !! canvasSize.width && (
@@ -23,13 +23,21 @@ const { useLocation } = unlock( routerPrivateApis );
23
23
  export default function useLayoutAreas() {
24
24
  const isSiteEditorLoading = useIsSiteEditorLoading();
25
25
  const { params } = useLocation();
26
- const { postType, postId, path, layout, isCustom } = params ?? {};
26
+ const { postType, postId, path, layout, isCustom, canvas } = params ?? {};
27
+
28
+ // Note: Since "sidebar" is not yet supported here,
29
+ // returning undefined from "mobile" means show the sidebar.
30
+
27
31
  // Regular page
28
32
  if ( path === '/page' ) {
29
33
  return {
30
34
  areas: {
31
35
  content: undefined,
32
36
  preview: <Editor isLoading={ isSiteEditorLoading } />,
37
+ mobile:
38
+ canvas === 'edit' ? (
39
+ <Editor isLoading={ isSiteEditorLoading } />
40
+ ) : undefined,
33
41
  },
34
42
  widths: {
35
43
  content: undefined,
@@ -63,6 +71,10 @@ export default function useLayoutAreas() {
63
71
  return {
64
72
  areas: {
65
73
  preview: <Editor isLoading={ isSiteEditorLoading } />,
74
+ mobile:
75
+ canvas === 'edit' ? (
76
+ <Editor isLoading={ isSiteEditorLoading } />
77
+ ) : undefined,
66
78
  },
67
79
  };
68
80
  }
@@ -79,6 +91,11 @@ export default function useLayoutAreas() {
79
91
  preview: isListLayout && (
80
92
  <Editor isLoading={ isSiteEditorLoading } />
81
93
  ),
94
+ mobile: (
95
+ <PageTemplatesTemplateParts
96
+ postType={ TEMPLATE_POST_TYPE }
97
+ />
98
+ ),
82
99
  },
83
100
  widths: {
84
101
  content: isListLayout ? 380 : undefined,
@@ -98,6 +115,11 @@ export default function useLayoutAreas() {
98
115
  preview: isListLayout && (
99
116
  <Editor isLoading={ isSiteEditorLoading } />
100
117
  ),
118
+ mobile: (
119
+ <PageTemplatesTemplateParts
120
+ postType={ TEMPLATE_PART_POST_TYPE }
121
+ />
122
+ ),
101
123
  },
102
124
  widths: {
103
125
  content: isListLayout ? 380 : undefined,
@@ -110,12 +132,19 @@ export default function useLayoutAreas() {
110
132
  return {
111
133
  areas: {
112
134
  content: <PagePatterns />,
135
+ mobile: <PagePatterns />,
113
136
  },
114
137
  };
115
138
  }
116
139
 
117
140
  // Fallback shows the home page preview
118
141
  return {
119
- areas: { preview: <Editor isLoading={ isSiteEditorLoading } /> },
142
+ areas: {
143
+ preview: <Editor isLoading={ isSiteEditorLoading } />,
144
+ mobile:
145
+ canvas === 'edit' ? (
146
+ <Editor isLoading={ isSiteEditorLoading } />
147
+ ) : undefined,
148
+ },
120
149
  };
121
150
  }
@@ -83,6 +83,12 @@
83
83
  flex-direction: column;
84
84
  }
85
85
 
86
+ .edit-site-layout__mobile {
87
+ position: relative;
88
+ width: 100%;
89
+ z-index: z-index(".edit-site-layout__canvas-container");
90
+ }
91
+
86
92
  .edit-site-layout__canvas-container {
87
93
  position: relative;
88
94
  flex-grow: 1;
@@ -147,6 +153,7 @@
147
153
  }
148
154
 
149
155
  // This shouldn't be necessary (we should have a way to say that a skeletton is relative
156
+ .edit-site-layout__mobile .interface-interface-skeleton,
150
157
  .edit-site-layout__canvas .interface-interface-skeleton,
151
158
  .edit-site-template-pages-preview .interface-interface-skeleton {
152
159
  position: relative !important;
@@ -210,6 +210,26 @@ function Title( { item, categoryId } ) {
210
210
  }
211
211
  return (
212
212
  <HStack alignment="center" justify="flex-start" spacing={ 2 }>
213
+ <Flex
214
+ as="div"
215
+ gap={ 0 }
216
+ justify="left"
217
+ className="edit-site-patterns__pattern-title"
218
+ >
219
+ { item.type === PATTERN_TYPES.theme ? (
220
+ item.title
221
+ ) : (
222
+ <Button
223
+ variant="link"
224
+ onClick={ onClick }
225
+ // Required for the grid's roving tab index system.
226
+ // See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243.
227
+ tabIndex="-1"
228
+ >
229
+ { item.title || item.name }
230
+ </Button>
231
+ ) }
232
+ </Flex>
213
233
  { itemIcon && ! isNonUserPattern && (
214
234
  <Tooltip
215
235
  placement="top"
@@ -235,26 +255,6 @@ function Title( { item, categoryId } ) {
235
255
  />
236
256
  </Tooltip>
237
257
  ) }
238
- <Flex
239
- as="div"
240
- gap={ 0 }
241
- justify="left"
242
- className="edit-site-patterns__pattern-title"
243
- >
244
- { item.type === PATTERN_TYPES.theme ? (
245
- item.title
246
- ) : (
247
- <Button
248
- variant="link"
249
- onClick={ onClick }
250
- // Required for the grid's roving tab index system.
251
- // See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243.
252
- tabIndex="-1"
253
- >
254
- { item.title || item.name }
255
- </Button>
256
- ) }
257
- </Flex>
258
258
  </HStack>
259
259
  );
260
260
  }
@@ -225,6 +225,12 @@
225
225
  * TODO: when this becomes stable, consolidate styles with the above.
226
226
  */
227
227
  .edit-site-page-patterns-dataviews {
228
+ margin-top: 60px;
229
+
230
+ @include break-medium {
231
+ margin-top: 0;
232
+ }
233
+
228
234
  .page-patterns-preview-field {
229
235
  display: flex;
230
236
  flex-direction: column;
@@ -283,6 +289,10 @@
283
289
  text-overflow: ellipsis;
284
290
  color: inherit;
285
291
  }
292
+
293
+ .dataviews-pagination {
294
+ z-index: z-index(".edit-site-patterns__dataviews-list-pagination");
295
+ }
286
296
  }
287
297
 
288
298
  .dataviews-action-modal__duplicate-pattern {
@@ -111,6 +111,7 @@ const selectTemplatePartsAsPatterns = createSelector(
111
111
  const selectThemePatterns = createSelector(
112
112
  ( select ) => {
113
113
  const { getSettings } = unlock( select( editSiteStore ) );
114
+ const { getIsResolving } = select( coreStore );
114
115
  const settings = getSettings();
115
116
  const blockPatterns =
116
117
  settings.__experimentalAdditionalBlockPatterns ??
@@ -136,19 +137,23 @@ const selectThemePatterns = createSelector(
136
137
  __unstableSkipMigrationLogs: true,
137
138
  } ),
138
139
  } ) );
139
-
140
- return { patterns, isResolving: false };
140
+ return { patterns, isResolving: getIsResolving( 'getBlockPatterns' ) };
141
141
  },
142
142
  ( select ) => [
143
143
  select( coreStore ).getBlockPatterns(),
144
+ select( coreStore ).getIsResolving( 'getBlockPatterns' ),
144
145
  unlock( select( editSiteStore ) ).getSettings(),
145
146
  ]
146
147
  );
147
148
 
148
149
  const selectPatterns = createSelector(
149
150
  ( select, categoryId, syncStatus, search = '' ) => {
150
- const { patterns: themePatterns } = selectThemePatterns( select );
151
- const { patterns: userPatterns } = selectUserPatterns( select );
151
+ const {
152
+ patterns: themePatterns,
153
+ isResolving: isResolvingThemePatterns,
154
+ } = selectThemePatterns( select );
155
+ const { patterns: userPatterns, isResolving: isResolvingUserPatterns } =
156
+ selectUserPatterns( select );
152
157
 
153
158
  let patterns = [
154
159
  ...( themePatterns || [] ),
@@ -176,7 +181,10 @@ const selectPatterns = createSelector(
176
181
  hasCategory: ( item ) => ! item.hasOwnProperty( 'categories' ),
177
182
  } );
178
183
  }
179
- return { patterns, isResolving: false };
184
+ return {
185
+ patterns,
186
+ isResolving: isResolvingThemePatterns || isResolvingUserPatterns,
187
+ };
180
188
  },
181
189
  ( select ) => [
182
190
  selectThemePatterns( select ),
@@ -429,6 +429,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
429
429
 
430
430
  return (
431
431
  <Page
432
+ className="edit-site-page-template-template-parts-dataviews"
432
433
  title={
433
434
  postType === TEMPLATE_POST_TYPE
434
435
  ? __( 'Templates' )
@@ -58,3 +58,9 @@
58
58
  .page-templates-description {
59
59
  white-space: normal;
60
60
  }
61
+
62
+ .edit-site-page-template-template-parts-dataviews {
63
+ .dataviews-pagination {
64
+ z-index: z-index(".edit-site-templates__dataviews-list-pagination");
65
+ }
66
+ }
@@ -13,6 +13,7 @@ import {
13
13
  } from '@wordpress/components';
14
14
  import { privateApis as routerPrivateApis } from '@wordpress/router';
15
15
  import { __ } from '@wordpress/i18n';
16
+ import { useViewportMatch } from '@wordpress/compose';
16
17
 
17
18
  /**
18
19
  * Internal dependencies
@@ -52,6 +53,7 @@ function SidebarScreenWrapper( { className, ...props } ) {
52
53
 
53
54
  function SidebarScreens() {
54
55
  useSyncPathWithURL();
56
+ const isMobileViewport = useViewportMatch( 'medium', '<' );
55
57
 
56
58
  return (
57
59
  <>
@@ -72,8 +74,9 @@ function SidebarScreens() {
72
74
  </SidebarScreenWrapper>
73
75
  <SidebarScreenWrapper path="/pages">
74
76
  <SidebarNavigationScreen
75
- title={ __( 'Pages' ) }
77
+ title={ __( 'Manage pages' ) }
76
78
  content={ <DataViewsSidebarContent /> }
79
+ backPath="/page"
77
80
  />
78
81
  </SidebarScreenWrapper>
79
82
  <SidebarScreenWrapper path="/page/:postId">
@@ -82,9 +85,11 @@ function SidebarScreens() {
82
85
  <SidebarScreenWrapper path="/:postType(wp_template)">
83
86
  <SidebarNavigationScreenTemplates />
84
87
  </SidebarScreenWrapper>
85
- <SidebarScreenWrapper path="/patterns">
86
- <SidebarNavigationScreenPatterns />
87
- </SidebarScreenWrapper>
88
+ { ! isMobileViewport && (
89
+ <SidebarScreenWrapper path="/patterns">
90
+ <SidebarNavigationScreenPatterns />
91
+ </SidebarScreenWrapper>
92
+ ) }
88
93
  <SidebarScreenWrapper path="/:postType(wp_template|wp_template_part)/all">
89
94
  <SidebarNavigationScreenTemplatesBrowse />
90
95
  </SidebarScreenWrapper>
@@ -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: [
@@ -14,6 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
14
14
  import { privateApis as routerPrivateApis } from '@wordpress/router';
15
15
  import { layout, page, home, verse, plus } from '@wordpress/icons';
16
16
  import { useSelect } from '@wordpress/data';
17
+ import { useViewportMatch } from '@wordpress/compose';
17
18
 
18
19
  /**
19
20
  * Internal dependencies
@@ -42,6 +43,7 @@ const PageItem = ( { postType = 'page', postId, ...props } ) => {
42
43
  };
43
44
 
44
45
  export default function SidebarNavigationScreenPages() {
46
+ const isMobileViewport = useViewportMatch( 'medium', '<' );
45
47
  const { records: pages, isResolving: isLoadingPages } = useEntityRecords(
46
48
  'postType',
47
49
  'page',
@@ -220,12 +222,14 @@ export default function SidebarNavigationScreenPages() {
220
222
  </Truncate>
221
223
  </PageItem>
222
224
  ) ) }
223
- <SidebarNavigationItem
224
- className="edit-site-sidebar-navigation-screen-pages__see-all"
225
- { ...pagesLink }
226
- >
227
- { __( 'Manage all pages' ) }
228
- </SidebarNavigationItem>
225
+ { ! isMobileViewport && (
226
+ <SidebarNavigationItem
227
+ className="edit-site-sidebar-navigation-screen-pages__see-all"
228
+ { ...pagesLink }
229
+ >
230
+ { __( 'Manage all pages' ) }
231
+ </SidebarNavigationItem>
232
+ ) }
229
233
  </VStack>
230
234
  }
231
235
  />
@@ -31,7 +31,7 @@ function TemplateDataviewItem( { template, isActive } ) {
31
31
  export default function DataviewsTemplatesSidebarContent( {
32
32
  activeView,
33
33
  postType,
34
- config,
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={ config[ postType ].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: __( 'All templates' ),
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: __( 'All template parts' ),
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
- config={ config }
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
- () => ( { ...originalSettings, __unstableIsPreviewMode: true } ),
428
+ () => ( {
429
+ ...originalSettings,
430
+ focusMode: false, // Disable "Spotlight mode".
431
+ __unstableIsPreviewMode: true,
432
+ } ),
429
433
  [ originalSettings ]
430
434
  );
431
435
 
@@ -22,6 +22,8 @@ import { TEMPLATE_POST_TYPE } from '../utils/constants';
22
22
  export const setCanvasMode =
23
23
  ( mode ) =>
24
24
  ( { registry, dispatch } ) => {
25
+ const isMediumOrBigger =
26
+ window.matchMedia( '(min-width: 782px)' ).matches;
25
27
  registry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );
26
28
  dispatch( {
27
29
  type: 'SET_CANVAS_MODE',
@@ -29,7 +31,9 @@ export const setCanvasMode =
29
31
  } );
30
32
  // Check if the block list view should be open by default.
31
33
  // If `distractionFree` mode is enabled, the block list view should not be open.
34
+ // This behavior is disabled for small viewports.
32
35
  if (
36
+ isMediumOrBigger &&
33
37
  mode === 'edit' &&
34
38
  registry
35
39
  .select( preferencesStore )
@@ -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: 8
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={ 8 } />\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;EAAG,CAAE,CACrB,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"}