@wordpress/editor 11.0.2 → 12.0.3

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 (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/build/components/autosave-monitor/index.js +5 -0
  4. package/build/components/autosave-monitor/index.js.map +1 -1
  5. package/build/components/character-count/index.js +1 -1
  6. package/build/components/character-count/index.js.map +1 -1
  7. package/build/components/editor-help/help-get-support-button.native.js +46 -0
  8. package/build/components/editor-help/help-get-support-button.native.js.map +1 -0
  9. package/build/components/editor-help/index.native.js +24 -5
  10. package/build/components/editor-help/index.native.js.map +1 -1
  11. package/build/components/entities-saved-states/entity-type-list.js +22 -13
  12. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +23 -4
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
  16. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  17. package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
  18. package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
  19. package/build/components/post-format/index.js +3 -1
  20. package/build/components/post-format/index.js.map +1 -1
  21. package/build/components/post-locked-modal/index.js +1 -1
  22. package/build/components/post-locked-modal/index.js.map +1 -1
  23. package/build/components/post-saved-state/index.js +37 -46
  24. package/build/components/post-saved-state/index.js.map +1 -1
  25. package/build/components/post-taxonomies/flat-term-selector.js +154 -211
  26. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  27. package/build/components/post-title/index.js +5 -3
  28. package/build/components/post-title/index.js.map +1 -1
  29. package/build/components/provider/index.native.js +3 -1
  30. package/build/components/provider/index.native.js.map +1 -1
  31. package/build/components/provider/use-block-editor-settings.js +32 -5
  32. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  33. package/build/components/word-count/index.js +1 -1
  34. package/build/components/word-count/index.js.map +1 -1
  35. package/build/store/actions.js +0 -25
  36. package/build/store/actions.js.map +1 -1
  37. package/build/store/selectors.js +3 -84
  38. package/build/store/selectors.js.map +1 -1
  39. package/build/store/utils/notice-builder.js +15 -18
  40. package/build/store/utils/notice-builder.js.map +1 -1
  41. package/build/{store/utils → utils}/get-template-part-icon.js +1 -1
  42. package/build/utils/get-template-part-icon.js.map +1 -0
  43. package/build/utils/index.js +8 -0
  44. package/build/utils/index.js.map +1 -1
  45. package/build-module/components/autosave-monitor/index.js +5 -0
  46. package/build-module/components/autosave-monitor/index.js.map +1 -1
  47. package/build-module/components/character-count/index.js +1 -1
  48. package/build-module/components/character-count/index.js.map +1 -1
  49. package/build-module/components/editor-help/help-get-support-button.native.js +34 -0
  50. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -0
  51. package/build-module/components/editor-help/index.native.js +22 -6
  52. package/build-module/components/editor-help/index.native.js.map +1 -1
  53. package/build-module/components/entities-saved-states/entity-type-list.js +24 -13
  54. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  55. package/build-module/components/entities-saved-states/index.js +23 -4
  56. package/build-module/components/entities-saved-states/index.js.map +1 -1
  57. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
  58. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  59. package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
  60. package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
  61. package/build-module/components/post-format/index.js +4 -2
  62. package/build-module/components/post-format/index.js.map +1 -1
  63. package/build-module/components/post-locked-modal/index.js +1 -1
  64. package/build-module/components/post-locked-modal/index.js.map +1 -1
  65. package/build-module/components/post-saved-state/index.js +38 -46
  66. package/build-module/components/post-saved-state/index.js.map +1 -1
  67. package/build-module/components/post-taxonomies/flat-term-selector.js +156 -214
  68. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  69. package/build-module/components/post-title/index.js +5 -3
  70. package/build-module/components/post-title/index.js.map +1 -1
  71. package/build-module/components/provider/index.native.js +3 -1
  72. package/build-module/components/provider/index.native.js.map +1 -1
  73. package/build-module/components/provider/use-block-editor-settings.js +31 -5
  74. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  75. package/build-module/components/word-count/index.js +1 -1
  76. package/build-module/components/word-count/index.js.map +1 -1
  77. package/build-module/store/actions.js +0 -23
  78. package/build-module/store/actions.js.map +1 -1
  79. package/build-module/store/selectors.js +3 -80
  80. package/build-module/store/selectors.js.map +1 -1
  81. package/build-module/store/utils/notice-builder.js +15 -18
  82. package/build-module/store/utils/notice-builder.js.map +1 -1
  83. package/build-module/{store/utils → utils}/get-template-part-icon.js +2 -2
  84. package/build-module/utils/get-template-part-icon.js.map +1 -0
  85. package/build-module/utils/index.js +1 -0
  86. package/build-module/utils/index.js.map +1 -1
  87. package/build-style/style-rtl.css +6 -1
  88. package/build-style/style.css +6 -1
  89. package/package.json +28 -28
  90. package/src/components/autosave-monitor/index.js +5 -0
  91. package/src/components/autosave-monitor/test/index.js +10 -4
  92. package/src/components/character-count/index.js +3 -2
  93. package/src/components/editor-help/help-get-support-button.native.js +38 -0
  94. package/src/components/editor-help/index.native.js +130 -80
  95. package/src/components/editor-help/style.android.scss +6 -0
  96. package/src/components/editor-help/style.ios.scss +6 -0
  97. package/src/components/editor-help/style.scss +25 -0
  98. package/src/components/editor-help/test/index.native.js +80 -0
  99. package/src/components/entities-saved-states/entity-type-list.js +29 -10
  100. package/src/components/entities-saved-states/index.js +38 -8
  101. package/src/components/global-keyboard-shortcuts/save-shortcut.js +34 -42
  102. package/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +8 -16
  103. package/src/components/post-format/index.js +6 -2
  104. package/src/components/post-format/style.scss +1 -0
  105. package/src/components/post-locked-modal/index.js +1 -1
  106. package/src/components/post-saved-state/index.js +41 -55
  107. package/src/components/post-saved-state/style.scss +10 -1
  108. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +20 -0
  109. package/src/components/post-saved-state/test/index.js +2 -2
  110. package/src/components/post-taxonomies/flat-term-selector.js +220 -254
  111. package/src/components/post-title/index.js +5 -3
  112. package/src/components/provider/index.native.js +2 -0
  113. package/src/components/provider/use-block-editor-settings.js +24 -2
  114. package/src/components/word-count/index.js +3 -2
  115. package/src/store/actions.js +0 -28
  116. package/src/store/selectors.js +2 -105
  117. package/src/store/test/actions.js +4 -2
  118. package/src/store/utils/notice-builder.js +17 -19
  119. package/src/store/utils/test/notice-builder.js +1 -1
  120. package/src/{store/utils → utils}/get-template-part-icon.js +2 -2
  121. package/src/utils/index.js +1 -0
  122. package/build/store/utils/get-template-part-icon.js.map +0 -1
  123. package/build-module/store/utils/get-template-part-icon.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","blockEditorStore","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AAeA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAmBA;;AAKA;;AA/DA;AACA;AACA;;AAGA;AACA;AACA;AAkCA,MAAMA,gBAAgB,GAAG,CACxB;AAAEC,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CADwB,EAExB;AAAED,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CAFwB,EAGxB;AAAED,EAAAA,IAAI,EAAE,YAAR;AAAsBC,EAAAA,OAAO,EAAE;AAA/B,CAHwB,EAIxB;AAAED,EAAAA,IAAI,EAAE,UAAR;AAAoBC,EAAAA,OAAO,EAAE;AAA7B,CAJwB,EAKvBC,GALuB,CAKhBC,cAAF,KAAwB;AAC9BC,EAAAA,IAAI,EAAE,UADwB;AAE9B,KAAGD,cAF2B;AAG9BE,EAAAA,cAAc,EAAE;AACfC,IAAAA,MAAM,EAAE,IADO;AAEfC,IAAAA,SAAS,EAAE;AAFI,GAHc;AAO9BC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE;AADM,GAPiB;AAU9BC,EAAAA,aAAa,EAAE,CAAE,OAAF,EAAW,SAAX,EAAsB,SAA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;AASNpB,IAAAA,oBATM;;AAUNqF,IAAAA,iCAAiC,CAAEjG,MAAF,EAAW;AAC3CwH,MAAAA,iBAAiB,CAAExH,MAAF,EAAU;AAC1B0H,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNtB,IAAAA,UAAU,CAAEb,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNY,IAAAA;AAlBM,GAAP;AAoBA,CAhCD,CA9BuB,CAAT,EA+DV9F,oBA/DU,C","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","blockEditorStore","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AAeA;;AACA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mB,EARzB;AASNnB,IAAAA,cAAc,EAAEmB,mBAAmB,CAAE,gBAAF;AAT7B,GAAP;AAWA,CA5BD,CADuB,EA8BvB,wBAAgBK,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAkCF,QAAQ,CAAE,aAAF,CAAhD;AACA,QAAM;AACLjG,IAAAA,cADK;AAELgF,IAAAA,kBAFK;AAGLnD,IAAAA,WAHK;AAILiD,IAAAA;AAJK,MAKFmB,QAAQ,CAAEF,kBAAF,CALZ;AAMA,QAAM;AAAEK,IAAAA;AAAF,MAAuBH,QAAQ,CAAE,gBAAF,CAArC;AACA,QAAM;AAAE5G,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwC2G,QAAQ,CAAE,MAAF,CAAtD;AACA,QAAM;AAAE9D,IAAAA;AAAF,MAA0B8D,QAAQ,CAAE,cAAF,CAAxC;AAEA,SAAO;AACNjG,IAAAA,cADM;AAENX,IAAAA,WAFM;AAGN2F,IAAAA,kBAHM;AAINnD,IAAAA,WAJM;AAKNM,IAAAA,mBALM;;AAMNzB,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClBuF,MAAAA,QAAQ,CAAE;AAAEvF,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUNsF,IAAAA,iCAAiC,CAAElG,MAAF,EAAW;AAC3CyH,MAAAA,iBAAiB,CAAEzH,MAAF,EAAU;AAC1B2H,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNtB,IAAAA,UAAU,CAAEb,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNY,IAAAA;AAlBM,GAAP;AAoBA,CAhCD,CA9BuB,CAAT,EA+DV/F,oBA/DU,C","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
@@ -13,6 +13,8 @@ var _data = require("@wordpress/data");
13
13
 
14
14
  var _coreData = require("@wordpress/core-data");
15
15
 
16
+ var _i18n = require("@wordpress/i18n");
17
+
16
18
  var _utils = require("../../utils");
17
19
 
18
20
  var _store = require("../../store");
@@ -41,7 +43,8 @@ function useBlockEditorSettings(settings, hasTemplate) {
41
43
  const {
42
44
  reusableBlocks,
43
45
  hasUploadPermissions,
44
- canUseUnfilteredHTML
46
+ canUseUnfilteredHTML,
47
+ userCanCreatePages
45
48
  } = (0, _data.useSelect)(select => {
46
49
  const {
47
50
  canUserUseUnfilteredHTML
@@ -62,21 +65,45 @@ function useBlockEditorSettings(settings, hasTemplate) {
62
65
  // Reusable blocks are fetched in the native version of this hook.
63
66
  hasUploadPermissions: (0, _lodash.defaultTo)(canUser('create', 'media'), true),
64
67
  hasResolvedLocalSiteData: hasFinishedResolvingSiteData,
65
- baseUrl: (siteData === null || siteData === void 0 ? void 0 : siteData.url) || ''
68
+ baseUrl: (siteData === null || siteData === void 0 ? void 0 : siteData.url) || '',
69
+ userCanCreatePages: canUser('create', 'pages')
66
70
  };
67
71
  }, []);
68
72
  const {
69
73
  undo
70
74
  } = (0, _data.useDispatch)(_store.store);
71
- return (0, _element.useMemo)(() => ({ ...(0, _lodash.pick)(settings, ['__experimentalBlockDirectory', '__experimentalBlockPatternCategories', '__experimentalBlockPatterns', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalGlobalStylesUserEntityId', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'bodyPlaceholder', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomGradients', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'focusMode', 'fontSizes', 'gradients', 'hasFixedToolbar', 'hasReducedUI', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'maxWidth', 'onUpdateDefaultBlockStyles', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock']),
75
+ const {
76
+ saveEntityRecord
77
+ } = (0, _data.useDispatch)(_coreData.store);
78
+ /**
79
+ * Creates a Post entity.
80
+ * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.
81
+ *
82
+ * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.
83
+ * @return {Object} the post type object that was created.
84
+ */
85
+
86
+ const createPageEntity = options => {
87
+ if (!userCanCreatePages) {
88
+ return Promise.reject({
89
+ message: (0, _i18n.__)('You do not have permission to create Pages.')
90
+ });
91
+ }
92
+
93
+ return saveEntityRecord('postType', 'page', options);
94
+ };
95
+
96
+ return (0, _element.useMemo)(() => ({ ...(0, _lodash.pick)(settings, ['__experimentalBlockDirectory', '__experimentalBlockPatternCategories', '__experimentalBlockPatterns', '__experimentalFeatures', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'bodyPlaceholder', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomGradients', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'focusMode', 'fontSizes', 'gradients', 'hasFixedToolbar', 'hasReducedUI', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'maxWidth', 'onUpdateDefaultBlockStyles', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock']),
72
97
  mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
73
98
  __experimentalReusableBlocks: reusableBlocks,
74
99
  __experimentalFetchLinkSuggestions: (search, searchOptions) => (0, _coreData.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
75
100
  __experimentalFetchRichUrlData: _coreData.__experimentalFetchUrlData,
76
101
  __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
77
102
  __experimentalUndo: undo,
78
- outlineMode: hasTemplate
79
- }), [settings, hasUploadPermissions, reusableBlocks, canUseUnfilteredHTML, undo, hasTemplate]);
103
+ outlineMode: hasTemplate,
104
+ __experimentalCreatePageEntity: createPageEntity,
105
+ __experimentalUserCanCreatePages: userCanCreatePages
106
+ }), [settings, hasUploadPermissions, reusableBlocks, canUseUnfilteredHTML, undo, hasTemplate, userCanCreatePages]);
80
107
  }
81
108
 
82
109
  var _default = useBlockEditorSettings;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","select","canUserUseUnfilteredHTML","editorStore","isWeb","Platform","OS","canUser","getUnstableBase","hasFinishedResolution","coreStore","siteData","hasFinishedResolvingSiteData","getEntityRecords","per_page","hasResolvedLocalSiteData","baseUrl","url","undo","mediaUpload","undefined","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AASA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAT,CAAiCC,QAAjC,EAA2CC,WAA3C,EAAyD;AACxD,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA;AAHK,MAIF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA;AAAF,QAA+BD,MAAM,CAAEE,YAAF,CAA3C;AACA,UAAMC,KAAK,GAAGC,kBAASC,EAAT,KAAgB,KAA9B;AACA,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,eAAX;AAA4BC,MAAAA;AAA5B,QAAsDR,MAAM,CACjES,eADiE,CAAlE;AAIA,UAAMC,QAAQ,GAAGH,eAAe,EAAhC;AAEA,UAAMI,4BAA4B,GAAGH,qBAAqB,CACzD,iBADyD,CAA1D;AAIA,WAAO;AACNT,MAAAA,oBAAoB,EAAEE,wBAAwB,EADxC;AAENJ,MAAAA,cAAc,EAAEM,KAAK,GAClBH,MAAM,CAAES,eAAF,CAAN,CAAoBG,gBAApB,CACA,UADA,EAEA,UAFA,EAGA;AAAEC,QAAAA,QAAQ,EAAE,CAAC;AAAb,OAHA,CADkB,GAMlB,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sBD,MAAtB,EAA8BC,aAA9B,EAA6C5B,QAA7C,CA7CM;AA8CP6B,IAAAA,8BAA8B,EAAEC,oCA9CzB;AA+CPC,IAAAA,sCAAsC,EAAE3B,oBA/CjC;AAgDP4B,IAAAA,kBAAkB,EAAEV,IAhDb;AAiDPW,IAAAA,WAAW,EAAEhC;AAjDN,GAAR,CADM,EAoDN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAICE,oBAJD,EAKCkB,IALD,EAMCrB,WAND,CApDM,CAAP;AA6DA;;eAEcF,sB","sourcesContent":["/**\n * External dependencies\n */\nimport { pick, defaultTo } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML } = select( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getUnstableBase, hasFinishedResolution } = select(\n\t\t\tcoreStore\n\t\t);\n\n\t\tconst siteData = getUnstableBase();\n\n\t\tconst hasFinishedResolvingSiteData = hasFinishedResolution(\n\t\t\t'getUnstableBase'\n\t\t);\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: [], // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: defaultTo(\n\t\t\t\tcanUser( 'create', 'media' ),\n\t\t\t\ttrue\n\t\t\t),\n\t\t\thasResolvedLocalSiteData: hasFinishedResolvingSiteData,\n\t\t\tbaseUrl: siteData?.url || '',\n\t\t};\n\t}, [] );\n\n\tconst { undo } = useDispatch( editorStore );\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...pick( settings, [\n\t\t\t\t'__experimentalBlockDirectory',\n\t\t\t\t'__experimentalBlockPatternCategories',\n\t\t\t\t'__experimentalBlockPatterns',\n\t\t\t\t'__experimentalFeatures',\n\t\t\t\t'__experimentalGlobalStylesBaseStyles',\n\t\t\t\t'__experimentalGlobalStylesUserEntityId',\n\t\t\t\t'__experimentalPreferredStyleVariations',\n\t\t\t\t'__experimentalSetIsInserterOpened',\n\t\t\t\t'__unstableGalleryWithImageBlocks',\n\t\t\t\t'alignWide',\n\t\t\t\t'allowedBlockTypes',\n\t\t\t\t'bodyPlaceholder',\n\t\t\t\t'codeEditingEnabled',\n\t\t\t\t'colors',\n\t\t\t\t'disableCustomColors',\n\t\t\t\t'disableCustomFontSizes',\n\t\t\t\t'disableCustomGradients',\n\t\t\t\t'enableCustomLineHeight',\n\t\t\t\t'enableCustomSpacing',\n\t\t\t\t'enableCustomUnits',\n\t\t\t\t'focusMode',\n\t\t\t\t'fontSizes',\n\t\t\t\t'gradients',\n\t\t\t\t'hasFixedToolbar',\n\t\t\t\t'hasReducedUI',\n\t\t\t\t'imageDefaultSize',\n\t\t\t\t'imageDimensions',\n\t\t\t\t'imageEditing',\n\t\t\t\t'imageSizes',\n\t\t\t\t'isRTL',\n\t\t\t\t'keepCaretInsideBlock',\n\t\t\t\t'maxWidth',\n\t\t\t\t'onUpdateDefaultBlockStyles',\n\t\t\t\t'styles',\n\t\t\t\t'template',\n\t\t\t\t'templateLock',\n\t\t\t\t'titlePlaceholder',\n\t\t\t\t'supportsLayout',\n\t\t\t\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t\t\t] ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","select","canUserUseUnfilteredHTML","editorStore","isWeb","Platform","OS","canUser","getUnstableBase","hasFinishedResolution","coreStore","siteData","hasFinishedResolvingSiteData","getEntityRecords","per_page","hasResolvedLocalSiteData","baseUrl","url","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","mediaUpload","undefined","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;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A6CPC,IAAAA,sCAAsC,EAAElC,oBA7CjC;AA8CPmC,IAAAA,kBAAkB,EAAEhB,IA9Cb;AA+CPiB,IAAAA,WAAW,EAAEvC,WA/CN;AAgDPwC,IAAAA,8BAA8B,EAAEhB,gBAhDzB;AAiDPiB,IAAAA,gCAAgC,EAAErC;AAjD3B,GAAR,CADM,EAoDN,CACCL,QADD,EAECG,oBAFD,EAGCD,cAHD,EAICE,oBAJD,EAKCmB,IALD,EAMCtB,WAND,EAOCI,kBAPD,CApDM,CAAP;AA8DA;;eAEcN,sB","sourcesContent":["/**\n * External dependencies\n */\nimport { pick, defaultTo } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML } = select( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getUnstableBase, hasFinishedResolution } = select(\n\t\t\tcoreStore\n\t\t);\n\n\t\tconst siteData = getUnstableBase();\n\n\t\tconst hasFinishedResolvingSiteData = hasFinishedResolution(\n\t\t\t'getUnstableBase'\n\t\t);\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: [], // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: defaultTo(\n\t\t\t\tcanUser( 'create', 'media' ),\n\t\t\t\ttrue\n\t\t\t),\n\t\t\thasResolvedLocalSiteData: hasFinishedResolvingSiteData,\n\t\t\tbaseUrl: siteData?.url || '',\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t};\n\t}, [] );\n\n\tconst { undo } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...pick( settings, [\n\t\t\t\t'__experimentalBlockDirectory',\n\t\t\t\t'__experimentalBlockPatternCategories',\n\t\t\t\t'__experimentalBlockPatterns',\n\t\t\t\t'__experimentalFeatures',\n\t\t\t\t'__experimentalPreferredStyleVariations',\n\t\t\t\t'__experimentalSetIsInserterOpened',\n\t\t\t\t'__unstableGalleryWithImageBlocks',\n\t\t\t\t'alignWide',\n\t\t\t\t'allowedBlockTypes',\n\t\t\t\t'bodyPlaceholder',\n\t\t\t\t'codeEditingEnabled',\n\t\t\t\t'colors',\n\t\t\t\t'disableCustomColors',\n\t\t\t\t'disableCustomFontSizes',\n\t\t\t\t'disableCustomGradients',\n\t\t\t\t'enableCustomLineHeight',\n\t\t\t\t'enableCustomSpacing',\n\t\t\t\t'enableCustomUnits',\n\t\t\t\t'focusMode',\n\t\t\t\t'fontSizes',\n\t\t\t\t'gradients',\n\t\t\t\t'hasFixedToolbar',\n\t\t\t\t'hasReducedUI',\n\t\t\t\t'imageDefaultSize',\n\t\t\t\t'imageDimensions',\n\t\t\t\t'imageEditing',\n\t\t\t\t'imageSizes',\n\t\t\t\t'isRTL',\n\t\t\t\t'keepCaretInsideBlock',\n\t\t\t\t'maxWidth',\n\t\t\t\t'onUpdateDefaultBlockStyles',\n\t\t\t\t'styles',\n\t\t\t\t'template',\n\t\t\t\t'templateLock',\n\t\t\t\t'titlePlaceholder',\n\t\t\t\t'supportsLayout',\n\t\t\t\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t\t\t] ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
@@ -23,7 +23,7 @@ var _store = require("../../store");
23
23
  * Internal dependencies
24
24
  */
25
25
  function WordCount() {
26
- const content = (0, _data.useSelect)(select => select(_store.store).getEditedPostAttribute('content'));
26
+ const content = (0, _data.useSelect)(select => select(_store.store).getEditedPostAttribute('content'), []);
27
27
  /*
28
28
  * translators: If your word count is based on single characters (e.g. East Asian characters),
29
29
  * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/word-count/index.js"],"names":["WordCount","content","select","editorStore","getEditedPostAttribute","wordCountType"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,SAAT,GAAqB;AACnC,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAC1BA,MAAM,CAAEC,YAAF,CAAN,CAAsBC,sBAAtB,CAA8C,SAA9C,CADe,CAAhB;AAIA;AACD;AACA;AACA;AACA;;AACC,QAAMC,aAAa,GAAG,cAAI,OAAJ,EAAa,oCAAb,CAAtB;AAEA,SACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,sBAAWJ,OAAX,EAAoBI,aAApB,CADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function WordCount() {\n\tconst content = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostAttribute( 'content' )\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/word-count/index.js"],"names":["WordCount","content","select","editorStore","getEditedPostAttribute","wordCountType"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,SAAT,GAAqB;AACnC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAsBC,sBAAtB,CAA8C,SAA9C,CADC,EAEf,EAFe,CAAhB;AAKA;AACD;AACA;AACA;AACA;;AACC,QAAMC,aAAa,GAAG,cAAI,OAAJ,EAAa,oCAAb,CAAtB;AAEA,SACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,sBAAWJ,OAAX,EAAoBI,aAApB,CADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"]}
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.setupEditor = setupEditor;
9
9
  exports.__experimentalTearDownEditor = __experimentalTearDownEditor;
10
10
  exports.resetPost = resetPost;
11
- exports.resetAutosave = resetAutosave;
12
11
  exports.__experimentalRequestPostUpdateStart = __experimentalRequestPostUpdateStart;
13
12
  exports.__experimentalRequestPostUpdateFinish = __experimentalRequestPostUpdateFinish;
14
13
  exports.updatePost = updatePost;
@@ -136,30 +135,6 @@ function resetPost(post) {
136
135
  post
137
136
  };
138
137
  }
139
- /**
140
- * Returns an action object used in signalling that the latest autosave of the
141
- * post has been received, by initialization or autosave.
142
- *
143
- * @deprecated since 5.6. Callers should use the `receiveAutosaves( postId, autosave )`
144
- * selector from the '@wordpress/core-data' package.
145
- *
146
- * @param {Object} newAutosave Autosave post object.
147
- *
148
- * @return {Object} Action object.
149
- */
150
-
151
-
152
- function* resetAutosave(newAutosave) {
153
- (0, _deprecated.default)('resetAutosave action (`core/editor` store)', {
154
- since: '5.3',
155
- alternative: 'receiveAutosaves action (`core` store)'
156
- });
157
- const postId = yield _data.controls.select(_constants.STORE_NAME, 'getCurrentPostId');
158
- yield _data.controls.dispatch(_coreData.store, 'receiveAutosaves', postId, newAutosave);
159
- return {
160
- type: '__INERT__'
161
- };
162
- }
163
138
  /**
164
139
  * Action for dispatching that a post update request has started.
165
140
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","resetAutosave","newAutosave","since","alternative","postId","controls","select","STORE_NAME","dispatch","coreStore","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","id","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","postTypeSlug","newPost","path","rest_base","Date","now","trashPost","TRASH_POST_NOTICE_ID","method","autosave","local","isPostNew","title","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC,SAAS,CAAEH,IAAF,CAAf;AACA,QAAM;AACLI,IAAAA,IAAI,EAAE,cADD;AAELJ,IAAAA,IAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAN;AAMA,QAAMG,gBAAgB,CAAEL,IAAF,CAAtB,CARqD,CASrD;;AACA,QAAMM,SAAS,GAAGN,IAAI,CAACO,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIJ,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIM,OAAJ;;AACA,QAAK,iBAAKP,KAAL,EAAY,CAAE,SAAF,CAAZ,CAAL,EAAmC;AAClCO,MAAAA,OAAO,GAAGP,KAAK,CAACO,OAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,OAAO,GAAGR,IAAI,CAACQ,OAAL,CAAaC,GAAvB;AACA;;AACD,QAAIC,MAAM,GAAG,mBAAOF,OAAP,CAAb;AACAE,IAAAA,MAAM,GAAG,2CAA+BA,MAA/B,EAAuCR,QAAvC,CAAT;AACA,UAAMS,iBAAiB,CAAED,MAAF,EAAU;AAChCE,MAAAA,+BAA+B,EAAE;AADD,KAAV,CAAvB;AAGA;;AACD,MACCX,KAAK,IACLY,MAAM,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ACiC,EAFR;AAGL0B,MAAAA,SAHK;AAILC,MAAAA,KAJK;AAKLpD,MAAAA,OALK;AAMLqD,MAAAA;AANK,KAAN;AAQA,GA7BD,MA6BO;AACN,UAAMrC,eAASG,QAAT,CAAmBD,qBAAnB,EAA+B,UAA/B,EAA2C;AAChDS,MAAAA,UAAU,EAAE,IADoC;AAEhD,SAAGL;AAF6C,KAA3C,CAAN;AAIA;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,UAAUgC,IAAV,GAAiB;AACvB,QAAMtC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;;;AACO,UAAUmC,IAAV,GAAiB;AACvB,QAAMvC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASoC,eAAT,GAA2B;AACjC,SAAO;AAAE5D,IAAAA,IAAI,EAAE;AAAR,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS6D,cAAT,CAAyBC,IAAzB,EAAgC;AACtC,SAAO;AACN9D,IAAAA,IAAI,EAAE,kBADA;AAEN8D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,oBAAT,GAAgC;AACtC,SAAO;AACN/D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASgE,qBAAT,GAAiC;AACvC,SAAO;AACNhE,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASiE,cAAT,CAA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CAAxC;AAEP;AACA;AACA;;;AACO,MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;;AACO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield editPost( edits );\n\t}\n}\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the latest autosave of the\n * post has been received, by initialization or autosave.\n *\n * @deprecated since 5.6. Callers should use the `receiveAutosaves( postId, autosave )`\n * \t\t\t selector from the '@wordpress/core-data' package.\n *\n * @param {Object} newAutosave Autosave post object.\n *\n * @return {Object} Action object.\n */\nexport function* resetAutosave( newAutosave ) {\n\tdeprecated( 'resetAutosave action (`core/editor` store)', {\n\t\tsince: '5.3',\n\t\talternative: 'receiveAutosaves action (`core` store)',\n\t} );\n\n\tconst postId = yield controls.select( STORE_NAME, 'getCurrentPostId' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'receiveAutosaves',\n\t\tpostId,\n\t\tnewAutosave\n\t);\n\n\treturn { type: '__INERT__' };\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Action generator for handling refreshing the current post.\n */\nexport function* refreshPost() {\n\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tconst newPost = yield apiFetch( {\n\t\t// Timestamp arg allows caller to bypass browser caching, which is\n\t\t// expected for this specific function.\n\t\tpath:\n\t\t\t`/wp/v2/${ postType.rest_base }/${ post.id }` +\n\t\t\t`?context=edit&_timestamp=${ Date.now() }`,\n\t} );\n\tyield controls.dispatch( STORE_NAME, 'resetPost', newPost );\n}\n\n/**\n * Action generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.dispatch( coreStore, 'undo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history record should\n * be created.\n *\n * @return {Object} Action object.\n */\nexport function createUndoLevel() {\n\treturn { type: 'CREATE_UNDO_LEVEL' };\n}\n\n/**\n * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post autosaving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post autosaving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\tyield* editPost( edits );\n}\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction = ( name ) =>\n\tfunction* ( ...args ) {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t} );\n\t\tyield controls.dispatch( blockEditorStore, name, ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","since","alternative","id","controls","select","STORE_NAME","dispatch","coreStore","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","postTypeSlug","newPost","path","rest_base","Date","now","trashPost","TRASH_POST_NOTICE_ID","method","autosave","local","isPostNew","title","excerpt","postId","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC,SAAS,CAAEH,IAAF,CAAf;AACA,QAAM;AACLI,IAAAA,IAAI,EAAE,cADD;AAELJ,IAAAA,IAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAN;AAMA,QAAMG,gBAAgB,CAAEL,IAAF,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hD;AAIP;AACA;AACA;;;AACO,MAAMsB,mBAAmB,GAAGtB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;;AACO,MAAMuB,WAAW,GAAGvB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;;AACO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield editPost( edits );\n\t}\n}\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Action generator for handling refreshing the current post.\n */\nexport function* refreshPost() {\n\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tconst newPost = yield apiFetch( {\n\t\t// Timestamp arg allows caller to bypass browser caching, which is\n\t\t// expected for this specific function.\n\t\tpath:\n\t\t\t`/wp/v2/${ postType.rest_base }/${ post.id }` +\n\t\t\t`?context=edit&_timestamp=${ Date.now() }`,\n\t} );\n\tyield controls.dispatch( STORE_NAME, 'resetPost', newPost );\n}\n\n/**\n * Action generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.dispatch( coreStore, 'undo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history record should\n * be created.\n *\n * @return {Object} Action object.\n */\nexport function createUndoLevel() {\n\treturn { type: 'CREATE_UNDO_LEVEL' };\n}\n\n/**\n * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post autosaving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that post autosaving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\tyield* editPost( edits );\n}\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction = ( name ) =>\n\tfunction* ( ...args ) {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t} );\n\t\tyield controls.dispatch( blockEditorStore, name, ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
@@ -27,7 +27,6 @@ exports.isAutosavingPost = isAutosavingPost;
27
27
  exports.isPreviewingPost = isPreviewingPost;
28
28
  exports.getEditedPostPreviewLink = getEditedPostPreviewLink;
29
29
  exports.getSuggestedPostFormat = getSuggestedPostFormat;
30
- exports.getBlocksForSerialization = getBlocksForSerialization;
31
30
  exports.isPublishingPost = isPublishingPost;
32
31
  exports.isPermalinkEditable = isPermalinkEditable;
33
32
  exports.getPermalink = getPermalink;
@@ -51,7 +50,7 @@ exports.getStateBeforeOptimisticTransaction = getStateBeforeOptimisticTransactio
51
50
  exports.inSomeHistory = inSomeHistory;
52
51
  exports.__experimentalGetDefaultTemplateTypes = __experimentalGetDefaultTemplateTypes;
53
52
  exports.__experimentalGetTemplateInfo = __experimentalGetTemplateInfo;
54
- exports.getPostTypeLabel = exports.__experimentalGetDefaultTemplateType = exports.__experimentalGetDefaultTemplatePartAreas = exports.getBlockListSettings = exports.hasInserterItems = exports.getInserterItems = exports.canInsertBlockType = exports.getTemplateLock = exports.getTemplate = exports.isValidTemplate = exports.isBlockInsertionPointVisible = exports.getBlockInsertionPoint = exports.isCaretWithinFormattedText = exports.isTyping = exports.getBlockMode = exports.isSelectionEnabled = exports.isMultiSelecting = exports.hasMultiSelection = exports.isBlockWithinSelection = exports.hasSelectedInnerBlock = exports.isBlockSelected = exports.getBlockIndex = exports.getBlockOrder = exports.getMultiSelectedBlocksEndClientId = exports.getMultiSelectedBlocksStartClientId = exports.isAncestorMultiSelected = exports.isBlockMultiSelected = exports.isFirstMultiSelectedBlock = exports.getLastMultiSelectedBlockClientId = exports.getFirstMultiSelectedBlockClientId = exports.getMultiSelectedBlocks = exports.getMultiSelectedBlockClientIds = exports.getSelectedBlocksInitialCaretPosition = exports.getNextBlockClientId = exports.getPreviousBlockClientId = exports.getAdjacentBlockClientId = exports.getBlockHierarchyRootClientId = exports.getBlockRootClientId = exports.getSelectedBlock = exports.getSelectedBlockClientId = exports.hasSelectedBlock = exports.getSelectedBlockCount = exports.getBlockSelectionEnd = exports.getBlockSelectionStart = exports.getBlockCount = exports.getBlocksByClientId = exports.getGlobalBlockCount = exports.getClientIdsWithDescendants = exports.getClientIdsOfDescendants = exports.getBlocks = exports.getBlock = exports.getBlockAttributes = exports.isBlockValid = exports.getBlockName = exports.getEditedPostContent = exports.didPostSaveRequestFail = exports.didPostSaveRequestSucceed = exports.isSavingNonPostEntityChanges = exports.isSavingPost = exports.hasAutosave = exports.getAutosave = exports.isEditedPostAutosaveable = exports.getAutosaveAttribute = exports.getReferenceByDistinctEdits = exports.getPostEdits = exports.getCurrentPost = exports.hasNonPostEntityChanges = exports.isEditedPostDirty = exports.hasEditorRedo = exports.hasEditorUndo = void 0;
53
+ exports.getPostTypeLabel = exports.__experimentalGetDefaultTemplateType = exports.__experimentalGetDefaultTemplatePartAreas = exports.getBlockListSettings = exports.hasInserterItems = exports.getInserterItems = exports.canInsertBlockType = exports.getTemplateLock = exports.getTemplate = exports.isValidTemplate = exports.isBlockInsertionPointVisible = exports.getBlockInsertionPoint = exports.isCaretWithinFormattedText = exports.isTyping = exports.getBlockMode = exports.isSelectionEnabled = exports.isMultiSelecting = exports.hasMultiSelection = exports.isBlockWithinSelection = exports.hasSelectedInnerBlock = exports.isBlockSelected = exports.getBlockIndex = exports.getBlockOrder = exports.getMultiSelectedBlocksEndClientId = exports.getMultiSelectedBlocksStartClientId = exports.isAncestorMultiSelected = exports.isBlockMultiSelected = exports.isFirstMultiSelectedBlock = exports.getLastMultiSelectedBlockClientId = exports.getFirstMultiSelectedBlockClientId = exports.getMultiSelectedBlocks = exports.getMultiSelectedBlockClientIds = exports.getSelectedBlocksInitialCaretPosition = exports.getNextBlockClientId = exports.getPreviousBlockClientId = exports.getAdjacentBlockClientId = exports.getBlockHierarchyRootClientId = exports.getBlockRootClientId = exports.getSelectedBlock = exports.getSelectedBlockClientId = exports.hasSelectedBlock = exports.getSelectedBlockCount = exports.getBlockSelectionEnd = exports.getBlockSelectionStart = exports.getBlockCount = exports.getBlocksByClientId = exports.getGlobalBlockCount = exports.getClientIdsWithDescendants = exports.getClientIdsOfDescendants = exports.getBlocks = exports.getBlock = exports.getBlockAttributes = exports.isBlockValid = exports.getBlockName = exports.getEditedPostContent = exports.didPostSaveRequestFail = exports.didPostSaveRequestSucceed = exports.isSavingNonPostEntityChanges = exports.isSavingPost = exports.isEditedPostAutosaveable = exports.getAutosaveAttribute = exports.getReferenceByDistinctEdits = exports.getPostEdits = exports.getCurrentPost = exports.hasNonPostEntityChanges = exports.isEditedPostDirty = exports.hasEditorRedo = exports.hasEditorUndo = void 0;
55
54
 
56
55
  var _lodash = require("lodash");
57
56
 
@@ -83,7 +82,7 @@ var _reducer = require("./reducer");
83
82
 
84
83
  var _url2 = require("../utils/url");
85
84
 
86
- var _getTemplatePartIcon = require("./utils/get-template-part-icon");
85
+ var _getTemplatePartIcon = require("../utils/get-template-part-icon");
87
86
 
88
87
  /**
89
88
  * External dependencies
@@ -671,53 +670,6 @@ const isEditedPostAutosaveable = (0, _data.createRegistrySelector)(select => sta
671
670
 
672
671
  return ['title', 'excerpt'].some(field => (0, _reducer.getPostRawValue)(autosave[field]) !== getEditedPostAttribute(state, field));
673
672
  });
674
- /**
675
- * Returns the current autosave, or null if one is not set (i.e. if the post
676
- * has yet to be autosaved, or has been saved or published since the last
677
- * autosave).
678
- *
679
- * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )`
680
- * selector from the '@wordpress/core-data' package.
681
- *
682
- * @param {Object} state Editor state.
683
- *
684
- * @return {?Object} Current autosave, if exists.
685
- */
686
-
687
- exports.isEditedPostAutosaveable = isEditedPostAutosaveable;
688
- const getAutosave = (0, _data.createRegistrySelector)(select => state => {
689
- (0, _deprecated.default)("`wp.data.select( 'core/editor' ).getAutosave()`", {
690
- since: '5.3',
691
- alternative: "`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`"
692
- });
693
- const postType = getCurrentPostType(state);
694
- const postId = getCurrentPostId(state);
695
- const currentUserId = (0, _lodash.get)(select(_coreData.store).getCurrentUser(), ['id']);
696
- const autosave = select(_coreData.store).getAutosave(postType, postId, currentUserId);
697
- return (0, _lodash.mapValues)((0, _lodash.pick)(autosave, _constants.AUTOSAVE_PROPERTIES), _reducer.getPostRawValue);
698
- });
699
- /**
700
- * Returns the true if there is an existing autosave, otherwise false.
701
- *
702
- * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
703
- * from the '@wordpress/core-data' package and check for a truthy value.
704
- *
705
- * @param {Object} state Global application state.
706
- *
707
- * @return {boolean} Whether there is an existing autosave.
708
- */
709
-
710
- exports.getAutosave = getAutosave;
711
- const hasAutosave = (0, _data.createRegistrySelector)(select => state => {
712
- (0, _deprecated.default)("`wp.data.select( 'core/editor' ).hasAutosave()`", {
713
- since: '5.3',
714
- alternative: "`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`"
715
- });
716
- const postType = getCurrentPostType(state);
717
- const postId = getCurrentPostId(state);
718
- const currentUserId = (0, _lodash.get)(select(_coreData.store).getCurrentUser(), ['id']);
719
- return !!select(_coreData.store).getAutosave(postType, postId, currentUserId);
720
- });
721
673
  /**
722
674
  * Return true if the post being edited is being scheduled. Preferring the
723
675
  * unsaved status values.
@@ -727,7 +679,7 @@ const hasAutosave = (0, _data.createRegistrySelector)(select => state => {
727
679
  * @return {boolean} Whether the post has been published.
728
680
  */
729
681
 
730
- exports.hasAutosave = hasAutosave;
682
+ exports.isEditedPostAutosaveable = isEditedPostAutosaveable;
731
683
 
732
684
  function isEditedPostBeingScheduled(state) {
733
685
  const date = getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency)
@@ -957,39 +909,6 @@ function getSuggestedPostFormat(state) {
957
909
  return null;
958
910
  }
959
911
  }
960
- /**
961
- * Returns a set of blocks which are to be used in consideration of the post's
962
- * generated save content.
963
- *
964
- * @deprecated since Gutenberg 6.2.0.
965
- *
966
- * @param {Object} state Editor state.
967
- *
968
- * @return {WPBlock[]} Filtered set of blocks for save.
969
- */
970
-
971
-
972
- function getBlocksForSerialization(state) {
973
- (0, _deprecated.default)('`core/editor` getBlocksForSerialization selector', {
974
- since: '5.3',
975
- alternative: 'getEditorBlocks',
976
- hint: 'Blocks serialization pre-processing occurs at save time'
977
- });
978
- const blocks = state.editor.present.blocks.value; // WARNING: Any changes to the logic of this function should be verified
979
- // against the implementation of isEditedPostEmpty, which bypasses this
980
- // function for performance' sake, in an assumption of this current logic
981
- // being irrelevant to the optimized condition of emptiness.
982
- // A single unmodified default block is assumed to be equivalent to an
983
- // empty post.
984
-
985
- const isSingleUnmodifiedDefaultBlock = blocks.length === 1 && (0, _blocks.isUnmodifiedDefaultBlock)(blocks[0]);
986
-
987
- if (isSingleUnmodifiedDefaultBlock) {
988
- return [];
989
- }
990
-
991
- return blocks;
992
- }
993
912
  /**
994
913
  * Returns the content of the post being edited.
995
914
  *