@wordpress/editor 14.43.1-next.v.202604091042.0 → 14.44.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/collab-sidebar/index.cjs.map +2 -2
- package/build/components/post-revisions-panel/index.cjs +44 -42
- package/build/components/post-revisions-panel/index.cjs.map +2 -2
- package/build/components/sidebar/index.cjs +7 -1
- package/build/components/sidebar/index.cjs.map +2 -2
- package/build/components/sidebar/post-revision-summary.cjs +11 -2
- package/build/components/sidebar/post-revision-summary.cjs.map +2 -2
- package/build/components/sidebar/post-summary.cjs +0 -18
- package/build/components/sidebar/post-summary.cjs.map +2 -2
- package/build/components/style-book/categories.cjs.map +2 -2
- package/build/components/style-book/examples.cjs +1 -1
- package/build/components/style-book/examples.cjs.map +2 -2
- package/build/components/style-book/types.cjs.map +1 -1
- package/build/components/sync-connection-error-modal/index.cjs +10 -1
- package/build/components/sync-connection-error-modal/index.cjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +44 -42
- package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +7 -1
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-revision-summary.mjs +15 -3
- package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +1 -18
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/style-book/categories.mjs.map +2 -2
- package/build-module/components/style-book/examples.mjs +1 -1
- package/build-module/components/style-book/examples.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/index.mjs +10 -1
- package/build-module/components/sync-connection-error-modal/index.mjs.map +2 -2
- package/build-style/style-rtl.css +27 -28
- package/build-style/style.css +27 -28
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts +0 -3
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/style-book/categories.d.ts.map +1 -1
- package/build-types/components/style-book/examples.d.ts.map +1 -1
- package/build-types/components/style-book/types.d.ts +1 -13
- package/build-types/components/style-book/types.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
- package/build-types/hooks/pattern-overrides.d.ts +1 -1
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
- package/package.json +45 -45
- package/src/components/collab-sidebar/index.js +1 -0
- package/src/components/post-revisions-panel/index.js +46 -44
- package/src/components/sidebar/index.js +7 -1
- package/src/components/sidebar/post-revision-summary.js +13 -3
- package/src/components/sidebar/post-summary.js +1 -18
- package/src/components/style-book/categories.ts +0 -1
- package/src/components/style-book/examples.tsx +6 -12
- package/src/components/style-book/types.ts +1 -18
- package/src/components/sync-connection-error-modal/index.tsx +24 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,MAAM,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,IAAI,EAAE,mBAAmB,CAAE,MAAM,CAAE,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,IAAI,CAAE,WAAW,EAAE,WAAW,GAAG,UAAU,CAAE,CAAC;IACtD,QAAQ,EAAE,IAAI,CAAE,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAE,CAAC;IACtD,SAAS,EAAE,IAAI,CAAE,WAAW,EAAE,QAAQ,GAAG,UAAU,CAAE,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/index.tsx"],"names":[],"mappings":"AAsCA;;;;;GAKG;AACH,wBAAgB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/index.tsx"],"names":[],"mappings":"AAsCA;;;;;GAKG;AACH,wBAAgB,wBAAwB,uCAgNvC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type WPHigherOrderComponent = import("@wordpress/compose").WPHigherOrderComponent;
|
|
2
|
-
export type WPBlockSettings =
|
|
2
|
+
export type WPBlockSettings = import("@wordpress/blocks").WPBlockSettings;
|
|
3
3
|
/**
|
|
4
4
|
* Object whose keys are the names of block attributes, where each value
|
|
5
5
|
* represents the meta key to which the block attribute is intended to save.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-sources-backwards-compatibility.d.ts","sourceRoot":"","sources":["../../src/hooks/custom-sources-backwards-compatibility.js"],"names":[],"mappings":"qCAcc,OAAO,oBAAoB,EAAE,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"custom-sources-backwards-compatibility.d.ts","sourceRoot":"","sources":["../../src/hooks/custom-sources-backwards-compatibility.js"],"names":[],"mappings":"qCAcc,OAAO,oBAAoB,EAAE,sBAAsB;8BACnD,OAAO,mBAAmB,EAAE,eAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type WPBlockSettings =
|
|
1
|
+
export type WPBlockSettings = import("@wordpress/blocks").WPBlockSettings;
|
|
2
2
|
//# sourceMappingURL=pattern-overrides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern-overrides.d.ts","sourceRoot":"","sources":["../../src/hooks/pattern-overrides.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"pattern-overrides.d.ts","sourceRoot":"","sources":["../../src/hooks/pattern-overrides.js"],"names":[],"mappings":"8BAmBc,OAAO,mBAAmB,EAAE,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.44.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,49 +61,49 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@floating-ui/react-dom": "2.0.8",
|
|
64
|
-
"@wordpress/a11y": "^4.
|
|
65
|
-
"@wordpress/api-fetch": "^7.
|
|
66
|
-
"@wordpress/base-styles": "^6.
|
|
67
|
-
"@wordpress/blob": "^4.
|
|
68
|
-
"@wordpress/block-editor": "^15.
|
|
69
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
70
|
-
"@wordpress/blocks": "^15.
|
|
71
|
-
"@wordpress/commands": "^1.
|
|
72
|
-
"@wordpress/components": "^32.
|
|
73
|
-
"@wordpress/compose": "^7.
|
|
74
|
-
"@wordpress/core-data": "^7.
|
|
75
|
-
"@wordpress/data": "^10.
|
|
76
|
-
"@wordpress/dataviews": "^14.1.
|
|
77
|
-
"@wordpress/date": "^5.
|
|
78
|
-
"@wordpress/deprecated": "^4.
|
|
79
|
-
"@wordpress/dom": "^4.
|
|
80
|
-
"@wordpress/element": "^6.44.
|
|
81
|
-
"@wordpress/fields": "^0.
|
|
82
|
-
"@wordpress/global-styles-engine": "^1.
|
|
83
|
-
"@wordpress/global-styles-ui": "^1.
|
|
84
|
-
"@wordpress/hooks": "^4.
|
|
85
|
-
"@wordpress/html-entities": "^4.
|
|
86
|
-
"@wordpress/i18n": "^6.17.
|
|
87
|
-
"@wordpress/icons": "^12.
|
|
88
|
-
"@wordpress/interface": "^9.
|
|
89
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
90
|
-
"@wordpress/keycodes": "^4.
|
|
91
|
-
"@wordpress/media-editor": "^0.
|
|
92
|
-
"@wordpress/media-fields": "^0.
|
|
93
|
-
"@wordpress/media-utils": "^5.
|
|
94
|
-
"@wordpress/notices": "^5.
|
|
95
|
-
"@wordpress/patterns": "^2.
|
|
96
|
-
"@wordpress/plugins": "^7.
|
|
97
|
-
"@wordpress/preferences": "^4.
|
|
98
|
-
"@wordpress/private-apis": "^1.
|
|
99
|
-
"@wordpress/reusable-blocks": "^5.
|
|
100
|
-
"@wordpress/rich-text": "^7.
|
|
101
|
-
"@wordpress/server-side-render": "^6.
|
|
102
|
-
"@wordpress/upload-media": "^0.
|
|
103
|
-
"@wordpress/url": "^4.
|
|
104
|
-
"@wordpress/views": "^1.
|
|
105
|
-
"@wordpress/warning": "^3.
|
|
106
|
-
"@wordpress/wordcount": "^4.
|
|
64
|
+
"@wordpress/a11y": "^4.44.0",
|
|
65
|
+
"@wordpress/api-fetch": "^7.44.0",
|
|
66
|
+
"@wordpress/base-styles": "^6.20.0",
|
|
67
|
+
"@wordpress/blob": "^4.44.0",
|
|
68
|
+
"@wordpress/block-editor": "^15.17.0",
|
|
69
|
+
"@wordpress/block-serialization-default-parser": "^5.44.0",
|
|
70
|
+
"@wordpress/blocks": "^15.17.0",
|
|
71
|
+
"@wordpress/commands": "^1.44.0",
|
|
72
|
+
"@wordpress/components": "^32.6.0",
|
|
73
|
+
"@wordpress/compose": "^7.44.0",
|
|
74
|
+
"@wordpress/core-data": "^7.44.0",
|
|
75
|
+
"@wordpress/data": "^10.44.0",
|
|
76
|
+
"@wordpress/dataviews": "^14.1.0",
|
|
77
|
+
"@wordpress/date": "^5.44.0",
|
|
78
|
+
"@wordpress/deprecated": "^4.44.0",
|
|
79
|
+
"@wordpress/dom": "^4.44.0",
|
|
80
|
+
"@wordpress/element": "^6.44.0",
|
|
81
|
+
"@wordpress/fields": "^0.36.0",
|
|
82
|
+
"@wordpress/global-styles-engine": "^1.11.0",
|
|
83
|
+
"@wordpress/global-styles-ui": "^1.11.0",
|
|
84
|
+
"@wordpress/hooks": "^4.44.0",
|
|
85
|
+
"@wordpress/html-entities": "^4.44.0",
|
|
86
|
+
"@wordpress/i18n": "^6.17.0",
|
|
87
|
+
"@wordpress/icons": "^12.2.0",
|
|
88
|
+
"@wordpress/interface": "^9.29.0",
|
|
89
|
+
"@wordpress/keyboard-shortcuts": "^5.44.0",
|
|
90
|
+
"@wordpress/keycodes": "^4.44.0",
|
|
91
|
+
"@wordpress/media-editor": "^0.7.0",
|
|
92
|
+
"@wordpress/media-fields": "^0.9.0",
|
|
93
|
+
"@wordpress/media-utils": "^5.44.0",
|
|
94
|
+
"@wordpress/notices": "^5.44.0",
|
|
95
|
+
"@wordpress/patterns": "^2.44.0",
|
|
96
|
+
"@wordpress/plugins": "^7.44.0",
|
|
97
|
+
"@wordpress/preferences": "^4.44.0",
|
|
98
|
+
"@wordpress/private-apis": "^1.44.0",
|
|
99
|
+
"@wordpress/reusable-blocks": "^5.44.0",
|
|
100
|
+
"@wordpress/rich-text": "^7.44.0",
|
|
101
|
+
"@wordpress/server-side-render": "^6.20.0",
|
|
102
|
+
"@wordpress/upload-media": "^0.29.0",
|
|
103
|
+
"@wordpress/url": "^4.44.0",
|
|
104
|
+
"@wordpress/views": "^1.11.0",
|
|
105
|
+
"@wordpress/warning": "^3.44.0",
|
|
106
|
+
"@wordpress/wordcount": "^4.44.0",
|
|
107
107
|
"change-case": "^4.1.2",
|
|
108
108
|
"client-zip": "^2.4.5",
|
|
109
109
|
"clsx": "^2.1.1",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"publishConfig": {
|
|
127
127
|
"access": "public"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "b862d8c84121a47bbeff882f6c87e61681ce2e0d"
|
|
130
130
|
}
|
|
@@ -56,6 +56,7 @@ function NotesSidebarContent( {
|
|
|
56
56
|
// Sometimes previous sidebar unmounts after the new one mounts.
|
|
57
57
|
// This ensures we always have the latest reference.
|
|
58
58
|
if ( node ) {
|
|
59
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
59
60
|
commentSidebarRef.current = node;
|
|
60
61
|
}
|
|
61
62
|
} }
|
|
@@ -25,30 +25,23 @@ import { unlock } from '../../lock-unlock';
|
|
|
25
25
|
const { Badge } = unlock( componentsPrivateApis );
|
|
26
26
|
const DAY_IN_MILLISECONDS = 86400000;
|
|
27
27
|
const EMPTY_ARRAY = [];
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
orderby: 'date',
|
|
32
|
-
order: 'desc',
|
|
33
|
-
context: 'embed',
|
|
34
|
-
_fields: 'id,date,author',
|
|
35
|
-
};
|
|
36
|
-
const defaultLayouts = { activity: {} };
|
|
28
|
+
const defaultLayouts = { activity: true };
|
|
29
|
+
const noop = () => {};
|
|
30
|
+
const paginationInfo = {};
|
|
37
31
|
const view = {
|
|
38
32
|
type: 'activity',
|
|
39
33
|
titleField: 'date',
|
|
40
34
|
fields: [ 'author' ],
|
|
41
|
-
layout: {
|
|
42
|
-
density: 'compact',
|
|
43
|
-
},
|
|
35
|
+
layout: { density: 'compact' },
|
|
44
36
|
};
|
|
45
37
|
const fields = [
|
|
46
38
|
{
|
|
47
39
|
id: 'date',
|
|
48
40
|
label: __( 'Date' ),
|
|
49
|
-
render: ( { item } ) => {
|
|
41
|
+
render: ( { item, field } ) => {
|
|
50
42
|
const dateNowInMs = getDate( null ).getTime();
|
|
51
|
-
const
|
|
43
|
+
const _value = field.getValue( { item } );
|
|
44
|
+
const date = getDate( _value ?? null );
|
|
52
45
|
const displayDate =
|
|
53
46
|
dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS
|
|
54
47
|
? dateI18n(
|
|
@@ -59,7 +52,7 @@ const fields = [
|
|
|
59
52
|
return (
|
|
60
53
|
<time
|
|
61
54
|
className="editor-post-revisions-panel__revision-date"
|
|
62
|
-
dateTime={
|
|
55
|
+
dateTime={ _value }
|
|
63
56
|
>
|
|
64
57
|
{ displayDate }
|
|
65
58
|
</time>
|
|
@@ -70,36 +63,45 @@ const fields = [
|
|
|
70
63
|
},
|
|
71
64
|
authorField,
|
|
72
65
|
];
|
|
73
|
-
const noop = () => {};
|
|
74
|
-
const paginationInfo = {};
|
|
75
66
|
|
|
76
67
|
function PostRevisionsPanelContent() {
|
|
77
68
|
const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
|
|
78
|
-
const {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
const {
|
|
70
|
+
revisionsCount,
|
|
71
|
+
revisions,
|
|
72
|
+
revisionKey,
|
|
73
|
+
isLoading,
|
|
74
|
+
lastRevisionId,
|
|
75
|
+
} = useSelect( ( select ) => {
|
|
76
|
+
const { getCurrentPostId, getCurrentPostType } = select( editorStore );
|
|
77
|
+
const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =
|
|
78
|
+
select( editorStore );
|
|
79
|
+
const { getRevisions, getEntityConfig, isResolving } =
|
|
80
|
+
select( coreStore );
|
|
81
|
+
const _postType = getCurrentPostType();
|
|
82
|
+
const entityConfig = getEntityConfig( 'postType', _postType );
|
|
83
|
+
const _revisionKey = entityConfig?.revisionKey || 'id';
|
|
84
|
+
const revisionsQuery = {
|
|
85
|
+
per_page: 3,
|
|
86
|
+
orderby: 'date',
|
|
87
|
+
order: 'desc',
|
|
88
|
+
_fields: `${ _revisionKey },date,author`,
|
|
89
|
+
};
|
|
90
|
+
const query = [
|
|
91
|
+
'postType',
|
|
92
|
+
_postType,
|
|
93
|
+
getCurrentPostId(),
|
|
94
|
+
revisionsQuery,
|
|
95
|
+
];
|
|
96
|
+
const _revisions = getRevisions( ...query );
|
|
97
|
+
return {
|
|
98
|
+
revisionsCount: getCurrentPostRevisionsCount(),
|
|
99
|
+
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
100
|
+
revisions: _revisions,
|
|
101
|
+
revisionKey: _revisionKey,
|
|
102
|
+
isLoading: isResolving( 'getRevisions', query ),
|
|
103
|
+
};
|
|
104
|
+
}, [] );
|
|
103
105
|
return (
|
|
104
106
|
<PanelBody
|
|
105
107
|
title={
|
|
@@ -121,10 +123,10 @@ function PostRevisionsPanelContent() {
|
|
|
121
123
|
isLoading={ isLoading }
|
|
122
124
|
paginationInfo={ paginationInfo }
|
|
123
125
|
defaultLayouts={ defaultLayouts }
|
|
124
|
-
getItemId={ ( item ) => item
|
|
126
|
+
getItemId={ ( item ) => item[ revisionKey ] }
|
|
125
127
|
isItemClickable={ () => true }
|
|
126
128
|
onClickItem={ ( item ) => {
|
|
127
|
-
setCurrentRevisionId( item
|
|
129
|
+
setCurrentRevisionId( item[ revisionKey ] );
|
|
128
130
|
} }
|
|
129
131
|
>
|
|
130
132
|
<DataViews.Layout />
|
|
@@ -112,7 +112,13 @@ const SidebarContent = ( {
|
|
|
112
112
|
<PluginDocumentSettingPanel.Slot />
|
|
113
113
|
<TemplateContentPanel />
|
|
114
114
|
{ window?.__experimentalDataFormInspector &&
|
|
115
|
-
[
|
|
115
|
+
[
|
|
116
|
+
'post',
|
|
117
|
+
'page',
|
|
118
|
+
'wp_template',
|
|
119
|
+
'wp_template_part',
|
|
120
|
+
'wp_block',
|
|
121
|
+
].includes( postType ) && (
|
|
116
122
|
<>
|
|
117
123
|
<TemplateActionsPanel />
|
|
118
124
|
<PostRevisionsPanel />
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ExternalLink,
|
|
7
|
+
__experimentalVStack as VStack,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* Internal dependencies
|
|
@@ -15,7 +20,6 @@ import { PostContentInformationUI } from '../post-content-information';
|
|
|
15
20
|
import RevisionFieldsDiffPanel from '../revision-fields-diff';
|
|
16
21
|
import PostPanelSection from '../post-panel-section';
|
|
17
22
|
import PostCardPanel from '../post-card-panel';
|
|
18
|
-
import { OpenRevisionsClassicScreen } from './post-summary';
|
|
19
23
|
|
|
20
24
|
export default function PostRevisionSummary() {
|
|
21
25
|
const { revisionId, postId, postContent } = useSelect( ( select ) => {
|
|
@@ -40,7 +44,13 @@ export default function PostRevisionSummary() {
|
|
|
40
44
|
<PostContentInformationUI postContent={ postContent } />
|
|
41
45
|
<RevisionCreatedPanel />
|
|
42
46
|
</VStack>
|
|
43
|
-
<
|
|
47
|
+
<ExternalLink
|
|
48
|
+
href={ addQueryArgs( 'revision.php', {
|
|
49
|
+
revision: revisionId,
|
|
50
|
+
} ) }
|
|
51
|
+
>
|
|
52
|
+
{ __( 'Open classic revisions screen' ) }
|
|
53
|
+
</ExternalLink>
|
|
44
54
|
<RevisionAuthorPanel />
|
|
45
55
|
</VStack>
|
|
46
56
|
</PostPanelSection>
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalVStack as VStack,
|
|
6
|
-
ExternalLink,
|
|
7
|
-
} from '@wordpress/components';
|
|
4
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
8
5
|
import { useSelect } from '@wordpress/data';
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
11
6
|
|
|
12
7
|
/**
|
|
13
8
|
* Internal dependencies
|
|
@@ -41,18 +36,6 @@ import PostTrash from '../post-trash';
|
|
|
41
36
|
*/
|
|
42
37
|
const PANEL_NAME = 'post-status';
|
|
43
38
|
|
|
44
|
-
export function OpenRevisionsClassicScreen( { revisionId } ) {
|
|
45
|
-
return (
|
|
46
|
-
<ExternalLink
|
|
47
|
-
href={ addQueryArgs( 'revision.php', {
|
|
48
|
-
revision: revisionId,
|
|
49
|
-
} ) }
|
|
50
|
-
>
|
|
51
|
-
{ __( 'Open classic revisions screen' ) }
|
|
52
|
-
</ExternalLink>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
39
|
export default function PostSummary( { onActionPerformed } ) {
|
|
57
40
|
const postType = useSelect(
|
|
58
41
|
( select ) => select( editorStore ).getCurrentPostType(),
|
|
@@ -2,24 +2,18 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import type { Block } from '@wordpress/blocks';
|
|
5
6
|
import {
|
|
6
7
|
getBlockType,
|
|
7
8
|
getBlockTypes,
|
|
8
9
|
getBlockFromExample,
|
|
9
10
|
createBlock,
|
|
10
|
-
// @wordpress/blocks imports are not typed.
|
|
11
|
-
// @ts-expect-error
|
|
12
11
|
} from '@wordpress/blocks';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Internal dependencies
|
|
16
15
|
*/
|
|
17
|
-
import type {
|
|
18
|
-
BlockExample,
|
|
19
|
-
ColorOrigin,
|
|
20
|
-
MultiOriginPalettes,
|
|
21
|
-
BlockType,
|
|
22
|
-
} from './types';
|
|
16
|
+
import type { BlockExample, ColorOrigin, MultiOriginPalettes } from './types';
|
|
23
17
|
import ColorExamples from './color-examples';
|
|
24
18
|
import DuotoneExamples from './duotone-examples';
|
|
25
19
|
import { STYLE_BOOK_COLOR_GROUPS } from './constants';
|
|
@@ -111,7 +105,7 @@ function getOverviewBlockExamples(
|
|
|
111
105
|
}
|
|
112
106
|
|
|
113
107
|
// Get examples for typography blocks.
|
|
114
|
-
const typographyBlockExamples:
|
|
108
|
+
const typographyBlockExamples: Block[] = [];
|
|
115
109
|
|
|
116
110
|
if ( getBlockType( 'core/heading' ) ) {
|
|
117
111
|
const headingBlock = createBlock( 'core/heading', {
|
|
@@ -212,7 +206,7 @@ function getOverviewBlockExamples(
|
|
|
212
206
|
*/
|
|
213
207
|
export function getExamples( colors: MultiOriginPalettes ): BlockExample[] {
|
|
214
208
|
const nonHeadingBlockExamples = getBlockTypes()
|
|
215
|
-
.filter( ( blockType
|
|
209
|
+
.filter( ( blockType ) => {
|
|
216
210
|
const { name, example, supports } = blockType;
|
|
217
211
|
return (
|
|
218
212
|
name !== 'core/heading' &&
|
|
@@ -220,7 +214,7 @@ export function getExamples( colors: MultiOriginPalettes ): BlockExample[] {
|
|
|
220
214
|
supports?.inserter !== false
|
|
221
215
|
);
|
|
222
216
|
} )
|
|
223
|
-
.map( ( blockType
|
|
217
|
+
.map( ( blockType ) => ( {
|
|
224
218
|
name: blockType.name,
|
|
225
219
|
title: blockType.title,
|
|
226
220
|
category: blockType.category,
|
|
@@ -232,7 +226,7 @@ export function getExamples( colors: MultiOriginPalettes ): BlockExample[] {
|
|
|
232
226
|
blocks: getBlockFromExample( blockType.name, {
|
|
233
227
|
...blockType.example,
|
|
234
228
|
attributes: {
|
|
235
|
-
...blockType.example
|
|
229
|
+
...blockType.example?.attributes,
|
|
236
230
|
style: undefined,
|
|
237
231
|
},
|
|
238
232
|
} ),
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
name: string;
|
|
3
|
-
attributes: Record< string, unknown >;
|
|
4
|
-
innerBlocks?: Block[];
|
|
5
|
-
};
|
|
1
|
+
import type { Block } from '@wordpress/blocks';
|
|
6
2
|
|
|
7
3
|
export type StyleBookCategory = {
|
|
8
4
|
title: string;
|
|
@@ -65,16 +61,3 @@ export type MultiOriginPalettes = {
|
|
|
65
61
|
duotones: Omit< ColorOrigin, 'colors' | 'gradients' >;
|
|
66
62
|
gradients: Omit< ColorOrigin, 'colors' | 'duotones' >;
|
|
67
63
|
};
|
|
68
|
-
|
|
69
|
-
/*
|
|
70
|
-
* Typing the items from getBlockTypes from '@wordpress/blocks'
|
|
71
|
-
* to appease the TS linter.
|
|
72
|
-
*/
|
|
73
|
-
export type BlockType = {
|
|
74
|
-
name: string;
|
|
75
|
-
title: string;
|
|
76
|
-
category: string;
|
|
77
|
-
example: BlockType;
|
|
78
|
-
attributes: Record< string, unknown >;
|
|
79
|
-
supports: Record< string, unknown >;
|
|
80
|
-
};
|
|
@@ -45,6 +45,8 @@ const INITIAL_DISCONNECTED_DEBOUNCE_MS = 20000;
|
|
|
45
45
|
export function SyncConnectionErrorModal() {
|
|
46
46
|
const [ hasInitialized, setHasInitialized ] = useState( false );
|
|
47
47
|
const [ showModal, setShowModal ] = useState( false );
|
|
48
|
+
const [ isManualRetryAvailable, setIsManualRetryAvailable ] =
|
|
49
|
+
useState( false );
|
|
48
50
|
|
|
49
51
|
const { connectionStatus, isCollaborationEnabled, postType } = useSelect(
|
|
50
52
|
( selectFn ) => {
|
|
@@ -82,6 +84,22 @@ export function SyncConnectionErrorModal() {
|
|
|
82
84
|
return () => clearTimeout( timeout );
|
|
83
85
|
}, [] );
|
|
84
86
|
|
|
87
|
+
// Track retry availability separately from the raw connection status.
|
|
88
|
+
// The polling manager briefly emits `{ status: 'connecting' }` without
|
|
89
|
+
// `canManuallyRetry` when a retry is kicked off, which would otherwise
|
|
90
|
+
// unmount the Retry button briefly.
|
|
91
|
+
useEffect( () => {
|
|
92
|
+
if ( 'connecting' === connectionStatus?.status ) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
setIsManualRetryAvailable(
|
|
97
|
+
connectionStatus !== null &&
|
|
98
|
+
'canManuallyRetry' in connectionStatus &&
|
|
99
|
+
connectionStatus.canManuallyRetry === true
|
|
100
|
+
);
|
|
101
|
+
}, [ connectionStatus ] );
|
|
102
|
+
|
|
85
103
|
// Show the modal when disconnected and either retries are exhausted or
|
|
86
104
|
// no retry is available (unrecoverable error). Hide on reconnect.
|
|
87
105
|
// The 'connecting' state is ignored so the modal preserves its current
|
|
@@ -145,15 +163,12 @@ export function SyncConnectionErrorModal() {
|
|
|
145
163
|
return null;
|
|
146
164
|
}
|
|
147
165
|
|
|
148
|
-
const manualRetry =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
retrySyncConnection();
|
|
155
|
-
}
|
|
156
|
-
: undefined;
|
|
166
|
+
const manualRetry = isManualRetryAvailable
|
|
167
|
+
? () => {
|
|
168
|
+
onManualRetry();
|
|
169
|
+
retrySyncConnection();
|
|
170
|
+
}
|
|
171
|
+
: undefined;
|
|
157
172
|
|
|
158
173
|
const messages = getSyncErrorMessages( error );
|
|
159
174
|
|