@wordpress/editor 14.5.0 → 14.6.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 (216) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/post-meta.js +2 -2
  3. package/build/bindings/post-meta.js.map +1 -1
  4. package/build/components/create-template-part-modal/index.js +1 -0
  5. package/build/components/create-template-part-modal/index.js.map +1 -1
  6. package/build/components/global-styles-provider/index.js +17 -4
  7. package/build/components/global-styles-provider/index.js.map +1 -1
  8. package/build/components/inserter-sidebar/index.js +5 -2
  9. package/build/components/inserter-sidebar/index.js.map +1 -1
  10. package/build/components/page-attributes/parent.js +6 -5
  11. package/build/components/page-attributes/parent.js.map +1 -1
  12. package/build/components/post-actions/actions.js +4 -499
  13. package/build/components/post-actions/actions.js.map +1 -1
  14. package/build/components/post-actions/index.js +8 -17
  15. package/build/components/post-actions/index.js.map +1 -1
  16. package/build/components/post-card-panel/index.js +20 -20
  17. package/build/components/post-card-panel/index.js.map +1 -1
  18. package/build/components/post-featured-image/index.js +2 -0
  19. package/build/components/post-featured-image/index.js.map +1 -1
  20. package/build/components/post-publish-panel/postpublish.js +4 -0
  21. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  22. package/build/components/post-slug/index.js +1 -0
  23. package/build/components/post-slug/index.js.map +1 -1
  24. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -1
  25. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  26. package/build/components/post-url/index.js +6 -5
  27. package/build/components/post-url/index.js.map +1 -1
  28. package/build/components/sidebar/post-summary.js +10 -7
  29. package/build/components/sidebar/post-summary.js.map +1 -1
  30. package/build/components/template-content-panel/index.js +1 -1
  31. package/build/components/template-content-panel/index.js.map +1 -1
  32. package/build/dataviews/actions/duplicate-pattern.js +48 -0
  33. package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
  34. package/build/dataviews/actions/duplicate-post.js +146 -0
  35. package/build/dataviews/actions/duplicate-post.js.map +1 -0
  36. package/build/dataviews/actions/duplicate-post.native.js +9 -0
  37. package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
  38. package/build/dataviews/actions/duplicate-template-part.js +67 -0
  39. package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
  40. package/build/dataviews/actions/rename-post.js +125 -0
  41. package/build/dataviews/actions/rename-post.js.map +1 -0
  42. package/build/dataviews/actions/reorder-page.js +116 -0
  43. package/build/dataviews/actions/reorder-page.js.map +1 -0
  44. package/build/dataviews/actions/reorder-page.native.js +9 -0
  45. package/build/dataviews/actions/reorder-page.native.js.map +1 -0
  46. package/build/dataviews/actions/reset-post.js +1 -1
  47. package/build/dataviews/actions/reset-post.js.map +1 -1
  48. package/build/dataviews/actions/utils.js +9 -1
  49. package/build/dataviews/actions/utils.js.map +1 -1
  50. package/build/dataviews/actions/view-post-revisions.js +49 -0
  51. package/build/dataviews/actions/view-post-revisions.js.map +1 -0
  52. package/build/dataviews/actions/view-post.js +36 -0
  53. package/build/dataviews/actions/view-post.js.map +1 -0
  54. package/build/dataviews/fields/index.js +32 -0
  55. package/build/dataviews/fields/index.js.map +1 -0
  56. package/build/dataviews/store/private-actions.js +16 -2
  57. package/build/dataviews/store/private-actions.js.map +1 -1
  58. package/build/dataviews/types.js.map +1 -1
  59. package/build/private-apis.js +2 -0
  60. package/build/private-apis.js.map +1 -1
  61. package/build/store/private-actions.js +1 -1
  62. package/build/store/private-actions.js.map +1 -1
  63. package/build/store/utils/is-template-revertable.js +1 -1
  64. package/build/store/utils/is-template-revertable.js.map +1 -1
  65. package/build-module/bindings/post-meta.js +2 -2
  66. package/build-module/bindings/post-meta.js.map +1 -1
  67. package/build-module/components/create-template-part-modal/index.js +1 -0
  68. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  69. package/build-module/components/global-styles-provider/index.js +17 -4
  70. package/build-module/components/global-styles-provider/index.js.map +1 -1
  71. package/build-module/components/inserter-sidebar/index.js +5 -2
  72. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  73. package/build-module/components/page-attributes/parent.js +6 -5
  74. package/build-module/components/page-attributes/parent.js.map +1 -1
  75. package/build-module/components/post-actions/actions.js +5 -501
  76. package/build-module/components/post-actions/actions.js.map +1 -1
  77. package/build-module/components/post-actions/index.js +8 -17
  78. package/build-module/components/post-actions/index.js.map +1 -1
  79. package/build-module/components/post-card-panel/index.js +20 -20
  80. package/build-module/components/post-card-panel/index.js.map +1 -1
  81. package/build-module/components/post-featured-image/index.js +2 -0
  82. package/build-module/components/post-featured-image/index.js.map +1 -1
  83. package/build-module/components/post-publish-panel/postpublish.js +4 -0
  84. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  85. package/build-module/components/post-slug/index.js +1 -0
  86. package/build-module/components/post-slug/index.js.map +1 -1
  87. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  88. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  89. package/build-module/components/post-url/index.js +7 -6
  90. package/build-module/components/post-url/index.js.map +1 -1
  91. package/build-module/components/sidebar/post-summary.js +10 -7
  92. package/build-module/components/sidebar/post-summary.js.map +1 -1
  93. package/build-module/components/template-content-panel/index.js +1 -1
  94. package/build-module/components/template-content-panel/index.js.map +1 -1
  95. package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
  96. package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
  97. package/build-module/dataviews/actions/duplicate-post.js +139 -0
  98. package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
  99. package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
  100. package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
  101. package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
  102. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
  103. package/build-module/dataviews/actions/rename-post.js +118 -0
  104. package/build-module/dataviews/actions/rename-post.js.map +1 -0
  105. package/build-module/dataviews/actions/reorder-page.js +111 -0
  106. package/build-module/dataviews/actions/reorder-page.js.map +1 -0
  107. package/build-module/dataviews/actions/reorder-page.native.js +3 -0
  108. package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
  109. package/build-module/dataviews/actions/reset-post.js +1 -1
  110. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  111. package/build-module/dataviews/actions/utils.js +7 -1
  112. package/build-module/dataviews/actions/utils.js.map +1 -1
  113. package/build-module/dataviews/actions/view-post-revisions.js +43 -0
  114. package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
  115. package/build-module/dataviews/actions/view-post.js +30 -0
  116. package/build-module/dataviews/actions/view-post.js.map +1 -0
  117. package/build-module/dataviews/fields/index.js +26 -0
  118. package/build-module/dataviews/fields/index.js.map +1 -0
  119. package/build-module/dataviews/store/private-actions.js +16 -2
  120. package/build-module/dataviews/store/private-actions.js.map +1 -1
  121. package/build-module/dataviews/types.js.map +1 -1
  122. package/build-module/private-apis.js +2 -0
  123. package/build-module/private-apis.js.map +1 -1
  124. package/build-module/store/private-actions.js +1 -1
  125. package/build-module/store/private-actions.js.map +1 -1
  126. package/build-module/store/utils/is-template-revertable.js +1 -1
  127. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  128. package/build-style/style-rtl.css +2 -31
  129. package/build-style/style.css +2 -31
  130. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  131. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  132. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  133. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  134. package/build-types/components/post-actions/actions.d.ts +1 -26
  135. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  136. package/build-types/components/post-actions/index.d.ts +3 -2
  137. package/build-types/components/post-actions/index.d.ts.map +1 -1
  138. package/build-types/components/post-card-panel/index.d.ts +4 -2
  139. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  140. package/build-types/components/post-slug/index.d.ts.map +1 -1
  141. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -17
  142. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  143. package/build-types/components/post-url/index.d.ts.map +1 -1
  144. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  145. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  146. package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
  147. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
  148. package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
  149. package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
  150. package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
  151. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
  152. package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
  153. package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
  154. package/build-types/dataviews/actions/rename-post.d.ts +5 -0
  155. package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
  156. package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
  157. package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
  158. package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
  159. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
  160. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  161. package/build-types/dataviews/actions/utils.d.ts +5 -3
  162. package/build-types/dataviews/actions/utils.d.ts.map +1 -1
  163. package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
  164. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
  165. package/build-types/dataviews/actions/view-post.d.ts +8 -0
  166. package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
  167. package/build-types/dataviews/fields/index.d.ts +8 -0
  168. package/build-types/dataviews/fields/index.d.ts.map +1 -0
  169. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  170. package/build-types/dataviews/types.d.ts +57 -8
  171. package/build-types/dataviews/types.d.ts.map +1 -1
  172. package/build-types/private-apis.d.ts.map +1 -1
  173. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  174. package/package.json +36 -36
  175. package/src/bindings/post-meta.js +2 -2
  176. package/src/components/block-manager/style.scss +2 -2
  177. package/src/components/create-template-part-modal/index.js +1 -0
  178. package/src/components/error-boundary/style.native.scss +1 -1
  179. package/src/components/error-boundary/style.scss +1 -1
  180. package/src/components/global-styles-provider/index.js +16 -3
  181. package/src/components/inserter-sidebar/index.js +10 -4
  182. package/src/components/page-attributes/parent.js +13 -9
  183. package/src/components/post-actions/actions.js +5 -616
  184. package/src/components/post-actions/index.js +16 -20
  185. package/src/components/post-card-panel/index.js +28 -27
  186. package/src/components/post-discussion/style.scss +0 -9
  187. package/src/components/post-featured-image/index.js +2 -0
  188. package/src/components/post-format/style.scss +0 -6
  189. package/src/components/post-publish-panel/postpublish.js +8 -2
  190. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -8
  191. package/src/components/post-slug/index.js +1 -0
  192. package/src/components/post-status/style.scss +0 -19
  193. package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -1
  194. package/src/components/post-url/index.js +15 -9
  195. package/src/components/save-publish-panels/style.scss +3 -3
  196. package/src/components/sidebar/post-summary.js +20 -16
  197. package/src/components/site-discussion/style.scss +0 -14
  198. package/src/components/template-content-panel/index.js +4 -1
  199. package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
  200. package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
  201. package/src/dataviews/actions/duplicate-post.tsx +174 -0
  202. package/src/dataviews/actions/duplicate-template-part.tsx +70 -0
  203. package/src/dataviews/actions/rename-post.tsx +146 -0
  204. package/src/dataviews/actions/reorder-page.native.tsx +3 -0
  205. package/src/dataviews/actions/reorder-page.tsx +125 -0
  206. package/src/dataviews/actions/reset-post.tsx +2 -1
  207. package/src/dataviews/actions/utils.ts +14 -4
  208. package/src/dataviews/actions/view-post-revisions.tsx +47 -0
  209. package/src/dataviews/actions/view-post.tsx +30 -0
  210. package/src/dataviews/fields/index.ts +26 -0
  211. package/src/dataviews/store/private-actions.ts +42 -1
  212. package/src/dataviews/types.ts +47 -6
  213. package/src/private-apis.js +2 -0
  214. package/src/store/private-actions.js +1 -1
  215. package/src/store/utils/is-template-revertable.js +2 -1
  216. package/tsconfig.tsbuildinfo +1 -1
@@ -13,7 +13,6 @@ import { store as coreStore } from '@wordpress/core-data';
13
13
  */
14
14
  import { unlock } from '../../lock-unlock';
15
15
  import { usePostActions } from './actions';
16
- import { store as editorStore } from '../../store';
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
18
17
  import { Fragment as _Fragment } from "react/jsx-runtime";
19
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -25,31 +24,24 @@ const {
25
24
  kebabCase
26
25
  } = unlock(componentsPrivateApis);
27
26
  export default function PostActions({
28
- onActionPerformed,
29
- buttonProps
27
+ postType,
28
+ postId,
29
+ onActionPerformed
30
30
  }) {
31
31
  const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(false);
32
32
  const {
33
33
  item,
34
- permissions,
35
- postType
34
+ permissions
36
35
  } = useSelect(select => {
37
- const {
38
- getCurrentPostType,
39
- getCurrentPostId
40
- } = select(editorStore);
41
36
  const {
42
37
  getEditedEntityRecord,
43
38
  getEntityRecordPermissions
44
39
  } = unlock(select(coreStore));
45
- const _postType = getCurrentPostType();
46
- const _id = getCurrentPostId();
47
40
  return {
48
- item: getEditedEntityRecord('postType', _postType, _id),
49
- permissions: getEntityRecordPermissions('postType', _postType, _id),
50
- postType: _postType
41
+ item: getEditedEntityRecord('postType', postType, postId),
42
+ permissions: getEntityRecordPermissions('postType', postType, postId)
51
43
  };
52
- }, []);
44
+ }, [postId, postType]);
53
45
  const itemWithPermissions = useMemo(() => {
54
46
  return {
55
47
  ...item,
@@ -74,8 +66,7 @@ export default function PostActions({
74
66
  disabled: !actions.length,
75
67
  accessibleWhenDisabled: true,
76
68
  className: "editor-all-actions-button",
77
- onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen),
78
- ...buttonProps
69
+ onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen)
79
70
  }),
80
71
  onOpenChange: setIsActionsMenuOpen,
81
72
  placement: "bottom-end",
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DropdownMenuV2","DropdownMenu","DropdownMenuGroupV2","DropdownMenuGroup","DropdownMenuItemV2","DropdownMenuItem","DropdownMenuItemLabelV2","DropdownMenuItemLabel","kebabCase","PostActions","onActionPerformed","buttonProps","isActionsMenuOpen","setIsActionsMenuOpen","item","permissions","postType","select","getCurrentPostType","getCurrentPostId","getEditedEntityRecord","getEntityRecordPermissions","_postType","_id","itemWithPermissions","allActions","actions","filter","action","isEligible","open","trigger","size","icon","label","disabled","length","accessibleWhenDisabled","className","onClick","onOpenChange","placement","children","ActionsDropdownMenuGroup","onClose","DropdownMenuItemTrigger","items","hideOnClick","RenderModal","ActionWithModal","ActionTrigger","isModalOpen","setIsModalOpen","actionTriggerProps","hideModalHeader","title","modalHeader","__experimentalHideHeader","onRequestClose","overlayClassName","id","focusOnMount","closeModal","map","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\nimport { store as editorStore } from '../../store';\n\nconst {\n\tDropdownMenuV2: DropdownMenu,\n\tDropdownMenuGroupV2: DropdownMenuGroup,\n\tDropdownMenuItemV2: DropdownMenuItem,\n\tDropdownMenuItemLabelV2: DropdownMenuItemLabel,\n\tkebabCase,\n} = unlock( componentsPrivateApis );\n\nexport default function PostActions( { onActionPerformed, buttonProps } ) {\n\tconst [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );\n\tconst { item, permissions, postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } = unlock(\n\t\t\tselect( coreStore )\n\t\t);\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\treturn {\n\t\t\titem: getEditedEntityRecord( 'postType', _postType, _id ),\n\t\t\tpermissions: getEntityRecordPermissions(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_id\n\t\t\t),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\tconst itemWithPermissions = useMemo( () => {\n\t\treturn {\n\t\t\t...item,\n\t\t\tpermissions,\n\t\t};\n\t}, [ item, permissions ] );\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t! action.isEligible || action.isEligible( itemWithPermissions )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemWithPermissions ] );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\topen={ isActionsMenuOpen }\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsetIsActionsMenuOpen( ! isActionsMenuOpen )\n\t\t\t\t\t}\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonOpenChange={ setIsActionsMenuOpen }\n\t\t\tplacement=\"bottom-end\"\n\t\t>\n\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\tactions={ actions }\n\t\t\t\titem={ itemWithPermissions }\n\t\t\t\tonClose={ () => {\n\t\t\t\t\tsetIsActionsMenuOpen( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</DropdownMenu>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<DropdownMenuItem\n\t\t\tonClick={ onClick }\n\t\t\thideOnClick={ ! action.RenderModal }\n\t\t>\n\t\t\t<DropdownMenuItemLabel>{ label }</DropdownMenuItemLabel>\n\t\t</DropdownMenuItem>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionWithModal( { action, item, ActionTrigger, onClose } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst actionTriggerProps = {\n\t\taction,\n\t\tonClick: () => setIsModalOpen( true ),\n\t\titems: [ item ],\n\t};\n\tconst { RenderModal, hideModalHeader } = action;\n\treturn (\n\t\t<>\n\t\t\t<ActionTrigger { ...actionTriggerProps } />\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ action.modalHeader || action.label }\n\t\t\t\t\t__experimentalHideHeader={ !! hideModalHeader }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\t\t\taction.id\n\t\t\t\t\t) }` }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenderModal\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionsDropdownMenuGroup( { actions, item, onClose } ) {\n\treturn (\n\t\t<DropdownMenuGroup>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\tif ( action.RenderModal ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ActionWithModal\n\t\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\t\tActionTrigger={ DropdownMenuItemTrigger }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => action.callback( [ item ] ) }\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownMenuGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAA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hC,IAAI,CAAI;QAClBgD,UAAU,EAAGA,CAAA,KAAM;UAClBV,cAAc,CAAE,KAAM,CAAC;UACvBR,OAAO,CAAC,CAAC;QACV;MAAG,CACH;IAAC,CACI,CACP;EAAA,CACA,CAAC;AAEL;;AAEA;AACA;AACA,SAASD,wBAAwBA,CAAE;EAAEjB,OAAO;EAAEZ,IAAI;EAAE8B;AAAQ,CAAC,EAAG;EAC/D,oBACCjD,IAAA,CAACQ,iBAAiB;IAAAuC,QAAA,EACfhB,OAAO,CAACqC,GAAG,CAAInC,MAAM,IAAM;MAC5B,IAAKA,MAAM,CAACoB,WAAW,EAAG;QACzB,oBACCrD,IAAA,CAACsD,eAAe;UAEfrB,MAAM,EAAGA,MAAQ;UACjBd,IAAI,EAAGA,IAAM;UACboC,aAAa,EAAGL,uBAAyB;UACzCD,OAAO,EAAGA;QAAS,GAJbhB,MAAM,CAACgC,EAKb,CAAC;MAEJ;MACA,oBACCjE,IAAA,CAACkD,uBAAuB;QAEvBjB,MAAM,EAAGA,MAAQ;QACjBW,OAAO,EAAGA,CAAA,KAAMX,MAAM,CAACoC,QAAQ,CAAE,CAAElD,IAAI,CAAG,CAAG;QAC7CgC,KAAK,EAAG,CAAEhC,IAAI;MAAI,GAHZc,MAAM,CAACgC,EAIb,CAAC;IAEJ,CAAE;EAAC,CACe,CAAC;AAEtB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DropdownMenuV2","DropdownMenu","DropdownMenuGroupV2","DropdownMenuGroup","DropdownMenuItemV2","DropdownMenuItem","DropdownMenuItemLabelV2","DropdownMenuItemLabel","kebabCase","PostActions","postType","postId","onActionPerformed","isActionsMenuOpen","setIsActionsMenuOpen","item","permissions","select","getEditedEntityRecord","getEntityRecordPermissions","itemWithPermissions","allActions","actions","filter","action","isEligible","open","trigger","size","icon","label","disabled","length","accessibleWhenDisabled","className","onClick","onOpenChange","placement","children","ActionsDropdownMenuGroup","onClose","DropdownMenuItemTrigger","items","hideOnClick","RenderModal","ActionWithModal","ActionTrigger","isModalOpen","setIsModalOpen","actionTriggerProps","hideModalHeader","title","modalHeader","__experimentalHideHeader","onRequestClose","overlayClassName","id","focusOnMount","closeModal","map","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\n\nconst {\n\tDropdownMenuV2: DropdownMenu,\n\tDropdownMenuGroupV2: DropdownMenuGroup,\n\tDropdownMenuItemV2: DropdownMenuItem,\n\tDropdownMenuItemLabelV2: DropdownMenuItemLabel,\n\tkebabCase,\n} = unlock( componentsPrivateApis );\n\nexport default function PostActions( { postType, postId, onActionPerformed } ) {\n\tconst [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );\n\tconst { item, permissions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } =\n\t\t\t\tunlock( select( coreStore ) );\n\t\t\treturn {\n\t\t\t\titem: getEditedEntityRecord( 'postType', postType, postId ),\n\t\t\t\tpermissions: getEntityRecordPermissions(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\tconst itemWithPermissions = useMemo( () => {\n\t\treturn {\n\t\t\t...item,\n\t\t\tpermissions,\n\t\t};\n\t}, [ item, permissions ] );\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t! action.isEligible || action.isEligible( itemWithPermissions )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemWithPermissions ] );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\topen={ isActionsMenuOpen }\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsetIsActionsMenuOpen( ! isActionsMenuOpen )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonOpenChange={ setIsActionsMenuOpen }\n\t\t\tplacement=\"bottom-end\"\n\t\t>\n\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\tactions={ actions }\n\t\t\t\titem={ itemWithPermissions }\n\t\t\t\tonClose={ () => {\n\t\t\t\t\tsetIsActionsMenuOpen( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</DropdownMenu>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<DropdownMenuItem\n\t\t\tonClick={ onClick }\n\t\t\thideOnClick={ ! action.RenderModal }\n\t\t>\n\t\t\t<DropdownMenuItemLabel>{ label }</DropdownMenuItemLabel>\n\t\t</DropdownMenuItem>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionWithModal( { action, item, ActionTrigger, onClose } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst actionTriggerProps = {\n\t\taction,\n\t\tonClick: () => setIsModalOpen( true ),\n\t\titems: [ item ],\n\t};\n\tconst { RenderModal, hideModalHeader } = action;\n\treturn (\n\t\t<>\n\t\t\t<ActionTrigger { ...actionTriggerProps } />\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ action.modalHeader || action.label }\n\t\t\t\t\t__experimentalHideHeader={ !! hideModalHeader }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\t\t\taction.id\n\t\t\t\t\t) }` }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenderModal\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionsDropdownMenuGroup( { actions, item, onClose } ) {\n\treturn (\n\t\t<DropdownMenuGroup>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\tif ( action.RenderModal ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ActionWithModal\n\t\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\t\tActionTrigger={ DropdownMenuItemTrigger }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => action.callback( [ item ] ) }\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownMenuGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,cAAc,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EACLC,cAAc,EAAEC,YAAY;EAC5BC,mBAAmB,EAAEC,iBAAiB;EACtCC,kBAAkB,EAAEC,gBAAgB;EACpCC,uBAAuB,EAAEC,qBAAqB;EAC9CC;AACD,CAAC,GAAGhB,MAAM,CAAEN,qBAAsB,CAAC;AAEnC,eAAe,SAASuB,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAG;EAC9E,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGhC,QAAQ,CAAE,KAAM,CAAC;EACrE,MAAM;IAAEiC,IAAI;IAAEC;EAAY,CAAC,GAAGnC,SAAS,CACpCoC,MAAM,IAAM;IACb,MAAM;MAAEC,qBAAqB;MAAEC;IAA2B,CAAC,GAC1D3B,MAAM,CAAEyB,MA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,CAAC,CAAEH,eAAiB;MAC/CI,cAAc,EAAGA,CAAA,KAAM;QACtBN,cAAc,CAAE,KAAM,CAAC;MACxB,CAAG;MACHO,gBAAgB,EAAI,4CAA4C/C,SAAS,CACxEgB,MAAM,CAACgC,EACR,CAAG,EAAG;MACNC,YAAY,EAAC,qBAAqB;MAClC7B,IAAI,EAAC,OAAO;MAAAU,QAAA,eAEZ3C,IAAA,CAACiD,WAAW;QACXF,KAAK,EAAG,CAAE3B,IAAI,CAAI;QAClB2C,UAAU,EAAGA,CAAA,KAAM;UAClBV,cAAc,CAAE,KAAM,CAAC;UACvBR,OAAO,CAAC,CAAC;QACV;MAAG,CACH;IAAC,CACI,CACP;EAAA,CACA,CAAC;AAEL;;AAEA;AACA;AACA,SAASD,wBAAwBA,CAAE;EAAEjB,OAAO;EAAEP,IAAI;EAAEyB;AAAQ,CAAC,EAAG;EAC/D,oBACC7C,IAAA,CAACQ,iBAAiB;IAAAmC,QAAA,EACfhB,OAAO,CAACqC,GAAG,CAAInC,MAAM,IAAM;MAC5B,IAAKA,MAAM,CAACoB,WAAW,EAAG;QACzB,oBACCjD,IAAA,CAACkD,eAAe;UAEfrB,MAAM,EAAGA,MAAQ;UACjBT,IAAI,EAAGA,IAAM;UACb+B,aAAa,EAAGL,uBAAyB;UACzCD,OAAO,EAAGA;QAAS,GAJbhB,MAAM,CAACgC,EAKb,CAAC;MAEJ;MACA,oBACC7D,IAAA,CAAC8C,uBAAuB;QAEvBjB,MAAM,EAAGA,MAAQ;QACjBW,OAAO,EAAGA,CAAA,KAAMX,MAAM,CAACoC,QAAQ,CAAE,CAAE7C,IAAI,CAAG,CAAG;QAC7C2B,KAAK,EAAG,CAAE3B,IAAI;MAAI,GAHZS,MAAM,CAACgC,EAIb,CAAC;IAEJ,CAAE;EAAC,CACe,CAAC;AAEtB","ignoreList":[]}
@@ -17,10 +17,13 @@ import { decodeEntities } from '@wordpress/html-entities';
17
17
  import { store as editorStore } from '../../store';
18
18
  import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, GLOBAL_POST_TYPES } from '../../store/constants';
19
19
  import { unlock } from '../../lock-unlock';
20
+ import PostActions from '../post-actions';
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
23
  export default function PostCardPanel({
23
- actions
24
+ postType,
25
+ postId,
26
+ onActionPerformed
24
27
  }) {
25
28
  const {
26
29
  isFrontPage,
@@ -30,45 +33,38 @@ export default function PostCardPanel({
30
33
  isSync
31
34
  } = useSelect(select => {
32
35
  const {
33
- getEditedPostAttribute,
34
- getCurrentPostType,
35
- getCurrentPostId,
36
36
  __experimentalGetTemplateInfo
37
37
  } = select(editorStore);
38
38
  const {
39
- canUser
40
- } = select(coreStore);
41
- const {
39
+ canUser,
42
40
  getEditedEntityRecord
43
41
  } = select(coreStore);
44
42
  const siteSettings = canUser('read', {
45
43
  kind: 'root',
46
44
  name: 'site'
47
45
  }) ? getEditedEntityRecord('root', 'site') : undefined;
48
- const _type = getCurrentPostType();
49
- const _id = getCurrentPostId();
50
- const _record = getEditedEntityRecord('postType', _type, _id);
51
- const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(_type) && __experimentalGetTemplateInfo(_record);
46
+ const _record = getEditedEntityRecord('postType', postType, postId);
47
+ const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) && __experimentalGetTemplateInfo(_record);
52
48
  let _isSync = false;
53
- if (GLOBAL_POST_TYPES.includes(_type)) {
54
- if (PATTERN_POST_TYPE === _type) {
49
+ if (GLOBAL_POST_TYPES.includes(postType)) {
50
+ if (PATTERN_POST_TYPE === postType) {
55
51
  // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
56
- const currentSyncStatus = getEditedPostAttribute('meta')?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status');
52
+ const currentSyncStatus = _record?.meta?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : _record?.wp_pattern_sync_status;
57
53
  _isSync = currentSyncStatus !== 'unsynced';
58
54
  } else {
59
55
  _isSync = true;
60
56
  }
61
57
  }
62
58
  return {
63
- title: _templateInfo?.title || getEditedPostAttribute('title'),
64
- icon: unlock(select(editorStore)).getPostIcon(_type, {
59
+ title: _templateInfo?.title || _record?.title,
60
+ icon: unlock(select(editorStore)).getPostIcon(postType, {
65
61
  area: _record?.area
66
62
  }),
67
63
  isSync: _isSync,
68
- isFrontPage: siteSettings?.page_on_front === _id,
69
- isPostsPage: siteSettings?.page_for_posts === _id
64
+ isFrontPage: siteSettings?.page_on_front === postId,
65
+ isPostsPage: siteSettings?.page_for_posts === postId
70
66
  };
71
- }, []);
67
+ }, [postId, postType]);
72
68
  return /*#__PURE__*/_jsx("div", {
73
69
  className: "editor-post-card-panel",
74
70
  children: /*#__PURE__*/_jsxs(HStack, {
@@ -94,7 +90,11 @@ export default function PostCardPanel({
94
90
  className: "editor-post-card-panel__title-badge",
95
91
  children: __('Posts Page')
96
92
  })]
97
- }), actions]
93
+ }), /*#__PURE__*/_jsx(PostActions, {
94
+ postType: postType,
95
+ postId: postId,
96
+ onActionPerformed: onActionPerformed
97
+ })]
98
98
  })
99
99
  });
100
100
  }
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Icon","__experimentalHStack","HStack","__experimentalText","Text","store","coreStore","useSelect","__","decodeEntities","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","GLOBAL_POST_TYPES","unlock","jsx","_jsx","jsxs","_jsxs","PostCardPanel","actions","isFrontPage","isPostsPage","title","icon","isSync","select","getEditedPostAttribute","getCurrentPostType","getCurrentPostId","__experimentalGetTemplateInfo","canUser","getEditedEntityRecord","siteSettings","kind","name","undefined","_type","_id","_record","_templateInfo","includes","_isSync","currentSyncStatus","wp_pattern_sync_status","getPostIcon","area","page_on_front","page_for_posts","className","children","spacing","align","numberOfLines","truncate","weight","as","lineHeight"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tGLOBAL_POST_TYPES,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\n\nexport default function PostCardPanel( { actions } ) {\n\tconst { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\t__experimentalGetTemplateInfo,\n\t\t\t} = select( editorStore );\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\t\t\tconst _type = getCurrentPostType();\n\t\t\tconst _id = getCurrentPostId();\n\t\t\tconst _record = getEditedEntityRecord( 'postType', _type, _id );\n\t\t\tconst _templateInfo =\n\t\t\t\t[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\t\t_type\n\t\t\t\t) && __experimentalGetTemplateInfo( _record );\n\t\t\tlet _isSync = false;\n\t\t\tif ( GLOBAL_POST_TYPES.includes( _type ) ) {\n\t\t\t\tif ( PATTERN_POST_TYPE === _type ) {\n\t\t\t\t\t// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.\n\t\t\t\t\tconst currentSyncStatus =\n\t\t\t\t\t\tgetEditedPostAttribute( 'meta' )\n\t\t\t\t\t\t\t?.wp_pattern_sync_status === 'unsynced'\n\t\t\t\t\t\t\t? 'unsynced'\n\t\t\t\t\t\t\t: getEditedPostAttribute(\n\t\t\t\t\t\t\t\t\t'wp_pattern_sync_status'\n\t\t\t\t\t\t\t );\n\t\t\t\t\t_isSync = currentSyncStatus !== 'unsynced';\n\t\t\t\t} else {\n\t\t\t\t\t_isSync = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttitle:\n\t\t\t\t\t_templateInfo?.title || getEditedPostAttribute( 'title' ),\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( _type, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tisSync: _isSync,\n\t\t\t\tisFrontPage: siteSettings?.page_on_front === _id,\n\t\t\t\tisPostsPage: siteSettings?.page_for_posts === _id,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t<div className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={ clsx( 'editor-post-card-panel__icon', {\n\t\t\t\t\t\t'is-sync': isSync,\n\t\t\t\t\t} ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t/>\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tlineHeight=\"20px\"\n\t\t\t\t>\n\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No title' ) }\n\t\t\t\t\t{ isFrontPage && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ __( 'Homepage' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostsPage && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ __( 'Posts Page' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,SACCC,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,QACX,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,eAAe,SAASC,aAAaA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACpD,MAAM;IAAEC,WAAW;IAAEC,WAAW;IAAEC,KAAK;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGnB,SAAS,CAChEoB,MAAM,IAAM;IACb,MAAM;MACLC,sBAAsB;MACtBC,kBAAkB;MAClBC,gBAAgB;MAChBC;IACD,CAAC,GAAGJ,MAAM,CAAEjB,WAAY,CAAC;IACzB,MA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AO;MACfrB,WAAW,EAAEY,YAAY,EAAEc,aAAa,KAAKT,GAAG;MAChDhB,WAAW,EAAEW,YAAY,EAAEe,cAAc,KAAKV;IAC/C,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD,oBACCtB,IAAA;IAAKiC,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACtChC,KAAA,CAACjB,MAAM;MACNkD,OAAO,EAAG,CAAG;MACbF,SAAS,EAAC,gCAAgC;MAC1CG,KAAK,EAAC,YAAY;MAAAF,QAAA,gBAElBlC,IAAA,CAACjB,IAAI;QACJkD,SAAS,EAAGnD,IAAI,CAAE,8BAA8B,EAAE;UACjD,SAAS,EAAE2B;QACZ,CAAE,CAAG;QACLD,IAAI,EAAGA;MAAM,CACb,CAAC,eACFN,KAAA,CAACf,IAAI;QACJkD,aAAa,EAAG,CAAG;QACnBC,QAAQ;QACRL,SAAS,EAAC,+BAA+B;QACzCM,MAAM,EAAG,GAAK;QACdC,EAAE,EAAC,IAAI;QACPC,UAAU,EAAC,MAAM;QAAAP,QAAA,GAEf3B,KAAK,GAAGf,cAAc,CAAEe,KAAM,CAAC,GAAGhB,EAAE,CAAE,UAAW,CAAC,EAClDc,WAAW,iBACZL,IAAA;UAAMiC,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClD3C,EAAE,CAAE,UAAW;QAAC,CACb,CACN,EACCe,WAAW,iBACZN,IAAA;UAAMiC,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClD3C,EAAE,CAAE,YAAa;QAAC,CACf,CACN;MAAA,CACI,CAAC,EACLa,OAAO;IAAA,CACF;EAAC,CACL,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Icon","__experimentalHStack","HStack","__experimentalText","Text","store","coreStore","useSelect","__","decodeEntities","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","GLOBAL_POST_TYPES","unlock","PostActions","jsx","_jsx","jsxs","_jsxs","PostCardPanel","postType","postId","onActionPerformed","isFrontPage","isPostsPage","title","icon","isSync","select","__experimentalGetTemplateInfo","canUser","getEditedEntityRecord","siteSettings","kind","name","undefined","_record","_templateInfo","includes","_isSync","currentSyncStatus","meta","wp_pattern_sync_status","getPostIcon","area","page_on_front","page_for_posts","className","children","spacing","align","numberOfLines","truncate","weight","as","lineHeight"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tGLOBAL_POST_TYPES,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\n\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __experimentalGetTemplateInfo } = select( editorStore );\n\t\t\tconst { canUser, getEditedEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst _templateInfo =\n\t\t\t\t[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\t\tpostType\n\t\t\t\t) && __experimentalGetTemplateInfo( _record );\n\t\t\tlet _isSync = false;\n\t\t\tif ( GLOBAL_POST_TYPES.includes( postType ) ) {\n\t\t\t\tif ( PATTERN_POST_TYPE === postType ) {\n\t\t\t\t\t// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.\n\t\t\t\t\tconst currentSyncStatus =\n\t\t\t\t\t\t_record?.meta?.wp_pattern_sync_status === 'unsynced'\n\t\t\t\t\t\t\t? 'unsynced'\n\t\t\t\t\t\t\t: _record?.wp_pattern_sync_status;\n\t\t\t\t\t_isSync = currentSyncStatus !== 'unsynced';\n\t\t\t\t} else {\n\t\t\t\t\t_isSync = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttitle: _templateInfo?.title || _record?.title,\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tisSync: _isSync,\n\t\t\t\tisFrontPage: siteSettings?.page_on_front === postId,\n\t\t\t\tisPostsPage: siteSettings?.page_for_posts === postId,\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\treturn (\n\t\t<div className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={ clsx( 'editor-post-card-panel__icon', {\n\t\t\t\t\t\t'is-sync': isSync,\n\t\t\t\t\t} ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t/>\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tlineHeight=\"20px\"\n\t\t\t\t>\n\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No title' ) }\n\t\t\t\t\t{ isFrontPage && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ __( 'Homepage' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostsPage && (\n\t\t\t\t\t\t<span className=\"editor-post-card-panel__title-badge\">\n\t\t\t\t\t\t\t{ __( 'Posts Page' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t<PostActions\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,SACCC,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,QACX,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE1C,eAAe,SAASC,aAAaA,CAAE;EACtCC,QAAQ;EACRC,MAAM;EACNC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,WAAW;IAAEC,WAAW;IAAEC,KAAK;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGt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WAAW,EAAEQ,YAAY,EAAEc,cAAc,KAAKzB;IAC/C,CAAC;EACF,CAAC,EACD,CAAEA,MAAM,EAAED,QAAQ,CACnB,CAAC;EACD,oBACCJ,IAAA;IAAK+B,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACtC9B,KAAA,CAAClB,MAAM;MACNiD,OAAO,EAAG,CAAG;MACbF,SAAS,EAAC,gCAAgC;MAC1CG,KAAK,EAAC,YAAY;MAAAF,QAAA,gBAElBhC,IAAA,CAAClB,IAAI;QACJiD,SAAS,EAAGlD,IAAI,CAAE,8BAA8B,EAAE;UACjD,SAAS,EAAE8B;QACZ,CAAE,CAAG;QACLD,IAAI,EAAGA;MAAM,CACb,CAAC,eACFR,KAAA,CAAChB,IAAI;QACJiD,aAAa,EAAG,CAAG;QACnBC,QAAQ;QACRL,SAAS,EAAC,+BAA+B;QACzCM,MAAM,EAAG,GAAK;QACdC,EAAE,EAAC,IAAI;QACPC,UAAU,EAAC,MAAM;QAAAP,QAAA,GAEfvB,KAAK,GAAGlB,cAAc,CAAEkB,KAAM,CAAC,GAAGnB,EAAE,CAAE,UAAW,CAAC,EAClDiB,WAAW,iBACZP,IAAA;UAAM+B,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClD1C,EAAE,CAAE,UAAW;QAAC,CACb,CACN,EACCkB,WAAW,iBACZR,IAAA;UAAM+B,SAAS,EAAC,qCAAqC;UAAAC,QAAA,EAClD1C,EAAE,CAAE,YAAa;QAAC,CACf,CACN;MAAA,CACI,CAAC,eACPU,IAAA,CAACF,WAAW;QACXM,QAAQ,EAAGA,QAAU;QACrBC,MAAM,EAAGA,MAAQ;QACjBC,iBAAiB,EAAGA;MAAmB,CACvC,CAAC;IAAA,CACK;EAAC,CACL,CAAC;AAER","ignoreList":[]}
@@ -125,6 +125,8 @@ function PostFeaturedImage({
125
125
  "aria-label": !featuredImageId ? null : __('Edit or replace the featured image'),
126
126
  "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`,
127
127
  "aria-haspopup": "dialog",
128
+ disabled: isLoading,
129
+ accessibleWhenDisabled: true,
128
130
  children: [!!featuredImageId && media && /*#__PURE__*/_jsx("img", {
129
131
  className: "editor-post-featured-image__preview-image",
130
132
  src: mediaSourceUrl,
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","jsx","_jsx","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","children","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","className","alt_text","full","file","slug","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","ref","onClick","src","alt","set_featured_image","current","focus","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n} ) {\n\tconst toggleRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Edit or replace the featured image'\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isLoading && <Spinner /> }\n\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack className=\"editor-post-featured-image__actions\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\ttoggleRef.current.focus();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType } = select( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Renders the component for managing the featured image of a post.\n *\n * @param {Object} props Props.\n * @param {number} props.currentPostId ID of the current post.\n * @param {number} props.featuredImageId ID of the featured image.\n * @param {Function} props.onUpdateImage Function to call when the image is updated.\n * @param {Function} props.onRemoveImage Function to call when the image is removed.\n * @param {Object} props.media The media object representing the featured image.\n * @param {string} props.postType Post type.\n * @param {Element} props.noticeUI UI for displaying notices.\n * @param {Object} props.noticeOperations Operations for managing notices.\n *\n * @return {Element} Component to be rendered .\n */\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACrE,SACCC,WAAW,EACXC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,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AC;IACDhB,aAAaA,CAAA,EAAG;MACfmD,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe5F,OAAO,CACrBP,WAAW,EACXyF,eAAe,EACfO,iBAAiB,EACjB/F,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAE0C,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","jsx","_jsx","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","children","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","className","alt_text","full","file","slug","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","ref","onClick","disabled","accessibleWhenDisabled","src","alt","set_featured_image","current","focus","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n} ) {\n\tconst toggleRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Edit or replace the featured image'\n\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isLoading && <Spinner /> }\n\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack className=\"editor-post-featured-image__actions\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\ttoggleRef.current.focus();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType } = select( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Renders the component for managing the featured image of a post.\n *\n * @param {Object} props Props.\n * @param {number} props.currentPostId ID of the current post.\n * @param {number} props.featuredImageId ID of the featured image.\n * @param {Function} props.onUpdateImage Function to call when the image is updated.\n * @param {Function} props.onRemoveImage Function to call when the image is removed.\n * @param {Object} props.media The media object representing the featured image.\n * @param {string} props.postType Post type.\n * @param {Element} props.noticeUI UI for displaying notices.\n * @param {Object} props.noticeOperations Operations for managing notices.\n *\n * @return {Element} Component to be rendered .\n */\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACrE,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YAAYA,CAAE,CAAEC,KAAK,CAAE,EAAG;UACzBwC,QAAQ,CAAE;YAAEC,cAAc,EAAEzC,KAAK,CAAC3B;UAAG,CAAE,CAAC;QACzC,CAAC;QACD6B,OAAOA,CAAEC,OAAO,EAAG;UAClBb,gBAAgB,CAACc,gBAAgB,CAAC,CAAC;UACnCd,gBAAgB,CAACe,iBAAiB,CAAEF,OAAQ,CAAC;QAC9C;MACD,CAAE,CAAC;IACL,CAAC;IACDhB,aAAaA,CAAA,EAAG;MACfqD,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe9F,OAAO,CACrBP,WAAW,EACX2F,eAAe,EACfO,iBAAiB,EACjBjG,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAE0C,iBAAkB,CAAC","ignoreList":[]}
@@ -48,6 +48,7 @@ function CopyButton({
48
48
  }) {
49
49
  const ref = useCopyToClipboard(text, onCopy);
50
50
  return /*#__PURE__*/_jsx(Button, {
51
+ __next40pxDefaultSize: true,
51
52
  variant: "secondary",
52
53
  ref: ref,
53
54
  children: children
@@ -120,6 +121,7 @@ class PostPublishPanelPostpublish extends Component {
120
121
  }), /*#__PURE__*/_jsxs("div", {
121
122
  className: "post-publish-panel__postpublish-post-address-container",
122
123
  children: [/*#__PURE__*/_jsx(TextControl, {
124
+ __next40pxDefaultSize: true,
123
125
  __nextHasNoMarginBottom: true,
124
126
  className: "post-publish-panel__postpublish-post-address",
125
127
  readOnly: true,
@@ -140,9 +142,11 @@ class PostPublishPanelPostpublish extends Component {
140
142
  children: [!isScheduled && /*#__PURE__*/_jsx(Button, {
141
143
  variant: "primary",
142
144
  href: link,
145
+ __next40pxDefaultSize: true,
143
146
  children: viewPostLabel
144
147
  }), /*#__PURE__*/_jsx(Button, {
145
148
  variant: isScheduled ? 'primary' : 'secondary',
149
+ __next40pxDefaultSize: true,
146
150
  href: addLink,
147
151
  children: addNewPostLabel
148
152
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["PanelBody","Button","TextControl","__","sprintf","Component","createRef","withSelect","addQueryArgs","safeDecodeURIComponent","decodeEntities","useCopyToClipboard","store","coreStore","PostScheduleLabel","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","variant","PostPublishPanelPostpublish","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","post_type","type","postPublishNonLinkHeader","className","href","title","__nextHasNoMarginBottom","readOnly","label","value","onFocus","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","getPostType"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AACtE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,EAAEC,sBAAsB,QAAQ,gBAAgB;AACrE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;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SAAU,CAAC,GACfA,EAAE,CAAE,MAAO;YAAC,CACJ;UAAC,CACT,CAAC;QAAA,CACF,CAAC,eAENkB,KAAA;UAAKoD,SAAS,EAAC,yCAAyC;UAAAxC,QAAA,GACrD,CAAEyB,WAAW,iBACdzC,IAAA,CAAChB,MAAM;YAACkC,OAAO,EAAC,SAAS;YAACuC,IAAI,EAAGP,IAAM;YAAAlC,QAAA,EACpC8B;UAAa,CACR,CACR,eACD9C,IAAA,CAAChB,MAAM;YACNkC,OAAO,EAAGuB,WAAW,GAAG,SAAS,GAAG,WAAa;YACjDgB,IAAI,EAAGL,OAAS;YAAApC,QAAA,EAEdgC;UAAe,CACV,CAAC;QAAA,CACL,CAAC;MAAA,CACI,CAAC,EACVhC,QAAQ;IAAA,CACN,CAAC;EAER;AACD;AAEA,eAAe1B,UAAU,CAAIiD,MAAM,IAAM;EACxC,MAAM;IAAEyB,sBAAsB;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GACvE3B,MAAM,CAAEzC,WAAY,CAAC;EACtB,MAAM;IAAEqE;EAAY,CAAC,GAAG5B,MAAM,CAAE3C,SAAU,CAAC;EAE3C,OAAO;IACNY,IAAI,EAAEyD,cAAc,CAAC,CAAC;IACtBvB,QAAQ,EAAEyB,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDvB,WAAW,EAAEyB,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE/C,2BAA4B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["PanelBody","Button","TextControl","__","sprintf","Component","createRef","withSelect","addQueryArgs","safeDecodeURIComponent","decodeEntities","useCopyToClipboard","store","coreStore","PostScheduleLabel","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","__next40pxDefaultSize","variant","PostPublishPanelPostpublish","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","post_type","type","postPublishNonLinkHeader","className","href","title","__nextHasNoMarginBottom","readOnly","label","value","onFocus","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","getPostType"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AACtE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,EAAEC,sBAAsB,QAAQ,gBAAgB;AACrE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAMC,QAAQ,GAAG,YAAY;AAC7B,MAAMC,QAAQ,GAAG,YAAY;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,gBAAgB,GAAKC,IAAI,IAAM;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EAErB,IAAKA,IAA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AChB,MAAM;YACNmC,OAAO,EAAC,SAAS;YACjBuC,IAAI,EAAGP,IAAM;YACbjC,qBAAqB;YAAAF,QAAA,EAEnB+B;UAAa,CACR,CACR,eACD/C,IAAA,CAAChB,MAAM;YACNmC,OAAO,EAAGuB,WAAW,GAAG,SAAS,GAAG,WAAa;YACjDxB,qBAAqB;YACrBwC,IAAI,EAAGL,OAAS;YAAArC,QAAA,EAEdiC;UAAe,CACV,CAAC;QAAA,CACL,CAAC;MAAA,CACI,CAAC,EACVjC,QAAQ;IAAA,CACN,CAAC;EAER;AACD;AAEA,eAAe1B,UAAU,CAAIkD,MAAM,IAAM;EACxC,MAAM;IAAEyB,sBAAsB;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GACvE3B,MAAM,CAAE1C,WAAY,CAAC;EACtB,MAAM;IAAEsE;EAAY,CAAC,GAAG5B,MAAM,CAAE5C,SAAU,CAAC;EAE3C,OAAO;IACNY,IAAI,EAAE0D,cAAc,CAAC,CAAC;IACtBvB,QAAQ,EAAEyB,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDvB,WAAW,EAAEyB,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE/C,2BAA4B,CAAC","ignoreList":[]}
@@ -22,6 +22,7 @@ function PostSlugControl() {
22
22
  } = useDispatch(editorStore);
23
23
  const [forceEmptyField, setForceEmptyField] = useState(false);
24
24
  return /*#__PURE__*/_jsx(TextControl, {
25
+ __next40pxDefaultSize: true,
25
26
  __nextHasNoMarginBottom: true,
26
27
  label: __('Slug'),
27
28
  autoComplete: "off",
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useSelect","useState","__","safeDecodeURIComponent","cleanForSlug","TextControl","PostSlugCheck","store","editorStore","jsx","_jsx","PostSlugControl","postSlug","select","getEditedPostSlug","editPost","forceEmptyField","setForceEmptyField","__nextHasNoMarginBottom","label","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","target","className","PostSlug","children"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\n/**\n * Renders the PostSlug component. It provide a control for editing the post slug.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,WAAW,QAAQ,uBAAuB;;AAEnD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,SAAS;AACnC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAGZ,SAAS,CAAIa,MAAM,IAAM;IACzC,OAAOV,sBAAsB,CAC5BU,MAAM,CAAEL,WAAY,CAAC,CAACM,iBAAiB,CAAC,CACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAS,CAAC,GAAGhB,WAAW,CAAES,WAAY,CAAC;EAC/C,MAAM,CAAEQ,eAAe,EAAEC,kBAAkB,CAAE,GAAGhB,QAAQ,CAAE,KAAM,CAAC;EAEjE,oBACCS,IAAA,CAACL,WAAW;IACXa,uBAAuB;IACvBC,KAAK,EAAGjB,EAAE,CAAE,MAAO,CAAG;IACtBkB,YAAY,EAAC,KAAK;IAClBC,UAAU,EAAC,OAAO;IAClBC,KAAK,EAAGN,eAAe,GAAG,EAAE,GAAGJ,QAAU;IACzCW,QAAQ,EAAKC,QAAQ,IAAM;MAC1BT,QAAQ,CAAE;QAAEU,IAAI,EAAED;MAAS,CAAE,CAAC;MAC9B;MACA;MACA;MACA;MACA,IAAK,CAAEA,QAAQ,EAAG;QACjB,IAAK,CAAER,eAAe,EAAG;UACxBC,kBAAkB,CAAE,IAAK,CAAC;QAC3B;QACA;MACD;MACA,IAAKD,eAAe,EAAG;QACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHS,MAAM,EAAKC,KAAK,IAAM;MACrBZ,QAAQ,CAAE;QACTU,IAAI,EAAErB,YAAY,CAAEuB,KAAK,CAACC,MAAM,CAACN,KAAM;MACxC,CAAE,CAAC;MACH,IAAKN,eAAe,EAAG;QACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHY,SAAS,EAAC;EAAkB,CAC5B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,oBACCpB,IAAA,CAACJ,aAAa;IAAAyB,QAAA,eACbrB,IAAA,CAACC,eAAe,IAAE;EAAC,CACL,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useSelect","useState","__","safeDecodeURIComponent","cleanForSlug","TextControl","PostSlugCheck","store","editorStore","jsx","_jsx","PostSlugControl","postSlug","select","getEditedPostSlug","editPost","forceEmptyField","setForceEmptyField","__next40pxDefaultSize","__nextHasNoMarginBottom","label","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","target","className","PostSlug","children"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\n/**\n * Renders the PostSlug component. It provide a control for editing the post slug.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,WAAW,QAAQ,uBAAuB;;AAEnD;AACA;AACA;AACA,OAAOC,aAAa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A;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,oBACCrB,IAAA,CAACJ,aAAa;IAAA0B,QAAA,eACbtB,IAAA,CAACC,eAAe,IAAE;EAAC,CACL,CAAC;AAElB","ignoreList":[]}
@@ -4,7 +4,7 @@
4
4
  import { __, _n, _x, sprintf } from '@wordpress/i18n';
5
5
  import { useMemo, useState } from '@wordpress/element';
6
6
  import { store as noticesStore } from '@wordpress/notices';
7
- import { Button, CheckboxControl, TextControl, TreeSelect, withFilters, Flex, FlexItem } from '@wordpress/components';
7
+ import { Button, CheckboxControl, TextControl, TreeSelect, withFilters, Flex, FlexItem, SearchControl } from '@wordpress/components';
8
8
  import { useDispatch, useSelect } from '@wordpress/data';
9
9
  import { useDebounce } from '@wordpress/compose';
10
10
  import { store as coreStore } from '@wordpress/core-data';
@@ -328,7 +328,8 @@ export function HierarchicalTermSelector({
328
328
  return /*#__PURE__*/_jsxs(Flex, {
329
329
  direction: "column",
330
330
  gap: "4",
331
- children: [showFilter && /*#__PURE__*/_jsx(TextControl, {
331
+ children: [showFilter && /*#__PURE__*/_jsx(SearchControl, {
332
+ __next40pxDefaultSize: true,
332
333
  __nextHasNoMarginBottom: true,
333
334
  label: filterLabel,
334
335
  value: filterValue,