@wordpress/block-editor 8.5.0 → 8.5.3
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/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-content-overlay/index.js +13 -4
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-lock/index.js +8 -0
- package/build/components/block-lock/index.js.map +1 -1
- package/build/components/block-lock/menu-item.js +5 -20
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +33 -12
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +7 -20
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +50 -0
- package/build/components/block-lock/use-block-lock.js.map +1 -0
- package/build/components/block-pattern-setup/index.js +37 -22
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-preview/auto.js +6 -3
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +4 -2
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-switcher/index.js +7 -2
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/copy-handler/index.js +44 -9
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/link-control/index.js +6 -7
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -10
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +13 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +7 -1
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/hooks/duotone.js +66 -16
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +7 -1
- package/build/hooks/index.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +22 -29
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +122 -3
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +27 -0
- package/build/store/utils.js.map +1 -0
- package/build-module/components/block-alignment-control/ui.js +2 -2
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +13 -4
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-lock/index.js +1 -0
- package/build-module/components/block-lock/index.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +4 -18
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +31 -12
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +6 -18
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +41 -0
- package/build-module/components/block-lock/use-block-lock.js.map +1 -0
- package/build-module/components/block-pattern-setup/index.js +39 -24
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-preview/auto.js +6 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +4 -2
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +7 -2
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/copy-handler/index.js +44 -9
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/link-control/index.js +6 -7
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -9
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +13 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +7 -1
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/hooks/duotone.js +63 -16
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -14
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +112 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +20 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-style/style-rtl.css +35 -28
- package/build-style/style.css +35 -28
- package/package.json +28 -28
- package/src/components/block-alignment-control/ui.js +2 -2
- package/src/components/block-content-overlay/index.js +19 -2
- package/src/components/block-content-overlay/style.scss +0 -1
- package/src/components/block-lock/index.js +1 -0
- package/src/components/block-lock/menu-item.js +3 -23
- package/src/components/block-lock/modal.js +37 -13
- package/src/components/block-lock/style.scss +1 -2
- package/src/components/block-lock/toolbar.js +4 -21
- package/src/components/block-lock/use-block-lock.js +45 -0
- package/src/components/block-pattern-setup/index.js +84 -59
- package/src/components/block-pattern-setup/setup-toolbar.js +3 -1
- package/src/components/block-pattern-setup/style.scss +32 -26
- package/src/components/block-preview/auto.js +10 -1
- package/src/components/block-preview/index.js +2 -0
- package/src/components/block-switcher/index.js +13 -1
- package/src/components/block-switcher/style.scss +7 -3
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +15 -13
- package/src/components/copy-handler/index.js +52 -10
- package/src/components/link-control/index.js +5 -5
- package/src/components/list-view/block-select-button.js +2 -10
- package/src/components/list-view/block.js +16 -7
- package/src/components/writing-flow/use-selection-observer.js +7 -0
- package/src/hooks/duotone.js +98 -62
- package/src/hooks/index.js +1 -0
- package/src/index.js +1 -0
- package/src/store/actions.js +5 -13
- package/src/store/selectors.js +148 -2
- package/src/store/utils.js +19 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function that maps attribute definition properties to the
|
|
3
|
+
* ones used by RichText utils like `create, toHTMLString, etc..`.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} attributeDefinition A block's attribute definition object.
|
|
6
|
+
* @return {Object} The mapped object.
|
|
7
|
+
*/
|
|
8
|
+
export function mapRichTextSettings(attributeDefinition) {
|
|
9
|
+
const {
|
|
10
|
+
multiline: multilineTag,
|
|
11
|
+
__unstableMultilineWrapperTags: multilineWrapperTags,
|
|
12
|
+
__unstablePreserveWhiteSpace: preserveWhiteSpace
|
|
13
|
+
} = attributeDefinition;
|
|
14
|
+
return {
|
|
15
|
+
multilineTag,
|
|
16
|
+
multilineWrapperTags,
|
|
17
|
+
preserveWhiteSpace
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/store/utils.js"],"names":["mapRichTextSettings","attributeDefinition","multiline","multilineTag","__unstableMultilineWrapperTags","multilineWrapperTags","__unstablePreserveWhiteSpace","preserveWhiteSpace"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAT,CAA8BC,mBAA9B,EAAoD;AAC1D,QAAM;AACLC,IAAAA,SAAS,EAAEC,YADN;AAELC,IAAAA,8BAA8B,EAAEC,oBAF3B;AAGLC,IAAAA,4BAA4B,EAAEC;AAHzB,MAIFN,mBAJJ;AAKA,SAAO;AACNE,IAAAA,YADM;AAENE,IAAAA,oBAFM;AAGNE,IAAAA;AAHM,GAAP;AAKA","sourcesContent":["/**\n * Helper function that maps attribute definition properties to the\n * ones used by RichText utils like `create, toHTMLString, etc..`.\n *\n * @param {Object} attributeDefinition A block's attribute definition object.\n * @return {Object} The mapped object.\n */\nexport function mapRichTextSettings( attributeDefinition ) {\n\tconst {\n\t\tmultiline: multilineTag,\n\t\t__unstableMultilineWrapperTags: multilineWrapperTags,\n\t\t__unstablePreserveWhiteSpace: preserveWhiteSpace,\n\t} = attributeDefinition;\n\treturn {\n\t\tmultilineTag,\n\t\tmultilineWrapperTags,\n\t\tpreserveWhiteSpace,\n\t};\n}\n"]}
|
|
@@ -855,8 +855,7 @@
|
|
|
855
855
|
padding-right: 0 !important;
|
|
856
856
|
}
|
|
857
857
|
.block-editor-block-lock-toolbar .components-button.has-icon:focus::before {
|
|
858
|
-
|
|
859
|
-
left: 12px !important;
|
|
858
|
+
left: 8px !important;
|
|
860
859
|
}
|
|
861
860
|
|
|
862
861
|
.block-editor-block-breadcrumb {
|
|
@@ -1019,7 +1018,6 @@
|
|
|
1019
1018
|
border: none;
|
|
1020
1019
|
border-radius: 2px;
|
|
1021
1020
|
z-index: 10;
|
|
1022
|
-
pointer-events: none;
|
|
1023
1021
|
}
|
|
1024
1022
|
.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active::before, .block-editor-block-content-overlay.parent-highlighted.overlay-active::before {
|
|
1025
1023
|
background: rgba(var(--wp-admin-theme-color--rgb), 0.1);
|
|
@@ -1423,11 +1421,13 @@
|
|
|
1423
1421
|
}
|
|
1424
1422
|
|
|
1425
1423
|
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1426
|
-
|
|
1424
|
+
display: flex;
|
|
1425
|
+
padding: 6px 12px !important;
|
|
1427
1426
|
}
|
|
1428
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-
|
|
1427
|
+
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1429
1428
|
margin-left: auto;
|
|
1430
1429
|
margin-right: auto;
|
|
1430
|
+
min-width: 24px !important;
|
|
1431
1431
|
}
|
|
1432
1432
|
|
|
1433
1433
|
.components-button.block-editor-block-switcher__no-switcher-icon:disabled {
|
|
@@ -1525,7 +1525,7 @@
|
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
1527
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1528
|
-
width:
|
|
1528
|
+
min-width: 36px;
|
|
1529
1529
|
}
|
|
1530
1530
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,
|
|
1531
1531
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle {
|
|
@@ -1652,39 +1652,41 @@
|
|
|
1652
1652
|
align-items: flex-start;
|
|
1653
1653
|
width: 100%;
|
|
1654
1654
|
border-radius: 2px;
|
|
1655
|
-
box-shadow: inset 0 0 0 1px #1e1e1e;
|
|
1656
|
-
outline: 1px solid transparent;
|
|
1657
1655
|
}
|
|
1658
1656
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__toolbar {
|
|
1659
1657
|
justify-content: center;
|
|
1660
1658
|
}
|
|
1661
1659
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
padding:
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1660
|
+
column-gap: 24px;
|
|
1661
|
+
display: block;
|
|
1662
|
+
width: 100%;
|
|
1663
|
+
padding: 32px;
|
|
1664
|
+
column-count: 2;
|
|
1665
|
+
}
|
|
1666
|
+
@media (min-width: 1440px) {
|
|
1667
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container {
|
|
1668
|
+
column-count: 3;
|
|
1669
|
+
}
|
|
1671
1670
|
}
|
|
1672
1671
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container,
|
|
1673
1672
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container div[role=button] {
|
|
1674
1673
|
cursor: pointer;
|
|
1675
1674
|
}
|
|
1676
|
-
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
text-align: center;
|
|
1675
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item {
|
|
1676
|
+
break-inside: avoid-column;
|
|
1677
|
+
margin-bottom: 24px;
|
|
1680
1678
|
}
|
|
1681
|
-
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container {
|
|
1679
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__container {
|
|
1680
|
+
min-height: 100px;
|
|
1682
1681
|
border-radius: 2px;
|
|
1683
1682
|
border: 1px solid #ddd;
|
|
1684
1683
|
}
|
|
1684
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__content {
|
|
1685
|
+
width: 100%;
|
|
1686
|
+
}
|
|
1685
1687
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar {
|
|
1688
|
+
height: 60px;
|
|
1686
1689
|
box-sizing: border-box;
|
|
1687
|
-
position: relative;
|
|
1688
1690
|
padding: 16px;
|
|
1689
1691
|
width: 100%;
|
|
1690
1692
|
text-align: right;
|
|
@@ -1692,12 +1694,12 @@
|
|
|
1692
1694
|
color: #1e1e1e;
|
|
1693
1695
|
border-radius: 2px 2px 0 0;
|
|
1694
1696
|
background-color: #fff;
|
|
1695
|
-
box-shadow: inset 0 0 0 1px #1e1e1e;
|
|
1696
|
-
outline: 1px solid transparent;
|
|
1697
1697
|
display: flex;
|
|
1698
1698
|
flex-direction: row;
|
|
1699
1699
|
align-items: center;
|
|
1700
1700
|
justify-content: space-between;
|
|
1701
|
+
border-top: 1px solid #ddd;
|
|
1702
|
+
align-self: flex-end;
|
|
1701
1703
|
}
|
|
1702
1704
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__display-controls {
|
|
1703
1705
|
display: flex;
|
|
@@ -1728,13 +1730,12 @@
|
|
|
1728
1730
|
box-sizing: border-box;
|
|
1729
1731
|
}
|
|
1730
1732
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide {
|
|
1731
|
-
opacity: 0;
|
|
1732
1733
|
position: absolute;
|
|
1733
1734
|
top: 0;
|
|
1734
1735
|
width: 100%;
|
|
1735
1736
|
margin: auto;
|
|
1736
|
-
padding:
|
|
1737
|
-
transition: transform 0.5s,
|
|
1737
|
+
padding: 0;
|
|
1738
|
+
transition: transform 0.5s, z-index 0.5s;
|
|
1738
1739
|
z-index: 100;
|
|
1739
1740
|
}
|
|
1740
1741
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide.active-slide {
|
|
@@ -1754,6 +1755,12 @@
|
|
|
1754
1755
|
display: none;
|
|
1755
1756
|
}
|
|
1756
1757
|
|
|
1758
|
+
.block-editor-block-pattern-setup__carousel,
|
|
1759
|
+
.block-editor-block-pattern-setup__grid {
|
|
1760
|
+
width: 100%;
|
|
1761
|
+
overflow-y: auto;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1757
1764
|
.block-editor-block-variation-transforms {
|
|
1758
1765
|
padding: 0 52px 16px 16px;
|
|
1759
1766
|
width: 100%;
|
package/build-style/style.css
CHANGED
|
@@ -855,8 +855,7 @@
|
|
|
855
855
|
padding-left: 0 !important;
|
|
856
856
|
}
|
|
857
857
|
.block-editor-block-lock-toolbar .components-button.has-icon:focus::before {
|
|
858
|
-
|
|
859
|
-
right: 12px !important;
|
|
858
|
+
right: 8px !important;
|
|
860
859
|
}
|
|
861
860
|
|
|
862
861
|
.block-editor-block-breadcrumb {
|
|
@@ -1019,7 +1018,6 @@
|
|
|
1019
1018
|
border: none;
|
|
1020
1019
|
border-radius: 2px;
|
|
1021
1020
|
z-index: 10;
|
|
1022
|
-
pointer-events: none;
|
|
1023
1021
|
}
|
|
1024
1022
|
.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active::before, .block-editor-block-content-overlay.parent-highlighted.overlay-active::before {
|
|
1025
1023
|
background: rgba(var(--wp-admin-theme-color--rgb), 0.1);
|
|
@@ -1423,11 +1421,13 @@
|
|
|
1423
1421
|
}
|
|
1424
1422
|
|
|
1425
1423
|
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1426
|
-
|
|
1424
|
+
display: flex;
|
|
1425
|
+
padding: 6px 12px !important;
|
|
1427
1426
|
}
|
|
1428
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-
|
|
1427
|
+
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1429
1428
|
margin-right: auto;
|
|
1430
1429
|
margin-left: auto;
|
|
1430
|
+
min-width: 24px !important;
|
|
1431
1431
|
}
|
|
1432
1432
|
|
|
1433
1433
|
.components-button.block-editor-block-switcher__no-switcher-icon:disabled {
|
|
@@ -1525,7 +1525,7 @@
|
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
1527
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1528
|
-
width:
|
|
1528
|
+
min-width: 36px;
|
|
1529
1529
|
}
|
|
1530
1530
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,
|
|
1531
1531
|
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle {
|
|
@@ -1652,39 +1652,41 @@
|
|
|
1652
1652
|
align-items: flex-start;
|
|
1653
1653
|
width: 100%;
|
|
1654
1654
|
border-radius: 2px;
|
|
1655
|
-
box-shadow: inset 0 0 0 1px #1e1e1e;
|
|
1656
|
-
outline: 1px solid transparent;
|
|
1657
1655
|
}
|
|
1658
1656
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__toolbar {
|
|
1659
1657
|
justify-content: center;
|
|
1660
1658
|
}
|
|
1661
1659
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
padding:
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1660
|
+
column-gap: 24px;
|
|
1661
|
+
display: block;
|
|
1662
|
+
width: 100%;
|
|
1663
|
+
padding: 32px;
|
|
1664
|
+
column-count: 2;
|
|
1665
|
+
}
|
|
1666
|
+
@media (min-width: 1440px) {
|
|
1667
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container {
|
|
1668
|
+
column-count: 3;
|
|
1669
|
+
}
|
|
1671
1670
|
}
|
|
1672
1671
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container,
|
|
1673
1672
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container div[role=button] {
|
|
1674
1673
|
cursor: pointer;
|
|
1675
1674
|
}
|
|
1676
|
-
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
text-align: center;
|
|
1675
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item {
|
|
1676
|
+
break-inside: avoid-column;
|
|
1677
|
+
margin-bottom: 24px;
|
|
1680
1678
|
}
|
|
1681
|
-
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-preview__container {
|
|
1679
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__container {
|
|
1680
|
+
min-height: 100px;
|
|
1682
1681
|
border-radius: 2px;
|
|
1683
1682
|
border: 1px solid #ddd;
|
|
1684
1683
|
}
|
|
1684
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__content {
|
|
1685
|
+
width: 100%;
|
|
1686
|
+
}
|
|
1685
1687
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar {
|
|
1688
|
+
height: 60px;
|
|
1686
1689
|
box-sizing: border-box;
|
|
1687
|
-
position: relative;
|
|
1688
1690
|
padding: 16px;
|
|
1689
1691
|
width: 100%;
|
|
1690
1692
|
text-align: left;
|
|
@@ -1692,12 +1694,12 @@
|
|
|
1692
1694
|
color: #1e1e1e;
|
|
1693
1695
|
border-radius: 2px 2px 0 0;
|
|
1694
1696
|
background-color: #fff;
|
|
1695
|
-
box-shadow: inset 0 0 0 1px #1e1e1e;
|
|
1696
|
-
outline: 1px solid transparent;
|
|
1697
1697
|
display: flex;
|
|
1698
1698
|
flex-direction: row;
|
|
1699
1699
|
align-items: center;
|
|
1700
1700
|
justify-content: space-between;
|
|
1701
|
+
border-top: 1px solid #ddd;
|
|
1702
|
+
align-self: flex-end;
|
|
1701
1703
|
}
|
|
1702
1704
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__toolbar .block-editor-block-pattern-setup__display-controls {
|
|
1703
1705
|
display: flex;
|
|
@@ -1728,13 +1730,12 @@
|
|
|
1728
1730
|
box-sizing: border-box;
|
|
1729
1731
|
}
|
|
1730
1732
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide {
|
|
1731
|
-
opacity: 0;
|
|
1732
1733
|
position: absolute;
|
|
1733
1734
|
top: 0;
|
|
1734
1735
|
width: 100%;
|
|
1735
1736
|
margin: auto;
|
|
1736
|
-
padding:
|
|
1737
|
-
transition: transform 0.5s,
|
|
1737
|
+
padding: 0;
|
|
1738
|
+
transition: transform 0.5s, z-index 0.5s;
|
|
1738
1739
|
z-index: 100;
|
|
1739
1740
|
}
|
|
1740
1741
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container .pattern-slide.active-slide {
|
|
@@ -1754,6 +1755,12 @@
|
|
|
1754
1755
|
display: none;
|
|
1755
1756
|
}
|
|
1756
1757
|
|
|
1758
|
+
.block-editor-block-pattern-setup__carousel,
|
|
1759
|
+
.block-editor-block-pattern-setup__grid {
|
|
1760
|
+
width: 100%;
|
|
1761
|
+
overflow-y: auto;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1757
1764
|
.block-editor-block-variation-transforms {
|
|
1758
1765
|
padding: 0 16px 16px 52px;
|
|
1759
1766
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.3",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.2.4",
|
|
36
|
-
"@wordpress/a11y": "^3.6.
|
|
37
|
-
"@wordpress/api-fetch": "^6.3.
|
|
38
|
-
"@wordpress/blob": "^3.6.
|
|
39
|
-
"@wordpress/blocks": "^11.5.
|
|
40
|
-
"@wordpress/components": "^19.8.
|
|
41
|
-
"@wordpress/compose": "^5.4.
|
|
42
|
-
"@wordpress/data": "^6.6.
|
|
43
|
-
"@wordpress/date": "^4.6.
|
|
44
|
-
"@wordpress/deprecated": "^3.6.
|
|
45
|
-
"@wordpress/dom": "^3.6.
|
|
46
|
-
"@wordpress/element": "^4.4.
|
|
47
|
-
"@wordpress/hooks": "^3.6.
|
|
48
|
-
"@wordpress/html-entities": "^3.6.
|
|
49
|
-
"@wordpress/i18n": "^4.6.
|
|
50
|
-
"@wordpress/icons": "^8.2.
|
|
51
|
-
"@wordpress/is-shallow-equal": "^4.6.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^3.4.
|
|
53
|
-
"@wordpress/keycodes": "^3.6.
|
|
54
|
-
"@wordpress/notices": "^3.6.
|
|
55
|
-
"@wordpress/rich-text": "^5.4.
|
|
56
|
-
"@wordpress/shortcode": "^3.6.
|
|
57
|
-
"@wordpress/style-engine": "^0.5.
|
|
58
|
-
"@wordpress/token-list": "^2.6.
|
|
59
|
-
"@wordpress/url": "^3.7.
|
|
60
|
-
"@wordpress/warning": "^2.6.
|
|
61
|
-
"@wordpress/wordcount": "^3.6.
|
|
36
|
+
"@wordpress/a11y": "^3.6.1",
|
|
37
|
+
"@wordpress/api-fetch": "^6.3.1",
|
|
38
|
+
"@wordpress/blob": "^3.6.1",
|
|
39
|
+
"@wordpress/blocks": "^11.5.3",
|
|
40
|
+
"@wordpress/components": "^19.8.2",
|
|
41
|
+
"@wordpress/compose": "^5.4.1",
|
|
42
|
+
"@wordpress/data": "^6.6.1",
|
|
43
|
+
"@wordpress/date": "^4.6.1",
|
|
44
|
+
"@wordpress/deprecated": "^3.6.1",
|
|
45
|
+
"@wordpress/dom": "^3.6.1",
|
|
46
|
+
"@wordpress/element": "^4.4.1",
|
|
47
|
+
"@wordpress/hooks": "^3.6.1",
|
|
48
|
+
"@wordpress/html-entities": "^3.6.1",
|
|
49
|
+
"@wordpress/i18n": "^4.6.1",
|
|
50
|
+
"@wordpress/icons": "^8.2.2",
|
|
51
|
+
"@wordpress/is-shallow-equal": "^4.6.1",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^3.4.1",
|
|
53
|
+
"@wordpress/keycodes": "^3.6.1",
|
|
54
|
+
"@wordpress/notices": "^3.6.1",
|
|
55
|
+
"@wordpress/rich-text": "^5.4.1",
|
|
56
|
+
"@wordpress/shortcode": "^3.6.1",
|
|
57
|
+
"@wordpress/style-engine": "^0.5.1",
|
|
58
|
+
"@wordpress/token-list": "^2.6.1",
|
|
59
|
+
"@wordpress/url": "^3.7.1",
|
|
60
|
+
"@wordpress/warning": "^2.6.1",
|
|
61
|
+
"@wordpress/wordcount": "^3.6.1",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
63
63
|
"colord": "^2.7.0",
|
|
64
64
|
"diff": "^4.0.2",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "37e930b93fbba88fa024a91eb527a90f855c97f3"
|
|
81
81
|
}
|
|
@@ -6,7 +6,7 @@ import classNames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
+
import { __, _x } from '@wordpress/i18n';
|
|
10
10
|
import {
|
|
11
11
|
ToolbarDropdownMenu,
|
|
12
12
|
ToolbarGroup,
|
|
@@ -31,7 +31,7 @@ import useAvailableAlignments from './use-available-alignments';
|
|
|
31
31
|
const BLOCK_ALIGNMENTS_CONTROLS = {
|
|
32
32
|
none: {
|
|
33
33
|
icon: alignNone,
|
|
34
|
-
title:
|
|
34
|
+
title: _x( 'None', 'Alignment option' ),
|
|
35
35
|
},
|
|
36
36
|
left: {
|
|
37
37
|
icon: positionLeft,
|
|
@@ -25,6 +25,7 @@ export default function BlockContentOverlay( {
|
|
|
25
25
|
const [ isHovered, setIsHovered ] = useState( false );
|
|
26
26
|
|
|
27
27
|
const {
|
|
28
|
+
canEdit,
|
|
28
29
|
isParentSelected,
|
|
29
30
|
hasChildSelected,
|
|
30
31
|
isDraggingBlocks,
|
|
@@ -36,8 +37,10 @@ export default function BlockContentOverlay( {
|
|
|
36
37
|
hasSelectedInnerBlock,
|
|
37
38
|
isDraggingBlocks: _isDraggingBlocks,
|
|
38
39
|
isBlockHighlighted,
|
|
40
|
+
canEditBlock,
|
|
39
41
|
} = select( blockEditorStore );
|
|
40
42
|
return {
|
|
43
|
+
canEdit: canEditBlock( clientId ),
|
|
41
44
|
isParentSelected: isBlockSelected( clientId ),
|
|
42
45
|
hasChildSelected: hasSelectedInnerBlock( clientId, true ),
|
|
43
46
|
isDraggingBlocks: _isDraggingBlocks(),
|
|
@@ -59,6 +62,12 @@ export default function BlockContentOverlay( {
|
|
|
59
62
|
);
|
|
60
63
|
|
|
61
64
|
useEffect( () => {
|
|
65
|
+
// The overlay is always active when editing is locked.
|
|
66
|
+
if ( ! canEdit ) {
|
|
67
|
+
setIsOverlayActive( true );
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
// Reenable when blocks are not in use.
|
|
63
72
|
if ( ! isParentSelected && ! hasChildSelected && ! isOverlayActive ) {
|
|
64
73
|
setIsOverlayActive( true );
|
|
@@ -75,7 +84,13 @@ export default function BlockContentOverlay( {
|
|
|
75
84
|
if ( hasChildSelected && isOverlayActive ) {
|
|
76
85
|
setIsOverlayActive( false );
|
|
77
86
|
}
|
|
78
|
-
}, [
|
|
87
|
+
}, [
|
|
88
|
+
isParentSelected,
|
|
89
|
+
hasChildSelected,
|
|
90
|
+
isOverlayActive,
|
|
91
|
+
isHovered,
|
|
92
|
+
canEdit,
|
|
93
|
+
] );
|
|
79
94
|
|
|
80
95
|
// Disabled because the overlay div doesn't actually have a role or functionality
|
|
81
96
|
// as far as the a11y is concerned. We're just catching the first click so that
|
|
@@ -88,7 +103,9 @@ export default function BlockContentOverlay( {
|
|
|
88
103
|
onMouseEnter={ () => setIsHovered( true ) }
|
|
89
104
|
onMouseLeave={ () => setIsHovered( false ) }
|
|
90
105
|
onMouseUp={
|
|
91
|
-
isOverlayActive
|
|
106
|
+
isOverlayActive && canEdit
|
|
107
|
+
? () => setIsOverlayActive( false )
|
|
108
|
+
: undefined
|
|
92
109
|
}
|
|
93
110
|
>
|
|
94
111
|
{ wrapperProps?.children }
|
|
@@ -4,43 +4,23 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useReducer } from '@wordpress/element';
|
|
6
6
|
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
7
|
import { lock, unlock } from '@wordpress/icons';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Internal dependencies
|
|
12
11
|
*/
|
|
12
|
+
import useBlockLock from './use-block-lock';
|
|
13
13
|
import BlockLockModal from './modal';
|
|
14
|
-
import { store as blockEditorStore } from '../../store';
|
|
15
14
|
|
|
16
15
|
export default function BlockLockMenuItem( { clientId } ) {
|
|
17
|
-
const {
|
|
18
|
-
( select ) => {
|
|
19
|
-
const {
|
|
20
|
-
canMoveBlock,
|
|
21
|
-
canRemoveBlock,
|
|
22
|
-
canLockBlockType,
|
|
23
|
-
getBlockName,
|
|
24
|
-
getBlockRootClientId,
|
|
25
|
-
} = select( blockEditorStore );
|
|
26
|
-
const rootClientId = getBlockRootClientId( clientId );
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
canLockBlock: canLockBlockType( getBlockName( clientId ) ),
|
|
30
|
-
isLocked:
|
|
31
|
-
! canMoveBlock( clientId, rootClientId ) ||
|
|
32
|
-
! canRemoveBlock( clientId, rootClientId ),
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
[ clientId ]
|
|
36
|
-
);
|
|
16
|
+
const { canLock, isLocked } = useBlockLock( clientId );
|
|
37
17
|
|
|
38
18
|
const [ isModalOpen, toggleModal ] = useReducer(
|
|
39
19
|
( isActive ) => ! isActive,
|
|
40
20
|
false
|
|
41
21
|
);
|
|
42
22
|
|
|
43
|
-
if ( !
|
|
23
|
+
if ( ! canLock ) {
|
|
44
24
|
return null;
|
|
45
25
|
}
|
|
46
26
|
|
|
@@ -14,27 +14,25 @@ import {
|
|
|
14
14
|
import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
|
|
15
15
|
import { useInstanceId } from '@wordpress/compose';
|
|
16
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
|
+
import { isReusableBlock, getBlockType } from '@wordpress/blocks';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Internal dependencies
|
|
20
21
|
*/
|
|
22
|
+
import useBlockLock from './use-block-lock';
|
|
21
23
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
22
24
|
import { store as blockEditorStore } from '../../store';
|
|
23
25
|
|
|
24
26
|
export default function BlockLockModal( { clientId, onClose } ) {
|
|
25
27
|
const [ lock, setLock ] = useState( { move: false, remove: false } );
|
|
26
|
-
const { canMove, canRemove } =
|
|
28
|
+
const { canEdit, canMove, canRemove } = useBlockLock( clientId );
|
|
29
|
+
const { isReusable } = useSelect(
|
|
27
30
|
( select ) => {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
canRemoveBlock,
|
|
31
|
-
getBlockRootClientId,
|
|
32
|
-
} = select( blockEditorStore );
|
|
33
|
-
const rootClientId = getBlockRootClientId( clientId );
|
|
31
|
+
const { getBlockName } = select( blockEditorStore );
|
|
32
|
+
const blockName = getBlockName( clientId );
|
|
34
33
|
|
|
35
34
|
return {
|
|
36
|
-
|
|
37
|
-
canRemove: canRemoveBlock( clientId, rootClientId ),
|
|
35
|
+
isReusable: isReusableBlock( getBlockType( blockName ) ),
|
|
38
36
|
};
|
|
39
37
|
},
|
|
40
38
|
[ clientId ]
|
|
@@ -50,12 +48,12 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
50
48
|
setLock( {
|
|
51
49
|
move: ! canMove,
|
|
52
50
|
remove: ! canRemove,
|
|
51
|
+
...( isReusable ? { edit: ! canEdit } : {} ),
|
|
53
52
|
} );
|
|
54
|
-
}, [ canMove, canRemove ] );
|
|
53
|
+
}, [ canEdit, canMove, canRemove, isReusable ] );
|
|
55
54
|
|
|
56
55
|
const isAllChecked = Object.values( lock ).every( Boolean );
|
|
57
|
-
const
|
|
58
|
-
Object.values( lock ).some( Boolean ) && ! isAllChecked;
|
|
56
|
+
const isMixed = Object.values( lock ).some( Boolean ) && ! isAllChecked;
|
|
59
57
|
|
|
60
58
|
return (
|
|
61
59
|
<Modal
|
|
@@ -91,15 +89,41 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
91
89
|
<span id={ instanceId }>{ __( 'Lock all' ) }</span>
|
|
92
90
|
}
|
|
93
91
|
checked={ isAllChecked }
|
|
94
|
-
indeterminate={
|
|
92
|
+
indeterminate={ isMixed }
|
|
95
93
|
onChange={ ( newValue ) =>
|
|
96
94
|
setLock( {
|
|
97
95
|
move: newValue,
|
|
98
96
|
remove: newValue,
|
|
97
|
+
...( isReusable ? { edit: newValue } : {} ),
|
|
99
98
|
} )
|
|
100
99
|
}
|
|
101
100
|
/>
|
|
102
101
|
<ul className="block-editor-block-lock-modal__checklist">
|
|
102
|
+
{ isReusable && (
|
|
103
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
104
|
+
<CheckboxControl
|
|
105
|
+
label={
|
|
106
|
+
<>
|
|
107
|
+
{ __( 'Restrict editing' ) }
|
|
108
|
+
<Icon
|
|
109
|
+
icon={
|
|
110
|
+
lock.edit
|
|
111
|
+
? lockIcon
|
|
112
|
+
: unlockIcon
|
|
113
|
+
}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
}
|
|
117
|
+
checked={ !! lock.edit }
|
|
118
|
+
onChange={ ( edit ) =>
|
|
119
|
+
setLock( ( prevLock ) => ( {
|
|
120
|
+
...prevLock,
|
|
121
|
+
edit,
|
|
122
|
+
} ) )
|
|
123
|
+
}
|
|
124
|
+
/>
|
|
125
|
+
</li>
|
|
126
|
+
) }
|
|
103
127
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
104
128
|
<CheckboxControl
|
|
105
129
|
label={
|