@wordpress/editor 13.14.0 → 13.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/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-comments/index.js +12 -15
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/index.js +9 -20
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +12 -15
- package/build/components/post-pingbacks/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/components/post-type-support-check/index.js +10 -14
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +1 -24
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/store/actions.js +37 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +55 -63
- 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-comments/index.js +13 -14
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +10 -19
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +13 -14
- package/build-module/components/post-pingbacks/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/components/post-type-support-check/index.js +11 -14
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -24
- package/build-module/hooks/custom-sources-backwards-compatibility.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 +48 -57
- 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-author/test/check.js +18 -12
- package/src/components/post-comments/index.js +11 -17
- package/src/components/post-excerpt/index.js +10 -16
- package/src/components/post-pingbacks/index.js +11 -15
- 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/components/post-type-support-check/index.js +8 -10
- package/src/components/post-type-support-check/test/index.js +35 -19
- package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
- package/src/store/actions.js +34 -2
- package/src/store/selectors.js +47 -43
- package/src/store/test/selectors.js +49 -38
- 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
|
@@ -75,10 +75,6 @@ selectorNames.forEach( ( name ) => {
|
|
|
75
75
|
};
|
|
76
76
|
},
|
|
77
77
|
|
|
78
|
-
isSavingEntityRecord() {
|
|
79
|
-
return state.saving && state.saving.requesting;
|
|
80
|
-
},
|
|
81
|
-
|
|
82
78
|
getLastEntitySaveError() {
|
|
83
79
|
const saving = state.saving;
|
|
84
80
|
const successful = saving && saving.successful;
|
|
@@ -264,7 +260,7 @@ describe( 'selectors', () => {
|
|
|
264
260
|
parent: [ 'core/test-block-b' ],
|
|
265
261
|
} );
|
|
266
262
|
|
|
267
|
-
registerBlockType( 'core/
|
|
263
|
+
registerBlockType( 'core/freeform', {
|
|
268
264
|
save: ( props ) => <RawHTML>{ props.attributes.content }</RawHTML>,
|
|
269
265
|
category: 'text',
|
|
270
266
|
title: 'Test Freeform Content Handler',
|
|
@@ -291,7 +287,7 @@ describe( 'selectors', () => {
|
|
|
291
287
|
save: () => null,
|
|
292
288
|
} );
|
|
293
289
|
|
|
294
|
-
setFreeformContentHandlerName( 'core/
|
|
290
|
+
setFreeformContentHandlerName( 'core/freeform' );
|
|
295
291
|
setDefaultBlockName( 'core/test-default' );
|
|
296
292
|
|
|
297
293
|
cachedSelectors.forEach( ( { clear } ) => clear() );
|
|
@@ -302,7 +298,7 @@ describe( 'selectors', () => {
|
|
|
302
298
|
unregisterBlockType( 'core/test-block-a' );
|
|
303
299
|
unregisterBlockType( 'core/test-block-b' );
|
|
304
300
|
unregisterBlockType( 'core/test-block-c' );
|
|
305
|
-
unregisterBlockType( 'core/
|
|
301
|
+
unregisterBlockType( 'core/freeform' );
|
|
306
302
|
unregisterBlockType( 'core/test-default' );
|
|
307
303
|
|
|
308
304
|
setFreeformContentHandlerName( undefined );
|
|
@@ -1254,7 +1250,7 @@ describe( 'selectors', () => {
|
|
|
1254
1250
|
title: 'sassel',
|
|
1255
1251
|
},
|
|
1256
1252
|
saving: {
|
|
1257
|
-
|
|
1253
|
+
pending: true,
|
|
1258
1254
|
},
|
|
1259
1255
|
};
|
|
1260
1256
|
|
|
@@ -1320,7 +1316,9 @@ describe( 'selectors', () => {
|
|
|
1320
1316
|
},
|
|
1321
1317
|
],
|
|
1322
1318
|
},
|
|
1323
|
-
edits: {
|
|
1319
|
+
edits: {
|
|
1320
|
+
content: () => {},
|
|
1321
|
+
},
|
|
1324
1322
|
},
|
|
1325
1323
|
},
|
|
1326
1324
|
initialEdits: {},
|
|
@@ -1339,7 +1337,7 @@ describe( 'selectors', () => {
|
|
|
1339
1337
|
value: [
|
|
1340
1338
|
{
|
|
1341
1339
|
clientId: 123,
|
|
1342
|
-
name: 'core/
|
|
1340
|
+
name: 'core/freeform',
|
|
1343
1341
|
isValid: true,
|
|
1344
1342
|
attributes: {
|
|
1345
1343
|
content: '',
|
|
@@ -1366,7 +1364,7 @@ describe( 'selectors', () => {
|
|
|
1366
1364
|
value: [
|
|
1367
1365
|
{
|
|
1368
1366
|
clientId: 123,
|
|
1369
|
-
name: 'core/
|
|
1367
|
+
name: 'core/freeform',
|
|
1370
1368
|
isValid: true,
|
|
1371
1369
|
attributes: {
|
|
1372
1370
|
content: '',
|
|
@@ -1403,9 +1401,8 @@ describe( 'selectors', () => {
|
|
|
1403
1401
|
currentPost: {
|
|
1404
1402
|
title: 'sassel',
|
|
1405
1403
|
},
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
},
|
|
1404
|
+
postAutosavingLock: {},
|
|
1405
|
+
saving: {},
|
|
1409
1406
|
getCurrentUser() {},
|
|
1410
1407
|
hasFetchedAutosaves() {
|
|
1411
1408
|
return false;
|
|
@@ -1434,9 +1431,8 @@ describe( 'selectors', () => {
|
|
|
1434
1431
|
currentPost: {
|
|
1435
1432
|
title: 'sassel',
|
|
1436
1433
|
},
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
},
|
|
1434
|
+
postAutosavingLock: {},
|
|
1435
|
+
saving: {},
|
|
1440
1436
|
getCurrentUser() {},
|
|
1441
1437
|
hasFetchedAutosaves() {
|
|
1442
1438
|
return true;
|
|
@@ -1597,14 +1593,13 @@ describe( 'selectors', () => {
|
|
|
1597
1593
|
const state = {
|
|
1598
1594
|
editor: {
|
|
1599
1595
|
present: {
|
|
1600
|
-
blocks: {
|
|
1601
|
-
value: [],
|
|
1602
|
-
},
|
|
1603
1596
|
edits: {},
|
|
1604
1597
|
},
|
|
1605
1598
|
},
|
|
1606
1599
|
initialEdits: {},
|
|
1607
|
-
currentPost: {
|
|
1600
|
+
currentPost: {
|
|
1601
|
+
content: '',
|
|
1602
|
+
},
|
|
1608
1603
|
};
|
|
1609
1604
|
|
|
1610
1605
|
expect( isEditedPostEmpty( state ) ).toBe( true );
|
|
@@ -1626,7 +1621,9 @@ describe( 'selectors', () => {
|
|
|
1626
1621
|
},
|
|
1627
1622
|
],
|
|
1628
1623
|
},
|
|
1629
|
-
edits: {
|
|
1624
|
+
edits: {
|
|
1625
|
+
content: () => {},
|
|
1626
|
+
},
|
|
1630
1627
|
},
|
|
1631
1628
|
},
|
|
1632
1629
|
initialEdits: {},
|
|
@@ -1656,7 +1653,9 @@ describe( 'selectors', () => {
|
|
|
1656
1653
|
},
|
|
1657
1654
|
],
|
|
1658
1655
|
},
|
|
1659
|
-
edits: {
|
|
1656
|
+
edits: {
|
|
1657
|
+
content: () => {},
|
|
1658
|
+
},
|
|
1660
1659
|
},
|
|
1661
1660
|
},
|
|
1662
1661
|
initialEdits: {},
|
|
@@ -1666,7 +1665,7 @@ describe( 'selectors', () => {
|
|
|
1666
1665
|
expect( isEditedPostEmpty( state ) ).toBe( true );
|
|
1667
1666
|
} );
|
|
1668
1667
|
|
|
1669
|
-
it( 'should return
|
|
1668
|
+
it( 'should return true if blocks, but empty content edit', () => {
|
|
1670
1669
|
const state = {
|
|
1671
1670
|
editor: {
|
|
1672
1671
|
present: {
|
|
@@ -1693,7 +1692,7 @@ describe( 'selectors', () => {
|
|
|
1693
1692
|
},
|
|
1694
1693
|
};
|
|
1695
1694
|
|
|
1696
|
-
expect( isEditedPostEmpty( state ) ).toBe(
|
|
1695
|
+
expect( isEditedPostEmpty( state ) ).toBe( true );
|
|
1697
1696
|
} );
|
|
1698
1697
|
|
|
1699
1698
|
it( 'should return true if the post has an empty content property', () => {
|
|
@@ -1715,7 +1714,7 @@ describe( 'selectors', () => {
|
|
|
1715
1714
|
expect( isEditedPostEmpty( state ) ).toBe( true );
|
|
1716
1715
|
} );
|
|
1717
1716
|
|
|
1718
|
-
it( 'should return
|
|
1717
|
+
it( 'should return false if edits include a non-empty content property', () => {
|
|
1719
1718
|
const state = {
|
|
1720
1719
|
editor: {
|
|
1721
1720
|
present: {
|
|
@@ -1731,7 +1730,7 @@ describe( 'selectors', () => {
|
|
|
1731
1730
|
currentPost: {},
|
|
1732
1731
|
};
|
|
1733
1732
|
|
|
1734
|
-
expect( isEditedPostEmpty( state ) ).toBe(
|
|
1733
|
+
expect( isEditedPostEmpty( state ) ).toBe( false );
|
|
1735
1734
|
} );
|
|
1736
1735
|
|
|
1737
1736
|
it( 'should return true if empty classic block', () => {
|
|
@@ -1742,7 +1741,7 @@ describe( 'selectors', () => {
|
|
|
1742
1741
|
value: [
|
|
1743
1742
|
{
|
|
1744
1743
|
clientId: 123,
|
|
1745
|
-
name: 'core/
|
|
1744
|
+
name: 'core/freeform',
|
|
1746
1745
|
isValid: true,
|
|
1747
1746
|
attributes: {
|
|
1748
1747
|
content: '',
|
|
@@ -1750,7 +1749,9 @@ describe( 'selectors', () => {
|
|
|
1750
1749
|
},
|
|
1751
1750
|
],
|
|
1752
1751
|
},
|
|
1753
|
-
edits: {
|
|
1752
|
+
edits: {
|
|
1753
|
+
content: () => {},
|
|
1754
|
+
},
|
|
1754
1755
|
},
|
|
1755
1756
|
},
|
|
1756
1757
|
initialEdits: {},
|
|
@@ -1768,7 +1769,7 @@ describe( 'selectors', () => {
|
|
|
1768
1769
|
value: [
|
|
1769
1770
|
{
|
|
1770
1771
|
clientId: 123,
|
|
1771
|
-
name: 'core/
|
|
1772
|
+
name: 'core/freeform',
|
|
1772
1773
|
isValid: true,
|
|
1773
1774
|
attributes: {
|
|
1774
1775
|
content: '',
|
|
@@ -1796,7 +1797,7 @@ describe( 'selectors', () => {
|
|
|
1796
1797
|
value: [
|
|
1797
1798
|
{
|
|
1798
1799
|
clientId: 123,
|
|
1799
|
-
name: 'core/
|
|
1800
|
+
name: 'core/freeform',
|
|
1800
1801
|
isValid: true,
|
|
1801
1802
|
attributes: {
|
|
1802
1803
|
content: 'Test Data',
|
|
@@ -1824,7 +1825,7 @@ describe( 'selectors', () => {
|
|
|
1824
1825
|
value: [
|
|
1825
1826
|
{
|
|
1826
1827
|
clientId: 123,
|
|
1827
|
-
name: 'core/
|
|
1828
|
+
name: 'core/freeform',
|
|
1828
1829
|
isValid: true,
|
|
1829
1830
|
attributes: {
|
|
1830
1831
|
content: '',
|
|
@@ -1832,7 +1833,7 @@ describe( 'selectors', () => {
|
|
|
1832
1833
|
},
|
|
1833
1834
|
{
|
|
1834
1835
|
clientId: 456,
|
|
1835
|
-
name: 'core/
|
|
1836
|
+
name: 'core/freeform',
|
|
1836
1837
|
isValid: true,
|
|
1837
1838
|
attributes: {
|
|
1838
1839
|
content: '',
|
|
@@ -2017,7 +2018,7 @@ describe( 'selectors', () => {
|
|
|
2017
2018
|
it( 'should return true if the post is currently being saved', () => {
|
|
2018
2019
|
const state = {
|
|
2019
2020
|
saving: {
|
|
2020
|
-
|
|
2021
|
+
pending: true,
|
|
2021
2022
|
},
|
|
2022
2023
|
};
|
|
2023
2024
|
|
|
@@ -2027,7 +2028,7 @@ describe( 'selectors', () => {
|
|
|
2027
2028
|
it( 'should return false if the post is not currently being saved', () => {
|
|
2028
2029
|
const state = {
|
|
2029
2030
|
saving: {
|
|
2030
|
-
|
|
2031
|
+
pending: false,
|
|
2031
2032
|
},
|
|
2032
2033
|
};
|
|
2033
2034
|
|
|
@@ -2156,6 +2157,7 @@ describe( 'selectors', () => {
|
|
|
2156
2157
|
attributes: {
|
|
2157
2158
|
providerNameSlug: 'instagram',
|
|
2158
2159
|
},
|
|
2160
|
+
innerBlocks: [],
|
|
2159
2161
|
},
|
|
2160
2162
|
],
|
|
2161
2163
|
},
|
|
@@ -2178,6 +2180,7 @@ describe( 'selectors', () => {
|
|
|
2178
2180
|
clientId: 567,
|
|
2179
2181
|
name: 'core/embed',
|
|
2180
2182
|
attributes: {},
|
|
2183
|
+
innerBlocks: [],
|
|
2181
2184
|
},
|
|
2182
2185
|
],
|
|
2183
2186
|
},
|
|
@@ -2200,11 +2203,13 @@ describe( 'selectors', () => {
|
|
|
2200
2203
|
clientId: 123,
|
|
2201
2204
|
name: 'core/image',
|
|
2202
2205
|
attributes: {},
|
|
2206
|
+
innerBlocks: [],
|
|
2203
2207
|
},
|
|
2204
2208
|
{
|
|
2205
2209
|
clientId: 456,
|
|
2206
2210
|
name: 'core/quote',
|
|
2207
2211
|
attributes: {},
|
|
2212
|
+
innerBlocks: [],
|
|
2208
2213
|
},
|
|
2209
2214
|
],
|
|
2210
2215
|
},
|
|
@@ -2228,6 +2233,7 @@ describe( 'selectors', () => {
|
|
|
2228
2233
|
clientId: 123,
|
|
2229
2234
|
name: 'core/image',
|
|
2230
2235
|
attributes: {},
|
|
2236
|
+
innerBlocks: [],
|
|
2231
2237
|
},
|
|
2232
2238
|
],
|
|
2233
2239
|
},
|
|
@@ -2251,6 +2257,7 @@ describe( 'selectors', () => {
|
|
|
2251
2257
|
clientId: 456,
|
|
2252
2258
|
name: 'core/quote',
|
|
2253
2259
|
attributes: {},
|
|
2260
|
+
innerBlocks: [],
|
|
2254
2261
|
},
|
|
2255
2262
|
],
|
|
2256
2263
|
},
|
|
@@ -2276,6 +2283,7 @@ describe( 'selectors', () => {
|
|
|
2276
2283
|
attributes: {
|
|
2277
2284
|
providerNameSlug: 'youtube',
|
|
2278
2285
|
},
|
|
2286
|
+
innerBlocks: [],
|
|
2279
2287
|
},
|
|
2280
2288
|
],
|
|
2281
2289
|
},
|
|
@@ -2301,6 +2309,7 @@ describe( 'selectors', () => {
|
|
|
2301
2309
|
attributes: {
|
|
2302
2310
|
providerNameSlug: 'soundcloud',
|
|
2303
2311
|
},
|
|
2312
|
+
innerBlocks: [],
|
|
2304
2313
|
},
|
|
2305
2314
|
],
|
|
2306
2315
|
},
|
|
@@ -2324,11 +2333,13 @@ describe( 'selectors', () => {
|
|
|
2324
2333
|
clientId: 456,
|
|
2325
2334
|
name: 'core/quote',
|
|
2326
2335
|
attributes: {},
|
|
2336
|
+
innerBlocks: [],
|
|
2327
2337
|
},
|
|
2328
2338
|
{
|
|
2329
2339
|
clientId: 789,
|
|
2330
2340
|
name: 'core/paragraph',
|
|
2331
2341
|
attributes: {},
|
|
2342
|
+
innerBlocks: [],
|
|
2332
2343
|
},
|
|
2333
2344
|
],
|
|
2334
2345
|
},
|
|
@@ -2415,7 +2426,7 @@ describe( 'selectors', () => {
|
|
|
2415
2426
|
} );
|
|
2416
2427
|
|
|
2417
2428
|
it( "returns removep'd serialization of blocks for single unknown", () => {
|
|
2418
|
-
const unknownBlock = createBlock( 'core/
|
|
2429
|
+
const unknownBlock = createBlock( 'core/freeform', {
|
|
2419
2430
|
content: '<p>foo</p>',
|
|
2420
2431
|
} );
|
|
2421
2432
|
const state = {
|
|
@@ -2437,10 +2448,10 @@ describe( 'selectors', () => {
|
|
|
2437
2448
|
} );
|
|
2438
2449
|
|
|
2439
2450
|
it( "returns non-removep'd serialization of blocks for multiple unknown", () => {
|
|
2440
|
-
const firstUnknown = createBlock( 'core/
|
|
2451
|
+
const firstUnknown = createBlock( 'core/freeform', {
|
|
2441
2452
|
content: '<p>foo</p>',
|
|
2442
2453
|
} );
|
|
2443
|
-
const secondUnknown = createBlock( 'core/
|
|
2454
|
+
const secondUnknown = createBlock( 'core/freeform', {
|
|
2444
2455
|
content: '<p>bar</p>',
|
|
2445
2456
|
} );
|
|
2446
2457
|
const state = {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/save-shortcut.js"],"names":["SaveShortcut","resetBlocksOnSave","resetEditorBlocks","savePost","editorStore","isEditedPostDirty","getPostEdits","isPostSavingLocked","event","preventDefault","postEdits","content","blocks"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAA+C;AAC9C,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MAAkC,uBAAaC,YAAb,CAAxC;AACA,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA,YAArB;AAAmCC,IAAAA;AAAnC,MACL,qBAAWH,YAAX,CADD;AAGA,sCAAa,kBAAb,EAAmCI,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,CAAEF,iBAAiB,EAAxB,EAA6B;AAC5B;AACA,KAjB4C,CAmB7C;AACA;AACA;AACA;;;AACA,QAAKJ,iBAAL,EAAyB;AACxB,YAAMS,SAAS,GAAGJ,YAAY,EAA9B;;AACA,UAAKI,SAAS,CAACC,OAAV,IAAqB,OAAOD,SAAS,CAACC,OAAjB,KAA6B,QAAvD,EAAkE;AACjE,cAAMC,MAAM,GAAG,mBAAOF,SAAS,CAACC,OAAjB,CAAf;AACAT,QAAAA,iBAAiB,CAAEU,MAAF,CAAjB;AACA;AACD;;AAEDT,IAAAA,QAAQ;AACR,GAhCD;AAkCA,SAAO,IAAP;AACA;;eAEcH,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction SaveShortcut( { resetBlocksOnSave } ) {\n\tconst { resetEditorBlocks, savePost } = useDispatch( editorStore );\n\tconst { isEditedPostDirty, getPostEdits, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\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\t// The text editor requires that editor blocks are updated for a\n\t\t// save to work correctly. Usually this happens when the textarea\n\t\t// for the code editors blurs, but the shortcut can be used without\n\t\t// blurring the textarea.\n\t\tif ( resetBlocksOnSave ) {\n\t\t\tconst postEdits = getPostEdits();\n\t\t\tif ( postEdits.content && typeof postEdits.content === 'string' ) {\n\t\t\t\tconst blocks = parse( postEdits.content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t}\n\t\t}\n\n\t\tsavePost();\n\t} );\n\n\treturn null;\n}\n\nexport default SaveShortcut;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = TextEditorGlobalKeyboardShortcuts;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _saveShortcut = _interopRequireDefault(require("./save-shortcut"));
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
function TextEditorGlobalKeyboardShortcuts() {
|
|
18
|
-
return (0, _element.createElement)(_saveShortcut.default, {
|
|
19
|
-
resetBlocksOnSave: true
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=text-editor-shortcuts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/text-editor-shortcuts.js"],"names":["TextEditorGlobalKeyboardShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,iCAAT,GAA6C;AAC3D,SAAO,4BAAC,qBAAD;AAAc,IAAA,iBAAiB;AAA/B,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport SaveShortcut from './save-shortcut';\n\nexport default function TextEditorGlobalKeyboardShortcuts() {\n\treturn <SaveShortcut resetBlocksOnSave />;\n}\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
13
|
-
|
|
14
|
-
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
|
-
var _saveShortcut = _interopRequireDefault(require("./save-shortcut"));
|
|
17
|
-
|
|
18
|
-
var _store = require("../../store");
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
function VisualEditorGlobalKeyboardShortcuts() {
|
|
28
|
-
const {
|
|
29
|
-
redo,
|
|
30
|
-
undo
|
|
31
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
32
|
-
(0, _keyboardShortcuts.useShortcut)('core/editor/undo', event => {
|
|
33
|
-
undo();
|
|
34
|
-
event.preventDefault();
|
|
35
|
-
});
|
|
36
|
-
(0, _keyboardShortcuts.useShortcut)('core/editor/redo', event => {
|
|
37
|
-
redo();
|
|
38
|
-
event.preventDefault();
|
|
39
|
-
});
|
|
40
|
-
return (0, _element.createElement)(_saveShortcut.default, null);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var _default = VisualEditorGlobalKeyboardShortcuts;
|
|
44
|
-
exports.default = _default;
|
|
45
|
-
//# sourceMappingURL=visual-editor-shortcuts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js"],"names":["VisualEditorGlobalKeyboardShortcuts","redo","undo","editorStore","event","preventDefault"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,mCAAT,GAA+C;AAC9C,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiB,uBAAaC,YAAb,CAAvB;AAEA,sCAAa,kBAAb,EAAmCC,KAAF,IAAa;AAC7CF,IAAAA,IAAI;AACJE,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,sCAAa,kBAAb,EAAmCD,KAAF,IAAa;AAC7CH,IAAAA,IAAI;AACJG,IAAAA,KAAK,CAACC,cAAN;AACA,GAHD;AAKA,SAAO,4BAAC,qBAAD,OAAP;AACA;;eAEcL,mC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SaveShortcut from './save-shortcut';\nimport { store as editorStore } from '../../store';\n\nfunction VisualEditorGlobalKeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( 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\treturn <SaveShortcut />;\n}\n\nexport default VisualEditorGlobalKeyboardShortcuts;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/save-shortcut.js"],"names":["useShortcut","useDispatch","useSelect","parse","store","editorStore","SaveShortcut","resetBlocksOnSave","resetEditorBlocks","savePost","isEditedPostDirty","getPostEdits","isPostSavingLocked","event","preventDefault","postEdits","content","blocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,+BAA5B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAT,QAAsB,mBAAtB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAA+C;AAC9C,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MAAkCR,WAAW,CAAEI,WAAF,CAAnD;AACA,QAAM;AAAEK,IAAAA,iBAAF;AAAqBC,IAAAA,YAArB;AAAmCC,IAAAA;AAAnC,MACLV,SAAS,CAAEG,WAAF,CADV;AAGAL,EAAAA,WAAW,CAAE,kBAAF,EAAwBa,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,CAAEF,iBAAiB,EAAxB,EAA6B;AAC5B;AACA,KAjB4C,CAmB7C;AACA;AACA;AACA;;;AACA,QAAKH,iBAAL,EAAyB;AACxB,YAAMQ,SAAS,GAAGJ,YAAY,EAA9B;;AACA,UAAKI,SAAS,CAACC,OAAV,IAAqB,OAAOD,SAAS,CAACC,OAAjB,KAA6B,QAAvD,EAAkE;AACjE,cAAMC,MAAM,GAAGd,KAAK,CAAEY,SAAS,CAACC,OAAZ,CAApB;AACAR,QAAAA,iBAAiB,CAAES,MAAF,CAAjB;AACA;AACD;;AAEDR,IAAAA,QAAQ;AACR,GAhCU,CAAX;AAkCA,SAAO,IAAP;AACA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction SaveShortcut( { resetBlocksOnSave } ) {\n\tconst { resetEditorBlocks, savePost } = useDispatch( editorStore );\n\tconst { isEditedPostDirty, getPostEdits, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\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\t// The text editor requires that editor blocks are updated for a\n\t\t// save to work correctly. Usually this happens when the textarea\n\t\t// for the code editors blurs, but the shortcut can be used without\n\t\t// blurring the textarea.\n\t\tif ( resetBlocksOnSave ) {\n\t\t\tconst postEdits = getPostEdits();\n\t\t\tif ( postEdits.content && typeof postEdits.content === 'string' ) {\n\t\t\t\tconst blocks = parse( postEdits.content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t}\n\t\t}\n\n\t\tsavePost();\n\t} );\n\n\treturn null;\n}\n\nexport default SaveShortcut;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Internal dependencies
|
|
5
|
-
*/
|
|
6
|
-
import SaveShortcut from './save-shortcut';
|
|
7
|
-
export default function TextEditorGlobalKeyboardShortcuts() {
|
|
8
|
-
return createElement(SaveShortcut, {
|
|
9
|
-
resetBlocksOnSave: true
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=text-editor-shortcuts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/text-editor-shortcuts.js"],"names":["SaveShortcut","TextEditorGlobalKeyboardShortcuts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,YAAP,MAAyB,iBAAzB;AAEA,eAAe,SAASC,iCAAT,GAA6C;AAC3D,SAAO,cAAC,YAAD;AAAc,IAAA,iBAAiB;AAA/B,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport SaveShortcut from './save-shortcut';\n\nexport default function TextEditorGlobalKeyboardShortcuts() {\n\treturn <SaveShortcut resetBlocksOnSave />;\n}\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
7
|
-
import { useDispatch } from '@wordpress/data';
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import SaveShortcut from './save-shortcut';
|
|
13
|
-
import { store as editorStore } from '../../store';
|
|
14
|
-
|
|
15
|
-
function VisualEditorGlobalKeyboardShortcuts() {
|
|
16
|
-
const {
|
|
17
|
-
redo,
|
|
18
|
-
undo
|
|
19
|
-
} = useDispatch(editorStore);
|
|
20
|
-
useShortcut('core/editor/undo', event => {
|
|
21
|
-
undo();
|
|
22
|
-
event.preventDefault();
|
|
23
|
-
});
|
|
24
|
-
useShortcut('core/editor/redo', event => {
|
|
25
|
-
redo();
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
});
|
|
28
|
-
return createElement(SaveShortcut, null);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default VisualEditorGlobalKeyboardShortcuts;
|
|
32
|
-
//# sourceMappingURL=visual-editor-shortcuts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js"],"names":["useShortcut","useDispatch","SaveShortcut","store","editorStore","VisualEditorGlobalKeyboardShortcuts","redo","undo","event","preventDefault"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,+BAA5B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,mCAAT,GAA+C;AAC9C,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiBN,WAAW,CAAEG,WAAF,CAAlC;AAEAJ,EAAAA,WAAW,CAAE,kBAAF,EAAwBQ,KAAF,IAAa;AAC7CD,IAAAA,IAAI;AACJC,IAAAA,KAAK,CAACC,cAAN;AACA,GAHU,CAAX;AAKAT,EAAAA,WAAW,CAAE,kBAAF,EAAwBQ,KAAF,IAAa;AAC7CF,IAAAA,IAAI;AACJE,IAAAA,KAAK,CAACC,cAAN;AACA,GAHU,CAAX;AAKA,SAAO,cAAC,YAAD,OAAP;AACA;;AAED,eAAeJ,mCAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SaveShortcut from './save-shortcut';\nimport { store as editorStore } from '../../store';\n\nfunction VisualEditorGlobalKeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( 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\treturn <SaveShortcut />;\n}\n\nexport default VisualEditorGlobalKeyboardShortcuts;\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
-
import { parse } from '@wordpress/blocks';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { store as editorStore } from '../../store';
|
|
12
|
-
|
|
13
|
-
function SaveShortcut( { resetBlocksOnSave } ) {
|
|
14
|
-
const { resetEditorBlocks, savePost } = useDispatch( editorStore );
|
|
15
|
-
const { isEditedPostDirty, getPostEdits, isPostSavingLocked } =
|
|
16
|
-
useSelect( editorStore );
|
|
17
|
-
|
|
18
|
-
useShortcut( 'core/editor/save', ( event ) => {
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Do not save the post if post saving is locked.
|
|
23
|
-
*/
|
|
24
|
-
if ( isPostSavingLocked() ) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// TODO: This should be handled in the `savePost` effect in
|
|
29
|
-
// considering `isSaveable`. See note on `isEditedPostSaveable`
|
|
30
|
-
// selector about dirtiness and meta-boxes.
|
|
31
|
-
//
|
|
32
|
-
// See: `isEditedPostSaveable`
|
|
33
|
-
if ( ! isEditedPostDirty() ) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// The text editor requires that editor blocks are updated for a
|
|
38
|
-
// save to work correctly. Usually this happens when the textarea
|
|
39
|
-
// for the code editors blurs, but the shortcut can be used without
|
|
40
|
-
// blurring the textarea.
|
|
41
|
-
if ( resetBlocksOnSave ) {
|
|
42
|
-
const postEdits = getPostEdits();
|
|
43
|
-
if ( postEdits.content && typeof postEdits.content === 'string' ) {
|
|
44
|
-
const blocks = parse( postEdits.content );
|
|
45
|
-
resetEditorBlocks( blocks );
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
savePost();
|
|
50
|
-
} );
|
|
51
|
-
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default SaveShortcut;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import SaveShortcut from './save-shortcut';
|
|
11
|
-
import { store as editorStore } from '../../store';
|
|
12
|
-
|
|
13
|
-
function VisualEditorGlobalKeyboardShortcuts() {
|
|
14
|
-
const { redo, undo } = useDispatch( editorStore );
|
|
15
|
-
|
|
16
|
-
useShortcut( 'core/editor/undo', ( event ) => {
|
|
17
|
-
undo();
|
|
18
|
-
event.preventDefault();
|
|
19
|
-
} );
|
|
20
|
-
|
|
21
|
-
useShortcut( 'core/editor/redo', ( event ) => {
|
|
22
|
-
redo();
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
} );
|
|
25
|
-
|
|
26
|
-
return <SaveShortcut />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default VisualEditorGlobalKeyboardShortcuts;
|