@wordpress/block-editor 12.3.4 → 12.3.5

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 (58) hide show
  1. package/README.md +4 -0
  2. package/build/components/block-edit/edit.js +25 -13
  3. package/build/components/block-edit/edit.js.map +1 -1
  4. package/build/components/block-parent-selector/index.js +8 -5
  5. package/build/components/block-parent-selector/index.js.map +1 -1
  6. package/build/components/block-removal-warning-modal/index.js +4 -1
  7. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  8. package/build/components/block-tools/block-contextual-toolbar.js +7 -11
  9. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  10. package/build/components/index.js +10 -1
  11. package/build/components/index.js.map +1 -1
  12. package/build/components/inserter/reusable-block-rename-hint.js +62 -0
  13. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -0
  14. package/build/components/inserter/reusable-blocks-tab.js +5 -1
  15. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  16. package/build/components/list-view/use-list-view-client-ids.js +2 -2
  17. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  18. package/build/store/private-selectors.js +5 -6
  19. package/build/store/private-selectors.js.map +1 -1
  20. package/build/store/selectors.js +6 -4
  21. package/build/store/selectors.js.map +1 -1
  22. package/build-module/components/block-edit/edit.js +27 -10
  23. package/build-module/components/block-edit/edit.js.map +1 -1
  24. package/build-module/components/block-parent-selector/index.js +7 -5
  25. package/build-module/components/block-parent-selector/index.js.map +1 -1
  26. package/build-module/components/block-removal-warning-modal/index.js +4 -1
  27. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  28. package/build-module/components/block-tools/block-contextual-toolbar.js +8 -11
  29. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  30. package/build-module/components/index.js +5 -0
  31. package/build-module/components/index.js.map +1 -1
  32. package/build-module/components/inserter/reusable-block-rename-hint.js +48 -0
  33. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -0
  34. package/build-module/components/inserter/reusable-blocks-tab.js +4 -1
  35. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  36. package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
  37. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  38. package/build-module/store/private-selectors.js +3 -3
  39. package/build-module/store/private-selectors.js.map +1 -1
  40. package/build-module/store/selectors.js +6 -4
  41. package/build-module/store/selectors.js.map +1 -1
  42. package/build-style/style-rtl.css +71 -20
  43. package/build-style/style.css +71 -20
  44. package/package.json +9 -9
  45. package/src/components/block-edit/edit.js +26 -9
  46. package/src/components/block-edit/test/edit.js +1 -1
  47. package/src/components/block-parent-selector/index.js +13 -8
  48. package/src/components/block-removal-warning-modal/index.js +3 -0
  49. package/src/components/block-tools/block-contextual-toolbar.js +5 -11
  50. package/src/components/block-tools/style.scss +69 -26
  51. package/src/components/index.js +5 -0
  52. package/src/components/inserter/reusable-block-rename-hint.js +52 -0
  53. package/src/components/inserter/reusable-blocks-tab.js +4 -0
  54. package/src/components/inserter/style.scss +28 -0
  55. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  56. package/src/store/private-selectors.js +3 -6
  57. package/src/store/selectors.js +9 -6
  58. package/src/store/test/private-selectors.js +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"names":["createSelector","select","store","blocksStore","getBlockRootClientId","getTemplateLock","getBlockName","getBlockOrder","getBlockParents","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockEditingMode","clientId","blockEditingModes","has","get","rootClientId","templateLock","name","isContent","__experimentalHasContentRoleAttribute","parentMode","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","mode","undefined","every","blocks","parents","getListViewClientIdsTree","flatMap","innerBlocks","order","settings","blockListSettings","getEnabledBlockParents","ascending","filter","parent","getRemovalPromptData","removalPromptData","isRemovalPromptSupported"],"mappings":"AAAA;AACA;AACA;A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AACCA,QAAAA,QADD;AAECoB,QAAAA,WAAW,EAAEF,wBAAwB,CACpCvB,KADoC,EAEpCK,QAFoC;AAFtC,OADM,CAAP;AASA;;AACD,WAAOkB,wBAAwB,CAAEvB,KAAF,EAASK,QAAT,CAA/B;AACA,GAbM,CAAP;AAcA,CAhBoD,EAiBnDL,KAAF,IAAa,CACZA,KAAK,CAACqB,MAAN,CAAaK,KADD,EAEZ1B,KAAK,CAACM,iBAFM,EAGZN,KAAK,CAAC2B,QAAN,CAAejB,YAHH,EAIZV,KAAK,CAAC4B,iBAJM,CAjBwC,CAA/C;AAyBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,sBAAsB,GAAGvC,cAAc,CACnD,CAAEU,KAAF,EAASK,QAAT,EAAmByB,SAAS,GAAG,KAA/B,KAA0C;AACzC,SAAOhC,eAAe,CAAEE,KAAF,EAASK,QAAT,EAAmByB,SAAnB,CAAf,CAA8CC,MAA9C,CACJC,MAAF,IAAc5B,mBAAmB,CAAEJ,KAAF,EAASgC,MAAT,CAAnB,KAAyC,UADjD,CAAP;AAGA,CALkD,EAMjDhC,KAAF,IAAa,CACZA,KAAK,CAACqB,MAAN,CAAaC,OADD,EAEZtB,KAAK,CAACM,iBAFM,EAGZN,KAAK,CAAC2B,QAAN,CAAejB,YAHH,EAIZV,KAAK,CAAC4B,iBAJM,CANsC,CAA7C;AAcP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASK,oBAAT,CAA+BjC,KAA/B,EAAuC;AAC7C,SAAOA,KAAK,CAACkC,iBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,wBAAT,CAAmCnC,KAAnC,EAA2C;AACjD,SAAOA,KAAK,CAACmC,wBAAb;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { select } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockRootClientId,\n\tgetTemplateLock,\n\tgetBlockName,\n\tgetBlockOrder,\n\tgetBlockParents,\n} from './selectors';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Returns the block editing mode for a given block.\n *\n * The mode can be one of three options:\n *\n * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be\n * selected.\n * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the\n * toolbar, the block movers, block settings.\n * - `'default'`: Allows editing the block as normal.\n *\n * Blocks can set a mode using the `useBlockEditingMode` hook.\n *\n * The mode is inherited by all of the block's inner blocks, unless they have\n * their own mode.\n *\n * A template lock can also set a mode. If the template lock is `'contentOnly'`,\n * the block's mode is overridden to `'contentOnly'` if the block has a content\n * role attribute, or `'disabled'` otherwise.\n *\n * @see useBlockEditingMode\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n */\nexport function getBlockEditingMode( state, clientId = '' ) {\n\tif ( state.blockEditingModes.has( clientId ) ) {\n\t\treturn state.blockEditingModes.get( clientId );\n\t}\n\tif ( ! clientId ) {\n\t\treturn 'default';\n\t}\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\tif ( templateLock === 'contentOnly' ) {\n\t\tconst name = getBlockName( state, clientId );\n\t\t// TODO: Terrible hack! We're calling the global select() function\n\t\t// here instead of using createRegistrySelector(). The problem with\n\t\t// using createRegistrySelector() is that then the public\n\t\t// block-editor selectors (e.g. canInsertBlockTypeUnmemoized) can't\n\t\t// call this private block-editor selector due to a bug in\n\t\t// @wordpress/data. See\n\t\t// https://github.com/WordPress/gutenberg/pull/50985.\n\t\tconst isContent =\n\t\t\tselect( blocksStore ).__experimentalHasContentRoleAttribute( name );\n\t\treturn isContent ? 'contentOnly' : 'disabled';\n\t}\n\tconst parentMode = getBlockEditingMode( state, rootClientId );\n\treturn parentMode === 'contentOnly' ? 'default' : parentMode;\n}\n\n/**\n * Returns true if the block with the given client ID and all of its descendants\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block and its descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = createSelector(\n\t( state, clientId ) => {\n\t\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\t\tconst mode = state.blockEditingModes.get( childClientId );\n\t\t\treturn (\n\t\t\t\t( mode === undefined || mode === 'disabled' ) &&\n\t\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\t\tisChildSubtreeDisabled\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, clientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, clientId ).every( isChildSubtreeDisabled )\n\t\t);\n\t},\n\t( state ) => [ state.blockEditingModes, state.blocks.parents ]\n);\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getListViewClientIdsTree = createSelector(\n\t( state, rootClientId = '' ) => {\n\t\treturn getBlockOrder( state, rootClientId ).flatMap( ( clientId ) => {\n\t\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tinnerBlocks: getListViewClientIdsTree(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tclientId\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn getListViewClientIdsTree( state, clientId );\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function isRemovalPromptSupported( state ) {\n\treturn state.isRemovalPromptSupported;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"names":["createSelector","select","store","blocksStore","getBlockRootClientId","getTemplateLock","getBlockName","getBlockOrder","getBlockParents","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockEditingMode","clientId","blockEditingModes","has","get","rootClientId","templateLock","name","isContent","__experimentalHasContentRoleAttribute","parentMode","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","mode","undefined","every","blocks","parents","getEnabledClientIdsTree","flatMap","innerBlocks","order","settings","blockListSettings","getEnabledBlockParents","ascending","filter","parent","getRemovalPromptData","removalPromptData","isRemovalPromptSupported"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,SACCC,oBADD,EAECC,eAFD,EAGCC,YAHD,EAICC,aAJD,EAKCC,eALD,QAMO,aANP;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,sBAAT,CAAiCC,KAAjC,EAAyC;AAC/C,SAAOA,KAAK,CAACD,sBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,8BAAT,CAAyCD,KAAzC,EAAiD;AACvD,SAAOA,KAAK,EAAEE,iBAAP,EAA0BC,SAAjC;AACA;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,mBAAT,CAA8BJ,KAA9B,EAAqCK,QAAQ,GAAG,EAAhD,EAAqD;AAC3D,MAAKL,KAAK,CAACM,iBAAN,CAAwBC,GAAxB,CAA6BF,QAA7B,CAAL,EAA+C;AAC9C,WAAOL,KAAK,CAACM,iBAAN,CAAwBE,GAAxB,CAA6BH,QAA7B,CAAP;AACA;;AACD,MAAK,CAAEA,QAAP,EAAkB;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A;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASK,oBAAT,CAA+BjC,KAA/B,EAAuC;AAC7C,SAAOA,KAAK,CAACkC,iBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,wBAAT,CAAmCnC,KAAnC,EAA2C;AACjD,SAAOA,KAAK,CAACmC,wBAAb;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { select } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockRootClientId,\n\tgetTemplateLock,\n\tgetBlockName,\n\tgetBlockOrder,\n\tgetBlockParents,\n} from './selectors';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Returns the block editing mode for a given block.\n *\n * The mode can be one of three options:\n *\n * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be\n * selected.\n * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the\n * toolbar, the block movers, block settings.\n * - `'default'`: Allows editing the block as normal.\n *\n * Blocks can set a mode using the `useBlockEditingMode` hook.\n *\n * The mode is inherited by all of the block's inner blocks, unless they have\n * their own mode.\n *\n * A template lock can also set a mode. If the template lock is `'contentOnly'`,\n * the block's mode is overridden to `'contentOnly'` if the block has a content\n * role attribute, or `'disabled'` otherwise.\n *\n * @see useBlockEditingMode\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n */\nexport function getBlockEditingMode( state, clientId = '' ) {\n\tif ( state.blockEditingModes.has( clientId ) ) {\n\t\treturn state.blockEditingModes.get( clientId );\n\t}\n\tif ( ! clientId ) {\n\t\treturn 'default';\n\t}\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\tif ( templateLock === 'contentOnly' ) {\n\t\tconst name = getBlockName( state, clientId );\n\t\t// TODO: Terrible hack! We're calling the global select() function\n\t\t// here instead of using createRegistrySelector(). The problem with\n\t\t// using createRegistrySelector() is that then the public\n\t\t// block-editor selectors (e.g. canInsertBlockTypeUnmemoized) can't\n\t\t// call this private block-editor selector due to a bug in\n\t\t// @wordpress/data. See\n\t\t// https://github.com/WordPress/gutenberg/pull/50985.\n\t\tconst isContent =\n\t\t\tselect( blocksStore ).__experimentalHasContentRoleAttribute( name );\n\t\treturn isContent ? 'contentOnly' : 'disabled';\n\t}\n\tconst parentMode = getBlockEditingMode( state, rootClientId );\n\treturn parentMode === 'contentOnly' ? 'default' : parentMode;\n}\n\n/**\n * Returns true if the block with the given client ID and all of its descendants\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block and its descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = createSelector(\n\t( state, clientId ) => {\n\t\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\t\tconst mode = state.blockEditingModes.get( childClientId );\n\t\t\treturn (\n\t\t\t\t( mode === undefined || mode === 'disabled' ) &&\n\t\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\t\tisChildSubtreeDisabled\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, clientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, clientId ).every( isChildSubtreeDisabled )\n\t\t);\n\t},\n\t( state ) => [ state.blockEditingModes, state.blocks.parents ]\n);\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\t( state, rootClientId = '' ) => {\n\t\treturn getBlockOrder( state, rootClientId ).flatMap( ( clientId ) => {\n\t\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tinnerBlocks: getEnabledClientIdsTree( state, clientId ),\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn getEnabledClientIdsTree( state, clientId );\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function isRemovalPromptSupported( state ) {\n\treturn state.isRemovalPromptSupported;\n}\n"]}
@@ -1847,9 +1847,11 @@ export const getInserterItems = createSelector((state, rootClientId = null) => {
1847
1847
  };
1848
1848
  };
1849
1849
 
1850
- const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).filter(reusableBlock => // Filter to either fully synced patterns (sync_status === 'fully'),
1851
- // or old school reusable blocks (sync_status === '').
1852
- reusableBlock.meta?.sync_status === 'fully' || reusableBlock.meta?.sync_status === '' || !reusableBlock.meta?.sync_status).map(buildReusableBlockInserterItem) : [];
1850
+ const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? getReusableBlocks(state).filter(reusableBlock => // Reusable blocks that are fully synced should have no sync status set
1851
+ // for backwards compat between patterns and old reusable blocks, but
1852
+ // some in release 16.1 may have had sync status inadvertantly set to
1853
+ // 'fully' if created in the site editor.
1854
+ reusableBlock.wp_pattern_sync_status === 'fully' || reusableBlock.wp_pattern_sync_status === '' || !reusableBlock.wp_pattern_sync_status).map(buildReusableBlockInserterItem) : [];
1853
1855
  const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
1854
1856
  buildScope: 'inserter'
1855
1857
  });
@@ -2043,7 +2045,7 @@ function getUnsyncedPatterns(state) {
2043
2045
  var _state$settings$__exp;
2044
2046
 
2045
2047
  const reusableBlocks = (_state$settings$__exp = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY;
2046
- return reusableBlocks.filter(reusableBlock => reusableBlock.meta?.sync_status === 'unsynced').map(reusableBlock => {
2048
+ return reusableBlocks.filter(reusableBlock => reusableBlock.wp_pattern_sync_status === 'unsynced').map(reusableBlock => {
2047
2049
  return {
2048
2050
  name: `core/block/${reusableBlock.id}`,
2049
2051
  title: reusableBlock.title.raw,