@wordpress/editor 13.26.1-next.79a6196f.0 → 13.27.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 (132) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/build/bindings/index.js +20 -0
  3. package/build/bindings/index.js.map +1 -0
  4. package/build/bindings/post-meta.js +52 -0
  5. package/build/bindings/post-meta.js.map +1 -0
  6. package/build/components/block-manager/category.js +106 -0
  7. package/build/components/block-manager/category.js.map +1 -0
  8. package/build/components/block-manager/checklist.js +35 -0
  9. package/build/components/block-manager/checklist.js.map +1 -0
  10. package/build/components/block-manager/index.js +130 -0
  11. package/build/components/block-manager/index.js.map +1 -0
  12. package/build/components/document-tools/index.js +58 -52
  13. package/build/components/document-tools/index.js.map +1 -1
  14. package/build/components/editor-canvas/index.js +4 -4
  15. package/build/components/editor-canvas/index.js.map +1 -1
  16. package/build/components/editor-notices/index.js +11 -11
  17. package/build/components/editor-notices/index.js.map +1 -1
  18. package/build/components/entities-saved-states/entity-type-list.js +38 -7
  19. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  20. package/build/components/offline-status/index.native.js +1 -3
  21. package/build/components/offline-status/index.native.js.map +1 -1
  22. package/build/components/post-locked-modal/index.js +1 -1
  23. package/build/components/post-locked-modal/index.js.map +1 -1
  24. package/build/components/post-saved-state/index.js +10 -24
  25. package/build/components/post-saved-state/index.js.map +1 -1
  26. package/build/components/post-schedule/check.js +5 -16
  27. package/build/components/post-schedule/check.js.map +1 -1
  28. package/build/components/preferences-modal/enable-panel.js +42 -0
  29. package/build/components/preferences-modal/enable-panel.js.map +1 -0
  30. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +33 -0
  31. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
  32. package/build/components/preferences-modal/index.js +186 -0
  33. package/build/components/preferences-modal/index.js.map +1 -0
  34. package/build/components/provider/disable-non-page-content-blocks.js +1 -4
  35. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  36. package/build/components/provider/use-block-editor-settings.js +34 -8
  37. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  38. package/build/hooks/pattern-partial-syncing.js +12 -6
  39. package/build/hooks/pattern-partial-syncing.js.map +1 -1
  40. package/build/index.js +1 -0
  41. package/build/index.js.map +1 -1
  42. package/build/private-apis.js +6 -2
  43. package/build/private-apis.js.map +1 -1
  44. package/build/store/defaults.js +2 -0
  45. package/build/store/defaults.js.map +1 -1
  46. package/build/store/private-actions.js +33 -1
  47. package/build/store/private-actions.js.map +1 -1
  48. package/build/store/private-selectors.js +1 -1
  49. package/build/store/private-selectors.js.map +1 -1
  50. package/build-module/bindings/index.js +15 -0
  51. package/build-module/bindings/index.js.map +1 -0
  52. package/build-module/bindings/post-meta.js +45 -0
  53. package/build-module/bindings/post-meta.js.map +1 -0
  54. package/build-module/components/block-manager/category.js +97 -0
  55. package/build-module/components/block-manager/category.js.map +1 -0
  56. package/build-module/components/block-manager/checklist.js +27 -0
  57. package/build-module/components/block-manager/checklist.js.map +1 -0
  58. package/build-module/components/block-manager/index.js +121 -0
  59. package/build-module/components/block-manager/index.js.map +1 -0
  60. package/build-module/components/document-tools/index.js +58 -52
  61. package/build-module/components/document-tools/index.js.map +1 -1
  62. package/build-module/components/editor-canvas/index.js +4 -4
  63. package/build-module/components/editor-canvas/index.js.map +1 -1
  64. package/build-module/components/editor-notices/index.js +12 -12
  65. package/build-module/components/editor-notices/index.js.map +1 -1
  66. package/build-module/components/entities-saved-states/entity-type-list.js +39 -8
  67. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  68. package/build-module/components/offline-status/index.native.js +1 -3
  69. package/build-module/components/offline-status/index.native.js.map +1 -1
  70. package/build-module/components/post-locked-modal/index.js +1 -1
  71. package/build-module/components/post-locked-modal/index.js.map +1 -1
  72. package/build-module/components/post-saved-state/index.js +11 -25
  73. package/build-module/components/post-saved-state/index.js.map +1 -1
  74. package/build-module/components/post-schedule/check.js +6 -15
  75. package/build-module/components/post-schedule/check.js.map +1 -1
  76. package/build-module/components/preferences-modal/enable-panel.js +34 -0
  77. package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
  78. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +24 -0
  79. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
  80. package/build-module/components/preferences-modal/index.js +179 -0
  81. package/build-module/components/preferences-modal/index.js.map +1 -0
  82. package/build-module/components/provider/disable-non-page-content-blocks.js +1 -4
  83. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  84. package/build-module/components/provider/use-block-editor-settings.js +35 -9
  85. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  86. package/build-module/hooks/pattern-partial-syncing.js +12 -6
  87. package/build-module/hooks/pattern-partial-syncing.js.map +1 -1
  88. package/build-module/index.js +1 -0
  89. package/build-module/index.js.map +1 -1
  90. package/build-module/private-apis.js +6 -2
  91. package/build-module/private-apis.js.map +1 -1
  92. package/build-module/store/defaults.js +2 -0
  93. package/build-module/store/defaults.js.map +1 -1
  94. package/build-module/store/private-actions.js +29 -0
  95. package/build-module/store/private-actions.js.map +1 -1
  96. package/build-module/store/private-selectors.js +1 -1
  97. package/build-module/store/private-selectors.js.map +1 -1
  98. package/build-style/style-rtl.css +80 -12
  99. package/build-style/style.css +80 -12
  100. package/package.json +33 -33
  101. package/src/bindings/index.js +13 -0
  102. package/src/bindings/post-meta.js +42 -0
  103. package/src/components/block-manager/category.js +96 -0
  104. package/src/components/block-manager/checklist.js +30 -0
  105. package/src/components/block-manager/index.js +160 -0
  106. package/src/components/block-manager/style.scss +82 -0
  107. package/src/components/document-tools/index.js +9 -1
  108. package/src/components/editor-canvas/index.js +3 -2
  109. package/src/components/editor-notices/index.js +11 -12
  110. package/src/components/editor-notices/style.scss +0 -1
  111. package/src/components/entities-saved-states/entity-type-list.js +47 -5
  112. package/src/components/entities-saved-states/style.scss +4 -0
  113. package/src/components/offline-status/index.native.js +2 -4
  114. package/src/components/post-locked-modal/index.js +1 -1
  115. package/src/components/post-locked-modal/style.scss +0 -6
  116. package/src/components/post-saved-state/index.js +30 -47
  117. package/src/components/post-schedule/check.js +10 -14
  118. package/src/components/post-schedule/test/check.js +24 -9
  119. package/src/components/preferences-modal/enable-panel.js +30 -0
  120. package/src/components/preferences-modal/enable-plugin-document-setting-panel.js +23 -0
  121. package/src/components/preferences-modal/index.js +269 -0
  122. package/src/components/preferences-modal/test/index.js +28 -0
  123. package/src/components/provider/disable-non-page-content-blocks.js +3 -3
  124. package/src/components/provider/use-block-editor-settings.js +45 -17
  125. package/src/hooks/pattern-partial-syncing.js +26 -22
  126. package/src/index.js +1 -0
  127. package/src/private-apis.js +6 -2
  128. package/src/store/defaults.js +2 -0
  129. package/src/store/private-actions.js +49 -0
  130. package/src/store/private-selectors.js +1 -1
  131. package/src/style.scss +1 -1
  132. package/src/components/editor-canvas/style.scss +0 -5
@@ -3,10 +3,11 @@
3
3
  */
4
4
  import { Platform, useMemo, useCallback } from '@wordpress/element';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
- import { store as coreStore, __experimentalFetchLinkSuggestions as fetchLinkSuggestions, __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
6
+ import { store as coreStore, __experimentalFetchLinkSuggestions as fetchLinkSuggestions, __experimentalFetchUrlData as fetchUrlData, fetchBlockPatterns } from '@wordpress/core-data';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  import { store as preferencesStore } from '@wordpress/preferences';
9
9
  import { useViewportMatch } from '@wordpress/compose';
10
+ import { store as blocksStore } from '@wordpress/blocks';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
@@ -15,7 +16,7 @@ import inserterMediaCategories from '../media-categories';
15
16
  import { mediaUpload } from '../../utils';
16
17
  import { store as editorStore } from '../../store';
17
18
  const EMPTY_BLOCKS_LIST = [];
18
- const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'getPostLinkProps', 'hasInlineToolbar', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
19
+ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'getPostLinkProps', 'hasInlineToolbar', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
19
20
 
20
21
  /**
21
22
  * React hook used to compute the block editor settings to use for the post editor.
@@ -31,18 +32,19 @@ function useBlockEditorSettings(settings, postType, postId) {
31
32
  const isLargeViewport = useViewportMatch('medium');
32
33
  const {
33
34
  allowRightClickOverrides,
35
+ blockTypes,
34
36
  focusMode,
35
37
  hasFixedToolbar,
36
38
  isDistractionFree,
37
39
  keepCaretInsideBlock,
38
40
  reusableBlocks,
39
41
  hasUploadPermissions,
42
+ hiddenBlockTypes,
40
43
  canUseUnfilteredHTML,
41
44
  userCanCreatePages,
42
45
  pageOnFront,
43
46
  pageForPosts,
44
47
  userPatternCategories,
45
- restBlockPatterns,
46
48
  restBlockPatternCategories
47
49
  } = useSelect(select => {
48
50
  var _canUser;
@@ -53,18 +55,22 @@ function useBlockEditorSettings(settings, postType, postId) {
53
55
  getEntityRecord,
54
56
  getUserPatternCategories,
55
57
  getEntityRecords,
56
- getBlockPatterns,
57
58
  getBlockPatternCategories
58
59
  } = select(coreStore);
59
60
  const {
60
61
  get
61
62
  } = select(preferencesStore);
63
+ const {
64
+ getBlockTypes
65
+ } = select(blocksStore);
62
66
  const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
63
67
  return {
64
68
  allowRightClickOverrides: get('core', 'allowRightClickOverrides'),
69
+ blockTypes: getBlockTypes(),
65
70
  canUseUnfilteredHTML: getRawEntityRecord('postType', postType, postId)?._links?.hasOwnProperty('wp:action-unfiltered-html'),
66
71
  focusMode: get('core', 'focusMode'),
67
72
  hasFixedToolbar: get('core', 'fixedToolbar') || !isLargeViewport,
73
+ hiddenBlockTypes: get('core', 'hiddenBlockTypes'),
68
74
  isDistractionFree: get('core', 'distractionFree'),
69
75
  keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'),
70
76
  reusableBlocks: isWeb ? getEntityRecords('postType', 'wp_block', {
@@ -76,7 +82,6 @@ function useBlockEditorSettings(settings, postType, postId) {
76
82
  pageOnFront: siteSettings?.page_on_front,
77
83
  pageForPosts: siteSettings?.page_for_posts,
78
84
  userPatternCategories: getUserPatternCategories(),
79
- restBlockPatterns: getBlockPatterns(),
80
85
  restBlockPatternCategories: getBlockPatternCategories()
81
86
  };
82
87
  }, [postType, postId, isLargeViewport]);
@@ -87,11 +92,11 @@ function useBlockEditorSettings(settings, postType, postId) {
87
92
  // WP 6.0
88
93
  settings.__experimentalBlockPatternCategories; // WP 5.9
89
94
 
90
- const blockPatterns = useMemo(() => [...(settingsBlockPatterns || []), ...(restBlockPatterns || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)).filter(({
95
+ const blockPatterns = useMemo(() => [...(settingsBlockPatterns || [])].filter(({
91
96
  postTypes
92
97
  }) => {
93
98
  return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType);
94
- }), [settingsBlockPatterns, restBlockPatterns, postType]);
99
+ }), [settingsBlockPatterns, postType]);
95
100
  const blockPatternCategories = useMemo(() => [...(settingsBlockPatternCategories || []), ...(restBlockPatternCategories || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)), [settingsBlockPatternCategories, restBlockPatternCategories]);
96
101
  const {
97
102
  undo,
@@ -116,17 +121,38 @@ function useBlockEditorSettings(settings, postType, postId) {
116
121
  }
117
122
  return saveEntityRecord('postType', 'page', options);
118
123
  }, [saveEntityRecord, userCanCreatePages]);
124
+ const allowedBlockTypes = useMemo(() => {
125
+ // Omit hidden block types if exists and non-empty.
126
+ if (hiddenBlockTypes && hiddenBlockTypes.length > 0) {
127
+ // Defer to passed setting for `allowedBlockTypes` if provided as
128
+ // anything other than `true` (where `true` is equivalent to allow
129
+ // all block types).
130
+ const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
131
+ name
132
+ }) => name) : settings.allowedBlockTypes || [];
133
+ return defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
134
+ }
135
+ return settings.allowedBlockTypes;
136
+ }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
119
137
  const forceDisableFocusMode = settings.focusMode === false;
120
138
  return useMemo(() => ({
121
139
  ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
140
+ allowedBlockTypes,
122
141
  allowRightClickOverrides,
123
142
  focusMode: focusMode && !forceDisableFocusMode,
124
143
  hasFixedToolbar,
125
144
  isDistractionFree,
126
145
  keepCaretInsideBlock,
127
146
  mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
128
- __experimentalReusableBlocks: reusableBlocks,
129
147
  __experimentalBlockPatterns: blockPatterns,
148
+ __experimentalFetchBlockPatterns: async () => {
149
+ return (await fetchBlockPatterns()).filter(({
150
+ postTypes
151
+ }) => {
152
+ return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType);
153
+ });
154
+ },
155
+ __experimentalReusableBlocks: reusableBlocks,
130
156
  __experimentalBlockPatternCategories: blockPatternCategories,
131
157
  __experimentalUserPatternCategories: userPatternCategories,
132
158
  __experimentalFetchLinkSuggestions: (search, searchOptions) => fetchLinkSuggestions(search, searchOptions, settings),
@@ -149,7 +175,7 @@ function useBlockEditorSettings(settings, postType, postId) {
149
175
  templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
150
176
  template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
151
177
  __experimentalSetIsInserterOpened: setIsInserterOpened
152
- }), [allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, reusableBlocks, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened]);
178
+ }), [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, reusableBlocks, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened]);
153
179
  }
154
180
  export default useBlockEditorSettings;
155
181
  //# sourceMappingURL=use-block-editor-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","preferencesStore","useViewportMatch","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatterns","restBlockPatternCategories","select","_canUser","isWeb","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","getBlockPatterns","getBlockPatternCategories","get","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","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","forceDisableFocusMode","Object","fromEntries","entries","key","__experimentalReusableBlocks","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"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';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\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'__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'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'getPostLinkProps',\n\t'hasInlineToolbar',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\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 isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\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\t\t\tconst { get } = select( preferencesStore );\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\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\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\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\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, isLargeViewport ]\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, setIsInserterOpened } = 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\tconst forceDisableFocusMode = settings.focusMode === false;\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\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\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\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\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\tsetIsInserterOpened,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,QACpC,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,qBAAqB;AACzD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASV,KAAK,IAAIW,WAAW,QAAQ,aAAa;AAElD,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,MAAMC,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,wCAAwC,EACxC,kCAAkC,EAClC,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,8BAA8B,EAC9B,WAAW,EACX,WA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BAAkB;IACpDC,WAAW;IACXC,YAAY;IACZiE,kCAAkC,EAAEhF,QAAQ,KAAK,aAAa;IAC9DiF,YAAY,EACXjF,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACkF,YAAY;IAChEC,QAAQ,EACPlF,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACmF,QAAQ;IACrBC,iCAAiC,EAAEzB;EACpC,CAAC,CAAE,EACH,CACCrD,wBAAwB,EACxBC,SAAS,EACT2D,qBAAqB,EACrB1D,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBV,QAAQ,EACRY,oBAAoB,EACpBD,cAAc,EACdM,qBAAqB,EACrB4B,aAAa,EACbY,sBAAsB,EACtB5C,oBAAoB,EACpB6C,IAAI,EACJG,gBAAgB,EAChB/C,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZf,QAAQ,EACR0D,mBAAmB,CAErB,CAAC;AACF;AAEA,eAAe5D,sBAAsB"}
1
+ {"version":3,"names":["Platform","useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","fetchBlockPatterns","__","preferencesStore","useViewportMatch","blocksStore","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","reusableBlocks","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","select","_canUser","isWeb","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","getBlockPatternCategories","get","getBlockTypes","siteSettings","undefined","_links","hasOwnProperty","per_page","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","Object","fromEntries","entries","key","__experimentalFetchBlockPatterns","__experimentalReusableBlocks","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"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\tfetchBlockPatterns,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\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'__unstableGalleryWithImageBlocks',\n\t'alignWide',\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'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'getPostLinkProps',\n\t'hasInlineToolbar',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\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 isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\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\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\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\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\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\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\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\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport ]\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[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { 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\t),\n\t\t[ settingsBlockPatterns, 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, setIsInserterOpened } = 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\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\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\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalFetchBlockPatterns: async () => {\n\t\t\t\treturn ( await fetchBlockPatterns() ).filter(\n\t\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\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\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\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\tsetIsInserterOpened,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,EAC1CC,kBAAkB,QACZ,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAAST,KAAK,IAAIU,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,qBAAqB;AACzD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASZ,KAAK,IAAIa,WAAW,QAAQ,aAAa;AAElD,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,MAAMC,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,wCAAwC,EACxC,kCAAkC,EAClC,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,mB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B/D,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBX,QAAQ,EACRa,oBAAoB,EACpBD,cAAc,EACdO,qBAAqB,EACrB2B,aAAa,EACbM,sBAAsB,EACtBrC,oBAAoB,EACpB4C,IAAI,EACJG,gBAAgB,EAChB9C,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZjB,QAAQ,EACR2D,mBAAmB,CAErB,CAAC;AACF;AAEA,eAAe7D,sBAAsB"}
@@ -29,16 +29,22 @@ const {
29
29
  * @return {Component} Wrapped component.
30
30
  */
31
31
  const withPartialSyncingControls = createHigherOrderComponent(BlockEdit => props => {
32
- const blockEditingMode = useBlockEditingMode();
33
- const isEditingPattern = useSelect(select => select(editorStore).getCurrentPostType() === PATTERN_TYPES.user, []);
34
- const shouldShowPartialSyncingControls = props.isSelected && isEditingPattern && blockEditingMode === 'default' && Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
32
+ const isSupportedBlock = Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
35
33
  return createElement(Fragment, null, createElement(BlockEdit, {
36
34
  ...props
37
- }), shouldShowPartialSyncingControls && createElement(PartialSyncingControls, {
35
+ }), props.isSelected && isSupportedBlock && createElement(ControlsWithStoreSubscription, {
38
36
  ...props
39
37
  }));
40
38
  });
41
- if (window.__experimentalPatternPartialSyncing) {
42
- addFilter('editor.BlockEdit', 'core/editor/with-partial-syncing-controls', withPartialSyncingControls);
39
+
40
+ // Split into a separate component to avoid a store subscription
41
+ // on every block.
42
+ function ControlsWithStoreSubscription(props) {
43
+ const blockEditingMode = useBlockEditingMode();
44
+ const isEditingPattern = useSelect(select => select(editorStore).getCurrentPostType() === PATTERN_TYPES.user, []);
45
+ return isEditingPattern && blockEditingMode === 'default' && createElement(PartialSyncingControls, {
46
+ ...props
47
+ });
43
48
  }
49
+ addFilter('editor.BlockEdit', 'core/editor/with-partial-syncing-controls', withPartialSyncingControls);
44
50
  //# sourceMappingURL=pattern-partial-syncing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","editorStore","unlock","PartialSyncingControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","withPartialSyncingControls","BlockEdit","props","blockEditingMode","isEditingPattern","select","getCurrentPostType","user","shouldShowPartialSyncingControls","isSelected","Object","keys","includes","name","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 { 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 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\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,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,CAAEN,mBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMU,0BAA0B,GAAGT,0BAA0B,CAC1DU,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GAAGX,mBAAmB,CAAC,CAAC;EAC9C,MAAMY,gBAAgB,GAAGX,SAAS,CAC/BY,MAAM,IACPA,MAAM,CAAEV,WAAY,CAAC,CAACW,kBAAkB,CAAC,CAAC,KAC1CR,aAAa,CAACS,IAAI,EACnB,EACD,CAAC;EAED,MAAMC,gCAAgC,GACrCN,KAAK,CAACO,UAAU,IAChBL,gBAAgB,IAChBD,gBAAgB,KAAK,SAAS,IAC9BO,MAAM,CAACC,IAAI,CAAEZ,gCAAiC,CAAC,CAACa,QAAQ,CACvDV,KAAK,CAACW,IACP,CAAC;EAEF,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACb,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBM,gCAAgC,IACjCM,aAAA,CAACjB,sBAAsB;IAAA,GAAMK;EAAK,CAAI,CAEtC,CAAC;AAEL,CACD,CAAC;AAED,IAAKc,MAAM,CAACC,mCAAmC,EAAG;EACjD7B,SAAS,CACR,kBAAkB,EAClB,2CAA2C,EAC3CY,0BACD,CAAC;AACF"}
1
+ {"version":3,"names":["addFilter","privateApis","patternsPrivateApis","createHigherOrderComponent","useBlockEditingMode","useSelect","store","editorStore","unlock","PartialSyncingControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","withPartialSyncingControls","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","createElement","Fragment","isSelected","ControlsWithStoreSubscription","blockEditingMode","isEditingPattern","select","getCurrentPostType","user"],"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 { 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 isSupportedBlock = Object.keys(\n\t\t\tPARTIAL_SYNCING_SUPPORTED_BLOCKS\n\t\t).includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isEditingPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === PATTERN_TYPES.user,\n\t\t[]\n\t);\n\n\treturn (\n\t\tisEditingPattern &&\n\t\tblockEditingMode === 'default' && (\n\t\t\t<PartialSyncingControls { ...props } />\n\t\t)\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-partial-syncing-controls',\n\twithPartialSyncingControls\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,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,CAAEN,mBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMU,0BAA0B,GAAGT,0BAA0B,CAC1DU,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CACnCN,gCACD,CAAC,CAACO,QAAQ,CAAEJ,KAAK,CAACK,IAAK,CAAC;EAExB,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBA,KAAK,CAACQ,UAAU,IAAIP,gBAAgB,IACrCK,aAAA,CAACG,6BAA6B;IAAA,GAAMT;EAAK,CAAI,CAE7C,CAAC;AAEL,CACD,CAAC;;AAED;AACA;AACA,SAASS,6BAA6BA,CAAET,KAAK,EAAG;EAC/C,MAAMU,gBAAgB,GAAGpB,mBAAmB,CAAC,CAAC;EAC9C,MAAMqB,gBAAgB,GAAGpB,SAAS,CAC/BqB,MAAM,IACPA,MAAM,CAAEnB,WAAY,CAAC,CAACoB,kBAAkB,CAAC,CAAC,KAAKjB,aAAa,CAACkB,IAAI,EAClE,EACD,CAAC;EAED,OACCH,gBAAgB,IAChBD,gBAAgB,KAAK,SAAS,IAC7BJ,aAAA,CAACX,sBAAsB;IAAA,GAAMK;EAAK,CAAI,CACtC;AAEH;AAEAd,SAAS,CACR,kBAAkB,EAClB,2CAA2C,EAC3CY,0BACD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
+ import './bindings';
4
5
  import './hooks';
5
6
  export { storeConfig, store } from './store';
6
7
  export * from './components';
@@ -1 +1 @@
1
- {"version":3,"names":["storeConfig","store","transformStyles"],"sources":["@wordpress/editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './private-apis';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,SAAS;AAEhB,SAASA,WAAW,EAAEC,KAAK,QAAQ,SAAS;AAC5C,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,gBAAgB;;AAE9B;AACA;AACA;AACA,SAASC,eAAe,QAAQ,yBAAyB"}
1
+ {"version":3,"names":["storeConfig","store","transformStyles"],"sources":["@wordpress/editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './bindings';\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './private-apis';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,YAAY;AACnB,OAAO,SAAS;AAEhB,SAASA,WAAW,EAAEC,KAAK,QAAQ,SAAS;AAC5C,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,gBAAgB;;AAE9B;AACA;AACA;AACA,SAASC,eAAe,QAAQ,yBAAyB"}
@@ -4,27 +4,31 @@
4
4
  import EditorCanvas from './components/editor-canvas';
5
5
  import { ExperimentalEditorProvider } from './components/provider';
6
6
  import { lock } from './lock-unlock';
7
+ import EnablePluginDocumentSettingPanelOption from './components/preferences-modal/enable-plugin-document-setting-panel';
7
8
  import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
8
9
  import useBlockEditorSettings from './components/provider/use-block-editor-settings';
9
10
  import DocumentTools from './components/document-tools';
10
11
  import InserterSidebar from './components/inserter-sidebar';
11
12
  import ListViewSidebar from './components/list-view-sidebar';
13
+ import PluginPostExcerpt from './components/post-excerpt/plugin';
12
14
  import PostPanelRow from './components/post-panel-row';
13
15
  import PostViewLink from './components/post-view-link';
14
16
  import PreviewDropdown from './components/preview-dropdown';
15
- import PluginPostExcerpt from './components/post-excerpt/plugin';
17
+ import PreferencesModal from './components/preferences-modal';
16
18
  export const privateApis = {};
17
19
  lock(privateApis, {
18
20
  DocumentTools,
19
21
  EditorCanvas,
20
22
  ExperimentalEditorProvider,
23
+ EnablePluginDocumentSettingPanelOption,
21
24
  EntitiesSavedStatesExtensible,
22
25
  InserterSidebar,
23
26
  ListViewSidebar,
27
+ PluginPostExcerpt,
24
28
  PostPanelRow,
25
29
  PostViewLink,
26
30
  PreviewDropdown,
27
- PluginPostExcerpt,
31
+ PreferencesModal,
28
32
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
29
33
  useBlockEditorSettings
30
34
  });
@@ -1 +1 @@
1
- {"version":3,"names":["EditorCanvas","ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","useBlockEditorSettings","DocumentTools","InserterSidebar","ListViewSidebar","PostPanelRow","PostViewLink","PreviewDropdown","PluginPostExcerpt","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 DocumentTools from './components/document-tools';\nimport InserterSidebar from './components/inserter-sidebar';\nimport ListViewSidebar from './components/list-view-sidebar';\nimport PostPanelRow from './components/post-panel-row';\nimport PostViewLink from './components/post-view-link';\nimport PreviewDropdown from './components/preview-dropdown';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tDocumentTools,\n\tEditorCanvas,\n\tExperimentalEditorProvider,\n\tEntitiesSavedStatesExtensible,\n\tInserterSidebar,\n\tListViewSidebar,\n\tPostPanelRow,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPluginPostExcerpt,\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,aAAa,MAAM,6BAA6B;AACvD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,iBAAiB,MAAM,kCAAkC;AAEhE,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BV,IAAI,CAAEU,WAAW,EAAE;EAClBP,aAAa;EACbL,YAAY;EACZC,0BAA0B;EAC1BE,6BAA6B;EAC7BG,eAAe;EACfC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,eAAe;EACfC,iBAAiB;EAEjB;EACAP;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["EditorCanvas","ExperimentalEditorProvider","lock","EnablePluginDocumentSettingPanelOption","EntitiesSavedStatesExtensible","useBlockEditorSettings","DocumentTools","InserterSidebar","ListViewSidebar","PluginPostExcerpt","PostPanelRow","PostViewLink","PreviewDropdown","PreferencesModal","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 EnablePluginDocumentSettingPanelOption from './components/preferences-modal/enable-plugin-document-setting-panel';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport DocumentTools from './components/document-tools';\nimport InserterSidebar from './components/inserter-sidebar';\nimport ListViewSidebar from './components/list-view-sidebar';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PostPanelRow from './components/post-panel-row';\nimport PostViewLink from './components/post-view-link';\nimport PreviewDropdown from './components/preview-dropdown';\nimport PreferencesModal from './components/preferences-modal';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tDocumentTools,\n\tEditorCanvas,\n\tExperimentalEditorProvider,\n\tEnablePluginDocumentSettingPanelOption,\n\tEntitiesSavedStatesExtensible,\n\tInserterSidebar,\n\tListViewSidebar,\n\tPluginPostExcerpt,\n\tPostPanelRow,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPreferencesModal,\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,OAAOC,sCAAsC,MAAM,qEAAqE;AACxH,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,OAAOC,sBAAsB,MAAM,iDAAiD;AACpF,OAAOC,aAAa,MAAM,6BAA6B;AACvD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,OAAOC,gBAAgB,MAAM,gCAAgC;AAE7D,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BZ,IAAI,CAAEY,WAAW,EAAE;EAClBR,aAAa;EACbN,YAAY;EACZC,0BAA0B;EAC1BE,sCAAsC;EACtCC,6BAA6B;EAC7BG,eAAe;EACfC,eAAe;EACfC,iBAAiB;EACjBC,YAAY;EACZC,YAAY;EACZC,eAAe;EACfC,gBAAgB;EAEhB;EACAR;AACD,CAAE,CAAC"}
@@ -9,6 +9,7 @@ import { SETTINGS_DEFAULTS } from '@wordpress/block-editor';
9
9
  * @property {boolean|Array} allowedBlockTypes Allowed block types
10
10
  * @property {boolean} richEditingEnabled Whether rich editing is enabled or not
11
11
  * @property {boolean} codeEditingEnabled Whether code editing is enabled or not
12
+ * @property {boolean} fontLibraryEnabled Whether the font library is enabled or not.
12
13
  * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.
13
14
  * true = the user has opted to show the Custom Fields panel at the bottom of the editor.
14
15
  * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.
@@ -25,6 +26,7 @@ export const EDITOR_SETTINGS_DEFAULTS = {
25
26
  ...SETTINGS_DEFAULTS,
26
27
  richEditingEnabled: true,
27
28
  codeEditingEnabled: true,
29
+ fontLibraryEnabled: true,
28
30
  enableCustomFields: undefined,
29
31
  defaultRenderingMode: 'post-only'
30
32
  };
@@ -1 +1 @@
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"}
1
+ {"version":3,"names":["SETTINGS_DEFAULTS","EDITOR_SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","fontLibraryEnabled","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} fontLibraryEnabled Whether the font library 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\tfontLibraryEnabled: 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;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,GAAGD,iBAAiB;EAEpBE,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC"}
@@ -4,6 +4,7 @@
4
4
  import { store as coreStore } from '@wordpress/core-data';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { store as noticesStore } from '@wordpress/notices';
7
+ import { store as preferencesStore } from '@wordpress/preferences';
7
8
 
8
9
  /**
9
10
  * Returns an action object used to set which template is currently being used/edited.
@@ -41,4 +42,32 @@ export const createTemplate = template => async ({
41
42
  }]
42
43
  });
43
44
  };
45
+
46
+ /**
47
+ * Update the provided block types to be visible.
48
+ *
49
+ * @param {string[]} blockNames Names of block types to show.
50
+ */
51
+ export const showBlockTypes = blockNames => ({
52
+ registry
53
+ }) => {
54
+ var _registry$select$get;
55
+ const existingBlockNames = (_registry$select$get = registry.select(preferencesStore).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
56
+ const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type));
57
+ registry.dispatch(preferencesStore).set('core', 'hiddenBlockTypes', newBlockNames);
58
+ };
59
+
60
+ /**
61
+ * Update the provided block types to be hidden.
62
+ *
63
+ * @param {string[]} blockNames Names of block types to hide.
64
+ */
65
+ export const hideBlockTypes = blockNames => ({
66
+ registry
67
+ }) => {
68
+ var _registry$select$get2;
69
+ const existingBlockNames = (_registry$select$get2 = registry.select(preferencesStore).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
70
+ const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
71
+ registry.dispatch(preferencesStore).set('core', 'hiddenBlockTypes', [...mergedBlockNames]);
72
+ };
44
73
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreStore","__","noticesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t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,CACxBb,MAAM,CAACc,iBAAiB,CAAC,CAAC,CACxBC,oBACH;IACF,CAAC;EAEH,CACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["store","coreStore","__","noticesStore","preferencesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAs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B,IAAAD,oBAAA,GACvBhB,QAAQ,CACNF,MAAM,CAAEN,gBAAiB,CAAC,CAC1B0B,GAAG,CAAE,MAAM,EAAE,kBAAmB,CAAC,cAAAF,oBAAA,cAAAA,oBAAA,GAAI,EAAE;EAE1C,MAAMG,aAAa,GAAGF,kBAAkB,CAACG,MAAM,CAC5CzB,IAAI,IACL,CAAE,CACD0B,KAAK,CAACC,OAAO,CAAEP,UAAW,CAAC,GAAGA,UAAU,GAAG,CAAEA,UAAU,CAAE,EACxDQ,QAAQ,CAAE5B,IAAK,CACnB,CAAC;EAEDK,QAAQ,CACND,QAAQ,CAAEP,gBAAiB,CAAC,CAC5BgC,GAAG,CAAE,MAAM,EAAE,kBAAkB,EAAEL,aAAc,CAAC;AACnD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,cAAc,GACxBV,UAAU,IACZ,CAAE;EAAEf;AAAS,CAAC,KAAM;EAAA,IAAA0B,qBAAA;EACnB,MAAMT,kBAAkB,IAAAS,qBAAA,GACvB1B,QAAQ,CACNF,MAAM,CAAEN,gBAAiB,CAAC,CAC1B0B,GAAG,CAAE,MAAM,EAAE,kBAAmB,CAAC,cAAAQ,qBAAA,cAAAA,qBAAA,GAAI,EAAE;EAE1C,MAAMC,gBAAgB,GAAG,IAAIC,GAAG,CAAE,CACjC,GAAGX,kBAAkB,EACrB,IAAKI,KAAK,CAACC,OAAO,CAAEP,UAAW,CAAC,GAAGA,UAAU,GAAG,CAAEA,UAAU,CAAE,CAAE,CAC/D,CAAC;EAEHf,QAAQ,CACND,QAAQ,CAAEP,gBAAiB,CAAC,CAC5BgC,GAAG,CAAE,MAAM,EAAE,kBAAkB,EAAE,CAAE,GAAGG,gBAAgB,CAAG,CAAC;AAC7D,CAAC"}
@@ -26,7 +26,7 @@ export const getInsertionPoint = createRegistrySelector(select => state => {
26
26
  return state.blockInserterPanel;
27
27
  }
28
28
  if (getRenderingMode(state) === 'template-locked') {
29
- const [postContentClientId] = select(blockEditorStore).__experimentalGetGlobalBlocksByName('core/post-content');
29
+ const [postContentClientId] = select(blockEditorStore).getBlocksByName('core/post-content');
30
30
  if (postContentClientId) {
31
31
  return {
32
32
  rootClientId: postContentClientId,
@@ -1 +1 @@
1
- {"version":3,"names":["store","blockEditorStore","createRegistrySelector","getRenderingMode","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","__experimentalGetGlobalBlocksByName","getListViewToggleRef","listViewToggleRef"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode } from './selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\treturn state.blockInserterPanel;\n\t\t}\n\n\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAGP,sBAAsB,CACpDQ,MAAM,IAAQC,KAAK,IAAM;EAC1B,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAKT,gBAAgB,CAAEQ,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEE,mBAAmB,CAAE,GAC5BH,MAAM,CAAET,gBAAiB,CAAC,CAACa,mCAAmC,CAC7D,mBACD,CAAC;IACF,IAAKD,mBAAmB,EAAG;MAC1B,OAAO;QACNR,YAAY,EAAEQ,mBAAmB;QACjCN,cAAc,EAAED,SAAS;QACzBE,WAAW,EAAEF;MACd,CAAC;IACF;EACD;EAEA,OAAOF,qBAAqB;AAC7B,CACD,CAAC;AAED,OAAO,SAASW,oBAAoBA,CAAEJ,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACK,iBAAiB;AAC/B"}
1
+ {"version":3,"names":["store","blockEditorStore","createRegistrySelector","getRenderingMode","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode } from './selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\treturn state.blockInserterPanel;\n\t\t}\n\n\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAGP,sBAAsB,CACpDQ,MAAM,IAAQC,KAAK,IAAM;EAC1B,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAKT,gBAAgB,CAAEQ,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEE,mBAAmB,CAAE,GAC5BH,MAAM,CAAET,gBAAiB,CAAC,CAACa,eAAe,CACzC,mBACD,CAAC;IACF,IAAKD,mBAAmB,EAAG;MAC1B,OAAO;QACNR,YAAY,EAAEQ,mBAAmB;QACjCN,cAAc,EAAED,SAAS;QACzBE,WAAW,EAAEF;MACd,CAAC;IACF;EACD;EAEA,OAAOF,qBAAqB;AAC7B,CACD,CAAC;AAED,OAAO,SAASW,oBAAoBA,CAAEJ,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACK,iBAAiB;AAC/B"}
@@ -98,7 +98,7 @@
98
98
  --wp-block-synced-color: #7a00df;
99
99
  --wp-block-synced-color--rgb: 122, 0, 223;
100
100
  }
101
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
101
+ @media (min-resolution: 192dpi) {
102
102
  :root {
103
103
  --wp-admin-border-width-focus: 1.5px;
104
104
  }
@@ -142,6 +142,81 @@
142
142
  color: var(--wp-admin-theme-color);
143
143
  }
144
144
 
145
+ .editor-block-manager__no-results {
146
+ font-style: italic;
147
+ padding: 24px 0;
148
+ text-align: center;
149
+ }
150
+
151
+ .editor-block-manager__search {
152
+ margin: 16px 0;
153
+ }
154
+
155
+ .editor-block-manager__disabled-blocks-count {
156
+ border: 1px solid #ddd;
157
+ border-width: 1px 0;
158
+ box-shadow: 32px 0 0 0 #fff, -32px 0 0 0 #fff;
159
+ padding: 8px;
160
+ background-color: #fff;
161
+ text-align: center;
162
+ position: sticky;
163
+ top: -5px;
164
+ z-index: 2;
165
+ }
166
+ .editor-block-manager__disabled-blocks-count ~ .editor-block-manager__results .editor-block-manager__category-title {
167
+ top: 31px;
168
+ }
169
+ .editor-block-manager__disabled-blocks-count .is-link {
170
+ margin-right: 12px;
171
+ }
172
+
173
+ .editor-block-manager__category {
174
+ margin: 0 0 24px 0;
175
+ }
176
+
177
+ .editor-block-manager__category-title {
178
+ position: sticky;
179
+ top: -4px;
180
+ padding: 16px 0;
181
+ background-color: #fff;
182
+ z-index: 1;
183
+ }
184
+ .editor-block-manager__category-title .components-checkbox-control__label {
185
+ font-weight: 600;
186
+ }
187
+
188
+ .editor-block-manager__checklist {
189
+ margin-top: 0;
190
+ }
191
+
192
+ .editor-block-manager__category-title,
193
+ .editor-block-manager__checklist-item {
194
+ border-bottom: 1px solid #ddd;
195
+ }
196
+
197
+ .editor-block-manager__checklist-item {
198
+ display: flex;
199
+ justify-content: space-between;
200
+ align-items: center;
201
+ margin-bottom: 0;
202
+ padding: 8px 16px 8px 0;
203
+ }
204
+ .components-modal__content .editor-block-manager__checklist-item.components-checkbox-control__input-container {
205
+ margin: 0 8px;
206
+ }
207
+ .editor-block-manager__checklist-item .block-editor-block-icon {
208
+ margin-left: 10px;
209
+ fill: #1e1e1e;
210
+ }
211
+
212
+ .editor-block-manager__results {
213
+ border-top: 1px solid #ddd;
214
+ }
215
+
216
+ .editor-block-manager__disabled-blocks-count + .editor-block-manager__results {
217
+ border-top-width: 0;
218
+ }
219
+
145
220
  .editor-document-bar {
146
221
  display: flex;
147
222
  align-items: center;
@@ -456,7 +531,6 @@
456
531
  .components-editor-notices__dismissible .components-notice,
457
532
  .components-editor-notices__pinned .components-notice {
458
533
  box-sizing: border-box;
459
- margin: 0;
460
534
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
461
535
  padding: 0 12px;
462
536
  min-height: 60px;
@@ -484,6 +558,10 @@
484
558
  margin-bottom: 12px;
485
559
  }
486
560
 
561
+ .entities-saved-states__description-heading {
562
+ font-size: 13px;
563
+ }
564
+
487
565
  .editor-error-boundary {
488
566
  margin: auto;
489
567
  max-width: 780px;
@@ -753,12 +831,6 @@
753
831
  padding: 16px;
754
832
  }
755
833
 
756
- @media (min-width: 600px) {
757
- .editor-post-locked-modal {
758
- max-width: 480px;
759
- }
760
- }
761
-
762
834
  .editor-post-locked-modal__buttons {
763
835
  margin-top: 24px;
764
836
  }
@@ -1415,8 +1487,4 @@
1415
1487
  }
1416
1488
  .editor-template-validation-notice .components-button {
1417
1489
  margin-right: 5px;
1418
- }
1419
-
1420
- .editor-canvas__iframe.has-history {
1421
- padding: 48px 48px 0;
1422
1490
  }