@wordpress/edit-site 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/{add-new-page → add-new-post}/index.js +21 -17
- package/build/components/add-new-post/index.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +5 -3
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +21 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +0 -5
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +13 -30
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -40
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +47 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block.js +14 -0
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +5 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -2
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +0 -2
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +4 -4
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +4 -3
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +14 -28
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -2
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +16 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +20 -41
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/index.js +43 -39
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +29 -4
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +22 -55
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +18 -19
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +4 -4
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/posts-app/index.js +11 -17
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/{page-pages/index.js → posts-app/posts-list.js} +135 -40
- package/build/components/posts-app/posts-list.js.map +1 -0
- package/build/components/posts-app/router.js +85 -0
- package/build/components/posts-app/router.js.map +1 -0
- package/build/components/revisions/index.js +10 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +1 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +98 -84
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/site-hub/index.js +81 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -42
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +57 -2
- package/build/posts.js.map +1 -1
- package/build/store/private-actions.js +7 -2
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/{add-new-page → add-new-post}/index.js +21 -17
- package/build-module/components/add-new-post/index.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +5 -3
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +21 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +0 -5
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +14 -31
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -38
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +39 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +15 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +5 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -2
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +6 -6
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +0 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +5 -5
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +4 -3
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +16 -29
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -2
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +14 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +20 -41
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/index.js +44 -40
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +28 -4
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -56
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +18 -19
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +4 -4
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/{page-pages/index.js → posts-app/posts-list.js} +134 -39
- package/build-module/components/posts-app/posts-list.js.map +1 -0
- package/build-module/components/posts-app/router.js +77 -0
- package/build-module/components/posts-app/router.js.map +1 -0
- package/build-module/components/revisions/index.js +10 -7
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +96 -83
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +5 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/site-hub/index.js +81 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +61 -38
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +7 -2
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +57 -2
- package/build-module/posts.js.map +1 -1
- package/build-module/store/private-actions.js +7 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/posts-rtl.css +108 -28
- package/build-style/posts.css +108 -28
- package/build-style/style-rtl.css +112 -144
- package/build-style/style.css +112 -144
- package/package.json +41 -41
- package/src/components/{add-new-page → add-new-post}/index.js +28 -22
- package/src/components/block-editor/use-site-editor-settings.js +33 -28
- package/src/components/editor/index.js +21 -5
- package/src/components/global-styles/background-panel.js +0 -8
- package/src/components/global-styles/font-library-modal/font-collection.js +17 -32
- package/src/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/src/components/global-styles/font-library-modal/style.scss +17 -10
- package/src/components/global-styles/hooks.js +0 -41
- package/src/components/global-styles/preview-typography.js +39 -0
- package/src/components/global-styles/screen-block.js +22 -0
- package/src/components/global-styles/screen-layout.js +5 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/shadows-edit-panel.js +1 -2
- package/src/components/global-styles/style-variations-container.js +10 -7
- package/src/components/global-styles/typography-elements.js +0 -4
- package/src/components/global-styles/variations/variation.js +5 -5
- package/src/components/global-styles/variations/variations-color.js +5 -3
- package/src/components/global-styles/variations/variations-typography.js +15 -32
- package/src/components/global-styles-sidebar/index.js +2 -2
- package/src/components/layout/index.js +13 -4
- package/src/components/layout/router.js +20 -36
- package/src/components/layout/style.scss +12 -0
- package/src/components/page-patterns/index.js +47 -56
- package/src/components/page-patterns/search-items.js +37 -3
- package/src/components/page-patterns/style.scss +1 -8
- package/src/components/page-patterns/use-patterns.js +43 -82
- package/src/components/page-templates/index.js +17 -19
- package/src/components/page-templates/style.scss +1 -6
- package/src/components/pagination/index.js +4 -4
- package/src/components/posts-app/index.js +9 -11
- package/src/components/{page-pages/index.js → posts-app/posts-list.js} +126 -39
- package/src/components/posts-app/router.js +69 -0
- package/src/components/{page-pages → posts-app}/style.scss +22 -8
- package/src/components/revisions/index.js +9 -1
- package/src/components/save-panel/index.js +1 -1
- package/src/components/sidebar/style.scss +6 -0
- package/src/components/sidebar-dataviews/add-new-view.js +2 -1
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/src/components/sidebar-dataviews/default-views.js +110 -97
- package/src/components/sidebar-dataviews/index.js +3 -3
- package/src/components/sidebar-navigation-screen-global-styles/index.js +7 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -2
- package/src/components/site-hub/index.js +84 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -2
- package/src/hooks/push-changes-to-global-styles/index.js +1 -1
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +28 -24
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +72 -47
- package/src/index.js +8 -1
- package/src/posts.js +63 -2
- package/src/posts.scss +9 -0
- package/src/store/private-actions.js +7 -3
- package/src/style.scss +1 -2
- package/build/components/add-new-page/index.js.map +0 -1
- package/build/components/page-pages/index.js.map +0 -1
- package/build/components/table/index.js +0 -35
- package/build/components/table/index.js.map +0 -1
- package/build-module/components/add-new-page/index.js.map +0 -1
- package/build-module/components/page-pages/index.js.map +0 -1
- package/build-module/components/table/index.js +0 -30
- package/build-module/components/table/index.js.map +0 -1
- package/src/components/table/index.js +0 -33
- package/src/components/table/style.scss +0 -38
|
@@ -14,18 +14,20 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
import cloneDeep from '../../utils/clone-deep';
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
16
|
|
|
17
|
-
const { GlobalStylesContext } = unlock(
|
|
17
|
+
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
18
|
+
blockEditorPrivateApis
|
|
19
|
+
);
|
|
18
20
|
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
|
-
* Removes all instances of
|
|
23
|
+
* Removes all instances of properties from an object.
|
|
22
24
|
*
|
|
23
|
-
* @param {Object}
|
|
24
|
-
* @param {string}
|
|
25
|
+
* @param {Object} object The object to remove the properties from.
|
|
26
|
+
* @param {string[]} properties The properties to remove.
|
|
25
27
|
* @return {Object} The modified object.
|
|
26
28
|
*/
|
|
27
|
-
export function
|
|
28
|
-
if ( !
|
|
29
|
+
export function removePropertiesFromObject( object, properties ) {
|
|
30
|
+
if ( ! properties?.length ) {
|
|
29
31
|
return object;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -38,26 +40,42 @@ export function removePropertyFromObject( object, property ) {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
for ( const key in object ) {
|
|
41
|
-
if ( key
|
|
43
|
+
if ( properties.includes( key ) ) {
|
|
42
44
|
delete object[ key ];
|
|
43
45
|
} else if ( typeof object[ key ] === 'object' ) {
|
|
44
|
-
|
|
46
|
+
removePropertiesFromObject( object[ key ], properties );
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
return object;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
53
|
+
* Checks whether a style variation is empty.
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} variation A style variation object.
|
|
56
|
+
* @param {string} variation.title The title of the variation.
|
|
57
|
+
* @param {Object} variation.settings The settings of the variation.
|
|
58
|
+
* @param {Object} variation.styles The styles of the variation.
|
|
59
|
+
* @return {boolean} Whether the variation is empty.
|
|
60
|
+
*/
|
|
61
|
+
function hasThemeVariation( { title, settings, styles } ) {
|
|
62
|
+
return (
|
|
63
|
+
title === __( 'Default' ) || // Always preserve the default variation.
|
|
64
|
+
Object.keys( settings ).length > 0 ||
|
|
65
|
+
Object.keys( styles ).length > 0
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Fetches the current theme style variations that contain only the specified properties
|
|
52
71
|
* and merges them with the user config.
|
|
53
72
|
*
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {string} props.property The property to filter by.
|
|
73
|
+
* @param {string[]} properties The properties to filter by.
|
|
56
74
|
* @return {Object[]|*} The merged object.
|
|
57
75
|
*/
|
|
58
|
-
export function useCurrentMergeThemeStyleVariationsWithUserConfig(
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
export function useCurrentMergeThemeStyleVariationsWithUserConfig(
|
|
77
|
+
properties = []
|
|
78
|
+
) {
|
|
61
79
|
const { variationsFromTheme } = useSelect( ( select ) => {
|
|
62
80
|
const _variationsFromTheme =
|
|
63
81
|
select(
|
|
@@ -70,55 +88,67 @@ export function useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
|
70
88
|
}, [] );
|
|
71
89
|
const { user: userVariation } = useContext( GlobalStylesContext );
|
|
72
90
|
|
|
91
|
+
const propertiesAsString = properties.toString();
|
|
92
|
+
|
|
73
93
|
return useMemo( () => {
|
|
74
94
|
const clonedUserVariation = cloneDeep( userVariation );
|
|
75
95
|
|
|
76
96
|
// Get user variation and remove the settings for the given property.
|
|
77
|
-
const
|
|
97
|
+
const userVariationWithoutProperties = removePropertiesFromObject(
|
|
78
98
|
clonedUserVariation,
|
|
79
|
-
|
|
99
|
+
properties
|
|
80
100
|
);
|
|
81
|
-
|
|
101
|
+
userVariationWithoutProperties.title = __( 'Default' );
|
|
82
102
|
|
|
83
|
-
const
|
|
103
|
+
const variationsWithPropertiesAndBase = variationsFromTheme
|
|
84
104
|
.filter( ( variation ) => {
|
|
85
|
-
return
|
|
105
|
+
return isVariationWithProperties( variation, properties );
|
|
86
106
|
} )
|
|
87
107
|
.map( ( variation ) => {
|
|
88
108
|
return mergeBaseAndUserConfigs(
|
|
89
|
-
|
|
109
|
+
userVariationWithoutProperties,
|
|
90
110
|
variation
|
|
91
111
|
);
|
|
92
112
|
} );
|
|
93
113
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
...
|
|
114
|
+
const variationsByProperties = [
|
|
115
|
+
userVariationWithoutProperties,
|
|
116
|
+
...variationsWithPropertiesAndBase,
|
|
97
117
|
];
|
|
98
|
-
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
* Filter out variations with no settings or styles.
|
|
121
|
+
*/
|
|
122
|
+
return variationsByProperties?.length
|
|
123
|
+
? variationsByProperties.filter( hasThemeVariation )
|
|
124
|
+
: [];
|
|
125
|
+
}, [ propertiesAsString, userVariation, variationsFromTheme ] );
|
|
99
126
|
}
|
|
100
127
|
|
|
101
128
|
/**
|
|
102
|
-
* Returns a new object, with properties specified in `
|
|
129
|
+
* Returns a new object, with properties specified in `properties` array.,
|
|
103
130
|
* maintain the original object tree structure.
|
|
104
|
-
* The function is recursive, so it will perform a deep search for the given
|
|
105
|
-
* E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the
|
|
131
|
+
* The function is recursive, so it will perform a deep search for the given properties.
|
|
132
|
+
* E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.
|
|
106
133
|
*
|
|
107
|
-
* @param {Object}
|
|
108
|
-
* @param {
|
|
134
|
+
* @param {Object} object The object to filter
|
|
135
|
+
* @param {string[]} properties The properties to filter by
|
|
109
136
|
* @return {Object} The merged object.
|
|
110
137
|
*/
|
|
111
|
-
export const
|
|
112
|
-
if ( ! object ) {
|
|
138
|
+
export const filterObjectByProperties = ( object, properties ) => {
|
|
139
|
+
if ( ! object || ! properties?.length ) {
|
|
113
140
|
return {};
|
|
114
141
|
}
|
|
115
142
|
|
|
116
143
|
const newObject = {};
|
|
117
144
|
Object.keys( object ).forEach( ( key ) => {
|
|
118
|
-
if ( key
|
|
145
|
+
if ( properties.includes( key ) ) {
|
|
119
146
|
newObject[ key ] = object[ key ];
|
|
120
147
|
} else if ( typeof object[ key ] === 'object' ) {
|
|
121
|
-
const newFilter =
|
|
148
|
+
const newFilter = filterObjectByProperties(
|
|
149
|
+
object[ key ],
|
|
150
|
+
properties
|
|
151
|
+
);
|
|
122
152
|
if ( Object.keys( newFilter ).length ) {
|
|
123
153
|
newObject[ key ] = newFilter;
|
|
124
154
|
}
|
|
@@ -128,23 +158,18 @@ export const filterObjectByProperty = ( object, property ) => {
|
|
|
128
158
|
};
|
|
129
159
|
|
|
130
160
|
/**
|
|
131
|
-
* Compares a style variation to the same variation filtered by
|
|
132
|
-
* Returns true if the variation contains only the
|
|
161
|
+
* Compares a style variation to the same variation filtered by the specified properties.
|
|
162
|
+
* Returns true if the variation contains only the properties specified.
|
|
133
163
|
*
|
|
134
|
-
* @param {Object}
|
|
135
|
-
* @param {string}
|
|
136
|
-
* @return {boolean} Whether the variation contains only
|
|
164
|
+
* @param {Object} variation The variation to compare.
|
|
165
|
+
* @param {string[]} properties The properties to compare.
|
|
166
|
+
* @return {boolean} Whether the variation contains only the specified properties.
|
|
137
167
|
*/
|
|
138
|
-
export function
|
|
139
|
-
const
|
|
168
|
+
export function isVariationWithProperties( variation, properties ) {
|
|
169
|
+
const variationWithProperties = filterObjectByProperties(
|
|
140
170
|
cloneDeep( variation ),
|
|
141
|
-
|
|
171
|
+
properties
|
|
142
172
|
);
|
|
143
173
|
|
|
144
|
-
return (
|
|
145
|
-
JSON.stringify( variationWithProperty?.styles ) ===
|
|
146
|
-
JSON.stringify( variation?.styles ) &&
|
|
147
|
-
JSON.stringify( variationWithProperty?.settings ) ===
|
|
148
|
-
JSON.stringify( variation?.settings )
|
|
149
|
-
);
|
|
174
|
+
return areGlobalStyleConfigsEqual( variationWithProperties, variation );
|
|
150
175
|
}
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
import { dispatch } from '@wordpress/data';
|
|
11
11
|
import deprecated from '@wordpress/deprecated';
|
|
12
12
|
import { createRoot, StrictMode } from '@wordpress/element';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
store as editorStore,
|
|
15
|
+
privateApis as editorPrivateApis,
|
|
16
|
+
} from '@wordpress/editor';
|
|
14
17
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
18
|
import {
|
|
16
19
|
registerLegacyWidgetBlock,
|
|
@@ -22,8 +25,11 @@ import {
|
|
|
22
25
|
*/
|
|
23
26
|
import './hooks';
|
|
24
27
|
import { store as editSiteStore } from './store';
|
|
28
|
+
import { unlock } from './lock-unlock';
|
|
25
29
|
import App from './components/app';
|
|
26
30
|
|
|
31
|
+
const { registerDefaultActions } = unlock( editorPrivateApis );
|
|
32
|
+
|
|
27
33
|
/**
|
|
28
34
|
* Initializes the site editor screen.
|
|
29
35
|
*
|
|
@@ -47,6 +53,7 @@ export function initializeEditor( id, settings ) {
|
|
|
47
53
|
enableFSEBlocks: true,
|
|
48
54
|
} );
|
|
49
55
|
}
|
|
56
|
+
registerDefaultActions();
|
|
50
57
|
|
|
51
58
|
// We dispatch actions and update the store synchronously before rendering
|
|
52
59
|
// so that we won't trigger unnecessary re-renders with useEffect.
|
package/src/posts.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { store as blocksStore } from '@wordpress/blocks';
|
|
5
|
+
import {
|
|
6
|
+
registerCoreBlocks,
|
|
7
|
+
__experimentalGetCoreBlocks,
|
|
8
|
+
__experimentalRegisterExperimentalCoreBlocks,
|
|
9
|
+
} from '@wordpress/block-library';
|
|
10
|
+
import { dispatch } from '@wordpress/data';
|
|
4
11
|
import { createRoot, StrictMode } from '@wordpress/element';
|
|
12
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
|
+
import {
|
|
14
|
+
registerLegacyWidgetBlock,
|
|
15
|
+
registerWidgetGroupBlock,
|
|
16
|
+
} from '@wordpress/widgets';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import './hooks';
|
|
22
|
+
import { store as editSiteStore } from './store';
|
|
5
23
|
|
|
6
24
|
/**
|
|
7
25
|
* Internal dependencies
|
|
@@ -10,15 +28,58 @@ import PostsApp from './components/posts-app';
|
|
|
10
28
|
|
|
11
29
|
/**
|
|
12
30
|
* Initializes the "Posts Dashboard"
|
|
13
|
-
* @param {string} id
|
|
31
|
+
* @param {string} id ID of the root element to render the screen in.
|
|
32
|
+
* @param {Object} settings Editor settings.
|
|
14
33
|
*/
|
|
15
|
-
export function initializePostsDashboard( id ) {
|
|
34
|
+
export function initializePostsDashboard( id, settings ) {
|
|
16
35
|
if ( ! globalThis.IS_GUTENBERG_PLUGIN ) {
|
|
17
36
|
return;
|
|
18
37
|
}
|
|
19
38
|
const target = document.getElementById( id );
|
|
20
39
|
const root = createRoot( target );
|
|
21
40
|
|
|
41
|
+
dispatch( blocksStore ).reapplyBlockTypeFilters();
|
|
42
|
+
const coreBlocks = __experimentalGetCoreBlocks().filter(
|
|
43
|
+
( { name } ) => name !== 'core/freeform'
|
|
44
|
+
);
|
|
45
|
+
registerCoreBlocks( coreBlocks );
|
|
46
|
+
dispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );
|
|
47
|
+
registerLegacyWidgetBlock( { inserter: false } );
|
|
48
|
+
registerWidgetGroupBlock( { inserter: false } );
|
|
49
|
+
if ( globalThis.IS_GUTENBERG_PLUGIN ) {
|
|
50
|
+
__experimentalRegisterExperimentalCoreBlocks( {
|
|
51
|
+
enableFSEBlocks: true,
|
|
52
|
+
} );
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// We dispatch actions and update the store synchronously before rendering
|
|
56
|
+
// so that we won't trigger unnecessary re-renders with useEffect.
|
|
57
|
+
dispatch( preferencesStore ).setDefaults( 'core/edit-site', {
|
|
58
|
+
welcomeGuide: true,
|
|
59
|
+
welcomeGuideStyles: true,
|
|
60
|
+
welcomeGuidePage: true,
|
|
61
|
+
welcomeGuideTemplate: true,
|
|
62
|
+
} );
|
|
63
|
+
|
|
64
|
+
dispatch( preferencesStore ).setDefaults( 'core', {
|
|
65
|
+
allowRightClickOverrides: true,
|
|
66
|
+
distractionFree: false,
|
|
67
|
+
editorMode: 'visual',
|
|
68
|
+
fixedToolbar: false,
|
|
69
|
+
focusMode: false,
|
|
70
|
+
inactivePanels: [],
|
|
71
|
+
keepCaretInsideBlock: false,
|
|
72
|
+
openPanels: [ 'post-status' ],
|
|
73
|
+
showBlockBreadcrumbs: true,
|
|
74
|
+
showListViewByDefault: false,
|
|
75
|
+
} );
|
|
76
|
+
|
|
77
|
+
dispatch( editSiteStore ).updateSettings( settings );
|
|
78
|
+
|
|
79
|
+
// Prevent the default browser action for files dropped outside of dropzones.
|
|
80
|
+
window.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );
|
|
81
|
+
window.addEventListener( 'drop', ( e ) => e.preventDefault(), false );
|
|
82
|
+
|
|
22
83
|
root.render(
|
|
23
84
|
<StrictMode>
|
|
24
85
|
<PostsApp />
|
package/src/posts.scss
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@import "./components/site-hub/style.scss";
|
|
8
8
|
@import "./components/site-icon/style.scss";
|
|
9
9
|
@import "./components/editor-canvas-container/style.scss";
|
|
10
|
+
@import "./components/posts-app/style.scss";
|
|
10
11
|
@import "./components/resizable-frame/style.scss";
|
|
11
12
|
|
|
12
13
|
@include wordpress-admin-schemes();
|
|
@@ -43,4 +44,12 @@ body {
|
|
|
43
44
|
min-height: 0;
|
|
44
45
|
position: static;
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
.components-editor-notices__snackbar {
|
|
49
|
+
position: fixed;
|
|
50
|
+
right: 0;
|
|
51
|
+
bottom: 16px;
|
|
52
|
+
padding-left: 16px;
|
|
53
|
+
padding-right: 16px;
|
|
54
|
+
}
|
|
46
55
|
}
|
|
@@ -13,10 +13,10 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
13
13
|
export const setCanvasMode =
|
|
14
14
|
( mode ) =>
|
|
15
15
|
( { registry, dispatch } ) => {
|
|
16
|
+
const isMediumOrBigger =
|
|
17
|
+
window.matchMedia( '(min-width: 782px)' ).matches;
|
|
16
18
|
const switchCanvasMode = () => {
|
|
17
19
|
registry.batch( () => {
|
|
18
|
-
const isMediumOrBigger =
|
|
19
|
-
window.matchMedia( '(min-width: 782px)' ).matches;
|
|
20
20
|
registry.dispatch( blockEditorStore ).clearSelectedBlock();
|
|
21
21
|
registry.dispatch( editorStore ).setDeviceType( 'Desktop' );
|
|
22
22
|
registry
|
|
@@ -59,7 +59,11 @@ export const setCanvasMode =
|
|
|
59
59
|
} );
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
/*
|
|
63
|
+
* Skip transition in mobile, otherwise it crashes the browser.
|
|
64
|
+
* See: https://github.com/WordPress/gutenberg/pull/63002.
|
|
65
|
+
*/
|
|
66
|
+
if ( ! isMediumOrBigger || ! document.startViewTransition ) {
|
|
63
67
|
switchCanvasMode();
|
|
64
68
|
} else {
|
|
65
69
|
document.documentElement.classList.add(
|
package/src/style.scss
CHANGED
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
@import "./components/global-styles/screen-revisions/style.scss";
|
|
8
8
|
@import "./components/global-styles-sidebar/style.scss";
|
|
9
9
|
@import "./components/page/style.scss";
|
|
10
|
-
@import "./components/page-pages/style.scss";
|
|
11
10
|
@import "./components/page-patterns/style.scss";
|
|
12
11
|
@import "./components/page-templates/style.scss";
|
|
13
|
-
@import "./components/table/style.scss";
|
|
14
12
|
@import "./components/editor/style.scss";
|
|
15
13
|
@import "./components/welcome-guide/style.scss";
|
|
16
14
|
@import "./components/layout/style.scss";
|
|
@@ -30,6 +28,7 @@
|
|
|
30
28
|
@import "./components/site-icon/style.scss";
|
|
31
29
|
@import "./components/style-book/style.scss";
|
|
32
30
|
@import "./components/editor-canvas-container/style.scss";
|
|
31
|
+
@import "./components/posts-app/style.scss";
|
|
33
32
|
@import "./components/resizable-frame/style.scss";
|
|
34
33
|
@import "./hooks/push-changes-to-global-styles/style.scss";
|
|
35
34
|
@import "./components/global-styles/font-library-modal/style.scss";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_notices","_htmlEntities","_blocks","_jsxRuntime","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","useState","title","setTitle","saveEntityRecord","useDispatch","coreStore","createErrorNotice","createSuccessNotice","noticesStore","resolveSelect","useRegistry","createPage","event","preventDefault","pagePostType","getPostType","newPage","status","slug","__","content","template","length","serialize","synchronizeBlocksWithTemplate","undefined","throwOnError","sprintf","decodeEntities","rendered","type","error","errorMessage","message","code","jsx","Modal","onRequestClose","focusOnMount","size","children","onSubmit","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","label","onChange","placeholder","value","__experimentalHStack","justify","Button","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { serialize, synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { resolveSelect } = useRegistry();\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst pagePostType =\n\t\t\t\tawait resolveSelect( coreStore ).getPostType( 'page' );\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t!! pagePostType.template && pagePostType.template.length\n\t\t\t\t\t\t\t? serialize(\n\t\t\t\t\t\t\t\t\tsynchronizeBlocksWithTemplate(\n\t\t\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\t\t\tpagePostType.template\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newPage.title?.rendered || title )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPage( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Draft a new page' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Page title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isCreatingPage }\n\t\t\t\t\t\t\taria-disabled={ isCreatingPage }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create draft' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAA6E,IAAAQ,WAAA,GAAAR,OAAA;AAhB7E;AACA;AACA;;AAgBe,SAASS,eAAeA,CAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAG;EAC9D,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC/D,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAF,iBAAQ,EAAE,EAAG,CAAC;EAE1C,MAAM;IAAEG;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACrD,MAAM;IAAEC,iBAAiB;IAAEC;EAAoB,CAAC,GAC/C,IAAAH,iBAAW,EAAEI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,QAAA,EAE9B,IAAArB,QAAE,EAAE,cAAe;UAAC,CACf,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_coreData","_htmlEntities","_element","_date","_router","_data","_dataviews","_editor","_page","_interopRequireDefault","_link","_interopRequireWildcard","_defaultViews","_constants","_addNewPage","_media","_lockUnlock","_dataviewsActions","_compose","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","usePostActions","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","EMPTY_ARRAY","getFormattedDate","dateToDisplay","dateI18n","getSettings","formats","datetimeAbbreviated","getDate","useView","postType","params","activeView","isCustom","layout","history","selectedDefaultView","useMemo","defaultView","DEFAULT_VIEWS","find","slug","view","type","DEFAULT_CONFIG_PER_VIEW_TYPE","setView","useState","useEffect","editedViewRecord","useSelect","select","getEditedEntityRecord","coreStore","dataviewRecord","Number","editEntityRecord","useDispatch","customView","storedView","content","JSON","parse","setCustomView","useCallback","viewToSet","id","stringify","setDefaultViewAndUpdateUrl","getLocationWithParams","push","STATUSES","value","label","__","DEFAULT_STATUSES","FeaturedImage","item","viewType","isDisabled","status","onClick","useLink","postId","canvas","hasMedia","featured_media","size","LAYOUT_GRID","media","jsx","className","renderButton","LAYOUT_LIST","children","title","rendered","getItemId","toString","PagePages","_pages$map","_usePrevious","selection","setSelection","onSelectionChange","items","_params$isCustom","length","undefined","queryArgs","filters","forEach","filter","field","operator","OPERATOR_IS_ANY","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","pages","isResolving","isLoadingPages","totalItems","totalPages","useEntityRecords","ids","map","prevIds","usePrevious","deletedIds","includes","postIdWasDeleted","authors","isLoadingAuthors","paginationInfo","frontPageId","postsPageId","addNewLabel","canCreatePage","getEntityRecord","getPostType","canUser","siteSettings","page_on_front","page_for_posts","labels","add_new_item","fields","header","getValue","render","enableSorting","width","addLink","LAYOUT_TABLE","decodeEntities","suffix","jsxs","__experimentalHStack","alignment","justify","maxWidth","enableHiding","_embedded","name","elements","_STATUSES$find$label","filterBy","operators","isDraftOrPrivate","createInterpolateElement","sprintf","date","span","time","isScheduled","modified","isPending","isPublished","postTypeActions","context","editAction","useEditPostAction","actions","onChangeView","newView","showAddPageModal","setShowAddPageModal","openModal","closeModal","handleNewPage","Fragment","Button","variant","__next40pxDefaultSize","onSave","onClose","DataViews","data","isLoading"],"sources":["@wordpress/edit-site/src/components/page-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\tcreateInterpolateElement,\n\tuseState,\n\tuseMemo,\n\tuseCallback,\n\tuseEffect,\n} from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { default as Link, useLink } from '../routes/link';\nimport {\n\tDEFAULT_VIEWS,\n\tDEFAULT_CONFIG_PER_VIEW_TYPE,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n} from '../../utils/constants';\n\nimport AddNewPageModal from '../add-new-page';\nimport Media from '../media';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { usePrevious } from '@wordpress/compose';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getFormattedDate = ( dateToDisplay ) =>\n\tdateI18n(\n\t\tgetSettings().formats.datetimeAbbreviated,\n\t\tgetDate( dateToDisplay )\n\t);\n\nfunction useView( postType ) {\n\tconst {\n\t\tparams: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst selectedDefaultView = useMemo( () => {\n\t\tconst defaultView =\n\t\t\tisCustom === 'false' &&\n\t\t\tDEFAULT_VIEWS[ postType ].find(\n\t\t\t\t( { slug } ) => slug === activeView\n\t\t\t)?.view;\n\t\tif ( isCustom === 'false' && layout ) {\n\t\t\treturn {\n\t\t\t\t...defaultView,\n\t\t\t\ttype: layout,\n\t\t\t\tlayout: {\n\t\t\t\t\t...( DEFAULT_CONFIG_PER_VIEW_TYPE[ layout ] || {} ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\treturn defaultView;\n\t}, [ isCustom, activeView, layout, postType ] );\n\tconst [ view, setView ] = useState( selectedDefaultView );\n\n\tuseEffect( () => {\n\t\tif ( selectedDefaultView ) {\n\t\t\tsetView( selectedDefaultView );\n\t\t}\n\t}, [ selectedDefaultView ] );\n\tconst editedViewRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst dataviewRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t\treturn dataviewRecord;\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst customView = useMemo( () => {\n\t\tconst storedView =\n\t\t\teditedViewRecord?.content &&\n\t\t\tJSON.parse( editedViewRecord?.content );\n\t\tif ( ! storedView ) {\n\t\t\treturn storedView;\n\t\t}\n\n\t\treturn {\n\t\t\t...storedView,\n\t\t\tlayout: {\n\t\t\t\t...( DEFAULT_CONFIG_PER_VIEW_TYPE[ storedView?.type ] || {} ),\n\t\t\t},\n\t\t};\n\t}, [ editedViewRecord?.content ] );\n\n\tconst setCustomView = useCallback(\n\t\t( viewToSet ) => {\n\t\t\teditEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\teditedViewRecord?.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: JSON.stringify( viewToSet ),\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[ editEntityRecord, editedViewRecord?.id ]\n\t);\n\n\tconst setDefaultViewAndUpdateUrl = useCallback(\n\t\t( viewToSet ) => {\n\t\t\tif ( viewToSet.type !== view?.type ) {\n\t\t\t\tconst { params } = history.getLocationWithParams();\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tlayout: viewToSet.type,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tsetView( viewToSet );\n\t\t},\n\t\t[ history, view?.type ]\n\t);\n\n\tif ( isCustom === 'false' ) {\n\t\treturn [ view, setDefaultViewAndUpdateUrl ];\n\t} else if ( isCustom === 'true' && customView ) {\n\t\treturn [ customView, setCustomView ];\n\t}\n\t// Loading state where no the view was not found on custom views or default views.\n\treturn [ DEFAULT_VIEWS[ postType ][ 0 ].view, setDefaultViewAndUpdateUrl ];\n}\n\n// See https://github.com/WordPress/gutenberg/issues/55886\n// We do not support custom statutes at the moment.\nconst STATUSES = [\n\t{ value: 'draft', label: __( 'Draft' ) },\n\t{ value: 'future', label: __( 'Scheduled' ) },\n\t{ value: 'pending', label: __( 'Pending Review' ) },\n\t{ value: 'private', label: __( 'Private' ) },\n\t{ value: 'publish', label: __( 'Published' ) },\n\t{ value: 'trash', label: __( 'Trash' ) },\n];\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction FeaturedImage( { item, viewType } ) {\n\tconst isDisabled = item.status === 'trash';\n\tconst { onClick } = useLink( {\n\t\tpostId: item.id,\n\t\tpostType: item.type,\n\t\tcanvas: 'edit',\n\t} );\n\tconst hasMedia = !! item.featured_media;\n\tconst size =\n\t\tviewType === LAYOUT_GRID\n\t\t\t? [ 'large', 'full', 'medium', 'thumbnail' ]\n\t\t\t: [ 'thumbnail', 'medium', 'large', 'full' ];\n\tconst media = hasMedia ? (\n\t\t<Media\n\t\t\tclassName=\"edit-site-page-pages__featured-image\"\n\t\t\tid={ item.featured_media }\n\t\t\tsize={ size }\n\t\t/>\n\t) : null;\n\tconst renderButton = viewType !== LAYOUT_LIST && ! isDisabled;\n\treturn (\n\t\t<div\n\t\t\tclassName={ `edit-site-page-pages__featured-image-wrapper is-layout-${ viewType }` }\n\t\t>\n\t\t\t{ renderButton ? (\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"page-pages-preview-field__button\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\taria-label={ item.title?.rendered || __( '(no title)' ) }\n\t\t\t\t>\n\t\t\t\t\t{ media }\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\tmedia\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PagePages() {\n\tconst postType = 'page';\n\tconst [ view, setView ] = useView( postType );\n\tconst history = useHistory();\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst onSelectionChange = useCallback(\n\t\t( items ) => {\n\t\t\tconst { params } = history.getLocationWithParams();\n\t\t\tif (\n\t\t\t\t( params.isCustom ?? 'false' ) === 'false' &&\n\t\t\t\tview?.type === LAYOUT_LIST\n\t\t\t) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ].id : undefined,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history, view?.type ]\n\t);\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\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...filters,\n\t\t};\n\t}, [ view ] );\n\tconst {\n\t\trecords: pages,\n\t\tisResolving: isLoadingPages,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecords( 'postType', postType, queryArgs );\n\n\tconst ids = pages?.map( ( page ) => getItemId( page ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.push( {\n\t\t\t\t...history.getLocationWithParams().params,\n\t\t\t\tpostId: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ postIdWasDeleted, history ] );\n\n\tconst { records: authors, isResolving: isLoadingAuthors } =\n\t\tuseEntityRecords( 'root', 'user', { per_page: -1 } );\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 { frontPageId, postsPageId, addNewLabel, canCreatePage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getPostType, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tfrontPageId: siteSettings?.page_on_front,\n\t\t\t\tpostsPageId: siteSettings?.page_for_posts,\n\t\t\t\taddNewLabel: getPostType( 'page' )?.labels?.add_new_item,\n\t\t\t\tcanCreatePage: canUser( 'create', 'pages' ),\n\t\t\t};\n\t\t}\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 } ) => (\n\t\t\t\t\t<FeaturedImage item={ item } viewType={ view.type } />\n\t\t\t\t),\n\t\t\t\tenableSorting: false,\n\t\t\t\twidth: '1%',\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,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst addLink =\n\t\t\t\t\t\t[ LAYOUT_TABLE, LAYOUT_GRID ].includes( view.type ) &&\n\t\t\t\t\t\titem.status !== 'trash';\n\t\t\t\t\tconst title = addLink ? (\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t\t\t__( '(no title)' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{ decodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t\t\t__( '(no title)' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t);\n\n\t\t\t\t\tlet suffix = '';\n\t\t\t\t\tif ( item.id === frontPageId ) {\n\t\t\t\t\t\tsuffix = (\n\t\t\t\t\t\t\t<span className=\"edit-site-page-pages__title-badge\">\n\t\t\t\t\t\t\t\t{ __( 'Front Page' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ( item.id === postsPageId ) {\n\t\t\t\t\t\tsuffix = (\n\t\t\t\t\t\t\t<span className=\"edit-site-page-pages__title-badge\">\n\t\t\t\t\t\t\t\t{ __( 'Posts Page' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tclassName=\"edit-site-page-pages-title\"\n\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 300,\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\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( ( { value } ) => value === item.status )\n\t\t\t\t\t\t?.label ?? item.status,\n\t\t\t\telements: STATUSES,\n\t\t\t\tenableSorting: false,\n\t\t\t\tfilterBy: {\n\t\t\t\t\toperators: [ OPERATOR_IS_ANY ],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Date' ),\n\t\t\t\tid: 'date',\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst isDraftOrPrivate = [ 'draft', 'private' ].includes(\n\t\t\t\t\t\titem.status\n\t\t\t\t\t);\n\t\t\t\t\tif ( isDraftOrPrivate ) {\n\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: page creation date */\n\t\t\t\t\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\t\t\t\t\tgetFormattedDate( item.date )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t\t\t\ttime: <time />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst isScheduled = item.status === 'future';\n\t\t\t\t\tif ( isScheduled ) {\n\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: page creation date */\n\t\t\t\t\t\t\t\t__( '<span>Scheduled: <time>%s</time></span>' ),\n\t\t\t\t\t\t\t\tgetFormattedDate( item.date )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t\t\t\ttime: <time />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Pending & Published posts show the modified date if it's newer.\n\t\t\t\t\tconst dateToDisplay =\n\t\t\t\t\t\tgetDate( item.modified ) > getDate( item.date )\n\t\t\t\t\t\t\t? item.modified\n\t\t\t\t\t\t\t: item.date;\n\n\t\t\t\t\tconst isPending = item.status === 'pending';\n\t\t\t\t\tif ( isPending ) {\n\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: the newest of created or modified date for the page */\n\t\t\t\t\t\t\t\t__( '<span>Modified: <time>%s</time></span>' ),\n\t\t\t\t\t\t\t\tgetFormattedDate( dateToDisplay )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t\t\t\ttime: <time />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst isPublished = item.status === 'publish';\n\t\t\t\t\tif ( isPublished ) {\n\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: the newest of created or modified date for the page */\n\t\t\t\t\t\t\t\t__( '<span>Published: <time>%s</time></span>' ),\n\t\t\t\t\t\t\t\tgetFormattedDate( dateToDisplay )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t\t\t\ttime: <time />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Unknow status.\n\t\t\t\t\treturn <time>{ getFormattedDate( item.date ) }</time>;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t[ authors, view.type, frontPageId, postsPageId ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: 'page',\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\tnewView = {\n\t\t\t\t\t...newView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ newView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView ]\n\t);\n\n\tconst [ showAddPageModal, setShowAddPageModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPageModal( true );\n\tconst closeModal = () => setShowAddPageModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ __( 'Pages' ) }\n\t\t\tactions={\n\t\t\t\taddNewLabel &&\n\t\t\t\tcanCreatePage && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPageModal && (\n\t\t\t\t\t\t\t<AddNewPageModal\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\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\t>\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 || isLoadingAuthors }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tselection={ selection }\n\t\t\t\tsetSelection={ setSelection }\n\t\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAOA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAKA,IAAAU,KAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,KAAA,GAAAC,uBAAA,CAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AAIA,IAAAe,UAAA,GAAAf,OAAA;AAQA,IAAAgB,WAAA,GAAAL,sBAAA,CAAAX,OAAA;AACA,IAAAiB,MAAA,GAAAN,sBAAA,CAAAX,OAAA;AACA,IAAAkB,WAAA,GAAAlB,OAAA;AACA,IAAAmB,iBAAA,GAAAnB,OAAA;AACA,IAAAoB,QAAA,GAAApB,OAAA;AAAiD,IAAAqB,WAAA,GAAArB,OAAA;AAAA,SAAAsB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAA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A,CAAA8M,QAAA;MAAA3G,QAAA,gBACC,IAAAnG,WAAA,CAAA+F,GAAA,EAACrH,WAAA,CAAAqO,MAAM;QACNC,OAAO,EAAC,SAAS;QACjB1H,OAAO,EAAGqH,SAAW;QACrBM,qBAAqB;QAAA9G,QAAA,EAEnBqD;MAAW,CACN,CAAC,EACPiD,gBAAgB,iBACjB,IAAAzM,WAAA,CAAA+F,GAAA,EAACpG,WAAA,CAAAY,OAAe;QACf2M,MAAM,EAAGL,aAAe;QACxBM,OAAO,EAAGP;MAAY,CACtB,CACD;IAAA,CACA,CAEH;IAAAzG,QAAA,eAED,IAAAnG,WAAA,CAAA+F,GAAA,EAAC5G,UAAA,CAAAiO,SAAS;MACT/D,cAAc,EAAGA,cAAgB;MACjCa,MAAM,EAAGA,MAAQ;MACjBoC,OAAO,EAAGA,OAAS;MACnBe,IAAI,EAAG/E,KAAK,IAAI3G,WAAa;MAC7B2L,SAAS,EAAG9E,cAAc,IAAIY,gBAAkB;MAChDpG,IAAI,EAAGA,IAAM;MACbuJ,YAAY,EAAGA,YAAc;MAC7B5F,SAAS,EAAGA,SAAW;MACvBC,YAAY,EAAGA,YAAc;MAC7BC,iBAAiB,EAAGA,iBAAmB;MACvCP,SAAS,EAAGA;IAAW,CACvB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = Table;
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
function Table({
|
|
9
|
-
data,
|
|
10
|
-
columns
|
|
11
|
-
}) {
|
|
12
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
13
|
-
className: "edit-site-table-wrapper",
|
|
14
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
15
|
-
className: "edit-site-table",
|
|
16
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
17
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
18
|
-
children: columns.map(column => /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
19
|
-
children: column.header
|
|
20
|
-
}, column.header))
|
|
21
|
-
})
|
|
22
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
23
|
-
children: data.map((row, rowIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
24
|
-
children: columns.map((column, columnIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
25
|
-
style: {
|
|
26
|
-
maxWidth: column.maxWidth ? column.maxWidth : undefined
|
|
27
|
-
},
|
|
28
|
-
children: column.cell(row)
|
|
29
|
-
}, columnIndex))
|
|
30
|
-
}, rowIndex))
|
|
31
|
-
})]
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Table","data","columns","_jsxRuntime","jsx","className","children","jsxs","map","column","header","row","rowIndex","columnIndex","style","maxWidth","undefined","cell"],"sources":["@wordpress/edit-site/src/components/table/index.js"],"sourcesContent":["export default function Table( { data, columns } ) {\n\treturn (\n\t\t<div className=\"edit-site-table-wrapper\">\n\t\t\t<table className=\"edit-site-table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t{ columns.map( ( column ) => (\n\t\t\t\t\t\t\t<th key={ column.header }>{ column.header }</th>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t{ data.map( ( row, rowIndex ) => (\n\t\t\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t\t\t{ columns.map( ( column, columnIndex ) => (\n\t\t\t\t\t\t\t\t<td\n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QAAQ,GACfC;YACJ,CAAG;YAAAV,QAAA,EAGDG,MAAM,CAACQ,IAAI,CAAEN,GAAI;UAAC,GAFdE,WAGH,CACH;QAAC,GAZMD,QAaN,CACH;MAAC,CACG,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Button","Modal","__experimentalHStack","HStack","__experimentalVStack","VStack","TextControl","__","sprintf","useDispatch","useRegistry","useState","store","coreStore","noticesStore","decodeEntities","serialize","synchronizeBlocksWithTemplate","jsx","_jsx","jsxs","_jsxs","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","title","setTitle","saveEntityRecord","createErrorNotice","createSuccessNotice","resolveSelect","createPage","event","preventDefault","pagePostType","getPostType","newPage","status","slug","content","template","length","undefined","throwOnError","rendered","type","error","errorMessage","message","code","onRequestClose","focusOnMount","size","children","onSubmit","spacing","__next40pxDefaultSize","label","onChange","placeholder","value","justify","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { serialize, synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { resolveSelect } = useRegistry();\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst pagePostType =\n\t\t\t\tawait resolveSelect( coreStore ).getPostType( 'page' );\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t!! pagePostType.template && pagePostType.template.length\n\t\t\t\t\t\t\t? serialize(\n\t\t\t\t\t\t\t\t\tsynchronizeBlocksWithTemplate(\n\t\t\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\t\t\tpagePostType.template\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newPage.title?.rendered || title )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPage( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Draft a new page' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Page title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isCreatingPage }\n\t\t\t\t\t\t\taria-disabled={ isCreatingPage }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create draft' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,KAAK,EACLC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,QACL,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,YAAY,QAAQ,oBAAo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