@wordpress/edit-site 5.21.0 → 5.22.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/actions/index.js +121 -0
- package/build/components/actions/index.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +12 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews/dataviews.js +10 -2
- package/build/components/dataviews/dataviews.js.map +1 -1
- package/build/components/dataviews/filters.js +30 -17
- package/build/components/dataviews/filters.js.map +1 -1
- package/build/components/dataviews/in-filter.js +5 -7
- package/build/components/dataviews/in-filter.js.map +1 -1
- package/build/components/dataviews/item-actions.js +62 -0
- package/build/components/dataviews/item-actions.js.map +1 -0
- package/build/components/dataviews/pagination.js +31 -50
- package/build/components/dataviews/pagination.js.map +1 -1
- package/build/components/dataviews/{text-filter.js → search.js} +10 -10
- package/build/components/dataviews/search.js.map +1 -0
- package/build/components/dataviews/view-grid.js +3 -3
- package/build/components/dataviews/view-grid.js.map +1 -1
- package/build/components/dataviews/view-list.js +2 -2
- package/build/components/dataviews/view-list.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -8
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/page-pages/default-views.js +62 -0
- package/build/components/page-pages/default-views.js.map +1 -0
- package/build/components/page-pages/index.js +73 -52
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js +27 -9
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/save-button/index.js +4 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +74 -0
- package/build/components/sidebar-dataviews/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/page-details.js +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +3 -2
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/utils/use-activate-theme.js +8 -0
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/actions/index.js +108 -0
- package/build-module/components/actions/index.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +12 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews/dataviews.js +10 -2
- package/build-module/components/dataviews/dataviews.js.map +1 -1
- package/build-module/components/dataviews/filters.js +30 -17
- package/build-module/components/dataviews/filters.js.map +1 -1
- package/build-module/components/dataviews/in-filter.js +5 -7
- package/build-module/components/dataviews/in-filter.js.map +1 -1
- package/build-module/components/dataviews/item-actions.js +55 -0
- package/build-module/components/dataviews/item-actions.js.map +1 -0
- package/build-module/components/dataviews/pagination.js +32 -51
- package/build-module/components/dataviews/pagination.js.map +1 -1
- package/build-module/components/dataviews/{text-filter.js → search.js} +9 -9
- package/build-module/components/dataviews/search.js.map +1 -0
- package/build-module/components/dataviews/view-grid.js +3 -3
- package/build-module/components/dataviews/view-grid.js.map +1 -1
- package/build-module/components/dataviews/view-list.js +2 -2
- package/build-module/components/dataviews/view-list.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -8
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/page-pages/default-views.js +55 -0
- package/build-module/components/page-pages/default-views.js.map +1 -0
- package/build-module/components/page-pages/index.js +71 -52
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +25 -9
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/save-button/index.js +4 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +66 -0
- package/build-module/components/sidebar-dataviews/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +8 -0
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +9 -5
- package/build-style/style.css +9 -5
- package/package.json +40 -40
- package/src/components/actions/index.js +123 -0
- package/src/components/block-editor/use-site-editor-settings.js +21 -13
- package/src/components/dataviews/README.md +134 -47
- package/src/components/dataviews/dataviews.js +11 -1
- package/src/components/dataviews/filters.js +35 -17
- package/src/components/dataviews/in-filter.js +5 -7
- package/src/components/dataviews/item-actions.js +69 -0
- package/src/components/dataviews/pagination.js +53 -74
- package/src/components/dataviews/{text-filter.js → search.js} +7 -7
- package/src/components/dataviews/style.scss +10 -5
- package/src/components/dataviews/view-grid.js +7 -2
- package/src/components/dataviews/view-list.js +2 -2
- package/src/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/src/components/global-styles/screen-block.js +1 -7
- package/src/components/page-pages/default-views.js +60 -0
- package/src/components/page-pages/index.js +85 -60
- package/src/components/page-patterns/rename-category-menu-item.js +29 -12
- package/src/components/save-button/index.js +10 -5
- package/src/components/sidebar/index.js +2 -0
- package/src/components/sidebar-dataviews/index.js +66 -0
- package/src/components/sidebar-navigation-screen-page/page-details.js +3 -1
- package/src/hooks/commands/use-edit-mode-commands.js +3 -1
- package/src/utils/use-activate-theme.js +5 -0
- package/build/components/actions/trash-post.js +0 -48
- package/build/components/actions/trash-post.js.map +0 -1
- package/build/components/dataviews/field-actions.js +0 -30
- package/build/components/dataviews/field-actions.js.map +0 -1
- package/build/components/dataviews/text-filter.js.map +0 -1
- package/build-module/components/actions/trash-post.js +0 -41
- package/build-module/components/actions/trash-post.js.map +0 -1
- package/build-module/components/dataviews/field-actions.js +0 -22
- package/build-module/components/dataviews/field-actions.js.map +0 -1
- package/build-module/components/dataviews/text-filter.js.map +0 -1
- package/src/components/actions/trash-post.js +0 -55
- package/src/components/dataviews/field-actions.js +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockEditor","_element","_data","_coreData","_components","_i18n","_header","_interopRequireDefault","_blockPreviewPanel","_lockUnlock","_subtitle","_variationsPanel","applyFallbackStyle","border","hasColorOrWidth","color","width","style","undefined","applyAllFallbackStyles","hasSplitBorders","top","right","bottom","left","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useHasEffectsPanel","useHasFiltersPanel","useHasImageSettingsPanel","useGlobalStyle","BorderPanel","StylesBorderPanel","ColorPanel","StylesColorPanel","TypographyPanel","StylesTypographyPanel","DimensionsPanel","StylesDimensionsPanel","EffectsPanel","StylesEffectsPanel","FiltersPanel","StylesFiltersPanel","ImageSettingsPanel","AdvancedPanel","StylesAdvancedPanel","unlock","blockEditorPrivateApis","ScreenBlock","name","variation","prefixParts","concat","prefix","join","shouldDecodeEncode","inheritedStyle","setStyle","userSettings","rawSettings","setSettings","settings","blockType","getBlockType","spacing","blockGap","supports","__experimentalSkipSerialization","some","spacingType","blockVariations","useBlockVariations","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasEffectsPanel","hasFiltersPanel","hasImageSettingsPanel","hasVariationsPanel","length","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","_links","currentBlockStyle","find","s","inheritedStyleWithLayout","useMemo","layout","styleWithLayout","onChangeDimensions","newStyle","updatedStyle","onChangeLightbox","newSetting","lightbox","onChangeBorders","radius","newBorder","updatedBorder","_react","createElement","Fragment","default","title","label","className","__experimentalVStack","__","VariationsPanel","inheritedValue","value","onChange","includeLayoutControls","customDuotone","PanelBody","initialOpen","sprintf","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport { useBlockVariations, VariationsPanel } from './variations-panel';\n\nfunction applyFallbackStyle( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tconst hasColorOrWidth = border.color || border.width;\n\n\tif ( ! border.style && hasColorOrWidth ) {\n\t\treturn { ...border, style: 'solid' };\n\t}\n\n\tif ( border.style && ! hasColorOrWidth ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n}\n\nfunction applyAllFallbackStyles( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tif ( hasSplitBorders( border ) ) {\n\t\treturn {\n\t\t\ttop: applyFallbackStyle( border.top ),\n\t\t\tright: applyFallbackStyle( border.right ),\n\t\t\tbottom: applyFallbackStyle( border.bottom ),\n\t\t\tleft: applyFallbackStyle( border.left ),\n\t\t};\n\t}\n\n\treturn applyFallbackStyle( border );\n}\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n\tuseHasEffectsPanel,\n\tuseHasFiltersPanel,\n\tuseHasImageSettingsPanel,\n\tuseGlobalStyle,\n\tBorderPanel: StylesBorderPanel,\n\tColorPanel: StylesColorPanel,\n\tTypographyPanel: StylesTypographyPanel,\n\tDimensionsPanel: StylesDimensionsPanel,\n\tEffectsPanel: StylesEffectsPanel,\n\tFiltersPanel: StylesFiltersPanel,\n\tImageSettingsPanel,\n\tAdvancedPanel: StylesAdvancedPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction ScreenBlock( { name, variation } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ userSettings ] = useGlobalSetting( '', name, 'user' );\n\tconst [ rawSettings, setSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst blockType = getBlockType( name );\n\n\t// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.\n\tif (\n\t\tsettings?.spacing?.blockGap &&\n\t\tblockType?.supports?.spacing?.blockGap &&\n\t\t( blockType?.supports?.spacing?.__experimentalSkipSerialization ===\n\t\t\ttrue ||\n\t\t\tblockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(\n\t\t\t\t( spacingType ) => spacingType === 'blockGap'\n\t\t\t) )\n\t) {\n\t\tsettings.spacing.blockGap = false;\n\t}\n\n\tconst blockVariations = useBlockVariations( name );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\tconst hasFiltersPanel = useHasFiltersPanel( settings );\n\tconst hasImageSettingsPanel = useHasImageSettingsPanel(\n\t\tname,\n\t\tuserSettings,\n\t\tsettings\n\t);\n\tconst hasVariationsPanel = !! blockVariations?.length && ! variation;\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst currentBlockStyle = variation\n\t\t? blockVariations.find( ( s ) => s.name === variation )\n\t\t: null;\n\n\t// These intermediary objects are needed because the \"layout\" property is stored\n\t// in settings rather than styles.\n\tconst inheritedStyleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...inheritedStyle,\n\t\t\tlayout: settings.layout,\n\t\t};\n\t}, [ inheritedStyle, settings.layout ] );\n\tconst styleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...style,\n\t\t\tlayout: userSettings.layout,\n\t\t};\n\t}, [ style, userSettings.layout ] );\n\tconst onChangeDimensions = ( newStyle ) => {\n\t\tconst updatedStyle = { ...newStyle };\n\t\tdelete updatedStyle.layout;\n\t\tsetStyle( updatedStyle );\n\n\t\tif ( newStyle.layout !== userSettings.layout ) {\n\t\t\tsetSettings( {\n\t\t\t\t...userSettings,\n\t\t\t\tlayout: newStyle.layout,\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeLightbox = ( newSetting ) => {\n\t\t// If the newSetting is undefined, this means that the user has deselected\n\t\t// (reset) the lightbox setting.\n\t\tif ( newSetting === undefined ) {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\n\t\t\t// Otherwise, we simply set the lightbox setting to the new value but\n\t\t\t// taking care of not overriding the other lightbox settings.\n\t\t} else {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: {\n\t\t\t\t\t...rawSettings.lightbox,\n\t\t\t\t\t...newSetting,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeBorders = ( newStyle ) => {\n\t\tif ( ! newStyle?.border ) {\n\t\t\tsetStyle( newStyle );\n\t\t\treturn;\n\t\t}\n\n\t\t// As Global Styles can't conditionally generate styles based on if\n\t\t// other style properties have been set, we need to force split\n\t\t// border definitions for user set global border styles. Border\n\t\t// radius is derived from the same property i.e. `border.radius` if\n\t\t// it is a string that is used. The longhand border radii styles are\n\t\t// only generated if that property is an object.\n\t\t//\n\t\t// For borders (color, style, and width) those are all properties on\n\t\t// the `border` style property. This means if the theme.json defined\n\t\t// split borders and the user condenses them into a flat border or\n\t\t// vice-versa we'd get both sets of styles which would conflict.\n\t\tconst { radius, ...newBorder } = newStyle.border;\n\t\tconst border = applyAllFallbackStyles( newBorder );\n\t\tconst updatedBorder = ! hasSplitBorders( border )\n\t\t\t? {\n\t\t\t\t\ttop: border,\n\t\t\t\t\tright: border,\n\t\t\t\t\tbottom: border,\n\t\t\t\t\tleft: border,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tcolor: null,\n\t\t\t\t\tstyle: null,\n\t\t\t\t\twidth: null,\n\t\t\t\t\t...border,\n\t\t\t };\n\n\t\tsetStyle( { ...newStyle, border: { ...updatedBorder, radius } } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ variation ? currentBlockStyle.label : blockType.title }\n\t\t\t/>\n\t\t\t<BlockPreviewPanel name={ name } variation={ variation } />\n\t\t\t{ hasVariationsPanel && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-variations\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Style Variations' ) }</Subtitle>\n\t\t\t\t\t\t<VariationsPanel name={ name } />\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<StylesColorPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<StylesTypographyPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<StylesDimensionsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ onChangeDimensions }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<StylesBorderPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ onChangeBorders }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasEffectsPanel && (\n\t\t\t\t<StylesEffectsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFiltersPanel && (\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ {\n\t\t\t\t\t\t...settings,\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...settings.color,\n\t\t\t\t\t\t\tcustomDuotone: false, //TO FIX: Custom duotone only works on the block level right now\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasImageSettingsPanel && (\n\t\t\t\t<ImageSettingsPanel\n\t\t\t\t\tonChange={ onChangeLightbox }\n\t\t\t\t\tvalue={ userSettings }\n\t\t\t\t\tinheritedValue={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canEditCSS && (\n\t\t\t\t<PanelBody title={ __( 'Advanced' ) } initialOpen={ false }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockType?.title\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAC,sBAAA,CAAAR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AqB;EAAA,CACrB,CACD,EACC3C,eAAe,IAChB,IAAA8B,MAAA,CAAAC,aAAA,EAAClE,kBAAkB;IAClB2E,cAAc,EAAGxB,wBAA0B;IAC3CyB,KAAK,EAAGtB,eAAiB;IACzBuB,QAAQ,EAAG9D,QAAU;IACrBI,QAAQ,EAAG;MACV,GAAGA,QAAQ;MACXlD,KAAK,EAAE;QACN,GAAGkD,QAAQ,CAAClD,KAAK;QACjB8G,aAAa,EAAE,KAAK,CAAE;MACvB;IACD,CAAG;;IACHD,qBAAqB;EAAA,CACrB,CACD,EACC1C,qBAAqB,IACtB,IAAA6B,MAAA,CAAAC,aAAA,EAACjE,kBAAkB;IAClB4E,QAAQ,EAAGnB,gBAAkB;IAC7BkB,KAAK,EAAG5D,YAAc;IACtB2D,cAAc,EAAGxD;EAAU,CAC3B,CACD,EAECoB,UAAU,IACX,IAAA0B,MAAA,CAAAC,aAAA,EAAC5G,WAAA,CAAA0H,SAAS;IAACX,KAAK,EAAG,IAAAI,QAAE,EAAE,UAAW,CAAG;IAACQ,WAAW,EAAG;EAAO,GAC1D,IAAAhB,MAAA,CAAAC,aAAA,aACG,IAAAgB,aAAO;EACR;EACA,IAAAT,QAAE,EACD,2IACD,CAAC,EACDrD,SAAS,EAAEiD,KACZ,CACE,CAAC,EACJ,IAAAJ,MAAA,CAAAC,aAAA,EAAC/D,mBAAmB;IACnByE,KAAK,EAAGzG,KAAO;IACf0G,QAAQ,EAAG9D,QAAU;IACrB4D,cAAc,EAAG7D;EAAgB,CACjC,CACS,CAEX,CAAC;AAEL;AAAC,IAAAqE,QAAA,GAEc7E,WAAW;AAAA8E,OAAA,CAAAhB,OAAA,GAAAe,QAAA"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_blockEditor","_element","_data","_coreData","_components","_i18n","_header","_interopRequireDefault","_blockPreviewPanel","_lockUnlock","_subtitle","_variationsPanel","applyFallbackStyle","border","hasColorOrWidth","color","width","style","undefined","applyAllFallbackStyles","hasSplitBorders","top","right","bottom","left","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useHasEffectsPanel","useHasFiltersPanel","useHasImageSettingsPanel","useGlobalStyle","BorderPanel","StylesBorderPanel","ColorPanel","StylesColorPanel","TypographyPanel","StylesTypographyPanel","DimensionsPanel","StylesDimensionsPanel","EffectsPanel","StylesEffectsPanel","FiltersPanel","StylesFiltersPanel","ImageSettingsPanel","AdvancedPanel","StylesAdvancedPanel","unlock","blockEditorPrivateApis","ScreenBlock","name","variation","prefixParts","concat","prefix","join","shouldDecodeEncode","inheritedStyle","setStyle","userSettings","rawSettings","setSettings","settings","blockType","getBlockType","spacing","blockGap","supports","__experimentalSkipSerialization","some","spacingType","blockVariations","useBlockVariations","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasEffectsPanel","hasFiltersPanel","hasImageSettingsPanel","hasVariationsPanel","length","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","_links","currentBlockStyle","find","s","inheritedStyleWithLayout","useMemo","layout","styleWithLayout","onChangeDimensions","newStyle","updatedStyle","onChangeLightbox","newSetting","lightbox","onChangeBorders","radius","newBorder","updatedBorder","_react","createElement","Fragment","default","title","label","className","__experimentalVStack","__","VariationsPanel","inheritedValue","value","onChange","includeLayoutControls","PanelBody","initialOpen","sprintf","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../lock-unlock';\nimport Subtitle from './subtitle';\nimport { useBlockVariations, VariationsPanel } from './variations-panel';\n\nfunction applyFallbackStyle( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tconst hasColorOrWidth = border.color || border.width;\n\n\tif ( ! border.style && hasColorOrWidth ) {\n\t\treturn { ...border, style: 'solid' };\n\t}\n\n\tif ( border.style && ! hasColorOrWidth ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n}\n\nfunction applyAllFallbackStyles( border ) {\n\tif ( ! border ) {\n\t\treturn border;\n\t}\n\n\tif ( hasSplitBorders( border ) ) {\n\t\treturn {\n\t\t\ttop: applyFallbackStyle( border.top ),\n\t\t\tright: applyFallbackStyle( border.right ),\n\t\t\tbottom: applyFallbackStyle( border.bottom ),\n\t\t\tleft: applyFallbackStyle( border.left ),\n\t\t};\n\t}\n\n\treturn applyFallbackStyle( border );\n}\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n\tuseHasEffectsPanel,\n\tuseHasFiltersPanel,\n\tuseHasImageSettingsPanel,\n\tuseGlobalStyle,\n\tBorderPanel: StylesBorderPanel,\n\tColorPanel: StylesColorPanel,\n\tTypographyPanel: StylesTypographyPanel,\n\tDimensionsPanel: StylesDimensionsPanel,\n\tEffectsPanel: StylesEffectsPanel,\n\tFiltersPanel: StylesFiltersPanel,\n\tImageSettingsPanel,\n\tAdvancedPanel: StylesAdvancedPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction ScreenBlock( { name, variation } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ userSettings ] = useGlobalSetting( '', name, 'user' );\n\tconst [ rawSettings, setSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst blockType = getBlockType( name );\n\n\t// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.\n\tif (\n\t\tsettings?.spacing?.blockGap &&\n\t\tblockType?.supports?.spacing?.blockGap &&\n\t\t( blockType?.supports?.spacing?.__experimentalSkipSerialization ===\n\t\t\ttrue ||\n\t\t\tblockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(\n\t\t\t\t( spacingType ) => spacingType === 'blockGap'\n\t\t\t) )\n\t) {\n\t\tsettings.spacing.blockGap = false;\n\t}\n\n\tconst blockVariations = useBlockVariations( name );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\tconst hasFiltersPanel = useHasFiltersPanel( settings );\n\tconst hasImageSettingsPanel = useHasImageSettingsPanel(\n\t\tname,\n\t\tuserSettings,\n\t\tsettings\n\t);\n\tconst hasVariationsPanel = !! blockVariations?.length && ! variation;\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst currentBlockStyle = variation\n\t\t? blockVariations.find( ( s ) => s.name === variation )\n\t\t: null;\n\n\t// These intermediary objects are needed because the \"layout\" property is stored\n\t// in settings rather than styles.\n\tconst inheritedStyleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...inheritedStyle,\n\t\t\tlayout: settings.layout,\n\t\t};\n\t}, [ inheritedStyle, settings.layout ] );\n\tconst styleWithLayout = useMemo( () => {\n\t\treturn {\n\t\t\t...style,\n\t\t\tlayout: userSettings.layout,\n\t\t};\n\t}, [ style, userSettings.layout ] );\n\tconst onChangeDimensions = ( newStyle ) => {\n\t\tconst updatedStyle = { ...newStyle };\n\t\tdelete updatedStyle.layout;\n\t\tsetStyle( updatedStyle );\n\n\t\tif ( newStyle.layout !== userSettings.layout ) {\n\t\t\tsetSettings( {\n\t\t\t\t...userSettings,\n\t\t\t\tlayout: newStyle.layout,\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeLightbox = ( newSetting ) => {\n\t\t// If the newSetting is undefined, this means that the user has deselected\n\t\t// (reset) the lightbox setting.\n\t\tif ( newSetting === undefined ) {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\n\t\t\t// Otherwise, we simply set the lightbox setting to the new value but\n\t\t\t// taking care of not overriding the other lightbox settings.\n\t\t} else {\n\t\t\tsetSettings( {\n\t\t\t\t...rawSettings,\n\t\t\t\tlightbox: {\n\t\t\t\t\t...rawSettings.lightbox,\n\t\t\t\t\t...newSetting,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t};\n\tconst onChangeBorders = ( newStyle ) => {\n\t\tif ( ! newStyle?.border ) {\n\t\t\tsetStyle( newStyle );\n\t\t\treturn;\n\t\t}\n\n\t\t// As Global Styles can't conditionally generate styles based on if\n\t\t// other style properties have been set, we need to force split\n\t\t// border definitions for user set global border styles. Border\n\t\t// radius is derived from the same property i.e. `border.radius` if\n\t\t// it is a string that is used. The longhand border radii styles are\n\t\t// only generated if that property is an object.\n\t\t//\n\t\t// For borders (color, style, and width) those are all properties on\n\t\t// the `border` style property. This means if the theme.json defined\n\t\t// split borders and the user condenses them into a flat border or\n\t\t// vice-versa we'd get both sets of styles which would conflict.\n\t\tconst { radius, ...newBorder } = newStyle.border;\n\t\tconst border = applyAllFallbackStyles( newBorder );\n\t\tconst updatedBorder = ! hasSplitBorders( border )\n\t\t\t? {\n\t\t\t\t\ttop: border,\n\t\t\t\t\tright: border,\n\t\t\t\t\tbottom: border,\n\t\t\t\t\tleft: border,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tcolor: null,\n\t\t\t\t\tstyle: null,\n\t\t\t\t\twidth: null,\n\t\t\t\t\t...border,\n\t\t\t };\n\n\t\tsetStyle( { ...newStyle, border: { ...updatedBorder, radius } } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ variation ? currentBlockStyle.label : blockType.title }\n\t\t\t/>\n\t\t\t<BlockPreviewPanel name={ name } variation={ variation } />\n\t\t\t{ hasVariationsPanel && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-variations\">\n\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t<Subtitle>{ __( 'Style Variations' ) }</Subtitle>\n\t\t\t\t\t\t<VariationsPanel name={ name } />\n\t\t\t\t\t</VStack>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<StylesColorPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<StylesTypographyPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasDimensionsPanel && (\n\t\t\t\t<StylesDimensionsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ onChangeDimensions }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<StylesBorderPanel\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ onChangeBorders }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasEffectsPanel && (\n\t\t\t\t<StylesEffectsPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFiltersPanel && (\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tinheritedValue={ inheritedStyleWithLayout }\n\t\t\t\t\tvalue={ styleWithLayout }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tincludeLayoutControls\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasImageSettingsPanel && (\n\t\t\t\t<ImageSettingsPanel\n\t\t\t\t\tonChange={ onChangeLightbox }\n\t\t\t\t\tvalue={ userSettings }\n\t\t\t\t\tinheritedValue={ settings }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ canEditCSS && (\n\t\t\t\t<PanelBody title={ __( 'Advanced' ) } initialOpen={ false }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Table'.\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblockType?.title\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBlock;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AAtBA;AACA;AACA;;AAaA;AACA;AACA;;AAOA,SAASa,kBAAkBA,CAAEC,MAAM,EAAG;EACrC,IAAK,CAAEA,MAAM,EAAG;IACf,OAAOA,MAAM;EACd;EAEA,MAAMC,eAAe,GAAGD,MAAM,CAACE,KAAK,IAAIF,MAAM,CAACG,KAAK;EAEpD,IAAK,CAAEH,MAAM,CAACI,KAAK,IAAIH,eAAe,EAAG;IACxC,OAAO;MAAE,GAAGD,MAAM;MAAEI,KAAK,EAAE;IAAQ,CAAC;EACrC;EAEA,IAAKJ,MAAM,CAACI,KAAK,IAAI,CAAEH,eAAe,EAAG;IACxC,OAAOI,SAAS;EACjB;EAEA,OAAOL,MAAM;AACd;AAEA,SA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ACR;EACA,IAAAR,QAAE,EACD,2IACD,CAAC,EACDrD,SAAS,EAAEiD,KACZ,CACE,CAAC,EACJ,IAAAJ,MAAA,CAAAC,aAAA,EAAC/D,mBAAmB;IACnByE,KAAK,EAAGzG,KAAO;IACf0G,QAAQ,EAAG9D,QAAU;IACrB4D,cAAc,EAAG7D;EAAgB,CACjC,CACS,CAEX,CAAC;AAEL;AAAC,IAAAoE,QAAA,GAEc5E,WAAW;AAAA6E,OAAA,CAAAf,OAAA,GAAAc,QAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DEFAULT_STATUSES = void 0;
|
|
7
|
+
var _i18n = require("@wordpress/i18n");
|
|
8
|
+
var _icons = require("@wordpress/icons");
|
|
9
|
+
/**
|
|
10
|
+
* WordPress dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// DEFAULT_STATUSES is intentionally sorted. Items do not have spaces in between them.
|
|
14
|
+
// The reason for that is to match the default statuses coming from the endpoint
|
|
15
|
+
// (entity request and useEffect to update the view).
|
|
16
|
+
const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All statuses but 'trash'.
|
|
17
|
+
exports.DEFAULT_STATUSES = DEFAULT_STATUSES;
|
|
18
|
+
const DEFAULT_PAGE_BASE = {
|
|
19
|
+
type: 'list',
|
|
20
|
+
search: '',
|
|
21
|
+
filters: {
|
|
22
|
+
status: DEFAULT_STATUSES
|
|
23
|
+
},
|
|
24
|
+
page: 1,
|
|
25
|
+
perPage: 5,
|
|
26
|
+
sort: {
|
|
27
|
+
field: 'date',
|
|
28
|
+
direction: 'desc'
|
|
29
|
+
},
|
|
30
|
+
visibleFilters: ['author', 'status'],
|
|
31
|
+
// All fields are visible by default, so it's
|
|
32
|
+
// better to keep track of the hidden ones.
|
|
33
|
+
hiddenFields: ['date', 'featured-image'],
|
|
34
|
+
layout: {}
|
|
35
|
+
};
|
|
36
|
+
const DEFAULT_VIEWS = [{
|
|
37
|
+
title: (0, _i18n.__)('All'),
|
|
38
|
+
slug: 'all',
|
|
39
|
+
view: DEFAULT_PAGE_BASE
|
|
40
|
+
}, {
|
|
41
|
+
title: (0, _i18n.__)('Drafts'),
|
|
42
|
+
slug: 'drafts',
|
|
43
|
+
view: {
|
|
44
|
+
...DEFAULT_PAGE_BASE,
|
|
45
|
+
filters: {
|
|
46
|
+
status: 'draft'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
title: (0, _i18n.__)('Trash'),
|
|
51
|
+
slug: 'trash',
|
|
52
|
+
icon: _icons.trash,
|
|
53
|
+
view: {
|
|
54
|
+
...DEFAULT_PAGE_BASE,
|
|
55
|
+
filters: {
|
|
56
|
+
status: 'trash'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}];
|
|
60
|
+
var _default = DEFAULT_VIEWS;
|
|
61
|
+
exports.default = _default;
|
|
62
|
+
//# sourceMappingURL=default-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","DEFAULT_STATUSES","exports","DEFAULT_PAGE_BASE","type","search","filters","status","page","perPage","sort","field","direction","visibleFilters","hiddenFields","layout","DEFAULT_VIEWS","title","__","slug","view","icon","trash","_default","default"],"sources":["@wordpress/edit-site/src/components/page-pages/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n// DEFAULT_STATUSES is intentionally sorted. Items do not have spaces in between them.\n// The reason for that is to match the default statuses coming from the endpoint\n// (entity request and useEffect to update the view).\nexport const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All statuses but 'trash'.\n\nconst DEFAULT_PAGE_BASE = {\n\ttype: 'list',\n\tsearch: '',\n\tfilters: {\n\t\tstatus: DEFAULT_STATUSES,\n\t},\n\tpage: 1,\n\tperPage: 5,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tvisibleFilters: [ 'author', 'status' ],\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'date', 'featured-image' ],\n\tlayout: {},\n};\n\nconst DEFAULT_VIEWS = [\n\t{\n\t\ttitle: __( 'All' ),\n\t\tslug: 'all',\n\t\tview: DEFAULT_PAGE_BASE,\n\t},\n\t{\n\t\ttitle: __( 'Drafts' ),\n\t\tslug: 'drafts',\n\t\tview: {\n\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\tfilters: {\n\t\t\t\tstatus: 'draft',\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\ttitle: __( 'Trash' ),\n\t\tslug: 'trash',\n\t\ticon: trash,\n\t\tview: {\n\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\tfilters: {\n\t\t\t\tstatus: 'trash',\n\t\t\t},\n\t\t},\n\t},\n];\n\nexport default DEFAULT_VIEWS;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACO,MAAME,gBAAgB,GAAG,sCAAsC,CAAC,CAAC;AAAAC,OAAA,CAAAD,gBAAA,GAAAA,gBAAA;AAExE,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE;IACRC,MAAM,EAAEN;EACT,CAAC;EACDO,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACDC,cAAc,EAAE,CAAE,QAAQ,EAAE,QAAQ,CAAE;EACtC;EACA;EACAC,YAAY,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;EAC1CC,MAAM,EAAE,CAAC;AACV,CAAC;AAED,MAAMC,aAAa,GAAG,CACrB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,KAAM,CAAC;EAClBC,IAAI,EAAE,KAAK;EACXC,IAAI,EAAEjB;AACP,CAAC,EACD;EACCc,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE;IACL,GAAGjB,iBAAiB;IACpBG,OAAO,EAAE;MACRC,MAAM,EAAE;IACT;EACD;AACD,CAAC,EACD;EACCU,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,IAAI,EAAE,OAAO;EACbE,IAAI,EAAEC,YAAK;EACXF,IAAI,EAAE;IACL,GAAGjB,iBAAiB;IACpBG,OAAO,EAAE;MACRC,MAAM,EAAE;IACT;EACD;AACD,CAAC,CACD;AAAC,IAAAgB,QAAA,GAEaP,aAAa;AAAAd,OAAA,CAAAsB,OAAA,GAAAD,QAAA"}
|
|
@@ -12,11 +12,16 @@ var _coreData = require("@wordpress/core-data");
|
|
|
12
12
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
13
13
|
var _element = require("@wordpress/element");
|
|
14
14
|
var _date = require("@wordpress/date");
|
|
15
|
+
var _router = require("@wordpress/router");
|
|
15
16
|
var _page = _interopRequireDefault(require("../page"));
|
|
16
17
|
var _link = _interopRequireDefault(require("../routes/link"));
|
|
17
18
|
var _dataviews = require("../dataviews");
|
|
18
|
-
var
|
|
19
|
+
var _defaultViews = _interopRequireWildcard(require("./default-views"));
|
|
20
|
+
var _actions = require("../actions");
|
|
19
21
|
var _media = _interopRequireDefault(require("../media"));
|
|
22
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
23
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
25
|
/**
|
|
21
26
|
* WordPress dependencies
|
|
22
27
|
*/
|
|
@@ -25,8 +30,10 @@ var _media = _interopRequireDefault(require("../media"));
|
|
|
25
30
|
* Internal dependencies
|
|
26
31
|
*/
|
|
27
32
|
|
|
33
|
+
const {
|
|
34
|
+
useLocation
|
|
35
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
28
36
|
const EMPTY_ARRAY = [];
|
|
29
|
-
const EMPTY_OBJECT = {};
|
|
30
37
|
const defaultConfigPerViewType = {
|
|
31
38
|
list: {},
|
|
32
39
|
grid: {
|
|
@@ -34,38 +41,60 @@ const defaultConfigPerViewType = {
|
|
|
34
41
|
}
|
|
35
42
|
};
|
|
36
43
|
function PagePages() {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
hiddenFields: ['date', 'featured-image'],
|
|
53
|
-
layout: {}
|
|
54
|
-
});
|
|
44
|
+
const {
|
|
45
|
+
params: {
|
|
46
|
+
path,
|
|
47
|
+
activeView = 'all'
|
|
48
|
+
}
|
|
49
|
+
} = useLocation();
|
|
50
|
+
const initialView = _defaultViews.default.find(({
|
|
51
|
+
slug
|
|
52
|
+
}) => slug === activeView).view;
|
|
53
|
+
const [view, setView] = (0, _element.useState)(initialView);
|
|
54
|
+
(0, _element.useEffect)(() => {
|
|
55
|
+
setView(_defaultViews.default.find(({
|
|
56
|
+
slug
|
|
57
|
+
}) => slug === activeView).view);
|
|
58
|
+
}, [path, activeView]);
|
|
55
59
|
// Request post statuses to get the proper labels.
|
|
56
60
|
const {
|
|
57
61
|
records: statuses
|
|
58
62
|
} = (0, _coreData.useEntityRecords)('root', 'status');
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
const defaultStatuses = (0, _element.useMemo)(() => {
|
|
64
|
+
return statuses === null ? _defaultViews.DEFAULT_STATUSES : statuses.filter(({
|
|
65
|
+
slug
|
|
66
|
+
}) => slug !== 'trash').map(({
|
|
67
|
+
slug
|
|
68
|
+
}) => slug).sort().join();
|
|
69
|
+
}, [statuses]);
|
|
70
|
+
(0, _element.useEffect)(() => {
|
|
71
|
+
// Only update the view if the statuses received from the endpoint
|
|
72
|
+
// are different from the DEFAULT_STATUSES provided initially.
|
|
73
|
+
//
|
|
74
|
+
// The pages endpoint depends on the status endpoint via the status filter.
|
|
75
|
+
// Initially, this code filters the pages request by DEFAULT_STATUTES,
|
|
76
|
+
// instead of using the default (publish).
|
|
77
|
+
// https://developer.wordpress.org/rest-api/reference/pages/#list-pages
|
|
78
|
+
//
|
|
79
|
+
// By doing so, it avoids a second request to the pages endpoint
|
|
80
|
+
// upon receiving the statuses when they are the same (most common scenario).
|
|
81
|
+
if (_defaultViews.DEFAULT_STATUSES !== defaultStatuses) {
|
|
82
|
+
setView({
|
|
83
|
+
...view,
|
|
84
|
+
filters: {
|
|
85
|
+
...view.filters,
|
|
86
|
+
status: defaultStatuses
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}, [defaultStatuses]);
|
|
63
91
|
const queryArgs = (0, _element.useMemo)(() => ({
|
|
64
92
|
per_page: view.perPage,
|
|
65
93
|
page: view.page,
|
|
66
94
|
_embed: 'author',
|
|
67
95
|
order: view.sort?.direction,
|
|
68
96
|
orderby: view.sort?.field,
|
|
97
|
+
search: view.search,
|
|
69
98
|
...view.filters
|
|
70
99
|
}), [view]);
|
|
71
100
|
const {
|
|
@@ -76,9 +105,7 @@ function PagePages() {
|
|
|
76
105
|
} = (0, _coreData.useEntityRecords)('postType', 'page', queryArgs);
|
|
77
106
|
const {
|
|
78
107
|
records: authors
|
|
79
|
-
} = (0, _coreData.useEntityRecords)('root', 'user'
|
|
80
|
-
who: 'authors'
|
|
81
|
-
});
|
|
108
|
+
} = (0, _coreData.useEntityRecords)('root', 'user');
|
|
82
109
|
const paginationInfo = (0, _element.useMemo)(() => ({
|
|
83
110
|
totalItems,
|
|
84
111
|
totalPages
|
|
@@ -120,10 +147,6 @@ function PagePages() {
|
|
|
120
147
|
}
|
|
121
148
|
}, (0, _htmlEntities.decodeEntities)(item.title?.rendered || item.slug) || (0, _i18n.__)('(no title)'))));
|
|
122
149
|
},
|
|
123
|
-
filters: [{
|
|
124
|
-
id: 'search',
|
|
125
|
-
type: 'search'
|
|
126
|
-
}],
|
|
127
150
|
maxWidth: 400,
|
|
128
151
|
sortingFn: 'alphanumeric',
|
|
129
152
|
enableHiding: false
|
|
@@ -141,40 +164,37 @@ function PagePages() {
|
|
|
141
164
|
href: `user-edit.php?user_id=${author.id}`
|
|
142
165
|
}, author.name);
|
|
143
166
|
},
|
|
144
|
-
filters: [
|
|
145
|
-
|
|
146
|
-
type: 'enumeration'
|
|
147
|
-
}],
|
|
148
|
-
elements: [{
|
|
149
|
-
value: '',
|
|
150
|
-
label: (0, _i18n.__)('All')
|
|
151
|
-
}, ...(authors?.map(({
|
|
167
|
+
filters: ['enumeration'],
|
|
168
|
+
elements: authors?.map(({
|
|
152
169
|
id,
|
|
153
170
|
name
|
|
154
171
|
}) => ({
|
|
155
172
|
value: id,
|
|
156
173
|
label: name
|
|
157
|
-
})) || []
|
|
174
|
+
})) || []
|
|
158
175
|
}, {
|
|
159
176
|
header: (0, _i18n.__)('Status'),
|
|
160
177
|
id: 'status',
|
|
161
178
|
getValue: ({
|
|
162
179
|
item
|
|
163
180
|
}) => {
|
|
164
|
-
var
|
|
165
|
-
return (
|
|
181
|
+
var _statuses$find$name;
|
|
182
|
+
return (_statuses$find$name = statuses?.find(({
|
|
183
|
+
slug
|
|
184
|
+
}) => slug === item.status)?.name) !== null && _statuses$find$name !== void 0 ? _statuses$find$name : item.status;
|
|
166
185
|
},
|
|
167
186
|
filters: [{
|
|
168
187
|
type: 'enumeration',
|
|
169
|
-
id: 'status'
|
|
188
|
+
id: 'status',
|
|
189
|
+
resetValue: defaultStatuses
|
|
170
190
|
}],
|
|
171
|
-
elements:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
191
|
+
elements: statuses?.map(({
|
|
192
|
+
slug,
|
|
193
|
+
name
|
|
194
|
+
}) => ({
|
|
175
195
|
value: slug,
|
|
176
196
|
label: name
|
|
177
|
-
})) || []
|
|
197
|
+
})) || [],
|
|
178
198
|
enableSorting: false
|
|
179
199
|
}, {
|
|
180
200
|
header: (0, _i18n.__)('Date'),
|
|
@@ -188,9 +208,10 @@ function PagePages() {
|
|
|
188
208
|
const formattedDate = (0, _date.dateI18n)((0, _date.getSettings)().formats.datetimeAbbreviated, (0, _date.getDate)(item.date));
|
|
189
209
|
return (0, _react.createElement)("time", null, formattedDate);
|
|
190
210
|
}
|
|
191
|
-
}], [
|
|
192
|
-
const trashPostAction = (0,
|
|
193
|
-
const
|
|
211
|
+
}], [defaultStatuses, statuses, authors]);
|
|
212
|
+
const trashPostAction = (0, _actions.useTrashPostAction)();
|
|
213
|
+
const editPostAction = (0, _actions.useEditPostAction)();
|
|
214
|
+
const actions = (0, _element.useMemo)(() => [_actions.viewPostAction, trashPostAction, editPostAction, _actions.postRevisionsAction], [trashPostAction, editPostAction]);
|
|
194
215
|
const onChangeView = (0, _element.useCallback)(viewUpdater => {
|
|
195
216
|
let updatedView = typeof viewUpdater === 'function' ? viewUpdater(view) : viewUpdater;
|
|
196
217
|
if (updatedView.type !== view.type) {
|
|
@@ -202,7 +223,7 @@ function PagePages() {
|
|
|
202
223
|
};
|
|
203
224
|
}
|
|
204
225
|
setView(updatedView);
|
|
205
|
-
}, [view]);
|
|
226
|
+
}, [view, setView]);
|
|
206
227
|
|
|
207
228
|
// TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.
|
|
208
229
|
return (0, _react.createElement)(_page.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_coreData","_htmlEntities","_element","_date","_page","_interopRequireDefault","_link","_dataviews","_trashPost","_media","EMPTY_ARRAY","EMPTY_OBJECT","defaultConfigPerViewType","list","grid","mediaField","PagePages","view","setView","useState","type","filters","search","status","page","perPage","sort","field","direction","visibleFilters","hiddenFields","layout","records","statuses","useEntityRecords","postStatuses","useMemo","Object","fromEntries","map","slug","name","queryArgs","per_page","_embed","order","orderby","pages","isResolving","isLoadingPages","totalItems","totalPages","authors","who","paginationInfo","fields","id","header","__","getValue","item","featured_media","render","currentView","_react","createElement","default","className","size","enableSorting","title","rendered","__experimentalVStack","spacing","__experimentalHeading","as","level","params","postId","postType","canvas","decodeEntities","maxWidth","sortingFn","enableHiding","_embedded","author","href","elements","value","label","_postStatuses$item$st","entries","filter","includes","date","formattedDate","dateI18n","getSettings","formats","datetimeAbbreviated","getDate","trashPostAction","useTrashPostAction","actions","onChangeView","useCallback","viewUpdater","updatedView","DataViews","data","isLoading"],"sources":["@wordpress/edit-site/src/components/page-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState, useMemo, useCallback } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Link from '../routes/link';\nimport { DataViews } from '../dataviews';\nimport useTrashPostAction from '../actions/trash-post';\nimport Media from '../media';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\nconst defaultConfigPerViewType = {\n\tlist: {},\n\tgrid: {\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nexport default function PagePages() {\n\tconst [ view, setView ] = useState( {\n\t\ttype: 'list',\n\t\tfilters: {\n\t\t\tsearch: '',\n\t\t\tstatus: 'publish, draft',\n\t\t},\n\t\tpage: 1,\n\t\tperPage: 5,\n\t\tsort: {\n\t\t\tfield: 'date',\n\t\t\tdirection: 'desc',\n\t\t},\n\t\tvisibleFilters: [ 'search', 'author', 'status' ],\n\t\t// All fields are visible by default, so it's\n\t\t// better to keep track of the hidden ones.\n\t\thiddenFields: [ 'date', 'featured-image' ],\n\t\tlayout: {},\n\t} );\n\t// Request post statuses to get the proper labels.\n\tconst { records: statuses } = useEntityRecords( 'root', 'status' );\n\tconst postStatuses = useMemo(\n\t\t() =>\n\t\t\tstatuses === null\n\t\t\t\t? EMPTY_OBJECT\n\t\t\t\t: Object.fromEntries(\n\t\t\t\t\t\tstatuses.map( ( { slug, name } ) => [ slug, name ] )\n\t\t\t\t ),\n\t\t[ statuses ]\n\t);\n\n\tconst queryArgs = useMemo(\n\t\t() => ( {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\t...view.filters,\n\t\t} ),\n\t\t[ view ]\n\t);\n\tconst {\n\t\trecords: pages,\n\t\tisResolving: isLoadingPages,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecords( 'postType', 'page', queryArgs );\n\n\tconst { records: authors } = useEntityRecords( 'root', 'user', {\n\t\twho: 'authors',\n\t} );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'featured-image',\n\t\t\t\theader: __( 'Featured Image' ),\n\t\t\t\tgetValue: ( { item } ) => item.featured_media,\n\t\t\t\trender: ( { item, view: currentView } ) =>\n\t\t\t\t\t!! item.featured_media ? (\n\t\t\t\t\t\t<Media\n\t\t\t\t\t\t\tclassName=\"edit-site-page-pages__featured-image\"\n\t\t\t\t\t\t\tid={ item.featured_media }\n\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\tcurrentView.type === 'list'\n\t\t\t\t\t\t\t\t\t? [ 'thumbnail', 'medium', 'large', 'full' ]\n\t\t\t\t\t\t\t\t\t: [ 'large', 'full', 'medium', 'thumbnail' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Title' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered || item.slug,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t<Heading as=\"h3\" level={ 5 }>\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered || item.slug\n\t\t\t\t\t\t\t\t\t) || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tfilters: [ { id: 'search', type: 'search' } ],\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tsortingFn: 'alphanumeric',\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst author = item._embedded?.author[ 0 ];\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<a href={ `user-edit.php?user_id=${ author.id }` }>\n\t\t\t\t\t\t\t{ author.name }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tfilters: [ { id: 'author', type: 'enumeration' } ],\n\t\t\t\telements: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: '',\n\t\t\t\t\t\tlabel: __( 'All' ),\n\t\t\t\t\t},\n\t\t\t\t\t...( authors?.map( ( { id, name } ) => ( {\n\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t} ) ) || [] ),\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Status' ),\n\t\t\t\tid: 'status',\n\t\t\t\tgetValue: ( { item } ) =>\n\t\t\t\t\tpostStatuses[ item.status ] ?? item.status,\n\t\t\t\tfilters: [ { type: 'enumeration', id: 'status' } ],\n\t\t\t\telements: [\n\t\t\t\t\t{ label: __( 'All' ), value: 'publish,draft' },\n\t\t\t\t\t...( ( postStatuses &&\n\t\t\t\t\t\tObject.entries( postStatuses )\n\t\t\t\t\t\t\t.filter( ( [ slug ] ) =>\n\t\t\t\t\t\t\t\t[ 'publish', 'draft' ].includes( slug )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map( ( [ slug, name ] ) => ( {\n\t\t\t\t\t\t\t\tvalue: slug,\n\t\t\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t\t\t} ) ) ) ||\n\t\t\t\t\t\t[] ),\n\t\t\t\t],\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Date' ),\n\t\t\t\tid: 'date',\n\t\t\t\tgetValue: ( { item } ) => item.date,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst formattedDate = dateI18n(\n\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\tgetDate( item.date )\n\t\t\t\t\t);\n\t\t\t\t\treturn <time>{ formattedDate }</time>;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t[ postStatuses, authors ]\n\t);\n\n\tconst trashPostAction = useTrashPostAction();\n\tconst actions = useMemo( () => [ trashPostAction ], [ trashPostAction ] );\n\tconst onChangeView = useCallback(\n\t\t( viewUpdater ) => {\n\t\t\tlet updatedView =\n\t\t\t\ttypeof viewUpdater === 'function'\n\t\t\t\t\t? viewUpdater( view )\n\t\t\t\t\t: viewUpdater;\n\t\t\tif ( updatedView.type !== view.type ) {\n\t\t\t\tupdatedView = {\n\t\t\t\t\t...updatedView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...defaultConfigPerViewType[ updatedView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( updatedView );\n\t\t},\n\t\t[ view ]\n\t);\n\n\t// TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.\n\treturn (\n\t\t<Page title={ __( 'Pages' ) }>\n\t\t\t<DataViews\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ pages || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingPages }\n\t\t\t\tview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EACD,CAAE7D,YAAY,EAAEiB,OAAO,CACxB,CAAC;EAED,MAAMkD,eAAe,GAAG,IAAAC,kBAAkB,EAAC,CAAC;EAC5C,MAAMC,OAAO,GAAG,IAAApE,gBAAO,EAAE,MAAM,CAAEkE,eAAe,CAAE,EAAE,CAAEA,eAAe,CAAG,CAAC;EACzE,MAAMG,YAAY,GAAG,IAAAC,oBAAW,EAC7BC,WAAW,IAAM;IAClB,IAAIC,WAAW,GACd,OAAOD,WAAW,KAAK,UAAU,GAC9BA,WAAW,CAAE1F,IAAK,CAAC,GACnB0F,WAAW;IACf,IAAKC,WAAW,CAACxF,IAAI,KAAKH,IAAI,CAACG,IAAI,EAAG;MACrCwF,WAAW,GAAG;QACb,GAAGA,WAAW;QACd7E,MAAM,EAAE;UACP,GAAGnB,wBAAwB,CAAEgG,WAAW,CAACxF,IAAI;QAC9C;MACD,CAAC;IACF;IAEAF,OAAO,CAAE0F,WAAY,CAAC;EACvB,CAAC,EACD,CAAE3F,IAAI,CACP,CAAC;;EAED;EACA,OACC,IAAA+C,MAAA,CAAAC,aAAA,EAAC7D,KAAA,CAAA8D,OAAI;IAACI,KAAK,EAAG,IAAAZ,QAAE,EAAE,OAAQ;EAAG,GAC5B,IAAAM,MAAA,CAAAC,aAAA,EAAC1D,UAAA,CAAAsG,SAAS;IACTvD,cAAc,EAAGA,cAAgB;IACjCC,MAAM,EAAGA,MAAQ;IACjBiD,OAAO,EAAGA,OAAS;IACnBM,IAAI,EAAG/D,KAAK,IAAIrC,WAAa;IAC7BqG,SAAS,EAAG9D,cAAgB;IAC5BhC,IAAI,EAAGA,IAAM;IACbwF,YAAY,EAAGA;EAAc,CAC7B,CACI,CAAC;AAET"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_coreData","_htmlEntities","_element","_date","_router","_page","_interopRequireDefault","_link","_dataviews","_defaultViews","_interopRequireWildcard","_actions","_media","_lockUnlock","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","useLocation","unlock","routerPrivateApis","EMPTY_ARRAY","defaultConfigPerViewType","list","grid","mediaField","PagePages","params","path","activeView","initialView","DEFAULT_VIEWS","find","slug","view","setView","useState","useEffect","records","statuses","useEntityRecords","defaultStatuses","useMemo","DEFAULT_STATUSES","filter","map","sort","join","filters","status","queryArgs","per_page","perPage","page","_embed","order","direction","orderby","field","search","pages","isResolving","isLoadingPages","totalItems","totalPages","authors","paginationInfo","fields","id","header","__","getValue","item","featured_media","render","currentView","_react","createElement","className","size","type","enableSorting","title","rendered","__experimentalVStack","spacing","__experimentalHeading","as","level","postId","postType","canvas","decodeEntities","maxWidth","sortingFn","enableHiding","_embedded","author","name","href","elements","value","label","_statuses$find$name","resetValue","date","formattedDate","dateI18n","getSettings","formats","datetimeAbbreviated","getDate","trashPostAction","useTrashPostAction","editPostAction","useEditPostAction","actions","viewPostAction","postRevisionsAction","onChangeView","useCallback","viewUpdater","updatedView","layout","DataViews","data","isLoading"],"sources":["@wordpress/edit-site/src/components/page-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Link from '../routes/link';\nimport { DataViews } from '../dataviews';\nimport { DEFAULT_STATUSES, default as DEFAULT_VIEWS } from './default-views';\nimport {\n\tuseTrashPostAction,\n\tpostRevisionsAction,\n\tviewPostAction,\n\tuseEditPostAction,\n} from '../actions';\nimport Media from '../media';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\nconst defaultConfigPerViewType = {\n\tlist: {},\n\tgrid: {\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nexport default function PagePages() {\n\tconst {\n\t\tparams: { path, activeView = 'all' },\n\t} = useLocation();\n\tconst initialView = DEFAULT_VIEWS.find(\n\t\t( { slug } ) => slug === activeView\n\t).view;\n\tconst [ view, setView ] = useState( initialView );\n\tuseEffect( () => {\n\t\tsetView(\n\t\t\tDEFAULT_VIEWS.find( ( { slug } ) => slug === activeView ).view\n\t\t);\n\t}, [ path, activeView ] );\n\t// Request post statuses to get the proper labels.\n\tconst { records: statuses } = useEntityRecords( 'root', 'status' );\n\tconst defaultStatuses = useMemo( () => {\n\t\treturn statuses === null\n\t\t\t? DEFAULT_STATUSES\n\t\t\t: statuses\n\t\t\t\t\t.filter( ( { slug } ) => slug !== 'trash' )\n\t\t\t\t\t.map( ( { slug } ) => slug )\n\t\t\t\t\t.sort()\n\t\t\t\t\t.join();\n\t}, [ statuses ] );\n\n\tuseEffect( () => {\n\t\t// Only update the view if the statuses received from the endpoint\n\t\t// are different from the DEFAULT_STATUSES provided initially.\n\t\t//\n\t\t// The pages endpoint depends on the status endpoint via the status filter.\n\t\t// Initially, this code filters the pages request by DEFAULT_STATUTES,\n\t\t// instead of using the default (publish).\n\t\t// https://developer.wordpress.org/rest-api/reference/pages/#list-pages\n\t\t//\n\t\t// By doing so, it avoids a second request to the pages endpoint\n\t\t// upon receiving the statuses when they are the same (most common scenario).\n\t\tif ( DEFAULT_STATUSES !== defaultStatuses ) {\n\t\t\tsetView( {\n\t\t\t\t...view,\n\t\t\t\tfilters: {\n\t\t\t\t\t...view.filters,\n\t\t\t\t\tstatus: defaultStatuses,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t}, [ defaultStatuses ] );\n\n\tconst queryArgs = useMemo(\n\t\t() => ( {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...view.filters,\n\t\t} ),\n\t\t[ view ]\n\t);\n\tconst {\n\t\trecords: pages,\n\t\tisResolving: isLoadingPages,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecords( 'postType', 'page', queryArgs );\n\n\tconst { records: authors } = useEntityRecords( 'root', 'user' );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'featured-image',\n\t\t\t\theader: __( 'Featured Image' ),\n\t\t\t\tgetValue: ( { item } ) => item.featured_media,\n\t\t\t\trender: ( { item, view: currentView } ) =>\n\t\t\t\t\t!! item.featured_media ? (\n\t\t\t\t\t\t<Media\n\t\t\t\t\t\t\tclassName=\"edit-site-page-pages__featured-image\"\n\t\t\t\t\t\t\tid={ item.featured_media }\n\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\tcurrentView.type === 'list'\n\t\t\t\t\t\t\t\t\t? [ 'thumbnail', 'medium', 'large', 'full' ]\n\t\t\t\t\t\t\t\t\t: [ 'large', 'full', 'medium', 'thumbnail' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Title' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered || item.slug,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t<Heading as=\"h3\" level={ 5 }>\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered || item.slug\n\t\t\t\t\t\t\t\t\t) || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tsortingFn: 'alphanumeric',\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst author = item._embedded?.author[ 0 ];\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<a href={ `user-edit.php?user_id=${ author.id }` }>\n\t\t\t\t\t\t\t{ author.name }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tfilters: [ 'enumeration' ],\n\t\t\t\telements:\n\t\t\t\t\tauthors?.map( ( { id, name } ) => ( {\n\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t} ) ) || [],\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Status' ),\n\t\t\t\tid: 'status',\n\t\t\t\tgetValue: ( { item } ) =>\n\t\t\t\t\tstatuses?.find( ( { slug } ) => slug === item.status )\n\t\t\t\t\t\t?.name ?? item.status,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'enumeration',\n\t\t\t\t\t\tid: 'status',\n\t\t\t\t\t\tresetValue: defaultStatuses,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\telements:\n\t\t\t\t\tstatuses?.map( ( { slug, name } ) => ( {\n\t\t\t\t\t\tvalue: slug,\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t} ) ) || [],\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Date' ),\n\t\t\t\tid: 'date',\n\t\t\t\tgetValue: ( { item } ) => item.date,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst formattedDate = dateI18n(\n\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\tgetDate( item.date )\n\t\t\t\t\t);\n\t\t\t\t\treturn <time>{ formattedDate }</time>;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t[ defaultStatuses, statuses, authors ]\n\t);\n\n\tconst trashPostAction = useTrashPostAction();\n\tconst editPostAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [\n\t\t\tviewPostAction,\n\t\t\ttrashPostAction,\n\t\t\teditPostAction,\n\t\t\tpostRevisionsAction,\n\t\t],\n\t\t[ trashPostAction, editPostAction ]\n\t);\n\tconst onChangeView = useCallback(\n\t\t( viewUpdater ) => {\n\t\t\tlet updatedView =\n\t\t\t\ttypeof viewUpdater === 'function'\n\t\t\t\t\t? viewUpdater( view )\n\t\t\t\t\t: viewUpdater;\n\t\t\tif ( updatedView.type !== view.type ) {\n\t\t\t\tupdatedView = {\n\t\t\t\t\t...updatedView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...defaultConfigPerViewType[ updatedView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( updatedView );\n\t\t},\n\t\t[ view, setView ]\n\t);\n\n\t// TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.\n\treturn (\n\t\t<Page title={ __( 'Pages' ) }>\n\t\t\t<DataViews\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\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,EAAGA,IAAM;IACbqF,YAAY,EAAGA;EAAc,CAC7B,CACI,CAAC;AAET"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -9,6 +10,7 @@ var _components = require("@wordpress/components");
|
|
|
9
10
|
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _patterns = require("@wordpress/patterns");
|
|
13
|
+
var _usePatternCategories = _interopRequireDefault(require("../sidebar-navigation-screen-patterns/use-pattern-categories"));
|
|
12
14
|
var _lockUnlock = require("../../lock-unlock");
|
|
13
15
|
/**
|
|
14
16
|
* WordPress dependencies
|
|
@@ -18,6 +20,10 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
18
20
|
* Internal dependencies
|
|
19
21
|
*/
|
|
20
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Internal dependencies
|
|
25
|
+
*/
|
|
26
|
+
|
|
21
27
|
const {
|
|
22
28
|
RenamePatternCategoryModal
|
|
23
29
|
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
@@ -26,7 +32,20 @@ function RenameCategoryMenuItem({
|
|
|
26
32
|
onClose
|
|
27
33
|
}) {
|
|
28
34
|
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
|
|
29
|
-
|
|
35
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuItem, {
|
|
36
|
+
onClick: () => setIsModalOpen(true)
|
|
37
|
+
}, (0, _i18n.__)('Rename')), isModalOpen && (0, _react.createElement)(RenameModal, {
|
|
38
|
+
category: category,
|
|
39
|
+
onClose: () => {
|
|
40
|
+
setIsModalOpen(false);
|
|
41
|
+
onClose();
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
function RenameModal({
|
|
46
|
+
category,
|
|
47
|
+
onClose
|
|
48
|
+
}) {
|
|
30
49
|
// User created pattern categories have their properties updated when
|
|
31
50
|
// retrieved via `getUserPatternCategories`. The rename modal expects an
|
|
32
51
|
// object that will match the pattern category entity.
|
|
@@ -35,15 +54,14 @@ function RenameCategoryMenuItem({
|
|
|
35
54
|
slug: category.slug,
|
|
36
55
|
name: category.label
|
|
37
56
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
|
|
58
|
+
// Optimization - only use pattern categories when the modal is open.
|
|
59
|
+
const existingCategories = (0, _usePatternCategories.default)();
|
|
60
|
+
return (0, _react.createElement)(RenamePatternCategoryModal, {
|
|
41
61
|
category: normalizedCategory,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onClose();
|
|
45
|
-
},
|
|
62
|
+
existingCategories: existingCategories,
|
|
63
|
+
onClose: onClose,
|
|
46
64
|
overlayClassName: "edit-site-list__rename-modal"
|
|
47
|
-
})
|
|
65
|
+
});
|
|
48
66
|
}
|
|
49
67
|
//# sourceMappingURL=rename-category-menu-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","_i18n","_patterns","_lockUnlock","RenamePatternCategoryModal","unlock","patternsPrivateApis","RenameCategoryMenuItem","category","onClose","isModalOpen","setIsModalOpen","useState","
|
|
1
|
+
{"version":3,"names":["_components","require","_element","_i18n","_patterns","_usePatternCategories","_interopRequireDefault","_lockUnlock","RenamePatternCategoryModal","unlock","patternsPrivateApis","RenameCategoryMenuItem","category","onClose","isModalOpen","setIsModalOpen","useState","_react","createElement","Fragment","MenuItem","onClick","__","RenameModal","normalizedCategory","id","slug","name","label","existingCategories","usePatternCategories","overlayClassName"],"sources":["@wordpress/edit-site/src/components/page-patterns/rename-category-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n/**\n * Internal dependencies\n */\nimport usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { RenamePatternCategoryModal } = unlock( patternsPrivateApis );\n\nexport default function RenameCategoryMenuItem( { category, onClose } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem onClick={ () => setIsModalOpen( true ) }>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tcategory={ category }\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction RenameModal( { category, onClose } ) {\n\t// User created pattern categories have their properties updated when\n\t// retrieved via `getUserPatternCategories`. The rename modal expects an\n\t// object that will match the pattern category entity.\n\tconst normalizedCategory = {\n\t\tid: category.id,\n\t\tslug: category.slug,\n\t\tname: category.label,\n\t};\n\n\t// Optimization - only use pattern categories when the modal is open.\n\tconst existingCategories = usePatternCategories();\n\n\treturn (\n\t\t<RenamePatternCategoryModal\n\t\t\tcategory={ normalizedCategory }\n\t\t\texistingCategories={ existingCategories }\n\t\t\tonClose={ onClose }\n\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAIA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAfA;AACA;AACA;;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(0, _data.useSelect)(select => {
|
|
36
36
|
const {
|
|
37
37
|
__experimentalGetDirtyEntityRecords,
|
|
38
|
-
isSavingEntityRecord
|
|
38
|
+
isSavingEntityRecord,
|
|
39
|
+
isResolving
|
|
39
40
|
} = select(_coreData.store);
|
|
40
41
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
41
42
|
const {
|
|
42
43
|
isSaveViewOpened
|
|
43
44
|
} = select(_store.store);
|
|
45
|
+
const isActivatingTheme = isResolving('activateTheme');
|
|
44
46
|
return {
|
|
45
47
|
isDirty: dirtyEntityRecords.length > 0,
|
|
46
|
-
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
|
48
|
+
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme,
|
|
47
49
|
isSaveViewOpen: isSaveViewOpened()
|
|
48
50
|
};
|
|
49
51
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_store","_isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","useDispatch","activateSaveEnabled","isPreviewingTheme","disabled","getLabel","__","label","_react","createElement","Button","isBusy","onClick","undefined","shortcut","displayShortcut","primary"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst {
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_store","_isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","isActivatingTheme","length","some","record","kind","name","key","setIsSaveViewOpened","useDispatch","activateSaveEnabled","isPreviewingTheme","disabled","getLabel","__","label","_react","createElement","Button","isBusy","onClick","undefined","shortcut","displayShortcut","primary"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn __( 'Activating' );\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( isDirty ) {\n\t\t\t\treturn __( 'Activate & Save' );\n\t\t\t}\n\t\t\treturn __( 'Activate' );\n\t\t}\n\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t} else if ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t} else if ( defaultLabel ) {\n\t\t\treturn defaultLabel;\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASO,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,YAAY;EACZC,IAAI;EACJC,qBAAqB,GAAG;AACzB,CAAC,EAAG;EACH,MAAM;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACtE,MAAM;MACLC,mCAAmC;MACnCC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEI,eAAU,CAAC;IACvB,MAAMC,kBAAkB,GAAGJ,mCAAmC,CAAC,CAAC;IAChE,MAAM;MAAEK;IAAiB,CAAC,GAAGN,MAAM,CAAEO,YAAc,CAAC;IACpD,MAAMC,iBAAiB,GAAGL,WAAW,CAAE,eAAgB,CAAC;IACxD,OAAO;MACNP,OAAO,EAAES,kBAAkB,CAACI,MAAM,GAAG,CAAC;MACtCZ,QAAQ,EACPQ,kBAAkB,CAACK,IAAI,CAAIC,MAAM,IAChCT,oBAAoB,CAAES,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC,IAAIN,iBAAiB;MACvBV,cAAc,EAAEQ,gBAAg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