@wordpress/edit-site 6.14.0 → 6.15.0

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 (126) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/add-new-pattern/index.js +6 -10
  4. package/build/components/add-new-pattern/index.js.map +1 -1
  5. package/build/components/editor/index.js +1 -9
  6. package/build/components/editor/index.js.map +1 -1
  7. package/build/components/global-styles/confirm-reset-shadow-dialog.js +39 -0
  8. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
  9. package/build/components/global-styles/font-library-modal/index.js +1 -1
  10. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  11. package/build/components/global-styles/font-sizes/font-size.js +17 -14
  12. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  13. package/build/components/global-styles/font-sizes/font-sizes.js +17 -20
  14. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  15. package/build/components/global-styles/screen-block.js +1 -1
  16. package/build/components/global-styles/screen-block.js.map +1 -1
  17. package/build/components/global-styles/shadows-edit-panel.js +21 -13
  18. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  19. package/build/components/global-styles/shadows-panel.js +43 -5
  20. package/build/components/global-styles/shadows-panel.js.map +1 -1
  21. package/build/components/layout/index.js +10 -1
  22. package/build/components/layout/index.js.map +1 -1
  23. package/build/components/page-patterns/fields.js +6 -35
  24. package/build/components/page-patterns/fields.js.map +1 -1
  25. package/build/components/page-templates/fields.js +6 -19
  26. package/build/components/page-templates/fields.js.map +1 -1
  27. package/build/components/post-list/index.js +13 -5
  28. package/build/components/post-list/index.js.map +1 -1
  29. package/build/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
  30. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  31. package/build/components/sidebar-dataviews/default-views.js +3 -2
  32. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  33. package/build/components/sidebar-global-styles-wrapper/index.js +40 -72
  34. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  35. package/build/components/sidebar-navigation-screen-main/index.js +1 -0
  36. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  37. package/build/components/site-editor-routes/stylebook.js +6 -2
  38. package/build/components/site-editor-routes/stylebook.js.map +1 -1
  39. package/build/components/site-editor-routes/styles.js +7 -1
  40. package/build/components/site-editor-routes/styles.js.map +1 -1
  41. package/build/components/style-book/constants.js +36 -2
  42. package/build/components/style-book/constants.js.map +1 -1
  43. package/build/components/style-book/index.js +106 -61
  44. package/build/components/style-book/index.js.map +1 -1
  45. package/build-module/components/add-new-pattern/index.js +6 -10
  46. package/build-module/components/add-new-pattern/index.js.map +1 -1
  47. package/build-module/components/editor/index.js +1 -9
  48. package/build-module/components/editor/index.js.map +1 -1
  49. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +32 -0
  50. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
  51. package/build-module/components/global-styles/font-library-modal/index.js +1 -1
  52. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  53. package/build-module/components/global-styles/font-sizes/font-size.js +17 -14
  54. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  55. package/build-module/components/global-styles/font-sizes/font-sizes.js +24 -27
  56. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  57. package/build-module/components/global-styles/screen-block.js +1 -1
  58. package/build-module/components/global-styles/screen-block.js.map +1 -1
  59. package/build-module/components/global-styles/shadows-edit-panel.js +21 -13
  60. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  61. package/build-module/components/global-styles/shadows-panel.js +46 -8
  62. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  63. package/build-module/components/layout/index.js +11 -2
  64. package/build-module/components/layout/index.js.map +1 -1
  65. package/build-module/components/page-patterns/fields.js +7 -36
  66. package/build-module/components/page-patterns/fields.js.map +1 -1
  67. package/build-module/components/page-templates/fields.js +6 -19
  68. package/build-module/components/page-templates/fields.js.map +1 -1
  69. package/build-module/components/post-list/index.js +13 -5
  70. package/build-module/components/post-list/index.js.map +1 -1
  71. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
  72. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  73. package/build-module/components/sidebar-dataviews/default-views.js +3 -2
  74. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  75. package/build-module/components/sidebar-global-styles-wrapper/index.js +41 -75
  76. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  77. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -0
  78. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  79. package/build-module/components/site-editor-routes/stylebook.js +6 -2
  80. package/build-module/components/site-editor-routes/stylebook.js.map +1 -1
  81. package/build-module/components/site-editor-routes/styles.js +7 -1
  82. package/build-module/components/site-editor-routes/styles.js.map +1 -1
  83. package/build-module/components/style-book/constants.js +35 -1
  84. package/build-module/components/style-book/constants.js.map +1 -1
  85. package/build-module/components/style-book/index.js +107 -62
  86. package/build-module/components/style-book/index.js.map +1 -1
  87. package/build-style/posts-rtl.css +72 -78
  88. package/build-style/posts.css +72 -78
  89. package/build-style/style-rtl.css +163 -184
  90. package/build-style/style.css +163 -184
  91. package/package.json +42 -41
  92. package/src/components/add-new-pattern/index.js +10 -7
  93. package/src/components/canvas-loader/style.scss +4 -3
  94. package/src/components/editor/index.js +1 -7
  95. package/src/components/editor/style.scss +4 -2
  96. package/src/components/editor-canvas-container/style.scss +7 -1
  97. package/src/components/global-styles/confirm-reset-shadow-dialog.js +37 -0
  98. package/src/components/global-styles/font-library-modal/index.js +1 -1
  99. package/src/components/global-styles/font-library-modal/style.scss +4 -2
  100. package/src/components/global-styles/font-sizes/font-size.js +28 -19
  101. package/src/components/global-styles/font-sizes/font-sizes.js +37 -35
  102. package/src/components/global-styles/screen-block.js +3 -2
  103. package/src/components/global-styles/shadows-edit-panel.js +38 -28
  104. package/src/components/global-styles/shadows-panel.js +64 -5
  105. package/src/components/global-styles/style.scss +9 -1
  106. package/src/components/global-styles/variations/style.scss +4 -3
  107. package/src/components/layout/index.js +12 -1
  108. package/src/components/layout/style.scss +8 -3
  109. package/src/components/page/style.scss +8 -5
  110. package/src/components/page-patterns/fields.js +11 -41
  111. package/src/components/page-patterns/style.scss +4 -25
  112. package/src/components/page-templates/fields.js +6 -16
  113. package/src/components/page-templates/style.scss +4 -20
  114. package/src/components/post-list/index.js +13 -4
  115. package/src/components/sidebar-dataviews/custom-dataviews-list.js +7 -6
  116. package/src/components/sidebar-dataviews/default-views.js +3 -2
  117. package/src/components/sidebar-dataviews/style.scss +4 -1
  118. package/src/components/sidebar-global-styles-wrapper/index.js +37 -83
  119. package/src/components/sidebar-global-styles-wrapper/style.scss +22 -0
  120. package/src/components/sidebar-navigation-item/style.scss +6 -0
  121. package/src/components/sidebar-navigation-screen-main/index.js +1 -1
  122. package/src/components/site-editor-routes/stylebook.js +2 -2
  123. package/src/components/site-editor-routes/styles.js +5 -1
  124. package/src/components/site-hub/style.scss +4 -2
  125. package/src/components/style-book/constants.ts +49 -1
  126. package/src/components/style-book/index.js +151 -77
@@ -13,8 +13,10 @@ import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorS
13
13
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
14
14
  import { useSelect, dispatch } from '@wordpress/data';
15
15
  import { useResizeObserver } from '@wordpress/compose';
16
- import { useMemo, useState, memo, useContext, useRef, useLayoutEffect } from '@wordpress/element';
16
+ import { useMemo, useState, memo, useContext, useRef, useLayoutEffect, useEffect } from '@wordpress/element';
17
17
  import { ENTER, SPACE } from '@wordpress/keycodes';
18
+ import { uploadMedia } from '@wordpress/media-utils';
19
+ import { store as coreStore } from '@wordpress/core-data';
18
20
 
19
21
  /**
20
22
  * Internal dependencies
@@ -25,6 +27,9 @@ import { STYLE_BOOK_IFRAME_STYLES } from './constants';
25
27
  import { getExamplesByCategory, getTopLevelStyleBookCategories } from './categories';
26
28
  import { getExamples } from './examples';
27
29
  import { store as siteEditorStore } from '../../store';
30
+ import { useSection } from '../sidebar-global-styles-wrapper';
31
+ import { GlobalStylesRenderer } from '../global-styles-renderer';
32
+ import { STYLE_BOOK_COLOR_GROUPS, STYLE_BOOK_PREVIEW_CATEGORIES } from '../style-book/constants';
28
33
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
34
  const {
30
35
  ExperimentalBlockEditorProvider,
@@ -61,31 +66,19 @@ const scrollToSection = (anchorId, iframe) => {
61
66
  };
62
67
 
63
68
  /**
64
- * Parses a Block Editor navigation path to extract the block name and
65
- * build a style book navigation path. The object can be extended to include a category,
66
- * representing a style book tab/section.
69
+ * Parses a Block Editor navigation path to build a style book navigation path.
70
+ * The object can be extended to include a category, representing a style book tab/section.
67
71
  *
68
72
  * @param {string} path An internal Block Editor navigation path.
69
73
  * @return {null|{block: string}} An object containing the example to navigate to.
70
74
  */
71
75
  const getStyleBookNavigationFromPath = path => {
72
76
  if (path && typeof path === 'string') {
73
- if (path === '/') {
77
+ if (path === '/' || path.startsWith('/typography') || path.startsWith('/colors') || path.startsWith('/blocks')) {
74
78
  return {
75
79
  top: true
76
80
  };
77
81
  }
78
- if (path.startsWith('/typography')) {
79
- return {
80
- block: 'typography'
81
- };
82
- }
83
- let block = path.includes('/blocks/') ? decodeURIComponent(path.split('/blocks/')[1]) : null;
84
- // Default to theme-colors if the path ends with /colors.
85
- block = path.endsWith('/colors') ? 'theme-colors' : block;
86
- return {
87
- block
88
- };
89
82
  }
90
83
  return null;
91
84
  };
@@ -214,23 +207,31 @@ function StyleBook({
214
207
  children: tab.title
215
208
  }, tab.slug))
216
209
  })
217
- }), tabs.map(tab => /*#__PURE__*/_jsx(Tabs.TabPanel, {
218
- tabId: tab.slug,
219
- focusable: false,
220
- className: "edit-site-style-book__tabpanel",
221
- children: /*#__PURE__*/_jsx(StyleBookBody, {
222
- category: tab.slug,
223
- examples: examples,
224
- isSelected: isSelected,
225
- onSelect: onSelect,
226
- settings: settings,
227
- sizes: sizes,
228
- title: tab.title,
229
- goTo: goTo
230
- })
231
- }, tab.slug))]
210
+ }), tabs.map(tab => {
211
+ const categoryDefinition = tab.slug ? getTopLevelStyleBookCategories().find(_category => _category.slug === tab.slug) : null;
212
+ const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : {
213
+ examples
214
+ };
215
+ return /*#__PURE__*/_jsx(Tabs.TabPanel, {
216
+ tabId: tab.slug,
217
+ focusable: false,
218
+ className: "edit-site-style-book__tabpanel",
219
+ children: /*#__PURE__*/_jsx(StyleBookBody, {
220
+ category: tab.slug,
221
+ examples: filteredExamples,
222
+ isSelected: isSelected,
223
+ onSelect: onSelect,
224
+ settings: settings,
225
+ sizes: sizes,
226
+ title: tab.title,
227
+ goTo: goTo
228
+ })
229
+ }, tab.slug);
230
+ })]
232
231
  }) : /*#__PURE__*/_jsx(StyleBookBody, {
233
- examples: examplesForSinglePageUse,
232
+ examples: {
233
+ examples: examplesForSinglePageUse
234
+ },
234
235
  isSelected: isSelected,
235
236
  onClick: onClick,
236
237
  onSelect: onSelect,
@@ -245,30 +246,83 @@ function StyleBook({
245
246
  /**
246
247
  * Style Book Preview component renders the stylebook without the Editor dependency.
247
248
  *
248
- * @param {Object} props Component props.
249
- * @param {string} props.path Path to the selected block.
250
- * @param {Object} props.userConfig User configuration.
251
- * @param {Function} props.isSelected Function to check if a block is selected.
252
- * @param {Function} props.onSelect Function to select a block.
249
+ * @param {Object} props Component props.
250
+ * @param {Object} props.userConfig User configuration.
251
+ * @param {boolean} props.isStatic Whether the stylebook is static or clickable.
253
252
  * @return {Object} Style Book Preview component.
254
253
  */
255
254
  export const StyleBookPreview = ({
256
- path = '',
257
255
  userConfig = {},
258
- isSelected,
259
- onSelect
256
+ isStatic = false
260
257
  }) => {
261
258
  const siteEditorSettings = useSelect(select => select(siteEditorStore).getSettings(), []);
259
+ const canUserUploadMedia = useSelect(select => select(coreStore).canUser('create', {
260
+ kind: 'root',
261
+ name: 'media'
262
+ }), []);
263
+
262
264
  // Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.
263
- dispatch(blockEditorStore).updateSettings(siteEditorSettings);
265
+ useEffect(() => {
266
+ dispatch(blockEditorStore).updateSettings({
267
+ ...siteEditorSettings,
268
+ mediaUpload: canUserUploadMedia ? uploadMedia : undefined
269
+ });
270
+ }, [siteEditorSettings, canUserUploadMedia]);
271
+ const [section, onChangeSection] = useSection();
272
+ const isSelected = blockName => {
273
+ // Match '/blocks/core%2Fbutton' and
274
+ // '/blocks/core%2Fbutton/typography', but not
275
+ // '/blocks/core%2Fbuttons'.
276
+ return section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`);
277
+ };
278
+ const onSelect = blockName => {
279
+ if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
280
+ // Go to color palettes Global Styles.
281
+ onChangeSection('/colors/palette');
282
+ return;
283
+ }
284
+ if (blockName === 'typography') {
285
+ // Go to typography Global Styles.
286
+ onChangeSection('/typography');
287
+ return;
288
+ }
289
+
290
+ // Now go to the selected block.
291
+ onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
292
+ };
264
293
  const [resizeObserver, sizes] = useResizeObserver();
265
294
  const colors = useMultiOriginPalettes();
266
295
  const examples = getExamples(colors);
267
296
  const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
297
+ let previewCategory = null;
298
+ if (section.includes('/colors')) {
299
+ previewCategory = 'colors';
300
+ } else if (section.includes('/typography')) {
301
+ previewCategory = 'text';
302
+ } else if (section.includes('/blocks')) {
303
+ previewCategory = 'blocks';
304
+ const blockName = decodeURIComponent(section).split('/blocks/')[1];
305
+ if (blockName && examples.find(example => example.name === blockName)) {
306
+ previewCategory = blockName;
307
+ }
308
+ } else if (!isStatic) {
309
+ previewCategory = 'overview';
310
+ }
311
+ const categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(category => category.slug === previewCategory);
312
+
313
+ // If there's no category definition there may be a single block.
314
+ const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : {
315
+ examples: [examples.find(example => example.name === previewCategory)]
316
+ };
317
+
318
+ // If there's no preview category, show all examples.
319
+ const displayedExamples = previewCategory ? filteredExamples : {
320
+ examples: examplesForSinglePageUse
321
+ };
268
322
  const {
269
323
  base: baseConfig
270
324
  } = useContext(GlobalStylesContext);
271
- const goTo = getStyleBookNavigationFromPath(path);
325
+ const goTo = getStyleBookNavigationFromPath(section);
272
326
  const mergedConfig = useMemo(() => {
273
327
  if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
274
328
  return mergeBaseAndUserConfigs(baseConfig, userConfig);
@@ -283,21 +337,22 @@ export const StyleBookPreview = ({
283
337
  }), [globalStyles, siteEditorSettings, userConfig]);
284
338
  return /*#__PURE__*/_jsxs("div", {
285
339
  className: "edit-site-style-book",
286
- children: [resizeObserver, /*#__PURE__*/_jsx(BlockEditorProvider, {
340
+ children: [resizeObserver, /*#__PURE__*/_jsxs(BlockEditorProvider, {
287
341
  settings: settings,
288
- children: /*#__PURE__*/_jsx(StyleBookBody, {
289
- examples: examplesForSinglePageUse,
342
+ children: [/*#__PURE__*/_jsx(GlobalStylesRenderer, {
343
+ disableRootPadding: true
344
+ }), /*#__PURE__*/_jsx(StyleBookBody, {
345
+ examples: displayedExamples,
290
346
  settings: settings,
291
347
  goTo: goTo,
292
348
  sizes: sizes,
293
- isSelected: isSelected,
294
- onSelect: onSelect
295
- })
349
+ isSelected: !isStatic ? isSelected : null,
350
+ onSelect: !isStatic ? onSelect : null
351
+ })]
296
352
  })]
297
353
  });
298
354
  };
299
355
  export const StyleBookBody = ({
300
- category,
301
356
  examples,
302
357
  isSelected,
303
358
  onClick,
@@ -344,10 +399,6 @@ export const StyleBookBody = ({
344
399
  if (hasIframeLoaded && iframeRef?.current) {
345
400
  if (goTo?.top) {
346
401
  scrollToSection('top', iframeRef?.current);
347
- return;
348
- }
349
- if (goTo?.block) {
350
- scrollToSection(`example-${goTo?.block}`, iframeRef?.current);
351
402
  }
352
403
  }
353
404
  }, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]);
@@ -369,28 +420,22 @@ export const StyleBookBody = ({
369
420
  className: clsx('edit-site-style-book__examples', {
370
421
  'is-wide': sizes.width > 600
371
422
  }),
372
- examples: examples,
373
- category: category,
423
+ filteredExamples: examples,
374
424
  label: title ? sprintf(
375
425
  // translators: %s: Category of blocks, e.g. Text.
376
426
  __('Examples of blocks in the %s category'), title) : __('Examples of blocks'),
377
427
  isSelected: isSelected,
378
428
  onSelect: onSelect
379
- }, category)]
429
+ }, title)]
380
430
  });
381
431
  };
382
432
  const Examples = memo(({
383
433
  className,
384
- examples,
385
- category,
434
+ filteredExamples,
386
435
  label,
387
436
  isSelected,
388
437
  onSelect
389
438
  }) => {
390
- const categoryDefinition = category ? getTopLevelStyleBookCategories().find(_category => _category.slug === category) : null;
391
- const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : {
392
- examples
393
- };
394
439
  return /*#__PURE__*/_jsxs(Composite, {
395
440
  orientation: "vertical",
396
441
  className: className,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Disabled","Composite","privateApis","componentsPrivateApis","__","_x","sprintf","BlockList","blockEditorPrivateApis","store","blockEditorStore","useSettings","BlockEditorProvider","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","editorPrivateApis","useSelect","dispatch","useResizeObserver","useMemo","useState","memo","useContext","useRef","useLayoutEffect","ENTER","SPACE","unlock","EditorCanvasContainer","STYLE_BOOK_IFRAME_STYLES","getExamplesByCategory","getTopLevelStyleBookCategories","getExamples","siteEditorStore","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","mergeBaseAndUserConfigs","Tabs","isObjectEmpty","object","Object","keys","length","scrollToSection","anchorId","iframe","contentDocument","element","body","getElementById","scrollIntoView","behavior","getStyleBookNavigationFromPath","path","top","startsWith","block","includes","decodeURIComponent","split","endsWith","useMultiOriginPalettes","colors","gradients","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","palettes","result","duotones","push","name","slug","getExamplesForSinglePageUse","examples","examplesForSinglePageUse","overviewCategoryExamples","otherExamples","filter","example","category","find","overviewExample","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","tabs","some","base","baseConfig","goTo","mergedConfig","originalSettings","select","getSettings","globalStyles","settings","styles","isPreviewMode","closeButtonLabel","children","className","width","style","color","background","TabList","map","tab","Tab","tabId","title","TabPanel","focusable","StyleBookBody","StyleBookPreview","siteEditorSettings","updateSettings","isFocused","setIsFocused","hasIframeLoaded","setHasIframeLoaded","iframeRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","handleLoad","current","onLoad","ref","tabIndex","Examples","label","categoryDefinition","_category","filteredExamples","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","undefined","render","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDisabled,\n\tComposite,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseSettings,\n\tBlockEditorProvider,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect, dispatch } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport {\n\tuseMemo,\n\tuseState,\n\tmemo,\n\tuseContext,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { STYLE_BOOK_IFRAME_STYLES } from './constants';\nimport {\n\tgetExamplesByCategory,\n\tgetTopLevelStyleBookCategories,\n} from './categories';\nimport { getExamples } from './examples';\nimport { store as siteEditorStore } from '../../store';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Scrolls to a section within an iframe.\n *\n * @param {string} anchorId The id of the element to scroll to.\n * @param {HTMLIFrameElement} iframe The target iframe.\n */\nconst scrollToSection = ( anchorId, iframe ) => {\n\tif ( ! anchorId || ! iframe || ! iframe?.contentDocument ) {\n\t\treturn;\n\t}\n\n\tconst element =\n\t\tanchorId === 'top'\n\t\t\t? iframe.contentDocument.body\n\t\t\t: iframe.contentDocument.getElementById( anchorId );\n\tif ( element ) {\n\t\telement.scrollIntoView( {\n\t\t\tbehavior: 'smooth',\n\t\t} );\n\t}\n};\n\n/**\n * Parses a Block Editor navigation path to extract the block name and\n * build a style book navigation path. The object can be extended to include a category,\n * representing a style book tab/section.\n *\n * @param {string} path An internal Block Editor navigation path.\n * @return {null|{block: string}} An object containing the example to navigate to.\n */\nconst getStyleBookNavigationFromPath = ( path ) => {\n\tif ( path && typeof path === 'string' ) {\n\t\tif ( path === '/' ) {\n\t\t\treturn {\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t}\n\n\t\tif ( path.startsWith( '/typography' ) ) {\n\t\t\treturn {\n\t\t\t\tblock: 'typography',\n\t\t\t};\n\t\t}\n\t\tlet block = path.includes( '/blocks/' )\n\t\t\t? decodeURIComponent( path.split( '/blocks/' )[ 1 ] )\n\t\t\t: null;\n\t\t// Default to theme-colors if the path ends with /colors.\n\t\tblock = path.endsWith( '/colors' ) ? 'theme-colors' : block;\n\n\t\treturn {\n\t\t\tblock,\n\t\t};\n\t}\n\treturn null;\n};\n\n/**\n * Retrieves colors, gradients, and duotone filters from Global Styles.\n * The inclusion of default (Core) palettes is controlled by the relevant\n * theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone.\n *\n * @return {Object} Object containing properties for each type of palette.\n */\nfunction useMultiOriginPalettes() {\n\tconst { colors, gradients } = useMultipleOriginColorsAndGradients();\n\n\t// Add duotone filters to the palettes data.\n\tconst [\n\t\tshouldDisplayDefaultDuotones,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t] = useSettings(\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default'\n\t);\n\n\tconst palettes = useMemo( () => {\n\t\tconst result = { colors, gradients, duotones: [] };\n\n\t\tif ( themeDuotones && themeDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates these duotone filters come from the theme.'\n\t\t\t\t),\n\t\t\t\tslug: 'theme',\n\t\t\t\tduotones: themeDuotones,\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tshouldDisplayDefaultDuotones &&\n\t\t\tdefaultDuotones &&\n\t\t\tdefaultDuotones.length\n\t\t) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates these duotone filters come from WordPress.'\n\t\t\t\t),\n\t\t\t\tslug: 'default',\n\t\t\t\tduotones: defaultDuotones,\n\t\t\t} );\n\t\t}\n\t\tif ( customDuotones && customDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates these doutone filters are created by the user.'\n\t\t\t\t),\n\t\t\t\tslug: 'custom',\n\t\t\t\tduotones: customDuotones,\n\t\t\t} );\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tcolors,\n\t\tgradients,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t\tshouldDisplayDefaultDuotones,\n\t] );\n\n\treturn palettes;\n}\n\n/**\n * Get deduped examples for single page stylebook.\n * @param {Array} examples Array of examples.\n * @return {Array} Deduped examples.\n */\nexport function getExamplesForSinglePageUse( examples ) {\n\tconst examplesForSinglePageUse = [];\n\tconst overviewCategoryExamples = getExamplesByCategory(\n\t\t{ slug: 'overview' },\n\t\texamples\n\t);\n\texamplesForSinglePageUse.push( ...overviewCategoryExamples.examples );\n\tconst otherExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\texample.category !== 'overview' &&\n\t\t\t! overviewCategoryExamples.examples.find(\n\t\t\t\t( overviewExample ) => overviewExample.name === example.name\n\t\t\t)\n\t\t);\n\t} );\n\texamplesForSinglePageUse.push( ...otherExamples );\n\n\treturn examplesForSinglePageUse;\n}\n\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n\tpath = '',\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = useMemo( () => getExamples( colors ), [ colors ] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetTopLevelStyleBookCategories().filter( ( category ) =>\n\t\t\t\texamples.some(\n\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t)\n\t\t\t),\n\t\t[ examples ]\n\t);\n\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: originalSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, originalSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={ showCloseButton ? __( 'Close' ) : null }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t<div className=\"edit-site-style-book__tablist-container\">\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-style-book__tabpanel\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\t\t\t\tcategory={ tab.slug }\n\t\t\t\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\t\t\t\ttitle={ tab.title }\n\t\t\t\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Tabs>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ examplesForSinglePageUse }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\n/**\n * Style Book Preview component renders the stylebook without the Editor dependency.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Path to the selected block.\n * @param {Object} props.userConfig User configuration.\n * @param {Function} props.isSelected Function to check if a block is selected.\n * @param {Function} props.onSelect Function to select a block.\n * @return {Object} Style Book Preview component.\n */\nexport const StyleBookPreview = ( {\n\tpath = '',\n\tuserConfig = {},\n\tisSelected,\n\tonSelect,\n} ) => {\n\tconst siteEditorSettings = useSelect(\n\t\t( select ) => select( siteEditorStore ).getSettings(),\n\t\t[]\n\t);\n\t// Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.\n\tdispatch( blockEditorStore ).updateSettings( siteEditorSettings );\n\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = getExamples( colors );\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...siteEditorSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: siteEditorSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, siteEditorSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<div className=\"edit-site-style-book\">\n\t\t\t{ resizeObserver }\n\t\t\t<BlockEditorProvider settings={ settings }>\n\t\t\t\t<StyleBookBody\n\t\t\t\t\texamples={ examplesForSinglePageUse }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t</BlockEditorProvider>\n\t\t</div>\n\t);\n};\n\nexport const StyleBookBody = ( {\n\tcategory,\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\n\ttitle,\n\tgoTo,\n} ) => {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst [ hasIframeLoaded, setHasIframeLoaded ] = useState( false );\n\tconst iframeRef = useRef( null );\n\t// The presence of an `onClick` prop indicates that the Style Book is being used as a button.\n\t// In this case, add additional props to the iframe to make it behave like a button.\n\tconst buttonModeProps = {\n\t\trole: 'button',\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( onClick && ( keyCode === ENTER || keyCode === SPACE ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\tonClick: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( onClick ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\tconst handleLoad = () => setHasIframeLoaded( true );\n\tuseLayoutEffect( () => {\n\t\tif ( hasIframeLoaded && iframeRef?.current ) {\n\t\t\tif ( goTo?.top ) {\n\t\t\t\tscrollToSection( 'top', iframeRef?.current );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( goTo?.block ) {\n\t\t\t\tscrollToSection(\n\t\t\t\t\t`example-${ goTo?.block }`,\n\t\t\t\t\tiframeRef?.current\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}, [ iframeRef?.current, goTo, scrollToSection, hasIframeLoaded ] );\n\n\treturn (\n\t\t<Iframe\n\t\t\tonLoad={ handleLoad }\n\t\t\tref={ iframeRef }\n\t\t\tclassName={ clsx( 'edit-site-style-book__iframe', {\n\t\t\t\t'is-focused': isFocused && !! onClick,\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tname=\"style-book-canvas\"\n\t\t\ttabIndex={ 0 }\n\t\t\t{ ...( onClick ? buttonModeProps : {} ) }\n\t\t>\n\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t<style>\n\t\t\t\t{ STYLE_BOOK_IFRAME_STYLES }\n\t\t\t\t{ !! onClick &&\n\t\t\t\t\t'body { cursor: pointer; } body * { pointer-events: none; }' }\n\t\t\t</style>\n\t\t\t<Examples\n\t\t\t\tclassName={ clsx( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\texamples={ examples }\n\t\t\t\tcategory={ category }\n\t\t\t\tlabel={\n\t\t\t\t\ttitle\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t__( 'Examples of blocks in the %s category' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Examples of blocks' )\n\t\t\t\t}\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tkey={ category }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst categoryDefinition = category\n\t\t\t? getTopLevelStyleBookCategories().find(\n\t\t\t\t\t( _category ) => _category.slug === category\n\t\t\t )\n\t\t\t: null;\n\n\t\tconst filteredExamples = categoryDefinition\n\t\t\t? getExamplesByCategory( categoryDefinition, examples )\n\t\t\t: { examples };\n\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t\trole=\"grid\"\n\t\t\t>\n\t\t\t\t{ !! filteredExamples?.examples?.length &&\n\t\t\t\t\tfilteredExamples.examples.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tcontent={ example.content }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t!! onSelect\n\t\t\t\t\t\t\t\t\t? () => onSelect( example.name )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ !! filteredExamples?.subcategories?.length &&\n\t\t\t\t\tfilteredExamples.subcategories.map( ( subcategory ) => (\n\t\t\t\t\t\t<Composite.Group\n\t\t\t\t\t\t\tclassName=\"edit-site-style-book__subcategory\"\n\t\t\t\t\t\t\tkey={ `subcategory-${ subcategory.slug }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Composite.GroupLabel>\n\t\t\t\t\t\t\t\t<h2 className=\"edit-site-style-book__subcategory-title\">\n\t\t\t\t\t\t\t\t\t{ subcategory.title }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t</Composite.GroupLabel>\n\t\t\t\t\t\t\t<Subcategory\n\t\t\t\t\t\t\t\texamples={ subcategory.examples }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Composite.Group>\n\t\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t);\n\t}\n);\n\nconst Subcategory = ( { examples, isSelected, onSelect } ) => {\n\treturn (\n\t\t!! examples?.length &&\n\t\texamples.map( ( example ) => (\n\t\t\t<Example\n\t\t\t\tkey={ example.name }\n\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\ttitle={ example.title }\n\t\t\t\tcontent={ example.content }\n\t\t\t\tblocks={ example.blocks }\n\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\tonClick={ !! onSelect ? () => onSelect( example.name ) : null }\n\t\t\t/>\n\t\t) )\n\t);\n};\n\nconst disabledExamples = [ 'example-duotones' ];\n\nconst Example = ( { id, title, blocks, isSelected, onClick, content } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst disabledProps =\n\t\tdisabledExamples.includes( id ) || ! onClick\n\t\t\t? {\n\t\t\t\t\tdisabled: true,\n\t\t\t\t\taccessibleWhenDisabled: !! onClick,\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<Composite.Item\n\t\t\t\t\tclassName={ clsx( 'edit-site-style-book__example', {\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t'is-disabled-example': !! disabledProps?.disabled,\n\t\t\t\t\t} ) }\n\t\t\t\t\tid={ id }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\t!! onClick\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole={ !! onClick ? 'button' : null }\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t{ ...disabledProps }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-style-book__example-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-style-book__example-preview\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<Disabled className=\"edit-site-style-book__example-preview__content\">\n\t\t\t\t\t\t\t{ content ? (\n\t\t\t\t\t\t\t\tcontent\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EditorStyles />\n\t\t\t\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Disabled>\n\t\t\t\t\t</div>\n\t\t\t\t</Composite.Item>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default StyleBook;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,M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;YAAAD,QAAA,EACjE8C,OAAO,GACRA,OAAO,gBAEP9H,KAAA,CAACC,+BAA+B;cAC/B+I,KAAK,EAAGT,cAAgB;cACxB3D,QAAQ,EAAGA,QAAU;cAAAI,QAAA,gBAErBlF,IAAA,CAACzB,YAAY,IAAE,CAAC,eAChByB,IAAA,CAAChC,SAAS;gBAACmL,cAAc,EAAG;cAAO,CAAE,CAAC;YAAA,CACN;UACjC,CACQ;QAAC,CACP,CAAC;MAAA,CACS;IAAC,CACb;EAAC,CACF,CAAC;AAER,CAAC;AAED,eAAe5F,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Disabled","Composite","privateApis","componentsPrivateApis","__","_x","sprintf","BlockList","blockEditorPrivateApis","store","blockEditorStore","useSettings","BlockEditorProvider","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","editorPrivateApis","useSelect","dispatch","useResizeObserver","useMemo","useState","memo","useContext","useRef","useLayoutEffect","useEffect","ENTER","SPACE","uploadMedia","coreStore","unlock","EditorCanvasContainer","STYLE_BOOK_IFRAME_STYLES","getExamplesByCategory","getTopLevelStyleBookCategories","getExamples","siteEditorStore","useSection","GlobalStylesRenderer","STYLE_BOOK_COLOR_GROUPS","STYLE_BOOK_PREVIEW_CATEGORIES","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","mergeBaseAndUserConfigs","Tabs","isObjectEmpty","object","Object","keys","length","scrollToSection","anchorId","iframe","contentDocument","element","body","getElementById","scrollIntoView","behavior","getStyleBookNavigationFromPath","path","startsWith","top","useMultiOriginPalettes","colors","gradients","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","palettes","result","duotones","push","name","slug","getExamplesForSinglePageUse","examples","examplesForSinglePageUse","overviewCategoryExamples","otherExamples","filter","example","category","find","overviewExample","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","tabs","some","base","baseConfig","goTo","mergedConfig","originalSettings","select","getSettings","globalStyles","settings","styles","isPreviewMode","closeButtonLabel","children","className","width","style","color","background","TabList","map","tab","Tab","tabId","title","categoryDefinition","_category","filteredExamples","TabPanel","focusable","StyleBookBody","StyleBookPreview","isStatic","siteEditorSettings","canUserUploadMedia","canUser","kind","updateSettings","mediaUpload","undefined","section","onChangeSection","blockName","encodeURIComponent","group","previewCategory","includes","decodeURIComponent","split","displayedExamples","disableRootPadding","isFocused","setIsFocused","hasIframeLoaded","setHasIframeLoaded","iframeRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","handleLoad","current","onLoad","ref","tabIndex","Examples","label","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","render","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDisabled,\n\tComposite,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseSettings,\n\tBlockEditorProvider,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect, dispatch } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport {\n\tuseMemo,\n\tuseState,\n\tmemo,\n\tuseContext,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n} from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { STYLE_BOOK_IFRAME_STYLES } from './constants';\nimport {\n\tgetExamplesByCategory,\n\tgetTopLevelStyleBookCategories,\n} from './categories';\nimport { getExamples } from './examples';\nimport { store as siteEditorStore } from '../../store';\nimport { useSection } from '../sidebar-global-styles-wrapper';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport {\n\tSTYLE_BOOK_COLOR_GROUPS,\n\tSTYLE_BOOK_PREVIEW_CATEGORIES,\n} from '../style-book/constants';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Scrolls to a section within an iframe.\n *\n * @param {string} anchorId The id of the element to scroll to.\n * @param {HTMLIFrameElement} iframe The target iframe.\n */\nconst scrollToSection = ( anchorId, iframe ) => {\n\tif ( ! anchorId || ! iframe || ! iframe?.contentDocument ) {\n\t\treturn;\n\t}\n\n\tconst element =\n\t\tanchorId === 'top'\n\t\t\t? iframe.contentDocument.body\n\t\t\t: iframe.contentDocument.getElementById( anchorId );\n\tif ( element ) {\n\t\telement.scrollIntoView( {\n\t\t\tbehavior: 'smooth',\n\t\t} );\n\t}\n};\n\n/**\n * Parses a Block Editor navigation path to build a style book navigation path.\n * The object can be extended to include a category, representing a style book tab/section.\n *\n * @param {string} path An internal Block Editor navigation path.\n * @return {null|{block: string}} An object containing the example to navigate to.\n */\nconst getStyleBookNavigationFromPath = ( path ) => {\n\tif ( path && typeof path === 'string' ) {\n\t\tif (\n\t\t\tpath === '/' ||\n\t\t\tpath.startsWith( '/typography' ) ||\n\t\t\tpath.startsWith( '/colors' ) ||\n\t\t\tpath.startsWith( '/blocks' )\n\t\t) {\n\t\t\treturn {\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t}\n\t}\n\treturn null;\n};\n\n/**\n * Retrieves colors, gradients, and duotone filters from Global Styles.\n * The inclusion of default (Core) palettes is controlled by the relevant\n * theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone.\n *\n * @return {Object} Object containing properties for each type of palette.\n */\nfunction useMultiOriginPalettes() {\n\tconst { colors, gradients } = useMultipleOriginColorsAndGradients();\n\n\t// Add duotone filters to the palettes data.\n\tconst [\n\t\tshouldDisplayDefaultDuotones,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t] = useSettings(\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default'\n\t);\n\n\tconst palettes = useMemo( () => {\n\t\tconst result = { colors, gradients, duotones: [] };\n\n\t\tif ( themeDuotones && themeDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates these duotone filters come from the theme.'\n\t\t\t\t),\n\t\t\t\tslug: 'theme',\n\t\t\t\tduotones: themeDuotones,\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tshouldDisplayDefaultDuotones &&\n\t\t\tdefaultDuotones &&\n\t\t\tdefaultDuotones.length\n\t\t) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates these duotone filters come from WordPress.'\n\t\t\t\t),\n\t\t\t\tslug: 'default',\n\t\t\t\tduotones: defaultDuotones,\n\t\t\t} );\n\t\t}\n\t\tif ( customDuotones && customDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates these doutone filters are created by the user.'\n\t\t\t\t),\n\t\t\t\tslug: 'custom',\n\t\t\t\tduotones: customDuotones,\n\t\t\t} );\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tcolors,\n\t\tgradients,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t\tshouldDisplayDefaultDuotones,\n\t] );\n\n\treturn palettes;\n}\n\n/**\n * Get deduped examples for single page stylebook.\n * @param {Array} examples Array of examples.\n * @return {Array} Deduped examples.\n */\nexport function getExamplesForSinglePageUse( examples ) {\n\tconst examplesForSinglePageUse = [];\n\tconst overviewCategoryExamples = getExamplesByCategory(\n\t\t{ slug: 'overview' },\n\t\texamples\n\t);\n\texamplesForSinglePageUse.push( ...overviewCategoryExamples.examples );\n\tconst otherExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\texample.category !== 'overview' &&\n\t\t\t! overviewCategoryExamples.examples.find(\n\t\t\t\t( overviewExample ) => overviewExample.name === example.name\n\t\t\t)\n\t\t);\n\t} );\n\texamplesForSinglePageUse.push( ...otherExamples );\n\n\treturn examplesForSinglePageUse;\n}\n\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n\tpath = '',\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = useMemo( () => getExamples( colors ), [ colors ] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetTopLevelStyleBookCategories().filter( ( category ) =>\n\t\t\t\texamples.some(\n\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t)\n\t\t\t),\n\t\t[ examples ]\n\t);\n\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: originalSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, originalSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={ showCloseButton ? __( 'Close' ) : null }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t<div className=\"edit-site-style-book__tablist-container\">\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\tconst categoryDefinition = tab.slug\n\t\t\t\t\t\t\t\t? getTopLevelStyleBookCategories().find(\n\t\t\t\t\t\t\t\t\t\t( _category ) =>\n\t\t\t\t\t\t\t\t\t\t\t_category.slug === tab.slug\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\t\tconst filteredExamples = categoryDefinition\n\t\t\t\t\t\t\t\t? getExamplesByCategory(\n\t\t\t\t\t\t\t\t\t\tcategoryDefinition,\n\t\t\t\t\t\t\t\t\t\texamples\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: { examples };\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-style-book__tabpanel\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\t\t\t\t\tcategory={ tab.slug }\n\t\t\t\t\t\t\t\t\t\texamples={ filteredExamples }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\t\t\t\t\ttitle={ tab.title }\n\t\t\t\t\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</Tabs>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ { examples: examplesForSinglePageUse } }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\n/**\n * Style Book Preview component renders the stylebook without the Editor dependency.\n *\n * @param {Object} props Component props.\n * @param {Object} props.userConfig User configuration.\n * @param {boolean} props.isStatic Whether the stylebook is static or clickable.\n * @return {Object} Style Book Preview component.\n */\nexport const StyleBookPreview = ( { userConfig = {}, isStatic = false } ) => {\n\tconst siteEditorSettings = useSelect(\n\t\t( select ) => select( siteEditorStore ).getSettings(),\n\t\t[]\n\t);\n\n\tconst canUserUploadMedia = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'media',\n\t\t\t} ),\n\t\t[]\n\t);\n\n\t// Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.\n\tuseEffect( () => {\n\t\tdispatch( blockEditorStore ).updateSettings( {\n\t\t\t...siteEditorSettings,\n\t\t\tmediaUpload: canUserUploadMedia ? uploadMedia : undefined,\n\t\t} );\n\t}, [ siteEditorSettings, canUserUploadMedia ] );\n\n\tconst [ section, onChangeSection ] = useSection();\n\n\tconst isSelected = ( blockName ) => {\n\t\t// Match '/blocks/core%2Fbutton' and\n\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t// '/blocks/core%2Fbuttons'.\n\t\treturn (\n\t\t\tsection === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\tsection.startsWith(\n\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onSelect = ( blockName ) => {\n\t\tif (\n\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t( group ) => group.slug === blockName\n\t\t\t)\n\t\t) {\n\t\t\t// Go to color palettes Global Styles.\n\t\t\tonChangeSection( '/colors/palette' );\n\t\t\treturn;\n\t\t}\n\t\tif ( blockName === 'typography' ) {\n\t\t\t// Go to typography Global Styles.\n\t\t\tonChangeSection( '/typography' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Now go to the selected block.\n\t\tonChangeSection( `/blocks/${ encodeURIComponent( blockName ) }` );\n\t};\n\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = getExamples( colors );\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tlet previewCategory = null;\n\tif ( section.includes( '/colors' ) ) {\n\t\tpreviewCategory = 'colors';\n\t} else if ( section.includes( '/typography' ) ) {\n\t\tpreviewCategory = 'text';\n\t} else if ( section.includes( '/blocks' ) ) {\n\t\tpreviewCategory = 'blocks';\n\t\tconst blockName =\n\t\t\tdecodeURIComponent( section ).split( '/blocks/' )[ 1 ];\n\t\tif (\n\t\t\tblockName &&\n\t\t\texamples.find( ( example ) => example.name === blockName )\n\t\t) {\n\t\t\tpreviewCategory = blockName;\n\t\t}\n\t} else if ( ! isStatic ) {\n\t\tpreviewCategory = 'overview';\n\t}\n\tconst categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(\n\t\t( category ) => category.slug === previewCategory\n\t);\n\n\t// If there's no category definition there may be a single block.\n\tconst filteredExamples = categoryDefinition\n\t\t? getExamplesByCategory( categoryDefinition, examples )\n\t\t: {\n\t\t\t\texamples: [\n\t\t\t\t\texamples.find(\n\t\t\t\t\t\t( example ) => example.name === previewCategory\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t };\n\n\t// If there's no preview category, show all examples.\n\tconst displayedExamples = previewCategory\n\t\t? filteredExamples\n\t\t: { examples: examplesForSinglePageUse };\n\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( section );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...siteEditorSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: siteEditorSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, siteEditorSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<div className=\"edit-site-style-book\">\n\t\t\t{ resizeObserver }\n\t\t\t<BlockEditorProvider settings={ settings }>\n\t\t\t\t<GlobalStylesRenderer disableRootPadding />\n\t\t\t\t<StyleBookBody\n\t\t\t\t\texamples={ displayedExamples }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\tisSelected={ ! isStatic ? isSelected : null }\n\t\t\t\t\tonSelect={ ! isStatic ? onSelect : null }\n\t\t\t\t/>\n\t\t\t</BlockEditorProvider>\n\t\t</div>\n\t);\n};\n\nexport const StyleBookBody = ( {\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\n\ttitle,\n\tgoTo,\n} ) => {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst [ hasIframeLoaded, setHasIframeLoaded ] = useState( false );\n\tconst iframeRef = useRef( null );\n\t// The presence of an `onClick` prop indicates that the Style Book is being used as a button.\n\t// In this case, add additional props to the iframe to make it behave like a button.\n\tconst buttonModeProps = {\n\t\trole: 'button',\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( onClick && ( keyCode === ENTER || keyCode === SPACE ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\tonClick: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( onClick ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\tconst handleLoad = () => setHasIframeLoaded( true );\n\tuseLayoutEffect( () => {\n\t\tif ( hasIframeLoaded && iframeRef?.current ) {\n\t\t\tif ( goTo?.top ) {\n\t\t\t\tscrollToSection( 'top', iframeRef?.current );\n\t\t\t}\n\t\t}\n\t}, [ iframeRef?.current, goTo, scrollToSection, hasIframeLoaded ] );\n\n\treturn (\n\t\t<Iframe\n\t\t\tonLoad={ handleLoad }\n\t\t\tref={ iframeRef }\n\t\t\tclassName={ clsx( 'edit-site-style-book__iframe', {\n\t\t\t\t'is-focused': isFocused && !! onClick,\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tname=\"style-book-canvas\"\n\t\t\ttabIndex={ 0 }\n\t\t\t{ ...( onClick ? buttonModeProps : {} ) }\n\t\t>\n\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t<style>\n\t\t\t\t{ STYLE_BOOK_IFRAME_STYLES }\n\t\t\t\t{ !! onClick &&\n\t\t\t\t\t'body { cursor: pointer; } body * { pointer-events: none; }' }\n\t\t\t</style>\n\t\t\t<Examples\n\t\t\t\tclassName={ clsx( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\tfilteredExamples={ examples }\n\t\t\t\tlabel={\n\t\t\t\t\ttitle\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t__( 'Examples of blocks in the %s category' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Examples of blocks' )\n\t\t\t\t}\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tkey={ title }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, filteredExamples, label, isSelected, onSelect } ) => {\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t\trole=\"grid\"\n\t\t\t>\n\t\t\t\t{ !! filteredExamples?.examples?.length &&\n\t\t\t\t\tfilteredExamples.examples.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tcontent={ example.content }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t!! onSelect\n\t\t\t\t\t\t\t\t\t? () => onSelect( example.name )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ !! filteredExamples?.subcategories?.length &&\n\t\t\t\t\tfilteredExamples.subcategories.map( ( subcategory ) => (\n\t\t\t\t\t\t<Composite.Group\n\t\t\t\t\t\t\tclassName=\"edit-site-style-book__subcategory\"\n\t\t\t\t\t\t\tkey={ `subcategory-${ subcategory.slug }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Composite.GroupLabel>\n\t\t\t\t\t\t\t\t<h2 className=\"edit-site-style-book__subcategory-title\">\n\t\t\t\t\t\t\t\t\t{ subcategory.title }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t</Composite.GroupLabel>\n\t\t\t\t\t\t\t<Subcategory\n\t\t\t\t\t\t\t\texamples={ subcategory.examples }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Composite.Group>\n\t\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t);\n\t}\n);\n\nconst Subcategory = ( { examples, isSelected, onSelect } ) => {\n\treturn (\n\t\t!! examples?.length &&\n\t\texamples.map( ( example ) => (\n\t\t\t<Example\n\t\t\t\tkey={ example.name }\n\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\ttitle={ example.title }\n\t\t\t\tcontent={ example.content }\n\t\t\t\tblocks={ example.blocks }\n\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\tonClick={ !! onSelect ? () => onSelect( example.name ) : null }\n\t\t\t/>\n\t\t) )\n\t);\n};\n\nconst disabledExamples = [ 'example-duotones' ];\n\nconst Example = ( { id, title, blocks, isSelected, onClick, content } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst disabledProps =\n\t\tdisabledExamples.includes( id ) || ! onClick\n\t\t\t? {\n\t\t\t\t\tdisabled: true,\n\t\t\t\t\taccessibleWhenDisabled: !! onClick,\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<Composite.Item\n\t\t\t\t\tclassName={ clsx( 'edit-site-style-book__example', {\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t'is-disabled-example': !! disabledProps?.disabled,\n\t\t\t\t\t} ) }\n\t\t\t\t\tid={ id }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\t!! onClick\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole={ !! onClick ? 'button' : null }\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t{ ...disabledProps }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-style-book__example-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-style-book__example-preview\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<Disabled className=\"edit-site-style-book__example-preview__content\">\n\t\t\t\t\t\t\t{ content ? (\n\t\t\t\t\t\t\t\tcontent\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EditorStyles />\n\t\t\t\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Disabled>\n\t\t\t\t\t</div>\n\t\t\t\t</Composite.Item>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default StyleBook;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,SAAS,EACTC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,SAAS,EACTL,WAAW,IAAIM,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,mBAAmB,EACnBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,EAC1BC,iDAAiD,IAAIC,mCAAmC,QAClF,yBAAyB;AAChC,SAAShB,WAAW,IAAIiB,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,iBAAiB;AACrD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SACCC,OAAO,EACPC,QAAQ,EACRC,IAAI,EACJC,UAAU,EACVC,MAAM,EACNC,eAAe,EACfC,SAAS,QACH,oBAAoB;AAC3B,SAASC,KAAK,EAAEC,KAAK,QAAQ,qBAAqB;AAClD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASvB,KAAK,IAAIwB,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,wBAAwB,QAAQ,aAAa;AACt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