@wordpress/editor 14.40.1-next.v.202602200903.0 → 14.40.1

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 (27) hide show
  1. package/build/components/post-locked-modal/index.cjs +4 -2
  2. package/build/components/post-locked-modal/index.cjs.map +2 -2
  3. package/build/components/preferences-modal/index.cjs +1 -1
  4. package/build/components/preferences-modal/index.cjs.map +2 -2
  5. package/build/components/provider/use-upload-save-lock.cjs +5 -5
  6. package/build/components/provider/use-upload-save-lock.cjs.map +2 -2
  7. package/build/utils/media-upload/index.cjs +2 -8
  8. package/build/utils/media-upload/index.cjs.map +2 -2
  9. package/build-module/components/post-locked-modal/index.mjs +4 -2
  10. package/build-module/components/post-locked-modal/index.mjs.map +2 -2
  11. package/build-module/components/preferences-modal/index.mjs +1 -1
  12. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  13. package/build-module/components/provider/use-upload-save-lock.mjs +5 -5
  14. package/build-module/components/provider/use-upload-save-lock.mjs.map +2 -2
  15. package/build-module/utils/media-upload/index.mjs +2 -8
  16. package/build-module/utils/media-upload/index.mjs.map +2 -2
  17. package/build-style/style-rtl.css +3 -3
  18. package/build-style/style.css +3 -3
  19. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  20. package/build-types/components/provider/use-upload-save-lock.d.ts +1 -1
  21. package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
  22. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  23. package/package.json +44 -44
  24. package/src/components/post-locked-modal/index.js +4 -2
  25. package/src/components/preferences-modal/index.js +1 -1
  26. package/src/components/provider/use-upload-save-lock.js +6 -7
  27. package/src/utils/media-upload/index.js +2 -8
@@ -133,8 +133,10 @@ function PostLockedModal() {
133
133
  if (!isLocked) {
134
134
  return null;
135
135
  }
136
- if (isCollaborationEnabled) {
137
- return null;
136
+ if (globalThis.IS_GUTENBERG_PLUGIN) {
137
+ if (isCollaborationEnabled) {
138
+ return null;
139
+ }
138
140
  }
139
141
  const userDisplayName = user.name;
140
142
  const userAvatar = user.avatar;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-locked-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisCollaborationEnabled,\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCollaborationEnabledForCurrentPost,\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisCollaborationEnabled: isCollaborationEnabledForCurrentPost(),\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\t// Avoid sending the modal if sync is supported, but retain functionality around locks etc.\n\tif ( isCollaborationEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\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'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\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\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {React.ReactNode} The rendered PostLockedModal component.\n */\nexport default globalThis.IS_GUTENBERG_PLUGIN\n\t? withFilters( 'editor.PostLockedModal' )( PostLockedModal )\n\t: PostLockedModal;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAMO;AACP,kBAAuC;AACvC,iBAA6B;AAC7B,qBAAoD;AACpD,mBAAwC;AACxC,qBAA8B;AAC9B,uBAAmC;AAKnC,mBAAqC;AAwKhC;AAtKL,SAAS,kBAAkB;AAC1B,QAAM,iBAAa,8BAAe,eAAgB;AAClD,QAAM,WAAW,mCAAmC;AACpD,QAAM,EAAE,UAAU,eAAe,QAAI,yBAAa,aAAAA,KAAY;AAC9D,QAAM;AAAA,IACL;AAAA,IACA;AAAA,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A,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UACD;AAAA,WACD;AAAA,SACD;AAAA;AAAA,EACD;AAEF;AAQA,IAAO,4BAAQ,WAAW,0BACvB,+BAAa,wBAAyB,EAAG,eAAgB,IACzD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisCollaborationEnabled,\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCollaborationEnabledForCurrentPost,\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisCollaborationEnabled: isCollaborationEnabledForCurrentPost(),\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\t// Avoid sending the modal if sync is supported, but retain functionality around locks etc.\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\tif ( isCollaborationEnabled ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\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'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\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\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {React.ReactNode} The rendered PostLockedModal component.\n */\nexport default globalThis.IS_GUTENBERG_PLUGIN\n\t? withFilters( 'editor.PostLockedModal' )( PostLockedModal )\n\t: PostLockedModal;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAMO;AACP,kBAAuC;AACvC,iBAA6B;AAC7B,qBAAoD;AACpD,mBAAwC;AACxC,qBAA8B;AAC9B,uBAAmC;AAKnC,mBAAqC;AA0KhC;AAxKL,SAAS,kBAAkB;AAC1B,QAAM,iBAAa,8BA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,iBAAE,cACH;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL,8BAAI,WAAY;AAAA;AAAA,gBACnB;AAAA,gBAED;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UACD;AAAA,WACD;AAAA,SACD;AAAA;AAAA,EACD;AAEF;AAQA,IAAO,4BAAQ,WAAW,0BACvB,+BAAa,wBAAyB,EAAG,eAAgB,IACzD;",
6
6
  "names": ["editorStore", "coreStore", "HStack"]
7
7
  }
@@ -354,7 +354,7 @@ function PreferencesModalContents({ extraSections = {} }) {
354
354
  )
355
355
  ] })
356
356
  },
357
- window.__clientSideMediaProcessing && {
357
+ window.__experimentalMediaProcessing && {
358
358
  name: "media",
359
359
  tabLabel: (0, import_i18n.__)("Media"),
360
360
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/preferences-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from '../block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View panel by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Pick from starter content when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__clientSideMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AACnB,qBAAiC;AACjC,kBAAuC;AACvC,qBAAwB;AACxB,yBAGO;AACP,uBAAwC;A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__ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from '../block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View panel by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Pick from starter content when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAmB;AACnB,qBAAiC;AACjC,kBAAuC;AACvC,qBAAwB;AACxB,yBAGO;AACP,uBAAwC;AAKxC,0BAA8B;AAC9B,kDAAmD;AACnD,oCAAuC;AACvC,8BAA4B;AAC5B,6BAA2B;AAC3B,mBAAmC;AACnC,IAAAA,gBAA6B;AAC7B,IAAAA,gBAAgC;AAChC,qCAAiC;AACjC,mBAAqC;AACrC,yBAAuB;AAuBpB;AArBH,IAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,QAAI,2BAAQ,mBAAAC,WAAuB;AAEpB,SAAR,uBAAyC,EAAE,gBAAgB,CAAC,EAAE,GAAI;AACxE,QAAM,eAAW,uBAAW,CAAE,WAAY;AACzC,WAAO,OAAQ,iBAAAC,KAAe,EAAE,cAAe,oBAAqB;AAAA,EACrE,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,WAAW,QAAI,yBAAa,iBAAAA,KAAe;AAEnD,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AAIA,SACC,4CAAC,oBAAiB,YACjB,sDAAC,4BAAyB,eAAgC,GAC3D;AAEF;AAEA,SAAS,yBAA0B,EAAE,gBAAgB,CAAC,EAAE,GAAI;AAC3D,QAAM,sBAAkB,iCAAkB,QAAS;AACnD,QAAM,iCAA6B;AAAA,IAClC,CAAE,WAAY;AACb,YAAM,EAAE,kBAAkB,IAAI,OAAQ,aAAAC,KAAY;AAClD,YAAM,EAAE,IAAI,IAAI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C;AAAA;AAAA,kBACA,OAAM;AAAA,kBACN,aAAY;AAAA,kBACZ,UAAO;AAAA,oBACN;AAAA,kBACD;AAAA,kBACA,WAAQ,gBAAI,eAAgB;AAAA;AAAA,cAC7B;AAAA;AAAA;AAAA,QACD,GACD;AAAA,MAEF;AAAA,IACD,EAAE,OAAQ,OAAQ;AAAA,IACnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,SAAO,4CAAC,wBAAqB,UAAsB;AACpD;",
6
6
  "names": ["import_check", "preferencesPrivateApis", "interfaceStore", "editorStore", "preferencesStore", "EnablePluginDocumentSettingPanelOption", "PostTaxonomies", "EnablePanelOption", "PostFeaturedImageCheck", "PostExcerptCheck", "PostTypeSupportCheck", "PageAttributesCheck", "EnablePublishSidebarOption", "BlockVisibility"]
7
7
  }
@@ -29,15 +29,15 @@ var import_upload_media = require("@wordpress/upload-media");
29
29
  var import_store = require("../../store/index.cjs");
30
30
  var LOCK_NAME = "upload-in-progress";
31
31
  function useUploadSaveLock() {
32
- const isClientSideMediaProcessingEnabled = window.__clientSideMediaProcessing;
32
+ const isExperimentEnabled = window.__experimentalMediaProcessing;
33
33
  const isUploading = (0, import_data.useSelect)(
34
34
  (select) => {
35
- if (!isClientSideMediaProcessingEnabled) {
35
+ if (!isExperimentEnabled) {
36
36
  return false;
37
37
  }
38
38
  return select(import_upload_media.store).isUploading();
39
39
  },
40
- [isClientSideMediaProcessingEnabled]
40
+ [isExperimentEnabled]
41
41
  );
42
42
  const {
43
43
  lockPostSaving,
@@ -46,7 +46,7 @@ function useUploadSaveLock() {
46
46
  unlockPostAutosaving
47
47
  } = (0, import_data.useDispatch)(import_store.store);
48
48
  (0, import_element.useEffect)(() => {
49
- if (!isClientSideMediaProcessingEnabled) {
49
+ if (!isExperimentEnabled) {
50
50
  return;
51
51
  }
52
52
  if (isUploading) {
@@ -61,7 +61,7 @@ function useUploadSaveLock() {
61
61
  unlockPostAutosaving(LOCK_NAME);
62
62
  };
63
63
  }, [
64
- isClientSideMediaProcessingEnabled,
64
+ isExperimentEnabled,
65
65
  isUploading,
66
66
  lockPostSaving,
67
67
  unlockPostSaving,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/provider/use-upload-save-lock.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as uploadStore } from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst LOCK_NAME = 'upload-in-progress';\n\n/**\n * A hook that locks post saving and autosaving while media uploads are in progress.\n * This prevents users from publishing or saving while files are still uploading.\n *\n * Only active when client-side media processing is enabled.\n */\nexport default function useUploadSaveLock() {\n\tconst isClientSideMediaProcessingEnabled =\n\t\twindow.__clientSideMediaProcessing;\n\n\tconst isUploading = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isClientSideMediaProcessingEnabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn select( uploadStore ).isUploading();\n\t\t},\n\t\t[ isClientSideMediaProcessingEnabled ]\n\t);\n\n\tconst {\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t} = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isClientSideMediaProcessingEnabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isUploading ) {\n\t\t\tlockPostSaving( LOCK_NAME );\n\t\t\tlockPostAutosaving( LOCK_NAME );\n\t\t} else {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t};\n\t}, [\n\t\tisClientSideMediaProcessingEnabled,\n\t\tisUploading,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t] );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,qBAA0B;AAC1B,0BAAqC;AAKrC,mBAAqC;AAErC,IAAM,YAAY;AAQH,SAAR,oBAAqC;AAC3C,QAAM,qCACL,OAAO;AAER,QAAM,kBAAc;AAAA,IACnB,CAAE,WAAY;AACb,UAAK,CAAE,oCAAqC;AAC3C,eAAO;AAAA,MACR;AACA,aAAO,OAAQ,oBAAAA,KAAY,EAAE,YAAY;AAAA,IAC1C;AAAA,IACA,CAAE,kCAAmC;AAAA,EACtC;AAEA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,yBAAa,aAAAC,KAAY;AAE7B,gCAAW,MAAM;AAChB,QAAK,CAAE,oCAAqC;AAC3C;AAAA,IACD;AAEA,QAAK,aAAc;AAClB,qBAAgB,SAAU;AAC1B,yBAAoB,SAAU;AAAA,IAC/B,OAAO;AACN,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAEA,WAAO,MAAM;AACZ,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as uploadStore } from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst LOCK_NAME = 'upload-in-progress';\n\n/**\n * A hook that locks post saving and autosaving while media uploads are in progress.\n * This prevents users from publishing or saving while files are still uploading.\n *\n * Only active when the experimental media processing feature is enabled.\n */\nexport default function useUploadSaveLock() {\n\tconst isExperimentEnabled = window.__experimentalMediaProcessing;\n\n\tconst isUploading = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isExperimentEnabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn select( uploadStore ).isUploading();\n\t\t},\n\t\t[ isExperimentEnabled ]\n\t);\n\n\tconst {\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t} = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isExperimentEnabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isUploading ) {\n\t\t\tlockPostSaving( LOCK_NAME );\n\t\t\tlockPostAutosaving( LOCK_NAME );\n\t\t} else {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t};\n\t}, [\n\t\tisExperimentEnabled,\n\t\tisUploading,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t] );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,qBAA0B;AAC1B,0BAAqC;AAKrC,mBAAqC;AAErC,IAAM,YAAY;AAQH,SAAR,oBAAqC;AAC3C,QAAM,sBAAsB,OAAO;AAEnC,QAAM,kBAAc;AAAA,IACnB,CAAE,WAAY;AACb,UAAK,CAAE,qBAAsB;AAC5B,eAAO;AAAA,MACR;AACA,aAAO,OAAQ,oBAAAA,KAAY,EAAE,YAAY;AAAA,IAC1C;AAAA,IACA,CAAE,mBAAoB;AAAA,EACvB;AAEA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,yBAAa,aAAAC,KAAY;AAE7B,gCAAW,MAAM;AAChB,QAAK,CAAE,qBAAsB;AAC5B;AAAA,IACD;AAEA,QAAK,aAAc;AAClB,qBAAgB,SAAU;AAC1B,yBAAoB,SAAU;AAAA,IAC/B,OAAO;AACN,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAEA,WAAO,MAAM;AACZ,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": ["uploadStore", "editorStore"]
7
7
  }
@@ -55,18 +55,12 @@ function mediaUpload({
55
55
  const currentPost = getCurrentPost();
56
56
  const currentPostId = typeof currentPost?.id === "number" ? currentPost.id : currentPost?.wp_id;
57
57
  const setSaveLock = () => {
58
- if (window.__clientSideMediaProcessing) {
59
- return;
60
- }
61
58
  lockPostSaving(lockKey);
62
59
  lockPostAutosaving(lockKey);
63
60
  imageIsUploading = true;
64
61
  };
65
62
  const postData = currentPostId ? { post: currentPostId } : {};
66
63
  const clearSaveLock = () => {
67
- if (window.__clientSideMediaProcessing) {
68
- return;
69
- }
70
64
  unlockPostSaving(lockKey);
71
65
  unlockPostAutosaving(lockKey);
72
66
  imageIsUploading = false;
@@ -75,7 +69,7 @@ function mediaUpload({
75
69
  allowedTypes,
76
70
  filesList,
77
71
  onFileChange: (file) => {
78
- if (!window.__clientSideMediaProcessing) {
72
+ if (!window.__experimentalMediaProcessing) {
79
73
  if (!imageIsUploading) {
80
74
  setSaveLock();
81
75
  } else {
@@ -102,7 +96,7 @@ function mediaUpload({
102
96
  },
103
97
  maxUploadFileSize,
104
98
  onError: ({ message }) => {
105
- if (!window.__clientSideMediaProcessing) {
99
+ if (!window.__experimentalMediaProcessing) {
106
100
  clearSaveLock();
107
101
  }
108
102
  onError(message);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/media-upload/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tlet imageIsUploading = false;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst setSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t\timageIsUploading = true;\n\t};\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\tconst clearSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t\timageIsUploading = false;\n\t};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( file ) => {\n\t\t\t// When client-side media processing is enabled, save locking\n\t\t\t// is handled by useUploadSaveLock in the editor provider.\n\t\t\tif ( ! window.__clientSideMediaProcessing ) {\n\t\t\t\tif ( ! imageIsUploading ) {\n\t\t\t\t\tsetSaveLock();\n\t\t\t\t} else {\n\t\t\t\t\tclearSaveLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tonFileChange?.( file );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called a second time with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = file.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\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AEA,sCAAa;AAAA,IACZ;AAAA,IACA;AAAA,IACA,cAAc,CAAE,SAAU;AAGzB,UAAK,CAAE,OAAO,6BAA8B;AAC3C,YAAK,CAAE,kBAAmB;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,wBAAc;AAAA,QACf;AAAA,MACD;AACA,qBAAgB,IAAK;AAKrB,YAAM,cAAc,KAAK,OAAQ,CAAE,UAAW,OAAO,EAAG;AACxD,UAAK,aAAa,QAAS;AAC1B,cAAM,kBAAkB;AACxB;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACf,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS,CAAE,EAAE,QAAQ,MAAO;AAC3B,UAAK,CAAE,OAAO,6BAA8B;AAC3C,sBAAc;AAAA,MACf;AACA,cAAS,OAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tlet imageIsUploading = false;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst setSaveLock = () => {\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t\timageIsUploading = true;\n\t};\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\tconst clearSaveLock = () => {\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t\timageIsUploading = false;\n\t};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( file ) => {\n\t\t\t// When client-side media processing is enabled, save locking\n\t\t\t// is handled by useUploadSaveLock in the editor provider.\n\t\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t\tif ( ! imageIsUploading ) {\n\t\t\t\t\tsetSaveLock();\n\t\t\t\t} else {\n\t\t\t\t\tclearSaveLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tonFileChange?.( file );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called a second time with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = file.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\n\t\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t\tonError( message );\n\t\t},\n\t\twpAllowedMimeTypes,\n\t\tmultiple,\n\t} );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2B;AAK3B,kBAAiC;AACjC,uBAAuC;AACvC,yBAA4B;AAK5B,mBAAqC;AAErC,IAAM,OAAO,MAAM;AAAC;AAgBL,SAAR,YAA8B;AAAA,EACpC,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,WAAW;AACZ,GAAI;AACH,QAAM,EAAE,qBAAqB,QAAI,sBAAU,iBAAAA,KAAc;AACzD,QAAM,EAAE,gBAAgB,kBAAkB,QAAI,oBAAQ,aAAAC,KAAY;AAClE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,sBAAU,aAAAA,KAAY;AAE1B,QAAM,qBAAqB,kBAAkB,EAAE;AAC/C,QAAM,UAAU,oBAAiB,YAAAC,IAAK,CAAE;AACxC,MAAI,mBAAmB;AACvB,sBACC,qBAAqB,kBAAkB,EAAE;AAC1C,QAAM,cAAc,eAAe;AAEnC,QAAM,gBACL,OAAO,aAAa,OAAO,WACxB,YAAY,KACZ,aAAa;AACjB,QAAM,cAAc,MAAM;AACzB,mBAAgB,OAAQ;AACxB,uBAAoB,OAAQ;AAC5B,uBAAmB;AAAA,EACpB;AAEA,QAAM,WAAW,gBAAgB,EAAE,MAAM,cAAc,IAAI,CAAC;AAC5D,QAAM,gBAAgB,MAAM;AAC3B,qBAAkB,OAAQ;AAC1B,yBAAsB,OAAQ;AAC9B,uBAAmB;AAAA,EACpB;AAEA,sCAAa;AAAA,IACZ;AAAA,IACA;AAAA,IACA,cAAc,CAAE,SAAU;AAGzB,UAAK,CAAE,OAAO,+BAAgC;AAC7C,YAAK,CAAE,kBAAmB;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,wBAAc;AAAA,QACf;AAAA,MACD;AACA,qBAAgB,IAAK;AAKrB,YAAM,cAAc,KAAK,OAAQ,CAAE,UAAW,OAAO,EAAG;AACxD,UAAK,aAAa,QAAS;AAC1B,cAAM,kBAAkB;AACxB;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACf,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS,CAAE,EAAE,QAAQ,MAAO;AAC3B,UAAK,CAAE,OAAO,+BAAgC;AAC7C,sBAAc;AAAA,MACf;AACA,cAAS,OAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": ["coreDataStore", "editorStore", "uuid"]
7
7
  }
@@ -115,8 +115,10 @@ function PostLockedModal() {
115
115
  if (!isLocked) {
116
116
  return null;
117
117
  }
118
- if (isCollaborationEnabled) {
119
- return null;
118
+ if (globalThis.IS_GUTENBERG_PLUGIN) {
119
+ if (isCollaborationEnabled) {
120
+ return null;
121
+ }
120
122
  }
121
123
  const userDisplayName = user.name;
122
124
  const userAvatar = user.avatar;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-locked-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisCollaborationEnabled,\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCollaborationEnabledForCurrentPost,\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisCollaborationEnabled: isCollaborationEnabledForCurrentPost(),\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\t// Avoid sending the modal if sync is supported, but retain functionality around locks etc.\n\tif ( isCollaborationEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\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'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\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\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {React.ReactNode} The rendered PostLockedModal component.\n */\nexport default globalThis.IS_GUTENBERG_PLUGIN\n\t? withFilters( 'editor.PostLockedModal' )( PostLockedModal )\n\t: PostLockedModal;\n"],
5
- "mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,gCAAgC;AACpD,SAAS,WAAW,oBAAoB;AACxC,SAAS,qBAAqB;AAC9B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AAwKhC,SAmCC,UAnCD,KAmCC,YAnCD;AAtKL,SAAS,kBAAkB;AAC1B,QAAM,aAAa,cAAe,eAAgB;AAClD,QA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BACnB;AAAA,gBAED;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UACD;AAAA,WACD;AAAA,SACD;AAAA;AAAA,EACD;AAEF;AAQA,IAAO,4BAAQ,WAAW,sBACvB,YAAa,wBAAyB,EAAG,eAAgB,IACzD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisCollaborationEnabled,\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCollaborationEnabledForCurrentPost,\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisCollaborationEnabled: isCollaborationEnabledForCurrentPost(),\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\t// Avoid sending the modal if sync is supported, but retain functionality around locks etc.\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\tif ( isCollaborationEnabled ) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don\u2019t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\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'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\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\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\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\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {React.ReactNode} The rendered PostLockedModal component.\n */\nexport default globalThis.IS_GUTENBERG_PLUGIN\n\t? withFilters( 'editor.PostLockedModal' )( PostLockedModal )\n\t: PostLockedModal;\n"],
5
+ "mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,gCAAgC;AACpD,SAAS,WAAW,oB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A,aACD;AAAA,UAGD;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,SAAQ;AAAA,cAEN;AAAA,iBAAE,cACH;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL,aAAI,WAAY;AAAA;AAAA,gBACnB;AAAA,gBAED;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,MAAO;AAAA,oBAEL;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UACD;AAAA,WACD;AAAA,SACD;AAAA;AAAA,EACD;AAEF;AAQA,IAAO,4BAAQ,WAAW,sBACvB,YAAa,wBAAyB,EAAG,eAAgB,IACzD;",
6
6
  "names": []
7
7
  }
@@ -323,7 +323,7 @@ function PreferencesModalContents({ extraSections = {} }) {
323
323
  )
324
324
  ] })
325
325
  },
326
- window.__clientSideMediaProcessing && {
326
+ window.__experimentalMediaProcessing && {
327
327
  name: "media",
328
328
  tabLabel: __("Media"),
329
329
  content: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/preferences-modal/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from '../block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View panel by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Pick from starter content when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__clientSideMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],
5
- "mappings": ";AAIA,SAAS,UAAU;AACnB,SAAS,wBAAwB;AACjC,SAAS,WAAW,mBAAmB;AACvC,SAAS,eAAe;AACxB;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS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AA,cACN,aAAY;AAAA,cACZ,MAAO;AAAA,gBACN;AAAA,cACD;AAAA,cACA,OAAQ,GAAI,uBAAwB;AAAA;AAAA,UACrC,GACD;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,OAAQ,GAAI,yBAA0B;AAAA,cACtC,aAAc;AAAA,gBACb;AAAA,cACD;AAAA,cAEA,8BAAC,mBAAgB;AAAA;AAAA,UAClB;AAAA,WACD;AAAA,MAEF;AAAA,MACA,OAAO,+BAA+B;AAAA,QACrC,MAAM;AAAA,QACN,UAAU,GAAI,OAAQ;AAAA,QACtB,SACC,gCACC;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,SAAU;AAAA,YACtB,aAAc;AAAA,cACb;AAAA,YACD;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,OAAM;AAAA,kBACN,aAAY;AAAA,kBACZ,MAAO;AAAA,oBACN;AAAA,kBACD;AAAA,kBACA,OAAQ,GAAI,wBAAyB;AAAA;AAAA,cACtC;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACA,OAAM;AAAA,kBACN,aAAY;AAAA,kBACZ,MAAO;AAAA,oBACN;AAAA,kBACD;AAAA,kBACA,OAAQ,GAAI,eAAgB;AAAA;AAAA,cAC7B;AAAA;AAAA;AAAA,QACD,GACD;AAAA,MAEF;AAAA,IACD,EAAE,OAAQ,OAAQ;AAAA,IACnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,SAAO,oBAAC,wBAAqB,UAAsB;AACpD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from '../block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View panel by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Pick from starter content when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n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7
7
  }
@@ -5,15 +5,15 @@ import { store as uploadStore } from "@wordpress/upload-media";
5
5
  import { store as editorStore } from "../../store/index.mjs";
6
6
  var LOCK_NAME = "upload-in-progress";
7
7
  function useUploadSaveLock() {
8
- const isClientSideMediaProcessingEnabled = window.__clientSideMediaProcessing;
8
+ const isExperimentEnabled = window.__experimentalMediaProcessing;
9
9
  const isUploading = useSelect(
10
10
  (select) => {
11
- if (!isClientSideMediaProcessingEnabled) {
11
+ if (!isExperimentEnabled) {
12
12
  return false;
13
13
  }
14
14
  return select(uploadStore).isUploading();
15
15
  },
16
- [isClientSideMediaProcessingEnabled]
16
+ [isExperimentEnabled]
17
17
  );
18
18
  const {
19
19
  lockPostSaving,
@@ -22,7 +22,7 @@ function useUploadSaveLock() {
22
22
  unlockPostAutosaving
23
23
  } = useDispatch(editorStore);
24
24
  useEffect(() => {
25
- if (!isClientSideMediaProcessingEnabled) {
25
+ if (!isExperimentEnabled) {
26
26
  return;
27
27
  }
28
28
  if (isUploading) {
@@ -37,7 +37,7 @@ function useUploadSaveLock() {
37
37
  unlockPostAutosaving(LOCK_NAME);
38
38
  };
39
39
  }, [
40
- isClientSideMediaProcessingEnabled,
40
+ isExperimentEnabled,
41
41
  isUploading,
42
42
  lockPostSaving,
43
43
  unlockPostSaving,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/provider/use-upload-save-lock.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as uploadStore } from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst LOCK_NAME = 'upload-in-progress';\n\n/**\n * A hook that locks post saving and autosaving while media uploads are in progress.\n * This prevents users from publishing or saving while files are still uploading.\n *\n * Only active when client-side media processing is enabled.\n */\nexport default function useUploadSaveLock() {\n\tconst isClientSideMediaProcessingEnabled =\n\t\twindow.__clientSideMediaProcessing;\n\n\tconst isUploading = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isClientSideMediaProcessingEnabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn select( uploadStore ).isUploading();\n\t\t},\n\t\t[ isClientSideMediaProcessingEnabled ]\n\t);\n\n\tconst {\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t} = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isClientSideMediaProcessingEnabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isUploading ) {\n\t\t\tlockPostSaving( LOCK_NAME );\n\t\t\tlockPostAutosaving( LOCK_NAME );\n\t\t} else {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t};\n\t}, [\n\t\tisClientSideMediaProcessingEnabled,\n\t\tisUploading,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t] );\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,mBAAmB;AAKrC,SAAS,SAAS,mBAAmB;AAErC,IAAM,YAAY;AAQH,SAAR,oBAAqC;AAC3C,QAAM,qCACL,OAAO;AAER,QAAM,cAAc;AAAA,IACnB,CAAE,WAAY;AACb,UAAK,CAAE,oCAAqC;AAC3C,eAAO;AAAA,MACR;AACA,aAAO,OAAQ,WAAY,EAAE,YAAY;AAAA,IAC1C;AAAA,IACA,CAAE,kCAAmC;AAAA,EACtC;AAEA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,YAAa,WAAY;AAE7B,YAAW,MAAM;AAChB,QAAK,CAAE,oCAAqC;AAC3C;AAAA,IACD;AAEA,QAAK,aAAc;AAClB,qBAAgB,SAAU;AAC1B,yBAAoB,SAAU;AAAA,IAC/B,OAAO;AACN,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAEA,WAAO,MAAM;AACZ,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as uploadStore } from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst LOCK_NAME = 'upload-in-progress';\n\n/**\n * A hook that locks post saving and autosaving while media uploads are in progress.\n * This prevents users from publishing or saving while files are still uploading.\n *\n * Only active when the experimental media processing feature is enabled.\n */\nexport default function useUploadSaveLock() {\n\tconst isExperimentEnabled = window.__experimentalMediaProcessing;\n\n\tconst isUploading = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isExperimentEnabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn select( uploadStore ).isUploading();\n\t\t},\n\t\t[ isExperimentEnabled ]\n\t);\n\n\tconst {\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t} = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isExperimentEnabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isUploading ) {\n\t\t\tlockPostSaving( LOCK_NAME );\n\t\t\tlockPostAutosaving( LOCK_NAME );\n\t\t} else {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunlockPostSaving( LOCK_NAME );\n\t\t\tunlockPostAutosaving( LOCK_NAME );\n\t\t};\n\t}, [\n\t\tisExperimentEnabled,\n\t\tisUploading,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t] );\n}\n"],
5
+ "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,mBAAmB;AAKrC,SAAS,SAAS,mBAAmB;AAErC,IAAM,YAAY;AAQH,SAAR,oBAAqC;AAC3C,QAAM,sBAAsB,OAAO;AAEnC,QAAM,cAAc;AAAA,IACnB,CAAE,WAAY;AACb,UAAK,CAAE,qBAAsB;AAC5B,eAAO;AAAA,MACR;AACA,aAAO,OAAQ,WAAY,EAAE,YAAY;AAAA,IAC1C;AAAA,IACA,CAAE,mBAAoB;AAAA,EACvB;AAEA,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,YAAa,WAAY;AAE7B,YAAW,MAAM;AAChB,QAAK,CAAE,qBAAsB;AAC5B;AAAA,IACD;AAEA,QAAK,aAAc;AAClB,qBAAgB,SAAU;AAC1B,yBAAoB,SAAU;AAAA,IAC/B,OAAO;AACN,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAEA,WAAO,MAAM;AACZ,uBAAkB,SAAU;AAC5B,2BAAsB,SAAU;AAAA,IACjC;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": []
7
7
  }
@@ -31,18 +31,12 @@ function mediaUpload({
31
31
  const currentPost = getCurrentPost();
32
32
  const currentPostId = typeof currentPost?.id === "number" ? currentPost.id : currentPost?.wp_id;
33
33
  const setSaveLock = () => {
34
- if (window.__clientSideMediaProcessing) {
35
- return;
36
- }
37
34
  lockPostSaving(lockKey);
38
35
  lockPostAutosaving(lockKey);
39
36
  imageIsUploading = true;
40
37
  };
41
38
  const postData = currentPostId ? { post: currentPostId } : {};
42
39
  const clearSaveLock = () => {
43
- if (window.__clientSideMediaProcessing) {
44
- return;
45
- }
46
40
  unlockPostSaving(lockKey);
47
41
  unlockPostAutosaving(lockKey);
48
42
  imageIsUploading = false;
@@ -51,7 +45,7 @@ function mediaUpload({
51
45
  allowedTypes,
52
46
  filesList,
53
47
  onFileChange: (file) => {
54
- if (!window.__clientSideMediaProcessing) {
48
+ if (!window.__experimentalMediaProcessing) {
55
49
  if (!imageIsUploading) {
56
50
  setSaveLock();
57
51
  } else {
@@ -78,7 +72,7 @@ function mediaUpload({
78
72
  },
79
73
  maxUploadFileSize,
80
74
  onError: ({ message }) => {
81
- if (!window.__clientSideMediaProcessing) {
75
+ if (!window.__experimentalMediaProcessing) {
82
76
  clearSaveLock();
83
77
  }
84
78
  onError(message);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/media-upload/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tlet imageIsUploading = false;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst setSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t\timageIsUploading = true;\n\t};\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\tconst clearSaveLock = () => {\n\t\tif ( window.__clientSideMediaProcessing ) {\n\t\t\treturn; // Skip - handled by useUploadSaveLock in editor provider\n\t\t}\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t\timageIsUploading = false;\n\t};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( file ) => {\n\t\t\t// When client-side media processing is enabled, save locking\n\t\t\t// is handled by useUploadSaveLock in the editor provider.\n\t\t\tif ( ! window.__clientSideMediaProcessing ) {\n\t\t\t\tif ( ! imageIsUploading ) {\n\t\t\t\t\tsetSaveLock();\n\t\t\t\t} else {\n\t\t\t\t\tclearSaveLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tonFileChange?.( file );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called a second time with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = file.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\n\t\t\tif ( ! window.__clientSideMediaProcessing ) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t\tonError( message );\n\t\t},\n\t\twpAllowedMimeTypes,\n\t\tmultiple,\n\t} );\n}\n"],
5
- "mappings": ";AAGA,SAAS,MAAM,YAAY;AAK3B,SAAS,QAAQ,gBAAgB;AACjC,SAAS,SAAS,qBAAqB;AACvC,SAAS,mBAAmB;AAK5B,SAAS,SAAS,mBAAmB;AAErC,IAAM,OAAO,MAAM;AAAC;AAgBL,SAAR,YAA8B;AAAA,EACpC,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,WAAW;AACZ,GAAI;AACH,QAAM,EAAE,qBAAqB,IAAI,SAAU,aAAc;AACzD,QAAM,EAAE,gBAAgB,kBAAkB,IAAI,OAAQ,WAAY;AAClE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,SAAU,WAAY;AAE1B,QA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n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { select, dispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around uploadMedia() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $0.onSuccess Function called after the final representation of the file is available.\n * @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n\tonSuccess,\n\tmultiple = true,\n} ) {\n\tconst { receiveEntityRecords } = dispatch( coreDataStore );\n\tconst { getCurrentPost, getEditorSettings } = select( editorStore );\n\tconst {\n\t\tlockPostAutosaving,\n\t\tunlockPostAutosaving,\n\t\tlockPostSaving,\n\t\tunlockPostSaving,\n\t} = dispatch( editorStore );\n\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tconst lockKey = `image-upload-${ uuid() }`;\n\tlet imageIsUploading = false;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\tconst currentPost = getCurrentPost();\n\t// Templates and template parts' numerical ID is stored in `wp_id`.\n\tconst currentPostId =\n\t\ttypeof currentPost?.id === 'number'\n\t\t\t? currentPost.id\n\t\t\t: currentPost?.wp_id;\n\tconst setSaveLock = () => {\n\t\tlockPostSaving( lockKey );\n\t\tlockPostAutosaving( lockKey );\n\t\timageIsUploading = true;\n\t};\n\n\tconst postData = currentPostId ? { post: currentPostId } : {};\n\tconst clearSaveLock = () => {\n\t\tunlockPostSaving( lockKey );\n\t\tunlockPostAutosaving( lockKey );\n\t\timageIsUploading = false;\n\t};\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange: ( file ) => {\n\t\t\t// When client-side media processing is enabled, save locking\n\t\t\t// is handled by useUploadSaveLock in the editor provider.\n\t\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t\tif ( ! imageIsUploading ) {\n\t\t\t\t\tsetSaveLock();\n\t\t\t\t} else {\n\t\t\t\t\tclearSaveLock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tonFileChange?.( file );\n\n\t\t\t// Files are initially received by `onFileChange` as a blob.\n\t\t\t// After that the function is called a second time with the file as an entity.\n\t\t\t// For core-data, we only care about receiving/invalidating entities.\n\t\t\tconst entityFiles = file.filter( ( _file ) => _file?.id );\n\t\t\tif ( entityFiles?.length ) {\n\t\t\t\tconst invalidateCache = true;\n\t\t\t\treceiveEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tentityFiles,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinvalidateCache\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\tonSuccess,\n\t\tadditionalData: {\n\t\t\t...postData,\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => {\n\t\t\tif ( ! window.__experimentalMediaProcessing ) {\n\t\t\t\tclearSaveLock();\n\t\t\t}\n\t\t\tonError( message );\n\t\t},\n\t\twpAllowedMimeTypes,\n\t\tmultiple,\n\t} );\n}\n"],
5
+ "mappings": ";AAGA,SAAS,MAAM,YAAY;AAK3B,SAAS,QAAQ,gBAAgB;AACjC,SAAS,SAAS,qBAAqB;AACvC,SAAS,mBAAmB;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A,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,MACf,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS,CAAE,EAAE,QAAQ,MAAO;AAC3B,UAAK,CAAE,OAAO,+BAAgC;AAC7C,sBAAc;AAAA,MACf;AACA,cAAS,OAAQ;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": []
7
7
  }
@@ -3097,11 +3097,11 @@ div.dataviews-view-list {
3097
3097
  }
3098
3098
 
3099
3099
  .dataviews-view-table thead th:has(.dataviews-view-table-header-button):first-child {
3100
- padding-right: 16px;
3100
+ padding-right: 40px;
3101
3101
  }
3102
3102
 
3103
3103
  .dataviews-view-table thead th:has(.dataviews-view-table-header-button):last-child {
3104
- padding-left: 16px;
3104
+ padding-left: 40px;
3105
3105
  }
3106
3106
 
3107
3107
  .dataviews-view-table tbody td {
@@ -3229,7 +3229,7 @@ div.dataviews-view-list {
3229
3229
  }
3230
3230
 
3231
3231
  /* Column width intents via colgroup: make non-primary columns shrink-to-fit */
3232
- .dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data):not(.dataviews-view-table__col-expand) {
3232
+ .dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data) {
3233
3233
  width: 1%;
3234
3234
  }
3235
3235
 
@@ -3100,11 +3100,11 @@ div.dataviews-view-list {
3100
3100
  }
3101
3101
 
3102
3102
  .dataviews-view-table thead th:has(.dataviews-view-table-header-button):first-child {
3103
- padding-left: 16px;
3103
+ padding-left: 40px;
3104
3104
  }
3105
3105
 
3106
3106
  .dataviews-view-table thead th:has(.dataviews-view-table-header-button):last-child {
3107
- padding-right: 16px;
3107
+ padding-right: 40px;
3108
3108
  }
3109
3109
 
3110
3110
  .dataviews-view-table tbody td {
@@ -3232,7 +3232,7 @@ div.dataviews-view-list {
3232
3232
  }
3233
3233
 
3234
3234
  /* Column width intents via colgroup: make non-primary columns shrink-to-fit */
3235
- .dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data):not(.dataviews-view-table__col-expand) {
3235
+ .dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data) {
3236
3236
  width: 1%;
3237
3237
  }
3238
3238
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":";;;;;;;;wJAsDG,CAAH;4BAEI,CAAC;;;;;;6BAOC,CAAC;yBAI2C,CAAC;+BAGhD,CAAD;0BAEY,CAAC,2DAKZ,CAAD;0BACE,CAAC;iCAEF,CAAD;iCAI0B,CAAC;wCAEjB,CAAC;2BAEO,CAAC;kCAKU,CAAC;;;;;;;wJAef,CAAC;4BAMF,CAAC;;;;;;6BAQ+B,CAAC;yBAGzC,CAAC;+BAGJ,CAAC;0BAEQ,CAAA,2DACc,CAAC;0BACd,CAAC;iCAIW,CAAC;iCACZ,CAAC;wCACoB,CAAC;2BAEpC,CAAF;kCAG8B,CAAC;;;;;AAxH/B,uEAkQC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":";;;;;;;;wJAsDG,CAAH;4BAEI,CAAC;;;;;;6BAOC,CAAC;yBAI2C,CAAC;+BAGhD,CAAD;0BAEY,CAAC,2DAKZ,CAAD;0BACE,CAAC;iCAEF,CAAD;iCAI0B,CAAC;wCAEjB,CAAC;2BAEO,CAAC;kCAKU,CAAC;;;;;;;wJAef,CAAC;4BAMF,CAAC;;;;;;6BAQ+B,CAAC;yBAGzC,CAAC;+BAGJ,CAAC;0BAEQ,CAAA,2DACc,CAAC;0BACd,CAAC;iCAIW,CAAC;iCACZ,CAAC;wCACoB,CAAC;2BAEpC,CAAF;kCAG8B,CAAC;;;;;AAxH/B,uEAoQC"}
@@ -2,7 +2,7 @@
2
2
  * A hook that locks post saving and autosaving while media uploads are in progress.
3
3
  * This prevents users from publishing or saving while files are still uploading.
4
4
  *
5
- * Only active when client-side media processing is enabled.
5
+ * Only active when the experimental media processing feature is enabled.
6
6
  */
7
7
  export default function useUploadSaveLock(): void;
8
8
  //# sourceMappingURL=use-upload-save-lock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload-save-lock.d.ts","sourceRoot":"","sources":["../../../src/components/provider/use-upload-save-lock.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,kDA8CC"}
1
+ {"version":3,"file":"use-upload-save-lock.d.ts","sourceRoot":"","sources":["../../../src/components/provider/use-upload-save-lock.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,kDA6CC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/media-upload/index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;GAaG;AACH,iJATG;IAAqB,cAAc,EAA1B,MAAM,OAAA;IACM,YAAY,EAAzB,MAAM;IACO,SAAS;IACT,iBAAiB,EAA7B,MAAM,OAAA;IACM,OAAO;IACP,YAAY;IACZ,SAAS;IACT,QAAQ,EAArB,OAAO;CACjB,QA+FA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/media-upload/index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;GAaG;AACH,iJATG;IAAqB,cAAc,EAA1B,MAAM,OAAA;IACM,YAAY,EAAzB,MAAM;IACO,SAAS;IACT,iBAAiB,EAA7B,MAAM,OAAA;IACM,OAAO;IACP,YAAY;IACZ,SAAS;IACT,QAAQ,EAArB,OAAO;CACjB,QAyFA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.40.1-next.v.202602200903.0+06edfb869",
3
+ "version": "14.40.1",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -61,48 +61,48 @@
61
61
  ],
62
62
  "dependencies": {
63
63
  "@floating-ui/react-dom": "2.0.8",
64
- "@wordpress/a11y": "^4.40.1-next.v.202602200903.0+06edfb869",
65
- "@wordpress/api-fetch": "^7.40.1-next.v.202602200903.0+06edfb869",
66
- "@wordpress/base-styles": "^6.16.1-next.v.202602200903.0+06edfb869",
67
- "@wordpress/blob": "^4.40.1-next.v.202602200903.0+06edfb869",
68
- "@wordpress/block-editor": "^15.13.1-next.v.202602200903.0+06edfb869",
69
- "@wordpress/block-serialization-default-parser": "^5.40.1-next.v.202602200903.0+06edfb869",
70
- "@wordpress/blocks": "^15.13.1-next.v.202602200903.0+06edfb869",
71
- "@wordpress/commands": "^1.40.1-next.v.202602200903.0+06edfb869",
72
- "@wordpress/components": "^32.2.2-next.v.202602200903.0+06edfb869",
73
- "@wordpress/compose": "^7.40.1-next.v.202602200903.0+06edfb869",
74
- "@wordpress/core-data": "^7.40.1-next.v.202602200903.0+06edfb869",
75
- "@wordpress/data": "^10.40.1-next.v.202602200903.0+06edfb869",
76
- "@wordpress/dataviews": "^12.1.1-next.v.202602200903.0+06edfb869",
77
- "@wordpress/date": "^5.40.1-next.v.202602200903.0+06edfb869",
78
- "@wordpress/deprecated": "^4.40.1-next.v.202602200903.0+06edfb869",
79
- "@wordpress/dom": "^4.40.1-next.v.202602200903.0+06edfb869",
80
- "@wordpress/element": "^6.40.1-next.v.202602200903.0+06edfb869",
81
- "@wordpress/fields": "^0.32.1-next.v.202602200903.0+06edfb869",
82
- "@wordpress/global-styles-engine": "^1.7.1-next.v.202602200903.0+06edfb869",
83
- "@wordpress/global-styles-ui": "^1.7.1-next.v.202602200903.0+06edfb869",
84
- "@wordpress/hooks": "^4.40.1-next.v.202602200903.0+06edfb869",
85
- "@wordpress/html-entities": "^4.40.1-next.v.202602200903.0+06edfb869",
86
- "@wordpress/i18n": "^6.13.1-next.v.202602200903.0+06edfb869",
87
- "@wordpress/icons": "^11.7.1-next.v.202602200903.0+06edfb869",
88
- "@wordpress/interface": "^9.25.1-next.v.202602200903.0+06edfb869",
89
- "@wordpress/keyboard-shortcuts": "^5.40.1-next.v.202602200903.0+06edfb869",
90
- "@wordpress/keycodes": "^4.40.1-next.v.202602200903.0+06edfb869",
91
- "@wordpress/media-editor": "^0.3.1-next.v.202602200903.0+06edfb869",
92
- "@wordpress/media-fields": "^0.5.1-next.v.202602200903.0+06edfb869",
93
- "@wordpress/media-utils": "^5.40.1-next.v.202602200903.0+06edfb869",
94
- "@wordpress/notices": "^5.40.1-next.v.202602200903.0+06edfb869",
95
- "@wordpress/patterns": "^2.40.1-next.v.202602200903.0+06edfb869",
96
- "@wordpress/plugins": "^7.40.1-next.v.202602200903.0+06edfb869",
97
- "@wordpress/preferences": "^4.40.1-next.v.202602200903.0+06edfb869",
98
- "@wordpress/private-apis": "^1.40.1-next.v.202602200903.0+06edfb869",
99
- "@wordpress/reusable-blocks": "^5.40.1-next.v.202602200903.0+06edfb869",
100
- "@wordpress/rich-text": "^7.40.1-next.v.202602200903.0+06edfb869",
101
- "@wordpress/server-side-render": "^6.16.1-next.v.202602200903.0+06edfb869",
102
- "@wordpress/upload-media": "^0.25.1-next.v.202602200903.0+06edfb869",
103
- "@wordpress/url": "^4.40.1-next.v.202602200903.0+06edfb869",
104
- "@wordpress/warning": "^3.40.1-next.v.202602200903.0+06edfb869",
105
- "@wordpress/wordcount": "^4.40.1-next.v.202602200903.0+06edfb869",
64
+ "@wordpress/a11y": "^4.40.0",
65
+ "@wordpress/api-fetch": "^7.40.0",
66
+ "@wordpress/base-styles": "^6.16.0",
67
+ "@wordpress/blob": "^4.40.0",
68
+ "@wordpress/block-editor": "^15.13.1",
69
+ "@wordpress/block-serialization-default-parser": "^5.40.0",
70
+ "@wordpress/blocks": "^15.13.0",
71
+ "@wordpress/commands": "^1.40.0",
72
+ "@wordpress/components": "^32.2.0",
73
+ "@wordpress/compose": "^7.40.0",
74
+ "@wordpress/core-data": "^7.40.1",
75
+ "@wordpress/data": "^10.40.0",
76
+ "@wordpress/dataviews": "^12.0.0",
77
+ "@wordpress/date": "^5.40.0",
78
+ "@wordpress/deprecated": "^4.40.0",
79
+ "@wordpress/dom": "^4.40.0",
80
+ "@wordpress/element": "^6.40.0",
81
+ "@wordpress/fields": "^0.32.1",
82
+ "@wordpress/global-styles-engine": "^1.7.0",
83
+ "@wordpress/global-styles-ui": "^1.7.1",
84
+ "@wordpress/hooks": "^4.40.0",
85
+ "@wordpress/html-entities": "^4.40.0",
86
+ "@wordpress/i18n": "^6.13.0",
87
+ "@wordpress/icons": "^11.7.0",
88
+ "@wordpress/interface": "^9.25.0",
89
+ "@wordpress/keyboard-shortcuts": "^5.40.0",
90
+ "@wordpress/keycodes": "^4.40.0",
91
+ "@wordpress/media-editor": "^0.3.0",
92
+ "@wordpress/media-fields": "^0.5.1",
93
+ "@wordpress/media-utils": "^5.40.1",
94
+ "@wordpress/notices": "^5.40.0",
95
+ "@wordpress/patterns": "^2.40.1",
96
+ "@wordpress/plugins": "^7.40.0",
97
+ "@wordpress/preferences": "^4.40.0",
98
+ "@wordpress/private-apis": "^1.40.0",
99
+ "@wordpress/reusable-blocks": "^5.40.1",
100
+ "@wordpress/rich-text": "^7.40.0",
101
+ "@wordpress/server-side-render": "^6.16.0",
102
+ "@wordpress/upload-media": "^0.25.1",
103
+ "@wordpress/url": "^4.40.0",
104
+ "@wordpress/warning": "^3.40.0",
105
+ "@wordpress/wordcount": "^4.40.0",
106
106
  "change-case": "^4.1.2",
107
107
  "client-zip": "^2.4.5",
108
108
  "clsx": "^2.1.1",
@@ -124,5 +124,5 @@
124
124
  "publishConfig": {
125
125
  "access": "public"
126
126
  },
127
- "gitHead": "6e225a6505fdc8e407305851c7a68b781dee8118"
127
+ "gitHead": "398c509dbbdcdb525d17e968edd83da33a0a7bde"
128
128
  }
@@ -152,8 +152,10 @@ function PostLockedModal() {
152
152
  }
153
153
 
154
154
  // Avoid sending the modal if sync is supported, but retain functionality around locks etc.
155
- if ( isCollaborationEnabled ) {
156
- return null;
155
+ if ( globalThis.IS_GUTENBERG_PLUGIN ) {
156
+ if ( isCollaborationEnabled ) {
157
+ return null;
158
+ }
157
159
  }
158
160
 
159
161
  const userDisplayName = user.name;
@@ -298,7 +298,7 @@ function PreferencesModalContents( { extraSections = {} } ) {
298
298
  </>
299
299
  ),
300
300
  },
301
- window.__clientSideMediaProcessing && {
301
+ window.__experimentalMediaProcessing && {
302
302
  name: 'media',
303
303
  tabLabel: __( 'Media' ),
304
304
  content: (
@@ -16,20 +16,19 @@ const LOCK_NAME = 'upload-in-progress';
16
16
  * A hook that locks post saving and autosaving while media uploads are in progress.
17
17
  * This prevents users from publishing or saving while files are still uploading.
18
18
  *
19
- * Only active when client-side media processing is enabled.
19
+ * Only active when the experimental media processing feature is enabled.
20
20
  */
21
21
  export default function useUploadSaveLock() {
22
- const isClientSideMediaProcessingEnabled =
23
- window.__clientSideMediaProcessing;
22
+ const isExperimentEnabled = window.__experimentalMediaProcessing;
24
23
 
25
24
  const isUploading = useSelect(
26
25
  ( select ) => {
27
- if ( ! isClientSideMediaProcessingEnabled ) {
26
+ if ( ! isExperimentEnabled ) {
28
27
  return false;
29
28
  }
30
29
  return select( uploadStore ).isUploading();
31
30
  },
32
- [ isClientSideMediaProcessingEnabled ]
31
+ [ isExperimentEnabled ]
33
32
  );
34
33
 
35
34
  const {
@@ -40,7 +39,7 @@ export default function useUploadSaveLock() {
40
39
  } = useDispatch( editorStore );
41
40
 
42
41
  useEffect( () => {
43
- if ( ! isClientSideMediaProcessingEnabled ) {
42
+ if ( ! isExperimentEnabled ) {
44
43
  return;
45
44
  }
46
45
 
@@ -57,7 +56,7 @@ export default function useUploadSaveLock() {
57
56
  unlockPostAutosaving( LOCK_NAME );
58
57
  };
59
58
  }, [
60
- isClientSideMediaProcessingEnabled,
59
+ isExperimentEnabled,
61
60
  isUploading,
62
61
  lockPostSaving,
63
62
  unlockPostSaving,
@@ -62,9 +62,6 @@ export default function mediaUpload( {
62
62
  ? currentPost.id
63
63
  : currentPost?.wp_id;
64
64
  const setSaveLock = () => {
65
- if ( window.__clientSideMediaProcessing ) {
66
- return; // Skip - handled by useUploadSaveLock in editor provider
67
- }
68
65
  lockPostSaving( lockKey );
69
66
  lockPostAutosaving( lockKey );
70
67
  imageIsUploading = true;
@@ -72,9 +69,6 @@ export default function mediaUpload( {
72
69
 
73
70
  const postData = currentPostId ? { post: currentPostId } : {};
74
71
  const clearSaveLock = () => {
75
- if ( window.__clientSideMediaProcessing ) {
76
- return; // Skip - handled by useUploadSaveLock in editor provider
77
- }
78
72
  unlockPostSaving( lockKey );
79
73
  unlockPostAutosaving( lockKey );
80
74
  imageIsUploading = false;
@@ -86,7 +80,7 @@ export default function mediaUpload( {
86
80
  onFileChange: ( file ) => {
87
81
  // When client-side media processing is enabled, save locking
88
82
  // is handled by useUploadSaveLock in the editor provider.
89
- if ( ! window.__clientSideMediaProcessing ) {
83
+ if ( ! window.__experimentalMediaProcessing ) {
90
84
  if ( ! imageIsUploading ) {
91
85
  setSaveLock();
92
86
  } else {
@@ -117,7 +111,7 @@ export default function mediaUpload( {
117
111
  },
118
112
  maxUploadFileSize,
119
113
  onError: ( { message } ) => {
120
- if ( ! window.__clientSideMediaProcessing ) {
114
+ if ( ! window.__experimentalMediaProcessing ) {
121
115
  clearSaveLock();
122
116
  }
123
117
  onError( message );