@wordpress/editor 13.26.0 → 13.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/bindings/index.js +20 -0
- package/build/bindings/index.js.map +1 -0
- package/build/bindings/post-meta.js +52 -0
- package/build/bindings/post-meta.js.map +1 -0
- package/build/components/block-manager/category.js +106 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +35 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +130 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/document-tools/index.js +58 -52
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/index.js +4 -4
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-notices/index.js +11 -11
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +38 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/offline-status/index.native.js +1 -3
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +10 -24
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +5 -16
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +42 -0
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +33 -0
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
- package/build/components/preferences-modal/index.js +186 -0
- package/build/components/preferences-modal/index.js.map +1 -0
- package/build/components/provider/disable-non-page-content-blocks.js +1 -4
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +34 -8
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/hooks/pattern-partial-syncing.js +12 -8
- package/build/hooks/pattern-partial-syncing.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/private-apis.js +6 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/defaults.js +2 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/private-actions.js +33 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build-module/bindings/index.js +15 -0
- package/build-module/bindings/index.js.map +1 -0
- package/build-module/bindings/post-meta.js +45 -0
- package/build-module/bindings/post-meta.js.map +1 -0
- package/build-module/components/block-manager/category.js +97 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +27 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +121 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/document-tools/index.js +58 -52
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +4 -4
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +12 -12
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +39 -8
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -3
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +11 -25
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -15
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js +34 -0
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +24 -0
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +179 -0
- package/build-module/components/preferences-modal/index.js.map +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js +1 -4
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +35 -9
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/hooks/pattern-partial-syncing.js +12 -8
- package/build-module/hooks/pattern-partial-syncing.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +6 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/defaults.js +2 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/private-actions.js +29 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-style/style-rtl.css +80 -12
- package/build-style/style.css +80 -12
- package/package.json +33 -33
- package/src/bindings/index.js +13 -0
- package/src/bindings/post-meta.js +42 -0
- package/src/components/block-manager/category.js +96 -0
- package/src/components/block-manager/checklist.js +30 -0
- package/src/components/block-manager/index.js +160 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/document-tools/index.js +9 -1
- package/src/components/editor-canvas/index.js +3 -2
- package/src/components/editor-notices/index.js +11 -12
- package/src/components/editor-notices/style.scss +0 -1
- package/src/components/entities-saved-states/entity-type-list.js +47 -5
- package/src/components/entities-saved-states/index.js +7 -7
- package/src/components/entities-saved-states/style.scss +4 -0
- package/src/components/offline-status/index.native.js +2 -4
- package/src/components/post-locked-modal/index.js +1 -1
- package/src/components/post-locked-modal/style.scss +0 -6
- package/src/components/post-saved-state/index.js +30 -47
- package/src/components/post-schedule/check.js +10 -14
- package/src/components/post-schedule/test/check.js +24 -9
- package/src/components/preferences-modal/enable-panel.js +30 -0
- package/src/components/preferences-modal/enable-plugin-document-setting-panel.js +23 -0
- package/src/components/preferences-modal/index.js +269 -0
- package/src/components/preferences-modal/test/index.js +28 -0
- package/src/components/provider/disable-non-page-content-blocks.js +3 -3
- package/src/components/provider/use-block-editor-settings.js +45 -17
- package/src/hooks/pattern-partial-syncing.js +26 -29
- package/src/index.js +1 -0
- package/src/private-apis.js +6 -2
- package/src/store/defaults.js +2 -0
- package/src/store/private-actions.js +49 -0
- package/src/store/private-selectors.js +1 -1
- package/src/style.scss +1 -1
- package/src/components/editor-canvas/style.scss +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_mediaCategories","_interopRequireDefault","_utils","_store","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatterns","restBlockPatternCategories","useSelect","select","_canUser","isWeb","Platform","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","getBlockPatterns","getBlockPatternCategories","coreStore","get","preferencesStore","siteSettings","undefined","_links","hasOwnProperty","per_page","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","forceDisableFocusMode","Object","fromEntries","entries","key","mediaUpload","__experimentalReusableBlocks","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'allowedBlockTypes',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'getPostLinkProps',\n\t'hasInlineToolbar',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatterns,\n\t\trestBlockPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetBlockPatterns,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\treusableBlocks: isWeb\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatterns: getBlockPatterns(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatterns || [] ),\n\t\t\t\t...( restBlockPatterns || [] ),\n\t\t\t]\n\t\t\t\t.filter(\n\t\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t\t)\n\t\t\t\t.filter( ( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t[ settingsBlockPatterns, restBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\tpostType,\n\t\t\tsetIsInserterOpened,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAnBA;AACA;AACA;;AAYA;AACA;AACA;;AAKA,MAAMU,iBAAiB,GAAG,EAAE;AAE5B,MAAMC,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,wCAAwC,EACxC,kCAAkC,EAClC,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EAC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I;IACxB;IACA;IACA6B,WAAW,EAAE5F,QAAQ,KAAK,aAAa;IACvC;IACA6F,8BAA8B,EAAEzB,gBAAgB;IAChD0B,gCAAgC,EAAEhF,kBAAkB;IACpDC,WAAW;IACXC,YAAY;IACZ+E,kCAAkC,EAAE/F,QAAQ,KAAK,aAAa;IAC9DgG,YAAY,EACXhG,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACiG,YAAY;IAChEC,QAAQ,EACPjG,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACkG,QAAQ;IACrBC,iCAAiC,EAAElC;EACpC,CAAC,CAAE,EACH,CACC1D,wBAAwB,EACxBC,SAAS,EACToE,qBAAqB,EACrBnE,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBX,QAAQ,EACRa,oBAAoB,EACpBD,cAAc,EACdM,qBAAqB,EACrBgC,aAAa,EACba,sBAAsB,EACtBjD,oBAAoB,EACpBkD,IAAI,EACJK,gBAAgB,EAChBtD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZhB,QAAQ,EACRgE,mBAAmB,CAErB,CAAC;AACF;AAAC,IAAAmC,QAAA,GAEcrG,sBAAsB;AAAAsG,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_mediaCategories","_interopRequireDefault","_utils","_store","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","reusableBlocks","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","useSelect","select","_canUser","isWeb","Platform","OS","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getEntityRecords","getBlockPatternCategories","coreStore","get","preferencesStore","getBlockTypes","blocksStore","siteSettings","undefined","_links","hasOwnProperty","per_page","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","Object","fromEntries","entries","key","mediaUpload","__experimentalFetchBlockPatterns","fetchBlockPatterns","__experimentalReusableBlocks","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tfetchBlockPatterns,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'getPostLinkProps',\n\t'hasInlineToolbar',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst isWeb = Platform.OS === 'web';\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\treusableBlocks: isWeb\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport ]\n\t);\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalFetchBlockPatterns: async () => {\n\t\t\t\treturn ( await fetchBlockPatterns() ).filter(\n\t\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\tpostType,\n\t\t\tsetIsInserterOpened,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,gBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AArBA;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAMW,iBAAiB,GAAG,EAAE;AAE5B,MAAMC,qBAAqB,GAAG,CAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,sCAAsC,EACtC,wCAAwC,EACxC,kCAAkC,EAClC,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,2BAA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CAAE,CAAE,GACjCD,QAAQ,CAAC2G,QAAQ;IACrBC,iCAAiC,EAAEzC;EACpC,CAAC,CAAE,EACH,CACCW,iBAAiB,EACjBvE,wBAAwB,EACxBE,SAAS,EACT0E,qBAAqB,EACrBzE,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBZ,QAAQ,EACRc,oBAAoB,EACpBD,cAAc,EACdO,qBAAqB,EACrBgC,aAAa,EACbO,sBAAsB,EACtB3C,oBAAoB,EACpBkD,IAAI,EACJK,gBAAgB,EAChBtD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZlB,QAAQ,EACRkE,mBAAmB,CAErB,CAAC;AACF;AAAC,IAAA0C,QAAA,GAEc9G,sBAAsB;AAAA+G,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,7 +5,6 @@ var _hooks = require("@wordpress/hooks");
|
|
|
5
5
|
var _patterns = require("@wordpress/patterns");
|
|
6
6
|
var _compose = require("@wordpress/compose");
|
|
7
7
|
var _blockEditor = require("@wordpress/block-editor");
|
|
8
|
-
var _blocks = require("@wordpress/blocks");
|
|
9
8
|
var _data = require("@wordpress/data");
|
|
10
9
|
var _store = require("../store");
|
|
11
10
|
var _lockUnlock = require("../lock-unlock");
|
|
@@ -33,17 +32,22 @@ const {
|
|
|
33
32
|
* @return {Component} Wrapped component.
|
|
34
33
|
*/
|
|
35
34
|
const withPartialSyncingControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
36
|
-
const
|
|
37
|
-
const hasCustomFieldsSupport = (0, _blocks.hasBlockSupport)(props.name, '__experimentalConnections', false);
|
|
38
|
-
const isEditingPattern = (0, _data.useSelect)(select => select(_store.store).getCurrentPostType() === PATTERN_TYPES.user, []);
|
|
39
|
-
const shouldShowPartialSyncingControls = hasCustomFieldsSupport && props.isSelected && isEditingPattern && blockEditingMode === 'default' && Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
|
|
35
|
+
const isSupportedBlock = Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(props.name);
|
|
40
36
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
41
37
|
...props
|
|
42
|
-
}),
|
|
38
|
+
}), props.isSelected && isSupportedBlock && (0, _react.createElement)(ControlsWithStoreSubscription, {
|
|
43
39
|
...props
|
|
44
40
|
}));
|
|
45
41
|
});
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
|
|
43
|
+
// Split into a separate component to avoid a store subscription
|
|
44
|
+
// on every block.
|
|
45
|
+
function ControlsWithStoreSubscription(props) {
|
|
46
|
+
const blockEditingMode = (0, _blockEditor.useBlockEditingMode)();
|
|
47
|
+
const isEditingPattern = (0, _data.useSelect)(select => select(_store.store).getCurrentPostType() === PATTERN_TYPES.user, []);
|
|
48
|
+
return isEditingPattern && blockEditingMode === 'default' && (0, _react.createElement)(PartialSyncingControls, {
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
48
51
|
}
|
|
52
|
+
(0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/with-partial-syncing-controls', withPartialSyncingControls);
|
|
49
53
|
//# sourceMappingURL=pattern-partial-syncing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hooks","require","_patterns","_compose","_blockEditor","
|
|
1
|
+
{"version":3,"names":["_hooks","require","_patterns","_compose","_blockEditor","_data","_store","_lockUnlock","PartialSyncingControls","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","unlock","patternsPrivateApis","withPartialSyncingControls","createHigherOrderComponent","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","_react","createElement","Fragment","isSelected","ControlsWithStoreSubscription","blockEditingMode","useBlockEditingMode","isEditingPattern","useSelect","select","editorStore","getCurrentPostType","user","addFilter"],"sources":["@wordpress/editor/src/hooks/pattern-partial-syncing.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tPartialSyncingControls,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPartialSyncingControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock = Object.keys(\n\t\t\tPARTIAL_SYNCING_SUPPORTED_BLOCKS\n\t\t).includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isEditingPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === PATTERN_TYPES.user,\n\t\t[]\n\t);\n\n\treturn (\n\t\tisEditingPattern &&\n\t\tblockEditingMode === 'default' && (\n\t\t\t<PartialSyncingControls { ...props } />\n\t\t)\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-partial-syncing-controls',\n\twithPartialSyncingControls\n);\n"],"mappings":";;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,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BACD,CAAC"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_store","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_utils","_privateApis","_blockEditor"],"sources":["@wordpress/editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './private-apis';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGAA,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,MAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,MAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,YAAA,GAAAhB,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAY,YAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,YAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,YAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AAKA,IAAAW,YAAA,GAAAjB,OAAA"}
|
|
1
|
+
{"version":3,"names":["require","_store","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_utils","_privateApis","_blockEditor"],"sources":["@wordpress/editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './bindings';\nimport './hooks';\n\nexport { storeConfig, store } from './store';\nexport * from './components';\nexport * from './utils';\nexport * from './private-apis';\n\n/*\n * Backward compatibility\n */\nexport { transformStyles } from '@wordpress/block-editor';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAA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vas = _interopRequireDefault(require("./components/editor-canvas"));
|
|
9
9
|
var _provider = require("./components/provider");
|
|
10
10
|
var _lockUnlock = require("./lock-unlock");
|
|
11
|
+
var _enablePluginDocumentSettingPanel = _interopRequireDefault(require("./components/preferences-modal/enable-plugin-document-setting-panel"));
|
|
11
12
|
var _entitiesSavedStates = require("./components/entities-saved-states");
|
|
12
13
|
var _useBlockEditorSettings = _interopRequireDefault(require("./components/provider/use-block-editor-settings"));
|
|
13
14
|
var _documentTools = _interopRequireDefault(require("./components/document-tools"));
|
|
14
15
|
var _inserterSidebar = _interopRequireDefault(require("./components/inserter-sidebar"));
|
|
15
16
|
var _listViewSidebar = _interopRequireDefault(require("./components/list-view-sidebar"));
|
|
17
|
+
var _plugin = _interopRequireDefault(require("./components/post-excerpt/plugin"));
|
|
16
18
|
var _postPanelRow = _interopRequireDefault(require("./components/post-panel-row"));
|
|
17
19
|
var _postViewLink = _interopRequireDefault(require("./components/post-view-link"));
|
|
18
20
|
var _previewDropdown = _interopRequireDefault(require("./components/preview-dropdown"));
|
|
19
|
-
var
|
|
21
|
+
var _preferencesModal = _interopRequireDefault(require("./components/preferences-modal"));
|
|
20
22
|
/**
|
|
21
23
|
* Internal dependencies
|
|
22
24
|
*/
|
|
@@ -27,13 +29,15 @@ exports.privateApis = privateApis;
|
|
|
27
29
|
DocumentTools: _documentTools.default,
|
|
28
30
|
EditorCanvas: _editorCanvas.default,
|
|
29
31
|
ExperimentalEditorProvider: _provider.ExperimentalEditorProvider,
|
|
32
|
+
EnablePluginDocumentSettingPanelOption: _enablePluginDocumentSettingPanel.default,
|
|
30
33
|
EntitiesSavedStatesExtensible: _entitiesSavedStates.EntitiesSavedStatesExtensible,
|
|
31
34
|
InserterSidebar: _inserterSidebar.default,
|
|
32
35
|
ListViewSidebar: _listViewSidebar.default,
|
|
36
|
+
PluginPostExcerpt: _plugin.default,
|
|
33
37
|
PostPanelRow: _postPanelRow.default,
|
|
34
38
|
PostViewLink: _postViewLink.default,
|
|
35
39
|
PreviewDropdown: _previewDropdown.default,
|
|
36
|
-
|
|
40
|
+
PreferencesModal: _preferencesModal.default,
|
|
37
41
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
38
42
|
useBlockEditorSettings: _useBlockEditorSettings.default
|
|
39
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editorCanvas","_interopRequireDefault","require","_provider","_lockUnlock","_entitiesSavedStates","_useBlockEditorSettings","_documentTools","_inserterSidebar","_listViewSidebar","_postPanelRow","_postViewLink","_previewDropdown","
|
|
1
|
+
{"version":3,"names":["_editorCanvas","_interopRequireDefault","require","_provider","_lockUnlock","_enablePluginDocumentSettingPanel","_entitiesSavedStates","_useBlockEditorSettings","_documentTools","_inserterSidebar","_listViewSidebar","_plugin","_postPanelRow","_postViewLink","_previewDropdown","_preferencesModal","privateApis","exports","lock","DocumentTools","EditorCanvas","ExperimentalEditorProvider","EnablePluginDocumentSettingPanelOption","EntitiesSavedStatesExtensible","InserterSidebar","ListViewSidebar","PluginPostExcerpt","PostPanelRow","PostViewLink","PreviewDropdown","PreferencesModal","useBlockEditorSettings"],"sources":["@wordpress/editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorCanvas from './components/editor-canvas';\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport EnablePluginDocumentSettingPanelOption from './components/preferences-modal/enable-plugin-document-setting-panel';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\nimport useBlockEditorSettings from './components/provider/use-block-editor-settings';\nimport DocumentTools from './components/document-tools';\nimport InserterSidebar from './components/inserter-sidebar';\nimport ListViewSidebar from './components/list-view-sidebar';\nimport PluginPostExcerpt from './components/post-excerpt/plugin';\nimport PostPanelRow from './components/post-panel-row';\nimport PostViewLink from './components/post-view-link';\nimport PreviewDropdown from './components/preview-dropdown';\nimport PreferencesModal from './components/preferences-modal';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tDocumentTools,\n\tEditorCanvas,\n\tExperimentalEditorProvider,\n\tEnablePluginDocumentSettingPanelOption,\n\tEntitiesSavedStatesExtensible,\n\tInserterSidebar,\n\tListViewSidebar,\n\tPluginPostExcerpt,\n\tPostPanelRow,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPreferencesModal,\n\n\t// This is a temporary private API while we're updating the site editor to use EditorProvider.\n\tuseBlockEditorSettings,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,gBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,gBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,aAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,aAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,gBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,iBAAA,GAAAd,sBAAA,CAAAC,OAAA;AAhBA;AACA;AACA;;AAgBO,MAAMc,WAAW,GAAG,CAAC,CAAC;AAACC,OAAA,CAAAD,WAAA,GAAAA,WAAA;AAC9B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBG,aAAa,EAAbA,sBAAa;EACbC,YAAY,EAAZA,qBAAY;EACZC,0BAA0B,EAA1BA,oCAA0B;EAC1BC,sCAAsC,EAAtCA,yCAAsC;EACtCC,6BAA6B,EAA7BA,kDAA6B;EAC7BC,eAAe,EAAfA,wBAAe;EACfC,eAAe,EAAfA,wBAAe;EACfC,iBAAiB,EAAjBA,eAAiB;EACjBC,YAAY,EAAZA,qBAAY;EACZC,YAAY,EAAZA,qBAAY;EACZC,eAAe,EAAfA,wBAAe;EACfC,gBAAgB,EAAhBA,yBAAgB;EAEhB;EACAC,sBAAsB,EAAtBA;AACD,CAAE,CAAC"}
|
package/build/store/defaults.js
CHANGED
|
@@ -15,6 +15,7 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
15
15
|
* @property {boolean|Array} allowedBlockTypes Allowed block types
|
|
16
16
|
* @property {boolean} richEditingEnabled Whether rich editing is enabled or not
|
|
17
17
|
* @property {boolean} codeEditingEnabled Whether code editing is enabled or not
|
|
18
|
+
* @property {boolean} fontLibraryEnabled Whether the font library is enabled or not.
|
|
18
19
|
* @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.
|
|
19
20
|
* true = the user has opted to show the Custom Fields panel at the bottom of the editor.
|
|
20
21
|
* false = the user has opted to hide the Custom Fields panel at the bottom of the editor.
|
|
@@ -31,6 +32,7 @@ const EDITOR_SETTINGS_DEFAULTS = {
|
|
|
31
32
|
..._blockEditor.SETTINGS_DEFAULTS,
|
|
32
33
|
richEditingEnabled: true,
|
|
33
34
|
codeEditingEnabled: true,
|
|
35
|
+
fontLibraryEnabled: true,
|
|
34
36
|
enableCustomFields: undefined,
|
|
35
37
|
defaultRenderingMode: 'post-only'
|
|
36
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","defaultRenderingMode","exports"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n\tdefaultRenderingMode: 'post-only',\n};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG;EACvC,GAAGC,8BAAiB;EAEpBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC;AAACC,OAAA,
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","fontLibraryEnabled","enableCustomFields","undefined","defaultRenderingMode","exports"],"sources":["@wordpress/editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} fontLibraryEnabled Whether the font library is enabled or not.\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tfontLibraryEnabled: true,\n\tenableCustomFields: undefined,\n\tdefaultRenderingMode: 'post-only',\n};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG;EACvC,GAAGC,8BAAiB;EAEpBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,kBAAkB,EAAEC,SAAS;EAC7BC,oBAAoB,EAAE;AACvB,CAAC;AAACC,OAAA,CAAAR,wBAAA,GAAAA,wBAAA"}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.createTemplate = void 0;
|
|
6
|
+
exports.hideBlockTypes = exports.createTemplate = void 0;
|
|
7
7
|
exports.setCurrentTemplateId = setCurrentTemplateId;
|
|
8
|
+
exports.showBlockTypes = void 0;
|
|
8
9
|
var _coreData = require("@wordpress/core-data");
|
|
9
10
|
var _i18n = require("@wordpress/i18n");
|
|
10
11
|
var _notices = require("@wordpress/notices");
|
|
12
|
+
var _preferences = require("@wordpress/preferences");
|
|
11
13
|
/**
|
|
12
14
|
* WordPress dependencies
|
|
13
15
|
*/
|
|
@@ -48,5 +50,35 @@ const createTemplate = template => async ({
|
|
|
48
50
|
}]
|
|
49
51
|
});
|
|
50
52
|
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Update the provided block types to be visible.
|
|
56
|
+
*
|
|
57
|
+
* @param {string[]} blockNames Names of block types to show.
|
|
58
|
+
*/
|
|
51
59
|
exports.createTemplate = createTemplate;
|
|
60
|
+
const showBlockTypes = blockNames => ({
|
|
61
|
+
registry
|
|
62
|
+
}) => {
|
|
63
|
+
var _registry$select$get;
|
|
64
|
+
const existingBlockNames = (_registry$select$get = registry.select(_preferences.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
|
|
65
|
+
const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type));
|
|
66
|
+
registry.dispatch(_preferences.store).set('core', 'hiddenBlockTypes', newBlockNames);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Update the provided block types to be hidden.
|
|
71
|
+
*
|
|
72
|
+
* @param {string[]} blockNames Names of block types to hide.
|
|
73
|
+
*/
|
|
74
|
+
exports.showBlockTypes = showBlockTypes;
|
|
75
|
+
const hideBlockTypes = blockNames => ({
|
|
76
|
+
registry
|
|
77
|
+
}) => {
|
|
78
|
+
var _registry$select$get2;
|
|
79
|
+
const existingBlockNames = (_registry$select$get2 = registry.select(_preferences.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
|
|
80
|
+
const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
|
|
81
|
+
registry.dispatch(_preferences.store).set('core', 'hiddenBlockTypes', [...mergedBlockNames]);
|
|
82
|
+
};
|
|
83
|
+
exports.hideBlockTypes = hideBlockTypes;
|
|
52
84
|
//# sourceMappingURL=private-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_i18n","_notices","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","coreStore","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","noticesStore","createSuccessNotice","__","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","exports"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_coreData","require","_i18n","_notices","_preferences","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","coreStore","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","noticesStore","createSuccessNotice","__","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","exports","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","preferencesStore","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,oBAAoBA,CAAEC,EAAE,EAAG;EAC1C,OAAO;IACNC,IAAI,EAAE,yBAAyB;IAC/BD;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,cAAc,GACxBC,QAAQ,IACV,OAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC3C,MAAMC,aAAa,GAAG,MAAMD,QAAQ,CAClCD,QAAQ,CAAEG,eAAU,CAAC,CACrBC,gBAAgB,CAAE,UAAU,EAAE,aAAa,EAAEN,QAAS,CAAC;EACzDG,QAAQ,CACND,QAAQ,CAAEG,eAAU,CAAC,CACrBE,gBAAgB,CAChB,UAAU,EACVN,MAAM,CAACO,kBAAkB,CAAC,CAAC,EAC3BP,MAAM,CAACQ,gBAAgB,CAAC,CAAC,EACzB;IACCT,QAAQ,EAAEI,aAAa,CAACM;EACzB,CACD,CAAC;EACFP,QAAQ,CACND,QAAQ,CAAES,cAAa,CAAC,CACxBC,mBAAmB,CACnB,IAAAC,QAAE,EAAE,uDAAwD,CAAC,EAC7D;IACCf,IAAI,EAAE,UAAU;IAChBgB,OAAO,EAAE,CACR;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,CACjC,GAAGZ,kBAAkB,EACrB,IAAKK,KAAK,CAACC,OAAO,CAAER,UAAW,CAAC,GAAGA,UAAU,GAAG,CAAEA,UAAU,CAAE,CAAE,CAC/D,CAAC;EAEHnB,QAAQ,CACND,QAAQ,CAAEuB,kBAAiB,CAAC,CAC5BO,GAAG,CAAE,MAAM,EAAE,kBAAkB,EAAE,CAAE,GAAGG,gBAAgB,CAAG,CAAC;AAC7D,CAAC;AAACf,OAAA,CAAAa,cAAA,GAAAA,cAAA"}
|
|
@@ -34,7 +34,7 @@ const getInsertionPoint = (0, _data.createRegistrySelector)(select => state => {
|
|
|
34
34
|
return state.blockInserterPanel;
|
|
35
35
|
}
|
|
36
36
|
if ((0, _selectors.getRenderingMode)(state) === 'template-locked') {
|
|
37
|
-
const [postContentClientId] = select(_blockEditor.store).
|
|
37
|
+
const [postContentClientId] = select(_blockEditor.store).getBlocksByName('core/post-content');
|
|
38
38
|
if (postContentClientId) {
|
|
39
39
|
return {
|
|
40
40
|
rootClientId: postContentClientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_data","_selectors","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","createRegistrySelector","select","state","blockInserterPanel","getRenderingMode","postContentClientId","blockEditorStore","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_data","_selectors","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","createRegistrySelector","select","state","blockInserterPanel","getRenderingMode","postContentClientId","blockEditorStore","getBlocksByName","exports","getListViewToggleRef","listViewToggleRef"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getRenderingMode } from './selectors';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const getInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\treturn state.blockInserterPanel;\n\t\t}\n\n\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAiB,GAAG,IAAAC,4BAAsB,EACpDC,MAAM,IAAQC,KAAK,IAAM;EAC1B,IAAK,OAAOA,KAAK,CAACC,kBAAkB,KAAK,QAAQ,EAAG;IACnD,OAAOD,KAAK,CAACC,kBAAkB;EAChC;EAEA,IAAK,IAAAC,2BAAgB,EAAEF,KAAM,CAAC,KAAK,iBAAiB,EAAG;IACtD,MAAM,CAAEG,mBAAmB,CAAE,GAC5BJ,MAAM,CAAEK,kBAAiB,CAAC,CAACC,eAAe,CACzC,mBACD,CAAC;IACF,IAAKF,mBAAmB,EAAG;MAC1B,OAAO;QACNV,YAAY,EAAEU,mBAAmB;QACjCR,cAAc,EAAED,SAAS;QACzBE,WAAW,EAAEF;MACd,CAAC;IACF;EACD;EAEA,OAAOF,qBAAqB;AAC7B,CACD,CAAC;AAACc,OAAA,CAAAT,iBAAA,GAAAA,iBAAA;AAEK,SAASU,oBAAoBA,CAAEP,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACQ,iBAAiB;AAC/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
|
+
import { dispatch } from '@wordpress/data';
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../lock-unlock';
|
|
10
|
+
import postMeta from './post-meta';
|
|
11
|
+
const {
|
|
12
|
+
registerBlockBindingsSource
|
|
13
|
+
} = unlock(dispatch(blockEditorStore));
|
|
14
|
+
registerBlockBindingsSource(postMeta);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","dispatch","unlock","postMeta","registerBlockBindingsSource"],"sources":["@wordpress/editor/src/bindings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { dispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport postMeta from './post-meta';\n\nconst { registerBlockBindingsSource } = unlock( dispatch( blockEditorStore ) );\nregisterBlockBindingsSource( postMeta );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,QAAQ,MAAM,aAAa;AAElC,MAAM;EAAEC;AAA4B,CAAC,GAAGF,MAAM,CAAED,QAAQ,CAAED,gBAAiB,CAAE,CAAC;AAC9EI,2BAA2B,CAAED,QAAS,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEntityProp } from '@wordpress/core-data';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as editorStore } from '../store';
|
|
11
|
+
export default {
|
|
12
|
+
name: 'post_meta',
|
|
13
|
+
label: __('Post Meta'),
|
|
14
|
+
useSource(props, sourceAttributes) {
|
|
15
|
+
const {
|
|
16
|
+
getCurrentPostType
|
|
17
|
+
} = useSelect(editorStore);
|
|
18
|
+
const {
|
|
19
|
+
context
|
|
20
|
+
} = props;
|
|
21
|
+
const {
|
|
22
|
+
value: metaKey
|
|
23
|
+
} = sourceAttributes;
|
|
24
|
+
const postType = context.postType ? context.postType : getCurrentPostType();
|
|
25
|
+
const [meta, setMeta] = useEntityProp('postType', context.postType, 'meta', context.postId);
|
|
26
|
+
if (postType === 'wp_template') {
|
|
27
|
+
return {
|
|
28
|
+
placeholder: metaKey
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const metaValue = meta[metaKey];
|
|
32
|
+
const updateMetaValue = newValue => {
|
|
33
|
+
setMeta({
|
|
34
|
+
...meta,
|
|
35
|
+
[metaKey]: newValue
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
placeholder: metaKey,
|
|
40
|
+
useValue: [metaValue, updateMetaValue]
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
lockAttributesEditing: true
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=post-meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEntityProp","useSelect","__","store","editorStore","name","label","useSource","props","sourceAttributes","getCurrentPostType","context","value","metaKey","postType","meta","setMeta","postId","placeholder","metaValue","updateMetaValue","newValue","useValue","lockAttributesEditing"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'post_meta',\n\tlabel: __( 'Post Meta' ),\n\tuseSource( props, sourceAttributes ) {\n\t\tconst { getCurrentPostType } = useSelect( editorStore );\n\t\tconst { context } = props;\n\t\tconst { value: metaKey } = sourceAttributes;\n\t\tconst postType = context.postType\n\t\t\t? context.postType\n\t\t\t: getCurrentPostType();\n\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t'postType',\n\t\t\tcontext.postType,\n\t\t\t'meta',\n\t\t\tcontext.postId\n\t\t);\n\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn { placeholder: metaKey };\n\t\t}\n\t\tconst metaValue = meta[ metaKey ];\n\t\tconst updateMetaValue = ( newValue ) => {\n\t\t\tsetMeta( { ...meta, [ metaKey ]: newValue } );\n\t\t};\n\t\treturn {\n\t\t\tplaceholder: metaKey,\n\t\t\tuseValue: [ metaValue, updateMetaValue ],\n\t\t};\n\t},\n\tlockAttributesEditing: true,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;AAE/C,eAAe;EACdC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAEJ,EAAE,CAAE,WAAY,CAAC;EACxBK,SAASA,CAAEC,KAAK,EAAEC,gBAAgB,EAAG;IACpC,MAAM;MAAEC;IAAmB,CAAC,GAAGT,SAAS,CAAEG,WAAY,CAAC;IACvD,MAAM;MAAEO;IAAQ,CAAC,GAAGH,KAAK;IACzB,MAAM;MAAEI,KAAK,EAAEC;IAAQ,CAAC,GAAGJ,gBAAgB;IAC3C,MAAMK,QAAQ,GAAGH,OAAO,CAACG,QAAQ,GAC9BH,OAAO,CAACG,QAAQ,GAChBJ,kBAAkB,CAAC,CAAC;IACvB,MAAM,CAAEK,IAAI,EAAEC,OAAO,CAAE,GAAGhB,aAAa,CACtC,UAAU,EACVW,OAAO,CAACG,QAAQ,EAChB,MAAM,EACNH,OAAO,CAACM,MACT,CAAC;IAED,IAAKH,QAAQ,KAAK,aAAa,EAAG;MACjC,OAAO;QAAEI,WAAW,EAAEL;MAAQ,CAAC;IAChC;IACA,MAAMM,SAAS,GAAGJ,IAAI,CAAEF,OAAO,CAAE;IACjC,MAAMO,eAAe,GAAKC,QAAQ,IAAM;MACvCL,OAAO,CAAE;QAAE,GAAGD,IAAI;QAAE,CAAEF,OAAO,GAAIQ;MAAS,CAAE,CAAC;IAC9C,CAAC;IACD,OAAO;MACNH,WAAW,EAAEL,OAAO;MACpBS,QAAQ,EAAE,CAAEH,SAAS,EAAEC,eAAe;IACvC,CAAC;EACF,CAAC;EACDG,qBAAqB,EAAE;AACxB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { useMemo, useCallback } from '@wordpress/element';
|
|
6
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
8
|
+
import { CheckboxControl } from '@wordpress/components';
|
|
9
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import BlockTypesChecklist from './checklist';
|
|
15
|
+
import { store as editorStore } from '../../store';
|
|
16
|
+
import { unlock } from '../../lock-unlock';
|
|
17
|
+
function BlockManagerCategory({
|
|
18
|
+
title,
|
|
19
|
+
blockTypes
|
|
20
|
+
}) {
|
|
21
|
+
const instanceId = useInstanceId(BlockManagerCategory);
|
|
22
|
+
const {
|
|
23
|
+
allowedBlockTypes,
|
|
24
|
+
hiddenBlockTypes
|
|
25
|
+
} = useSelect(select => {
|
|
26
|
+
const {
|
|
27
|
+
getEditorSettings
|
|
28
|
+
} = select(editorStore);
|
|
29
|
+
const {
|
|
30
|
+
get
|
|
31
|
+
} = select(preferencesStore);
|
|
32
|
+
return {
|
|
33
|
+
allowedBlockTypes: getEditorSettings().allowedBlockTypes,
|
|
34
|
+
hiddenBlockTypes: get('core', 'hiddenBlockTypes')
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
const filteredBlockTypes = useMemo(() => {
|
|
38
|
+
if (allowedBlockTypes === true) {
|
|
39
|
+
return blockTypes;
|
|
40
|
+
}
|
|
41
|
+
return blockTypes.filter(({
|
|
42
|
+
name
|
|
43
|
+
}) => {
|
|
44
|
+
return allowedBlockTypes?.includes(name);
|
|
45
|
+
});
|
|
46
|
+
}, [allowedBlockTypes, blockTypes]);
|
|
47
|
+
const {
|
|
48
|
+
showBlockTypes,
|
|
49
|
+
hideBlockTypes
|
|
50
|
+
} = unlock(useDispatch(editorStore));
|
|
51
|
+
const toggleVisible = useCallback((blockName, nextIsChecked) => {
|
|
52
|
+
if (nextIsChecked) {
|
|
53
|
+
showBlockTypes(blockName);
|
|
54
|
+
} else {
|
|
55
|
+
hideBlockTypes(blockName);
|
|
56
|
+
}
|
|
57
|
+
}, [showBlockTypes, hideBlockTypes]);
|
|
58
|
+
const toggleAllVisible = useCallback(nextIsChecked => {
|
|
59
|
+
const blockNames = blockTypes.map(({
|
|
60
|
+
name
|
|
61
|
+
}) => name);
|
|
62
|
+
if (nextIsChecked) {
|
|
63
|
+
showBlockTypes(blockNames);
|
|
64
|
+
} else {
|
|
65
|
+
hideBlockTypes(blockNames);
|
|
66
|
+
}
|
|
67
|
+
}, [blockTypes, showBlockTypes, hideBlockTypes]);
|
|
68
|
+
if (!filteredBlockTypes.length) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const checkedBlockNames = filteredBlockTypes.map(({
|
|
72
|
+
name
|
|
73
|
+
}) => name).filter(type => !(hiddenBlockTypes !== null && hiddenBlockTypes !== void 0 ? hiddenBlockTypes : []).includes(type));
|
|
74
|
+
const titleId = 'editor-block-manager__category-title-' + instanceId;
|
|
75
|
+
const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;
|
|
76
|
+
const isIndeterminate = !isAllChecked && checkedBlockNames.length > 0;
|
|
77
|
+
return createElement("div", {
|
|
78
|
+
role: "group",
|
|
79
|
+
"aria-labelledby": titleId,
|
|
80
|
+
className: "editor-block-manager__category"
|
|
81
|
+
}, createElement(CheckboxControl, {
|
|
82
|
+
__nextHasNoMarginBottom: true,
|
|
83
|
+
checked: isAllChecked,
|
|
84
|
+
onChange: toggleAllVisible,
|
|
85
|
+
className: "editor-block-manager__category-title",
|
|
86
|
+
indeterminate: isIndeterminate,
|
|
87
|
+
label: createElement("span", {
|
|
88
|
+
id: titleId
|
|
89
|
+
}, title)
|
|
90
|
+
}), createElement(BlockTypesChecklist, {
|
|
91
|
+
blockTypes: filteredBlockTypes,
|
|
92
|
+
value: checkedBlockNames,
|
|
93
|
+
onItemChange: toggleVisible
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
export default BlockManagerCategory;
|
|
97
|
+
//# sourceMappingURL=category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","useInstanceId","CheckboxControl","store","preferencesStore","BlockTypesChecklist","editorStore","unlock","BlockManagerCategory","title","blockTypes","instanceId","allowedBlockTypes","hiddenBlockTypes","select","getEditorSettings","get","filteredBlockTypes","filter","name","includes","showBlockTypes","hideBlockTypes","toggleVisible","blockName","nextIsChecked","toggleAllVisible","blockNames","map","length","checkedBlockNames","type","titleId","isAllChecked","isIndeterminate","createElement","role","className","__nextHasNoMarginBottom","checked","onChange","indeterminate","label","id","value","onItemChange"],"sources":["@wordpress/editor/src/components/block-manager/category.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockManagerCategory( { title, blockTypes } ) {\n\tconst instanceId = useInstanceId( BlockManagerCategory );\n\tconst { allowedBlockTypes, hiddenBlockTypes } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tallowedBlockTypes: getEditorSettings().allowedBlockTypes,\n\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t};\n\t}, [] );\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( allowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn allowedBlockTypes?.includes( name );\n\t\t} );\n\t}, [ allowedBlockTypes, blockTypes ] );\n\tconst { showBlockTypes, hideBlockTypes } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst toggleVisible = useCallback(\n\t\t( blockName, nextIsChecked ) => {\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockName );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockName );\n\t\t\t}\n\t\t},\n\t\t[ showBlockTypes, hideBlockTypes ]\n\t);\n\tconst toggleAllVisible = useCallback(\n\t\t( nextIsChecked ) => {\n\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockNames );\n\t\t\t}\n\t\t},\n\t\t[ blockTypes, showBlockTypes, hideBlockTypes ]\n\t);\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = filteredBlockTypes\n\t\t.map( ( { name } ) => name )\n\t\t.filter( ( type ) => ! ( hiddenBlockTypes ?? [] ).includes( type ) );\n\n\tconst titleId = 'editor-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\tconst isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"editor-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"editor-block-manager__category-title\"\n\t\t\t\tindeterminate={ isIndeterminate }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockManagerCategory;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,eAAe,QAAQ,uBAAuB;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MAAMQ,EAAE,EAAGX;IAAS,GAAGvB,KAAa;EAAG,CAC/C,CAAC,EACF0B,aAAA,CAAC9B,mBAAmB;IACnBK,UAAU,EAAGO,kBAAoB;IACjC2B,KAAK,EAAGd,iBAAmB;IAC3Be,YAAY,EAAGtB;EAAe,CAC9B,CACG,CAAC;AAER;AAEA,eAAef,oBAAoB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { BlockIcon } from '@wordpress/block-editor';
|
|
6
|
+
import { CheckboxControl } from '@wordpress/components';
|
|
7
|
+
function BlockTypesChecklist({
|
|
8
|
+
blockTypes,
|
|
9
|
+
value,
|
|
10
|
+
onItemChange
|
|
11
|
+
}) {
|
|
12
|
+
return createElement("ul", {
|
|
13
|
+
className: "editor-block-manager__checklist"
|
|
14
|
+
}, blockTypes.map(blockType => createElement("li", {
|
|
15
|
+
key: blockType.name,
|
|
16
|
+
className: "editor-block-manager__checklist-item"
|
|
17
|
+
}, createElement(CheckboxControl, {
|
|
18
|
+
__nextHasNoMarginBottom: true,
|
|
19
|
+
label: blockType.title,
|
|
20
|
+
checked: value.includes(blockType.name),
|
|
21
|
+
onChange: (...args) => onItemChange(blockType.name, ...args)
|
|
22
|
+
}), createElement(BlockIcon, {
|
|
23
|
+
icon: blockType.icon
|
|
24
|
+
}))));
|
|
25
|
+
}
|
|
26
|
+
export default BlockTypesChecklist;
|
|
27
|
+
//# sourceMappingURL=checklist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BlockIcon","CheckboxControl","BlockTypesChecklist","blockTypes","value","onItemChange","createElement","className","map","blockType","key","name","__nextHasNoMarginBottom","label","title","checked","includes","onChange","args","icon"],"sources":["@wordpress/editor/src/components/block-manager/checklist.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"editor-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"editor-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ blockType.title }\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ ( ...args ) =>\n\t\t\t\t\t\t\tonItemChange( blockType.name, ...args )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,yBAAyB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,mBAAmBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACnE,OACCC,aAAA;IAAIC,SAAS,EAAC;EAAiC,GAC5CJ,UAAU,CAACK,GAAG,CAAIC,SAAS,IAC5BH,aAAA;IACCI,GAAG,EAAGD,SAAS,CAACE,IAAM;IACtBJ,SAAS,EAAC;EAAsC,GAEhDD,aAAA,CAACL,eAAe;IACfW,uBAAuB;IACvBC,KAAK,EAAGJ,SAAS,CAACK,KAAO;IACzBC,OAAO,EAAGX,KAAK,CAACY,QAAQ,CAAEP,SAAS,CAACE,IAAK,CAAG;IAC5CM,QAAQ,EAAGA,CAAE,GAAGC,IAAI,KACnBb,YAAY,CAAEI,SAAS,CAACE,IAAI,EAAE,GAAGO,IAAK;EACtC,CACD,CAAC,EACFZ,aAAA,CAACN,SAAS;IAACmB,IAAI,EAAGV,SAAS,CAACU;EAAM,CAAE,CACjC,CACH,CACC,CAAC;AAEP;AAEA,eAAejB,mBAAmB"}
|