@wordpress/edit-site 3.0.11 → 3.0.12

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 (151) hide show
  1. package/build/components/add-new-template/new-template-part.js +34 -17
  2. package/build/components/add-new-template/new-template-part.js.map +1 -1
  3. package/build/components/add-new-template/new-template.js +41 -22
  4. package/build/components/add-new-template/new-template.js.map +1 -1
  5. package/build/components/block-editor/index.js +3 -1
  6. package/build/components/block-editor/index.js.map +1 -1
  7. package/build/components/global-styles/color-palette-panel.js +4 -4
  8. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  9. package/build/components/global-styles/gradients-palette-panel.js +56 -0
  10. package/build/components/global-styles/gradients-palette-panel.js.map +1 -0
  11. package/build/components/global-styles/hooks.js +5 -5
  12. package/build/components/global-styles/hooks.js.map +1 -1
  13. package/build/components/global-styles/palette.js +11 -5
  14. package/build/components/global-styles/palette.js.map +1 -1
  15. package/build/components/global-styles/screen-background-color.js +2 -1
  16. package/build/components/global-styles/screen-background-color.js.map +1 -1
  17. package/build/components/global-styles/screen-color-palette.js +23 -3
  18. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  19. package/build/components/global-styles/screen-link-color.js +2 -1
  20. package/build/components/global-styles/screen-link-color.js.map +1 -1
  21. package/build/components/global-styles/screen-text-color.js +2 -1
  22. package/build/components/global-styles/screen-text-color.js.map +1 -1
  23. package/build/components/global-styles/screen-typography-element.js +54 -0
  24. package/build/components/global-styles/screen-typography-element.js.map +1 -0
  25. package/build/components/global-styles/screen-typography.js +74 -6
  26. package/build/components/global-styles/screen-typography.js.map +1 -1
  27. package/build/components/global-styles/typography-panel.js +28 -8
  28. package/build/components/global-styles/typography-panel.js.map +1 -1
  29. package/build/components/global-styles/ui.js +12 -0
  30. package/build/components/global-styles/ui.js.map +1 -1
  31. package/build/components/global-styles/use-global-styles-output.js +2 -2
  32. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  33. package/build/components/global-styles/utils.js +1 -1
  34. package/build/components/global-styles/utils.js.map +1 -1
  35. package/build/components/list/actions/index.js +104 -0
  36. package/build/components/list/actions/index.js.map +1 -0
  37. package/build/components/list/actions/rename-menu-item.js +112 -0
  38. package/build/components/list/actions/rename-menu-item.js.map +1 -0
  39. package/build/components/list/added-by.js +180 -0
  40. package/build/components/list/added-by.js.map +1 -0
  41. package/build/components/list/index.js +18 -3
  42. package/build/components/list/index.js.map +1 -1
  43. package/build/components/list/table.js +54 -67
  44. package/build/components/list/table.js.map +1 -1
  45. package/build/components/navigation-sidebar/index.js +12 -11
  46. package/build/components/navigation-sidebar/index.js.map +1 -1
  47. package/build/components/navigation-sidebar/navigation-panel/index.js +28 -11
  48. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  49. package/build/components/navigation-sidebar/navigation-toggle/index.js +14 -5
  50. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  51. package/build/index.js +8 -2
  52. package/build/index.js.map +1 -1
  53. package/build/store/actions.js +47 -18
  54. package/build/store/actions.js.map +1 -1
  55. package/build/store/selectors.js +25 -5
  56. package/build/store/selectors.js.map +1 -1
  57. package/build-module/components/add-new-template/new-template-part.js +30 -16
  58. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  59. package/build-module/components/add-new-template/new-template.js +40 -23
  60. package/build-module/components/add-new-template/new-template.js.map +1 -1
  61. package/build-module/components/block-editor/index.js +2 -1
  62. package/build-module/components/block-editor/index.js.map +1 -1
  63. package/build-module/components/global-styles/color-palette-panel.js +5 -5
  64. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  65. package/build-module/components/global-styles/gradients-palette-panel.js +46 -0
  66. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -0
  67. package/build-module/components/global-styles/hooks.js +5 -5
  68. package/build-module/components/global-styles/hooks.js.map +1 -1
  69. package/build-module/components/global-styles/palette.js +12 -5
  70. package/build-module/components/global-styles/palette.js.map +1 -1
  71. package/build-module/components/global-styles/screen-background-color.js +2 -1
  72. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  73. package/build-module/components/global-styles/screen-color-palette.js +22 -3
  74. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  75. package/build-module/components/global-styles/screen-link-color.js +2 -1
  76. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  77. package/build-module/components/global-styles/screen-text-color.js +2 -1
  78. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  79. package/build-module/components/global-styles/screen-typography-element.js +41 -0
  80. package/build-module/components/global-styles/screen-typography-element.js.map +1 -0
  81. package/build-module/components/global-styles/screen-typography.js +70 -6
  82. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  83. package/build-module/components/global-styles/typography-panel.js +28 -8
  84. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  85. package/build-module/components/global-styles/ui.js +11 -0
  86. package/build-module/components/global-styles/ui.js.map +1 -1
  87. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  88. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  89. package/build-module/components/global-styles/utils.js +1 -1
  90. package/build-module/components/global-styles/utils.js.map +1 -1
  91. package/build-module/components/list/actions/index.js +85 -0
  92. package/build-module/components/list/actions/index.js.map +1 -0
  93. package/build-module/components/list/actions/rename-menu-item.js +101 -0
  94. package/build-module/components/list/actions/rename-menu-item.js.map +1 -0
  95. package/build-module/components/list/added-by.js +166 -0
  96. package/build-module/components/list/added-by.js.map +1 -0
  97. package/build-module/components/list/index.js +15 -3
  98. package/build-module/components/list/index.js.map +1 -1
  99. package/build-module/components/list/table.js +56 -69
  100. package/build-module/components/list/table.js.map +1 -1
  101. package/build-module/components/navigation-sidebar/index.js +11 -12
  102. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  103. package/build-module/components/navigation-sidebar/navigation-panel/index.js +26 -12
  104. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  105. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +14 -6
  106. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  107. package/build-module/index.js +8 -3
  108. package/build-module/index.js.map +1 -1
  109. package/build-module/store/actions.js +48 -19
  110. package/build-module/store/actions.js.map +1 -1
  111. package/build-module/store/selectors.js +21 -3
  112. package/build-module/store/selectors.js.map +1 -1
  113. package/build-style/style-rtl.css +136 -17
  114. package/build-style/style.css +136 -17
  115. package/package.json +10 -8
  116. package/src/components/add-new-template/new-template-part.js +32 -17
  117. package/src/components/add-new-template/new-template.js +39 -19
  118. package/src/components/block-editor/index.js +2 -0
  119. package/src/components/global-styles/color-palette-panel.js +5 -5
  120. package/src/components/global-styles/gradients-palette-panel.js +79 -0
  121. package/src/components/global-styles/hooks.js +4 -4
  122. package/src/components/global-styles/palette.js +30 -10
  123. package/src/components/global-styles/screen-background-color.js +1 -0
  124. package/src/components/global-styles/screen-color-palette.js +30 -3
  125. package/src/components/global-styles/screen-link-color.js +1 -0
  126. package/src/components/global-styles/screen-text-color.js +1 -0
  127. package/src/components/global-styles/screen-typography-element.js +39 -0
  128. package/src/components/global-styles/screen-typography.js +84 -3
  129. package/src/components/global-styles/style.scss +33 -0
  130. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  131. package/src/components/global-styles/test/utils.js +1 -1
  132. package/src/components/global-styles/typography-panel.js +37 -7
  133. package/src/components/global-styles/ui.js +9 -0
  134. package/src/components/global-styles/use-global-styles-output.js +2 -2
  135. package/src/components/global-styles/utils.js +1 -1
  136. package/src/components/list/actions/index.js +95 -0
  137. package/src/components/list/actions/rename-menu-item.js +134 -0
  138. package/src/components/list/added-by.js +179 -0
  139. package/src/components/list/index.js +27 -11
  140. package/src/components/list/style.scss +106 -11
  141. package/src/components/list/table.js +64 -75
  142. package/src/components/navigation-sidebar/index.js +9 -16
  143. package/src/components/navigation-sidebar/navigation-panel/index.js +25 -9
  144. package/src/components/navigation-sidebar/navigation-toggle/index.js +29 -17
  145. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +2 -0
  146. package/src/components/sidebar/style.scss +2 -1
  147. package/src/index.js +10 -2
  148. package/src/store/actions.js +82 -34
  149. package/src/store/selectors.js +22 -4
  150. package/src/store/test/actions.js +0 -24
  151. package/src/store/test/selectors.js +24 -0
@@ -11,6 +11,7 @@ import { store as coreDataStore } from '@wordpress/core-data';
11
11
  import { createRegistrySelector } from '@wordpress/data';
12
12
  import { uploadMedia } from '@wordpress/media-utils';
13
13
  import { isTemplatePart } from '@wordpress/blocks';
14
+ import { Platform } from '@wordpress/element';
14
15
  /**
15
16
  * Internal dependencies
16
17
  */
@@ -53,6 +54,20 @@ export function __experimentalGetPreviewDeviceType(state) {
53
54
  */
54
55
 
55
56
  export const getCanUserCreateMedia = createRegistrySelector(select => () => select(coreDataStore).canUser('create', 'media'));
57
+ /**
58
+ * Returns any available Reusable blocks.
59
+ *
60
+ * @param {Object} state Global application state.
61
+ *
62
+ * @return {Array} The available reusable blocks.
63
+ */
64
+
65
+ export const getReusableBlocks = createRegistrySelector(select => () => {
66
+ const isWeb = Platform.OS === 'web';
67
+ return isWeb ? select(coreDataStore).getEntityRecords('postType', 'wp_block', {
68
+ per_page: -1
69
+ }) : [];
70
+ });
56
71
  /**
57
72
  * Returns the settings, taking into account active features and permissions.
58
73
  *
@@ -67,7 +82,8 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
67
82
  outlineMode: true,
68
83
  focusMode: isFeatureActive(state, 'focusMode'),
69
84
  hasFixedToolbar: isFeatureActive(state, 'fixedToolbar'),
70
- __experimentalSetIsInserterOpened: setIsInserterOpen
85
+ __experimentalSetIsInserterOpened: setIsInserterOpen,
86
+ __experimentalReusableBlocks: getReusableBlocks(state)
71
87
  };
72
88
  const canUserCreateMedia = getCanUserCreateMedia(state);
73
89
 
@@ -93,7 +109,7 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
93
109
  };
94
110
 
95
111
  return settings;
96
- }, state => [getCanUserCreateMedia(state), state.settings, isFeatureActive(state, 'focusMode'), isFeatureActive(state, 'fixedToolbar')]);
112
+ }, state => [getCanUserCreateMedia(state), state.settings, isFeatureActive(state, 'focusMode'), isFeatureActive(state, 'fixedToolbar'), getReusableBlocks(state)]);
97
113
  /**
98
114
  * Returns the current home template ID.
99
115
  *
@@ -279,7 +295,9 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(select =>
279
295
  const templateType = getEditedPostType(state);
280
296
  const templateId = getEditedPostId(state);
281
297
  const template = select(coreDataStore).getEditedEntityRecord('postType', templateType, templateId);
282
- const templateParts = select(coreDataStore).getEntityRecords('postType', 'wp_template_part');
298
+ const templateParts = select(coreDataStore).getEntityRecords('postType', 'wp_template_part', {
299
+ per_page: -1
300
+ });
283
301
  const templatePartsById = keyBy(templateParts, templatePart => templatePart.id);
284
302
  return ((_template$blocks = template.blocks) !== null && _template$blocks !== void 0 ? _template$blocks : []).filter(block => isTemplatePart(block)).map(block => {
285
303
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","isTemplatePart","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","length","getPreviousEditedPost","getEditedPostType","type","getEditedPostId","id","getPreviousEditedPostType","getPreviousEditedPostId","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","getEntityRecords","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,QAAhC;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAiCC,OAAjC,EAA2C;AACjD,SAAOjB,GAAG,CAAEgB,KAAK,CAACE,WAAN,CAAkBC,QAApB,EAA8B,CAAEF,OAAF,CAA9B,EAA2C,KAA3C,CAAV;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CJ,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACK,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGhB,sBAAsB,CAAIiB,MAAF,IAAc,MAC1EA,MAAM,CAAElB,aAAF,CAAN,CAAwBmB,OAAxB,CAAiC,QAAjC,EAA2C,OAA3C,CAD0D,CAApD;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGtB,cAAc,CACxC,CAAEa,KAAF,EAASU,iBAAT,KAAgC;AAC/B,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c,YAAY,GAAGD,iBAAiB,CAAEO,cAAF,CAAtC;AAEA,WAAO;AACNN,MAAAA,YADM;AAENG,MAAAA;AAFM,KAAP;AAIA,GAbK,EAcLD,MAdK,CAcG;AAAA,QAAE;AAAEF,MAAAA;AAAF,KAAF;AAAA,WAAwB,CAAC,CAAEA,YAA3B;AAAA,GAdH,CAAP;AAeA,CAlCmE,CAA9D","sourcesContent":["/**\n * External dependencies\n */\nimport { get, map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, feature ) {\n\treturn get( state.preferences.features, [ feature ], false );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: isFeatureActive( state, 'focusMode' ),\n\t\t\thasFixedToolbar: isFeatureActive( state, 'fixedToolbar' ),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\tisFeatureActive( state, 'focusMode' ),\n\t\tisFeatureActive( state, 'fixedToolbar' ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost[ state.editedPost.length - 1 ] || {};\n}\n\nfunction getPreviousEditedPost( state ) {\n\treturn state.editedPost[ state.editedPost.length - 2 ] || {};\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the previous edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getPreviousEditedPostType( state ) {\n\treturn getPreviousEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the previous edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getPreviousEditedPostId( state ) {\n\treturn getPreviousEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template_part'\n\t\t);\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","isTemplatePart","Platform","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","length","getPreviousEditedPost","getEditedPostType","type","getEditedPostId","id","getPreviousEditedPostType","getPreviousEditedPostId","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,QAAhC;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAiCC,OAAjC,EAA2C;AACjD,SAAOlB,GAAG,CAAEiB,KAAK,CAACE,WAAN,CAAkBC,QAApB,EAA8B,CAAEF,OAAF,CAA9B,EAA2C,KAA3C,CAAV;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CJ,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACK,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjB,sBAAsB,CAAIkB,MAAF,IAAc,MAC1EA,MAAM,CAAEnB,aAAF,CAAN,CAAwBoB,OAAxB,CAAiC,QAAjC,EAA2C,OAA3C,CAD0D,CAApD;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,iBAAiB,GAAGpB,sBAAsB,CAAIkB,MAAF,IAAc,MAAM;AAC5E,QAAMG,KAAK,GAAGlB,QAAQ,CAACmB,EAAT,KAAgB,KAA9B;AAC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AAEC,IAAAA,QAAQ,EAAE,CAAC;AAAb,GAF9B,CAAtB;AAGA,QAAM0D,iBAAiB,GAAGtF,KAAK,CAC9BqF,aAD8B,EAE5BE,YAAF,IAAoBA,YAAY,CAAClC,EAFH,CAA/B;AAKA,SAAO,qBAAEW,QAAQ,CAACwB,MAAX,+DAAqB,EAArB,EACLC,MADK,CACKC,KAAF,IAAapF,cAAc,CAAEoF,KAAF,CAD9B,EAEL3F,GAFK,CAEE2F,KAAF,IAAa;AAClB,UAAM;AACLC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,KAAF;AAASnB,QAAAA;AAAT;AADP,QAEFiB,KAFJ;AAGA,UAAMG,cAAc,GAAI,GAAGD,KAAO,KAAKnB,IAAM,EAA7C;AACA,UAAMc,YAAY,GAAGD,iBAAiB,CAAEO,cAAF,CAAtC;AAEA,WAAO;AACNN,MAAAA,YADM;AAENG,MAAAA;AAFM,KAAP;AAIA,GAbK,EAcLD,MAdK,CAcG;AAAA,QAAE;AAAEF,MAAAA;AAAF,KAAF;AAAA,WAAwB,CAAC,CAAEA,YAA3B;AAAA,GAdH,CAAP;AAeA,CAjCmE,CAA9D","sourcesContent":["/**\n * External dependencies\n */\nimport { get, map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, feature ) {\n\treturn get( state.preferences.features, [ feature ], false );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: isFeatureActive( state, 'focusMode' ),\n\t\t\thasFixedToolbar: isFeatureActive( state, 'fixedToolbar' ),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\tisFeatureActive( state, 'focusMode' ),\n\t\tisFeatureActive( state, 'fixedToolbar' ),\n\t\tgetReusableBlocks( state ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost[ state.editedPost.length - 1 ] || {};\n}\n\nfunction getPreviousEditedPost( state ) {\n\treturn state.editedPost[ state.editedPost.length - 2 ] || {};\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the previous edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getPreviousEditedPostType( state ) {\n\treturn getPreviousEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the previous edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getPreviousEditedPostId( state ) {\n\treturn getPreviousEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select(\n\t\t\tcoreDataStore\n\t\t).getEntityRecords( 'postType', 'wp_template_part', { per_page: -1 } );\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n"]}
@@ -535,6 +535,30 @@ body.is-fullscreen-mode .interface-interface-skeleton {
535
535
  padding: 0;
536
536
  }
537
537
 
538
+ .edit-site-typography-panel__preview {
539
+ display: flex;
540
+ align-items: center;
541
+ justify-content: center;
542
+ min-height: 100px;
543
+ margin-bottom: 16px;
544
+ background: #f0f0f0;
545
+ border-radius: 2px;
546
+ }
547
+
548
+ .edit-site-global-styles-screen-typography {
549
+ margin: 16px;
550
+ }
551
+
552
+ .edit-site-global-styles-screen-typography__indicator {
553
+ height: 24px;
554
+ width: 24px;
555
+ font-size: 14px;
556
+ display: flex !important;
557
+ align-items: center;
558
+ justify-content: center;
559
+ border-radius: 2px;
560
+ }
561
+
538
562
  .edit-site-global-styles-screen-colors {
539
563
  margin: 16px;
540
564
  }
@@ -561,6 +585,15 @@ body.is-fullscreen-mode .interface-interface-skeleton {
561
585
  font-weight: 500;
562
586
  }
563
587
 
588
+ .edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
589
+ margin-left: 16px;
590
+ margin-right: 16px;
591
+ width: unset;
592
+ }
593
+ .edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle .components-toggle-group-control {
594
+ min-height: 32px;
595
+ }
596
+
564
597
  .edit-site-header {
565
598
  align-items: center;
566
599
  background-color: #fff;
@@ -1099,12 +1132,14 @@ body.is-fullscreen-mode .edit-site-list-header {
1099
1132
 
1100
1133
  .edit-site-list-table {
1101
1134
  width: 100%;
1102
- border: 1px solid #e0e0e0;
1135
+ border: 1px solid #ddd;
1103
1136
  border-radius: 2px;
1104
1137
  margin: 0;
1105
1138
  overflow: hidden;
1139
+ border-spacing: 0;
1140
+ max-width: 960px;
1106
1141
  }
1107
- .edit-site-list-table li {
1142
+ .edit-site-list-table tr {
1108
1143
  display: flex;
1109
1144
  align-items: center;
1110
1145
  padding: 16px;
@@ -1112,36 +1147,119 @@ body.is-fullscreen-mode .edit-site-list-header {
1112
1147
  border-top: 1px solid #f0f0f0;
1113
1148
  margin: 0;
1114
1149
  }
1150
+ .edit-site-list-table tr:first-child {
1151
+ border-top: 0;
1152
+ }
1115
1153
  @media (min-width: 782px) {
1116
- .edit-site-list-table li {
1154
+ .edit-site-list-table tr {
1117
1155
  padding: 24px 32px;
1118
1156
  }
1119
1157
  }
1120
- .edit-site-list-table li .edit-site-list-table-column:nth-child(1) {
1121
- width: calc(60% - 36px);
1158
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(1) {
1159
+ width: calc(60% - 18px);
1160
+ padding-left: 24px;
1122
1161
  }
1123
- .edit-site-list-table li .edit-site-list-table-column:nth-child(1) a {
1124
- display: block;
1162
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(1) a {
1163
+ display: inline-block;
1125
1164
  text-decoration: none;
1126
1165
  font-weight: 500;
1127
1166
  margin-bottom: 4px;
1128
1167
  }
1129
- .edit-site-list-table li .edit-site-list-table-column:nth-child(2) {
1130
- width: calc(40% - 36px);
1168
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
1169
+ width: calc(40% - 18px);
1131
1170
  }
1132
- .edit-site-list-table li .edit-site-list-table-column:nth-child(3) {
1171
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
1133
1172
  min-width: 36px;
1173
+ flex-shrink: 0;
1134
1174
  }
1135
- .edit-site-list-table li.edit-site-list-table-head {
1136
- border-bottom: 1px solid #e0e0e0;
1175
+ .edit-site-list-table tr.edit-site-list-table-head {
1137
1176
  font-size: 16px;
1138
- font-weight: 500;
1177
+ font-weight: 600;
1139
1178
  text-align: right;
1140
- color: #000;
1179
+ color: #1e1e1e;
1141
1180
  border-top: none;
1181
+ border-bottom: 1px solid #ddd;
1142
1182
  }
1143
- .edit-site-list-table li.edit-site-list-table-head + li {
1144
- border-top: 0;
1183
+ .edit-site-list-table tr.edit-site-list-table-head th {
1184
+ font-weight: inherit;
1185
+ }
1186
+
1187
+ @media (min-width: 782px) {
1188
+ .edit-site-list.is-navigation-open .components-snackbar-list {
1189
+ margin-right: 300px;
1190
+ }
1191
+ }
1192
+
1193
+ @media (min-width: 782px) {
1194
+ .edit-site-list__rename-modal .components-base-control {
1195
+ width: 320px;
1196
+ }
1197
+ }
1198
+ .edit-site-list__rename-modal .components-modal__header {
1199
+ border-bottom: none;
1200
+ }
1201
+ .edit-site-list__rename-modal .components-modal__content::before {
1202
+ margin-bottom: 4px;
1203
+ }
1204
+
1205
+ .edit-site-list__rename-modal-actions {
1206
+ margin-top: 12px;
1207
+ }
1208
+
1209
+ .edit-site-template__actions button:not(:last-child) {
1210
+ margin-left: 8px;
1211
+ }
1212
+
1213
+ .edit-site-list-added-by__icon {
1214
+ display: flex;
1215
+ flex-shrink: 0;
1216
+ position: relative;
1217
+ align-items: center;
1218
+ justify-content: center;
1219
+ width: 32px;
1220
+ height: 32px;
1221
+ background: #2f2f2f;
1222
+ border-radius: 100%;
1223
+ }
1224
+ .edit-site-list-added-by__icon svg {
1225
+ fill: #fff;
1226
+ }
1227
+ .edit-site-list-added-by__icon.is-customized::after {
1228
+ position: absolute;
1229
+ content: "";
1230
+ background: var(--wp-admin-theme-color);
1231
+ height: 8px;
1232
+ width: 8px;
1233
+ outline: 2px solid #fff;
1234
+ border-radius: 100%;
1235
+ top: -1px;
1236
+ left: -1px;
1237
+ }
1238
+
1239
+ .edit-site-list-added-by__avatar {
1240
+ flex-shrink: 0;
1241
+ overflow: hidden;
1242
+ border-radius: 100%;
1243
+ background: #2f2f2f;
1244
+ width: 32px;
1245
+ height: 32px;
1246
+ }
1247
+ .edit-site-list-added-by__avatar img {
1248
+ width: 32px;
1249
+ height: 32px;
1250
+ -o-object-fit: cover;
1251
+ object-fit: cover;
1252
+ opacity: 0;
1253
+ transition: opacity 0.1s linear;
1254
+ }
1255
+ @media (prefers-reduced-motion: reduce) {
1256
+ .edit-site-list-added-by__avatar img {
1257
+ transition-duration: 0s;
1258
+ transition-delay: 0s;
1259
+ }
1260
+ }
1261
+ .edit-site-list-added-by__avatar.is-loaded img {
1262
+ opacity: 1;
1145
1263
  }
1146
1264
 
1147
1265
  .edit-site-new-template-dropdown .components-dropdown-menu__toggle {
@@ -1212,7 +1330,8 @@ body.is-fullscreen-mode .edit-site-list-header {
1212
1330
  padding: 0 16px;
1213
1331
  }
1214
1332
 
1215
- .edit-site-global-styles-color-palette-panel {
1333
+ .edit-site-global-styles-color-palette-panel,
1334
+ .edit-site-global-styles-gradient-palette-panel {
1216
1335
  padding: 16px;
1217
1336
  }
1218
1337
 
@@ -535,6 +535,30 @@ body.is-fullscreen-mode .interface-interface-skeleton {
535
535
  padding: 0;
536
536
  }
537
537
 
538
+ .edit-site-typography-panel__preview {
539
+ display: flex;
540
+ align-items: center;
541
+ justify-content: center;
542
+ min-height: 100px;
543
+ margin-bottom: 16px;
544
+ background: #f0f0f0;
545
+ border-radius: 2px;
546
+ }
547
+
548
+ .edit-site-global-styles-screen-typography {
549
+ margin: 16px;
550
+ }
551
+
552
+ .edit-site-global-styles-screen-typography__indicator {
553
+ height: 24px;
554
+ width: 24px;
555
+ font-size: 14px;
556
+ display: flex !important;
557
+ align-items: center;
558
+ justify-content: center;
559
+ border-radius: 2px;
560
+ }
561
+
538
562
  .edit-site-global-styles-screen-colors {
539
563
  margin: 16px;
540
564
  }
@@ -561,6 +585,15 @@ body.is-fullscreen-mode .interface-interface-skeleton {
561
585
  font-weight: 500;
562
586
  }
563
587
 
588
+ .edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
589
+ margin-right: 16px;
590
+ margin-left: 16px;
591
+ width: unset;
592
+ }
593
+ .edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle .components-toggle-group-control {
594
+ min-height: 32px;
595
+ }
596
+
564
597
  .edit-site-header {
565
598
  align-items: center;
566
599
  background-color: #fff;
@@ -1099,12 +1132,14 @@ body.is-fullscreen-mode .edit-site-list-header {
1099
1132
 
1100
1133
  .edit-site-list-table {
1101
1134
  width: 100%;
1102
- border: 1px solid #e0e0e0;
1135
+ border: 1px solid #ddd;
1103
1136
  border-radius: 2px;
1104
1137
  margin: 0;
1105
1138
  overflow: hidden;
1139
+ border-spacing: 0;
1140
+ max-width: 960px;
1106
1141
  }
1107
- .edit-site-list-table li {
1142
+ .edit-site-list-table tr {
1108
1143
  display: flex;
1109
1144
  align-items: center;
1110
1145
  padding: 16px;
@@ -1112,36 +1147,119 @@ body.is-fullscreen-mode .edit-site-list-header {
1112
1147
  border-top: 1px solid #f0f0f0;
1113
1148
  margin: 0;
1114
1149
  }
1150
+ .edit-site-list-table tr:first-child {
1151
+ border-top: 0;
1152
+ }
1115
1153
  @media (min-width: 782px) {
1116
- .edit-site-list-table li {
1154
+ .edit-site-list-table tr {
1117
1155
  padding: 24px 32px;
1118
1156
  }
1119
1157
  }
1120
- .edit-site-list-table li .edit-site-list-table-column:nth-child(1) {
1121
- width: calc(60% - 36px);
1158
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(1) {
1159
+ width: calc(60% - 18px);
1160
+ padding-right: 24px;
1122
1161
  }
1123
- .edit-site-list-table li .edit-site-list-table-column:nth-child(1) a {
1124
- display: block;
1162
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(1) a {
1163
+ display: inline-block;
1125
1164
  text-decoration: none;
1126
1165
  font-weight: 500;
1127
1166
  margin-bottom: 4px;
1128
1167
  }
1129
- .edit-site-list-table li .edit-site-list-table-column:nth-child(2) {
1130
- width: calc(40% - 36px);
1168
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
1169
+ width: calc(40% - 18px);
1131
1170
  }
1132
- .edit-site-list-table li .edit-site-list-table-column:nth-child(3) {
1171
+ .edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
1133
1172
  min-width: 36px;
1173
+ flex-shrink: 0;
1134
1174
  }
1135
- .edit-site-list-table li.edit-site-list-table-head {
1136
- border-bottom: 1px solid #e0e0e0;
1175
+ .edit-site-list-table tr.edit-site-list-table-head {
1137
1176
  font-size: 16px;
1138
- font-weight: 500;
1177
+ font-weight: 600;
1139
1178
  text-align: left;
1140
- color: #000;
1179
+ color: #1e1e1e;
1141
1180
  border-top: none;
1181
+ border-bottom: 1px solid #ddd;
1142
1182
  }
1143
- .edit-site-list-table li.edit-site-list-table-head + li {
1144
- border-top: 0;
1183
+ .edit-site-list-table tr.edit-site-list-table-head th {
1184
+ font-weight: inherit;
1185
+ }
1186
+
1187
+ @media (min-width: 782px) {
1188
+ .edit-site-list.is-navigation-open .components-snackbar-list {
1189
+ margin-left: 300px;
1190
+ }
1191
+ }
1192
+
1193
+ @media (min-width: 782px) {
1194
+ .edit-site-list__rename-modal .components-base-control {
1195
+ width: 320px;
1196
+ }
1197
+ }
1198
+ .edit-site-list__rename-modal .components-modal__header {
1199
+ border-bottom: none;
1200
+ }
1201
+ .edit-site-list__rename-modal .components-modal__content::before {
1202
+ margin-bottom: 4px;
1203
+ }
1204
+
1205
+ .edit-site-list__rename-modal-actions {
1206
+ margin-top: 12px;
1207
+ }
1208
+
1209
+ .edit-site-template__actions button:not(:last-child) {
1210
+ margin-right: 8px;
1211
+ }
1212
+
1213
+ .edit-site-list-added-by__icon {
1214
+ display: flex;
1215
+ flex-shrink: 0;
1216
+ position: relative;
1217
+ align-items: center;
1218
+ justify-content: center;
1219
+ width: 32px;
1220
+ height: 32px;
1221
+ background: #2f2f2f;
1222
+ border-radius: 100%;
1223
+ }
1224
+ .edit-site-list-added-by__icon svg {
1225
+ fill: #fff;
1226
+ }
1227
+ .edit-site-list-added-by__icon.is-customized::after {
1228
+ position: absolute;
1229
+ content: "";
1230
+ background: var(--wp-admin-theme-color);
1231
+ height: 8px;
1232
+ width: 8px;
1233
+ outline: 2px solid #fff;
1234
+ border-radius: 100%;
1235
+ top: -1px;
1236
+ right: -1px;
1237
+ }
1238
+
1239
+ .edit-site-list-added-by__avatar {
1240
+ flex-shrink: 0;
1241
+ overflow: hidden;
1242
+ border-radius: 100%;
1243
+ background: #2f2f2f;
1244
+ width: 32px;
1245
+ height: 32px;
1246
+ }
1247
+ .edit-site-list-added-by__avatar img {
1248
+ width: 32px;
1249
+ height: 32px;
1250
+ -o-object-fit: cover;
1251
+ object-fit: cover;
1252
+ opacity: 0;
1253
+ transition: opacity 0.1s linear;
1254
+ }
1255
+ @media (prefers-reduced-motion: reduce) {
1256
+ .edit-site-list-added-by__avatar img {
1257
+ transition-duration: 0s;
1258
+ transition-delay: 0s;
1259
+ }
1260
+ }
1261
+ .edit-site-list-added-by__avatar.is-loaded img {
1262
+ opacity: 1;
1145
1263
  }
1146
1264
 
1147
1265
  .edit-site-new-template-dropdown .components-dropdown-menu__toggle {
@@ -1212,7 +1330,8 @@ body.is-fullscreen-mode .edit-site-list-header {
1212
1330
  padding: 0 16px;
1213
1331
  }
1214
1332
 
1215
- .edit-site-global-styles-color-palette-panel {
1333
+ .edit-site-global-styles-color-palette-panel,
1334
+ .edit-site-global-styles-gradient-palette-panel {
1216
1335
  padding: 16px;
1217
1336
  }
1218
1337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,28 +29,30 @@
29
29
  "@babel/runtime": "^7.16.0",
30
30
  "@wordpress/a11y": "^3.2.4",
31
31
  "@wordpress/api-fetch": "^5.2.6",
32
- "@wordpress/block-editor": "^8.0.5",
33
- "@wordpress/block-library": "^6.0.9",
32
+ "@wordpress/block-editor": "^8.0.6",
33
+ "@wordpress/block-library": "^6.0.10",
34
34
  "@wordpress/blocks": "^11.1.4",
35
- "@wordpress/components": "^19.0.5",
35
+ "@wordpress/components": "^19.1.0",
36
36
  "@wordpress/compose": "^5.0.6",
37
- "@wordpress/core-data": "^4.0.7",
37
+ "@wordpress/core-data": "^4.0.8",
38
38
  "@wordpress/data": "^6.1.4",
39
39
  "@wordpress/data-controls": "^2.2.7",
40
- "@wordpress/editor": "^12.0.8",
40
+ "@wordpress/editor": "^12.0.9",
41
41
  "@wordpress/element": "^4.0.4",
42
42
  "@wordpress/hooks": "^3.2.2",
43
43
  "@wordpress/html-entities": "^3.2.3",
44
44
  "@wordpress/i18n": "^4.2.4",
45
45
  "@wordpress/icons": "^6.1.1",
46
- "@wordpress/interface": "^4.1.7",
46
+ "@wordpress/interface": "^4.1.8",
47
47
  "@wordpress/keyboard-shortcuts": "^3.0.6",
48
48
  "@wordpress/keycodes": "^3.2.4",
49
49
  "@wordpress/media-utils": "^3.0.5",
50
50
  "@wordpress/notices": "^3.2.7",
51
51
  "@wordpress/plugins": "^4.0.6",
52
52
  "@wordpress/primitives": "^3.0.4",
53
+ "@wordpress/reusable-blocks": "^3.0.12",
53
54
  "@wordpress/url": "^3.3.1",
55
+ "@wordpress/viewport": "^4.0.6",
54
56
  "classnames": "^2.3.1",
55
57
  "downloadjs": "^1.4.7",
56
58
  "file-saver": "^2.0.2",
@@ -61,5 +63,5 @@
61
63
  "publishConfig": {
62
64
  "access": "public"
63
65
  },
64
- "gitHead": "518e7a279a0f596612232c55c83a351460f8816d"
66
+ "gitHead": "6d3bd917064b4b194677233ee426f5988fa441b9"
65
67
  }
@@ -7,9 +7,12 @@ import { kebabCase } from 'lodash';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useState } from '@wordpress/element';
10
+ import { useDispatch } from '@wordpress/data';
10
11
  import { Button } from '@wordpress/components';
11
12
  import { addQueryArgs } from '@wordpress/url';
12
13
  import apiFetch from '@wordpress/api-fetch';
14
+ import { __ } from '@wordpress/i18n';
15
+ import { store as noticesStore } from '@wordpress/notices';
13
16
 
14
17
  /**
15
18
  * Internal dependencies
@@ -18,31 +21,43 @@ import CreateTemplatePartModal from '../create-template-part-modal';
18
21
 
19
22
  export default function NewTemplatePart( { postType } ) {
20
23
  const [ isModalOpen, setIsModalOpen ] = useState( false );
24
+ const { createErrorNotice } = useDispatch( noticesStore );
21
25
 
22
26
  async function createTemplatePart( { title, area } ) {
23
27
  if ( ! title ) {
28
+ createErrorNotice( __( 'Title is not defined.' ), {
29
+ type: 'snackbar',
30
+ } );
24
31
  return;
25
32
  }
26
33
 
27
- const templatePart = await apiFetch( {
28
- path: '/wp/v2/template-parts',
29
- method: 'POST',
30
- data: {
31
- slug: kebabCase( title ),
32
- title,
33
- content: '',
34
- area,
35
- },
36
- } );
34
+ try {
35
+ const templatePart = await apiFetch( {
36
+ path: '/wp/v2/template-parts',
37
+ method: 'POST',
38
+ data: {
39
+ slug: kebabCase( title ),
40
+ title,
41
+ content: '',
42
+ area,
43
+ },
44
+ } );
37
45
 
38
- // Navigate to the created template part editor.
39
- window.location.href = addQueryArgs( window.location.href, {
40
- postId: templatePart.id,
41
- postType: 'wp_template_part',
42
- } );
46
+ // Navigate to the created template part editor.
47
+ window.location.href = addQueryArgs( window.location.href, {
48
+ postId: templatePart.id,
49
+ postType: 'wp_template_part',
50
+ } );
51
+ } catch ( error ) {
52
+ const errorMessage =
53
+ error.message && error.code !== 'unknown_error'
54
+ ? error.message
55
+ : __(
56
+ 'An error occurred while creating the template part.'
57
+ );
43
58
 
44
- // Wait for async navigation to happen before closing the modal.
45
- await new Promise( () => {} );
59
+ createErrorNotice( errorMessage, { type: 'snackbar' } );
60
+ }
46
61
  }
47
62
 
48
63
  return (