@wordpress/editor 13.24.1 → 13.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/document-bar/index.js +152 -0
  3. package/build/components/document-bar/index.js.map +1 -0
  4. package/build/components/editor-canvas/edit-template-blocks-notification.js +106 -0
  5. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -0
  6. package/build/components/editor-canvas/index.js +292 -0
  7. package/build/components/editor-canvas/index.js.map +1 -0
  8. package/build/components/index.js +24 -8
  9. package/build/components/index.js.map +1 -1
  10. package/build/components/post-publish-button/index.js +1 -0
  11. package/build/components/post-publish-button/index.js.map +1 -1
  12. package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
  13. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  14. package/build/components/post-saved-state/index.js +1 -0
  15. package/build/components/post-saved-state/index.js.map +1 -1
  16. package/build/components/post-schedule/panel.js +1 -1
  17. package/build/components/post-schedule/panel.js.map +1 -1
  18. package/build/components/post-template/block-theme.js +99 -0
  19. package/build/components/post-template/block-theme.js.map +1 -0
  20. package/build/components/post-template/classic-theme.js +171 -0
  21. package/build/components/post-template/classic-theme.js.map +1 -0
  22. package/build/components/post-template/create-new-template-modal.js +98 -0
  23. package/build/components/post-template/create-new-template-modal.js.map +1 -0
  24. package/build/components/post-template/create-new-template.js +55 -0
  25. package/build/components/post-template/create-new-template.js.map +1 -0
  26. package/build/components/post-template/hooks.js +88 -0
  27. package/build/components/post-template/hooks.js.map +1 -0
  28. package/build/components/post-template/panel.js +71 -0
  29. package/build/components/post-template/panel.js.map +1 -0
  30. package/build/components/post-template/reset-default-template.js +48 -0
  31. package/build/components/post-template/reset-default-template.js.map +1 -0
  32. package/build/components/post-template/swap-template-button.js +84 -0
  33. package/build/components/post-template/swap-template-button.js.map +1 -0
  34. package/build/components/post-title/index.native.js +0 -1
  35. package/build/components/post-title/index.native.js.map +1 -1
  36. package/build/components/preview-dropdown/index.js +113 -0
  37. package/build/components/preview-dropdown/index.js.map +1 -0
  38. package/build/components/provider/index.js +24 -82
  39. package/build/components/provider/index.js.map +1 -1
  40. package/build/components/provider/index.native.js +17 -8
  41. package/build/components/provider/index.native.js.map +1 -1
  42. package/build/components/provider/navigation-block-editing-mode.js +40 -0
  43. package/build/components/provider/navigation-block-editing-mode.js.map +1 -0
  44. package/build/components/provider/use-block-editor-settings.js +9 -10
  45. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  46. package/build/hooks/index.js +1 -0
  47. package/build/hooks/index.js.map +1 -1
  48. package/build/hooks/pattern-partial-syncing.js +49 -0
  49. package/build/hooks/pattern-partial-syncing.js.map +1 -0
  50. package/build/private-apis.js +4 -0
  51. package/build/private-apis.js.map +1 -1
  52. package/build/store/actions.js +59 -11
  53. package/build/store/actions.js.map +1 -1
  54. package/build/store/defaults.js +2 -1
  55. package/build/store/defaults.js.map +1 -1
  56. package/build/store/index.js +3 -0
  57. package/build/store/index.js.map +1 -1
  58. package/build/store/private-actions.js +52 -0
  59. package/build/store/private-actions.js.map +1 -0
  60. package/build/store/reducer.js +32 -27
  61. package/build/store/reducer.js.map +1 -1
  62. package/build/store/reducer.native.js +0 -1
  63. package/build/store/reducer.native.js.map +1 -1
  64. package/build/store/selectors.js +31 -10
  65. package/build/store/selectors.js.map +1 -1
  66. package/build-module/components/document-bar/index.js +144 -0
  67. package/build-module/components/document-bar/index.js.map +1 -0
  68. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +100 -0
  69. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -0
  70. package/build-module/components/editor-canvas/index.js +283 -0
  71. package/build-module/components/editor-canvas/index.js.map +1 -0
  72. package/build-module/components/index.js +3 -1
  73. package/build-module/components/index.js.map +1 -1
  74. package/build-module/components/post-publish-button/index.js +1 -0
  75. package/build-module/components/post-publish-button/index.js.map +1 -1
  76. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
  77. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  78. package/build-module/components/post-saved-state/index.js +1 -0
  79. package/build-module/components/post-saved-state/index.js.map +1 -1
  80. package/build-module/components/post-schedule/panel.js +1 -1
  81. package/build-module/components/post-schedule/panel.js.map +1 -1
  82. package/build-module/components/post-template/block-theme.js +91 -0
  83. package/build-module/components/post-template/block-theme.js.map +1 -0
  84. package/build-module/components/post-template/classic-theme.js +162 -0
  85. package/build-module/components/post-template/classic-theme.js.map +1 -0
  86. package/build-module/components/post-template/create-new-template-modal.js +91 -0
  87. package/build-module/components/post-template/create-new-template-modal.js.map +1 -0
  88. package/build-module/components/post-template/create-new-template.js +47 -0
  89. package/build-module/components/post-template/create-new-template.js.map +1 -0
  90. package/build-module/components/post-template/hooks.js +78 -0
  91. package/build-module/components/post-template/hooks.js.map +1 -0
  92. package/build-module/components/post-template/panel.js +63 -0
  93. package/build-module/components/post-template/panel.js.map +1 -0
  94. package/build-module/components/post-template/reset-default-template.js +41 -0
  95. package/build-module/components/post-template/reset-default-template.js.map +1 -0
  96. package/build-module/components/post-template/swap-template-button.js +77 -0
  97. package/build-module/components/post-template/swap-template-button.js.map +1 -0
  98. package/build-module/components/post-title/index.native.js +0 -1
  99. package/build-module/components/post-title/index.native.js.map +1 -1
  100. package/build-module/components/preview-dropdown/index.js +105 -0
  101. package/build-module/components/preview-dropdown/index.js.map +1 -0
  102. package/build-module/components/provider/index.js +25 -83
  103. package/build-module/components/provider/index.js.map +1 -1
  104. package/build-module/components/provider/index.native.js +18 -9
  105. package/build-module/components/provider/index.native.js.map +1 -1
  106. package/build-module/components/provider/navigation-block-editing-mode.js +34 -0
  107. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -0
  108. package/build-module/components/provider/use-block-editor-settings.js +9 -10
  109. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  110. package/build-module/hooks/index.js +1 -0
  111. package/build-module/hooks/index.js.map +1 -1
  112. package/build-module/hooks/pattern-partial-syncing.js +46 -0
  113. package/build-module/hooks/pattern-partial-syncing.js.map +1 -0
  114. package/build-module/private-apis.js +4 -0
  115. package/build-module/private-apis.js.map +1 -1
  116. package/build-module/store/actions.js +53 -9
  117. package/build-module/store/actions.js.map +1 -1
  118. package/build-module/store/defaults.js +2 -1
  119. package/build-module/store/defaults.js.map +1 -1
  120. package/build-module/store/index.js +3 -0
  121. package/build-module/store/index.js.map +1 -1
  122. package/build-module/store/private-actions.js +44 -0
  123. package/build-module/store/private-actions.js.map +1 -0
  124. package/build-module/store/reducer.js +30 -26
  125. package/build-module/store/reducer.js.map +1 -1
  126. package/build-module/store/reducer.native.js +1 -2
  127. package/build-module/store/reducer.native.js.map +1 -1
  128. package/build-module/store/selectors.js +26 -6
  129. package/build-module/store/selectors.js.map +1 -1
  130. package/build-style/style-rtl.css +182 -0
  131. package/build-style/style.css +182 -0
  132. package/package.json +32 -31
  133. package/src/components/document-bar/index.js +182 -0
  134. package/src/components/document-bar/style.scss +130 -0
  135. package/src/components/editor-canvas/edit-template-blocks-notification.js +108 -0
  136. package/src/components/editor-canvas/index.js +381 -0
  137. package/src/components/index.js +3 -1
  138. package/src/components/post-publish-button/index.js +1 -0
  139. package/src/components/post-publish-panel/maybe-upload-media.js +3 -8
  140. package/src/components/post-saved-state/index.js +1 -0
  141. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +2 -2
  142. package/src/components/post-schedule/panel.js +1 -1
  143. package/src/components/post-template/block-theme.js +109 -0
  144. package/src/components/post-template/classic-theme.js +213 -0
  145. package/src/components/post-template/create-new-template-modal.js +139 -0
  146. package/src/components/post-template/create-new-template.js +50 -0
  147. package/src/components/post-template/hooks.js +95 -0
  148. package/src/components/post-template/panel.js +67 -0
  149. package/src/components/post-template/reset-default-template.js +43 -0
  150. package/src/components/post-template/style.scss +52 -0
  151. package/src/components/post-template/swap-template-button.js +83 -0
  152. package/src/components/post-title/index.native.js +0 -1
  153. package/src/components/preview-dropdown/index.js +136 -0
  154. package/src/components/preview-dropdown/style.scss +5 -0
  155. package/src/components/provider/index.js +28 -118
  156. package/src/components/provider/index.native.js +26 -12
  157. package/src/components/provider/navigation-block-editing-mode.js +37 -0
  158. package/src/components/provider/use-block-editor-settings.js +6 -9
  159. package/src/hooks/index.js +1 -0
  160. package/src/hooks/pattern-partial-syncing.js +73 -0
  161. package/src/private-apis.js +4 -0
  162. package/src/store/actions.js +51 -9
  163. package/src/store/defaults.js +1 -0
  164. package/src/store/index.js +3 -0
  165. package/src/store/private-actions.js +61 -0
  166. package/src/store/reducer.js +32 -27
  167. package/src/store/reducer.native.js +0 -2
  168. package/src/store/selectors.js +64 -42
  169. package/src/store/test/selectors.js +88 -147
  170. package/src/style.scss +3 -0
  171. package/build/components/post-template/index.js +0 -66
  172. package/build/components/post-template/index.js.map +0 -1
  173. package/build-module/components/post-template/index.js +0 -57
  174. package/build-module/components/post-template/index.js.map +0 -1
  175. package/src/components/post-template/index.js +0 -64
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useDispatch","useSelect","store","blockEditorStore","NavigationBlockEditingMode","blockClientId","select","getBlockOrder","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/navigation-block-editing-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * For the Navigation block editor, we need to force the block editor to contentOnly for that block.\n *\n * Set block editing mode to contentOnly when entering Navigation focus mode.\n * this ensures that non-content controls on the block will be hidden and thus\n * the user can focus on editing the Navigation Menu content only.\n */\n\nexport default function NavigationBlockEditingMode() {\n\t// In the navigation block editor,\n\t// the navigation block is the only root block.\n\tconst blockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockOrder()?.[ 0 ],\n\t\t[]\n\t);\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! blockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockEditingMode( blockClientId, 'contentOnly' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( blockClientId );\n\t\t};\n\t}, [ blockClientId, unsetBlockEditingMode, setBlockEditingMode ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD;EACA;EACA,MAAMC,aAAa,GAAGJ,SAAS,CAC5BK,MAAM,IAAMA,MAAM,CAAEH,gBAAiB,CAAC,CAACI,aAAa,CAAC,CAAC,GAAI,CAAC,CAAE,EAC/D,EACD,CAAC;EACD,MAAM;IAAEC,mBAAmB;IAAEC;EAAsB,CAAC,GACnDT,WAAW,CAAEG,gBAAiB,CAAC;EAEhCJ,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEM,aAAa,EAAG;MACtB;IACD;IAEAG,mBAAmB,CAAEH,aAAa,EAAE,aAAc,CAAC;IAEnD,OAAO,MAAM;MACZI,qBAAqB,CAAEJ,aAAc,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CAAEA,aAAa,EAAEI,qBAAqB,EAAED,mBAAmB,CAAG,CAAC;AACnE"}
@@ -33,7 +33,9 @@ function useBlockEditorSettings(settings, postType, postId) {
33
33
  userCanCreatePages,
34
34
  pageOnFront,
35
35
  pageForPosts,
36
- userPatternCategories
36
+ userPatternCategories,
37
+ restBlockPatterns,
38
+ restBlockPatternCategories
37
39
  } = useSelect(select => {
38
40
  var _canUser;
39
41
  const isWeb = Platform.OS === 'web';
@@ -42,7 +44,9 @@ function useBlockEditorSettings(settings, postType, postId) {
42
44
  getRawEntityRecord,
43
45
  getEntityRecord,
44
46
  getUserPatternCategories,
45
- getEntityRecords
47
+ getEntityRecords,
48
+ getBlockPatterns,
49
+ getBlockPatternCategories
46
50
  } = select(coreStore);
47
51
  const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
48
52
  return {
@@ -55,7 +59,9 @@ function useBlockEditorSettings(settings, postType, postId) {
55
59
  userCanCreatePages: canUser('create', 'pages'),
56
60
  pageOnFront: siteSettings?.page_on_front,
57
61
  pageForPosts: siteSettings?.page_for_posts,
58
- userPatternCategories: getUserPatternCategories()
62
+ userPatternCategories: getUserPatternCategories(),
63
+ restBlockPatterns: getBlockPatterns(),
64
+ restBlockPatternCategories: getBlockPatternCategories()
59
65
  };
60
66
  }, [postType, postId]);
61
67
  const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
@@ -65,13 +71,6 @@ function useBlockEditorSettings(settings, postType, postId) {
65
71
  // WP 6.0
66
72
  settings.__experimentalBlockPatternCategories; // WP 5.9
67
73
 
68
- const {
69
- restBlockPatterns,
70
- restBlockPatternCategories
71
- } = useSelect(select => ({
72
- restBlockPatterns: select(coreStore).getBlockPatterns(),
73
- restBlockPatternCategories: select(coreStore).getBlockPatternCategories()
74
- }), []);
75
74
  const blockPatterns = useMemo(() => [...(settingsBlockPatterns || []), ...(restBlockPatterns || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)).filter(({
76
75
  postTypes
77
76
  }) => {
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","select","_canUser","isWeb","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","siteSettings","undefined","_links","hasOwnProperty","per_page","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","restBlockPatterns","restBlockPatternCategories","getBlockPatterns","getBlockPatternCategories","blockPatterns","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","Object","fromEntries","entries","key","__experimentalReusableBlocks","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo, useCallback } 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 inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__experimentalSetIsInserterOpened',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'allowedBlockTypes',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'focusMode',\n\t'distractionFree',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'hasFixedToolbar',\n\t'hasInlineToolbar',\n\t'isDistractionFree',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'keepCaretInsideBlock',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\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 {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetEntityRecords,\n\t\t\t} = select( coreStore );\n\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\treusableBlocks: isWeb\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst { restBlockPatterns, restBlockPatternCategories } = useSelect(\n\t\t( select ) => ( {\n\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\trestBlockPatternCategories:\n\t\t\t\tselect( coreStore ).getBlockPatternCategories(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatterns || [] ),\n\t\t\t\t...( restBlockPatterns || [] ),\n\t\t\t]\n\t\t\t\t.filter(\n\t\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t\t)\n\t\t\t\t.filter( ( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t[ settingsBlockPatterns, restBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\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 = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tp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B,kCAAkC,EAAEA,CAAE2E,MAAM,EAAEC,aAAa,KAC1D3E,oBAAoB,CAAE0E,MAAM,EAAEC,aAAa,EAAEjE,QAAS,CAAC;IACxDN,uBAAuB;IACvBwE,8BAA8B,EAAE1E,YAAY;IAC5C;IACA;IACA2E,sCAAsC,EAAE5D,oBAAoB;IAC5D;IACA6D,kBAAkB,EAAEjB,IAAI;IACxB;IACA;IACAkB,WAAW,EAAEpE,QAAQ,KAAK,aAAa;IACvC;IACAqE,8BAA8B,EAAEjB,gBAAgB;IAChDkB,gCAAgC,EAAE/D,kBAAkB;IACpDC,WAAW;IACXC,YAAY;IACZ8D,kCAAkC,EAAEvE,QAAQ,KAAK,aAAa;IAC9DwE,YAAY,EACXxE,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACyE,YAAY;IAChEC,QAAQ,EACPzE,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAAC0E;EACd,CAAC,CAAE,EACH,CACC1E,QAAQ,EACRM,oBAAoB,EACpBD,cAAc,EACdM,qBAAqB,EACrB2B,aAAa,EACbY,sBAAsB,EACtB3C,oBAAoB,EACpB4C,IAAI,EACJE,gBAAgB,EAChB7C,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZT,QAAQ,CAEV,CAAC;AACF;AAEA,eAAeF,sBAAsB"}
1
+ {"version":3,"names":["Platform","useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatterns","restBlockPatternCategories","select","_canUser","isWeb","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","getBlockPatterns","getBlockPatternCategories","siteSettings","undefined","_links","hasOwnProperty","per_page","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","Object","fromEntries","entries","key","__experimentalReusableBlocks","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo, useCallback } 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 inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__experimentalSetIsInserterOpened',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'allowedBlockTypes',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'focusMode',\n\t'distractionFree',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'hasFixedToolbar',\n\t'hasInlineToolbar',\n\t'isDistractionFree',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'keepCaretInsideBlock',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\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 {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatterns,\n\t\trestBlockPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetBlockPatterns,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\treusableBlocks: isWeb\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatterns: getBlockPatterns(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatterns || [] ),\n\t\t\t\t...( restBlockPatterns || [] ),\n\t\t\t]\n\t\t\t\t.filter(\n\t\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t\t)\n\t\t\t\t.filter( ( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t[ settingsBlockPatterns, restBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\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 = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\tpostType,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;A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AE5D,oBAAoB;IAC5D;IACA6D,kBAAkB,EAAEjB,IAAI;IACxB;IACA;IACAkB,WAAW,EAAEpE,QAAQ,KAAK,aAAa;IACvC;IACAqE,8BAA8B,EAAEjB,gBAAgB;IAChDkB,gCAAgC,EAAE/D,kBAAkB;IACpDC,WAAW;IACXC,YAAY;IACZ8D,kCAAkC,EAAEvE,QAAQ,KAAK,aAAa;IAC9DwE,YAAY,EACXxE,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACyE,YAAY;IAChEC,QAAQ,EACPzE,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAAC0E;EACd,CAAC,CAAE,EACH,CACC1E,QAAQ,EACRM,oBAAoB,EACpBD,cAAc,EACdM,qBAAqB,EACrB2B,aAAa,EACbY,sBAAsB,EACtB3C,oBAAoB,EACpB4C,IAAI,EACJE,gBAAgB,EAChB7C,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZT,QAAQ,CAEV,CAAC;AACF;AAEA,eAAeF,sBAAsB"}
@@ -3,4 +3,5 @@
3
3
  */
4
4
  import './custom-sources-backwards-compatibility';
5
5
  import './default-autocompleters';
6
+ import './pattern-partial-syncing';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './custom-sources-backwards-compatibility';\nimport './default-autocompleters';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,0CAA0C;AACjD,OAAO,0BAA0B"}
1
+ {"version":3,"names":[],"sources":["@wordpress/editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './custom-sources-backwards-compatibility';\nimport './default-autocompleters';\nimport './pattern-partial-syncing';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,0CAA0C;AACjD,OAAO,0BAA0B;AACjC,OAAO,2BAA2B"}
@@ -0,0 +1,46 @@
1
+ import { createElement, Fragment } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { addFilter } from '@wordpress/hooks';
6
+ import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
7
+ import { createHigherOrderComponent } from '@wordpress/compose';
8
+ import { useBlockEditingMode } from '@wordpress/block-editor';
9
+ import { hasBlockSupport } from '@wordpress/blocks';
10
+ import { useSelect } from '@wordpress/data';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { store as editorStore } from '../store';
16
+ import { unlock } from '../lock-unlock';
17
+ const {
18
+ PartialSyncingControls,
19
+ PATTERN_TYPES,
20
+ PARTIAL_SYNCING_SUPPORTED_BLOCKS
21
+ } = unlock(patternsPrivateApis);
22
+
23
+ /**
24
+ * Override the default edit UI to include a new block inspector control for
25
+ * assigning a partial syncing controls to supported blocks in the pattern editor.
26
+ * Currently, only the `core/paragraph` block is supported.
27
+ *
28
+ * @param {Component} BlockEdit Original component.
29
+ *
30
+ * @return {Component} Wrapped component.
31
+ */
32
+ const withPartialSyncingControls = createHigherOrderComponent(BlockEdit => props => {
33
+ const blockEditingMode = useBlockEditingMode();
34
+ const hasCustomFieldsSupport = hasBlockSupport(props.name, '__experimentalConnections', false);
35
+ const isEditingPattern = useSelect(select => select(editorStore).getCurrentPostType() === PATTERN_TYPES.user, []);
36
+ const shouldShowPartialSyncingControls = hasCustomFieldsSupport && props.isSelected && isEditingPattern && blockEditingMode === 'default' && Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
37
+ return createElement(Fragment, null, createElement(BlockEdit, {
38
+ ...props
39
+ }), shouldShowPartialSyncingControls && createElement(PartialSyncingControls, {
40
+ ...props
41
+ }));
42
+ });
43
+ if (window.__experimentalPatternPartialSyncing) {
44
+ addFilter('editor.BlockEdit', 'core/editor/with-partial-syncing-controls', withPartialSyncingControls);
45
+ }
46
+ //# sourceMappingURL=pattern-partial-syncing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","hasBlockSupport","useSelect","store","editorStore","unlock","PartialSyncingControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","withPartialSyncingControls","BlockEdit","props","blockEditingMode","hasCustomFieldsSupport","name","isEditingPattern","select","getCurrentPostType","user","shouldShowPartialSyncingControls","isSelected","Object","keys","includes","createElement","Fragment","window","__experimentalPatternPartialSyncing"],"sources":["@wordpress/editor/src/hooks/pattern-partial-syncing.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tPartialSyncingControls,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPartialSyncingControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\tconst hasCustomFieldsSupport = hasBlockSupport(\n\t\t\tprops.name,\n\t\t\t'__experimentalConnections',\n\t\t\tfalse\n\t\t);\n\t\tconst isEditingPattern = useSelect(\n\t\t\t( select ) =>\n\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\tPATTERN_TYPES.user,\n\t\t\t[]\n\t\t);\n\n\t\tconst shouldShowPartialSyncingControls =\n\t\t\thasCustomFieldsSupport &&\n\t\t\tprops.isSelected &&\n\t\t\tisEditingPattern &&\n\t\t\tblockEditingMode === 'default' &&\n\t\t\tObject.keys( PARTIAL_SYNCING_SUPPORTED_BLOCKS ).includes(\n\t\t\t\tprops.name\n\t\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ shouldShowPartialSyncingControls && (\n\t\t\t\t\t<PartialSyncingControls { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\nif ( window.__experimentalPatternPartialSyncing ) {\n\taddFilter(\n\t\t'editor.BlockEdit',\n\t\t'core/editor/with-partial-syncing-controls',\n\t\twithPartialSyncingControls\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;AAC/C,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAM;EACLC,sBAAsB;EACtBC,aAAa;EACbC;AACD,CAAC,GAAGH,MAAM,CAAEP,mBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,0BAA0B,GAAGV,0BAA0B,CAC1DW,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GAAGZ,mBAAmB,CAAC,CAAC;EAC9C,MAAMa,sBAAsB,GAAGZ,eAAe,CAC7CU,KAAK,CAACG,IAAI,EACV,2BAA2B,EAC3B,KACD,CAAC;EACD,MAAMC,gBAAgB,GAAGb,SAAS,CAC/Bc,MAAM,IACPA,MAAM,CAAEZ,WAAY,CAAC,CAACa,kBAAkB,CAAC,CAAC,KAC1CV,aAAa,CAACW,IAAI,EACnB,EACD,CAAC;EAED,MAAMC,gCAAgC,GACrCN,sBAAsB,IACtBF,KAAK,CAACS,UAAU,IAChBL,gBAAgB,IAChBH,gBAAgB,KAAK,SAAS,IAC9BS,MAAM,CAACC,IAAI,CAAEd,gCAAiC,CAAC,CAACe,QAAQ,CACvDZ,KAAK,CAACG,IACP,CAAC;EAEF,OACCU,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACd,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBQ,gCAAgC,IACjCK,aAAA,CAAClB,sBAAsB;IAAA,GAAMK;EAAK,CAAI,CAEtC,CAAC;AAEL,CACD,CAAC;AAED,IAAKe,MAAM,CAACC,mCAAmC,EAAG;EACjD/B,SAAS,CACR,kBAAkB,EAClB,2CAA2C,EAC3Ca,0BACD,CAAC;AACF"}
@@ -1,16 +1,20 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
+ import EditorCanvas from './components/editor-canvas';
4
5
  import { ExperimentalEditorProvider } from './components/provider';
5
6
  import { lock } from './lock-unlock';
6
7
  import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
7
8
  import useBlockEditorSettings from './components/provider/use-block-editor-settings';
8
9
  import PostPanelRow from './components/post-panel-row';
10
+ import PreviewDropdown from './components/preview-dropdown';
9
11
  export const privateApis = {};
10
12
  lock(privateApis, {
13
+ EditorCanvas,
11
14
  ExperimentalEditorProvider,
12
15
  EntitiesSavedStatesExtensible,
13
16
  PostPanelRow,
17
+ PreviewDropdown,
14
18
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
15
19
  useBlockEditorSettings
16
20
  });
@@ -1 +1 @@
1
- {"version":3,"names":["ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","PostPanelRow","privateApis"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport PostPanelRow from './components/post-panel-row';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tExperimentalEditorProvider,\n\tEntitiesSavedStatesExtensible,\n\tPostPanelRow,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,YAAY,MAAM,6BAA6B;AAEtD,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BJ,IAAI,CAAEI,WAAW,EAAE;EAClBL,0BAA0B;EAC1BE,6BAA6B;EAC7BE,YAAY;EAEZ;EACAD;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["EditorCanvas","ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","PostPanelRow","PreviewDropdown","privateApis"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorCanvas from './components/editor-canvas';\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport PostPanelRow from './components/post-panel-row';\nimport PreviewDropdown from './components/preview-dropdown';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tEditorCanvas,\n\tExperimentalEditorProvider,\n\tEntitiesSavedStatesExtensible,\n\tPostPanelRow,\n\tPreviewDropdown,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,YAAY,MAAM,4BAA4B;AACrD,SAASC,0BAA0B,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,eAAe,MAAM,+BAA+B;AAE3D,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BL,IAAI,CAAEK,WAAW,EAAE;EAClBP,YAAY;EACZC,0BAA0B;EAC1BE,6BAA6B;EAC7BE,YAAY;EACZC,eAAe;EAEf;EACAF;AACD,CAAE,CAAC"}
@@ -28,7 +28,7 @@ import { getNotificationArgumentsForSaveSuccess, getNotificationArgumentsForSave
28
28
  export const setupEditor = (post, edits, template) => ({
29
29
  dispatch
30
30
  }) => {
31
- dispatch.setupEditorState(post);
31
+ dispatch.setEditedPost(post.type, post.id);
32
32
  // Apply a template for new posts only, if exists.
33
33
  const isNewPost = post.status === 'auto-draft';
34
34
  if (isNewPost && template) {
@@ -59,11 +59,16 @@ export const setupEditor = (post, edits, template) => ({
59
59
  * Returns an action object signalling that the editor is being destroyed and
60
60
  * that any necessary state or side-effect cleanup should occur.
61
61
  *
62
+ * @deprecated
63
+ *
62
64
  * @return {Object} Action object.
63
65
  */
64
66
  export function __experimentalTearDownEditor() {
67
+ deprecated("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor", {
68
+ since: '6.5'
69
+ });
65
70
  return {
66
- type: 'TEAR_DOWN_EDITOR'
71
+ type: 'DO_NOTHING'
67
72
  };
68
73
  }
69
74
 
@@ -102,17 +107,33 @@ export function updatePost() {
102
107
  }
103
108
 
104
109
  /**
105
- * Returns an action object used to setup the editor state when first opening
106
- * an editor.
110
+ * Setup the editor state.
111
+ *
112
+ * @deprecated
107
113
  *
108
114
  * @param {Object} post Post object.
115
+ */
116
+ export function setupEditorState(post) {
117
+ deprecated("wp.data.dispatch( 'core/editor' ).setupEditorState", {
118
+ since: '6.5',
119
+ alternative: "wp.data.dispatch( 'core/editor' ).setEditedPost"
120
+ });
121
+ return setEditedPost(post.type, post.id);
122
+ }
123
+
124
+ /**
125
+ * Returns an action that sets the current post Type and post ID.
126
+ *
127
+ * @param {string} postType Post Type.
128
+ * @param {string} postId Post ID.
109
129
  *
110
130
  * @return {Object} Action object.
111
131
  */
112
- export function setupEditorState(post) {
132
+ export function setEditedPost(postType, postId) {
113
133
  return {
114
- type: 'SETUP_EDITOR_STATE',
115
- post
134
+ type: 'SET_EDITED_POST',
135
+ postType,
136
+ postId
116
137
  };
117
138
  }
118
139
 
@@ -546,15 +567,38 @@ export function updateEditorSettings(settings) {
546
567
  */
547
568
  export const setRenderingMode = mode => ({
548
569
  dispatch,
549
- registry
570
+ registry,
571
+ select
550
572
  }) => {
551
- registry.dispatch(blockEditorStore).clearSelectedBlock();
573
+ if (select.__unstableIsEditorReady()) {
574
+ // We clear the block selection but we also need to clear the selection from the core store.
575
+ registry.dispatch(blockEditorStore).clearSelectedBlock();
576
+ dispatch.editPost({
577
+ selection: undefined
578
+ }, {
579
+ undoIgnore: true
580
+ });
581
+ }
552
582
  dispatch({
553
583
  type: 'SET_RENDERING_MODE',
554
584
  mode
555
585
  });
556
586
  };
557
587
 
588
+ /**
589
+ * Action that changes the width of the editing canvas.
590
+ *
591
+ * @param {string} deviceType
592
+ *
593
+ * @return {Object} Action object.
594
+ */
595
+ export function setDeviceType(deviceType) {
596
+ return {
597
+ type: 'SET_DEVICE_TYPE',
598
+ deviceType
599
+ };
600
+ }
601
+
558
602
  /**
559
603
  * Backward compatibility
560
604
  */
@@ -1 +1 @@
1
- {"version":3,"names":["apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","applyFilters","preferencesStore","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","_post$key$raw","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","Promise","resolve","catch","err","args","length","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","__unstableSaveForPreview","forceIsAutosaveable","isEditedPostAutosaveable","isPostLocked","isDraft","includes","isPreview","getEditedPostPreviewLink","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","setRenderingMode","mode","clearSelectedBlock","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"sources":["@wordpress/editor/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\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';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\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 const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setupEditorState( post );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\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 * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\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 */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\n\t\tlet error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\n\t\tif ( ! error ) {\n\t\t\tawait applyFilters(\n\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\tPromise.resolve(),\n\t\t\t\toptions\n\t\t\t).catch( ( err ) => {\n\t\t\t\terror = err;\n\t\t\t} );\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. 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 const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( local ) {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\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 * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\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 * Action that unlocks post saving.\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 * Action that locks post autosaving.\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 * Action that unlocks post autosaving.\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 */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\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 * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `all`: This is the default mode. It renders the post editor with all the features available. If a template is provided, it's preferred over the post.\n * - `template-only`: This mode renders the editor with only the template blocks visible.\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'template-only', 'post-only', 'template-locked' or 'all').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\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\tversion: '6.2',\n\t\t} );\n\t\tregistry.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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SACCC,KAAK,EACLC,6BAA6B,EAC7BC,2BAA2B,QACrB,mBAAmB;AAC1B,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,aAAa;AAClD,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SACCC,sCAAsC,EACtCC,mCAAmC,EACnCC,oCAAoC,QAC9B,wBAAwB;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACvBA,CAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,KACvB,CAAE;EAAEC;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAACC,gBAAgB,CAAEJ,IAAK,CAAC;EACjC;EACA,MAAMK,SAAS,GAAGL,IAAI,CAACM,MAAM,KAAK,YAAY;EAC9C,IAAKD,SAAS,IAAIH,QAAQ,EAAG;IAC5B;IACA;IACA;IACA,IAAIK,OAAO;IACX,IAAK,SAAS,IAAIN,KAAK,EAAG;MACzBM,OAAO,GAAGN,KAAK,CAACM,OAAO;IACxB,CAAC,MAAM;MACNA,OAAO,GAAGP,IAAI,CAACO,OAAO,CAACC,GAAG;IAC3B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AI,EAAE,kBAAkB;IACxBkE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAChCA,CAAA,KACA,CAAE;EAAE3D;AAAS,CAAC,KAAM;EACnBA,QAAQ,CACNzB,QAAQ,CAAEV,gBAAiB,CAAC,CAC5B+F,GAAG,CAAE,gBAAgB,EAAE,yBAAyB,EAAE,IAAK,CAAC;AAC3D,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAE7D;AAAS,CAAC,KAAM;EACnBA,QAAQ,CACNzB,QAAQ,CAAEV,gBAAiB,CAAC,CAC5B+F,GAAG,CAAE,gBAAgB,EAAE,yBAAyB,EAAE,KAAM,CAAC;AAC5D,CAAC;;AAEF;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;AACA,OAAO,SAASE,cAAcA,CAAEC,QAAQ,EAAG;EAC1C,OAAO;IACNvE,IAAI,EAAE,kBAAkB;IACxBuE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAED,QAAQ,EAAG;EAC5C,OAAO;IACNvE,IAAI,EAAE,oBAAoB;IAC1BuE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAAEF,QAAQ,EAAG;EAC9C,OAAO;IACNvE,IAAI,EAAE,sBAAsB;IAC5BuE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,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cAAe,CAAC;;AAElE;AACA;AACA;AACA,OAAO,MAAMwB,WAAW,GAAGxB,oBAAoB,CAAE,aAAc,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAMyB,eAAe,GAAGzB,oBAAoB,CAAE,iBAAkB,CAAC;;AAExE;AACA;AACA;AACA,OAAO,MAAM0B,WAAW,GAAG1B,oBAAoB,CAAE,aAAc,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAM2B,UAAU,GAAG3B,oBAAoB,CAAE,YAAa,CAAC;;AAE9D;AACA;AACA;AACA,OAAO,MAAM4B,kBAAkB,GAAG5B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM6B,iBAAiB,GAAG7B,oBAAoB,CAAE,mBAAoB,CAAC;;AAE5E;AACA;AACA;AACA,OAAO,MAAM8B,kBAAkB,GAAG9B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM+B,uBAAuB,GAAG/B,oBAAoB,CAC1D,yBACD,CAAC"}
1
+ {"version":3,"names":["apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","applyFilters","preferencesStore","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setEditedPost","type","id","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","_post$key$raw","editPost","__experimentalTearDownEditor","since","resetPost","version","alternative","updatePost","setupEditorState","postType","postId","options","select","registry","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","Promise","resolve","catch","err","args","length","createErrorNotice","updatedRecord","previousPost","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","__unstableSaveForPreview","forceIsAutosaveable","isEditedPostAutosaveable","isPostLocked","isDraft","includes","isPreview","getEditedPostPreviewLink","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","setRenderingMode","mode","__unstableIsEditorReady","clearSelectedBlock","undefined","setDeviceType","deviceType","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"sources":["@wordpress/editor/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\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';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\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 const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setEditedPost( post.type, post.id );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\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 * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t}\n\t);\n\treturn { type: 'DO_NOTHING' };\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 * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\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 * Setup the editor state.\n *\n * @deprecated\n *\n * @param {Object} post Post object.\n */\nexport function setupEditorState( post ) {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).setupEditorState\", {\n\t\tsince: '6.5',\n\t\talternative: \"wp.data.dispatch( 'core/editor' ).setEditedPost\",\n\t} );\n\treturn setEditedPost( post.type, post.id );\n}\n\n/**\n * Returns an action that sets the current post Type and post ID.\n *\n * @param {string} postType Post Type.\n * @param {string} postId Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPost( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tpostId,\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 */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\n\t\tlet error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\n\t\tif ( ! error ) {\n\t\t\tawait applyFilters(\n\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\tPromise.resolve(),\n\t\t\t\toptions\n\t\t\t).catch( ( err ) => {\n\t\t\t\terror = err;\n\t\t\t} );\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. 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 const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( local ) {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\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 * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\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 * Action that unlocks post saving.\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 * Action that locks post autosaving.\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 * Action that unlocks post autosaving.\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 */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\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 * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `all`: This is the default mode. It renders the post editor with all the features available. If a template is provided, it's preferred over the post.\n * - `template-only`: This mode renders the editor with only the template blocks visible.\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'template-only', 'post-only', 'template-locked' or 'all').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry, select } ) => {\n\t\tif ( select.__unstableIsEditorReady() ) {\n\t\t\t// We clear the block selection but we also need to clear the selection from the core store.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\tdispatch.editPost( { selection: undefined }, { undoIgnore: true } );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function setDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\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\tversion: '6.2',\n\t\t} );\n\t\tregistry.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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SACCC,KAAK,EACLC,6BAA6B,EAC7BC,2BAA2B,QACrB,mBAAmB;AAC1B,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,aAAa;AAClD,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SACCC,sCAAsC,EACtCC,mCAAmC,EACnCC,oCAAoC,QAC9B,wBAAwB;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACvBA,CAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,KACvB,CAAE;EAAEC;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAACC,aAAa,CA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A;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,OAAO,SAASE,cAAcA,CAAEC,QAAQ,EAAG;EAC1C,OAAO;IACNxF,IAAI,EAAE,kBAAkB;IACxBwF;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAED,QAAQ,EAAG;EAC5C,OAAO;IACNxF,IAAI,EAAE,oBAAoB;IAC1BwF;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAAEF,QAAQ,EAAG;EAC9C,OAAO;IACNxF,IAAI,EAAE,sBAAsB;IAC5BwF;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,oBAAoBA,CAAEH,QAAQ,EAAG;EAChD,OAAO;IACNxF,IAAI,EAAE,wBAAwB;IAC9BwF;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMjF,iBAAiB,GAC7BA,CAAED,MAAM,EAAEmB,OAAO,GAAG,CAAC,CAAC,KACtB,CAAE;EAAEC,MAAM;EAAE5B,QAAQ;EAAE6B;AAAS,CAAC,KAAM;EACrC,MAAM;IAAEnB,+BAA+B;IAAEoF;EAAU,CAAC,GAAGnE,OAAO;EAC9D,MAAM7B,KAAK,GAAG;IAAEU,MAAM;IAAEsF;EAAU,CAAC;EAEnC,IAAKpF,+BAA+B,KAAK,KAAK,EAAG;IAChD,MAAM;MAAEP,EAAE;MAAED;IAAK,CAAC,GAAG0B,MAAM,C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C;;AAExE;AACA;AACA;AACA,OAAO,MAAM0B,WAAW,GAAG1B,oBAAoB,CAAE,aAAc,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAM2B,UAAU,GAAG3B,oBAAoB,CAAE,YAAa,CAAC;;AAE9D;AACA;AACA;AACA,OAAO,MAAM4B,kBAAkB,GAAG5B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM6B,iBAAiB,GAAG7B,oBAAoB,CAAE,mBAAoB,CAAC;;AAE5E;AACA;AACA;AACA,OAAO,MAAM8B,kBAAkB,GAAG9B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM+B,uBAAuB,GAAG/B,oBAAoB,CAC1D,yBACD,CAAC"}
@@ -25,6 +25,7 @@ export const EDITOR_SETTINGS_DEFAULTS = {
25
25
  ...SETTINGS_DEFAULTS,
26
26
  richEditingEnabled: true,
27
27
  codeEditingEnabled: true,
28
- enableCustomFields: undefined
28
+ enableCustomFields: undefined,
29
+ defaultRenderingMode: 'post-only'
29
30
  };
30
31
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SETTINGS_DEFAULTS","EDITOR_SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,GAAGD,iBAAiB;EAEpBE,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC;AACrB,CAAC"}
1
+ {"version":3,"names":["SETTINGS_DEFAULTS","EDITOR_SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","defaultRenderingMode"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n\tdefaultRenderingMode: 'post-only',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,GAAGD,iBAAiB;EAEpBE,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC"}
@@ -9,7 +9,9 @@ import { createReduxStore, register } from '@wordpress/data';
9
9
  import reducer from './reducer';
10
10
  import * as selectors from './selectors';
11
11
  import * as actions from './actions';
12
+ import * as privateActions from './private-actions';
12
13
  import { STORE_NAME } from './constants';
14
+ import { unlock } from '../lock-unlock';
13
15
 
14
16
  /**
15
17
  * Post editor data store configuration.
@@ -35,4 +37,5 @@ export const store = createReduxStore(STORE_NAME, {
35
37
  ...storeConfig
36
38
  });
37
39
  register(store);
40
+ unlock(store).registerPrivateActions(privateActions);
38
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createReduxStore","register","reducer","selectors","actions","STORE_NAME","storeConfig","store"],"sources":["@wordpress/editor/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAG;EAC1BJ,OAAO;EACPC,SAAS;EACTC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,KAAK,GAAGP,gBAAgB,CAAEK,UAAU,EAAE;EAClD,GAAGC;AACJ,CAAE,CAAC;AAEHL,QAAQ,CAAEM,KAAM,CAAC"}
1
+ {"version":3,"names":["createReduxStore","register","reducer","selectors","actions","privateActions","STORE_NAME","unlock","storeConfig","store","registerPrivateActions"],"sources":["@wordpress/editor/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,cAAc,MAAM,mBAAmB;AACnD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAG;EAC1BN,OAAO;EACPC,SAAS;EACTC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,KAAK,GAAGT,gBAAgB,CAAEM,UAAU,EAAE;EAClD,GAAGE;AACJ,CAAE,CAAC;AAEHP,QAAQ,CAAEQ,KAAM,CAAC;AACjBF,MAAM,CAAEE,KAAM,CAAC,CAACC,sBAAsB,CAAEL,cAAe,CAAC"}