@wordpress/edit-site 4.10.0 → 4.12.1-next.d6164808d3.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/add-new-template/add-custom-template-modal.js +26 -44
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template.js +45 -23
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +493 -242
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/index.js +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +26 -12
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/global-styles/border-panel.js +3 -3
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +280 -20
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +4 -4
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +1 -1
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +51 -7
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +157 -0
- package/build/components/global-styles/screen-heading-color.js.map +1 -0
- package/build/components/global-styles/screen-typography-element.js +4 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -0
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +82 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +217 -0
- package/build/components/global-styles/typography-utils.js.map +1 -0
- package/build/components/global-styles/ui.js +11 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +183 -52
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +85 -5
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/document-actions/index.js +1 -0
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/index.js +27 -12
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +0 -4
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +13 -3
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +2 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/list/actions/index.js +1 -1
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +11 -1
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +2 -2
- package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +11 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-actions.js +1 -1
- package/build/components/sidebar/template-card/template-actions.js.map +1 -1
- package/build/components/template-details/edit-template-title.js +1 -1
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/index.js +19 -9
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +1 -1
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-details/template-part-area-selector.js +47 -0
- package/build/components/template-details/template-part-area-selector.js.map +1 -0
- package/build/components/template-part-converter/convert-to-template-part.js +4 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +86 -0
- package/build/hooks/template-part-edit.js.map +1 -0
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +27 -45
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +45 -25
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +489 -230
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -2
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +26 -12
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +278 -22
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +4 -4
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -1
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +51 -7
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +143 -0
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -0
- package/build-module/components/global-styles/screen-typography-element.js +4 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +83 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +204 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -0
- package/build-module/components/global-styles/ui.js +10 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +182 -61
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +82 -5
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +1 -0
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/index.js +30 -14
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +0 -4
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +13 -3
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +3 -2
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/list/actions/index.js +1 -1
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -4
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +9 -1
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +3 -3
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +9 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js +1 -1
- package/build-module/components/sidebar/template-card/template-actions.js.map +1 -1
- package/build-module/components/template-details/edit-template-title.js +1 -1
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/index.js +19 -10
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +1 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-details/template-part-area-selector.js +35 -0
- package/build-module/components/template-details/template-part-area-selector.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-template-part.js +3 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +67 -0
- package/build-module/hooks/template-part-edit.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +40 -33
- package/build-style/style.css +40 -33
- package/package.json +29 -29
- package/src/components/add-new-template/add-custom-template-modal.js +39 -48
- package/src/components/add-new-template/new-template.js +50 -58
- package/src/components/add-new-template/style.scss +20 -8
- package/src/components/add-new-template/utils.js +529 -231
- package/src/components/block-editor/index.js +0 -2
- package/src/components/block-editor/resizable-editor.js +28 -18
- package/src/components/editor/style.scss +1 -0
- package/src/components/global-styles/border-panel.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +344 -45
- package/src/components/global-styles/hooks.js +6 -3
- package/src/components/global-styles/screen-color-palette.js +1 -1
- package/src/components/global-styles/screen-colors.js +46 -4
- package/src/components/global-styles/screen-heading-color.js +201 -0
- package/src/components/global-styles/screen-typography-element.js +4 -0
- package/src/components/global-styles/screen-typography.js +6 -0
- package/src/components/global-styles/style.scss +14 -6
- package/src/components/global-styles/test/typography-utils.js +130 -0
- package/src/components/global-styles/test/use-global-styles-output.js +143 -4
- package/src/components/global-styles/test/utils.js +68 -8
- package/src/components/global-styles/typography-panel.js +119 -48
- package/src/components/global-styles/typography-utils.js +228 -0
- package/src/components/global-styles/ui.js +13 -0
- package/src/components/global-styles/use-global-styles-output.js +203 -53
- package/src/components/global-styles/utils.js +70 -4
- package/src/components/header/document-actions/index.js +3 -0
- package/src/components/header/index.js +41 -14
- package/src/components/header/mode-switcher/index.js +0 -3
- package/src/components/header/more-menu/index.js +7 -2
- package/src/components/header/style.scss +5 -3
- package/src/components/header/undo-redo/redo.js +6 -2
- package/src/components/list/actions/index.js +3 -1
- package/src/components/save-button/index.js +10 -13
- package/src/components/sidebar/default-sidebar.js +12 -0
- package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +1 -5
- package/src/components/sidebar/plugin-sidebar/index.js +12 -0
- package/src/components/sidebar/style.scss +4 -0
- package/src/components/sidebar/template-card/template-actions.js +3 -1
- package/src/components/template-details/edit-template-title.js +7 -3
- package/src/components/template-details/index.js +23 -8
- package/src/components/template-details/style.scss +0 -5
- package/src/components/template-details/template-areas.js +3 -1
- package/src/components/template-details/template-part-area-selector.js +38 -0
- package/src/components/template-part-converter/convert-to-template-part.js +3 -1
- package/src/hooks/index.js +1 -0
- package/src/hooks/template-part-edit.js +82 -0
- package/src/index.js +1 -1
- package/src/style.scss +0 -1
- package/build/components/edit-template-part-menu-button/index.js +0 -90
- package/build/components/edit-template-part-menu-button/index.js.map +0 -1
- package/build-module/components/edit-template-part-menu-button/index.js +0 -72
- package/build-module/components/edit-template-part-menu-button/index.js.map +0 -1
- package/src/components/edit-template-part-menu-button/index.js +0 -82
package/build-style/style.css
CHANGED
|
@@ -722,6 +722,12 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
722
722
|
border-radius: 2px;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
+
.edit-site-typography-panel__full-width-control {
|
|
726
|
+
grid-column: 1/-1;
|
|
727
|
+
max-width: 100%;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.edit-site-global-styles-screen-heading-color,
|
|
725
731
|
.edit-site-global-styles-screen-typography {
|
|
726
732
|
margin: 16px;
|
|
727
733
|
}
|
|
@@ -741,6 +747,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
741
747
|
}
|
|
742
748
|
.edit-site-global-styles-screen-colors .component-color-indicator {
|
|
743
749
|
background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
750
|
+
flex-shrink: 0;
|
|
744
751
|
}
|
|
745
752
|
|
|
746
753
|
.edit-site-global-styles-header__description,
|
|
@@ -770,10 +777,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
770
777
|
padding: 16px;
|
|
771
778
|
}
|
|
772
779
|
|
|
773
|
-
.edit-site-screen-background-color__control .block-editor-color-gradient-control__tab-panel {
|
|
774
|
-
padding: 16px;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
780
|
.edit-site-global-styles-variations_item {
|
|
778
781
|
box-sizing: border-box;
|
|
779
782
|
}
|
|
@@ -798,6 +801,13 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
|
|
798
801
|
|
|
799
802
|
.edit-site-global-styles__color-indicator-wrapper {
|
|
800
803
|
height: 24px;
|
|
804
|
+
flex-shrink: 0;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.edit-site-global-styles__color-label {
|
|
808
|
+
white-space: nowrap;
|
|
809
|
+
overflow: hidden;
|
|
810
|
+
text-overflow: ellipsis;
|
|
801
811
|
}
|
|
802
812
|
|
|
803
813
|
.edit-site-header {
|
|
@@ -1001,14 +1011,13 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
1001
1011
|
padding-left: 6px;
|
|
1002
1012
|
padding-right: 6px;
|
|
1003
1013
|
}
|
|
1014
|
+
.show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info::after {
|
|
1015
|
+
content: none;
|
|
1016
|
+
}
|
|
1004
1017
|
.show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
|
|
1005
1018
|
.show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
|
|
1006
1019
|
height: 36px;
|
|
1007
|
-
padding: 0
|
|
1008
|
-
}
|
|
1009
|
-
.show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle::after,
|
|
1010
|
-
.show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info::after {
|
|
1011
|
-
content: none;
|
|
1020
|
+
padding: 0 8px;
|
|
1012
1021
|
}
|
|
1013
1022
|
.show-icon-labels .edit-site-header .edit-site-header_start .edit-site-header__toolbar > * + * {
|
|
1014
1023
|
margin-left: 8px;
|
|
@@ -1490,30 +1499,36 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1490
1499
|
}
|
|
1491
1500
|
}
|
|
1492
1501
|
|
|
1493
|
-
.edit-site-custom-template-modal__contents >
|
|
1494
|
-
text-align: center;
|
|
1495
|
-
cursor: pointer;
|
|
1502
|
+
.edit-site-custom-template-modal__contents > .components-button {
|
|
1496
1503
|
padding: 24px;
|
|
1497
|
-
|
|
1504
|
+
box-shadow: inset 0 0 0 1px #949494;
|
|
1498
1505
|
border-radius: 2px;
|
|
1499
1506
|
width: 256px;
|
|
1507
|
+
height: auto;
|
|
1500
1508
|
display: flex;
|
|
1501
1509
|
flex-direction: column;
|
|
1502
1510
|
gap: 8px;
|
|
1503
|
-
|
|
1504
|
-
|
|
1511
|
+
outline: 1px solid transparent;
|
|
1512
|
+
}
|
|
1513
|
+
.edit-site-custom-template-modal__contents > .components-button span:first-child {
|
|
1514
|
+
color: #1e1e1e;
|
|
1505
1515
|
}
|
|
1506
|
-
.edit-site-custom-template-modal__contents >
|
|
1516
|
+
.edit-site-custom-template-modal__contents > .components-button span {
|
|
1507
1517
|
color: #757575;
|
|
1508
1518
|
}
|
|
1509
|
-
.edit-site-custom-template-modal__contents >
|
|
1510
|
-
|
|
1519
|
+
.edit-site-custom-template-modal__contents > .components-button:hover {
|
|
1520
|
+
color: var(--wp-admin-theme-color-darker-10);
|
|
1521
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color-darker-10);
|
|
1511
1522
|
}
|
|
1512
|
-
.edit-site-custom-template-modal__contents >
|
|
1523
|
+
.edit-site-custom-template-modal__contents > .components-button:hover span:first-child {
|
|
1513
1524
|
color: var(--wp-admin-theme-color);
|
|
1514
1525
|
}
|
|
1515
|
-
.edit-site-custom-template-modal__contents >
|
|
1526
|
+
.edit-site-custom-template-modal__contents > .components-button:focus {
|
|
1516
1527
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1528
|
+
outline: 3px solid transparent;
|
|
1529
|
+
}
|
|
1530
|
+
.edit-site-custom-template-modal__contents > .components-button:focus span:first-child {
|
|
1531
|
+
color: var(--wp-admin-theme-color);
|
|
1517
1532
|
}
|
|
1518
1533
|
.edit-site-custom-template-modal .components-search-control input[type=search].components-search-control__input {
|
|
1519
1534
|
background: #fff;
|
|
@@ -1658,6 +1673,10 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1658
1673
|
grid-column: span 1;
|
|
1659
1674
|
}
|
|
1660
1675
|
|
|
1676
|
+
.edit-site-global-styles-sidebar .components-tools-panel .span-columns {
|
|
1677
|
+
grid-column: 1/-1;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1661
1680
|
.edit-site-global-styles-sidebar__blocks-group {
|
|
1662
1681
|
padding-top: 24px;
|
|
1663
1682
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1883,6 +1902,7 @@ html.wp-toolbar {
|
|
|
1883
1902
|
position: relative;
|
|
1884
1903
|
height: 100%;
|
|
1885
1904
|
display: block;
|
|
1905
|
+
overflow: hidden;
|
|
1886
1906
|
}
|
|
1887
1907
|
.edit-site-visual-editor iframe {
|
|
1888
1908
|
display: block;
|
|
@@ -1944,11 +1964,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1944
1964
|
.edit-site-template-details .edit-site-template-details__group + .edit-site-template-details__group {
|
|
1945
1965
|
border-top: 1px solid #ccc;
|
|
1946
1966
|
}
|
|
1947
|
-
.edit-site-template-details .edit-site-template-details__title {
|
|
1948
|
-
margin: 0;
|
|
1949
|
-
}
|
|
1950
1967
|
.edit-site-template-details .edit-site-template-details__description {
|
|
1951
|
-
margin: 12px 0 0;
|
|
1952
1968
|
color: #757575;
|
|
1953
1969
|
}
|
|
1954
1970
|
.edit-site-template-details .edit-site-template-details__group.edit-site-template-details__template-areas {
|
|
@@ -2188,40 +2204,31 @@ html.wp-toolbar {
|
|
|
2188
2204
|
background: #fff;
|
|
2189
2205
|
}
|
|
2190
2206
|
|
|
2191
|
-
body.appearance_page_gutenberg-edit-site,
|
|
2192
2207
|
body.site-editor-php {
|
|
2193
2208
|
background: #fff;
|
|
2194
2209
|
/* We hide legacy notices in Gutenberg Based Pages, because they were not designed in a way that scaled well.
|
|
2195
2210
|
Plugins can use Gutenberg notices if they need to pass on information to the user when they are editing. */
|
|
2196
2211
|
}
|
|
2197
|
-
body.appearance_page_gutenberg-edit-site #wpcontent,
|
|
2198
2212
|
body.site-editor-php #wpcontent {
|
|
2199
2213
|
padding-left: 0;
|
|
2200
2214
|
}
|
|
2201
|
-
body.appearance_page_gutenberg-edit-site #wpbody-content,
|
|
2202
2215
|
body.site-editor-php #wpbody-content {
|
|
2203
2216
|
padding-bottom: 0;
|
|
2204
2217
|
}
|
|
2205
|
-
body.appearance_page_gutenberg-edit-site #wpbody-content > div:not(.edit-site):not(#screen-meta),
|
|
2206
2218
|
body.site-editor-php #wpbody-content > div:not(.edit-site):not(#screen-meta) {
|
|
2207
2219
|
display: none;
|
|
2208
2220
|
}
|
|
2209
|
-
body.appearance_page_gutenberg-edit-site #wpfooter,
|
|
2210
2221
|
body.site-editor-php #wpfooter {
|
|
2211
2222
|
display: none;
|
|
2212
2223
|
}
|
|
2213
|
-
body.appearance_page_gutenberg-edit-site .a11y-speak-region,
|
|
2214
2224
|
body.site-editor-php .a11y-speak-region {
|
|
2215
2225
|
left: -1px;
|
|
2216
2226
|
top: -1px;
|
|
2217
2227
|
}
|
|
2218
|
-
body.appearance_page_gutenberg-edit-site ul#adminmenu a.wp-has-current-submenu::after,
|
|
2219
|
-
body.appearance_page_gutenberg-edit-site ul#adminmenu > li.current > a.current::after,
|
|
2220
2228
|
body.site-editor-php ul#adminmenu a.wp-has-current-submenu::after,
|
|
2221
2229
|
body.site-editor-php ul#adminmenu > li.current > a.current::after {
|
|
2222
2230
|
border-right-color: #fff;
|
|
2223
2231
|
}
|
|
2224
|
-
body.appearance_page_gutenberg-edit-site .media-frame select.attachment-filters:last-of-type,
|
|
2225
2232
|
body.site-editor-php .media-frame select.attachment-filters:last-of-type {
|
|
2226
2233
|
width: auto;
|
|
2227
2234
|
max-width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.1-next.d6164808d3.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,33 +27,33 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^9.
|
|
33
|
-
"@wordpress/block-library": "^7.
|
|
34
|
-
"@wordpress/blocks": "^11.
|
|
35
|
-
"@wordpress/components": "^
|
|
36
|
-
"@wordpress/compose": "^5.
|
|
37
|
-
"@wordpress/core-data": "^4.
|
|
38
|
-
"@wordpress/data": "^
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/editor": "^12.
|
|
41
|
-
"@wordpress/element": "^4.
|
|
42
|
-
"@wordpress/hooks": "^3.
|
|
43
|
-
"@wordpress/html-entities": "^3.
|
|
44
|
-
"@wordpress/i18n": "^4.
|
|
45
|
-
"@wordpress/icons": "^9.
|
|
46
|
-
"@wordpress/interface": "^4.
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
48
|
-
"@wordpress/keycodes": "^3.
|
|
49
|
-
"@wordpress/media-utils": "^4.
|
|
50
|
-
"@wordpress/notices": "^3.
|
|
51
|
-
"@wordpress/plugins": "^4.
|
|
52
|
-
"@wordpress/preferences": "^2.
|
|
53
|
-
"@wordpress/reusable-blocks": "^3.
|
|
54
|
-
"@wordpress/style-engine": "^0.
|
|
55
|
-
"@wordpress/url": "^3.
|
|
56
|
-
"@wordpress/viewport": "^4.
|
|
30
|
+
"@wordpress/a11y": "^3.15.1-next.d6164808d3.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.12.1-next.d6164808d3.0",
|
|
32
|
+
"@wordpress/block-editor": "^9.7.1-next.d6164808d3.0",
|
|
33
|
+
"@wordpress/block-library": "^7.12.2-next.d6164808d3.0",
|
|
34
|
+
"@wordpress/blocks": "^11.14.1-next.d6164808d3.0",
|
|
35
|
+
"@wordpress/components": "^20.0.1-next.d6164808d3.0",
|
|
36
|
+
"@wordpress/compose": "^5.13.1-next.d6164808d3.0",
|
|
37
|
+
"@wordpress/core-data": "^4.14.1-next.d6164808d3.0",
|
|
38
|
+
"@wordpress/data": "^7.0.1-next.d6164808d3.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.15.1-next.d6164808d3.0",
|
|
40
|
+
"@wordpress/editor": "^12.14.1-next.d6164808d3.0",
|
|
41
|
+
"@wordpress/element": "^4.13.1-next.d6164808d3.0",
|
|
42
|
+
"@wordpress/hooks": "^3.15.1-next.d6164808d3.0",
|
|
43
|
+
"@wordpress/html-entities": "^3.15.1-next.d6164808d3.0",
|
|
44
|
+
"@wordpress/i18n": "^4.15.1-next.d6164808d3.0",
|
|
45
|
+
"@wordpress/icons": "^9.6.1-next.d6164808d3.0",
|
|
46
|
+
"@wordpress/interface": "^4.14.1-next.d6164808d3.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^3.13.1-next.d6164808d3.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.15.1-next.d6164808d3.0",
|
|
49
|
+
"@wordpress/media-utils": "^4.6.1-next.d6164808d3.0",
|
|
50
|
+
"@wordpress/notices": "^3.15.1-next.d6164808d3.0",
|
|
51
|
+
"@wordpress/plugins": "^4.13.1-next.d6164808d3.0",
|
|
52
|
+
"@wordpress/preferences": "^2.7.1-next.d6164808d3.0",
|
|
53
|
+
"@wordpress/reusable-blocks": "^3.13.1-next.d6164808d3.0",
|
|
54
|
+
"@wordpress/style-engine": "^0.14.1-next.d6164808d3.0",
|
|
55
|
+
"@wordpress/url": "^3.16.1-next.d6164808d3.0",
|
|
56
|
+
"@wordpress/viewport": "^4.13.1-next.d6164808d3.0",
|
|
57
57
|
"classnames": "^2.3.1",
|
|
58
58
|
"downloadjs": "^1.4.7",
|
|
59
59
|
"history": "^5.1.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ba8a396d2f418e53a6c4c50575582f3f3eb11ff7"
|
|
72
72
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
SearchControl,
|
|
12
12
|
TextHighlight,
|
|
13
13
|
__experimentalText as Text,
|
|
14
|
-
__experimentalHeading as Heading,
|
|
15
14
|
__unstableComposite as Composite,
|
|
16
15
|
__unstableUseCompositeState as useCompositeState,
|
|
17
16
|
__unstableCompositeItem as CompositeItem,
|
|
@@ -26,34 +25,6 @@ import { mapToIHasNameAndId } from './utils';
|
|
|
26
25
|
|
|
27
26
|
const EMPTY_ARRAY = [];
|
|
28
27
|
|
|
29
|
-
function selectSuggestion( suggestion, onSelect, entityForSuggestions ) {
|
|
30
|
-
const {
|
|
31
|
-
labels,
|
|
32
|
-
slug,
|
|
33
|
-
config: { templateSlug, templatePrefix },
|
|
34
|
-
} = entityForSuggestions;
|
|
35
|
-
const title = sprintf(
|
|
36
|
-
// translators: Represents the title of a user's custom template in the Site Editor, where %1$s is the singular name of a post type or taxonomy and %2$s is the name of the post or term, e.g. "Post: Hello, WordPress", "Category: shoes"
|
|
37
|
-
__( '%1$s: %2$s' ),
|
|
38
|
-
labels.singular_name,
|
|
39
|
-
suggestion.name
|
|
40
|
-
);
|
|
41
|
-
let newTemplateSlug = `${ templateSlug || slug }-${ suggestion.slug }`;
|
|
42
|
-
if ( templatePrefix ) {
|
|
43
|
-
newTemplateSlug = templatePrefix + newTemplateSlug;
|
|
44
|
-
}
|
|
45
|
-
const newTemplate = {
|
|
46
|
-
title,
|
|
47
|
-
description: sprintf(
|
|
48
|
-
// translators: Represents the description of a user's custom template in the Site Editor, e.g. "Template for Post: Hello, WordPress"
|
|
49
|
-
__( 'Template for %1$s' ),
|
|
50
|
-
title
|
|
51
|
-
),
|
|
52
|
-
slug: newTemplateSlug,
|
|
53
|
-
};
|
|
54
|
-
onSelect( newTemplate );
|
|
55
|
-
}
|
|
56
|
-
|
|
57
28
|
function SuggestionListItem( {
|
|
58
29
|
suggestion,
|
|
59
30
|
search,
|
|
@@ -70,7 +41,11 @@ function SuggestionListItem( {
|
|
|
70
41
|
{ ...composite }
|
|
71
42
|
className={ baseCssClass }
|
|
72
43
|
onClick={ () =>
|
|
73
|
-
|
|
44
|
+
onSelect(
|
|
45
|
+
entityForSuggestions.config.getSpecificTemplate(
|
|
46
|
+
suggestion
|
|
47
|
+
)
|
|
48
|
+
)
|
|
74
49
|
}
|
|
75
50
|
>
|
|
76
51
|
<span className={ `${ baseCssClass }__title` }>
|
|
@@ -98,18 +73,16 @@ function useDebouncedInput() {
|
|
|
98
73
|
}
|
|
99
74
|
|
|
100
75
|
function useSearchSuggestions( entityForSuggestions, search ) {
|
|
101
|
-
const { config
|
|
76
|
+
const { config } = entityForSuggestions;
|
|
102
77
|
const query = useMemo(
|
|
103
78
|
() => ( {
|
|
104
79
|
order: 'asc',
|
|
105
|
-
_fields: 'id,name,title,slug,link',
|
|
106
80
|
context: 'view',
|
|
107
81
|
search,
|
|
108
|
-
orderBy: config.getOrderBy( { search } ),
|
|
109
|
-
exclude: postsToExclude,
|
|
110
82
|
per_page: search ? 20 : 10,
|
|
83
|
+
...config.queryArgs( search ),
|
|
111
84
|
} ),
|
|
112
|
-
[ search, config
|
|
85
|
+
[ search, config ]
|
|
113
86
|
);
|
|
114
87
|
const { records: searchResults, hasResolved: searchHasResolved } =
|
|
115
88
|
useEntityRecords(
|
|
@@ -145,19 +118,26 @@ function SuggestionList( { entityForSuggestions, onSelect } ) {
|
|
|
145
118
|
debouncedSearch
|
|
146
119
|
);
|
|
147
120
|
const { labels } = entityForSuggestions;
|
|
121
|
+
const [ showSearchControl, setShowSearchControl ] = useState( false );
|
|
122
|
+
if ( ! showSearchControl && suggestions?.length > 9 ) {
|
|
123
|
+
setShowSearchControl( true );
|
|
124
|
+
}
|
|
148
125
|
return (
|
|
149
126
|
<>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
127
|
+
{ showSearchControl && (
|
|
128
|
+
<SearchControl
|
|
129
|
+
onChange={ setSearch }
|
|
130
|
+
value={ search }
|
|
131
|
+
label={ labels.search_items }
|
|
132
|
+
placeholder={ labels.search_items }
|
|
133
|
+
/>
|
|
134
|
+
) }
|
|
156
135
|
{ !! suggestions?.length && (
|
|
157
136
|
<Composite
|
|
158
137
|
{ ...composite }
|
|
159
138
|
role="listbox"
|
|
160
139
|
className="edit-site-custom-template-modal__suggestions_list"
|
|
140
|
+
aria-label={ __( 'Suggestions list' ) }
|
|
161
141
|
>
|
|
162
142
|
{ suggestions.map( ( suggestion ) => (
|
|
163
143
|
<SuggestionListItem
|
|
@@ -210,15 +190,25 @@ function AddCustomTemplateModal( { onClose, onSelect, entityForSuggestions } ) {
|
|
|
210
190
|
>
|
|
211
191
|
<FlexItem
|
|
212
192
|
isBlock
|
|
193
|
+
as={ Button }
|
|
213
194
|
onClick={ () => {
|
|
214
|
-
const {
|
|
215
|
-
|
|
216
|
-
|
|
195
|
+
const {
|
|
196
|
+
slug,
|
|
197
|
+
title,
|
|
198
|
+
description,
|
|
199
|
+
templatePrefix,
|
|
200
|
+
} = entityForSuggestions.template;
|
|
201
|
+
onSelect( {
|
|
202
|
+
slug,
|
|
203
|
+
title,
|
|
204
|
+
description,
|
|
205
|
+
templatePrefix,
|
|
206
|
+
} );
|
|
217
207
|
} }
|
|
218
208
|
>
|
|
219
|
-
<
|
|
209
|
+
<Text as="span" weight={ 600 }>
|
|
220
210
|
{ entityForSuggestions.labels.all_items }
|
|
221
|
-
</
|
|
211
|
+
</Text>
|
|
222
212
|
<Text as="span">
|
|
223
213
|
{
|
|
224
214
|
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
|
|
@@ -228,13 +218,14 @@ function AddCustomTemplateModal( { onClose, onSelect, entityForSuggestions } ) {
|
|
|
228
218
|
</FlexItem>
|
|
229
219
|
<FlexItem
|
|
230
220
|
isBlock
|
|
221
|
+
as={ Button }
|
|
231
222
|
onClick={ () => {
|
|
232
223
|
setShowSearchEntities( true );
|
|
233
224
|
} }
|
|
234
225
|
>
|
|
235
|
-
<
|
|
226
|
+
<Text as="span" weight={ 600 }>
|
|
236
227
|
{ entityForSuggestions.labels.singular_name }
|
|
237
|
-
</
|
|
228
|
+
</Text>
|
|
238
229
|
<Text as="span">
|
|
239
230
|
{
|
|
240
231
|
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import apiFetch from '@wordpress/api-fetch';
|
|
5
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
4
6
|
import {
|
|
5
7
|
DropdownMenu,
|
|
6
8
|
MenuGroup,
|
|
@@ -26,7 +28,7 @@ import {
|
|
|
26
28
|
tag,
|
|
27
29
|
layout as customGenericTemplateIcon,
|
|
28
30
|
} from '@wordpress/icons';
|
|
29
|
-
import { __ } from '@wordpress/i18n';
|
|
31
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
30
32
|
import { store as noticesStore } from '@wordpress/notices';
|
|
31
33
|
|
|
32
34
|
/**
|
|
@@ -36,13 +38,9 @@ import AddCustomTemplateModal from './add-custom-template-modal';
|
|
|
36
38
|
import {
|
|
37
39
|
useExistingTemplates,
|
|
38
40
|
useDefaultTemplateTypes,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
useTaxonomies,
|
|
43
|
-
useTaxonomyCategory,
|
|
44
|
-
useTaxonomyTag,
|
|
45
|
-
useExtraTemplates,
|
|
41
|
+
useTaxonomiesMenuItems,
|
|
42
|
+
usePostTypeMenuItems,
|
|
43
|
+
useAuthorMenuItem,
|
|
46
44
|
} from './utils';
|
|
47
45
|
import AddCustomGenericTemplateModal from './add-custom-generic-template-modal';
|
|
48
46
|
import { useHistory } from '../routes';
|
|
@@ -90,12 +88,25 @@ export default function NewTemplate( { postType } ) {
|
|
|
90
88
|
|
|
91
89
|
const history = useHistory();
|
|
92
90
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
93
|
-
const { createErrorNotice } =
|
|
91
|
+
const { createErrorNotice, createSuccessNotice } =
|
|
92
|
+
useDispatch( noticesStore );
|
|
94
93
|
const { setTemplate } = useDispatch( editSiteStore );
|
|
95
94
|
|
|
96
95
|
async function createTemplate( template, isWPSuggestion = true ) {
|
|
97
96
|
try {
|
|
98
|
-
const { title, description, slug } = template;
|
|
97
|
+
const { title, description, slug, templatePrefix } = template;
|
|
98
|
+
let templateContent = template.content;
|
|
99
|
+
// Try to find fallback content from existing templates.
|
|
100
|
+
if ( ! templateContent ) {
|
|
101
|
+
const fallbackTemplate = await apiFetch( {
|
|
102
|
+
path: addQueryArgs( '/wp/v2/templates/lookup', {
|
|
103
|
+
slug,
|
|
104
|
+
is_custom: ! isWPSuggestion,
|
|
105
|
+
template_prefix: templatePrefix,
|
|
106
|
+
} ),
|
|
107
|
+
} );
|
|
108
|
+
templateContent = fallbackTemplate.content;
|
|
109
|
+
}
|
|
99
110
|
const newTemplate = await saveEntityRecord(
|
|
100
111
|
'postType',
|
|
101
112
|
'wp_template',
|
|
@@ -105,6 +116,7 @@ export default function NewTemplate( { postType } ) {
|
|
|
105
116
|
slug: slug.toString(),
|
|
106
117
|
status: 'publish',
|
|
107
118
|
title,
|
|
119
|
+
content: templateContent,
|
|
108
120
|
// This adds a post meta field in template that is part of `is_custom` value calculation.
|
|
109
121
|
is_wp_suggestion: isWPSuggestion,
|
|
110
122
|
},
|
|
@@ -119,8 +131,16 @@ export default function NewTemplate( { postType } ) {
|
|
|
119
131
|
postId: newTemplate.id,
|
|
120
132
|
postType: newTemplate.type,
|
|
121
133
|
} );
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
createSuccessNotice(
|
|
135
|
+
sprintf(
|
|
136
|
+
// translators: %s: Title of the created template e.g: "Category".
|
|
137
|
+
__( '"%s" successfully created.' ),
|
|
138
|
+
title
|
|
139
|
+
),
|
|
140
|
+
{
|
|
141
|
+
type: 'snackbar',
|
|
142
|
+
}
|
|
143
|
+
);
|
|
124
144
|
} catch ( error ) {
|
|
125
145
|
const errorMessage =
|
|
126
146
|
error.message && error.code !== 'unknown_error'
|
|
@@ -225,19 +245,11 @@ function useMissingTemplates(
|
|
|
225
245
|
setEntityForSuggestions,
|
|
226
246
|
setShowCustomTemplateModal
|
|
227
247
|
) {
|
|
228
|
-
const postTypes = usePostTypes();
|
|
229
|
-
const pagePostType = usePostTypePage();
|
|
230
|
-
const taxonomies = useTaxonomies();
|
|
231
|
-
const categoryTaxonomy = useTaxonomyCategory();
|
|
232
|
-
const tagTaxonomy = useTaxonomyTag();
|
|
233
|
-
|
|
234
248
|
const existingTemplates = useExistingTemplates();
|
|
235
249
|
const defaultTemplateTypes = useDefaultTemplateTypes();
|
|
236
|
-
|
|
237
250
|
const existingTemplateSlugs = ( existingTemplates || [] ).map(
|
|
238
251
|
( { slug } ) => slug
|
|
239
252
|
);
|
|
240
|
-
|
|
241
253
|
const missingDefaultTemplates = ( defaultTemplateTypes || [] ).filter(
|
|
242
254
|
( template ) =>
|
|
243
255
|
DEFAULT_TEMPLATE_SLUGS.includes( template.slug ) &&
|
|
@@ -247,33 +259,27 @@ function useMissingTemplates(
|
|
|
247
259
|
setShowCustomTemplateModal( true );
|
|
248
260
|
setEntityForSuggestions( _entityForSuggestions );
|
|
249
261
|
};
|
|
250
|
-
// TODO: find better names for these variables. `useExtraTemplates` returns an array of items.
|
|
251
|
-
const categoryMenuItem = useExtraTemplates(
|
|
252
|
-
categoryTaxonomy,
|
|
253
|
-
entitiesConfig.category,
|
|
254
|
-
onClickMenuItem
|
|
255
|
-
);
|
|
256
|
-
const tagMenuItem = useExtraTemplates(
|
|
257
|
-
tagTaxonomy,
|
|
258
|
-
entitiesConfig.tag,
|
|
259
|
-
onClickMenuItem
|
|
260
|
-
);
|
|
261
|
-
const pageMenuItem = useExtraTemplates(
|
|
262
|
-
pagePostType,
|
|
263
|
-
entitiesConfig.page,
|
|
264
|
-
onClickMenuItem
|
|
265
|
-
);
|
|
266
262
|
// We need to replace existing default template types with
|
|
267
263
|
// the create specific template functionality. The original
|
|
268
264
|
// info (title, description, etc.) is preserved in the
|
|
269
|
-
//
|
|
265
|
+
// used hooks.
|
|
270
266
|
const enhancedMissingDefaultTemplateTypes = [ ...missingDefaultTemplates ];
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } =
|
|
268
|
+
useTaxonomiesMenuItems( onClickMenuItem );
|
|
269
|
+
const { defaultPostTypesMenuItems, postTypesMenuItems } =
|
|
270
|
+
usePostTypeMenuItems( onClickMenuItem );
|
|
271
|
+
|
|
272
|
+
const authorMenuItem = useAuthorMenuItem( onClickMenuItem );
|
|
273
|
+
[
|
|
274
|
+
...defaultTaxonomiesMenuItems,
|
|
275
|
+
...defaultPostTypesMenuItems,
|
|
276
|
+
authorMenuItem,
|
|
277
|
+
].forEach( ( menuItem ) => {
|
|
278
|
+
if ( ! menuItem ) {
|
|
273
279
|
return;
|
|
274
280
|
}
|
|
275
281
|
const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex(
|
|
276
|
-
( template ) => template.slug === menuItem
|
|
282
|
+
( template ) => template.slug === menuItem.slug
|
|
277
283
|
);
|
|
278
284
|
// Some default template types might have been filtered above from
|
|
279
285
|
// `missingDefaultTemplates` because they only check for the general
|
|
@@ -281,13 +287,9 @@ function useMissingTemplates(
|
|
|
281
287
|
// with the check if it has available specific item to create a
|
|
282
288
|
// template for.
|
|
283
289
|
if ( matchIndex > -1 ) {
|
|
284
|
-
enhancedMissingDefaultTemplateTypes
|
|
285
|
-
matchIndex,
|
|
286
|
-
1,
|
|
287
|
-
menuItem[ 0 ]
|
|
288
|
-
);
|
|
290
|
+
enhancedMissingDefaultTemplateTypes[ matchIndex ] = menuItem;
|
|
289
291
|
} else {
|
|
290
|
-
enhancedMissingDefaultTemplateTypes.push( menuItem
|
|
292
|
+
enhancedMissingDefaultTemplateTypes.push( menuItem );
|
|
291
293
|
}
|
|
292
294
|
} );
|
|
293
295
|
// Update the sort order to match the DEFAULT_TEMPLATE_SLUGS order.
|
|
@@ -297,20 +299,10 @@ function useMissingTemplates(
|
|
|
297
299
|
DEFAULT_TEMPLATE_SLUGS.indexOf( template2.slug )
|
|
298
300
|
);
|
|
299
301
|
} );
|
|
300
|
-
const extraPostTypeTemplates = useExtraTemplates(
|
|
301
|
-
postTypes,
|
|
302
|
-
entitiesConfig.postType,
|
|
303
|
-
onClickMenuItem
|
|
304
|
-
);
|
|
305
|
-
const extraTaxonomyTemplates = useExtraTemplates(
|
|
306
|
-
taxonomies,
|
|
307
|
-
entitiesConfig.taxonomy,
|
|
308
|
-
onClickMenuItem
|
|
309
|
-
);
|
|
310
302
|
const missingTemplates = [
|
|
311
303
|
...enhancedMissingDefaultTemplateTypes,
|
|
312
|
-
...
|
|
313
|
-
...
|
|
304
|
+
...postTypesMenuItems,
|
|
305
|
+
...taxonomiesMenuItems,
|
|
314
306
|
];
|
|
315
307
|
return missingTemplates;
|
|
316
308
|
}
|
|
@@ -12,33 +12,45 @@
|
|
|
12
12
|
|
|
13
13
|
.edit-site-custom-template-modal {
|
|
14
14
|
&__contents {
|
|
15
|
-
>
|
|
16
|
-
text-align: center;
|
|
17
|
-
cursor: pointer;
|
|
15
|
+
> .components-button {
|
|
18
16
|
padding: $grid-unit-30;
|
|
19
|
-
|
|
17
|
+
box-shadow: inset 0 0 0 $border-width $gray-600;
|
|
20
18
|
border-radius: $radius-block-ui;
|
|
21
19
|
width: 256px;
|
|
20
|
+
height: auto;
|
|
22
21
|
display: flex;
|
|
23
22
|
flex-direction: column;
|
|
24
23
|
gap: $grid-unit;
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
// Show the boundary of the button, in High Contrast Mode.
|
|
26
|
+
outline: 1px solid transparent;
|
|
27
|
+
|
|
28
|
+
span:first-child {
|
|
29
|
+
color: $gray-900;
|
|
30
|
+
}
|
|
27
31
|
|
|
28
32
|
span {
|
|
29
33
|
color: $gray-700;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
&:hover {
|
|
33
|
-
|
|
37
|
+
color: var(--wp-admin-theme-color-darker-10);
|
|
38
|
+
box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color-darker-10);
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
span:first-child {
|
|
36
41
|
color: var(--wp-admin-theme-color);
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
&:focus {
|
|
41
46
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
47
|
+
|
|
48
|
+
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
49
|
+
outline: 3px solid transparent;
|
|
50
|
+
|
|
51
|
+
span:first-child {
|
|
52
|
+
color: var(--wp-admin-theme-color);
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
}
|