@wordpress/editor 13.14.0 → 13.15.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/entities-saved-states/entity-record-item.js +3 -37
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +2 -4
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +0 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/{save-shortcut.js → index.js} +13 -25
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -0
- package/build/components/index.js +32 -19
- package/build/components/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +62 -157
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -9
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +2 -4
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -3
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +2 -5
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/label.js +4 -4
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-sync-status/index.js +84 -5
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-text-editor/index.js +51 -58
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/store/actions.js +37 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +53 -61
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +6 -40
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +2 -4
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +0 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/{save-shortcut.js → index.js} +12 -23
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -0
- package/build-module/components/index.js +9 -4
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +63 -149
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -9
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +2 -4
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +2 -5
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +4 -4
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +84 -8
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +48 -56
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/store/actions.js +31 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +46 -55
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +0 -18
- package/build-style/style.css +0 -18
- package/package.json +30 -30
- package/src/components/entities-saved-states/entity-record-item.js +3 -61
- package/src/components/entities-saved-states/entity-type-list.js +0 -2
- package/src/components/entities-saved-states/index.js +0 -1
- package/src/components/entities-saved-states/style.scss +0 -15
- package/src/components/global-keyboard-shortcuts/index.js +49 -0
- package/src/components/index.js +12 -3
- package/src/components/post-preview-button/index.js +73 -156
- package/src/components/post-preview-button/test/index.js +94 -158
- package/src/components/post-publish-button/index.js +2 -7
- package/src/components/post-publish-button/label.js +2 -2
- package/src/components/post-publish-button/test/index.js +0 -10
- package/src/components/post-publish-panel/index.js +1 -3
- package/src/components/post-saved-state/index.js +2 -5
- package/src/components/post-schedule/label.js +4 -4
- package/src/components/post-sync-status/index.js +100 -7
- package/src/components/post-text-editor/index.js +34 -57
- package/src/components/post-title/style.native.scss +5 -5
- package/src/store/actions.js +34 -2
- package/src/store/selectors.js +45 -41
- package/src/store/test/selectors.js +36 -25
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +0 -1
- package/build/components/global-keyboard-shortcuts/text-editor-shortcuts.js +0 -22
- package/build/components/global-keyboard-shortcuts/text-editor-shortcuts.js.map +0 -1
- package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -45
- package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +0 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +0 -1
- package/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js +0 -12
- package/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js.map +0 -1
- package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -32
- package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +0 -1
- package/src/components/global-keyboard-shortcuts/save-shortcut.js +0 -55
- package/src/components/global-keyboard-shortcuts/text-editor-shortcuts.js +0 -8
- package/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -29
- package/src/components/post-text-editor/test/index.js +0 -156
package/CHANGELOG.md
CHANGED
|
@@ -13,8 +13,6 @@ var _i18n = require("@wordpress/i18n");
|
|
|
13
13
|
|
|
14
14
|
var _data = require("@wordpress/data");
|
|
15
15
|
|
|
16
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
-
|
|
18
16
|
var _coreData = require("@wordpress/core-data");
|
|
19
17
|
|
|
20
18
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
@@ -31,25 +29,14 @@ var _store = require("../../store");
|
|
|
31
29
|
function EntityRecordItem({
|
|
32
30
|
record,
|
|
33
31
|
checked,
|
|
34
|
-
onChange
|
|
35
|
-
closePanel
|
|
32
|
+
onChange
|
|
36
33
|
}) {
|
|
37
34
|
const {
|
|
38
35
|
name,
|
|
39
36
|
kind,
|
|
40
37
|
title,
|
|
41
38
|
key
|
|
42
|
-
} = record;
|
|
43
|
-
const parentBlockId = (0, _data.useSelect)(select => {
|
|
44
|
-
// Get entity's blocks.
|
|
45
|
-
const {
|
|
46
|
-
blocks = []
|
|
47
|
-
} = select(_coreData.store).getEditedEntityRecord(kind, name, key); // Get parents of the entity's first block.
|
|
48
|
-
|
|
49
|
-
const parents = select(_blockEditor.store).getBlockParents(blocks[0]?.clientId); // Return closest parent block's clientId.
|
|
50
|
-
|
|
51
|
-
return parents[parents.length - 1];
|
|
52
|
-
}, []); // Handle templates that might use default descriptive titles.
|
|
39
|
+
} = record; // Handle templates that might use default descriptive titles.
|
|
53
40
|
|
|
54
41
|
const entityRecordTitle = (0, _data.useSelect)(select => {
|
|
55
42
|
if ('postType' !== kind || 'wp_template' !== name) {
|
|
@@ -59,32 +46,11 @@ function EntityRecordItem({
|
|
|
59
46
|
const template = select(_coreData.store).getEditedEntityRecord(kind, name, key);
|
|
60
47
|
return select(_store.store).__experimentalGetTemplateInfo(template).title;
|
|
61
48
|
}, [name, kind, title, key]);
|
|
62
|
-
const isSelected = (0, _data.useSelect)(select => {
|
|
63
|
-
const selectedBlockId = select(_blockEditor.store).getSelectedBlockClientId();
|
|
64
|
-
return selectedBlockId === parentBlockId;
|
|
65
|
-
}, [parentBlockId]);
|
|
66
|
-
const isSelectedText = isSelected ? (0, _i18n.__)('Selected') : (0, _i18n.__)('Select');
|
|
67
|
-
const {
|
|
68
|
-
selectBlock
|
|
69
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
70
|
-
const selectParentBlock = (0, _element.useCallback)(() => selectBlock(parentBlockId), [parentBlockId]);
|
|
71
|
-
const selectAndDismiss = (0, _element.useCallback)(() => {
|
|
72
|
-
selectBlock(parentBlockId);
|
|
73
|
-
closePanel();
|
|
74
|
-
}, [parentBlockId]);
|
|
75
49
|
return (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_components.CheckboxControl, {
|
|
76
50
|
__nextHasNoMarginBottom: true,
|
|
77
51
|
label: (0, _element.createElement)("strong", null, (0, _htmlEntities.decodeEntities)(entityRecordTitle) || (0, _i18n.__)('Untitled')),
|
|
78
52
|
checked: checked,
|
|
79
53
|
onChange: onChange
|
|
80
|
-
})
|
|
81
|
-
onClick: selectParentBlock,
|
|
82
|
-
className: "entities-saved-states__find-entity",
|
|
83
|
-
disabled: isSelected
|
|
84
|
-
}, isSelectedText), (0, _element.createElement)(_components.Button, {
|
|
85
|
-
onClick: selectAndDismiss,
|
|
86
|
-
className: "entities-saved-states__find-entity-small",
|
|
87
|
-
disabled: isSelected
|
|
88
|
-
}, isSelectedText)) : null);
|
|
54
|
+
}));
|
|
89
55
|
}
|
|
90
56
|
//# sourceMappingURL=entity-record-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","name","kind","title","key","entityRecordTitle","select","template","coreStore","getEditedEntityRecord","editorStore","__experimentalGetTemplateInfo"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,gBAAT,CAA2B;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,OAAV;AAAmBC,EAAAA;AAAnB,CAA3B,EAA2D;AACzE,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA;AAArB,MAA6BN,MAAnC,CADyE,CAGzE;;AACA,QAAMO,iBAAiB,GAAG,qBACvBC,MAAF,IAAc;AACb,QAAK,eAAeJ,IAAf,IAAuB,kBAAkBD,IAA9C,EAAqD;AACpD,aAAOE,KAAP;AACA;;AAED,UAAMI,QAAQ,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,qBAApB,CAChBP,IADgB,EAEhBD,IAFgB,EAGhBG,GAHgB,CAAjB;AAKA,WAAOE,MAAM,CAAEI,YAAF,CAAN,CAAsBC,6BAAtB,CACNJ,QADM,EAELJ,KAFF;AAGA,GAdwB,EAezB,CAAEF,IAAF,EAAQC,IAAR,EAAcC,KAAd,EAAqBC,GAArB,CAfyB,CAA1B;AAkBA,SACC,4BAAC,oBAAD,QACC,4BAAC,2BAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EACJ,4CACG,kCAAgBC,iBAAhB,KACD,cAAI,UAAJ,CAFF,CAHF;AAQC,IAAA,OAAO,EAAGN,OARX;AASC,IAAA,QAAQ,EAAGC;AATZ,IADD,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function EntityRecordItem( { record, checked, onChange } ) {\n\tconst { name, kind, title, key } = record;\n\n\t// Handle templates that might use default descriptive titles.\n\tconst entityRecordTitle = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn title;\n\t\t\t}\n\n\t\t\tconst template = select( coreStore ).getEditedEntityRecord(\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tkey\n\t\t\t);\n\t\t\treturn select( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\ttemplate\n\t\t\t).title;\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\treturn (\n\t\t<PanelRow>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t{ decodeEntities( entityRecordTitle ) ||\n\t\t\t\t\t\t\t__( 'Untitled' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t}\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</PanelRow>\n\t);\n}\n"]}
|
|
@@ -43,8 +43,7 @@ function getEntityDescription(entity, count) {
|
|
|
43
43
|
function EntityTypeList({
|
|
44
44
|
list,
|
|
45
45
|
unselectedEntities,
|
|
46
|
-
setUnselectedEntities
|
|
47
|
-
closePanel
|
|
46
|
+
setUnselectedEntities
|
|
48
47
|
}) {
|
|
49
48
|
const count = list.length;
|
|
50
49
|
const firstRecord = list[0];
|
|
@@ -68,8 +67,7 @@ function EntityTypeList({
|
|
|
68
67
|
key: record.key || record.property,
|
|
69
68
|
record: record,
|
|
70
69
|
checked: !unselectedEntities.some(elt => elt.kind === record.kind && elt.name === record.name && elt.key === record.key && elt.property === record.property),
|
|
71
|
-
onChange: value => setUnselectedEntities(record, value)
|
|
72
|
-
closePanel: closePanel
|
|
70
|
+
onChange: value => setUnselectedEntities(record, value)
|
|
73
71
|
});
|
|
74
72
|
}));
|
|
75
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","count","EntityTypeList","list","unselectedEntities","setUnselectedEntities","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","count","EntityTypeList","list","unselectedEntities","setUnselectedEntities","length","firstRecord","entityConfig","select","coreStore","getEntityConfig","kind","name","entityLabel","label","description","map","record","key","property","some","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,KAAvC,EAA+C;AAC9C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,MAA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V;AAGC,MAAA,OAAO,EACN,CAAEd,kBAAkB,CAACiB,IAAnB,CACCC,GAAF,IACCA,GAAG,CAACV,IAAJ,KAAaM,MAAM,CAACN,IAApB,IACAU,GAAG,CAACT,IAAJ,KAAaK,MAAM,CAACL,IADpB,IAEAS,GAAG,CAACH,GAAJ,KAAYD,MAAM,CAACC,GAFnB,IAGAG,GAAG,CAACF,QAAJ,KAAiBF,MAAM,CAACE,QALxB,CAJJ;AAYC,MAAA,QAAQ,EAAKG,KAAF,IACVlB,qBAAqB,CAAEa,MAAF,EAAUK,KAAV;AAbvB,MADD;AAkBA,GAnBC,CAFH,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nfunction getEntityDescription( entity, count ) {\n\tswitch ( entity ) {\n\t\tcase 'site':\n\t\t\treturn 1 === count\n\t\t\t\t? __( 'This change will affect your whole site.' )\n\t\t\t\t: __( 'These changes will affect your whole site.' );\n\t\tcase 'wp_template':\n\t\t\treturn __(\n\t\t\t\t'This change will affect pages and posts that use this template.'\n\t\t\t);\n\t\tcase 'page':\n\t\tcase 'post':\n\t\t\treturn __( 'The following content has been modified.' );\n\t}\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n} ) {\n\tconst count = list.length;\n\tconst firstRecord = list[ 0 ];\n\tconst entityConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityConfig(\n\t\t\t\tfirstRecord.kind,\n\t\t\t\tfirstRecord.name\n\t\t\t),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\tconst { name } = firstRecord;\n\n\tlet entityLabel = entityConfig.label;\n\tif ( name === 'wp_template_part' ) {\n\t\tentityLabel =\n\t\t\t1 === count ? __( 'Template Part' ) : __( 'Template Parts' );\n\t}\n\t// Set description based on type of entity.\n\tconst description = getEntityDescription( name, count );\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen={ true }>\n\t\t\t{ description && <PanelRow>{ description }</PanelRow> }\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! unselectedEntities.some(\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\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</PanelBody>\n\t);\n}\n"]}
|
|
@@ -187,7 +187,6 @@ function EntitiesSavedStatesExtensible({
|
|
|
187
187
|
return (0, _element.createElement)(_entityTypeList.default, {
|
|
188
188
|
key: list[0].name,
|
|
189
189
|
list: list,
|
|
190
|
-
closePanel: dismissPanel,
|
|
191
190
|
unselectedEntities: unselectedEntities,
|
|
192
191
|
setUnselectedEntities: setUnselectedEntities
|
|
193
192
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"names":["PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","coreStore","__unstableMarkLastChangeAsPersistent","blockEditorStore","createSuccessNotice","createErrorNotice","removeNotice","noticesStore","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","catch","error","dismissPanel","saveDialogRef","saveDialogProps","onClose","Button","map","list"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,CAChC;AACCC,EAAAA,IAAI,EAAE,UADP;AAECC,EAAAA,IAAI,EAAE;AAFP,CADgC,CAAjC;;AAOA,SAASC,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,SAAOA,MAAP;AACA;;AAEc,SAASC,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAA0C;AACxD,QAAMC,YAAY,GAAG,6BAArB;AACA,SACC,4BAAC,6BAAD;AAA+B,IAAA,KAAK,EAAGD,KAAvC;AAAA,OAAoDC;AAApD,IADD;AAGA;;AAEM,SAASC,6BAAT,CAAwC;AAC9CC,EAAAA,gBAAgB,GAAGC,SAD2B;AAE9CJ,EAAAA,KAF8C;AAG9CK,EAAAA,MAAM,GAAGR,QAHqC;AAI9CS,EAAAA,WAAW,EAAEC,eAAe,GAAGH,SAJe;AAK9CI,EAAAA,SAAS,GAAG,cAAI,MAAJ,CALkC;AAO9CC,EAAAA,kBAP8C;AAQ9CC,EAAAA,OAR8C;AAS9CC,EAAAA,qBAT8C;AAU9CC,EAAAA;AAV8C,CAAxC,EAWH;AACH,QAAMC,aAAa,GAAG,sBAAtB;AACA,QAAM;AACLC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AAEP,WALd;AAMC,IAAA,OAAO,EAAGoC,mBANX;AAOC,IAAA,SAAS,EAAC;AAPX,KASGlC,SATH,CADD,EAYC,4BAAC,oBAAD;AACC,IAAA,OAAO,MADR;AAEC,IAAA,EAAE,EAAG2D,kBAFN;AAGC,IAAA,OAAO,EAAC,WAHT;AAIC,IAAA,OAAO,EAAGJ;AAJX,KAMG,cAAI,QAAJ,CANH,CAZD,CALD,EA2BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4CAAU,cAAI,wBAAJ,CAAV,CADD,EAEG5D,gBAFH,EAGGO,OAAO,IACR,uCACG,cACD,4EADC,CADH,CAJF,CA3BD,EAuCG2B,yBAAyB,CAAC+B,GAA1B,CAAiCC,IAAF,IAAY;AAC5C,WACC,4BAAC,uBAAD;AACC,MAAA,GAAG,EAAGA,IAAI,CAAE,CAAF,CAAJ,CAAUzE,IADjB;AAEC,MAAA,IAAI,EAAGyE,IAFR;AAGC,MAAA,UAAU,EAAGN,YAHd;AAIC,MAAA,kBAAkB,EAAGnD,kBAJtB;AAKC,MAAA,qBAAqB,EAAGD;AALzB,MADD;AASA,GAVC,CAvCH,CADD;AAqDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong>{ __( 'Are you ready to save?' ) }</strong>\n\t\t\t\t{ additionalPrompt }\n\t\t\t\t{ isDirty && (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'The following changes have been made to your site, templates, and content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tclosePanel={ dismissPanel }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"names":["PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","coreStore","__unstableMarkLastChangeAsPersistent","blockEditorStore","createSuccessNotice","createErrorNotice","removeNotice","noticesStore","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","catch","error","dismissPanel","saveDialogRef","saveDialogProps","onClose","Button","map","list"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAMA,wBAAwB,GAAG,CAChC;AACCC,EAAAA,IAAI,EAAE,UADP;AAECC,EAAAA,IAAI,EAAE;AAFP,CADgC,CAAjC;;AAOA,SAASC,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,SAAOA,MAAP;AACA;;AAEc,SAASC,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,E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button, Flex, FlexItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong>{ __( 'Are you ready to save?' ) }</strong>\n\t\t\t\t{ additionalPrompt }\n\t\t\t\t{ isDirty && (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'The following changes have been made to your site, templates, and content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = EditorKeyboardShortcuts;
|
|
7
7
|
|
|
8
8
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
9
9
|
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
|
|
12
|
-
var _blocks = require("@wordpress/blocks");
|
|
13
|
-
|
|
14
12
|
var _store = require("../../store");
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -20,18 +18,24 @@ var _store = require("../../store");
|
|
|
20
18
|
/**
|
|
21
19
|
* Internal dependencies
|
|
22
20
|
*/
|
|
23
|
-
function
|
|
24
|
-
resetBlocksOnSave
|
|
25
|
-
}) {
|
|
21
|
+
function EditorKeyboardShortcuts() {
|
|
26
22
|
const {
|
|
27
|
-
|
|
23
|
+
redo,
|
|
24
|
+
undo,
|
|
28
25
|
savePost
|
|
29
26
|
} = (0, _data.useDispatch)(_store.store);
|
|
30
27
|
const {
|
|
31
28
|
isEditedPostDirty,
|
|
32
|
-
getPostEdits,
|
|
33
29
|
isPostSavingLocked
|
|
34
30
|
} = (0, _data.useSelect)(_store.store);
|
|
31
|
+
(0, _keyboardShortcuts.useShortcut)('core/editor/undo', event => {
|
|
32
|
+
undo();
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
});
|
|
35
|
+
(0, _keyboardShortcuts.useShortcut)('core/editor/redo', event => {
|
|
36
|
+
redo();
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
});
|
|
35
39
|
(0, _keyboardShortcuts.useShortcut)('core/editor/save', event => {
|
|
36
40
|
event.preventDefault();
|
|
37
41
|
/**
|
|
@@ -49,26 +53,10 @@ function SaveShortcut({
|
|
|
49
53
|
|
|
50
54
|
if (!isEditedPostDirty()) {
|
|
51
55
|
return;
|
|
52
|
-
} // The text editor requires that editor blocks are updated for a
|
|
53
|
-
// save to work correctly. Usually this happens when the textarea
|
|
54
|
-
// for the code editors blurs, but the shortcut can be used without
|
|
55
|
-
// blurring the textarea.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (resetBlocksOnSave) {
|
|
59
|
-
const postEdits = getPostEdits();
|
|
60
|
-
|
|
61
|
-
if (postEdits.content && typeof postEdits.content === 'string') {
|
|
62
|
-
const blocks = (0, _blocks.parse)(postEdits.content);
|
|
63
|
-
resetEditorBlocks(blocks);
|
|
64
|
-
}
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
savePost();
|
|
68
59
|
});
|
|
69
60
|
return null;
|
|
70
61
|
}
|
|
71
|
-
|
|
72
|
-
var _default = SaveShortcut;
|
|
73
|
-
exports.default = _default;
|
|
74
|
-
//# sourceMappingURL=save-shortcut.js.map
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/index.js"],"names":["EditorKeyboardShortcuts","redo","undo","savePost","editorStore","isEditedPostDirty","isPostSavingLocked","event","preventDefault"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,SAASA,uBAAT,GAAmC;AACjD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAA2B,uBAAaC,YAAb,CAAjC;AACA,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MAA4C,qBAAWF,YAAX,CAAlD;AAEA,sCAAa,kBAAb,EAAmCG,KAAF,IAAa;AAC7CL,IAAAA,IAAI;AACJK,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,sCAAa,kBAAb,EAAmCD,KAAF,IAAa;AAC7CN,IAAAA,IAAI;AACJM,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,sCAAa,kBAAb,EAAmCD,KAAF,IAAa;AAC7CA,IAAAA,KAAK,CAACC,cAAN;AAEA;AACF;AACA;;AACE,QAAKF,kBAAkB,EAAvB,EAA4B;AAC3B;AACA,KAR4C,CAU7C;AACA;AACA;AACA;AACA;;;AACA,QAAK,CAAED,iBAAiB,EAAxB,EAA6B;AAC5B;AACA;;AAEDF,IAAAA,QAAQ;AACR,GApBD;AAsBA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function EditorKeyboardShortcuts() {\n\tconst { redo, undo, savePost } = useDispatch( editorStore );\n\tconst { isEditedPostDirty, isPostSavingLocked } = useSelect( editorStore );\n\n\tuseShortcut( 'core/editor/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/editor/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/editor/save', ( event ) => {\n\t\tevent.preventDefault();\n\n\t\t/**\n\t\t * Do not save the post if post saving is locked.\n\t\t */\n\t\tif ( isPostSavingLocked() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO: This should be handled in the `savePost` effect in\n\t\t// considering `isSaveable`. See note on `isEditedPostSaveable`\n\t\t// selector about dirtiness and meta-boxes.\n\t\t//\n\t\t// See: `isEditedPostSaveable`\n\t\tif ( ! isEditedPostDirty() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsavePost();\n\t} );\n\n\treturn null;\n}\n"]}
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
var _exportNames = {
|
|
9
|
+
VisualEditorGlobalKeyboardShortcuts: true,
|
|
10
|
+
TextEditorGlobalKeyboardShortcuts: true,
|
|
11
|
+
EditorKeyboardShortcuts: true,
|
|
9
12
|
AutosaveMonitor: true,
|
|
10
13
|
DocumentOutline: true,
|
|
11
14
|
DocumentOutlineCheck: true,
|
|
12
|
-
VisualEditorGlobalKeyboardShortcuts: true,
|
|
13
|
-
TextEditorGlobalKeyboardShortcuts: true,
|
|
14
15
|
EditorKeyboardShortcutsRegister: true,
|
|
15
16
|
EditorHistoryRedo: true,
|
|
16
17
|
EditorHistoryUndo: true,
|
|
@@ -54,6 +55,7 @@ var _exportNames = {
|
|
|
54
55
|
PostStickyCheck: true,
|
|
55
56
|
PostSwitchToDraftButton: true,
|
|
56
57
|
PostSyncStatus: true,
|
|
58
|
+
PostSyncStatusModal: true,
|
|
57
59
|
PostTaxonomies: true,
|
|
58
60
|
PostTaxonomiesFlatTermSelector: true,
|
|
59
61
|
PostTaxonomiesHierarchicalTermSelector: true,
|
|
@@ -115,6 +117,12 @@ Object.defineProperty(exports, "EditorHistoryUndo", {
|
|
|
115
117
|
return _undo.default;
|
|
116
118
|
}
|
|
117
119
|
});
|
|
120
|
+
Object.defineProperty(exports, "EditorKeyboardShortcuts", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _globalKeyboardShortcuts.default;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
118
126
|
Object.defineProperty(exports, "EditorKeyboardShortcutsRegister", {
|
|
119
127
|
enumerable: true,
|
|
120
128
|
get: function () {
|
|
@@ -355,6 +363,12 @@ Object.defineProperty(exports, "PostSyncStatus", {
|
|
|
355
363
|
return _postSyncStatus.default;
|
|
356
364
|
}
|
|
357
365
|
});
|
|
366
|
+
Object.defineProperty(exports, "PostSyncStatusModal", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return _postSyncStatus.PostSyncStatusModal;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
358
372
|
Object.defineProperty(exports, "PostTaxonomies", {
|
|
359
373
|
enumerable: true,
|
|
360
374
|
get: function () {
|
|
@@ -451,12 +465,7 @@ Object.defineProperty(exports, "TableOfContents", {
|
|
|
451
465
|
return _tableOfContents.default;
|
|
452
466
|
}
|
|
453
467
|
});
|
|
454
|
-
|
|
455
|
-
enumerable: true,
|
|
456
|
-
get: function () {
|
|
457
|
-
return _textEditorShortcuts.default;
|
|
458
|
-
}
|
|
459
|
-
});
|
|
468
|
+
exports.TextEditorGlobalKeyboardShortcuts = void 0;
|
|
460
469
|
Object.defineProperty(exports, "ThemeSupportCheck", {
|
|
461
470
|
enumerable: true,
|
|
462
471
|
get: function () {
|
|
@@ -475,12 +484,7 @@ Object.defineProperty(exports, "UnsavedChangesWarning", {
|
|
|
475
484
|
return _unsavedChangesWarning.default;
|
|
476
485
|
}
|
|
477
486
|
});
|
|
478
|
-
|
|
479
|
-
enumerable: true,
|
|
480
|
-
get: function () {
|
|
481
|
-
return _visualEditorShortcuts.default;
|
|
482
|
-
}
|
|
483
|
-
});
|
|
487
|
+
exports.VisualEditorGlobalKeyboardShortcuts = void 0;
|
|
484
488
|
Object.defineProperty(exports, "WordCount", {
|
|
485
489
|
enumerable: true,
|
|
486
490
|
get: function () {
|
|
@@ -512,6 +516,8 @@ Object.defineProperty(exports, "usePostVisibilityLabel", {
|
|
|
512
516
|
}
|
|
513
517
|
});
|
|
514
518
|
|
|
519
|
+
var _globalKeyboardShortcuts = _interopRequireDefault(require("./global-keyboard-shortcuts"));
|
|
520
|
+
|
|
515
521
|
var _autocompleters = require("./autocompleters");
|
|
516
522
|
|
|
517
523
|
Object.keys(_autocompleters).forEach(function (key) {
|
|
@@ -532,10 +538,6 @@ var _documentOutline = _interopRequireDefault(require("./document-outline"));
|
|
|
532
538
|
|
|
533
539
|
var _check = _interopRequireDefault(require("./document-outline/check"));
|
|
534
540
|
|
|
535
|
-
var _visualEditorShortcuts = _interopRequireDefault(require("./global-keyboard-shortcuts/visual-editor-shortcuts"));
|
|
536
|
-
|
|
537
|
-
var _textEditorShortcuts = _interopRequireDefault(require("./global-keyboard-shortcuts/text-editor-shortcuts"));
|
|
538
|
-
|
|
539
541
|
var _registerShortcuts = _interopRequireDefault(require("./global-keyboard-shortcuts/register-shortcuts"));
|
|
540
542
|
|
|
541
543
|
var _redo = _interopRequireDefault(require("./editor-history/redo"));
|
|
@@ -618,7 +620,7 @@ var _check11 = _interopRequireDefault(require("./post-sticky/check"));
|
|
|
618
620
|
|
|
619
621
|
var _postSwitchToDraftButton = _interopRequireDefault(require("./post-switch-to-draft-button"));
|
|
620
622
|
|
|
621
|
-
var _postSyncStatus =
|
|
623
|
+
var _postSyncStatus = _interopRequireWildcard(require("./post-sync-status"));
|
|
622
624
|
|
|
623
625
|
var _postTaxonomies = _interopRequireDefault(require("./post-taxonomies"));
|
|
624
626
|
|
|
@@ -681,4 +683,15 @@ Object.keys(_deprecated).forEach(function (key) {
|
|
|
681
683
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
682
684
|
|
|
683
685
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Internal dependencies
|
|
689
|
+
*/
|
|
690
|
+
// Block Creation Components.
|
|
691
|
+
// Post Related Components.
|
|
692
|
+
// State Related Components.
|
|
693
|
+
const VisualEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
694
|
+
exports.VisualEditorGlobalKeyboardShortcuts = VisualEditorGlobalKeyboardShortcuts;
|
|
695
|
+
const TextEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
696
|
+
exports.TextEditorGlobalKeyboardShortcuts = TextEditorGlobalKeyboardShortcuts;
|
|
684
697
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":["VisualEditorGlobalKeyboardShortcuts","EditorKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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CAA5C;;AACA,MAAMC,iCAAiC,GAAGD,gCAA1C","sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostComments } from './post-comments';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport {\n\tdefault as PostSyncStatus,\n\tPostSyncStatusModal,\n} from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"]}
|