@wordpress/editor 13.2.0 → 13.3.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 (122) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/error-boundary/index.js +24 -30
  3. package/build/components/error-boundary/index.js.map +1 -1
  4. package/build/components/media-categories/index.js +237 -0
  5. package/build/components/media-categories/index.js.map +1 -0
  6. package/build/components/page-attributes/parent.js +1 -1
  7. package/build/components/page-attributes/parent.js.map +1 -1
  8. package/build/components/post-publish-panel/postpublish.js +1 -0
  9. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  10. package/build/components/post-slug/index.js +1 -0
  11. package/build/components/post-slug/index.js.map +1 -1
  12. package/build/components/post-taxonomies/hierarchical-term-selector.js +7 -3
  13. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  14. package/build/components/post-template/index.js +7 -4
  15. package/build/components/post-template/index.js.map +1 -1
  16. package/build/components/post-url/index.js +1 -0
  17. package/build/components/post-url/index.js.map +1 -1
  18. package/build/components/provider/index.js +26 -8
  19. package/build/components/provider/index.js.map +1 -1
  20. package/build/components/provider/index.native.js +21 -14
  21. package/build/components/provider/index.native.js.map +1 -1
  22. package/build/components/provider/use-block-editor-settings.js +7 -4
  23. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  24. package/build/components/provider/use-block-editor-settings.native.js +1 -2
  25. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  26. package/build/components/table-of-contents/index.js +3 -1
  27. package/build/components/table-of-contents/index.js.map +1 -1
  28. package/build/components/unsaved-changes-warning/index.js +1 -1
  29. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  30. package/build/experiments.js +20 -0
  31. package/build/experiments.js.map +1 -0
  32. package/build/hooks/default-autocompleters.js +2 -7
  33. package/build/hooks/default-autocompleters.js.map +1 -1
  34. package/build/index.js +14 -0
  35. package/build/index.js.map +1 -1
  36. package/build/index.native.js +14 -0
  37. package/build/index.native.js.map +1 -1
  38. package/build/lockUnlock.js +19 -0
  39. package/build/lockUnlock.js.map +1 -0
  40. package/build/store/defaults.js +1 -2
  41. package/build/store/defaults.js.map +1 -1
  42. package/build/store/selectors.js +1 -1
  43. package/build/store/selectors.js.map +1 -1
  44. package/build/utils/terms.js +9 -5
  45. package/build/utils/terms.js.map +1 -1
  46. package/build-module/components/error-boundary/index.js +24 -30
  47. package/build-module/components/error-boundary/index.js.map +1 -1
  48. package/build-module/components/media-categories/index.js +225 -0
  49. package/build-module/components/media-categories/index.js.map +1 -0
  50. package/build-module/components/page-attributes/parent.js +2 -2
  51. package/build-module/components/page-attributes/parent.js.map +1 -1
  52. package/build-module/components/post-publish-panel/postpublish.js +1 -0
  53. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  54. package/build-module/components/post-slug/index.js +1 -0
  55. package/build-module/components/post-slug/index.js.map +1 -1
  56. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +8 -5
  57. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  58. package/build-module/components/post-template/index.js +8 -5
  59. package/build-module/components/post-template/index.js.map +1 -1
  60. package/build-module/components/post-url/index.js +1 -0
  61. package/build-module/components/post-url/index.js.map +1 -1
  62. package/build-module/components/provider/index.js +21 -9
  63. package/build-module/components/provider/index.js.map +1 -1
  64. package/build-module/components/provider/index.native.js +20 -12
  65. package/build-module/components/provider/index.native.js.map +1 -1
  66. package/build-module/components/provider/use-block-editor-settings.js +5 -5
  67. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  68. package/build-module/components/provider/use-block-editor-settings.native.js +1 -2
  69. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  70. package/build-module/components/table-of-contents/index.js +3 -1
  71. package/build-module/components/table-of-contents/index.js.map +1 -1
  72. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  73. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  74. package/build-module/experiments.js +10 -0
  75. package/build-module/experiments.js.map +1 -0
  76. package/build-module/hooks/default-autocompleters.js +2 -6
  77. package/build-module/hooks/default-autocompleters.js.map +1 -1
  78. package/build-module/index.js +1 -0
  79. package/build-module/index.js.map +1 -1
  80. package/build-module/index.native.js +1 -0
  81. package/build-module/index.native.js.map +1 -1
  82. package/build-module/lockUnlock.js +9 -0
  83. package/build-module/lockUnlock.js.map +1 -0
  84. package/build-module/store/defaults.js +1 -2
  85. package/build-module/store/defaults.js.map +1 -1
  86. package/build-module/store/selectors.js +1 -1
  87. package/build-module/store/selectors.js.map +1 -1
  88. package/build-module/utils/terms.js +9 -6
  89. package/build-module/utils/terms.js.map +1 -1
  90. package/build-style/style-rtl.css +0 -3
  91. package/build-style/style.css +0 -3
  92. package/package.json +30 -29
  93. package/src/components/autosave-monitor/test/index.js +8 -2
  94. package/src/components/editor-help/test/index.native.js +5 -5
  95. package/src/components/error-boundary/index.js +24 -37
  96. package/src/components/media-categories/index.js +247 -0
  97. package/src/components/page-attributes/parent.js +2 -2
  98. package/src/components/page-attributes/test/order.js +4 -14
  99. package/src/components/post-preview-button/test/index.js +5 -17
  100. package/src/components/post-publish-button/test/index.js +5 -17
  101. package/src/components/post-publish-panel/postpublish.js +1 -0
  102. package/src/components/post-publish-panel/style.scss +1 -5
  103. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -18
  104. package/src/components/post-saved-state/test/index.js +1 -5
  105. package/src/components/post-slug/index.js +1 -0
  106. package/src/components/post-taxonomies/hierarchical-term-selector.js +23 -17
  107. package/src/components/post-template/index.js +3 -4
  108. package/src/components/post-url/index.js +1 -0
  109. package/src/components/provider/index.js +120 -91
  110. package/src/components/provider/index.native.js +26 -17
  111. package/src/components/provider/use-block-editor-settings.js +60 -49
  112. package/src/components/provider/use-block-editor-settings.native.js +1 -2
  113. package/src/components/table-of-contents/index.js +3 -1
  114. package/src/components/unsaved-changes-warning/index.js +1 -1
  115. package/src/experiments.js +10 -0
  116. package/src/hooks/default-autocompleters.js +1 -6
  117. package/src/index.js +1 -0
  118. package/src/index.native.js +1 -0
  119. package/src/lockUnlock.js +9 -0
  120. package/src/store/defaults.js +0 -1
  121. package/src/store/selectors.js +1 -1
  122. package/src/utils/terms.js +8 -5
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -13,6 +15,8 @@ var _coreData = require("@wordpress/core-data");
13
15
 
14
16
  var _i18n = require("@wordpress/i18n");
15
17
 
18
+ var _mediaCategories = _interopRequireDefault(require("../media-categories"));
19
+
16
20
  var _utils = require("../../utils");
17
21
 
18
22
  var _store = require("../../store");
@@ -25,6 +29,7 @@ var _store = require("../../store");
25
29
  * Internal dependencies
26
30
  */
27
31
  const EMPTY_BLOCKS_LIST = [];
32
+ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalBlockInspectorAnimation', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'focusMode', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'hasInlineToolbar', 'isDistractionFree', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postsPerPage', 'readOnly', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets'];
28
33
  /**
29
34
  * React hook used to compute the block editor settings to use for the post editor.
30
35
  *
@@ -115,16 +120,14 @@ function useBlockEditorSettings(settings, hasTemplate) {
115
120
 
116
121
  return (0, _element.useMemo)(() => ({ ...Object.fromEntries(Object.entries(settings).filter(_ref2 => {
117
122
  let [key] = _ref2;
118
- return ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'bodyPlaceholder', 'canLockBlocks', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'focusMode', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'isDistractionFree', 'hasInlineToolbar', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'maxWidth', 'onUpdateDefaultBlockStyles', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableResolvedAssets'].includes(key);
123
+ return BLOCK_EDITOR_SETTINGS.includes(key);
119
124
  })),
120
125
  mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
121
126
  __experimentalReusableBlocks: reusableBlocks,
122
127
  __experimentalBlockPatterns: blockPatterns,
123
128
  __experimentalBlockPatternCategories: blockPatternCategories,
124
129
  __experimentalFetchLinkSuggestions: (search, searchOptions) => (0, _coreData.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
125
- // TODO: We should find a proper way to consolidate similar cases
126
- // like reusable blocks, fetch entities, etc.
127
- __unstableFetchMedia: _coreData.__experimentalFetchMedia,
130
+ inserterMediaCategories: _mediaCategories.default,
128
131
  __experimentalFetchRichUrlData: _coreData.__experimentalFetchUrlData,
129
132
  __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
130
133
  __experimentalUndo: undo,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["EMPTY_BLOCKS_LIST","useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","select","canUserUseUnfilteredHTML","getCurrentPostType","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","siteSettings","undefined","getEntityRecords","per_page","page_on_front","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","mediaUpload","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","__unstableFetchMedia","fetchMedia","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAMA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG,EAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,sBAAT,CAAiCC,QAAjC,EAA2CC,WAA3C,EAAyD;AAAA;;AACxD,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,kBAJK;AAKLC,IA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D3C;AAmDPuC,IAAAA,4BAA4B,EAAExD,cAnDvB;AAoDPuB,IAAAA,2BAA2B,EAAEQ,aApDtB;AAqDPL,IAAAA,oCAAoC,EAAEiB,sBArD/B;AAsDPc,IAAAA,kCAAkC,EAAE,CAAEC,MAAF,EAAUC,aAAV,KACnC,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6C7D,QAA7C,CAvDM;AAwDP;AACA;AACA8D,IAAAA,oBAAoB,EAAEC,kCA1Df;AA2DPC,IAAAA,8BAA8B,EAAEC,oCA3DzB;AA4DPC,IAAAA,sCAAsC,EAAE9D,oBA5DjC;AA6DP+D,IAAAA,kBAAkB,EAAErB,IA7Db;AA8DPsB,IAAAA,WAAW,EAAEnE,WA9DN;AA+DPoE,IAAAA,8BAA8B,EAAErB,gBA/DzB;AAgEPsB,IAAAA,gCAAgC,EAAEjE,kBAhE3B;AAiEPC,IAAAA,WAjEO;AAkEPiE,IAAAA,kCAAkC,EAAEtE;AAlE7B,GAAR,CADM,EAqEN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAIC+B,aAJD,EAKCY,sBALD,EAMCzC,oBAND,EAOC0C,IAPD,EAQC7C,WARD,EASCI,kBATD,EAUCC,WAVD,CArEM,CAAP;AAkFA;;eAEcP,sB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\t__experimentalFetchMedia as fetchMedia,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\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 = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\t[\n\t\t\t\t\t\t'__experimentalBlockDirectory',\n\t\t\t\t\t\t'__experimentalDiscussionSettings',\n\t\t\t\t\t\t'__experimentalFeatures',\n\t\t\t\t\t\t'__experimentalPreferredStyleVariations',\n\t\t\t\t\t\t'__experimentalSetIsInserterOpened',\n\t\t\t\t\t\t'__unstableGalleryWithImageBlocks',\n\t\t\t\t\t\t'alignWide',\n\t\t\t\t\t\t'allowedBlockTypes',\n\t\t\t\t\t\t'blockInspectorTabs',\n\t\t\t\t\t\t'bodyPlaceholder',\n\t\t\t\t\t\t'canLockBlocks',\n\t\t\t\t\t\t'codeEditingEnabled',\n\t\t\t\t\t\t'colors',\n\t\t\t\t\t\t'disableCustomColors',\n\t\t\t\t\t\t'disableCustomFontSizes',\n\t\t\t\t\t\t'disableCustomSpacingSizes',\n\t\t\t\t\t\t'disableCustomGradients',\n\t\t\t\t\t\t'disableLayoutStyles',\n\t\t\t\t\t\t'enableCustomLineHeight',\n\t\t\t\t\t\t'enableCustomSpacing',\n\t\t\t\t\t\t'enableCustomUnits',\n\t\t\t\t\t\t'focusMode',\n\t\t\t\t\t\t'fontSizes',\n\t\t\t\t\t\t'gradients',\n\t\t\t\t\t\t'generateAnchors',\n\t\t\t\t\t\t'hasFixedToolbar',\n\t\t\t\t\t\t'isDistractionFree',\n\t\t\t\t\t\t'hasInlineToolbar',\n\t\t\t\t\t\t'imageDefaultSize',\n\t\t\t\t\t\t'imageDimensions',\n\t\t\t\t\t\t'imageEditing',\n\t\t\t\t\t\t'imageSizes',\n\t\t\t\t\t\t'isRTL',\n\t\t\t\t\t\t'keepCaretInsideBlock',\n\t\t\t\t\t\t'maxWidth',\n\t\t\t\t\t\t'onUpdateDefaultBlockStyles',\n\t\t\t\t\t\t'styles',\n\t\t\t\t\t\t'template',\n\t\t\t\t\t\t'templateLock',\n\t\t\t\t\t\t'titlePlaceholder',\n\t\t\t\t\t\t'supportsLayout',\n\t\t\t\t\t\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t\t\t\t\t\t'__unstableResolvedAssets',\n\t\t\t\t\t].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__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\t// TODO: We should find a proper way to consolidate similar cases\n\t\t\t// like reusable blocks, fetch entities, etc.\n\t\t\t__unstableFetchMedia: fetchMedia,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","select","canUserUseUnfilteredHTML","getCurrentPostType","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","siteSettings","undefined","getEntityRecords","per_page","page_on_front","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","mediaUpload","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKA,MAAMA,iBAAiB,GAAG,EAA1B;AAEA,MAAMC,qBAAqB,GAAG,CAC7B,8BAD6B,EAE7B,uCAF6B,EAG7B,kCAH6B,EAI7B,wBAJ6B,EAK7B,sCAL6B,EAM7B,wCAN6B,EAO7B,mCAP6B,EAQ7B,kCAR6B,EAS7B,WAT6B,EAU7B,mBAV6B,EAW7B,oBAX6B,EAY7B,kBAZ6B,EAa7B,iBAb6B,EAc7B,eAd6B,EAe7B,cAf6B,EAgB7B,qBAhB6B,EAiB7B,oBAjB6B,EAkB7B,QAlB6B,EAmB7B,qBAnB6B,EAoB7B,wBApB6B,EAqB7B,2BArB6B,EAsB7B,wBAtB6B,EAuB7B,qBAvB6B,EAwB7B,wBAxB6B,EAyB7B,qBAzB6B,EA0B7B,mBA1B6B,EA2B7B,8BA3B6B,EA4B7B,WA5B6B,EA6B7B,WA7B6B,EA8B7B,WA9B6B,EA+B7B,iBA/B6B,EAgC7B,iBAhC6B,EAiC7B,kBAjC6B,EAkC7B,mBAlC6B,EAmC7B,kBAnC6B,EAoC7B,iBApC6B,EAqC7B,cArC6B,EAsC7B,YAtC6B,EAuC7B,O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;AAUPc,IAAAA,kCAAkC,EAAE,CAAEC,MAAF,EAAUC,aAAV,KACnC,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6C7D,QAA7C,CAXM;AAYP8D,IAAAA,uBAAuB,EAAvBA,wBAZO;AAaPC,IAAAA,8BAA8B,EAAEC,oCAbzB;AAcPC,IAAAA,sCAAsC,EAAE7D,oBAdjC;AAeP8D,IAAAA,kBAAkB,EAAEpB,IAfb;AAgBPqB,IAAAA,WAAW,EAAElE,WAhBN;AAiBPmE,IAAAA,8BAA8B,EAAEpB,gBAjBzB;AAkBPqB,IAAAA,gCAAgC,EAAEhE,kBAlB3B;AAmBPC,IAAAA,WAnBO;AAoBPgE,IAAAA,kCAAkC,EAAErE;AApB7B,GAAR,CADM,EAuBN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAIC+B,aAJD,EAKCY,sBALD,EAMCzC,oBAND,EAOC0C,IAPD,EAQC7C,WARD,EASCI,kBATD,EAUCC,WAVD,CAvBM,CAAP;AAoCA;;eAEcP,sB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport 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'__experimentalBlockInspectorAnimation',\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'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'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'template',\n\t'templateLock',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\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 {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\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 = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...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__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__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
@@ -29,9 +29,8 @@ const EMPTY_BLOCKS_LIST = [];
29
29
  function useNativeBlockEditorSettings(settings, hasTemplate) {
30
30
  var _settings$capabilitie;
31
31
 
32
- const capabilities = (_settings$capabilitie = settings.capabilities) !== null && _settings$capabilitie !== void 0 ? _settings$capabilitie : {};
33
32
  const editorSettings = (0, _useBlockEditorSettings.default)(settings, hasTemplate);
34
- const supportReusableBlock = capabilities.reusableBlock === true;
33
+ const supportReusableBlock = ((_settings$capabilitie = settings.capabilities) === null || _settings$capabilitie === void 0 ? void 0 : _settings$capabilitie.reusableBlock) === true;
35
34
  const {
36
35
  reusableBlocks,
37
36
  isTitleSelected
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"names":["EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","capabilities","editorSettings","supportReusableBlock","reusableBlock","reusableBlocks","isTitleSelected","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG,EAA1B;;AAEA,SAASC,4BAAT,CAAuCC,QAAvC,EAAiDC,WAAjD,EAA+D;AAAA;;AAC9D,QAAMC,YAAY,4BAAGF,QAAQ,CAACE,YAAZ,yEAA4B,EAA9C;AACA,QAAMC,cAAc,GAAG,qCAAwBH,QAAxB,EAAkCC,WAAlC,CAAvB;AAEA,QAAMG,oBAAoB,GAAGF,YAAY,CAACG,aAAb,KAA+B,IAA5D;AACA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAsC,qBACzCC,MAAF,IAAc;AACb,WAAO;AACNF,MAAAA,cAAc,EAAEF,oBAAoB,GACjCI,MAAM,CAAEC,eAAF,CAAN,CAAoBC,gBAApB,CACA,UADA,EAEA,UAFA,EAGA;AACA;AACA;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OALA,CADiC,GAQjCb,iBATG;AAUNS,MAAAA,eAAe,EAAEC,MAAM,CAAEI,YAAF,CAAN,CAAsBC,mBAAtB;AAVX,KAAP;AAYA,GAd0C,EAe3C,CAAET,oBAAF,CAf2C,CAA5C;AAkBA,SAAO,sBACN,OAAQ,EACP,GAAGD,cADI;AAEPW,IAAAA,4BAA4B,EAAER,cAFvB;AAGPS,IAAAA,kCAAkC,EAAER;AAH7B,GAAR,CADM,EAMN,CAAEJ,cAAF,EAAkBG,cAAlB,EAAkCC,eAAlC,CANM,CAAP;AAQA;;eAEcR,4B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, hasTemplate ) {\n\tconst capabilities = settings.capabilities ?? {};\n\tconst editorSettings = useBlockEditorSettings( settings, hasTemplate );\n\n\tconst supportReusableBlock = capabilities.reusableBlock === true;\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"names":["EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG,EAA1B;;AAEA,SAASC,4BAAT,CAAuCC,QAAvC,EAAiDC,WAAjD,EAA+D;AAAA;;AAC9D,QAAMC,cAAc,GAAG,qCAAwBF,QAAxB,EAAkCC,WAAlC,CAAvB;AACA,QAAME,oBAAoB,GAAG,0BAAAH,QAAQ,CAACI,YAAT,gFAAuBC,aAAvB,MAAyC,IAAtE;AAEA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAsC,qBACzCC,MAAF,IAAc;AACb,WAAO;AACNF,MAAAA,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEC,eAAF,CAAN,CAAoBC,gBAApB,CACA,UADA,EAEA,UAFA,EAGA;AACA;AACA;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OALA,CADiC,GAQjCb,iBATG;AAUNS,MAAAA,eAAe,EAAEC,MAAM,CAAEI,YAAF,CAAN,CAAsBC,mBAAtB;AAVX,KAAP;AAYA,GAd0C,EAe3C,CAAEV,oBAAF,CAf2C,CAA5C;AAkBA,SAAO,sBACN,OAAQ,EACP,GAAGD,cADI;AAEPY,IAAAA,4BAA4B,EAAER,cAFvB;AAGPS,IAAAA,kCAAkC,EAAER;AAH7B,GAAR,CADM,EAMN,CAAEL,cAAF,EAAkBI,cAAlB,EAAkCC,eAAlC,CANM,CAAP;AAQA;;eAEcR,4B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, hasTemplate ) {\n\tconst editorSettings = useBlockEditorSettings( settings, hasTemplate );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"]}
@@ -38,7 +38,9 @@ function TableOfContents(_ref, ref) {
38
38
  } = _ref;
39
39
  const hasBlocks = (0, _data.useSelect)(select => !!select(_blockEditor.store).getBlockCount(), []);
40
40
  return (0, _element.createElement)(_components.Dropdown, {
41
- position: repositionDropdown ? 'middle right right' : 'bottom',
41
+ popoverProps: {
42
+ placement: repositionDropdown ? 'right' : 'bottom'
43
+ },
42
44
  className: "table-of-contents",
43
45
  contentClassName: "table-of-contents__popover",
44
46
  renderToggle: _ref2 => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["TableOfContents","ref","hasOutlineItemsDisabled","repositionDropdown","props","hasBlocks","select","blockEditorStore","getBlockCount","isOpen","onToggle","undefined","info","onClose"],"mappings":";;;;;;;;;AAOA;;;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,eAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA,kBAA3B;AAA+C,OAAGC;AAAlD,GAEC;AACD,QAAMC,SAAS,GAAG,qBACfC,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,EADA,EAEjB,EAFiB,CAAlB;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGL,kBAAkB,GAAG,oBAAH,GAA0B,QADxD;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEM,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD,6BACMN,KADN;AAEC,QAAA,GAAG,EAAGH,GAFP;AAGC,QAAA,OAAO,EAAGI,SAAS,GAAGK,QAAH,GAAcC,SAHlC;AAIC,QAAA,IAAI,EAAGC,WAJR;AAKC,yBAAgBH,MALjB;AAMC,yBAAc;AACd;AAPD;AAQC,QAAA,KAAK,EAAG,cAAI,SAAJ,CART;AASC,QAAA,eAAe,EAAC,QATjB;AAUC,yBAAgB,CAAEJ;AAVnB,SADc;AAAA,KAJhB;AAkBC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAEQ,QAAAA;AAAF,OAAF;AAAA,aACf,4BAAC,cAAD;AACC,QAAA,cAAc,EAAGA,OADlB;AAEC,QAAA,uBAAuB,EAAGX;AAF3B,QADe;AAAA;AAlBjB,IADD;AA2BA;;eAEc,yBAAYF,eAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tposition={ repositionDropdown ? 'middle right right' : 'bottom' }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["TableOfContents","ref","hasOutlineItemsDisabled","repositionDropdown","props","hasBlocks","select","blockEditorStore","getBlockCount","placement","isOpen","onToggle","undefined","info","onClose"],"mappings":";;;;;;;;;AAOA;;;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,eAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA,kBAA3B;AAA+C,OAAGC;AAAlD,GAEC;AACD,QAAMC,SAAS,GAAG,qBACfC,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,EADA,EAEjB,EAFiB,CAAlB;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAG;AACdC,MAAAA,SAAS,EAAEN,kBAAkB,GAAG,OAAH,GAAa;AAD5B,KADhB;AAIC,IAAA,SAAS,EAAC,mBAJX;AAKC,IAAA,gBAAgB,EAAC,4BALlB;AAMC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEO,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD,6BACMP,KADN;AAEC,QAAA,GAAG,EAAGH,GAFP;AAGC,QAAA,OAAO,EAAGI,SAAS,GAAGM,QAAH,GAAcC,SAHlC;AAIC,QAAA,IAAI,EAAGC,WAJR;AAKC,yBAAgBH,MALjB;AAMC,yBAAc;AACd;AAPD;AAQC,QAAA,KAAK,EAAG,cAAI,SAAJ,CART;AASC,QAAA,eAAe,EAAC,QATjB;AAUC,yBAAgB,CAAEL;AAVnB,SADc;AAAA,KANhB;AAoBC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAES,QAAAA;AAAF,OAAF;AAAA,aACf,4BAAC,cAAD;AACC,QAAA,cAAc,EAAGA,OADlB;AAEC,QAAA,uBAAuB,EAAGZ;AAF3B,QADe;AAAA;AApBjB,IADD;AA6BA;;eAEc,yBAAYF,eAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
@@ -40,7 +40,7 @@ function UnsavedChangesWarning() {
40
40
  *
41
41
  * @param {Event} event `beforeunload` event.
42
42
  *
43
- * @return {?string} Warning prompt message, if unsaved changes exist.
43
+ * @return {string | undefined} Warning prompt message, if unsaved changes exist.
44
44
  */
45
45
 
46
46
  const warnIfUnsavedChanges = event => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"names":["UnsavedChangesWarning","isDirty","select","__experimentalGetDirtyEntityRecords","coreStore","dirtyEntityRecords","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAAc;AACxC,WAAO,MAAM;AACZ,YAAM;AAAEC,QAAAA;AAAF,UAA0CD,MAAM,CAAEE,eAAF,CAAtD;;AACA,YAAMC,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,aAAOE,kBAAkB,CAACC,MAAnB,GAA4B,CAAnC;AACA,KAJD;AAKA,GANe,EAMb,EANa,CAAhB;AAQA;AACD;AACA;AACA;AACA;AACA;AACA;;AACC,QAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC;AACA;AACA;AACA;AACA,QAAKP,OAAO,EAAZ,EAAiB;AAChBO,MAAAA,KAAK,CAACC,WAAN,GAAoB,cACnB,8DADmB,CAApB;AAGA,aAAOD,KAAK,CAACC,WAAb;AACA;AACD,GAXD;;AAaA,0BAAW,MAAM;AAChBC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAND,EAMG,EANH;AAQA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\treturn () => {\n\t\t\tconst { __experimentalGetDirtyEntityRecords } = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\treturn dirtyEntityRecords.length > 0;\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Warns the user if there are unsaved changes before leaving the editor.\n\t *\n\t * @param {Event} event `beforeunload` event.\n\t *\n\t * @return {?string} Warning prompt message, if unsaved changes exist.\n\t */\n\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t// We need to call the selector directly in the listener to avoid race\n\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\tif ( isDirty() ) {\n\t\t\tevent.returnValue = __(\n\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t);\n\t\t\treturn event.returnValue;\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [] );\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"names":["UnsavedChangesWarning","isDirty","select","__experimentalGetDirtyEntityRecords","coreStore","dirtyEntityRecords","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAAc;AACxC,WAAO,MAAM;AACZ,YAAM;AAAEC,QAAAA;AAAF,UAA0CD,MAAM,CAAEE,eAAF,CAAtD;;AACA,YAAMC,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,aAAOE,kBAAkB,CAACC,MAAnB,GAA4B,CAAnC;AACA,KAJD;AAKA,GANe,EAMb,EANa,CAAhB;AAQA;AACD;AACA;AACA;AACA;AACA;AACA;;AACC,QAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC;AACA;AACA;AACA;AACA,QAAKP,OAAO,EAAZ,EAAiB;AAChBO,MAAAA,KAAK,CAACC,WAAN,GAAoB,cACnB,8DADmB,CAApB;AAGA,aAAOD,KAAK,CAACC,WAAb;AACA;AACD,GAXD;;AAaA,0BAAW,MAAM;AAChBC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAND,EAMG,EANH;AAQA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\treturn () => {\n\t\t\tconst { __experimentalGetDirtyEntityRecords } = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\treturn dirtyEntityRecords.length > 0;\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Warns the user if there are unsaved changes before leaving the editor.\n\t *\n\t * @param {Event} event `beforeunload` event.\n\t *\n\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t */\n\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t// We need to call the selector directly in the listener to avoid race\n\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\tif ( isDirty() ) {\n\t\t\tevent.returnValue = __(\n\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t);\n\t\t\treturn event.returnValue;\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [] );\n\n\treturn null;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.experiments = void 0;
7
+
8
+ var _provider = require("./components/provider");
9
+
10
+ var _lockUnlock = require("./lockUnlock");
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ const experiments = {};
16
+ exports.experiments = experiments;
17
+ (0, _lockUnlock.lock)(experiments, {
18
+ ExperimentalEditorProvider: _provider.ExperimentalEditorProvider
19
+ });
20
+ //# sourceMappingURL=experiments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/editor/src/experiments.js"],"names":["experiments","ExperimentalEditorProvider"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB;AAClBC,EAAAA,0BAA0B,EAA1BA;AADkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lockUnlock';\n\nexport const experiments = {};\nlock( experiments, {\n\tExperimentalEditorProvider,\n} );\n"]}
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _lodash = require("lodash");
4
-
5
3
  var _hooks = require("@wordpress/hooks");
6
4
 
7
5
  var _components = require("../components");
8
6
 
9
- /**
10
- * External dependencies
11
- */
12
-
13
7
  /**
14
8
  * WordPress dependencies
15
9
  */
@@ -20,7 +14,8 @@ var _components = require("../components");
20
14
  function setDefaultCompleters() {
21
15
  let completers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
22
16
  // Provide copies so filters may directly modify them.
23
- completers.push((0, _lodash.clone)(_components.userAutocompleter));
17
+ completers.push({ ..._components.userAutocompleter
18
+ });
24
19
  return completers;
25
20
  }
26
21
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["setDefaultCompleters","completers","push","userAutocompleter"],"mappings":";;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,oBAAT,GAAiD;AAAA,MAAlBC,UAAkB,uEAAL,EAAK;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiB,mBAAOC,6BAAP,CAAjB;AAEA,SAAOF,UAAP;AACA;;AAED,sBACC,gCADD,EAEC,8CAFD,EAGCD,oBAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { clone } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( clone( userAutocompleter ) );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["setDefaultCompleters","completers","push","userAutocompleter"],"mappings":";;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,oBAAT,GAAiD;AAAA,MAAlBC,UAAkB,uEAAL,EAAK;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiB,EAAE,GAAGC;AAAL,GAAjB;AAEA,SAAOF,UAAP;AACA;;AAED,sBACC,gCADD,EAEC,8CAFD,EAGCD,oBAHD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( { ...userAutocompleter } );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"]}
package/build/index.js CHANGED
@@ -59,5 +59,19 @@ Object.keys(_utils).forEach(function (key) {
59
59
  });
60
60
  });
61
61
 
62
+ var _experiments = require("./experiments");
63
+
64
+ Object.keys(_experiments).forEach(function (key) {
65
+ if (key === "default" || key === "__esModule") return;
66
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
67
+ if (key in exports && exports[key] === _experiments[key]) return;
68
+ Object.defineProperty(exports, key, {
69
+ enumerable: true,
70
+ get: function () {
71
+ return _experiments[key];
72
+ }
73
+ });
74
+ });
75
+
62
76
  var _blockEditor = require("@wordpress/block-editor");
63
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './experiments';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"]}
@@ -50,4 +50,18 @@ Object.keys(_utils).forEach(function (key) {
50
50
  }
51
51
  });
52
52
  });
53
+
54
+ var _experiments = require("./experiments");
55
+
56
+ Object.keys(_experiments).forEach(function (key) {
57
+ if (key === "default" || key === "__esModule") return;
58
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
59
+ if (key in exports && exports[key] === _experiments[key]) return;
60
+ Object.defineProperty(exports, key, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _experiments[key];
64
+ }
65
+ });
66
+ });
53
67
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/block-editor';\nimport '@wordpress/core-data';\nimport '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { store } from './store';\nexport * from './components';\nexport * from './utils';\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/block-editor';\nimport '@wordpress/core-data';\nimport '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './experiments';\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unlock = exports.lock = void 0;
7
+
8
+ var _experiments = require("@wordpress/experiments");
9
+
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+ const {
14
+ lock,
15
+ unlock
16
+ } = (0, _experiments.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/editor');
17
+ exports.unlock = unlock;
18
+ exports.lock = lock;
19
+ //# sourceMappingURL=lockUnlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/editor/src/lockUnlock.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAEO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,mBAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/editor'\n\t);\n"]}
@@ -32,8 +32,7 @@ var _blockEditor = require("@wordpress/block-editor");
32
32
  const EDITOR_SETTINGS_DEFAULTS = { ..._blockEditor.SETTINGS_DEFAULTS,
33
33
  richEditingEnabled: true,
34
34
  codeEditingEnabled: true,
35
- enableCustomFields: undefined,
36
- supportsLayout: true
35
+ enableCustomFields: undefined
37
36
  };
38
37
  exports.EDITOR_SETTINGS_DEFAULTS = EDITOR_SETTINGS_DEFAULTS;
39
38
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/defaults.js"],"names":["EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","supportsLayout"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,wBAAwB,GAAG,EACvC,GAAGC,8BADoC;AAGvCC,EAAAA,kBAAkB,EAAE,IAHmB;AAIvCC,EAAAA,kBAAkB,EAAE,IAJmB;AAKvCC,EAAAA,kBAAkB,EAAEC,SALmB;AAMvCC,EAAAA,cAAc,EAAE;AANuB,CAAjC","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\tsupportsLayout: true,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/defaults.js"],"names":["EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,wBAAwB,GAAG,EACvC,GAAGC,8BADoC;AAGvCC,EAAAA,kBAAkB,EAAE,IAHmB;AAIvCC,EAAAA,kBAAkB,EAAE,IAJmB;AAKvCC,EAAAA,kBAAkB,EAAEC;AALmB,CAAjC","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"]}
@@ -818,7 +818,7 @@ function isPreviewingPost(state) {
818
818
  *
819
819
  * @param {Object} state Global application state.
820
820
  *
821
- * @return {string?} Preview Link.
821
+ * @return {string | undefined} Preview Link.
822
822
  */
823
823
 
824
824