@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-controls/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +14 -28
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +4 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -4
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +7 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/block-tools/index.js +12 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +156 -23
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +33 -25
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/url-input/index.js +3 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +5 -6
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +3 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +12 -8
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +27 -22
- package/build/utils/dom.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +15 -27
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +4 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -4
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +7 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/block-tools/index.js +13 -10
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +157 -24
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +33 -25
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/url-input/index.js +3 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +4 -4
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +3 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +12 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +25 -21
- package/build-module/utils/dom.js.map +1 -1
- package/build-style/content-rtl.css +30 -15
- package/build-style/content.css +30 -15
- package/build-style/style-rtl.css +92 -3
- package/build-style/style.css +92 -3
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/components/block-canvas/style.scss +1 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-inspector/style.scss +2 -1
- package/src/components/block-list/block.js +28 -48
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/index.story.js +2 -19
- package/src/components/block-popover/index.js +4 -4
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/change-design.js +1 -7
- package/src/components/block-toolbar/index.js +6 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/index.js +26 -10
- package/src/components/block-tools/style.scss +12 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -1
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +16 -3
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +204 -44
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +41 -37
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/components/rich-text/index.js +8 -1
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/url-input/index.js +3 -4
- package/src/components/use-block-commands/index.js +245 -234
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +6 -6
- package/src/hooks/utils.js +8 -3
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +6 -7
- package/src/store/selectors.js +60 -45
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/selectors.js +87 -58
- package/src/store/utils.js +12 -11
- package/src/style.scss +1 -0
- package/src/utils/dom.js +26 -21
- package/src/utils/test/dom.js +224 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
import { cloneBlock } from '@wordpress/blocks';
|
|
12
12
|
import { useMemo } from '@wordpress/element';
|
|
13
|
-
import { useAsyncList } from '@wordpress/compose';
|
|
14
13
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -81,10 +80,6 @@ export default function ChangeDesign( { clientId } ) {
|
|
|
81
80
|
.slice( 0, MAX_PATTERNS_TO_SHOW );
|
|
82
81
|
}, [ categories, currentPatternName, patterns ] );
|
|
83
82
|
|
|
84
|
-
const currentShownPatterns = useAsyncList(
|
|
85
|
-
sameCategoryPatternsWithSingleWrapper
|
|
86
|
-
);
|
|
87
|
-
|
|
88
83
|
if ( sameCategoryPatternsWithSingleWrapper.length < 2 ) {
|
|
89
84
|
return null;
|
|
90
85
|
}
|
|
@@ -121,10 +116,9 @@ export default function ChangeDesign( { clientId } ) {
|
|
|
121
116
|
paddingSize="none"
|
|
122
117
|
>
|
|
123
118
|
<BlockPatternsList
|
|
124
|
-
shownPatterns={ currentShownPatterns }
|
|
125
119
|
blockPatterns={ sameCategoryPatternsWithSingleWrapper }
|
|
126
120
|
onClickPattern={ onClickPattern }
|
|
127
|
-
|
|
121
|
+
showTitlesAsTooltip
|
|
128
122
|
/>
|
|
129
123
|
</DropdownContentWrapper>
|
|
130
124
|
) }
|
|
@@ -36,6 +36,7 @@ import __unstableBlockNameContext from './block-name-context';
|
|
|
36
36
|
import NavigableToolbar from '../navigable-toolbar';
|
|
37
37
|
import { useHasBlockToolbar } from './use-has-block-toolbar';
|
|
38
38
|
import ChangeDesign from './change-design';
|
|
39
|
+
import SwitchSectionStyle from './switch-section-style';
|
|
39
40
|
import { unlock } from '../../lock-unlock';
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -72,6 +73,7 @@ export function PrivateBlockToolbar( {
|
|
|
72
73
|
showSlots,
|
|
73
74
|
showGroupButtons,
|
|
74
75
|
showLockButtons,
|
|
76
|
+
showSwitchSectionStyleButton,
|
|
75
77
|
} = useSelect( ( select ) => {
|
|
76
78
|
const {
|
|
77
79
|
getBlockName,
|
|
@@ -141,6 +143,7 @@ export function PrivateBlockToolbar( {
|
|
|
141
143
|
showSlots: ! isZoomOut(),
|
|
142
144
|
showGroupButtons: ! isZoomOut(),
|
|
143
145
|
showLockButtons: ! isZoomOut(),
|
|
146
|
+
showSwitchSectionStyleButton: isZoomOut(),
|
|
144
147
|
};
|
|
145
148
|
}, [] );
|
|
146
149
|
|
|
@@ -222,6 +225,9 @@ export function PrivateBlockToolbar( {
|
|
|
222
225
|
{ showShuffleButton && (
|
|
223
226
|
<ChangeDesign clientId={ blockClientIds[ 0 ] } />
|
|
224
227
|
) }
|
|
228
|
+
{ showSwitchSectionStyleButton && (
|
|
229
|
+
<SwitchSectionStyle clientId={ blockClientIds[ 0 ] } />
|
|
230
|
+
) }
|
|
225
231
|
{ shouldShowVisualToolbar && showSlots && (
|
|
226
232
|
<>
|
|
227
233
|
<BlockControls.Slot
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
ToolbarButton,
|
|
6
|
+
ToolbarGroup,
|
|
7
|
+
Icon,
|
|
8
|
+
Path,
|
|
9
|
+
SVG,
|
|
10
|
+
} from '@wordpress/components';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
12
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
|
+
import { useContext } from '@wordpress/element';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import useStylesForBlocks from '../block-styles/use-styles-for-block';
|
|
19
|
+
import { replaceActiveStyle } from '../block-styles/utils';
|
|
20
|
+
import { store as blockEditorStore } from '../../store';
|
|
21
|
+
import { GlobalStylesContext } from '../global-styles';
|
|
22
|
+
import { globalStylesDataKey } from '../../store/private-keys';
|
|
23
|
+
import { getVariationStylesWithRefValues } from '../../hooks/block-style-variation';
|
|
24
|
+
|
|
25
|
+
const styleIcon = (
|
|
26
|
+
<SVG
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
width="24"
|
|
30
|
+
height="24"
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
focusable="false"
|
|
33
|
+
>
|
|
34
|
+
<Path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z" />
|
|
35
|
+
<Path
|
|
36
|
+
stroke="currentColor"
|
|
37
|
+
strokeWidth="1.5"
|
|
38
|
+
d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"
|
|
39
|
+
/>
|
|
40
|
+
</SVG>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
function SwitchSectionStyle( { clientId } ) {
|
|
44
|
+
const { stylesToRender, activeStyle, className } = useStylesForBlocks( {
|
|
45
|
+
clientId,
|
|
46
|
+
} );
|
|
47
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
48
|
+
|
|
49
|
+
// Get global styles data
|
|
50
|
+
const { merged: mergedConfig } = useContext( GlobalStylesContext );
|
|
51
|
+
const { globalSettings, globalStyles, blockName } = useSelect(
|
|
52
|
+
( select ) => {
|
|
53
|
+
const settings = select( blockEditorStore ).getSettings();
|
|
54
|
+
return {
|
|
55
|
+
globalSettings: settings.__experimentalFeatures,
|
|
56
|
+
globalStyles: settings[ globalStylesDataKey ],
|
|
57
|
+
blockName: select( blockEditorStore ).getBlockName( clientId ),
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
[ clientId ]
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Get the background color for the active style
|
|
64
|
+
const activeStyleBackground = activeStyle?.name
|
|
65
|
+
? getVariationStylesWithRefValues(
|
|
66
|
+
{
|
|
67
|
+
settings: mergedConfig?.settings ?? globalSettings,
|
|
68
|
+
styles: mergedConfig?.styles ?? globalStyles,
|
|
69
|
+
},
|
|
70
|
+
blockName,
|
|
71
|
+
activeStyle.name
|
|
72
|
+
)?.color?.background
|
|
73
|
+
: undefined;
|
|
74
|
+
|
|
75
|
+
if ( ! stylesToRender || stylesToRender.length === 0 ) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const handleStyleSwitch = () => {
|
|
80
|
+
const currentIndex = stylesToRender.findIndex(
|
|
81
|
+
( style ) => style.name === activeStyle.name
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const nextIndex = ( currentIndex + 1 ) % stylesToRender.length;
|
|
85
|
+
const nextStyle = stylesToRender[ nextIndex ];
|
|
86
|
+
|
|
87
|
+
const styleClassName = replaceActiveStyle(
|
|
88
|
+
className,
|
|
89
|
+
activeStyle,
|
|
90
|
+
nextStyle
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
updateBlockAttributes( clientId, {
|
|
94
|
+
className: styleClassName,
|
|
95
|
+
} );
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<ToolbarGroup>
|
|
100
|
+
<ToolbarButton
|
|
101
|
+
onClick={ handleStyleSwitch }
|
|
102
|
+
label={ __( 'Shuffle styles' ) }
|
|
103
|
+
>
|
|
104
|
+
<Icon
|
|
105
|
+
icon={ styleIcon }
|
|
106
|
+
style={ {
|
|
107
|
+
fill: activeStyleBackground || 'transparent',
|
|
108
|
+
} }
|
|
109
|
+
/>
|
|
110
|
+
</ToolbarButton>
|
|
111
|
+
</ToolbarGroup>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default SwitchSectionStyle;
|
|
@@ -8,7 +8,7 @@ import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordp
|
|
|
8
8
|
import { useRef } from '@wordpress/element';
|
|
9
9
|
import { switchToBlockType, store as blocksStore } from '@wordpress/blocks';
|
|
10
10
|
import { speak } from '@wordpress/a11y';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
+
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
@@ -92,19 +92,35 @@ export default function BlockTools( {
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
if (
|
|
95
|
+
if (
|
|
96
|
+
isMatch( 'core/block-editor/move-up', event ) ||
|
|
97
|
+
isMatch( 'core/block-editor/move-down', event )
|
|
98
|
+
) {
|
|
96
99
|
const clientIds = getSelectedBlockClientIds();
|
|
97
100
|
if ( clientIds.length ) {
|
|
98
101
|
event.preventDefault();
|
|
99
102
|
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
const direction = isMatch( 'core/block-editor/move-up', event )
|
|
104
|
+
? 'up'
|
|
105
|
+
: 'down';
|
|
106
|
+
if ( direction === 'up' ) {
|
|
107
|
+
moveBlocksUp( clientIds, rootClientId );
|
|
108
|
+
} else {
|
|
109
|
+
moveBlocksDown( clientIds, rootClientId );
|
|
110
|
+
}
|
|
111
|
+
const blockLength = Array.isArray( clientIds )
|
|
112
|
+
? clientIds.length
|
|
113
|
+
: 1;
|
|
114
|
+
const message = sprintf(
|
|
115
|
+
// translators: %d: the name of the block that has been moved
|
|
116
|
+
_n(
|
|
117
|
+
'%d block moved.',
|
|
118
|
+
'%d blocks moved.',
|
|
119
|
+
clientIds.length
|
|
120
|
+
),
|
|
121
|
+
blockLength
|
|
122
|
+
);
|
|
123
|
+
speak( message );
|
|
108
124
|
}
|
|
109
125
|
} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {
|
|
110
126
|
const clientIds = getSelectedBlockClientIds();
|
|
@@ -57,6 +57,18 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// The black plus that shows up on the right side of an empty paragraph block.
|
|
61
|
+
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
line-height: 0;
|
|
66
|
+
|
|
67
|
+
&:disabled {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
// Sibling inserter / "inbetweenserter".
|
|
61
73
|
.block-editor-block-list__empty-block-inserter,
|
|
62
74
|
.block-editor-block-list__insertion-point-inserter {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
18
|
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
19
19
|
import { hasStickyOrFixedPositionValue } from '../../hooks/position';
|
|
20
|
-
import {
|
|
20
|
+
import { getElementBounds } from '../../utils/dom';
|
|
21
21
|
|
|
22
22
|
const COMMON_PROPS = {
|
|
23
23
|
placement: 'top-start',
|
|
@@ -68,7 +68,7 @@ function getProps(
|
|
|
68
68
|
// Get how far the content area has been scrolled.
|
|
69
69
|
const scrollTop = scrollContainer?.scrollTop || 0;
|
|
70
70
|
|
|
71
|
-
const blockRect =
|
|
71
|
+
const blockRect = getElementBounds( selectedBlockElement );
|
|
72
72
|
const contentRect = contentElement.getBoundingClientRect();
|
|
73
73
|
|
|
74
74
|
// Get the vertical position of top of the visible content area.
|
|
@@ -40,7 +40,9 @@ export function useShowBlockTools() {
|
|
|
40
40
|
const _showEmptyBlockSideInserter =
|
|
41
41
|
clientId &&
|
|
42
42
|
! isTyping() &&
|
|
43
|
-
|
|
43
|
+
// Hide the block inserter on the navigation mode.
|
|
44
|
+
// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
|
|
45
|
+
editorMode !== 'navigation' &&
|
|
44
46
|
isEmptyDefaultBlock;
|
|
45
47
|
const _showBlockToolbarPopover =
|
|
46
48
|
! getSettings().hasFixedToolbar &&
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createSlotFill } from '@wordpress/components';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
'__unstableCommentIconFill'
|
|
8
|
-
);
|
|
6
|
+
const CommentIconSlotFill = createSlotFill( Symbol( 'CommentIconSlotFill' ) );
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export default __unstableCommentIconFill;
|
|
8
|
+
export default CommentIconSlotFill;
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createSlotFill } from '@wordpress/components';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
'
|
|
6
|
+
const CommentIconToolbarSlotFill = createSlotFill(
|
|
7
|
+
Symbol( 'CommentIconToolbarSlotFill' )
|
|
8
8
|
);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export default __unstableCommentIconToolbarFill;
|
|
10
|
+
export default CommentIconToolbarSlotFill;
|
|
@@ -10,14 +10,32 @@ import { useSettings } from '../use-settings';
|
|
|
10
10
|
|
|
11
11
|
export default createHigherOrderComponent( ( WrappedComponent ) => {
|
|
12
12
|
return ( props ) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// Get the default colors, theme colors, and custom colors
|
|
14
|
+
const [
|
|
15
|
+
defaultColors,
|
|
16
|
+
themeColors,
|
|
17
|
+
customColors,
|
|
18
|
+
enableCustomColors,
|
|
19
|
+
enableDefaultColors,
|
|
20
|
+
] = useSettings(
|
|
21
|
+
'color.palette.default',
|
|
22
|
+
'color.palette.theme',
|
|
23
|
+
'color.palette.custom',
|
|
24
|
+
'color.custom',
|
|
25
|
+
'color.defaultPalette'
|
|
16
26
|
);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
|
|
28
|
+
const _colors = enableDefaultColors
|
|
29
|
+
? [
|
|
30
|
+
...( themeColors || [] ),
|
|
31
|
+
...( defaultColors || [] ),
|
|
32
|
+
...( customColors || [] ),
|
|
33
|
+
]
|
|
34
|
+
: [ ...( themeColors || [] ), ...( customColors || [] ) ];
|
|
35
|
+
|
|
36
|
+
const { colors = _colors, disableCustomColors = ! enableCustomColors } =
|
|
37
|
+
props;
|
|
38
|
+
|
|
21
39
|
const hasColorsToChoose =
|
|
22
40
|
( colors && colors.length > 0 ) || ! disableCustomColors;
|
|
23
41
|
return (
|
|
@@ -24,20 +24,11 @@
|
|
|
24
24
|
.block-editor-default-block-appender__content {
|
|
25
25
|
// Set the opacity of the initial block appender to the same as placeholder text in an empty Paragraph block.
|
|
26
26
|
opacity: 0.62;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// In "constrained" layout containers, the first and last paragraphs have their margins zeroed out.
|
|
30
|
-
// In the case of this appender, it needs to apply those same rules to avoid layout shifts.
|
|
31
|
-
// Such shifts happen when the bottom margin of the Title block has been set to less than the default 1em margin of paragraphs.
|
|
32
|
-
:where(body .is-layout-constrained) &,
|
|
33
|
-
:where(.wp-site-blocks) & {
|
|
34
|
-
> :first-child {
|
|
35
|
-
margin-block-start: 0;
|
|
36
|
-
margin-block-end: 0;
|
|
37
|
-
}
|
|
38
27
|
|
|
39
|
-
//
|
|
40
|
-
// This
|
|
28
|
+
// The following prevents user agent styles from applying margins to the appender's inner paragraph.
|
|
29
|
+
// This in turn prevents layout shift due to layout styles removing margins from first and last children.
|
|
30
|
+
margin-block-start: 0;
|
|
31
|
+
margin-block-end: 0;
|
|
41
32
|
}
|
|
42
33
|
|
|
43
34
|
// Dropzone.
|
|
@@ -62,9 +53,7 @@
|
|
|
62
53
|
}
|
|
63
54
|
}
|
|
64
55
|
|
|
65
|
-
// The
|
|
66
|
-
// that exists only on empty documents.
|
|
67
|
-
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
|
|
56
|
+
// The initial appender that exists only on empty documents.
|
|
68
57
|
.block-editor-default-block-appender .block-editor-inserter {
|
|
69
58
|
position: absolute;
|
|
70
59
|
top: 0;
|
|
@@ -76,10 +65,11 @@
|
|
|
76
65
|
}
|
|
77
66
|
}
|
|
78
67
|
|
|
79
|
-
|
|
80
68
|
/**
|
|
81
|
-
* Fixed position appender.
|
|
82
|
-
*
|
|
69
|
+
* Fixed position appender (right bottom corner).
|
|
70
|
+
*
|
|
71
|
+
* These styles apply to all in-canvas inserters. All in-canvas inserters always
|
|
72
|
+
* exist within a block.
|
|
83
73
|
*/
|
|
84
74
|
|
|
85
75
|
.block-editor-block-list__block .block-list-appender {
|
|
@@ -96,6 +86,10 @@
|
|
|
96
86
|
line-height: 0;
|
|
97
87
|
}
|
|
98
88
|
|
|
89
|
+
.block-editor-inserter:disabled {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
99
93
|
.block-editor-default-block-appender {
|
|
100
94
|
height: $button-size-small;
|
|
101
95
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { CustomSelectControl } from '@wordpress/components';
|
|
5
5
|
import deprecated from '@wordpress/deprecated';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
@@ -30,13 +30,15 @@ export default function FontFamilyControl( {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const options = [
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
{
|
|
34
|
+
key: '',
|
|
35
|
+
name: __( 'Default' ),
|
|
36
|
+
},
|
|
37
|
+
...fontFamilies.map( ( { fontFamily, name } ) => ( {
|
|
38
|
+
key: fontFamily,
|
|
39
|
+
name: name || fontFamily,
|
|
40
|
+
style: { fontFamily },
|
|
41
|
+
} ) ),
|
|
40
42
|
];
|
|
41
43
|
|
|
42
44
|
if ( ! __nextHasNoMarginBottom ) {
|
|
@@ -51,14 +53,12 @@ export default function FontFamilyControl( {
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
return (
|
|
54
|
-
<
|
|
56
|
+
<CustomSelectControl
|
|
55
57
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
56
|
-
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
57
58
|
label={ __( 'Font' ) }
|
|
58
|
-
options={ options }
|
|
59
59
|
value={ value }
|
|
60
|
-
onChange={ onChange }
|
|
61
|
-
|
|
60
|
+
onChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }
|
|
61
|
+
options={ options }
|
|
62
62
|
{ ...props }
|
|
63
63
|
/>
|
|
64
64
|
);
|
|
@@ -147,24 +147,30 @@ function splitStyleValue( value ) {
|
|
|
147
147
|
return value;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
function splitGapValue( value ) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// If the value is a string, treat it as a single side (top) for the spacing controls.
|
|
154
|
-
return {
|
|
155
|
-
top: value,
|
|
156
|
-
};
|
|
150
|
+
function splitGapValue( value, isAxialGap ) {
|
|
151
|
+
if ( ! value ) {
|
|
152
|
+
return value;
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
155
|
+
// Check for shorthand value (a string value).
|
|
156
|
+
if ( typeof value === 'string' ) {
|
|
157
|
+
/*
|
|
158
|
+
* Map the string value to appropriate sides for the spacing control depending
|
|
159
|
+
* on whether the current block has axial gap support or not.
|
|
160
|
+
*
|
|
161
|
+
* Note: The axial value pairs must match for the spacing control to display
|
|
162
|
+
* the appropriate horizontal/vertical sliders.
|
|
163
|
+
*/
|
|
164
|
+
return isAxialGap
|
|
165
|
+
? { top: value, right: value, bottom: value, left: value }
|
|
166
|
+
: { top: value };
|
|
165
167
|
}
|
|
166
168
|
|
|
167
|
-
return
|
|
169
|
+
return {
|
|
170
|
+
...value,
|
|
171
|
+
right: value?.left,
|
|
172
|
+
bottom: value?.top,
|
|
173
|
+
};
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
function DimensionsToolsPanel( {
|
|
@@ -325,13 +331,13 @@ export default function DimensionsPanel( {
|
|
|
325
331
|
|
|
326
332
|
// Block Gap
|
|
327
333
|
const showGapControl = useHasGap( settings );
|
|
328
|
-
const gapValue = decodeValue( inheritedValue?.spacing?.blockGap );
|
|
329
|
-
const gapValues = splitGapValue( gapValue );
|
|
330
334
|
const gapSides = Array.isArray( settings?.spacing?.blockGap )
|
|
331
335
|
? settings?.spacing?.blockGap
|
|
332
336
|
: settings?.spacing?.blockGap?.sides;
|
|
333
337
|
const isAxialGap =
|
|
334
338
|
gapSides && gapSides.some( ( side ) => AXIAL_SIDES.includes( side ) );
|
|
339
|
+
const gapValue = decodeValue( inheritedValue?.spacing?.blockGap );
|
|
340
|
+
const gapValues = splitGapValue( gapValue, isAxialGap );
|
|
335
341
|
const setGapValue = ( newGapValue ) => {
|
|
336
342
|
onChange(
|
|
337
343
|
setImmutably( value, [ 'spacing', 'blockGap' ], newGapValue )
|
|
@@ -855,7 +855,7 @@ describe( 'global styles renderer', () => {
|
|
|
855
855
|
|
|
856
856
|
it( 'should return block selectors data with old experimental selectors', () => {
|
|
857
857
|
const imageSupports = {
|
|
858
|
-
|
|
858
|
+
border: {
|
|
859
859
|
radius: true,
|
|
860
860
|
__experimentalSelector: 'img, .crop-area',
|
|
861
861
|
},
|
|
@@ -47,7 +47,7 @@ const ELEMENT_CLASS_NAMES = {
|
|
|
47
47
|
// List of block support features that can have their related styles
|
|
48
48
|
// generated under their own feature level selector rather than the block's.
|
|
49
49
|
const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {
|
|
50
|
-
|
|
50
|
+
border: 'border',
|
|
51
51
|
color: 'color',
|
|
52
52
|
spacing: 'spacing',
|
|
53
53
|
typography: 'typography',
|
|
@@ -7,13 +7,26 @@
|
|
|
7
7
|
// We don't want to animate the transform of the translateX because it is used
|
|
8
8
|
// to "center" the canvas. Leaving it on causes the canvas to slide around in
|
|
9
9
|
// odd ways.
|
|
10
|
-
@include editor-canvas-resize-animation(transform 0s, scale 0s, padding 0s);
|
|
10
|
+
@include editor-canvas-resize-animation( transform 0s, scale 0s, padding 0s, translate 0s);
|
|
11
11
|
|
|
12
12
|
&.zoom-out-animation {
|
|
13
|
-
|
|
13
|
+
$scroll-top: var(--wp-block-editor-iframe-zoom-out-scroll-top, 0);
|
|
14
|
+
$scroll-top-next: var(--wp-block-editor-iframe-zoom-out-scroll-top-next, 0);
|
|
15
|
+
|
|
16
|
+
position: fixed;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
top: calc(-1 * #{$scroll-top});
|
|
20
|
+
bottom: 0;
|
|
21
|
+
translate: 0 calc(#{$scroll-top} - #{$scroll-top-next});
|
|
22
|
+
// Force preserving a scrollbar gutter as scrollbar-gutter isn't supported in all browsers yet,
|
|
23
|
+
// and removing the scrollbar causes the content to shift.
|
|
24
|
+
overflow-y: scroll;
|
|
25
|
+
|
|
26
|
+
// We only want to animate the scaling when entering zoom out. When sidebars
|
|
14
27
|
// are toggled, the resizing of the iframe handles scaling the canvas as well,
|
|
15
28
|
// and the doubled animations cause very odd animations.
|
|
16
|
-
@include editor-canvas-resize-animation(transform 0s);
|
|
29
|
+
@include editor-canvas-resize-animation( transform 0s, top 0s, bottom 0s, right 0s, left 0s );
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
|
|
@@ -37,15 +37,10 @@ export function getCompatibilityStyles() {
|
|
|
37
37
|
return accumulator;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
// Don't try to add
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
if (
|
|
44
|
-
[
|
|
45
|
-
'wp-reset-editor-styles-css',
|
|
46
|
-
'wp-reset-editor-styles-rtl-css',
|
|
47
|
-
].includes( ownerNode.id )
|
|
48
|
-
) {
|
|
40
|
+
// Don't try to add core WP styles. We are responsible for adding
|
|
41
|
+
// them. This compatibility layer is only meant to add styles added
|
|
42
|
+
// by plugins or themes.
|
|
43
|
+
if ( ownerNode.id.startsWith( 'wp-' ) ) {
|
|
49
44
|
return accumulator;
|
|
50
45
|
}
|
|
51
46
|
|