@wordpress/edit-post 7.29.0 → 7.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -58
  3. package/build/components/editor-initialization/index.js +3 -6
  4. package/build/components/editor-initialization/index.js.map +1 -1
  5. package/build/components/editor-initialization/listener-hooks.js +6 -10
  6. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  7. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  8. package/build/components/header/index.js +18 -11
  9. package/build/components/header/index.js.map +1 -1
  10. package/build/components/header/more-menu/index.js +10 -2
  11. package/build/components/header/more-menu/index.js.map +1 -1
  12. package/build/components/init-pattern-modal/index.js +99 -0
  13. package/build/components/init-pattern-modal/index.js.map +1 -0
  14. package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
  15. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  16. package/build/components/layout/index.js +2 -1
  17. package/build/components/layout/index.js.map +1 -1
  18. package/build/components/sidebar/post-status/index.js +3 -1
  19. package/build/components/sidebar/post-status/index.js.map +1 -1
  20. package/build/components/sidebar/settings-sidebar/index.js +1 -2
  21. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  22. package/build/editor.js +1 -15
  23. package/build/editor.js.map +1 -1
  24. package/build/editor.native.js +2 -2
  25. package/build/editor.native.js.map +1 -1
  26. package/build/index.js +1 -2
  27. package/build/index.js.map +1 -1
  28. package/build/store/selectors.js +1 -1
  29. package/build/store/selectors.js.map +1 -1
  30. package/build-module/components/editor-initialization/index.js +3 -6
  31. package/build-module/components/editor-initialization/index.js.map +1 -1
  32. package/build-module/components/editor-initialization/listener-hooks.js +6 -10
  33. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  34. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  35. package/build-module/components/header/index.js +19 -12
  36. package/build-module/components/header/index.js.map +1 -1
  37. package/build-module/components/header/more-menu/index.js +12 -4
  38. package/build-module/components/header/more-menu/index.js.map +1 -1
  39. package/build-module/components/init-pattern-modal/index.js +93 -0
  40. package/build-module/components/init-pattern-modal/index.js.map +1 -0
  41. package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
  42. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  43. package/build-module/components/layout/index.js +3 -2
  44. package/build-module/components/layout/index.js.map +1 -1
  45. package/build-module/components/sidebar/post-status/index.js +4 -2
  46. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  47. package/build-module/components/sidebar/settings-sidebar/index.js +2 -3
  48. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  49. package/build-module/editor.js +1 -15
  50. package/build-module/editor.js.map +1 -1
  51. package/build-module/editor.native.js +3 -3
  52. package/build-module/editor.native.js.map +1 -1
  53. package/build-module/index.js +2 -2
  54. package/build-module/index.js.map +1 -1
  55. package/build-module/store/selectors.js +1 -1
  56. package/build-module/store/selectors.js.map +1 -1
  57. package/build-style/classic-rtl.css +1 -0
  58. package/build-style/classic.css +1 -0
  59. package/build-style/style-rtl.css +5 -32
  60. package/build-style/style.css +5 -32
  61. package/package.json +32 -32
  62. package/src/components/editor-initialization/index.js +3 -4
  63. package/src/components/editor-initialization/listener-hooks.js +20 -22
  64. package/src/components/editor-initialization/test/listener-hooks.js +8 -8
  65. package/src/components/header/header-toolbar/index.native.js +1 -1
  66. package/src/components/header/index.js +31 -28
  67. package/src/components/header/more-menu/index.js +13 -9
  68. package/src/components/header/style.scss +4 -0
  69. package/src/components/header/test/index.js +4 -14
  70. package/src/components/init-pattern-modal/index.js +117 -0
  71. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  72. package/src/components/layout/index.js +2 -2
  73. package/src/components/sidebar/plugin-post-publish-panel/test/index.js +1 -1
  74. package/src/components/sidebar/post-status/index.js +2 -0
  75. package/src/components/sidebar/settings-sidebar/index.js +1 -3
  76. package/src/editor.js +1 -12
  77. package/src/editor.native.js +8 -2
  78. package/src/index.js +2 -1
  79. package/src/store/selectors.js +1 -1
  80. package/build/components/sidebar/plugin-document-setting-panel/index.js +0 -126
  81. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +0 -1
  82. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +0 -118
  83. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +0 -1
  84. package/src/components/sidebar/plugin-document-setting-panel/index.js +0 -125
@@ -1 +1 @@
1
- {"version":3,"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","store","editorStore","parse","serialize","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","isRTL","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","type","status","meta","createElement","style","flex","useSubRegistry","select","getEditorMode","dispatch"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { EditorProvider, store as editorStore } from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,QAAQ;AAC3B,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,cAAc,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxE,SAASC,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACpD,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,wBAAwB,EACxBC,qCAAqC,QAC/B,gCAAgC;AACvC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AAExC,MAAMC,MAAM,SAASd,SAAS,CAAC;EAC9Be,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAE,GAAGC,SAAU,CAAC;;IAErB;IACA;IACA,MAAM;MAAEC,sBAAsB,GAAG;IAAK,CAAC,GAAGF,KAAK;IAC/CG,MAAM,CAACC,EAAE,CAACC,qBAAqB,GAAGH,sBAAsB;IAExD,IAAKF,KAAK,CAACM,sBAAsB,IAAIN,KAAK,CAACO,IAAI,KAAK,QAAQ,EAAG;MAC9D;MACA,IAAI,C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AAU,CAAI0D,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAc,CAAC,GAAGD,MAAM,CAAE9D,WAAY,CAAC;EAE/C,OAAO;IACNoB,IAAI,EAAE2C,aAAa,CAAC;EACrB,CAAC;AACF,CAAE,CAAC,EACH5D,YAAY,CAAI6D,QAAQ,IAAM;EAC7B,MAAM;IAAE3C;EAAiB,CAAC,GAAG2C,QAAQ,CAAEhE,WAAY,CAAC;EACpD,MAAM;IAAE6B;EAAiB,CAAC,GAAGmC,QAAQ,CAAEvD,SAAU,CAAC;EAClD,OAAO;IACNY,gBAAgB;IAChBQ;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAElB,MAAO,CAAC"}
1
+ {"version":3,"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","ErrorBoundary","store","editorStore","parse","serialize","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","isRTL","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","type","status","meta","createElement","style","flex","useSubRegistry","select","getEditorMode","dispatch"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,QAAQ;AAC3B,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SACCC,cAAc,EACdC,aAAa,EACbC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACpD,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,wBAAwB,EACxBC,qCAAqC,QAC/B,gCAAgC;AACvC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AAExC,MAAMC,MAAM,SAASf,SAAS,CAAC;EAC9BgB,WAAWA,CAAEC,KAAK,EAAG;IACpB,KA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,cAAgB;MAC3BF,IAAI,EAAGG,cAAgB;MACvBJ,YAAY,EAAGA,YAAc;MAC7BgB,cAAc,EAAG,KAAO;MAAA,GACnBhD;IAAK,GAEV6C,aAAA,CAAC5D,aAAa,QACb4D,aAAA,CAAChD,MAAM;MAACc,WAAW,EAAG,IAAI,CAACA;IAAa,CAAE,CAC5B,CACA,CACC,CACK,CAAC;EAE3B;AACD;AAEA,eAAenB,OAAO,CAAE,CACvBD,UAAU,CAAI0D,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAc,CAAC,GAAGD,MAAM,CAAE9D,WAAY,CAAC;EAE/C,OAAO;IACNoB,IAAI,EAAE2C,aAAa,CAAC;EACrB,CAAC;AACF,CAAE,CAAC,EACH5D,YAAY,CAAI6D,QAAQ,IAAM;EAC7B,MAAM;IAAE3C;EAAiB,CAAC,GAAG2C,QAAQ,CAAEhE,WAAY,CAAC;EACpD,MAAM;IAAE6B;EAAiB,CAAC,GAAGmC,QAAQ,CAAEvD,SAAU,CAAC;EAClD,OAAO;IACNY,gBAAgB;IAChBQ;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAElB,MAAO,CAAC"}
@@ -9,7 +9,7 @@ import { createRoot } from '@wordpress/element';
9
9
  import { dispatch, select } from '@wordpress/data';
10
10
  import { store as preferencesStore } from '@wordpress/preferences';
11
11
  import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
12
- import { privateApis as editorPrivateApis, store as editorStore } from '@wordpress/editor';
12
+ import { PluginDocumentSettingPanel, privateApis as editorPrivateApis, store as editorStore } from '@wordpress/editor';
13
13
 
14
14
  /**
15
15
  * Internal dependencies
@@ -130,7 +130,7 @@ export function reinitializeEditor() {
130
130
  });
131
131
  }
132
132
  export { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';
133
- export { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';
133
+ export { PluginDocumentSettingPanel };
134
134
  export { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';
135
135
  export { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';
136
136
  export { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","privateApis","editorPrivateApis","editorStore","Editor","unlock","PluginPostExcerpt","__experimentalPluginPostExcerpt","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","isPublishSidebarEnabled","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","reapplyBlockTypeFilters","get","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD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IG,kBAAkB,QAAQ,2CAA2C;AACzF,SAASH,OAAO,IAAII,sBAAsB,QAAQ,gDAAgD;AAClG,SAASJ,OAAO,IAAIK,oBAAoB,QAAQ,8CAA8C;AAC9F,SAASL,OAAO,IAAIM,qBAAqB,QAAQ,+CAA+C;AAChG,SAASN,OAAO,IAAIO,aAAa,QAAQ,qCAAqC;AAC9E,SAASP,OAAO,IAAIQ,yBAAyB,QAAQ,mDAAmD;AACxG,SAASR,OAAO,IAAIS,iCAAiC,QAAQ,2CAA2C;AACxG,SAAST,OAAO,IAAIU,iCAAiC,QAAQ,2CAA2C;AACxG,SAASvE,+BAA+B;AACxC,SAASjB,KAAK,QAAQ,SAAS"}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","PluginDocumentSettingPanel","privateApis","editorPrivateApis","editorStore","Editor","unlock","PluginPostExcerpt","__experimentalPluginPostExcerpt","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","isPublishSidebarEnabled","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","reapplyBlockTypeFilters","get","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginDocumentSettingPanel,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { PluginDocumentSettingPanel };\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,4CAA4C,QACtC,0BAA0B;AACjC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,iBAAiB;AAClD,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,0BAA0B,EAC1BC,WAAW,IAAIC,iBAAiB,EAChCb,KAAK,IAAIc,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAO,SAAS;AAChB,OAAO,WAAW;AAClB,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,eAAe;AAEtC,MAAM;EAAEC,iBAAiB,EAAEC;AAAgC,CAAC,GAC3DF,MAAM,CAAEH,iBAAkB,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,gBAAgBA,CAC/BC,EAAE,EACFC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACX;EACD,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAC1E,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEX,EAAG,CAAC;EAC5C,MAAMY,IAAI,GAAG3B,UAAU,CAAEwB,MAAO,CAAC;EAEjCvB,QAAQ,CAAEE,gBAAiB,CAAC,CAACy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,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,SAAS4C,kBAAkBA,CAAA,EAAG;EACpCxE,UAAU,CAAE,gCAAgC,EAAE;IAC7CyE,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,2BAA2B,QAAQ,kEAAkE;AACzH,SAASrE,0BAA0B;AACnC,SAASoE,OAAO,IAAIE,kBAAkB,QAAQ,2CAA2C;AACzF,SAASF,OAAO,IAAIG,sBAAsB,QAAQ,gDAAgD;AAClG,SAASH,OAAO,IAAII,oBAAoB,QAAQ,8CAA8C;AAC9F,SAASJ,OAAO,IAAIK,qBAAqB,QAAQ,+CAA+C;AAChG,SAASL,OAAO,IAAIM,aAAa,QAAQ,qCAAqC;AAC9E,SAASN,OAAO,IAAIO,yBAAyB,QAAQ,mDAAmD;AACxG,SAASP,OAAO,IAAIQ,iCAAiC,QAAQ,2CAA2C;AACxG,SAASR,OAAO,IAAIS,iCAAiC,QAAQ,2CAA2C;AACxG,SAAStE,+BAA+B;AACxC,SAASlB,KAAK,QAAQ,SAAS"}
@@ -461,7 +461,7 @@ export const isEditingTemplate = createRegistrySelector(select => () => {
461
461
  since: '6.5',
462
462
  alternative: `select( 'core/editor' ).getRenderingMode`
463
463
  });
464
- return select(editorStore).getCurrentPostType() !== 'post-only';
464
+ return select(editorStore).getCurrentPostType() === 'wp_template';
465
465
  });
466
466
 
467
467
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","deprecated","unlock","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","slugToCheck","type","defaultTemplateId","getDefaultTemplateId"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\tstate,\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() !== 'post-only';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( post.slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page'\n\t\t\t\t\t? `${ post.type }-${ post.slug }`\n\t\t\t\t\t: `single-${ post.type }-${ post.slug }`;\n\t\t} else {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page' ? 'page' : `single-${ post.type }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\tdefaultTemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;AAC9D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;AACzD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGV,sBAAsB,CAChDW,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAER,gBAAiB,CAAC,CAACU,GAAG,CAAE,MAAM,EAAE,YAAa,CAA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AAM,CAAEP,SAAU,CAAC,CAAC6F,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbK,iBACD,CAAC;AACF,CACD,CAAC"}
1
+ {"version":3,"names":["createSelector","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","deprecated","unlock","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","slugToCheck","type","defaultTemplateId","getDefaultTemplateId"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\tstate,\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( post.slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page'\n\t\t\t\t\t? `${ post.type }-${ post.slug }`\n\t\t\t\t\t: `single-${ post.type }-${ post.slug }`;\n\t\t} else {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page' ? 'page' : `single-${ post.type }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\tdefaultTemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;AAC9D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,SAAS,QAAQ,s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,GACVF,IAAI,CAACG,IAAI,KAAK,MAAM,GAChB,GAAGH,IAAI,CAACG,IAAM,IAAIH,IAAI,CAACF,IAAM,EAAC,GAC9B,UAAUE,IAAI,CAACG,IAAM,IAAIH,IAAI,CAACF,IAAM,EAAC;EAC3C,CAAC,MAAM;IACNI,WAAW,GACVF,IAAI,CAACG,IAAI,KAAK,MAAM,GAAG,MAAM,GAAI,UAAUH,IAAI,CAACG,IAAM,EAAC;EACzD;EACA,MAAMC,iBAAiB,GAAG3F,MAAM,CAAEP,SAAU,CAAC,CAACmG,oBAAoB,CAAE;IACnEP,IAAI,EAAEI;EACP,CAAE,CAAC;EACH,OAAOzF,MAAM,CAAEP,SAAU,CAAC,CAAC6F,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbK,iBACD,CAAC;AACF,CACD,CAAC"}
@@ -96,6 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
+ --wp-bound-block-color: #9747ff;
99
100
  }
100
101
  @media (min-resolution: 192dpi) {
101
102
  :root {
@@ -96,6 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
+ --wp-bound-block-color: #9747ff;
99
100
  }
100
101
  @media (min-resolution: 192dpi) {
101
102
  :root {
@@ -96,6 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
+ --wp-bound-block-color: #9747ff;
99
100
  }
100
101
  @media (min-resolution: 192dpi) {
101
102
  :root {
@@ -438,38 +439,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
438
439
  }
439
440
  }
440
441
 
441
- .interface-more-menu-dropdown {
442
- margin-right: -4px;
443
- }
444
- .interface-more-menu-dropdown .components-button {
445
- width: auto;
446
- padding: 0 2px;
447
- }
448
- @media (min-width: 600px) {
449
- .interface-more-menu-dropdown {
450
- margin-right: 0;
451
- }
452
- .interface-more-menu-dropdown .components-button {
453
- padding: 0 4px;
454
- }
455
- }
456
-
457
- .interface-more-menu-dropdown__content .components-popover__content {
458
- min-width: 300px;
459
- }
460
- @media (min-width: 480px) {
461
- .interface-more-menu-dropdown__content .components-popover__content {
462
- max-width: 480px;
463
- }
464
- }
465
- .interface-more-menu-dropdown__content .components-popover__content .components-dropdown-menu__menu {
466
- padding: 0;
467
- }
468
-
469
- .components-popover.interface-more-menu-dropdown__content {
470
- z-index: 99998;
471
- }
472
-
473
442
  .interface-pinned-items {
474
443
  display: flex;
475
444
  gap: 8px;
@@ -779,6 +748,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
779
748
  z-index: 35;
780
749
  }
781
750
 
751
+ .components-popover.more-menu-dropdown__content {
752
+ z-index: 99998;
753
+ }
754
+
782
755
  .edit-post-fullscreen-mode-close.components-button {
783
756
  display: none;
784
757
  }
@@ -96,6 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
+ --wp-bound-block-color: #9747ff;
99
100
  }
100
101
  @media (min-resolution: 192dpi) {
101
102
  :root {
@@ -438,38 +439,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
438
439
  }
439
440
  }
440
441
 
441
- .interface-more-menu-dropdown {
442
- margin-left: -4px;
443
- }
444
- .interface-more-menu-dropdown .components-button {
445
- width: auto;
446
- padding: 0 2px;
447
- }
448
- @media (min-width: 600px) {
449
- .interface-more-menu-dropdown {
450
- margin-left: 0;
451
- }
452
- .interface-more-menu-dropdown .components-button {
453
- padding: 0 4px;
454
- }
455
- }
456
-
457
- .interface-more-menu-dropdown__content .components-popover__content {
458
- min-width: 300px;
459
- }
460
- @media (min-width: 480px) {
461
- .interface-more-menu-dropdown__content .components-popover__content {
462
- max-width: 480px;
463
- }
464
- }
465
- .interface-more-menu-dropdown__content .components-popover__content .components-dropdown-menu__menu {
466
- padding: 0;
467
- }
468
-
469
- .components-popover.interface-more-menu-dropdown__content {
470
- z-index: 99998;
471
- }
472
-
473
442
  .interface-pinned-items {
474
443
  display: flex;
475
444
  gap: 8px;
@@ -779,6 +748,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
779
748
  z-index: 35;
780
749
  }
781
750
 
751
+ .components-popover.more-menu-dropdown__content {
752
+ z-index: 99998;
753
+ }
754
+
782
755
  .edit-post-fullscreen-mode-close.components-button {
783
756
  display: none;
784
757
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "7.29.0",
3
+ "version": "7.31.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,36 +27,36 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.52.0",
31
- "@wordpress/api-fetch": "^6.49.0",
32
- "@wordpress/block-editor": "^12.20.0",
33
- "@wordpress/block-library": "^8.29.0",
34
- "@wordpress/blocks": "^12.29.0",
35
- "@wordpress/commands": "^0.23.0",
36
- "@wordpress/components": "^27.0.0",
37
- "@wordpress/compose": "^6.29.0",
38
- "@wordpress/core-commands": "^0.21.0",
39
- "@wordpress/core-data": "^6.29.0",
40
- "@wordpress/data": "^9.22.0",
41
- "@wordpress/deprecated": "^3.52.0",
42
- "@wordpress/dom": "^3.52.0",
43
- "@wordpress/editor": "^13.29.0",
44
- "@wordpress/element": "^5.29.0",
45
- "@wordpress/hooks": "^3.52.0",
46
- "@wordpress/i18n": "^4.52.0",
47
- "@wordpress/icons": "^9.43.0",
48
- "@wordpress/interface": "^5.29.0",
49
- "@wordpress/keyboard-shortcuts": "^4.29.0",
50
- "@wordpress/keycodes": "^3.52.0",
51
- "@wordpress/media-utils": "^4.43.0",
52
- "@wordpress/notices": "^4.20.0",
53
- "@wordpress/plugins": "^6.20.0",
54
- "@wordpress/preferences": "^3.29.0",
55
- "@wordpress/private-apis": "^0.34.0",
56
- "@wordpress/url": "^3.53.0",
57
- "@wordpress/viewport": "^5.29.0",
58
- "@wordpress/warning": "^2.52.0",
59
- "@wordpress/widgets": "^3.29.0",
30
+ "@wordpress/a11y": "^3.54.0",
31
+ "@wordpress/api-fetch": "^6.51.0",
32
+ "@wordpress/block-editor": "^12.22.0",
33
+ "@wordpress/block-library": "^8.31.0",
34
+ "@wordpress/blocks": "^12.31.0",
35
+ "@wordpress/commands": "^0.25.0",
36
+ "@wordpress/components": "^27.2.0",
37
+ "@wordpress/compose": "^6.31.0",
38
+ "@wordpress/core-commands": "^0.23.0",
39
+ "@wordpress/core-data": "^6.31.0",
40
+ "@wordpress/data": "^9.24.0",
41
+ "@wordpress/deprecated": "^3.54.0",
42
+ "@wordpress/dom": "^3.54.0",
43
+ "@wordpress/editor": "^13.31.0",
44
+ "@wordpress/element": "^5.31.0",
45
+ "@wordpress/hooks": "^3.54.0",
46
+ "@wordpress/i18n": "^4.54.0",
47
+ "@wordpress/icons": "^9.45.0",
48
+ "@wordpress/interface": "^5.31.0",
49
+ "@wordpress/keyboard-shortcuts": "^4.31.0",
50
+ "@wordpress/keycodes": "^3.54.0",
51
+ "@wordpress/media-utils": "^4.45.0",
52
+ "@wordpress/notices": "^4.22.0",
53
+ "@wordpress/plugins": "^6.22.0",
54
+ "@wordpress/preferences": "^3.31.0",
55
+ "@wordpress/private-apis": "^0.36.0",
56
+ "@wordpress/url": "^3.55.0",
57
+ "@wordpress/viewport": "^5.31.0",
58
+ "@wordpress/warning": "^2.54.0",
59
+ "@wordpress/widgets": "^3.31.0",
60
60
  "classnames": "^2.3.1",
61
61
  "memize": "^2.1.0",
62
62
  "rememo": "^4.0.2"
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "c139588f4c668b38bafbc5431f2f4e3903dbe683"
71
+ "gitHead": "ffc07735d0abfb3f69e91d48f25b7fe8d1ef92d2"
72
72
  }
@@ -10,11 +10,10 @@ import {
10
10
  * Data component used for initializing the editor and re-initializes
11
11
  * when postId changes or on unmount.
12
12
  *
13
- * @param {number} postId The id of the post.
14
13
  * @return {null} This is a data component so does not render any ui.
15
14
  */
16
- export default function EditorInitialization( { postId } ) {
17
- useBlockSelectionListener( postId );
18
- useUpdatePostLinkListener( postId );
15
+ export default function EditorInitialization() {
16
+ useBlockSelectionListener();
17
+ useUpdatePostLinkListener();
19
18
  return null;
20
19
  }
@@ -19,24 +19,19 @@ import {
19
19
  /**
20
20
  * This listener hook monitors for block selection and triggers the appropriate
21
21
  * sidebar state.
22
- *
23
- * @param {number} postId The current post id.
24
22
  */
25
- export const useBlockSelectionListener = ( postId ) => {
23
+ export const useBlockSelectionListener = () => {
26
24
  const { hasBlockSelection, isEditorSidebarOpened, isDistractionFree } =
27
- useSelect(
28
- ( select ) => {
29
- const { get } = select( preferencesStore );
30
- return {
31
- hasBlockSelection:
32
- !! select( blockEditorStore ).getBlockSelectionStart(),
33
- isEditorSidebarOpened:
34
- select( STORE_NAME ).isEditorSidebarOpened(),
35
- isDistractionFree: get( 'core', 'distractionFree' ),
36
- };
37
- },
38
- [ postId ]
39
- );
25
+ useSelect( ( select ) => {
26
+ const { get } = select( preferencesStore );
27
+ return {
28
+ hasBlockSelection:
29
+ !! select( blockEditorStore ).getBlockSelectionStart(),
30
+ isEditorSidebarOpened:
31
+ select( STORE_NAME ).isEditorSidebarOpened(),
32
+ isDistractionFree: get( 'core', 'distractionFree' ),
33
+ };
34
+ }, [] );
40
35
 
41
36
  const { openGeneralSidebar } = useDispatch( STORE_NAME );
42
37
 
@@ -49,21 +44,24 @@ export const useBlockSelectionListener = ( postId ) => {
49
44
  } else {
50
45
  openGeneralSidebar( 'edit-post/document' );
51
46
  }
52
- }, [ hasBlockSelection, isEditorSidebarOpened ] );
47
+ }, [
48
+ hasBlockSelection,
49
+ isDistractionFree,
50
+ isEditorSidebarOpened,
51
+ openGeneralSidebar,
52
+ ] );
53
53
  };
54
54
 
55
55
  /**
56
56
  * This listener hook monitors any change in permalink and updates the view
57
57
  * post link in the admin bar.
58
- *
59
- * @param {number} postId
60
58
  */
61
- export const useUpdatePostLinkListener = ( postId ) => {
59
+ export const useUpdatePostLinkListener = () => {
62
60
  const { newPermalink } = useSelect(
63
61
  ( select ) => ( {
64
62
  newPermalink: select( editorStore ).getCurrentPost().link,
65
63
  } ),
66
- [ postId ]
64
+ []
67
65
  );
68
66
  const nodeToUpdate = useRef();
69
67
 
@@ -71,7 +69,7 @@ export const useUpdatePostLinkListener = ( postId ) => {
71
69
  nodeToUpdate.current =
72
70
  document.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||
73
71
  document.querySelector( VIEW_AS_LINK_SELECTOR );
74
- }, [ postId ] );
72
+ }, [] );
75
73
 
76
74
  useEffect( () => {
77
75
  if ( ! newPermalink || ! nodeToUpdate.current ) {