@wordpress/editor 13.12.4 → 13.12.5
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/build/components/post-switch-to-draft-button/index.js +3 -5
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +2 -3
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +5 -7
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +2 -3
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-style/style-rtl.css +2 -2
- package/build-style/style.css +2 -2
- package/package.json +13 -13
- package/src/components/post-switch-to-draft-button/index.js +3 -4
- package/src/components/post-sync-status/index.js +2 -3
- package/src/components/post-trash/style.scss +2 -2
|
@@ -49,9 +49,7 @@ function PostSwitchToDraftButton({
|
|
|
49
49
|
onClick();
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
return (0, _element.createElement)(_components.
|
|
53
|
-
isBlock: true
|
|
54
|
-
}, (0, _element.createElement)(_components.Button, {
|
|
52
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.Button, {
|
|
55
53
|
className: "editor-post-switch-to-draft",
|
|
56
54
|
onClick: () => {
|
|
57
55
|
setShowConfirmDialog(true);
|
|
@@ -59,8 +57,8 @@ function PostSwitchToDraftButton({
|
|
|
59
57
|
disabled: isSaving,
|
|
60
58
|
variant: "secondary",
|
|
61
59
|
style: {
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
flexGrow: '1',
|
|
61
|
+
justifyContent: 'center'
|
|
64
62
|
}
|
|
65
63
|
}, (0, _i18n.__)('Switch to draft')), (0, _element.createElement)(_components.__experimentalConfirmDialog, {
|
|
66
64
|
isOpen: showConfirmDialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["PostSwitchToDraftButton","isSaving","isPublished","isScheduled","onClick","showConfirmDialog","setShowConfirmDialog","alertMessage","handleConfirm","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["PostSwitchToDraftButton","isSaving","isPublished","isScheduled","onClick","showConfirmDialog","setShowConfirmDialog","alertMessage","handleConfirm","flexGrow","justifyContent","select","isSavingPost","isCurrentPostPublished","isCurrentPostScheduled","editorStore","dispatch","editPost","savePost","status"],"mappings":";;;;;;;AAUA;;AAPA;;AAIA;;AACA;;AACA;;AAMA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,SAASA,uBAAT,CAAkC;AACjCC,EAAAA,QADiC;AAEjCC,EAAAA,WAFiC;AAGjCC,EAAAA,WAHiC;AAIjCC,EAAAA;AAJiC,CAAlC,EAKI;AACH,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,KAAV,CAApD;;AAEA,MAAK,CAAEJ,WAAF,IAAiB,CAAEC,WAAxB,EAAsC;AACrC,WAAO,IAAP;AACA;;AAED,MAAII,YAAJ;;AACA,MAAKL,WAAL,EAAmB;AAClBK,IAAAA,YAAY,GAAG,cAAI,+CAAJ,CAAf;AACA,GAFD,MAEO,IAAKJ,WAAL,EAAmB;AACzBI,IAAAA,YAAY,GAAG,cAAI,gDAAJ,CAAf;AACA;;AAED,QAAMC,aAAa,GAAG,MAAM;AAC3BF,IAAAA,oBAAoB,CAAE,KAAF,CAApB;AACAF,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,OAAO,EAAG,MAAM;AACfE,MAAAA,oBAAoB,CAAE,IAAF,CAApB;AACA,KAJF;AAKC,IAAA,QAAQ,EAAGL,QALZ;AAMC,IAAA,OAAO,EAAC,WANT;AAOC,IAAA,KAAK,EAAG;AAAEQ,MAAAA,QAAQ,EAAE,GAAZ;AAAiBC,MAAAA,cAAc,EAAE;AAAjC;AAPT,KASG,cAAI,iBAAJ,CATH,CADD,EAYC,4BAAC,uCAAD;AACC,IAAA,MAAM,EAAGL,iBADV;AAEC,IAAA,SAAS,EAAGG,aAFb;AAGC,IAAA,QAAQ,EAAG,MAAMF,oBAAoB,CAAE,KAAF;AAHtC,KAKGC,YALH,CAZD,CADD;AAsBA;;eAEc,sBAAS,CACvB,sBAAcI,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,sBAAhB;AAAwCC,IAAAA;AAAxC,MACLH,MAAM,CAAEI,YAAF,CADP;AAEA,SAAO;AACNd,IAAAA,QAAQ,EAAEW,YAAY,EADhB;AAENV,IAAAA,WAAW,EAAEW,sBAAsB,EAF7B;AAGNV,IAAAA,WAAW,EAAEW,sBAAsB;AAH7B,GAAP;AAKA,CARD,CADuB,EAUvB,wBAAgBE,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAED,YAAF,CAAvC;AACA,SAAO;AACNX,IAAAA,OAAO,EAAE,MAAM;AACda,MAAAA,QAAQ,CAAE;AAAEE,QAAAA,MAAM,EAAE;AAAV,OAAF,CAAR;AACAD,MAAAA,QAAQ;AACR;AAJK,GAAP;AAMA,CARD,CAVuB,CAAT,EAmBVlB,uBAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostSwitchToDraftButton( {\n\tisSaving,\n\tisPublished,\n\tisScheduled,\n\tonClick,\n} ) {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( ! isPublished && ! isScheduled ) {\n\t\treturn null;\n\t}\n\n\tlet alertMessage;\n\tif ( isPublished ) {\n\t\talertMessage = __( 'Are you sure you want to unpublish this post?' );\n\t} else if ( isScheduled ) {\n\t\talertMessage = __( 'Are you sure you want to unschedule this post?' );\n\t}\n\n\tconst handleConfirm = () => {\n\t\tsetShowConfirmDialog( false );\n\t\tonClick();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-post-switch-to-draft\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t} }\n\t\t\t\tdisabled={ isSaving }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tstyle={ { flexGrow: '1', justifyContent: 'center' } }\n\t\t\t>\n\t\t\t\t{ __( 'Switch to draft' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t>\n\t\t\t\t{ alertMessage }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { isSavingPost, isCurrentPostPublished, isCurrentPostScheduled } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonClick: () => {\n\t\t\t\teditPost( { status: 'draft' } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSwitchToDraftButton );\n"]}
|
|
@@ -24,14 +24,14 @@ var _store = require("../../store");
|
|
|
24
24
|
*/
|
|
25
25
|
function PostSyncStatus() {
|
|
26
26
|
const {
|
|
27
|
-
|
|
27
|
+
syncStatus,
|
|
28
28
|
postType
|
|
29
29
|
} = (0, _data.useSelect)(select => {
|
|
30
30
|
const {
|
|
31
31
|
getEditedPostAttribute
|
|
32
32
|
} = select(_store.store);
|
|
33
33
|
return {
|
|
34
|
-
|
|
34
|
+
syncStatus: getEditedPostAttribute('wp_pattern_sync_status'),
|
|
35
35
|
postType: getEditedPostAttribute('type')
|
|
36
36
|
};
|
|
37
37
|
}, []);
|
|
@@ -40,7 +40,6 @@ function PostSyncStatus() {
|
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const syncStatus = meta?.sync_status;
|
|
44
43
|
const isFullySynced = !syncStatus;
|
|
45
44
|
return (0, _element.createElement)(_components.PanelRow, {
|
|
46
45
|
className: "edit-post-sync-status"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-sync-status/index.js"],"names":["PostSyncStatus","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-sync-status/index.js"],"names":["PostSyncStatus","syncStatus","postType","select","getEditedPostAttribute","editorStore","isFullySynced"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,cAAT,GAA0B;AACxC,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA2B,qBAAaC,MAAF,IAAc;AACzD,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEE,YAAF,CAAzC;AACA,WAAO;AACNJ,MAAAA,UAAU,EAAEG,sBAAsB,CAAE,wBAAF,CAD5B;AAENF,MAAAA,QAAQ,EAAEE,sBAAsB,CAAE,MAAF;AAF1B,KAAP;AAIA,GANgC,EAM9B,EAN8B,CAAjC;;AAOA,MAAKF,QAAQ,KAAK,UAAlB,EAA+B;AAC9B,WAAO,IAAP;AACA;;AACD,QAAMI,aAAa,GAAG,CAAEL,UAAxB;AAEA,SACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,0CAAQ,cAAI,aAAJ,CAAR,CADD,EAEC,yCACGK,aAAa,GAAG,cAAI,cAAJ,CAAH,GAA0B,cAAI,YAAJ,CAD1C,CAFD,CADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { PanelRow } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostSyncStatus() {\n\tconst { syncStatus, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\treturn {\n\t\t\tsyncStatus: getEditedPostAttribute( 'wp_pattern_sync_status' ),\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t};\n\t}, [] );\n\tif ( postType !== 'wp_block' ) {\n\t\treturn null;\n\t}\n\tconst isFullySynced = ! syncStatus;\n\n\treturn (\n\t\t<PanelRow className=\"edit-post-sync-status\">\n\t\t\t<span>{ __( 'Sync status' ) }</span>\n\t\t\t<div>\n\t\t\t\t{ isFullySynced ? __( 'Fully synced' ) : __( 'Not synced' ) }\n\t\t\t</div>\n\t\t</PanelRow>\n\t);\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { Button,
|
|
6
|
+
import { Button, __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
9
9
|
import { compose } from '@wordpress/compose';
|
|
@@ -39,9 +39,7 @@ function PostSwitchToDraftButton({
|
|
|
39
39
|
onClick();
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
return createElement(
|
|
43
|
-
isBlock: true
|
|
44
|
-
}, createElement(Button, {
|
|
42
|
+
return createElement(Fragment, null, createElement(Button, {
|
|
45
43
|
className: "editor-post-switch-to-draft",
|
|
46
44
|
onClick: () => {
|
|
47
45
|
setShowConfirmDialog(true);
|
|
@@ -49,8 +47,8 @@ function PostSwitchToDraftButton({
|
|
|
49
47
|
disabled: isSaving,
|
|
50
48
|
variant: "secondary",
|
|
51
49
|
style: {
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
flexGrow: '1',
|
|
51
|
+
justifyContent: 'center'
|
|
54
52
|
}
|
|
55
53
|
}, __('Switch to draft')), createElement(ConfirmDialog, {
|
|
56
54
|
isOpen: showConfirmDialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["Button","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["Button","__experimentalConfirmDialog","ConfirmDialog","__","withSelect","withDispatch","compose","useState","store","editorStore","PostSwitchToDraftButton","isSaving","isPublished","isScheduled","onClick","showConfirmDialog","setShowConfirmDialog","alertMessage","handleConfirm","flexGrow","justifyContent","select","isSavingPost","isCurrentPostPublished","isCurrentPostScheduled","dispatch","editPost","savePost","status"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,2BAA2B,IAAIC,aAFhC,QAGO,uBAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,uBAAT,CAAkC;AACjCC,EAAAA,QADiC;AAEjCC,EAAAA,WAFiC;AAGjCC,EAAAA,WAHiC;AAIjCC,EAAAA;AAJiC,CAAlC,EAKI;AACH,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8CT,QAAQ,CAAE,KAAF,CAA5D;;AAEA,MAAK,CAAEK,WAAF,IAAiB,CAAEC,WAAxB,EAAsC;AACrC,WAAO,IAAP;AACA;;AAED,MAAII,YAAJ;;AACA,MAAKL,WAAL,EAAmB;AAClBK,IAAAA,YAAY,GAAGd,EAAE,CAAE,+CAAF,CAAjB;AACA,GAFD,MAEO,IAAKU,WAAL,EAAmB;AACzBI,IAAAA,YAAY,GAAGd,EAAE,CAAE,gDAAF,CAAjB;AACA;;AAED,QAAMe,aAAa,GAAG,MAAM;AAC3BF,IAAAA,oBAAoB,CAAE,KAAF,CAApB;AACAF,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC,8BACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,OAAO,EAAG,MAAM;AACfE,MAAAA,oBAAoB,CAAE,IAAF,CAApB;AACA,KAJF;AAKC,IAAA,QAAQ,EAAGL,QALZ;AAMC,IAAA,OAAO,EAAC,WANT;AAOC,IAAA,KAAK,EAAG;AAAEQ,MAAAA,QAAQ,EAAE,GAAZ;AAAiBC,MAAAA,cAAc,EAAE;AAAjC;AAPT,KASGjB,EAAE,CAAE,iBAAF,CATL,CADD,EAYC,cAAC,aAAD;AACC,IAAA,MAAM,EAAGY,iBADV;AAEC,IAAA,SAAS,EAAGG,aAFb;AAGC,IAAA,QAAQ,EAAG,MAAMF,oBAAoB,CAAE,KAAF;AAHtC,KAKGC,YALH,CAZD,CADD;AAsBA;;AAED,eAAeX,OAAO,CAAE,CACvBF,UAAU,CAAIiB,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,sBAAhB;AAAwCC,IAAAA;AAAxC,MACLH,MAAM,CAAEZ,WAAF,CADP;AAEA,SAAO;AACNE,IAAAA,QAAQ,EAAEW,YAAY,EADhB;AAENV,IAAAA,WAAW,EAAEW,sBAAsB,EAF7B;AAGNV,IAAAA,WAAW,EAAEW,sBAAsB;AAH7B,GAAP;AAKA,CARS,CADa,EAUvBnB,YAAY,CAAIoB,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAEhB,WAAF,CAAvC;AACA,SAAO;AACNK,IAAAA,OAAO,EAAE,MAAM;AACdY,MAAAA,QAAQ,CAAE;AAAEE,QAAAA,MAAM,EAAE;AAAV,OAAF,CAAR;AACAD,MAAAA,QAAQ;AACR;AAJK,GAAP;AAMA,CARW,CAVW,CAAF,CAAP,CAmBVjB,uBAnBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostSwitchToDraftButton( {\n\tisSaving,\n\tisPublished,\n\tisScheduled,\n\tonClick,\n} ) {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( ! isPublished && ! isScheduled ) {\n\t\treturn null;\n\t}\n\n\tlet alertMessage;\n\tif ( isPublished ) {\n\t\talertMessage = __( 'Are you sure you want to unpublish this post?' );\n\t} else if ( isScheduled ) {\n\t\talertMessage = __( 'Are you sure you want to unschedule this post?' );\n\t}\n\n\tconst handleConfirm = () => {\n\t\tsetShowConfirmDialog( false );\n\t\tonClick();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-post-switch-to-draft\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t} }\n\t\t\t\tdisabled={ isSaving }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tstyle={ { flexGrow: '1', justifyContent: 'center' } }\n\t\t\t>\n\t\t\t\t{ __( 'Switch to draft' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t>\n\t\t\t\t{ alertMessage }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { isSavingPost, isCurrentPostPublished, isCurrentPostScheduled } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonClick: () => {\n\t\t\t\teditPost( { status: 'draft' } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSwitchToDraftButton );\n"]}
|
|
@@ -13,14 +13,14 @@ import { PanelRow } from '@wordpress/components';
|
|
|
13
13
|
import { store as editorStore } from '../../store';
|
|
14
14
|
export default function PostSyncStatus() {
|
|
15
15
|
const {
|
|
16
|
-
|
|
16
|
+
syncStatus,
|
|
17
17
|
postType
|
|
18
18
|
} = useSelect(select => {
|
|
19
19
|
const {
|
|
20
20
|
getEditedPostAttribute
|
|
21
21
|
} = select(editorStore);
|
|
22
22
|
return {
|
|
23
|
-
|
|
23
|
+
syncStatus: getEditedPostAttribute('wp_pattern_sync_status'),
|
|
24
24
|
postType: getEditedPostAttribute('type')
|
|
25
25
|
};
|
|
26
26
|
}, []);
|
|
@@ -29,7 +29,6 @@ export default function PostSyncStatus() {
|
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const syncStatus = meta?.sync_status;
|
|
33
32
|
const isFullySynced = !syncStatus;
|
|
34
33
|
return createElement(PanelRow, {
|
|
35
34
|
className: "edit-post-sync-status"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-sync-status/index.js"],"names":["useSelect","__","PanelRow","store","editorStore","PostSyncStatus","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-sync-status/index.js"],"names":["useSelect","__","PanelRow","store","editorStore","PostSyncStatus","syncStatus","postType","select","getEditedPostAttribute","isFullySynced"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,uBAAzB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,eAAe,SAASC,cAAT,GAA0B;AACxC,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA2BP,SAAS,CAAIQ,MAAF,IAAc;AACzD,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEJ,WAAF,CAAzC;AACA,WAAO;AACNE,MAAAA,UAAU,EAAEG,sBAAsB,CAAE,wBAAF,CAD5B;AAENF,MAAAA,QAAQ,EAAEE,sBAAsB,CAAE,MAAF;AAF1B,KAAP;AAIA,GANyC,EAMvC,EANuC,CAA1C;;AAOA,MAAKF,QAAQ,KAAK,UAAlB,EAA+B;AAC9B,WAAO,IAAP;AACA;;AACD,QAAMG,aAAa,GAAG,CAAEJ,UAAxB;AAEA,SACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,4BAAQL,EAAE,CAAE,aAAF,CAAV,CADD,EAEC,2BACGS,aAAa,GAAGT,EAAE,CAAE,cAAF,CAAL,GAA0BA,EAAE,CAAE,YAAF,CAD5C,CAFD,CADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { PanelRow } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostSyncStatus() {\n\tconst { syncStatus, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\treturn {\n\t\t\tsyncStatus: getEditedPostAttribute( 'wp_pattern_sync_status' ),\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t};\n\t}, [] );\n\tif ( postType !== 'wp_block' ) {\n\t\treturn null;\n\t}\n\tconst isFullySynced = ! syncStatus;\n\n\treturn (\n\t\t<PanelRow className=\"edit-post-sync-status\">\n\t\t\t<span>{ __( 'Sync status' ) }</span>\n\t\t\t<div>\n\t\t\t\t{ isFullySynced ? __( 'Fully synced' ) : __( 'Not synced' ) }\n\t\t\t</div>\n\t\t</PanelRow>\n\t);\n}\n"]}
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.5",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"@wordpress/a11y": "^3.35.1",
|
|
35
35
|
"@wordpress/api-fetch": "^6.32.1",
|
|
36
36
|
"@wordpress/blob": "^3.35.1",
|
|
37
|
-
"@wordpress/block-editor": "^12.3.
|
|
38
|
-
"@wordpress/blocks": "^12.12.
|
|
39
|
-
"@wordpress/components": "^25.1.
|
|
37
|
+
"@wordpress/block-editor": "^12.3.5",
|
|
38
|
+
"@wordpress/blocks": "^12.12.3",
|
|
39
|
+
"@wordpress/components": "^25.1.5",
|
|
40
40
|
"@wordpress/compose": "^6.12.1",
|
|
41
|
-
"@wordpress/core-data": "^6.12.
|
|
42
|
-
"@wordpress/data": "^9.5.
|
|
41
|
+
"@wordpress/core-data": "^6.12.5",
|
|
42
|
+
"@wordpress/data": "^9.5.3",
|
|
43
43
|
"@wordpress/date": "^4.35.1",
|
|
44
44
|
"@wordpress/deprecated": "^3.35.1",
|
|
45
45
|
"@wordpress/dom": "^3.35.1",
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"@wordpress/html-entities": "^3.35.1",
|
|
49
49
|
"@wordpress/i18n": "^4.35.1",
|
|
50
50
|
"@wordpress/icons": "^9.26.2",
|
|
51
|
-
"@wordpress/keyboard-shortcuts": "^4.12.
|
|
51
|
+
"@wordpress/keyboard-shortcuts": "^4.12.3",
|
|
52
52
|
"@wordpress/keycodes": "^3.35.1",
|
|
53
53
|
"@wordpress/media-utils": "^4.26.1",
|
|
54
|
-
"@wordpress/notices": "^4.3.
|
|
55
|
-
"@wordpress/preferences": "^3.12.
|
|
54
|
+
"@wordpress/notices": "^4.3.3",
|
|
55
|
+
"@wordpress/preferences": "^3.12.5",
|
|
56
56
|
"@wordpress/private-apis": "^0.17.1",
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.12.
|
|
58
|
-
"@wordpress/rich-text": "^6.12.
|
|
59
|
-
"@wordpress/server-side-render": "^4.12.
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.12.5",
|
|
58
|
+
"@wordpress/rich-text": "^6.12.3",
|
|
59
|
+
"@wordpress/server-side-render": "^4.12.5",
|
|
60
60
|
"@wordpress/url": "^3.36.1",
|
|
61
61
|
"@wordpress/wordcount": "^3.35.1",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
|
|
77
77
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
|
-
FlexItem,
|
|
7
6
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
8
7
|
} from '@wordpress/components';
|
|
9
8
|
import { __ } from '@wordpress/i18n';
|
|
@@ -41,7 +40,7 @@ function PostSwitchToDraftButton( {
|
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
return (
|
|
44
|
-
|
|
43
|
+
<>
|
|
45
44
|
<Button
|
|
46
45
|
className="editor-post-switch-to-draft"
|
|
47
46
|
onClick={ () => {
|
|
@@ -49,7 +48,7 @@ function PostSwitchToDraftButton( {
|
|
|
49
48
|
} }
|
|
50
49
|
disabled={ isSaving }
|
|
51
50
|
variant="secondary"
|
|
52
|
-
style={ {
|
|
51
|
+
style={ { flexGrow: '1', justifyContent: 'center' } }
|
|
53
52
|
>
|
|
54
53
|
{ __( 'Switch to draft' ) }
|
|
55
54
|
</Button>
|
|
@@ -60,7 +59,7 @@ function PostSwitchToDraftButton( {
|
|
|
60
59
|
>
|
|
61
60
|
{ alertMessage }
|
|
62
61
|
</ConfirmDialog>
|
|
63
|
-
|
|
62
|
+
</>
|
|
64
63
|
);
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -11,17 +11,16 @@ import { PanelRow } from '@wordpress/components';
|
|
|
11
11
|
import { store as editorStore } from '../../store';
|
|
12
12
|
|
|
13
13
|
export default function PostSyncStatus() {
|
|
14
|
-
const {
|
|
14
|
+
const { syncStatus, postType } = useSelect( ( select ) => {
|
|
15
15
|
const { getEditedPostAttribute } = select( editorStore );
|
|
16
16
|
return {
|
|
17
|
-
|
|
17
|
+
syncStatus: getEditedPostAttribute( 'wp_pattern_sync_status' ),
|
|
18
18
|
postType: getEditedPostAttribute( 'type' ),
|
|
19
19
|
};
|
|
20
20
|
}, [] );
|
|
21
21
|
if ( postType !== 'wp_block' ) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
const syncStatus = meta?.sync_status;
|
|
25
24
|
const isFullySynced = ! syncStatus;
|
|
26
25
|
|
|
27
26
|
return (
|