@wordpress/editor 14.47.0 → 14.48.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.
- package/CHANGELOG.md +2 -0
- package/build/components/provider/use-block-editor-settings.cjs +1 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +1 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-style/style-rtl.css +59 -37
- package/build-style/style.css +59 -37
- package/build-types/components/post-locked-modal/index.d.ts +6 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +6 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +6 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +48 -48
- package/src/components/provider/use-block-editor-settings.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -302,7 +302,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
|
|
|
302
302
|
);
|
|
303
303
|
},
|
|
304
304
|
[mediaEditKey]: hasUploadPermissions ? editMediaEntity : void 0,
|
|
305
|
-
[openMediaEditorModalKey]: ({ id, onUpdate }) => openMediaEditorModal({ id, onUpdate }),
|
|
305
|
+
[openMediaEditorModalKey]: ({ id, onUpdate, onClose }) => openMediaEditorModal({ id, onUpdate, onClose }),
|
|
306
306
|
mediaUpload: hasUploadPermissions ? import_utils.mediaUpload : void 0,
|
|
307
307
|
[mediaUploadOnSuccessKey]: hasUploadPermissions ? import_on_success.default : void 0,
|
|
308
308
|
mediaSideload: hasUploadPermissions ? import_media_sideload.default : void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/provider/use-block-editor-settings.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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\tprivateApis as coreDataPrivateApis,\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';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForUnsyncedPatterns',\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'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\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'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tonViewportStateChangeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\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 * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\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 { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\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\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\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\tconst { updateDeviceTypeForViewportState } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\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\tconst blockEditorSettings = {\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\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\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\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\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// 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: ! isDistractionFree && 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\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked',\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tupdateDeviceTypeForViewportState,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqC;AACrC,kBAAuC;AACvC,uBAKO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,qBAAiC;AACjC,oBAAqC;AACrC,0BAGO;AACP,0BAAsD;AAKtD,8BAAoC;AACpC,mBAA4B;AAC5B,wBAAiC;AACjC,4BAAyC;AACzC,4BAAyC;AACzC,0BAAuC;AACvC,mBAAqC;AACrC,yBAAuB;AACvB,2BAAgC;AAEhC,IAAM,EAAE,OAAO,iBAAiB,QAAI,2BAA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A,QACT,OAAO,QAAS,QAAS,EAAE;AAAA,UAAQ,CAAE,CAAE,GAAI,MAC1C,sBAAsB,SAAU,GAAI;AAAA,QACrC;AAAA,MACD;AAAA,MACA,CAAE,mBAAoB,GAAG;AAAA,MACzB,CAAE,wBAAyB,GAAG;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,aAAa,CAAE;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAE,iBAAkB,GAAG,CAAE,QAAQ,iBAAkB;AAClD,eAAO,OAAQ,iBAAAA,KAAU,EAAE;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,CAAE,YAAa,GAAG,uBACf,kBACA;AAAA,MACH,CAAE,uBAAwB,GAAG,CAAE,EAAE,IAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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\tprivateApis as coreDataPrivateApis,\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';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForUnsyncedPatterns',\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'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\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'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tonViewportStateChangeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\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 * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\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 { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\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\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\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\tconst { updateDeviceTypeForViewportState } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\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\tconst blockEditorSettings = {\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\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\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\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate, onClose } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate, onClose } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\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// 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: ! isDistractionFree && 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\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked',\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tupdateDeviceTypeForViewportState,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqC;AACrC,kBAAuC;AACvC,uBAKO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,qBAAiC;AACjC,oBAAqC;AACrC,0BAGO;AACP,0BAAsD;AAKtD,8BAAoC;AACpC,mBAA4B;AAC5B,wBAAiC;AACjC,4BAAyC;AACzC,4BAAyC;AACzC,0BAAuC;AACvC,mBAAqC;AACrC,yBAAuB;AACvB,2BAAgC;AAEhC,IAAM,EAAE,OAAO,iBAAiB,QAAI,2BAAQ,oBAAAA,WAAuB;AAEnE,IAAM,eAAe,CAAC;AAEtB,SAAS,mCAAoC,QAAS;AACrD,QAAM,EAAE,6BAA6B,QAAI,2BAAQ,iBAAAC,WAAoB;AACrE,QAAM,EAAE,iBAAiB,IAAI,OAAQ,iBAAAC,KAAU;AAC/C,SAAO,iBAAkB,YAAY,YAAY;AAAA,IAChD,UAAU;AAAA,IACV,CAAE,4BAA6B,GAAG;AAAA,EACnC,CAAE;AACH;AAEA,SAAS,0CAA2C,QAAS;AAC5D,SAAO,OAAQ,iBAAAA,KAAU,EAAE,yBAAyB;AACrD;AAEA,IAAM,wBAAwB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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E,yBAA0B,GAAG,aAAa;AAAA;AAAA;AAAA,MAG5C,oCACC,kBAAkB;AAAA,MACnB,GAAK,aAAa,EAAE,CAAE,aAAc,GAAG,WAAW,IAAI,CAAC;AAAA,MACvD,CAAE,wBAAyB,GAAG;AAAA,MAC9B,CAAE,6BAA8B,GAAG;AAAA,IACpC;AAEA,QAAK,iBAAkB;AACtB,0BAAoB,gBAAgB;AAAA,IACrC;AAEA,WAAO;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAEA,IAAO,oCAAQ;",
|
|
6
6
|
"names": ["mediaEditorPrivateApis", "coreDataPrivateApis", "coreStore", "preferencesStore", "blocksStore", "editorStore", "blockEditorStore", "mediaUploadOnSuccess", "mediaSideload", "mediaFinalize", "mediaDelete", "fetchLinkSuggestions", "inserterMediaCategories", "fetchUrlData"]
|
|
7
7
|
}
|
|
@@ -276,7 +276,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
|
|
|
276
276
|
);
|
|
277
277
|
},
|
|
278
278
|
[mediaEditKey]: hasUploadPermissions ? editMediaEntity : void 0,
|
|
279
|
-
[openMediaEditorModalKey]: ({ id, onUpdate }) => openMediaEditorModal({ id, onUpdate }),
|
|
279
|
+
[openMediaEditorModalKey]: ({ id, onUpdate, onClose }) => openMediaEditorModal({ id, onUpdate, onClose }),
|
|
280
280
|
mediaUpload: hasUploadPermissions ? mediaUpload : void 0,
|
|
281
281
|
[mediaUploadOnSuccessKey]: hasUploadPermissions ? mediaUploadOnSuccess : void 0,
|
|
282
282
|
mediaSideload: hasUploadPermissions ? mediaSideload : void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/provider/use-block-editor-settings.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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\tprivateApis as coreDataPrivateApis,\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';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForUnsyncedPatterns',\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'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\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'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tonViewportStateChangeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\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 * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\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 { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\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\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\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\tconst { updateDeviceTypeForViewportState } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\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\tconst blockEditorSettings = {\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\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\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\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\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// 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: ! isDistractionFree && 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\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked',\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tupdateDeviceTypeForViewportState,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC,SAAS,aAAa,iBAA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AS,GAAI;AAItD,YAAM,2BACL,SAAS,SAAS,oBACf,WAAW,IAAK,CAAE,EAAE,KAAK,MAAO,IAAK,IACrC,SAAS,qBAAqB,CAAC;AAEnC,aAAO,yBAAyB;AAAA,QAC/B,CAAE,SAAU,CAAE,iBAAiB,SAAU,IAAK;AAAA,MAC/C;AAAA,IACD;AAEA,WAAO,SAAS;AAAA,EACjB,GAAG,CAAE,SAAS,mBAAmB,kBAAkB,UAAW,CAAE;AAEhE,QAAM,wBAAwB,SAAS,cAAc;AAErD,SAAO,QAAS,MAAM;AACrB,UAAM,sBAAsB;AAAA,MAC3B,GAAG,OAAO;AAAA,QACT,OAAO,QAAS,QAAS,EAAE;AAAA,UAAQ,CAAE,CAAE,GAAI,MAC1C,sBAAsB,SAAU,GAAI;AAAA,QACrC;AAAA,MACD;AAAA,MACA,CAAE,mBAAoB,GAAG;AAAA,MACzB,CAAE,wBAAyB,GAAG;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,aAAa,CAAE;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAE,iBAAkB,GAAG,CAAE,QAAQ,iBAAkB;AAClD,eAAO,OAAQ,SAAU,EAAE;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,CAAE,YAAa,GAAG,uBACf,kBACA;AAAA,MACH,CAAE,uBAAwB,GAAG,CAAE,EAAE,IAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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\tprivateApis as coreDataPrivateApis,\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';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForUnsyncedPatterns',\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'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\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'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tonViewportStateChangeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\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 * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\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 { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\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\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\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\tconst { updateDeviceTypeForViewportState } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\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\tconst blockEditorSettings = {\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\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\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\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate, onClose } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate, onClose } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\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// 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: ! isDistractionFree && 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\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked',\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tupdateDeviceTypeForViewportState,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC,SAAS,aAAa,iBAAiB;AACvC;AAAA,EACC,SAAS;AAAA,EACT,sCAAsC;AAAA,EACtC,8BAA8B;AAAA,EAC9B,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AACnB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,wBAAwB;AACjC,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,eAAe,8BAA8B;AAKtD,OAAO,6BAA6B;AACpC,SAAS,mBAAmB;AAC5B,OAAO,0BAA0B;AACjC,SAAS,WAAW,qBAAqB;AACzC,SAAS,WAAW,qBAAqB;AACzC,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAEhC,IAAM,EAAE,OAAO,iBAAiB,IAAI,OA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A;AAAA,MACA,oCAAoC,aAAa;AAAA,MACjD,cACC,aAAa,kBAAkB,WAAW,SAAS;AAAA,MACpD,UACC,aAAa,kBACV,CAAE,CAAE,mBAAmB,CAAC,GAAG,CAAC,CAAE,CAAE,IAChC,SAAS;AAAA,MACb,mCAAmC;AAAA,MACnC,CAAE,sBAAuB,GAAG;AAAA,MAC5B,YACC,kBAAkB,eAAe,aAAa,gBAC3C,SACA;AAAA;AAAA;AAAA,MAGJ,CAAE,mBAAoB,GAAG;AAAA,QACxB;AAAA,QACA;AAAA,QACA;AAAA,MACD,EAAE,SAAU,QAAS;AAAA,MACrB,CAAE,yBAA0B,GAAG,aAAa;AAAA;AAAA;AAAA,MAG5C,oCACC,kBAAkB;AAAA,MACnB,GAAK,aAAa,EAAE,CAAE,aAAc,GAAG,WAAW,IAAI,CAAC;AAAA,MACvD,CAAE,wBAAyB,GAAG;AAAA,MAC9B,CAAE,6BAA8B,GAAG;AAAA,IACpC;AAEA,QAAK,iBAAkB;AACtB,0BAAoB,gBAAgB;AAAA,IACrC;AAEA,WAAO;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAEA,IAAO,oCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4920,15 +4920,6 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
4920
4920
|
flex: 1;
|
|
4921
4921
|
}
|
|
4922
4922
|
|
|
4923
|
-
.media-editor .interface-interface-skeleton__footer {
|
|
4924
|
-
position: relative;
|
|
4925
|
-
display: flex;
|
|
4926
|
-
}
|
|
4927
|
-
|
|
4928
|
-
.media-editor .interface-interface-skeleton.has-footer .interface-interface-skeleton__body {
|
|
4929
|
-
padding-bottom: 0;
|
|
4930
|
-
}
|
|
4931
|
-
|
|
4932
4923
|
.media-editor .media-editor__canvas {
|
|
4933
4924
|
display: flex;
|
|
4934
4925
|
align-items: center;
|
|
@@ -5008,6 +4999,64 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
5008
4999
|
min-height: 0;
|
|
5009
5000
|
}
|
|
5010
5001
|
|
|
5002
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer {
|
|
5003
|
+
flex-shrink: 0;
|
|
5004
|
+
display: flex;
|
|
5005
|
+
gap: 16px;
|
|
5006
|
+
padding: 8px 24px;
|
|
5007
|
+
border-top: 1px solid #ddd;
|
|
5008
|
+
background: #fff;
|
|
5009
|
+
}
|
|
5010
|
+
|
|
5011
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide {
|
|
5012
|
+
flex-direction: row;
|
|
5013
|
+
align-items: center;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
5016
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-modal__footer-toolbar {
|
|
5017
|
+
flex: 1 1 0;
|
|
5018
|
+
min-width: 0;
|
|
5019
|
+
display: flex;
|
|
5020
|
+
align-items: center;
|
|
5021
|
+
justify-content: center;
|
|
5022
|
+
gap: 8px;
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-fine-rotation {
|
|
5026
|
+
flex: 1 1 280px;
|
|
5027
|
+
min-width: 0;
|
|
5028
|
+
max-width: 360px;
|
|
5029
|
+
}
|
|
5030
|
+
|
|
5031
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-transform-controls {
|
|
5032
|
+
border-right: 1px solid #ddd;
|
|
5033
|
+
padding-right: 12px;
|
|
5034
|
+
}
|
|
5035
|
+
|
|
5036
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor__footer-actions {
|
|
5037
|
+
margin-right: auto;
|
|
5038
|
+
}
|
|
5039
|
+
|
|
5040
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-medium, .media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow {
|
|
5041
|
+
flex-direction: column;
|
|
5042
|
+
}
|
|
5043
|
+
|
|
5044
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow > .media-editor-transform-controls {
|
|
5045
|
+
align-self: center;
|
|
5046
|
+
}
|
|
5047
|
+
|
|
5048
|
+
.media-editor-modal__footer-row {
|
|
5049
|
+
display: flex;
|
|
5050
|
+
flex-wrap: wrap;
|
|
5051
|
+
align-items: center;
|
|
5052
|
+
gap: 16px;
|
|
5053
|
+
}
|
|
5054
|
+
|
|
5055
|
+
.media-editor-modal__footer-row .media-editor-transform-controls,
|
|
5056
|
+
.media-editor-modal__footer-row .media-editor__footer-actions {
|
|
5057
|
+
margin-right: auto;
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5011
5060
|
.media-editor-modal {
|
|
5012
5061
|
display: flex;
|
|
5013
5062
|
flex-direction: column;
|
|
@@ -5039,40 +5088,13 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
5039
5088
|
height: 100%;
|
|
5040
5089
|
}
|
|
5041
5090
|
|
|
5042
|
-
.media-editor-
|
|
5043
|
-
width: 100%;
|
|
5044
|
-
padding: 8px 16px;
|
|
5045
|
-
}
|
|
5046
|
-
|
|
5047
|
-
.media-editor-toolbar__rotation-slider {
|
|
5048
|
-
flex: 1 1 280px;
|
|
5049
|
-
min-width: 0;
|
|
5050
|
-
max-width: 360px;
|
|
5051
|
-
}
|
|
5052
|
-
|
|
5053
|
-
.media-editor-toolbar__action-cluster {
|
|
5091
|
+
.media-editor-transform-controls {
|
|
5054
5092
|
display: flex;
|
|
5055
5093
|
flex-wrap: nowrap;
|
|
5056
5094
|
align-items: center;
|
|
5057
5095
|
gap: 8px;
|
|
5058
5096
|
}
|
|
5059
5097
|
|
|
5060
|
-
@media (min-width: 782px) {
|
|
5061
|
-
.media-editor-toolbar__action-cluster {
|
|
5062
|
-
border-right: 1px solid #ddd;
|
|
5063
|
-
padding-right: 12px;
|
|
5064
|
-
}
|
|
5065
|
-
}
|
|
5066
|
-
@media (max-width: 781px) {
|
|
5067
|
-
.media-editor-toolbar__rotation-slider {
|
|
5068
|
-
flex-basis: 100%;
|
|
5069
|
-
max-width: none;
|
|
5070
|
-
}
|
|
5071
|
-
.media-editor-toolbar__action-cluster {
|
|
5072
|
-
flex-basis: 100%;
|
|
5073
|
-
justify-content: center;
|
|
5074
|
-
}
|
|
5075
|
-
}
|
|
5076
5098
|
.media-editor-keyboard-shortcuts-modal {
|
|
5077
5099
|
min-width: 280px;
|
|
5078
5100
|
}
|
package/build-style/style.css
CHANGED
|
@@ -4923,15 +4923,6 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
4923
4923
|
flex: 1;
|
|
4924
4924
|
}
|
|
4925
4925
|
|
|
4926
|
-
.media-editor .interface-interface-skeleton__footer {
|
|
4927
|
-
position: relative;
|
|
4928
|
-
display: flex;
|
|
4929
|
-
}
|
|
4930
|
-
|
|
4931
|
-
.media-editor .interface-interface-skeleton.has-footer .interface-interface-skeleton__body {
|
|
4932
|
-
padding-bottom: 0;
|
|
4933
|
-
}
|
|
4934
|
-
|
|
4935
4926
|
.media-editor .media-editor__canvas {
|
|
4936
4927
|
display: flex;
|
|
4937
4928
|
align-items: center;
|
|
@@ -5011,6 +5002,64 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
5011
5002
|
min-height: 0;
|
|
5012
5003
|
}
|
|
5013
5004
|
|
|
5005
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer {
|
|
5006
|
+
flex-shrink: 0;
|
|
5007
|
+
display: flex;
|
|
5008
|
+
gap: 16px;
|
|
5009
|
+
padding: 8px 24px;
|
|
5010
|
+
border-top: 1px solid #ddd;
|
|
5011
|
+
background: #fff;
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide {
|
|
5015
|
+
flex-direction: row;
|
|
5016
|
+
align-items: center;
|
|
5017
|
+
}
|
|
5018
|
+
|
|
5019
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-modal__footer-toolbar {
|
|
5020
|
+
flex: 1 1 0;
|
|
5021
|
+
min-width: 0;
|
|
5022
|
+
display: flex;
|
|
5023
|
+
align-items: center;
|
|
5024
|
+
justify-content: center;
|
|
5025
|
+
gap: 8px;
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-fine-rotation {
|
|
5029
|
+
flex: 1 1 280px;
|
|
5030
|
+
min-width: 0;
|
|
5031
|
+
max-width: 360px;
|
|
5032
|
+
}
|
|
5033
|
+
|
|
5034
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-transform-controls {
|
|
5035
|
+
border-left: 1px solid #ddd;
|
|
5036
|
+
padding-left: 12px;
|
|
5037
|
+
}
|
|
5038
|
+
|
|
5039
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor__footer-actions {
|
|
5040
|
+
margin-left: auto;
|
|
5041
|
+
}
|
|
5042
|
+
|
|
5043
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-medium, .media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow {
|
|
5044
|
+
flex-direction: column;
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5047
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow > .media-editor-transform-controls {
|
|
5048
|
+
align-self: center;
|
|
5049
|
+
}
|
|
5050
|
+
|
|
5051
|
+
.media-editor-modal__footer-row {
|
|
5052
|
+
display: flex;
|
|
5053
|
+
flex-wrap: wrap;
|
|
5054
|
+
align-items: center;
|
|
5055
|
+
gap: 16px;
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5058
|
+
.media-editor-modal__footer-row .media-editor-transform-controls,
|
|
5059
|
+
.media-editor-modal__footer-row .media-editor__footer-actions {
|
|
5060
|
+
margin-left: auto;
|
|
5061
|
+
}
|
|
5062
|
+
|
|
5014
5063
|
.media-editor-modal {
|
|
5015
5064
|
display: flex;
|
|
5016
5065
|
flex-direction: column;
|
|
@@ -5042,40 +5091,13 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
5042
5091
|
height: 100%;
|
|
5043
5092
|
}
|
|
5044
5093
|
|
|
5045
|
-
.media-editor-
|
|
5046
|
-
width: 100%;
|
|
5047
|
-
padding: 8px 16px;
|
|
5048
|
-
}
|
|
5049
|
-
|
|
5050
|
-
.media-editor-toolbar__rotation-slider {
|
|
5051
|
-
flex: 1 1 280px;
|
|
5052
|
-
min-width: 0;
|
|
5053
|
-
max-width: 360px;
|
|
5054
|
-
}
|
|
5055
|
-
|
|
5056
|
-
.media-editor-toolbar__action-cluster {
|
|
5094
|
+
.media-editor-transform-controls {
|
|
5057
5095
|
display: flex;
|
|
5058
5096
|
flex-wrap: nowrap;
|
|
5059
5097
|
align-items: center;
|
|
5060
5098
|
gap: 8px;
|
|
5061
5099
|
}
|
|
5062
5100
|
|
|
5063
|
-
@media (min-width: 782px) {
|
|
5064
|
-
.media-editor-toolbar__action-cluster {
|
|
5065
|
-
border-left: 1px solid #ddd;
|
|
5066
|
-
padding-left: 12px;
|
|
5067
|
-
}
|
|
5068
|
-
}
|
|
5069
|
-
@media (max-width: 781px) {
|
|
5070
|
-
.media-editor-toolbar__rotation-slider {
|
|
5071
|
-
flex-basis: 100%;
|
|
5072
|
-
max-width: none;
|
|
5073
|
-
}
|
|
5074
|
-
.media-editor-toolbar__action-cluster {
|
|
5075
|
-
flex-basis: 100%;
|
|
5076
|
-
justify-content: center;
|
|
5077
|
-
}
|
|
5078
|
-
}
|
|
5079
5101
|
.media-editor-keyboard-shortcuts-modal {
|
|
5080
5102
|
min-width: 280px;
|
|
5081
5103
|
}
|
|
@@ -17,6 +17,9 @@ declare const _default: {
|
|
|
17
17
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
18
18
|
readonly props: Readonly<{}>;
|
|
19
19
|
state: Readonly<{}>;
|
|
20
|
+
refs: {
|
|
21
|
+
[key: string]: import("react").ReactInstance;
|
|
22
|
+
};
|
|
20
23
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
21
24
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
22
25
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -37,6 +40,9 @@ declare const _default: {
|
|
|
37
40
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
38
41
|
readonly props: Readonly<{}>;
|
|
39
42
|
state: Readonly<{}>;
|
|
43
|
+
refs: {
|
|
44
|
+
[key: string]: import("react").ReactInstance;
|
|
45
|
+
};
|
|
40
46
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
41
47
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
42
48
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -49,7 +55,6 @@ declare const _default: {
|
|
|
49
55
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
50
56
|
}[];
|
|
51
57
|
contextType?: import("react").Context<any> | undefined;
|
|
52
|
-
propTypes?: any;
|
|
53
58
|
} | typeof PostLockedModal;
|
|
54
59
|
export default _default;
|
|
55
60
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -21,6 +21,9 @@ declare const _default: {
|
|
|
21
21
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
22
22
|
readonly props: Readonly<{}>;
|
|
23
23
|
state: Readonly<{}>;
|
|
24
|
+
refs: {
|
|
25
|
+
[key: string]: import("react").ReactInstance;
|
|
26
|
+
};
|
|
24
27
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
25
28
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
26
29
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -41,6 +44,9 @@ declare const _default: {
|
|
|
41
44
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
42
45
|
readonly props: Readonly<{}>;
|
|
43
46
|
state: Readonly<{}>;
|
|
47
|
+
refs: {
|
|
48
|
+
[key: string]: import("react").ReactInstance;
|
|
49
|
+
};
|
|
44
50
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
45
51
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
46
52
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -53,7 +59,6 @@ declare const _default: {
|
|
|
53
59
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
54
60
|
}[];
|
|
55
61
|
contextType?: import("react").Context<any> | undefined;
|
|
56
|
-
propTypes?: any;
|
|
57
62
|
};
|
|
58
63
|
export default _default;
|
|
59
64
|
//# sourceMappingURL=flat-term-selector.d.ts.map
|
|
@@ -45,6 +45,9 @@ declare const _default: {
|
|
|
45
45
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
46
46
|
readonly props: Readonly<{}>;
|
|
47
47
|
state: Readonly<{}>;
|
|
48
|
+
refs: {
|
|
49
|
+
[key: string]: import("react").ReactInstance;
|
|
50
|
+
};
|
|
48
51
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
49
52
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
50
53
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -65,6 +68,9 @@ declare const _default: {
|
|
|
65
68
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
66
69
|
readonly props: Readonly<{}>;
|
|
67
70
|
state: Readonly<{}>;
|
|
71
|
+
refs: {
|
|
72
|
+
[key: string]: import("react").ReactInstance;
|
|
73
|
+
};
|
|
68
74
|
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
69
75
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
70
76
|
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
@@ -77,7 +83,6 @@ declare const _default: {
|
|
|
77
83
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
78
84
|
}[];
|
|
79
85
|
contextType?: import("react").Context<any> | undefined;
|
|
80
|
-
propTypes?: any;
|
|
81
86
|
};
|
|
82
87
|
export default _default;
|
|
83
88
|
//# sourceMappingURL=hierarchical-term-selector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AA0CA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;CAEvB,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;CAEvB,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAgB,eA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CAuBzC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;CAM5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAE,KAAK,QAAA,GAFjC,OAAO,CAIlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.48.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -60,50 +60,50 @@
|
|
|
60
60
|
"build-module/bindings/**"
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@wordpress/a11y": "^4.
|
|
64
|
-
"@wordpress/api-fetch": "^7.
|
|
65
|
-
"@wordpress/base-styles": "^9.
|
|
66
|
-
"@wordpress/blob": "^4.
|
|
67
|
-
"@wordpress/block-editor": "^15.
|
|
68
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
69
|
-
"@wordpress/blocks": "^15.
|
|
70
|
-
"@wordpress/commands": "^1.
|
|
71
|
-
"@wordpress/components": "^
|
|
72
|
-
"@wordpress/compose": "^8.
|
|
73
|
-
"@wordpress/core-data": "^7.
|
|
74
|
-
"@wordpress/data": "^10.
|
|
75
|
-
"@wordpress/dataviews": "^
|
|
76
|
-
"@wordpress/date": "^5.
|
|
77
|
-
"@wordpress/deprecated": "^4.
|
|
78
|
-
"@wordpress/dom": "^4.
|
|
79
|
-
"@wordpress/element": "^
|
|
80
|
-
"@wordpress/fields": "^0.
|
|
81
|
-
"@wordpress/global-styles-engine": "^1.
|
|
82
|
-
"@wordpress/global-styles-ui": "^1.
|
|
83
|
-
"@wordpress/hooks": "^4.
|
|
84
|
-
"@wordpress/html-entities": "^4.
|
|
85
|
-
"@wordpress/i18n": "^6.
|
|
86
|
-
"@wordpress/icons": "^13.
|
|
87
|
-
"@wordpress/interface": "^9.
|
|
88
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
89
|
-
"@wordpress/keycodes": "^4.
|
|
90
|
-
"@wordpress/media-editor": "^0.
|
|
91
|
-
"@wordpress/media-fields": "^0.
|
|
92
|
-
"@wordpress/media-utils": "^5.
|
|
93
|
-
"@wordpress/notices": "^5.
|
|
94
|
-
"@wordpress/patterns": "^2.
|
|
95
|
-
"@wordpress/plugins": "^7.
|
|
96
|
-
"@wordpress/preferences": "^4.
|
|
97
|
-
"@wordpress/private-apis": "^1.
|
|
98
|
-
"@wordpress/reusable-blocks": "^5.
|
|
99
|
-
"@wordpress/rich-text": "^7.
|
|
100
|
-
"@wordpress/server-side-render": "^6.
|
|
101
|
-
"@wordpress/ui": "^0.
|
|
102
|
-
"@wordpress/upload-media": "^0.
|
|
103
|
-
"@wordpress/url": "^4.
|
|
104
|
-
"@wordpress/views": "^1.
|
|
105
|
-
"@wordpress/warning": "^3.
|
|
106
|
-
"@wordpress/wordcount": "^4.
|
|
63
|
+
"@wordpress/a11y": "^4.48.0",
|
|
64
|
+
"@wordpress/api-fetch": "^7.48.0",
|
|
65
|
+
"@wordpress/base-styles": "^9.1.0",
|
|
66
|
+
"@wordpress/blob": "^4.48.0",
|
|
67
|
+
"@wordpress/block-editor": "^15.21.0",
|
|
68
|
+
"@wordpress/block-serialization-default-parser": "^5.48.0",
|
|
69
|
+
"@wordpress/blocks": "^15.21.0",
|
|
70
|
+
"@wordpress/commands": "^1.48.0",
|
|
71
|
+
"@wordpress/components": "^35.0.0",
|
|
72
|
+
"@wordpress/compose": "^8.1.0",
|
|
73
|
+
"@wordpress/core-data": "^7.48.0",
|
|
74
|
+
"@wordpress/data": "^10.48.0",
|
|
75
|
+
"@wordpress/dataviews": "^16.0.0",
|
|
76
|
+
"@wordpress/date": "^5.48.0",
|
|
77
|
+
"@wordpress/deprecated": "^4.48.0",
|
|
78
|
+
"@wordpress/dom": "^4.48.0",
|
|
79
|
+
"@wordpress/element": "^8.0.0",
|
|
80
|
+
"@wordpress/fields": "^0.40.0",
|
|
81
|
+
"@wordpress/global-styles-engine": "^1.15.0",
|
|
82
|
+
"@wordpress/global-styles-ui": "^1.15.0",
|
|
83
|
+
"@wordpress/hooks": "^4.48.0",
|
|
84
|
+
"@wordpress/html-entities": "^4.48.0",
|
|
85
|
+
"@wordpress/i18n": "^6.21.0",
|
|
86
|
+
"@wordpress/icons": "^13.3.0",
|
|
87
|
+
"@wordpress/interface": "^9.33.0",
|
|
88
|
+
"@wordpress/keyboard-shortcuts": "^5.48.0",
|
|
89
|
+
"@wordpress/keycodes": "^4.48.0",
|
|
90
|
+
"@wordpress/media-editor": "^0.11.0",
|
|
91
|
+
"@wordpress/media-fields": "^0.13.0",
|
|
92
|
+
"@wordpress/media-utils": "^5.48.0",
|
|
93
|
+
"@wordpress/notices": "^5.48.0",
|
|
94
|
+
"@wordpress/patterns": "^2.48.0",
|
|
95
|
+
"@wordpress/plugins": "^7.48.0",
|
|
96
|
+
"@wordpress/preferences": "^4.48.0",
|
|
97
|
+
"@wordpress/private-apis": "^1.48.0",
|
|
98
|
+
"@wordpress/reusable-blocks": "^5.48.0",
|
|
99
|
+
"@wordpress/rich-text": "^7.48.0",
|
|
100
|
+
"@wordpress/server-side-render": "^6.24.0",
|
|
101
|
+
"@wordpress/ui": "^0.15.0",
|
|
102
|
+
"@wordpress/upload-media": "^0.33.0",
|
|
103
|
+
"@wordpress/url": "^4.48.0",
|
|
104
|
+
"@wordpress/views": "^1.15.0",
|
|
105
|
+
"@wordpress/warning": "^3.48.0",
|
|
106
|
+
"@wordpress/wordcount": "^4.48.0",
|
|
107
107
|
"change-case": "^4.1.2",
|
|
108
108
|
"client-zip": "^2.4.5",
|
|
109
109
|
"clsx": "^2.1.1",
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"deep-freeze": "0.0.1"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
|
-
"react": "^
|
|
124
|
-
"react-dom": "^
|
|
123
|
+
"react": "^18.0.0",
|
|
124
|
+
"react-dom": "^18.0.0"
|
|
125
125
|
},
|
|
126
126
|
"publishConfig": {
|
|
127
127
|
"access": "public"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
|
|
130
130
|
}
|
|
@@ -351,8 +351,8 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
351
351
|
[ mediaEditKey ]: hasUploadPermissions
|
|
352
352
|
? editMediaEntity
|
|
353
353
|
: undefined,
|
|
354
|
-
[ openMediaEditorModalKey ]: ( { id, onUpdate } ) =>
|
|
355
|
-
openMediaEditorModal( { id, onUpdate } ),
|
|
354
|
+
[ openMediaEditorModalKey ]: ( { id, onUpdate, onClose } ) =>
|
|
355
|
+
openMediaEditorModal( { id, onUpdate, onClose } ),
|
|
356
356
|
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
|
|
357
357
|
[ mediaUploadOnSuccessKey ]: hasUploadPermissions
|
|
358
358
|
? mediaUploadOnSuccess
|