@wordpress/edit-site 6.4.0 → 6.6.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 +4 -0
- package/build/components/add-new-pattern/index.js +6 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +2 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +2 -2
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/editor/index.js +71 -20
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +1 -4
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +3 -4
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +25 -5
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -8
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +23 -7
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/screen-block.js +5 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-typeset.js +40 -0
- package/build/components/global-styles/screen-typeset.js.map +1 -0
- package/build/components/global-styles/screen-typography-element.js +14 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +51 -59
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/size-control/index.js +10 -5
- package/build/components/global-styles/size-control/index.js.map +1 -1
- package/build/components/global-styles/typeset-button.js +97 -0
- package/build/components/global-styles/typeset-button.js.map +1 -0
- package/build/components/global-styles/typeset.js +80 -0
- package/build/components/global-styles/typeset.js.map +1 -0
- package/build/components/global-styles/ui.js +4 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +10 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/page-patterns/fields.js +230 -0
- package/build/components/page-patterns/fields.js.map +1 -0
- package/build/components/page-patterns/index.js +13 -228
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +29 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/fields.js +169 -0
- package/build/components/page-templates/fields.js.map +1 -0
- package/build/components/page-templates/index.js +10 -177
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +46 -34
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +50 -28
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +126 -68
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +3 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +81 -81
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -42
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/site-hub/index.js +6 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +22 -25
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- 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 +3 -3
- 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 +2 -4
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/utils/is-template-removable.js +2 -2
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +6 -1
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +2 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +2 -2
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/editor/index.js +73 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +1 -4
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +3 -4
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -5
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +26 -6
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +1 -8
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +23 -7
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +5 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-typeset.js +34 -0
- package/build-module/components/global-styles/screen-typeset.js.map +1 -0
- package/build-module/components/global-styles/screen-typography-element.js +14 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +4 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +52 -60
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/size-control/index.js +10 -5
- package/build-module/components/global-styles/size-control/index.js.map +1 -1
- package/build-module/components/global-styles/typeset-button.js +89 -0
- package/build-module/components/global-styles/typeset-button.js.map +1 -0
- package/build-module/components/global-styles/typeset.js +71 -0
- package/build-module/components/global-styles/typeset.js.map +1 -0
- package/build-module/components/global-styles/ui.js +4 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +10 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +223 -0
- package/build-module/components/page-patterns/fields.js.map +1 -0
- package/build-module/components/page-patterns/index.js +14 -231
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +26 -0
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/fields.js +160 -0
- package/build-module/components/page-templates/fields.js.map +1 -0
- package/build-module/components/page-templates/index.js +12 -178
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +49 -37
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +50 -28
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +128 -70
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +3 -2
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +81 -81
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +3 -42
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +7 -4
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +23 -26
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- 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 +3 -3
- 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 +2 -3
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +0 -2
- package/build-module/index.js.map +1 -1
- package/build-module/utils/is-template-removable.js +2 -2
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-style/posts-rtl.css +201 -25
- package/build-style/posts.css +201 -25
- package/build-style/style-rtl.css +307 -69
- package/build-style/style.css +307 -69
- package/package.json +41 -41
- package/src/components/add-new-pattern/index.js +8 -3
- package/src/components/add-new-post/index.js +2 -1
- package/src/components/add-new-template/style.scss +1 -1
- package/src/components/add-new-template/utils.js +10 -6
- package/src/components/editor/index.js +80 -22
- package/src/components/editor/style.scss +60 -2
- package/src/components/global-styles/background-panel.js +0 -3
- package/src/components/global-styles/font-families.js +3 -5
- package/src/components/global-styles/font-library-modal/context.js +0 -5
- package/src/components/global-styles/font-library-modal/font-collection.js +34 -10
- package/src/components/global-styles/font-library-modal/index.js +2 -7
- package/src/components/global-styles/font-library-modal/installed-fonts.js +26 -6
- package/src/components/global-styles/font-library-modal/style.scss +2 -2
- package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -2
- package/src/components/global-styles/screen-block.js +2 -4
- package/src/components/global-styles/screen-css.js +3 -1
- package/src/components/global-styles/screen-typeset.js +42 -0
- package/src/components/global-styles/screen-typography-element.js +14 -0
- package/src/components/global-styles/screen-typography.js +4 -4
- package/src/components/global-styles/shadows-edit-panel.js +67 -73
- package/src/components/global-styles/size-control/index.js +9 -6
- package/src/components/global-styles/style.scss +4 -7
- package/src/components/global-styles/typeset-button.js +93 -0
- package/src/components/global-styles/typeset.js +73 -0
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/utils.js +13 -1
- package/src/components/layout/style.scss +8 -0
- package/src/components/page-patterns/fields.js +251 -0
- package/src/components/page-patterns/index.js +19 -246
- package/src/components/page-patterns/style.scss +82 -85
- package/src/components/page-patterns/use-patterns.js +33 -0
- package/src/components/page-templates/fields.js +157 -0
- package/src/components/page-templates/index.js +19 -170
- package/src/components/page-templates/style.scss +14 -5
- package/src/components/post-edit/index.js +58 -35
- package/src/components/post-fields/index.js +88 -25
- package/src/components/post-list/index.js +135 -79
- package/src/components/sidebar-dataviews/add-new-view.js +3 -4
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +95 -95
- package/src/components/sidebar-dataviews/index.js +3 -37
- package/src/components/site-hub/index.js +11 -2
- package/src/components/site-icon/style.scss +4 -1
- package/src/components/style-book/index.js +27 -32
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- package/src/hooks/push-changes-to-global-styles/index.js +3 -3
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -3
- package/src/index.js +0 -2
- package/src/utils/is-template-removable.js +4 -2
- package/src/utils/is-template-revertable.js +2 -1
- package/build/utils/clone-deep.js +0 -15
- package/build/utils/clone-deep.js.map +0 -1
- package/build-module/utils/clone-deep.js +0 -9
- package/build-module/utils/clone-deep.js.map +0 -1
- package/src/utils/clone-deep.js +0 -8
|
@@ -77,105 +77,105 @@ export function useDefaultViews( { postType } ) {
|
|
|
77
77
|
[ postType ]
|
|
78
78
|
);
|
|
79
79
|
return useMemo( () => {
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
],
|
|
101
|
-
},
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
title: labels?.all_items || __( 'All items' ),
|
|
83
|
+
slug: 'all',
|
|
84
|
+
icon: pages,
|
|
85
|
+
view: DEFAULT_POST_BASE,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: __( 'Published' ),
|
|
89
|
+
slug: 'published',
|
|
90
|
+
icon: published,
|
|
91
|
+
view: {
|
|
92
|
+
...DEFAULT_POST_BASE,
|
|
93
|
+
filters: [
|
|
94
|
+
{
|
|
95
|
+
field: 'status',
|
|
96
|
+
operator: OPERATOR_IS_ANY,
|
|
97
|
+
value: 'publish',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
102
100
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: __( 'Scheduled' ),
|
|
104
|
+
slug: 'future',
|
|
105
|
+
icon: scheduled,
|
|
106
|
+
view: {
|
|
107
|
+
...DEFAULT_POST_BASE,
|
|
108
|
+
filters: [
|
|
109
|
+
{
|
|
110
|
+
field: 'status',
|
|
111
|
+
operator: OPERATOR_IS_ANY,
|
|
112
|
+
value: 'future',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
117
115
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: __( 'Drafts' ),
|
|
119
|
+
slug: 'drafts',
|
|
120
|
+
icon: drafts,
|
|
121
|
+
view: {
|
|
122
|
+
...DEFAULT_POST_BASE,
|
|
123
|
+
filters: [
|
|
124
|
+
{
|
|
125
|
+
field: 'status',
|
|
126
|
+
operator: OPERATOR_IS_ANY,
|
|
127
|
+
value: 'draft',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
132
130
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: __( 'Pending' ),
|
|
134
|
+
slug: 'pending',
|
|
135
|
+
icon: pending,
|
|
136
|
+
view: {
|
|
137
|
+
...DEFAULT_POST_BASE,
|
|
138
|
+
filters: [
|
|
139
|
+
{
|
|
140
|
+
field: 'status',
|
|
141
|
+
operator: OPERATOR_IS_ANY,
|
|
142
|
+
value: 'pending',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
147
145
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: __( 'Private' ),
|
|
149
|
+
slug: 'private',
|
|
150
|
+
icon: notAllowed,
|
|
151
|
+
view: {
|
|
152
|
+
...DEFAULT_POST_BASE,
|
|
153
|
+
filters: [
|
|
154
|
+
{
|
|
155
|
+
field: 'status',
|
|
156
|
+
operator: OPERATOR_IS_ANY,
|
|
157
|
+
value: 'private',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
162
160
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: __( 'Trash' ),
|
|
164
|
+
slug: 'trash',
|
|
165
|
+
icon: trash,
|
|
166
|
+
view: {
|
|
167
|
+
...DEFAULT_POST_BASE,
|
|
168
|
+
type: LAYOUT_TABLE,
|
|
169
|
+
layout: defaultLayouts[ LAYOUT_TABLE ].layout,
|
|
170
|
+
filters: [
|
|
171
|
+
{
|
|
172
|
+
field: 'status',
|
|
173
|
+
operator: OPERATOR_IS_ANY,
|
|
174
|
+
value: 'trash',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
177
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}, [ labels
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
}, [ labels ] );
|
|
181
181
|
}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
5
5
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
|
-
import { useRef, useEffect } from '@wordpress/element';
|
|
7
|
-
import { usePrevious } from '@wordpress/compose';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Internal dependencies
|
|
@@ -14,45 +12,13 @@ import { unlock } from '../../lock-unlock';
|
|
|
14
12
|
import DataViewItem from './dataview-item';
|
|
15
13
|
import CustomDataViewsList from './custom-dataviews-list';
|
|
16
14
|
|
|
17
|
-
const { useLocation
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Hook to switch to table layout when switching to the trash view.
|
|
21
|
-
* When going out of the trash view, it switches back to the previous layout if
|
|
22
|
-
* there was an automatic switch to table layout.
|
|
23
|
-
*/
|
|
24
|
-
function useSwitchToTableOnTrash() {
|
|
25
|
-
const {
|
|
26
|
-
params: { activeView, layout, ...restParams },
|
|
27
|
-
} = useLocation();
|
|
28
|
-
const history = useHistory();
|
|
29
|
-
const viewToSwitchOutOfTrash = useRef( undefined );
|
|
30
|
-
const previousActiveView = usePrevious( activeView );
|
|
31
|
-
useEffect( () => {
|
|
32
|
-
if ( activeView === 'trash' && previousActiveView !== 'trash' ) {
|
|
33
|
-
viewToSwitchOutOfTrash.current = layout || 'list';
|
|
34
|
-
history.push( { ...restParams, layout: 'table', activeView } );
|
|
35
|
-
} else if (
|
|
36
|
-
previousActiveView === 'trash' &&
|
|
37
|
-
activeView !== 'trash' &&
|
|
38
|
-
viewToSwitchOutOfTrash.current
|
|
39
|
-
) {
|
|
40
|
-
history.push( {
|
|
41
|
-
...restParams,
|
|
42
|
-
layout: viewToSwitchOutOfTrash.current,
|
|
43
|
-
activeView,
|
|
44
|
-
} );
|
|
45
|
-
viewToSwitchOutOfTrash.current = undefined;
|
|
46
|
-
}
|
|
47
|
-
}, [ previousActiveView, activeView, layout, history, restParams ] );
|
|
48
|
-
}
|
|
15
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
49
16
|
|
|
50
17
|
export default function DataViewsSidebarContent() {
|
|
51
18
|
const {
|
|
52
19
|
params: { postType, activeView = 'all', isCustom = 'false' },
|
|
53
20
|
} = useLocation();
|
|
54
|
-
|
|
55
|
-
const DEFAULT_VIEWS = useDefaultViews( { postType } );
|
|
21
|
+
const defaultViews = useDefaultViews( { postType } );
|
|
56
22
|
if ( ! postType ) {
|
|
57
23
|
return null;
|
|
58
24
|
}
|
|
@@ -61,7 +27,7 @@ export default function DataViewsSidebarContent() {
|
|
|
61
27
|
return (
|
|
62
28
|
<>
|
|
63
29
|
<ItemGroup>
|
|
64
|
-
{
|
|
30
|
+
{ defaultViews.map( ( dataview ) => {
|
|
65
31
|
return (
|
|
66
32
|
<DataViewItem
|
|
67
33
|
key={ dataview.slug }
|
|
@@ -7,7 +7,11 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
__experimentalHStack as HStack,
|
|
13
|
+
VisuallyHidden,
|
|
14
|
+
} from '@wordpress/components';
|
|
11
15
|
import { __ } from '@wordpress/i18n';
|
|
12
16
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
17
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -80,9 +84,14 @@ const SiteHub = memo(
|
|
|
80
84
|
variant="link"
|
|
81
85
|
href={ homeUrl }
|
|
82
86
|
target="_blank"
|
|
83
|
-
label={ __( 'View site (opens in a new tab)' ) }
|
|
84
87
|
>
|
|
85
88
|
{ decodeEntities( siteTitle ) }
|
|
89
|
+
<VisuallyHidden as="span">
|
|
90
|
+
{
|
|
91
|
+
/* translators: accessibility text */
|
|
92
|
+
__( '(opens in a new tab)' )
|
|
93
|
+
}
|
|
94
|
+
</VisuallyHidden>
|
|
86
95
|
</Button>
|
|
87
96
|
</div>
|
|
88
97
|
<HStack
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
.edit-site-site-icon__icon {
|
|
2
2
|
fill: currentColor;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
3
5
|
|
|
4
6
|
.edit-site-layout.is-full-canvas & {
|
|
5
7
|
// Make the WordPress icon not so big in full canvas.
|
|
6
|
-
padding: $grid-unit-15
|
|
8
|
+
padding: $grid-unit-15;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -12,6 +14,7 @@
|
|
|
12
14
|
height: 100%;
|
|
13
15
|
object-fit: cover;
|
|
14
16
|
background: #333;
|
|
17
|
+
aspect-ratio: 1 / 1;
|
|
15
18
|
|
|
16
19
|
.edit-site-layout.is-full-canvas & {
|
|
17
20
|
border-radius: 0;
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import { __, sprintf } from '@wordpress/i18n';
|
|
14
14
|
import {
|
|
15
15
|
getCategories,
|
|
16
|
+
getBlockType,
|
|
16
17
|
getBlockTypes,
|
|
17
18
|
getBlockFromExample,
|
|
18
19
|
createBlock,
|
|
@@ -128,37 +129,7 @@ function isObjectEmpty( object ) {
|
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
function getExamples() {
|
|
131
|
-
|
|
132
|
-
// heading levels.
|
|
133
|
-
const headingsExample = {
|
|
134
|
-
name: 'core/heading',
|
|
135
|
-
title: __( 'Headings' ),
|
|
136
|
-
category: 'text',
|
|
137
|
-
blocks: [
|
|
138
|
-
createBlock( 'core/heading', {
|
|
139
|
-
content: __( 'Code Is Poetry' ),
|
|
140
|
-
level: 1,
|
|
141
|
-
} ),
|
|
142
|
-
createBlock( 'core/heading', {
|
|
143
|
-
content: __( 'Code Is Poetry' ),
|
|
144
|
-
level: 2,
|
|
145
|
-
} ),
|
|
146
|
-
createBlock( 'core/heading', {
|
|
147
|
-
content: __( 'Code Is Poetry' ),
|
|
148
|
-
level: 3,
|
|
149
|
-
} ),
|
|
150
|
-
createBlock( 'core/heading', {
|
|
151
|
-
content: __( 'Code Is Poetry' ),
|
|
152
|
-
level: 4,
|
|
153
|
-
} ),
|
|
154
|
-
createBlock( 'core/heading', {
|
|
155
|
-
content: __( 'Code Is Poetry' ),
|
|
156
|
-
level: 5,
|
|
157
|
-
} ),
|
|
158
|
-
],
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
const otherExamples = getBlockTypes()
|
|
132
|
+
const nonHeadingBlockExamples = getBlockTypes()
|
|
162
133
|
.filter( ( blockType ) => {
|
|
163
134
|
const { name, example, supports } = blockType;
|
|
164
135
|
return (
|
|
@@ -174,7 +145,31 @@ function getExamples() {
|
|
|
174
145
|
blocks: getBlockFromExample( blockType.name, blockType.example ),
|
|
175
146
|
} ) );
|
|
176
147
|
|
|
177
|
-
|
|
148
|
+
const isHeadingBlockRegistered = !! getBlockType( 'core/heading' );
|
|
149
|
+
|
|
150
|
+
if ( ! isHeadingBlockRegistered ) {
|
|
151
|
+
return nonHeadingBlockExamples;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Use our own example for the Heading block so that we can show multiple
|
|
155
|
+
// heading levels.
|
|
156
|
+
const headingsExample = {
|
|
157
|
+
name: 'core/heading',
|
|
158
|
+
title: __( 'Headings' ),
|
|
159
|
+
category: 'text',
|
|
160
|
+
blocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {
|
|
161
|
+
return createBlock( 'core/heading', {
|
|
162
|
+
content: sprintf(
|
|
163
|
+
// translators: %d: heading level e.g: "1", "2", "3"
|
|
164
|
+
__( 'Heading %d' ),
|
|
165
|
+
level
|
|
166
|
+
),
|
|
167
|
+
level,
|
|
168
|
+
} );
|
|
169
|
+
} ),
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
return [ headingsExample, ...nonHeadingBlockExamples ];
|
|
178
173
|
}
|
|
179
174
|
|
|
180
175
|
function StyleBook( {
|
|
@@ -90,6 +90,11 @@ function useResolveEditedEntityAndContext( { postId, postType } ) {
|
|
|
90
90
|
return undefined;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// Don't trigger resolution for multi-selected posts.
|
|
94
|
+
if ( postId && postId.includes( ',' ) ) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
const {
|
|
94
99
|
getEditedEntityRecord,
|
|
95
100
|
getEntityRecords,
|
|
@@ -26,7 +26,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
26
26
|
*/
|
|
27
27
|
import { useSupportedStyles } from '../../components/global-styles/hooks';
|
|
28
28
|
import { unlock } from '../../lock-unlock';
|
|
29
|
-
import cloneDeep from '../../utils/clone-deep';
|
|
30
29
|
import setNestedValue from '../../utils/set-nested-value';
|
|
31
30
|
|
|
32
31
|
const { cleanEmptyObject, GlobalStylesContext } = unlock(
|
|
@@ -259,8 +258,8 @@ function PushChangesToGlobalStylesControl( {
|
|
|
259
258
|
if ( changes.length > 0 ) {
|
|
260
259
|
const { style: blockStyles } = attributes;
|
|
261
260
|
|
|
262
|
-
const newBlockStyles =
|
|
263
|
-
const newUserConfig =
|
|
261
|
+
const newBlockStyles = structuredClone( blockStyles );
|
|
262
|
+
const newUserConfig = structuredClone( userConfig );
|
|
264
263
|
|
|
265
264
|
for ( const { path, value } of changes ) {
|
|
266
265
|
setNestedValue( newBlockStyles, path, undefined );
|
|
@@ -324,6 +323,7 @@ function PushChangesToGlobalStylesControl( {
|
|
|
324
323
|
|
|
325
324
|
return (
|
|
326
325
|
<BaseControl
|
|
326
|
+
__nextHasNoMarginBottom
|
|
327
327
|
className="edit-site-push-changes-to-global-styles-control"
|
|
328
328
|
help={ sprintf(
|
|
329
329
|
// translators: %s: Title of the block e.g. 'Heading'.
|
|
@@ -11,7 +11,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import cloneDeep from '../../utils/clone-deep';
|
|
15
14
|
import { unlock } from '../../lock-unlock';
|
|
16
15
|
|
|
17
16
|
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
@@ -91,7 +90,7 @@ export function useCurrentMergeThemeStyleVariationsWithUserConfig(
|
|
|
91
90
|
const propertiesAsString = properties.toString();
|
|
92
91
|
|
|
93
92
|
return useMemo( () => {
|
|
94
|
-
const clonedUserVariation =
|
|
93
|
+
const clonedUserVariation = structuredClone( userVariation );
|
|
95
94
|
|
|
96
95
|
// Get user variation and remove the settings for the given property.
|
|
97
96
|
const userVariationWithoutProperties = removePropertiesFromObject(
|
|
@@ -167,7 +166,7 @@ export const filterObjectByProperties = ( object, properties ) => {
|
|
|
167
166
|
*/
|
|
168
167
|
export function isVariationWithProperties( variation, properties ) {
|
|
169
168
|
const variationWithProperties = filterObjectByProperties(
|
|
170
|
-
|
|
169
|
+
structuredClone( variation ),
|
|
171
170
|
properties
|
|
172
171
|
);
|
|
173
172
|
|
package/src/index.js
CHANGED
|
@@ -29,7 +29,6 @@ import { unlock } from './lock-unlock';
|
|
|
29
29
|
import App from './components/app';
|
|
30
30
|
|
|
31
31
|
const {
|
|
32
|
-
registerDefaultActions,
|
|
33
32
|
registerCoreBlockBindingsSources,
|
|
34
33
|
bootstrapBlockBindingsSourcesFromServer,
|
|
35
34
|
} = unlock( editorPrivateApis );
|
|
@@ -59,7 +58,6 @@ export function initializeEditor( id, settings ) {
|
|
|
59
58
|
enableFSEBlocks: true,
|
|
60
59
|
} );
|
|
61
60
|
}
|
|
62
|
-
registerDefaultActions();
|
|
63
61
|
|
|
64
62
|
// We dispatch actions and update the store synchronously before rendering
|
|
65
63
|
// so that we won't trigger unnecessary re-renders with useEffect.
|
|
@@ -7,7 +7,7 @@ import { TEMPLATE_ORIGINS } from './constants';
|
|
|
7
7
|
* Check if a template is removable.
|
|
8
8
|
*
|
|
9
9
|
* @param {Object} template The template entity to check.
|
|
10
|
-
* @return {boolean} Whether the template is
|
|
10
|
+
* @return {boolean} Whether the template is removable.
|
|
11
11
|
*/
|
|
12
12
|
export default function isTemplateRemovable( template ) {
|
|
13
13
|
if ( ! template ) {
|
|
@@ -15,6 +15,8 @@ export default function isTemplateRemovable( template ) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
template.source === TEMPLATE_ORIGINS.custom &&
|
|
18
|
+
template.source === TEMPLATE_ORIGINS.custom &&
|
|
19
|
+
! Boolean( template.plugin ) &&
|
|
20
|
+
! template.has_theme_file
|
|
19
21
|
);
|
|
20
22
|
}
|
|
@@ -15,7 +15,8 @@ export default function isTemplateRevertable( template ) {
|
|
|
15
15
|
}
|
|
16
16
|
/* eslint-disable camelcase */
|
|
17
17
|
return (
|
|
18
|
-
template?.source === TEMPLATE_ORIGINS.custom &&
|
|
18
|
+
template?.source === TEMPLATE_ORIGINS.custom &&
|
|
19
|
+
( Boolean( template?.plugin ) || template?.has_theme_file )
|
|
19
20
|
);
|
|
20
21
|
/* eslint-enable camelcase */
|
|
21
22
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = cloneDeep;
|
|
7
|
-
/**
|
|
8
|
-
* Makes a copy of an object without storing any references to the original object.
|
|
9
|
-
* @param {Object} object
|
|
10
|
-
* @return {Object} The cloned object.
|
|
11
|
-
*/
|
|
12
|
-
function cloneDeep(object) {
|
|
13
|
-
return !object ? {} : JSON.parse(JSON.stringify(object));
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=clone-deep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cloneDeep","object","JSON","parse","stringify"],"sources":["@wordpress/edit-site/src/utils/clone-deep.js"],"sourcesContent":["/**\n * Makes a copy of an object without storing any references to the original object.\n * @param {Object} object\n * @return {Object} The cloned object.\n */\nexport default function cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,SAASA,CAAEC,MAAM,EAAG;EAC3C,OAAO,CAAEA,MAAM,GAAG,CAAC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEH,MAAO,CAAE,CAAC;AAC9D","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Makes a copy of an object without storing any references to the original object.
|
|
3
|
-
* @param {Object} object
|
|
4
|
-
* @return {Object} The cloned object.
|
|
5
|
-
*/
|
|
6
|
-
export default function cloneDeep(object) {
|
|
7
|
-
return !object ? {} : JSON.parse(JSON.stringify(object));
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=clone-deep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["cloneDeep","object","JSON","parse","stringify"],"sources":["@wordpress/edit-site/src/utils/clone-deep.js"],"sourcesContent":["/**\n * Makes a copy of an object without storing any references to the original object.\n * @param {Object} object\n * @return {Object} The cloned object.\n */\nexport default function cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,SAASA,CAAEC,MAAM,EAAG;EAC3C,OAAO,CAAEA,MAAM,GAAG,CAAC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEH,MAAO,CAAE,CAAC;AAC9D","ignoreList":[]}
|
package/src/utils/clone-deep.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Makes a copy of an object without storing any references to the original object.
|
|
3
|
-
* @param {Object} object
|
|
4
|
-
* @return {Object} The cloned object.
|
|
5
|
-
*/
|
|
6
|
-
export default function cloneDeep( object ) {
|
|
7
|
-
return ! object ? {} : JSON.parse( JSON.stringify( object ) );
|
|
8
|
-
}
|