@wordpress/block-editor 12.0.0 → 12.1.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/README.md +1 -1
- package/build/components/block-controls/slot.js +12 -4
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +10 -1
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/index.js +11 -7
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +15 -7
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +15 -2
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +158 -195
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +57 -0
- package/build/components/block-list/block-outline.native.js.map +1 -0
- package/build/components/block-list/block.native.js +343 -299
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +202 -298
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +4 -2
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +8 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +15 -4
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +17 -62
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +3 -8
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +86 -0
- package/build/components/global-styles/advanced-panel.js.map +1 -0
- package/build/components/global-styles/color-panel.js +4 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +6 -6
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +24 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +27 -4
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +30 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +24 -8
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +5 -0
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/fill.js +1 -1
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +1 -1
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/slot.js +3 -6
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +1 -1
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/line-height-control/index.js +7 -2
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +9 -8
- package/build/components/link-control/use-internal-input-value.js.map +1 -1
- package/build/components/list-view/block-contents.js +7 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +4 -4
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +32 -18
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +163 -11
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-placeholder/index.js +68 -7
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +2 -2
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +3 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build/components/preview-options/index.js +6 -1
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +1 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/hooks/align.js +1 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/border.js +1 -1
- 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/content-lock-ui.js +8 -12
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/duotone.js +1 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.native.js +8 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +2 -2
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +1 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-editor-wrapper-styles.native.js +255 -0
- package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build/hooks/use-typography-props.js +14 -10
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/index.native.js +31 -0
- package/build/index.native.js.map +1 -0
- package/build/utils/use-should-contextual-toolbar-show.js +16 -12
- package/build/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-module/components/block-controls/slot.js +11 -4
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +9 -1
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/index.js +10 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.js +2 -2
- package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +16 -8
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +13 -2
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +160 -190
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +44 -0
- package/build-module/components/block-list/block-outline.native.js.map +1 -0
- package/build-module/components/block-list/block.native.js +341 -298
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +203 -293
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +4 -2
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -9
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +13 -5
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +18 -62
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +3 -7
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +74 -0
- package/build-module/components/global-styles/advanced-panel.js.map +1 -0
- package/build-module/components/global-styles/color-panel.js +5 -2
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +6 -6
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +3 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +25 -4
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +25 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +24 -8
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -0
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -1
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +1 -1
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +4 -7
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +1 -1
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/line-height-control/index.js +7 -2
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +9 -8
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +7 -3
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -1
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +4 -4
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +32 -18
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +160 -11
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +66 -7
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +2 -2
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +3 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
- package/build-module/components/preview-options/index.js +7 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/hooks/align.js +1 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/border.js +1 -1
- 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/content-lock-ui.js +8 -11
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/duotone.js +1 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +2 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +1 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +1 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-editor-wrapper-styles.native.js +242 -0
- package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -0
- package/build-module/hooks/use-typography-props.js +14 -10
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/index.native.js +6 -0
- package/build-module/index.native.js.map +1 -0
- package/build-module/utils/use-should-contextual-toolbar-show.js +16 -12
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -1
- package/build-style/content-rtl.css +0 -1
- package/build-style/content.css +0 -1
- package/build-style/style-rtl.css +37 -13
- package/build-style/style.css +37 -13
- package/package.json +31 -31
- package/src/components/block-breadcrumb/style.scss +2 -1
- package/src/components/block-controls/slot.js +8 -4
- package/src/components/block-controls/slot.native.js +6 -1
- package/src/components/block-draggable/index.js +10 -6
- package/src/components/block-draggable/use-scroll-when-dragging.js +8 -2
- package/src/components/block-list/block-invalid-warning.native.js +17 -9
- package/src/components/block-list/block-list-item-cell.native.js +10 -1
- package/src/components/block-list/block-list-item.native.js +180 -208
- package/src/components/block-list/block-outline.native.js +58 -0
- package/src/components/block-list/block.native.js +564 -523
- package/src/components/block-list/content.scss +0 -1
- package/src/components/block-list/index.native.js +229 -298
- package/src/components/block-list/insertion-point.native.js +2 -2
- package/src/components/block-list/test/block-invalid-warning.native.js +48 -0
- package/src/components/block-list/test/index.native.js +205 -0
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -1
- package/src/components/block-pattern-setup/style.scss +1 -4
- package/src/components/block-patterns-list/style.scss +1 -4
- package/src/components/block-settings-menu/block-settings-dropdown.js +10 -17
- package/src/components/block-settings-menu-controls/index.js +24 -4
- package/src/components/block-styles/style.scss +4 -4
- package/src/components/block-tools/block-contextual-toolbar.js +28 -62
- package/src/components/block-tools/selected-block-popover.js +3 -5
- package/src/components/block-tools/style.scss +8 -0
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +16 -2
- package/src/components/global-styles/advanced-panel.js +82 -0
- package/src/components/global-styles/color-panel.js +6 -1
- package/src/components/global-styles/dimensions-panel.js +6 -6
- package/src/components/global-styles/hooks.js +1 -5
- package/src/components/global-styles/index.js +6 -1
- package/src/components/global-styles/style.scss +14 -0
- package/src/components/global-styles/test/utils.js +57 -1
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +21 -3
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/image-editor/use-save-image.js +20 -9
- package/src/components/inserter-draggable-blocks/index.js +4 -0
- package/src/components/inspector-controls/fill.js +1 -1
- package/src/components/inspector-controls/fill.native.js +1 -1
- package/src/components/inspector-controls/slot.js +4 -9
- package/src/components/inspector-controls/slot.native.js +1 -1
- package/src/components/line-height-control/index.js +7 -2
- package/src/components/line-height-control/stories/index.js +1 -1
- package/src/components/link-control/test/index.js +42 -0
- package/src/components/link-control/use-internal-input-value.js +8 -7
- package/src/components/list-view/block-contents.js +26 -20
- package/src/components/list-view/block-select-button.js +5 -1
- package/src/components/list-view/block.js +5 -2
- package/src/components/list-view/index.js +26 -14
- package/src/components/list-view/style.scss +5 -2
- package/src/components/list-view/test/use-list-view-drop-zone.js +88 -12
- package/src/components/list-view/use-list-view-drop-zone.js +194 -11
- package/src/components/media-placeholder/index.js +74 -1
- package/src/components/multi-selection-inspector/index.js +2 -2
- package/src/components/off-canvas-editor/leaf-more-menu.js +2 -1
- package/src/components/preview-options/index.js +9 -2
- package/src/components/spacing-sizes-control/spacing-input-control.js +1 -0
- package/src/components/url-input/index.js +1 -2
- package/src/hooks/align.js +2 -1
- package/src/hooks/border.js +2 -1
- package/src/hooks/color.js +2 -1
- package/src/hooks/content-lock-ui.js +3 -15
- package/src/hooks/duotone.js +1 -0
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/layout.js +4 -2
- package/src/hooks/position.js +2 -1
- package/src/hooks/style.js +2 -1
- package/src/hooks/test/use-editor-wrapper-styles.native.js +282 -0
- package/src/hooks/test/use-typography-props.js +47 -2
- package/src/hooks/use-editor-wrapper-styles.native.js +250 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +11 -0
- package/src/hooks/use-typography-props.js +10 -11
- package/src/index.native.js +6 -0
- package/src/utils/use-should-contextual-toolbar-show.js +19 -9
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -13,16 +13,15 @@ import { unlock } from '../lock-unlock';
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns true if the contextual block toolbar should show, or false if it should be hidden.
|
|
15
15
|
*
|
|
16
|
-
* @param {string} clientId The client ID of the block.
|
|
17
|
-
*
|
|
18
16
|
* @return {boolean} Whether the block toolbar is hidden.
|
|
19
17
|
*/
|
|
20
18
|
|
|
21
|
-
export function useShouldContextualToolbarShow(
|
|
19
|
+
export function useShouldContextualToolbarShow() {
|
|
22
20
|
const isLargeViewport = useViewportMatch('medium');
|
|
23
21
|
const {
|
|
24
22
|
shouldShowContextualToolbar,
|
|
25
|
-
canFocusHiddenToolbar
|
|
23
|
+
canFocusHiddenToolbar,
|
|
24
|
+
fixedToolbarCanBeFocused
|
|
26
25
|
} = useSelect(select => {
|
|
27
26
|
const {
|
|
28
27
|
__unstableGetEditorMode,
|
|
@@ -31,26 +30,31 @@ export function useShouldContextualToolbarShow(clientId) {
|
|
|
31
30
|
isBlockInterfaceHidden,
|
|
32
31
|
getBlock,
|
|
33
32
|
getSettings,
|
|
34
|
-
isNavigationMode
|
|
33
|
+
isNavigationMode,
|
|
34
|
+
getSelectedBlockClientId,
|
|
35
|
+
getFirstMultiSelectedBlockClientId
|
|
35
36
|
} = unlock(select(blockEditorStore));
|
|
36
37
|
const isEditMode = __unstableGetEditorMode() === 'edit';
|
|
37
38
|
const hasFixedToolbar = getSettings().hasFixedToolbar;
|
|
38
39
|
const isDistractionFree = getSettings().isDistractionFree;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
40
|
+
const selectedBlockId = getFirstMultiSelectedBlockClientId() || getSelectedBlockClientId();
|
|
41
|
+
const hasSelectedBlockId = !!selectedBlockId;
|
|
42
|
+
const isEmptyDefaultBlock = isUnmodifiedDefaultBlock(getBlock(selectedBlockId) || {});
|
|
41
43
|
|
|
42
|
-
const _shouldShowContextualToolbar = isEditMode && !hasFixedToolbar && (!isDistractionFree || isNavigationMode()) && isLargeViewport && !isMultiSelecting() && !isTyping() &&
|
|
44
|
+
const _shouldShowContextualToolbar = isEditMode && !hasFixedToolbar && (!isDistractionFree || isNavigationMode()) && isLargeViewport && !isMultiSelecting() && !isTyping() && hasSelectedBlockId && !isEmptyDefaultBlock && !isBlockInterfaceHidden();
|
|
43
45
|
|
|
44
|
-
const _canFocusHiddenToolbar = isEditMode &&
|
|
46
|
+
const _canFocusHiddenToolbar = isEditMode && hasSelectedBlockId && !_shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
|
|
45
47
|
|
|
46
48
|
return {
|
|
47
49
|
shouldShowContextualToolbar: _shouldShowContextualToolbar,
|
|
48
|
-
canFocusHiddenToolbar: _canFocusHiddenToolbar
|
|
50
|
+
canFocusHiddenToolbar: _canFocusHiddenToolbar,
|
|
51
|
+
fixedToolbarCanBeFocused: (hasFixedToolbar || !isLargeViewport) && selectedBlockId
|
|
49
52
|
};
|
|
50
|
-
}, [
|
|
53
|
+
}, [isLargeViewport]);
|
|
51
54
|
return {
|
|
52
55
|
shouldShowContextualToolbar,
|
|
53
|
-
canFocusHiddenToolbar
|
|
56
|
+
canFocusHiddenToolbar,
|
|
57
|
+
fixedToolbarCanBeFocused
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
60
|
//# sourceMappingURL=use-should-contextual-toolbar-show.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/use-should-contextual-toolbar-show.js"],"names":["useSelect","isUnmodifiedDefaultBlock","useViewportMatch","store","blockEditorStore","unlock","useShouldContextualToolbarShow","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/use-should-contextual-toolbar-show.js"],"names":["useSelect","isUnmodifiedDefaultBlock","useViewportMatch","store","blockEditorStore","unlock","useShouldContextualToolbarShow","isLargeViewport","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","select","__unstableGetEditorMode","isMultiSelecting","isTyping","isBlockInterfaceHidden","getBlock","getSettings","isNavigationMode","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","isEditMode","hasFixedToolbar","isDistractionFree","selectedBlockId","hasSelectedBlockId","isEmptyDefaultBlock","_shouldShowContextualToolbar","_canFocusHiddenToolbar"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,wBAAT,QAAyC,mBAAzC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AACA,SAASC,MAAT,QAAuB,gBAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,8BAAT,GAA0C;AAChD,QAAMC,eAAe,GAAGL,gBAAgB,CAAE,QAAF,CAAxC;AAEA,QAAM;AACLM,IAAAA,2BADK;AAELC,IAAAA,qBAFK;AAGLC,IAAAA;AAHK,MAIFV,SAAS,CACVW,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,uBADK;AAELC,MAAAA,gBAFK;AAGLC,MAAAA,QAHK;AAILC,MAAAA,sBAJK;AAKLC,MAAAA,QALK;AAMLC,MAAAA,WANK;AAOLC,MAAAA,gBAPK;AAQLC,MAAAA,wBARK;AASLC,MAAAA;AATK,QAUFf,MAAM,CAAEM,MAAM,CAAEP,gBAAF,CAAR,CAVV;AAYA,UAAMiB,UAAU,GAAGT,uBAAuB,OAAO,MAAjD;AACA,UAAMU,eAAe,GAAGL,WAAW,GAAGK,eAAtC;AACA,UAAMC,iBAAiB,GAAGN,WAAW,GAAGM,iBAAxC;AACA,UAAMC,eAAe,GACpBJ,kCAAkC,MAClCD,wBAAwB,EAFzB;AAGA,UAAMM,kBAAkB,GAAG,CAAC,CAAED,eAA9B;AACA,UAAME,mBAAmB,GAAGzB,wBAAwB,CACnDe,QAAQ,CAAEQ,eAAF,CAAR,IAA+B,EADoB,CAApD;;AAIA,UAAMG,4BAA4B,GACjCN,UAAU,IACV,CAAEC,eADF,KAEE,CAAEC,iBAAF,IAAuBL,gBAAgB,EAFzC,KAGAX,eAHA,IAIA,CAAEM,gBAAgB,EAJlB,IAKA,CAAEC,QAAQ,EALV,IAMAW,kBANA,IAOA,CAAEC,mBAPF,IAQA,CAAEX,sBAAsB,EATzB;;AAWA,UAAMa,sBAAsB,GAC3BP,UAAU,IACVI,kBADA,IAEA,CAAEE,4BAFF,IAGA,CAAEL,eAHF,IAIA,CAAEC,iBAJF,IAKA,CAAEG,mBANH;;AAQA,WAAO;AACNlB,MAAAA,2BAA2B,EAAEmB,4BADvB;AAENlB,MAAAA,qBAAqB,EAAEmB,sBAFjB;AAGNlB,MAAAA,wBAAwB,EACvB,CAAEY,eAAe,IAAI,CAAEf,eAAvB,KAA4CiB;AAJvC,KAAP;AAMA,GAlDW,EAmDZ,CAAEjB,eAAF,CAnDY,CAJb;AA0DA,SAAO;AACNC,IAAAA,2BADM;AAENC,IAAAA,qBAFM;AAGNC,IAAAA;AAHM,GAAP;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Returns true if the contextual block toolbar should show, or false if it should be hidden.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function useShouldContextualToolbarShow() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tisMultiSelecting,\n\t\t\t\tisTyping,\n\t\t\t\tisBlockInterfaceHidden,\n\t\t\t\tgetBlock,\n\t\t\t\tgetSettings,\n\t\t\t\tisNavigationMode,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst isEditMode = __unstableGetEditorMode() === 'edit';\n\t\t\tconst hasFixedToolbar = getSettings().hasFixedToolbar;\n\t\t\tconst isDistractionFree = getSettings().isDistractionFree;\n\t\t\tconst selectedBlockId =\n\t\t\t\tgetFirstMultiSelectedBlockClientId() ||\n\t\t\t\tgetSelectedBlockClientId();\n\t\t\tconst hasSelectedBlockId = !! selectedBlockId;\n\t\t\tconst isEmptyDefaultBlock = isUnmodifiedDefaultBlock(\n\t\t\t\tgetBlock( selectedBlockId ) || {}\n\t\t\t);\n\n\t\t\tconst _shouldShowContextualToolbar =\n\t\t\t\tisEditMode &&\n\t\t\t\t! hasFixedToolbar &&\n\t\t\t\t( ! isDistractionFree || isNavigationMode() ) &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\t! isMultiSelecting() &&\n\t\t\t\t! isTyping() &&\n\t\t\t\thasSelectedBlockId &&\n\t\t\t\t! isEmptyDefaultBlock &&\n\t\t\t\t! isBlockInterfaceHidden();\n\n\t\t\tconst _canFocusHiddenToolbar =\n\t\t\t\tisEditMode &&\n\t\t\t\thasSelectedBlockId &&\n\t\t\t\t! _shouldShowContextualToolbar &&\n\t\t\t\t! hasFixedToolbar &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\t! isEmptyDefaultBlock;\n\n\t\t\treturn {\n\t\t\t\tshouldShowContextualToolbar: _shouldShowContextualToolbar,\n\t\t\t\tcanFocusHiddenToolbar: _canFocusHiddenToolbar,\n\t\t\t\tfixedToolbarCanBeFocused:\n\t\t\t\t\t( hasFixedToolbar || ! isLargeViewport ) && selectedBlockId,\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\treturn {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t};\n}\n"]}
|
|
@@ -151,7 +151,6 @@
|
|
|
151
151
|
}
|
|
152
152
|
.block-editor-block-list__layout:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)) {
|
|
153
153
|
border-radius: 2px;
|
|
154
|
-
overflow: hidden;
|
|
155
154
|
}
|
|
156
155
|
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
157
156
|
background: transparent;
|
package/build-style/content.css
CHANGED
|
@@ -151,7 +151,6 @@
|
|
|
151
151
|
}
|
|
152
152
|
.block-editor-block-list__layout:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)) {
|
|
153
153
|
border-radius: 2px;
|
|
154
|
-
overflow: hidden;
|
|
155
154
|
}
|
|
156
155
|
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
157
156
|
background: transparent;
|
|
@@ -407,6 +407,12 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
407
407
|
background-color: #ddd;
|
|
408
408
|
position: relative;
|
|
409
409
|
}
|
|
410
|
+
.blocks-widgets-container .block-editor-block-contextual-toolbar.is-fixed {
|
|
411
|
+
margin-right: 153.6px;
|
|
412
|
+
}
|
|
413
|
+
.blocks-widgets-container .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
414
|
+
margin-right: 268.8px;
|
|
415
|
+
}
|
|
410
416
|
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
|
|
411
417
|
position: relative;
|
|
412
418
|
top: -1px;
|
|
@@ -628,7 +634,8 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
628
634
|
left: 1px;
|
|
629
635
|
bottom: 1px;
|
|
630
636
|
right: 1px;
|
|
631
|
-
box-shadow:
|
|
637
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
638
|
+
outline: 2px solid transparent;
|
|
632
639
|
}
|
|
633
640
|
|
|
634
641
|
.block-editor-block-breadcrumb__current {
|
|
@@ -917,8 +924,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
917
924
|
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
918
925
|
}
|
|
919
926
|
.block-editor-block-patterns-list__item:focus .block-editor-block-preview__container {
|
|
920
|
-
box-shadow:
|
|
927
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
|
|
921
928
|
outline: 2px solid transparent;
|
|
929
|
+
outline-offset: 2px;
|
|
922
930
|
}
|
|
923
931
|
.block-editor-block-patterns-list__item:hover .block-editor-block-patterns-list__item-title, .block-editor-block-patterns-list__item:focus .block-editor-block-patterns-list__item-title {
|
|
924
932
|
color: var(--wp-admin-theme-color);
|
|
@@ -1031,25 +1039,26 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1031
1039
|
justify-content: space-between;
|
|
1032
1040
|
gap: 8px;
|
|
1033
1041
|
}
|
|
1034
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item {
|
|
1042
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item {
|
|
1035
1043
|
color: #1e1e1e;
|
|
1036
1044
|
box-shadow: inset 0 0 0 1px #ccc;
|
|
1037
1045
|
display: inline-block;
|
|
1038
1046
|
width: calc(50% - 4px);
|
|
1039
1047
|
}
|
|
1040
|
-
.block-editor-block-styles__variants .
|
|
1048
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:hover {
|
|
1041
1049
|
color: var(--wp-admin-theme-color);
|
|
1042
|
-
box-shadow: inset 0 0 0
|
|
1050
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1043
1051
|
}
|
|
1044
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active, .block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover {
|
|
1052
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:hover {
|
|
1045
1053
|
background-color: #1e1e1e;
|
|
1046
1054
|
box-shadow: none;
|
|
1047
1055
|
}
|
|
1048
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active .block-editor-block-styles__item-text, .block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text {
|
|
1056
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active .block-editor-block-styles__item-text, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text {
|
|
1049
1057
|
color: #fff;
|
|
1050
1058
|
}
|
|
1051
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:focus {
|
|
1052
|
-
box-shadow:
|
|
1059
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:focus, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:focus {
|
|
1060
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1061
|
+
outline: 2px solid transparent;
|
|
1053
1062
|
}
|
|
1054
1063
|
.block-editor-block-styles__variants .block-editor-block-styles__item-text {
|
|
1055
1064
|
word-break: break-all;
|
|
@@ -1270,8 +1279,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1270
1279
|
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
1271
1280
|
}
|
|
1272
1281
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-preview__container {
|
|
1273
|
-
box-shadow:
|
|
1282
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
|
|
1274
1283
|
outline: 2px solid transparent;
|
|
1284
|
+
outline-offset: 2px;
|
|
1275
1285
|
}
|
|
1276
1286
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-pattern-setup-list__item-title, .block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-pattern-setup-list__item-title {
|
|
1277
1287
|
color: var(--wp-admin-theme-color);
|
|
@@ -1632,6 +1642,20 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1632
1642
|
width: 24px;
|
|
1633
1643
|
}
|
|
1634
1644
|
|
|
1645
|
+
.block-editor-global-styles-advanced-panel__custom-css-input textarea {
|
|
1646
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.block-editor-global-styles-advanced-panel__custom-css-validation-wrapper {
|
|
1650
|
+
position: absolute;
|
|
1651
|
+
bottom: 16px;
|
|
1652
|
+
left: 24px;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
.block-editor-global-styles-advanced-panel__custom-css-validation-icon {
|
|
1656
|
+
fill: #cc1818;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1635
1659
|
.block-editor-height-control {
|
|
1636
1660
|
border: 0;
|
|
1637
1661
|
margin: 0;
|
|
@@ -2289,10 +2313,10 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2289
2313
|
.block-editor-list-view-leaf {
|
|
2290
2314
|
position: relative;
|
|
2291
2315
|
}
|
|
2292
|
-
.block-editor-list-view-leaf .
|
|
2293
|
-
color:
|
|
2316
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button[aria-expanded=true] {
|
|
2317
|
+
color: inherit;
|
|
2294
2318
|
}
|
|
2295
|
-
.block-editor-list-view-leaf .
|
|
2319
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button:hover {
|
|
2296
2320
|
color: var(--wp-admin-theme-color);
|
|
2297
2321
|
}
|
|
2298
2322
|
.block-editor-list-view-leaf.is-selected td {
|
package/build-style/style.css
CHANGED
|
@@ -407,6 +407,12 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
407
407
|
background-color: #ddd;
|
|
408
408
|
position: relative;
|
|
409
409
|
}
|
|
410
|
+
.blocks-widgets-container .block-editor-block-contextual-toolbar.is-fixed {
|
|
411
|
+
margin-left: 153.6px;
|
|
412
|
+
}
|
|
413
|
+
.blocks-widgets-container .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
414
|
+
margin-left: 268.8px;
|
|
415
|
+
}
|
|
410
416
|
.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
|
|
411
417
|
position: relative;
|
|
412
418
|
top: -1px;
|
|
@@ -628,7 +634,8 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
628
634
|
right: 1px;
|
|
629
635
|
bottom: 1px;
|
|
630
636
|
left: 1px;
|
|
631
|
-
box-shadow:
|
|
637
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
638
|
+
outline: 2px solid transparent;
|
|
632
639
|
}
|
|
633
640
|
|
|
634
641
|
.block-editor-block-breadcrumb__current {
|
|
@@ -917,8 +924,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
917
924
|
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
918
925
|
}
|
|
919
926
|
.block-editor-block-patterns-list__item:focus .block-editor-block-preview__container {
|
|
920
|
-
box-shadow:
|
|
927
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
|
|
921
928
|
outline: 2px solid transparent;
|
|
929
|
+
outline-offset: 2px;
|
|
922
930
|
}
|
|
923
931
|
.block-editor-block-patterns-list__item:hover .block-editor-block-patterns-list__item-title, .block-editor-block-patterns-list__item:focus .block-editor-block-patterns-list__item-title {
|
|
924
932
|
color: var(--wp-admin-theme-color);
|
|
@@ -1031,25 +1039,26 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1031
1039
|
justify-content: space-between;
|
|
1032
1040
|
gap: 8px;
|
|
1033
1041
|
}
|
|
1034
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item {
|
|
1042
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item {
|
|
1035
1043
|
color: #1e1e1e;
|
|
1036
1044
|
box-shadow: inset 0 0 0 1px #ccc;
|
|
1037
1045
|
display: inline-block;
|
|
1038
1046
|
width: calc(50% - 4px);
|
|
1039
1047
|
}
|
|
1040
|
-
.block-editor-block-styles__variants .
|
|
1048
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:hover {
|
|
1041
1049
|
color: var(--wp-admin-theme-color);
|
|
1042
|
-
box-shadow: inset 0 0 0
|
|
1050
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1043
1051
|
}
|
|
1044
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active, .block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover {
|
|
1052
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:hover {
|
|
1045
1053
|
background-color: #1e1e1e;
|
|
1046
1054
|
box-shadow: none;
|
|
1047
1055
|
}
|
|
1048
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active .block-editor-block-styles__item-text, .block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text {
|
|
1056
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active .block-editor-block-styles__item-text, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text {
|
|
1049
1057
|
color: #fff;
|
|
1050
1058
|
}
|
|
1051
|
-
.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:focus {
|
|
1052
|
-
box-shadow:
|
|
1059
|
+
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:focus, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:focus {
|
|
1060
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1061
|
+
outline: 2px solid transparent;
|
|
1053
1062
|
}
|
|
1054
1063
|
.block-editor-block-styles__variants .block-editor-block-styles__item-text {
|
|
1055
1064
|
word-break: break-all;
|
|
@@ -1270,8 +1279,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1270
1279
|
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
1271
1280
|
}
|
|
1272
1281
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-preview__container {
|
|
1273
|
-
box-shadow:
|
|
1282
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
|
|
1274
1283
|
outline: 2px solid transparent;
|
|
1284
|
+
outline-offset: 2px;
|
|
1275
1285
|
}
|
|
1276
1286
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-pattern-setup-list__item-title, .block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-pattern-setup-list__item-title {
|
|
1277
1287
|
color: var(--wp-admin-theme-color);
|
|
@@ -1632,6 +1642,20 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1632
1642
|
width: 24px;
|
|
1633
1643
|
}
|
|
1634
1644
|
|
|
1645
|
+
.block-editor-global-styles-advanced-panel__custom-css-input textarea {
|
|
1646
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.block-editor-global-styles-advanced-panel__custom-css-validation-wrapper {
|
|
1650
|
+
position: absolute;
|
|
1651
|
+
bottom: 16px;
|
|
1652
|
+
right: 24px;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
.block-editor-global-styles-advanced-panel__custom-css-validation-icon {
|
|
1656
|
+
fill: #cc1818;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1635
1659
|
.block-editor-height-control {
|
|
1636
1660
|
border: 0;
|
|
1637
1661
|
margin: 0;
|
|
@@ -2289,10 +2313,10 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2289
2313
|
.block-editor-list-view-leaf {
|
|
2290
2314
|
position: relative;
|
|
2291
2315
|
}
|
|
2292
|
-
.block-editor-list-view-leaf .
|
|
2293
|
-
color:
|
|
2316
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button[aria-expanded=true] {
|
|
2317
|
+
color: inherit;
|
|
2294
2318
|
}
|
|
2295
|
-
.block-editor-list-view-leaf .
|
|
2319
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button:hover {
|
|
2296
2320
|
color: var(--wp-admin-theme-color);
|
|
2297
2321
|
}
|
|
2298
2322
|
.block-editor-list-view-leaf.is-selected td {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,35 +33,35 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/data": "^9.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/escape-html": "^2.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
53
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/preferences": "^3.
|
|
57
|
-
"@wordpress/private-apis": "^0.
|
|
58
|
-
"@wordpress/rich-text": "^6.
|
|
59
|
-
"@wordpress/shortcode": "^3.
|
|
60
|
-
"@wordpress/style-engine": "^1.
|
|
61
|
-
"@wordpress/token-list": "^2.
|
|
62
|
-
"@wordpress/url": "^3.
|
|
63
|
-
"@wordpress/warning": "^2.
|
|
64
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.33.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.30.0",
|
|
38
|
+
"@wordpress/blob": "^3.33.0",
|
|
39
|
+
"@wordpress/blocks": "^12.10.0",
|
|
40
|
+
"@wordpress/components": "^24.0.0",
|
|
41
|
+
"@wordpress/compose": "^6.10.0",
|
|
42
|
+
"@wordpress/data": "^9.3.0",
|
|
43
|
+
"@wordpress/date": "^4.33.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.33.0",
|
|
45
|
+
"@wordpress/dom": "^3.33.0",
|
|
46
|
+
"@wordpress/element": "^5.10.0",
|
|
47
|
+
"@wordpress/escape-html": "^2.33.0",
|
|
48
|
+
"@wordpress/hooks": "^3.33.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.33.0",
|
|
50
|
+
"@wordpress/i18n": "^4.33.0",
|
|
51
|
+
"@wordpress/icons": "^9.24.0",
|
|
52
|
+
"@wordpress/is-shallow-equal": "^4.33.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.10.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.33.0",
|
|
55
|
+
"@wordpress/notices": "^4.1.0",
|
|
56
|
+
"@wordpress/preferences": "^3.10.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.15.0",
|
|
58
|
+
"@wordpress/rich-text": "^6.10.0",
|
|
59
|
+
"@wordpress/shortcode": "^3.33.0",
|
|
60
|
+
"@wordpress/style-engine": "^1.16.0",
|
|
61
|
+
"@wordpress/token-list": "^2.33.0",
|
|
62
|
+
"@wordpress/url": "^3.34.0",
|
|
63
|
+
"@wordpress/warning": "^2.33.0",
|
|
64
|
+
"@wordpress/wordcount": "^3.33.0",
|
|
65
65
|
"change-case": "^4.1.2",
|
|
66
66
|
"classnames": "^2.3.1",
|
|
67
67
|
"colord": "^2.7.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "e936127e1e13881f1a940b7bd1593a9e500147f3"
|
|
87
87
|
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ToolbarGroup,
|
|
8
8
|
__experimentalUseSlotFills as useSlotFills,
|
|
9
9
|
} from '@wordpress/components';
|
|
10
|
+
import warning from '@wordpress/warning';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -15,11 +16,14 @@ import groups from './groups';
|
|
|
15
16
|
|
|
16
17
|
export default function BlockControlsSlot( { group = 'default', ...props } ) {
|
|
17
18
|
const accessibleToolbarState = useContext( ToolbarContext );
|
|
18
|
-
const Slot = groups[ group ]
|
|
19
|
-
const fills = useSlotFills( Slot
|
|
20
|
-
|
|
19
|
+
const Slot = groups[ group ]?.Slot;
|
|
20
|
+
const fills = useSlotFills( Slot?.__unstableName );
|
|
21
|
+
if ( ! Slot ) {
|
|
22
|
+
warning( `Unknown BlockControls group "${ group }" provided.` );
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
21
25
|
|
|
22
|
-
if ( !
|
|
26
|
+
if ( ! fills?.length ) {
|
|
23
27
|
return null;
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
__experimentalToolbarContext as ToolbarContext,
|
|
7
7
|
ToolbarGroup,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
|
+
import warning from '@wordpress/warning';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Internal dependencies
|
|
@@ -14,7 +15,11 @@ import groups from './groups';
|
|
|
14
15
|
|
|
15
16
|
export default function BlockControlsSlot( { group = 'default', ...props } ) {
|
|
16
17
|
const accessibleToolbarState = useContext( ToolbarContext );
|
|
17
|
-
const Slot = groups[ group ]
|
|
18
|
+
const Slot = groups[ group ]?.Slot;
|
|
19
|
+
if ( ! Slot ) {
|
|
20
|
+
warning( `Unknown BlockControls group "${ group }" provided.` );
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
18
23
|
|
|
19
24
|
if ( group === 'default' ) {
|
|
20
25
|
return <Slot { ...props } fillProps={ accessibleToolbarState } />;
|
|
@@ -67,14 +67,18 @@ const BlockDraggable = ( {
|
|
|
67
67
|
__experimentalTransferDataType="wp-blocks"
|
|
68
68
|
transferData={ transferData }
|
|
69
69
|
onDragStart={ ( event ) => {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// Defer hiding the dragged source element to the next
|
|
71
|
+
// frame to enable dragging.
|
|
72
|
+
window.requestAnimationFrame( () => {
|
|
73
|
+
startDraggingBlocks( clientIds );
|
|
74
|
+
isDragging.current = true;
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
startScrolling( event );
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
if ( onDragStart ) {
|
|
79
|
+
onDragStart();
|
|
80
|
+
}
|
|
81
|
+
} );
|
|
78
82
|
} }
|
|
79
83
|
onDragOver={ scrollOnDragOver }
|
|
80
84
|
onDragEnd={ () => {
|
|
@@ -78,7 +78,10 @@ export default function useScrollWhenDragging() {
|
|
|
78
78
|
SCROLL_INACTIVE_DISTANCE_PX,
|
|
79
79
|
0
|
|
80
80
|
);
|
|
81
|
-
const distancePercentage =
|
|
81
|
+
const distancePercentage =
|
|
82
|
+
moveableDistance === 0 || dragDistance === 0
|
|
83
|
+
? 0
|
|
84
|
+
: dragDistance / moveableDistance;
|
|
82
85
|
velocityY.current = VELOCITY_MULTIPLIER * distancePercentage;
|
|
83
86
|
} else if ( event.clientY < offsetDragStartPosition ) {
|
|
84
87
|
// User is dragging upwards.
|
|
@@ -92,7 +95,10 @@ export default function useScrollWhenDragging() {
|
|
|
92
95
|
SCROLL_INACTIVE_DISTANCE_PX,
|
|
93
96
|
0
|
|
94
97
|
);
|
|
95
|
-
const distancePercentage =
|
|
98
|
+
const distancePercentage =
|
|
99
|
+
moveableDistance === 0 || dragDistance === 0
|
|
100
|
+
? 0
|
|
101
|
+
: dragDistance / moveableDistance;
|
|
96
102
|
velocityY.current = -VELOCITY_MULTIPLIER * distancePercentage;
|
|
97
103
|
} else {
|
|
98
104
|
velocityY.current = 0;
|
|
@@ -8,7 +8,7 @@ import { TouchableWithoutFeedback } from 'react-native';
|
|
|
8
8
|
*/
|
|
9
9
|
import { __, sprintf } from '@wordpress/i18n';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
-
import { createBlock } from '@wordpress/blocks';
|
|
11
|
+
import { createBlock, getBlockType } from '@wordpress/blocks';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
@@ -16,22 +16,30 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
16
16
|
import Warning from '../warning';
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
18
|
|
|
19
|
-
export default function BlockInvalidWarning( {
|
|
20
|
-
const accessibilityLabel = sprintf(
|
|
21
|
-
/* translators: accessibility text for blocks with invalid content. %d: localized block title */
|
|
22
|
-
__( '%s block. This block has invalid content' ),
|
|
23
|
-
blockTitle
|
|
24
|
-
);
|
|
25
|
-
|
|
19
|
+
export default function BlockInvalidWarning( { clientId } ) {
|
|
26
20
|
const selector = ( select ) => {
|
|
27
21
|
const { getBlock } = select( blockEditorStore );
|
|
28
22
|
const block = getBlock( clientId );
|
|
23
|
+
const { name } = block || {};
|
|
24
|
+
|
|
25
|
+
const blockType = getBlockType( name || 'core/missing' );
|
|
26
|
+
const title = blockType?.title;
|
|
27
|
+
const blockIcon = blockType?.icon;
|
|
28
|
+
|
|
29
29
|
return {
|
|
30
30
|
block,
|
|
31
|
+
blockTitle: title,
|
|
32
|
+
icon: blockIcon,
|
|
31
33
|
};
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
const { block } = useSelect( selector, [ clientId ] );
|
|
36
|
+
const { block, blockTitle, icon } = useSelect( selector, [ clientId ] );
|
|
37
|
+
|
|
38
|
+
const accessibilityLabel = sprintf(
|
|
39
|
+
/* translators: accessibility text for blocks with invalid content. %d: localized block title */
|
|
40
|
+
__( '%s block. This block has invalid content' ),
|
|
41
|
+
blockTitle
|
|
42
|
+
);
|
|
35
43
|
|
|
36
44
|
const { replaceBlock } = useDispatch( blockEditorStore );
|
|
37
45
|
|
|
@@ -7,14 +7,23 @@ import { View } from 'react-native';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useEffect, useCallback } from '@wordpress/element';
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
13
14
|
*/
|
|
14
15
|
import { useBlockListContext } from './block-list-context';
|
|
16
|
+
import { store as blockEditorStore } from '../../store';
|
|
15
17
|
|
|
16
|
-
function BlockListItemCell( { children, clientId,
|
|
18
|
+
function BlockListItemCell( { children, item: clientId, onLayout } ) {
|
|
17
19
|
const { blocksLayouts, updateBlocksLayouts } = useBlockListContext();
|
|
20
|
+
const { rootClientId } = useSelect(
|
|
21
|
+
( select ) => {
|
|
22
|
+
const { getBlockRootClientId } = select( blockEditorStore );
|
|
23
|
+
return { rootClientId: getBlockRootClientId( clientId ) };
|
|
24
|
+
},
|
|
25
|
+
[ clientId ]
|
|
26
|
+
);
|
|
18
27
|
|
|
19
28
|
useEffect( () => {
|
|
20
29
|
return () => {
|