@wordpress/block-editor 15.22.1 → 16.0.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 +35 -0
- package/build/autocompleters/block.cjs +10 -2
- package/build/autocompleters/block.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +0 -2
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-canvas/index.cjs +6 -1
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-controls/groups.cjs +3 -1
- package/build/components/block-controls/groups.cjs.map +2 -2
- package/build/components/block-edit/edit.cjs +10 -18
- package/build/components/block-edit/edit.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs +3 -0
- package/build/components/block-inspector/edit-contents.cjs.map +3 -3
- package/build/components/block-inspector/index.cjs +18 -36
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block-invalid-warning.cjs +8 -19
- package/build/components/block-list/block-invalid-warning.cjs.map +2 -2
- package/build/components/block-list/block.cjs +9 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +1 -3
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +3 -1
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-handler.cjs +12 -4
- package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
- package/build/components/block-styles/use-styles-for-block.cjs +2 -1
- package/build/components/block-styles/use-styles-for-block.cjs.map +2 -2
- package/build/components/block-title/use-block-display-title.cjs +7 -2
- package/build/components/block-title/use-block-display-title.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +10 -14
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +43 -24
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +7 -2
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +0 -1
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +20 -6
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +16 -6
- package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
- package/build/components/block-visibility/utils.cjs +15 -2
- package/build/components/block-visibility/utils.cjs.map +3 -3
- package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +0 -6
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +5 -5
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +1 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +0 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/dimensions-tool/width-height-tool.cjs +2 -4
- package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
- package/build/components/font-appearance-control/index.cjs +6 -25
- package/build/components/font-appearance-control/index.cjs.map +3 -3
- package/build/components/font-family/index.cjs +6 -15
- package/build/components/font-family/index.cjs.map +3 -3
- package/build/components/font-sizes/font-size-picker.cjs +1 -2
- package/build/components/font-sizes/font-size-picker.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +0 -1
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +0 -3
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/state-control-badges.cjs +39 -3
- package/build/components/global-styles/state-control-badges.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +4 -11
- package/build/components/global-styles/typography-panel.cjs.map +2 -2
- package/build/components/height-control/index.cjs +0 -2
- package/build/components/height-control/index.cjs.map +2 -2
- package/build/components/html-element-control/index.cjs +0 -1
- package/build/components/html-element-control/index.cjs.map +2 -2
- package/build/components/image-editor/index.cjs +5 -0
- package/build/components/image-editor/index.cjs.map +3 -3
- package/build/components/image-editor/zoom-dropdown.cjs +0 -1
- package/build/components/image-editor/zoom-dropdown.cjs.map +2 -2
- package/build/components/image-size-control/index.cjs +3 -7
- package/build/components/image-size-control/index.cjs.map +2 -2
- package/build/components/inner-content/index.cjs +107 -0
- package/build/components/inner-content/index.cjs.map +7 -0
- package/build/components/inserter/hooks/use-block-types-state.cjs +10 -2
- package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
- package/build/components/inserter/media-tab/hooks.cjs +67 -12
- package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-list.cjs +3 -1
- package/build/components/inserter/media-tab/media-list.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs +287 -28
- package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
- package/build/components/inserter/media-tab/media-preview.cjs +32 -17
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-tab.cjs +26 -6
- package/build/components/inserter/media-tab/media-tab.cjs.map +2 -2
- package/build/components/inserter/mobile-tab-navigation.cjs +6 -1
- package/build/components/inserter/mobile-tab-navigation.cjs.map +2 -2
- package/build/components/inserter/no-results.cjs +2 -2
- package/build/components/inserter/no-results.cjs.map +2 -2
- package/build/components/inserter/preview-panel.cjs +2 -1
- package/build/components/inserter/preview-panel.cjs.map +2 -2
- package/build/components/inserter-list-item/index.cjs +8 -2
- package/build/components/inserter-list-item/index.cjs.map +2 -2
- package/build/components/keyboard-shortcuts/index.cjs +19 -11
- package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/letter-spacing-control/index.cjs +0 -24
- package/build/components/letter-spacing-control/index.cjs.map +3 -3
- package/build/components/line-height-control/index.cjs +6 -22
- package/build/components/line-height-control/index.cjs.map +3 -3
- package/build/components/list-view/block-select-button.cjs +90 -84
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +61 -21
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/expander.cjs +1 -1
- package/build/components/list-view/expander.cjs.map +2 -2
- package/build/components/list-view/use-list-view-client-ids.cjs +2 -2
- package/build/components/list-view/use-list-view-client-ids.cjs.map +2 -2
- package/build/components/media-placeholder/index.cjs +0 -1
- package/build/components/media-placeholder/index.cjs.map +2 -2
- package/build/components/observe-typing/index.cjs +4 -3
- package/build/components/observe-typing/index.cjs.map +2 -2
- package/build/components/preset-input-control/custom-value-controls.cjs +1 -3
- package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +1 -3
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/resolution-tool/index.cjs +1 -2
- package/build/components/resolution-tool/index.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +2 -3
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +3 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +66 -17
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/text-alignment-control/index.cjs +0 -1
- package/build/components/text-alignment-control/index.cjs.map +2 -2
- package/build/components/text-decoration-control/index.cjs +0 -1
- package/build/components/text-decoration-control/index.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +0 -8
- package/build/components/text-indent-control/index.cjs.map +2 -2
- package/build/components/text-transform-control/index.cjs +0 -1
- package/build/components/text-transform-control/index.cjs.map +2 -2
- package/build/components/typewriter/index.cjs +129 -136
- package/build/components/typewriter/index.cjs.map +3 -3
- package/build/components/use-block-commands/index.cjs +21 -17
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -8
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/use-on-block-drop/index.cjs +3 -7
- package/build/components/use-on-block-drop/index.cjs.map +2 -2
- package/build/components/use-resize-canvas/index.cjs +16 -53
- package/build/components/use-resize-canvas/index.cjs.map +3 -3
- package/build/components/writing-flow/index.cjs +12 -1
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +18 -5
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +2 -2
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +3 -8
- package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-editable-root.cjs +112 -0
- package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
- package/build/components/writing-flow/use-home-end.cjs +64 -0
- package/build/components/writing-flow/use-home-end.cjs.map +7 -0
- package/build/components/writing-flow/use-input.cjs +15 -5
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-select-all.cjs +14 -2
- package/build/components/writing-flow/use-select-all.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +126 -20
- package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
- package/build/components/writing-flow/utils.cjs +39 -2
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/components/writing-mode-control/index.cjs +0 -1
- package/build/components/writing-mode-control/index.cjs.map +2 -2
- package/build/hooks/background.cjs +3 -2
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-fields/rich-text/index.cjs +2 -3
- package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
- package/build/hooks/elements.cjs +1 -1
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/font-size.cjs +1 -2
- package/build/hooks/font-size.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +5 -3
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +22 -12
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/hooks/layout.cjs +33 -16
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/position.cjs +36 -16
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/states.cjs +32 -23
- package/build/hooks/states.cjs.map +3 -3
- package/build/hooks/style.cjs +31 -9
- package/build/hooks/style.cjs.map +3 -3
- package/build/hooks/text-align.cjs +36 -6
- package/build/hooks/text-align.cjs.map +3 -3
- package/build/hooks/typography.cjs +1 -1
- package/build/hooks/typography.cjs.map +2 -2
- package/build/layouts/constrained.cjs +35 -27
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +27 -22
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/grid.cjs +51 -11
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +4 -2
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +2 -2
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +16 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +3 -3
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/private-selectors.cjs +109 -12
- package/build/store/private-selectors.cjs.map +3 -3
- package/build/store/reducer.cjs +19 -3
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +13 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/block-bindings.cjs +29 -0
- package/build/utils/block-bindings.cjs.map +2 -2
- package/build/utils/dom.cjs +14 -0
- package/build/utils/dom.cjs.map +2 -2
- package/build-module/autocompleters/block.mjs +10 -2
- package/build-module/autocompleters/block.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +0 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-canvas/index.mjs +7 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-controls/groups.mjs +3 -1
- package/build-module/components/block-controls/groups.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs +11 -18
- package/build-module/components/block-edit/edit.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs +4 -1
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +18 -36
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block-invalid-warning.mjs +8 -19
- package/build-module/components/block-list/block-invalid-warning.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +9 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +1 -3
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +3 -1
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +9 -4
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +12 -4
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
- package/build-module/components/block-styles/use-styles-for-block.mjs +2 -1
- package/build-module/components/block-styles/use-styles-for-block.mjs.map +2 -2
- package/build-module/components/block-title/use-block-display-title.mjs +7 -2
- package/build-module/components/block-title/use-block-display-title.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +10 -14
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +43 -24
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +7 -2
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +0 -1
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +22 -10
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +18 -3
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +0 -6
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +5 -5
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +1 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +0 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/width-height-tool.mjs +2 -4
- package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
- package/build-module/components/font-appearance-control/index.mjs +6 -15
- package/build-module/components/font-appearance-control/index.mjs.map +2 -2
- package/build-module/components/font-family/index.mjs +6 -15
- package/build-module/components/font-family/index.mjs.map +2 -2
- package/build-module/components/font-sizes/font-size-picker.mjs +1 -2
- package/build-module/components/font-sizes/font-size-picker.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +0 -1
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/state-control-badges.mjs +41 -5
- package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +4 -11
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/height-control/index.mjs +0 -2
- package/build-module/components/height-control/index.mjs.map +2 -2
- package/build-module/components/html-element-control/index.mjs +0 -1
- package/build-module/components/html-element-control/index.mjs.map +2 -2
- package/build-module/components/image-editor/index.mjs +5 -0
- package/build-module/components/image-editor/index.mjs.map +2 -2
- package/build-module/components/image-editor/zoom-dropdown.mjs +0 -1
- package/build-module/components/image-editor/zoom-dropdown.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +3 -7
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inner-content/index.mjs +82 -0
- package/build-module/components/inner-content/index.mjs.map +7 -0
- package/build-module/components/inserter/hooks/use-block-types-state.mjs +10 -2
- package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/hooks.mjs +66 -12
- package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-list.mjs +3 -1
- package/build-module/components/inserter/media-tab/media-list.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs +297 -32
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-preview.mjs +33 -18
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-tab.mjs +27 -7
- package/build-module/components/inserter/media-tab/media-tab.mjs.map +2 -2
- package/build-module/components/inserter/mobile-tab-navigation.mjs +6 -1
- package/build-module/components/inserter/mobile-tab-navigation.mjs.map +2 -2
- package/build-module/components/inserter/no-results.mjs +2 -2
- package/build-module/components/inserter/no-results.mjs.map +2 -2
- package/build-module/components/inserter/preview-panel.mjs +2 -1
- package/build-module/components/inserter/preview-panel.mjs.map +2 -2
- package/build-module/components/inserter-list-item/index.mjs +8 -2
- package/build-module/components/inserter-list-item/index.mjs.map +2 -2
- package/build-module/components/keyboard-shortcuts/index.mjs +19 -11
- package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/letter-spacing-control/index.mjs +0 -14
- package/build-module/components/letter-spacing-control/index.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +6 -12
- package/build-module/components/line-height-control/index.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +90 -84
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +61 -21
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/expander.mjs +1 -1
- package/build-module/components/list-view/expander.mjs.map +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.mjs +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.mjs.map +2 -2
- package/build-module/components/media-placeholder/index.mjs +0 -1
- package/build-module/components/media-placeholder/index.mjs.map +2 -2
- package/build-module/components/observe-typing/index.mjs +4 -3
- package/build-module/components/observe-typing/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/custom-value-controls.mjs +1 -3
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +1 -3
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/resolution-tool/index.mjs +1 -2
- package/build-module/components/resolution-tool/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +64 -13
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/text-alignment-control/index.mjs +0 -1
- package/build-module/components/text-alignment-control/index.mjs.map +2 -2
- package/build-module/components/text-decoration-control/index.mjs +0 -1
- package/build-module/components/text-decoration-control/index.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +0 -8
- package/build-module/components/text-indent-control/index.mjs.map +2 -2
- package/build-module/components/text-transform-control/index.mjs +0 -1
- package/build-module/components/text-transform-control/index.mjs.map +2 -2
- package/build-module/components/typewriter/index.mjs +129 -136
- package/build-module/components/typewriter/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +21 -17
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +10 -8
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/use-on-block-drop/index.mjs +4 -7
- package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
- package/build-module/components/use-resize-canvas/index.mjs +6 -53
- package/build-module/components/use-resize-canvas/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +12 -1
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +19 -6
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
- package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-editable-root.mjs +86 -0
- package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
- package/build-module/components/writing-flow/use-home-end.mjs +43 -0
- package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
- package/build-module/components/writing-flow/use-input.mjs +15 -5
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-select-all.mjs +19 -3
- package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +128 -19
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +35 -1
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/components/writing-mode-control/index.mjs +0 -1
- package/build-module/components/writing-mode-control/index.mjs.map +2 -2
- package/build-module/hooks/background.mjs +3 -2
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
- package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +1 -1
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/font-size.mjs +1 -2
- package/build-module/hooks/font-size.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +5 -3
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +22 -12
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +32 -16
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/position.mjs +38 -18
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/states.mjs +32 -23
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +40 -11
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/text-align.mjs +39 -10
- package/build-module/hooks/text-align.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +1 -1
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +35 -27
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +27 -22
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +52 -11
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +5 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +3 -3
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +14 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -2
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +106 -12
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +17 -3
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +13 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/block-bindings.mjs +28 -0
- package/build-module/utils/block-bindings.mjs.map +2 -2
- package/build-module/utils/dom.mjs +13 -0
- package/build-module/utils/dom.mjs.map +2 -2
- package/build-style/content-rtl.css +15 -14
- package/build-style/content.css +15 -14
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +144 -47
- package/build-style/style.css +144 -47
- package/build-types/components/block-context/index.d.ts +7 -0
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/block-bindings.d.ts +19 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts +11 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
- package/build-types/utils/pasting.d.ts +1 -1
- package/build-types/utils/pasting.d.ts.map +1 -1
- package/package.json +46 -44
- package/src/autocompleters/block.js +10 -3
- package/src/autocompleters/test/block.js +53 -0
- package/src/components/background-image-control/index.js +0 -2
- package/src/components/block-canvas/index.js +9 -2
- package/src/components/block-card/style.scss +1 -1
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-edit/edit.js +13 -31
- package/src/components/block-inspector/edit-contents.js +5 -1
- package/src/components/block-inspector/index.js +25 -44
- package/src/components/block-list/block-invalid-warning.js +8 -19
- package/src/components/block-list/block.js +6 -0
- package/src/components/block-list/index.js +0 -2
- package/src/components/block-list/use-block-props/index.js +2 -0
- package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
- package/src/components/block-list/use-block-props/use-focus-handler.js +34 -9
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-manager/style.scss +1 -1
- package/src/components/block-navigation/style.scss +1 -1
- package/src/components/block-patterns-list/stories/index.story.jsx +1 -1
- package/src/components/block-quick-navigation/style.scss +1 -3
- package/src/components/block-styles/style.scss +2 -2
- package/src/components/block-styles/use-styles-for-block.js +1 -0
- package/src/components/block-title/use-block-display-title.js +7 -2
- package/src/components/block-toolbar/block-toolbar-icon.js +11 -16
- package/src/components/block-toolbar/index.js +41 -18
- package/src/components/block-toolbar/test/block-toolbar-icon.js +32 -9
- package/src/components/block-tools/index.js +7 -0
- package/src/components/block-types-list/style.scss +0 -1
- package/src/components/block-variation-transforms/index.js +0 -1
- package/src/components/block-visibility/modal.js +24 -10
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/test/use-block-visibility.js +128 -35
- package/src/components/block-visibility/test/utils.js +11 -0
- package/src/components/block-visibility/use-block-visibility.js +33 -11
- package/src/components/block-visibility/utils.js +31 -6
- package/src/components/block-visibility/viewport-menu-item.js +10 -1
- package/src/components/block-visibility/viewport-toolbar.js +6 -0
- package/src/components/block-visibility/viewport-visibility-info.js +5 -1
- package/src/components/button-block-appender/content.scss +1 -7
- package/src/components/child-layout-control/index.js +0 -6
- package/src/components/color-palette/test/__snapshots__/control.js.snap +13 -108
- package/src/components/colors-gradients/control.js +4 -4
- package/src/components/colors-gradients/style.scss +2 -2
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/dimensions-tool/aspect-ratio-tool.js +0 -1
- package/src/components/dimensions-tool/scale-tool.js +0 -1
- package/src/components/dimensions-tool/width-height-tool.js +0 -2
- package/src/components/font-appearance-control/index.js +6 -19
- package/src/components/font-family/README.md +0 -9
- package/src/components/font-family/index.js +6 -19
- package/src/components/font-family/stories/index.story.jsx +1 -2
- package/src/components/font-sizes/font-size-picker.js +0 -1
- package/src/components/global-styles/border-panel.js +0 -1
- package/src/components/global-styles/dimensions-panel.js +0 -3
- package/src/components/global-styles/state-control-badges.js +45 -6
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/global-styles/test/state-control-badges.js +65 -0
- package/src/components/global-styles/typography-panel.js +0 -7
- package/src/components/height-control/index.js +0 -2
- package/src/components/html-element-control/index.js +0 -1
- package/src/components/iframe/content.scss +3 -3
- package/src/components/image-editor/index.js +22 -0
- package/src/components/image-editor/zoom-dropdown.js +0 -1
- package/src/components/image-size-control/index.js +0 -4
- package/src/components/inner-content/index.js +119 -0
- package/src/components/inner-content/test/index.js +81 -0
- package/src/components/inserter/hooks/use-block-types-state.js +10 -2
- package/src/components/inserter/media-tab/hooks.js +114 -16
- package/src/components/inserter/media-tab/media-list.js +2 -0
- package/src/components/inserter/media-tab/media-panel.js +354 -19
- package/src/components/inserter/media-tab/media-preview.js +34 -17
- package/src/components/inserter/media-tab/media-tab.js +20 -2
- package/src/components/inserter/media-tab/test/hooks.js +267 -0
- package/src/components/inserter/media-tab/test/media-panel.js +127 -0
- package/src/components/inserter/mobile-tab-navigation.js +6 -1
- package/src/components/inserter/no-results.js +2 -2
- package/src/components/inserter/preview-panel.js +1 -0
- package/src/components/inserter/style.scss +115 -3
- package/src/components/inserter-list-item/index.js +8 -2
- package/src/components/inserter-list-item/style.scss +0 -15
- package/src/components/keyboard-shortcuts/index.js +28 -11
- package/src/components/letter-spacing-control/README.md +0 -8
- package/src/components/letter-spacing-control/index.js +5 -23
- package/src/components/letter-spacing-control/stories/index.story.jsx +0 -12
- package/src/components/line-height-control/README.md +0 -8
- package/src/components/line-height-control/index.js +6 -16
- package/src/components/line-height-control/stories/index.story.jsx +0 -1
- package/src/components/line-height-control/test/index.js +1 -7
- package/src/components/link-control/style.scss +2 -2
- package/src/components/link-control/test/index.js +6 -6
- package/src/components/link-picker/style.scss +1 -2
- package/src/components/link-picker/test/index.js +3 -1
- package/src/components/list-view/block-select-button.js +5 -1
- package/src/components/list-view/block.js +69 -23
- package/src/components/list-view/expander.js +5 -1
- package/src/components/list-view/style.scss +23 -5
- package/src/components/list-view/use-list-view-client-ids.js +2 -2
- package/src/components/media-placeholder/index.js +0 -1
- package/src/components/multi-selection-inspector/style.scss +1 -1
- package/src/components/observe-typing/index.js +9 -4
- package/src/components/preset-input-control/custom-value-controls.js +0 -2
- package/src/components/preset-input-control/index.js +0 -2
- package/src/components/resolution-tool/index.js +0 -1
- package/src/components/responsive-block-control/style.scss +1 -1
- package/src/components/responsive-block-control/test/index.js +1 -5
- package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/delete.js +7 -4
- package/src/components/rich-text/event-listeners/enter.js +10 -4
- package/src/components/rich-text/event-listeners/input-events.js +4 -3
- package/src/components/rich-text/event-listeners/input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
- package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
- package/src/components/rich-text/index.js +94 -25
- package/src/components/skip-to-selected-block/style.scss +1 -1
- package/src/components/text-alignment-control/index.js +0 -1
- package/src/components/text-decoration-control/index.js +0 -1
- package/src/components/text-indent-control/index.js +7 -16
- package/src/components/text-transform-control/index.js +0 -1
- package/src/components/typewriter/index.js +228 -224
- package/src/components/use-block-commands/index.js +27 -17
- package/src/components/use-block-display-information/index.js +9 -13
- package/src/components/use-block-display-information/test/index.js +47 -9
- package/src/components/use-on-block-drop/index.js +4 -7
- package/src/components/use-resize-canvas/index.js +10 -71
- package/src/components/writing-flow/index.js +15 -1
- package/src/components/writing-flow/use-arrow-nav.js +39 -12
- package/src/components/writing-flow/use-click-selection.js +2 -3
- package/src/components/writing-flow/use-clipboard-handler.js +5 -2
- package/src/components/writing-flow/use-drag-selection.js +1 -14
- package/src/components/writing-flow/use-editable-root.js +182 -0
- package/src/components/writing-flow/use-home-end.js +63 -0
- package/src/components/writing-flow/use-input.js +25 -8
- package/src/components/writing-flow/use-multi-selection.js +2 -3
- package/src/components/writing-flow/use-select-all.js +33 -3
- package/src/components/writing-flow/use-selection-observer.js +197 -38
- package/src/components/writing-flow/utils.js +83 -0
- package/src/components/writing-mode-control/index.js +0 -1
- package/src/hooks/background.js +7 -9
- package/src/hooks/block-fields/link/styles.scss +1 -6
- package/src/hooks/block-fields/media/styles.scss +1 -6
- package/src/hooks/block-fields/rich-text/index.js +6 -9
- package/src/hooks/block-hooks.scss +15 -0
- package/src/hooks/elements.js +0 -1
- package/src/hooks/font-size.js +0 -1
- package/src/hooks/grid-visualizer.js +40 -36
- package/src/hooks/layout-child.js +19 -9
- package/src/hooks/layout.js +53 -35
- package/src/hooks/position.js +44 -23
- package/src/hooks/states.js +55 -28
- package/src/hooks/style.js +67 -17
- package/src/hooks/test/cross-origin-isolation.js +0 -4
- package/src/hooks/test/layout.js +75 -1
- package/src/hooks/test/style.js +29 -0
- package/src/hooks/test/text-align.js +34 -1
- package/src/hooks/text-align.js +41 -10
- package/src/hooks/typography.js +0 -1
- package/src/layouts/constrained.js +56 -29
- package/src/layouts/flex.js +5 -4
- package/src/layouts/grid.js +59 -9
- package/src/layouts/test/constrained.js +91 -0
- package/src/layouts/test/grid.js +71 -0
- package/src/private-apis.js +4 -2
- package/src/store/actions.js +43 -14
- package/src/store/private-actions.js +31 -0
- package/src/store/private-keys.js +1 -1
- package/src/store/private-selectors.js +209 -16
- package/src/store/reducer.js +37 -2
- package/src/store/selectors.js +41 -0
- package/src/store/test/actions.js +1 -1
- package/src/store/test/private-selectors.js +547 -10
- package/src/store/test/reducer.js +41 -13
- package/src/store/test/selectors.js +133 -0
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.ts +50 -0
- package/src/utils/dom.ts +33 -0
- package/src/utils/test/block-bindings.js +181 -0
- package/build/components/rich-text/input-event.cjs +0 -50
- package/build/components/rich-text/input-event.cjs.map +0 -7
- package/build/components/rich-text/shortcut.cjs +0 -51
- package/build/components/rich-text/shortcut.cjs.map +0 -7
- package/build-module/components/rich-text/input-event.mjs +0 -25
- package/build-module/components/rich-text/input-event.mjs.map +0 -7
- package/build-module/components/rich-text/shortcut.mjs +0 -26
- package/build-module/components/rich-text/shortcut.mjs.map +0 -7
- package/src/components/rich-text/input-event.js +0 -31
- package/src/components/rich-text/shortcut.js +0 -32
- package/src/components/use-resize-canvas/README.md +0 -37
|
@@ -11,7 +11,7 @@ import { ExperimentalBlockEditorProvider } from '../../provider';
|
|
|
11
11
|
import patterns from './fixtures';
|
|
12
12
|
// Reason: Styles are contained in ExperimentalBlockEditorProvider iframe.
|
|
13
13
|
// eslint-disable-next-line @wordpress/no-non-module-stylesheet-imports
|
|
14
|
-
import blockLibraryStyles from '
|
|
14
|
+
import blockLibraryStyles from '@wordpress/block-library/build-style/style.css?raw';
|
|
15
15
|
|
|
16
16
|
const blockEditorSettings = {
|
|
17
17
|
styles: [ { css: blockLibraryStyles } ],
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
button.components-button.block-editor-block-styles__item {
|
|
32
32
|
color: $gray-900;
|
|
33
|
-
|
|
33
|
+
border-color: $gray-300;
|
|
34
34
|
display: inline-block;
|
|
35
35
|
width: calc(50% - #{$grid-unit-05});
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
&:focus,
|
|
54
54
|
&.is-active:focus {
|
|
55
|
-
@include
|
|
55
|
+
@include outset-ring__focus();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -39,7 +39,7 @@ export default function useBlockDisplayTitle( {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const { getBlockName, getBlockAttributes } =
|
|
42
|
+
const { getBlockName, getBlockAttributes, getBlock } =
|
|
43
43
|
select( blockEditorStore );
|
|
44
44
|
const { getBlockType, getActiveBlockVariation } =
|
|
45
45
|
select( blocksStore );
|
|
@@ -57,7 +57,12 @@ export default function useBlockDisplayTitle( {
|
|
|
57
57
|
return label;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const match = getActiveBlockVariation(
|
|
60
|
+
const match = getActiveBlockVariation(
|
|
61
|
+
blockName,
|
|
62
|
+
attributes,
|
|
63
|
+
undefined,
|
|
64
|
+
getBlock?.( clientId )?.innerContent
|
|
65
|
+
);
|
|
61
66
|
// Label will fallback to the title if no label is defined for the current label context.
|
|
62
67
|
return match?.title || blockType.title;
|
|
63
68
|
},
|
|
@@ -19,7 +19,6 @@ import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
|
19
19
|
import { store as blockEditorStore } from '../../store';
|
|
20
20
|
import { hasPatternOverridesDefaultBinding } from '../../utils/block-bindings';
|
|
21
21
|
import { unlock } from '../../lock-unlock';
|
|
22
|
-
import { isIsolatedEditorKey } from '../../store/private-keys';
|
|
23
22
|
|
|
24
23
|
function getBlockIconVariant( { select, clientIds } ) {
|
|
25
24
|
const {
|
|
@@ -30,11 +29,9 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
30
29
|
getTemplateLock,
|
|
31
30
|
getBlockEditingMode,
|
|
32
31
|
canEditBlock,
|
|
33
|
-
|
|
34
|
-
getSettings,
|
|
32
|
+
isSectionBlock,
|
|
35
33
|
} = unlock( select( blockEditorStore ) );
|
|
36
34
|
const { getBlockStyles } = select( blocksStore );
|
|
37
|
-
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
38
35
|
|
|
39
36
|
const hasTemplateLock = clientIds.some(
|
|
40
37
|
( id ) => getTemplateLock( id ) === 'contentOnly'
|
|
@@ -48,8 +45,7 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
48
45
|
const hasPatternNameInSelection = clientIds.some(
|
|
49
46
|
( id ) =>
|
|
50
47
|
!! getBlockAttributes( id )?.metadata?.patternName &&
|
|
51
|
-
|
|
52
|
-
! isIsolatedEditor
|
|
48
|
+
isSectionBlock( id )
|
|
53
49
|
);
|
|
54
50
|
const hasPatternOverrides = clientIds.every( ( clientId ) =>
|
|
55
51
|
hasPatternOverridesDefaultBinding(
|
|
@@ -93,13 +89,8 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
function getBlockIcon( { select, clientIds } ) {
|
|
96
|
-
const {
|
|
97
|
-
|
|
98
|
-
getBlockAttributes,
|
|
99
|
-
isWithinEditedContentOnlySection,
|
|
100
|
-
getSettings,
|
|
101
|
-
} = unlock( select( blockEditorStore ) );
|
|
102
|
-
const isIsolatedEditor = !! getSettings()?.[ isIsolatedEditorKey ];
|
|
92
|
+
const { getBlockName, getBlockAttributes, getBlock, isSectionBlock } =
|
|
93
|
+
unlock( select( blockEditorStore ) );
|
|
103
94
|
|
|
104
95
|
const _isSingleBlock = clientIds.length === 1;
|
|
105
96
|
const firstClientId = clientIds[ 0 ];
|
|
@@ -108,8 +99,7 @@ function getBlockIcon( { select, clientIds } ) {
|
|
|
108
99
|
if (
|
|
109
100
|
_isSingleBlock &&
|
|
110
101
|
blockAttributes?.metadata?.patternName &&
|
|
111
|
-
|
|
112
|
-
! isIsolatedEditor
|
|
102
|
+
isSectionBlock( firstClientId )
|
|
113
103
|
) {
|
|
114
104
|
return symbol;
|
|
115
105
|
}
|
|
@@ -118,7 +108,12 @@ function getBlockIcon( { select, clientIds } ) {
|
|
|
118
108
|
const blockType = getBlockType( blockName );
|
|
119
109
|
if ( _isSingleBlock ) {
|
|
120
110
|
const { getActiveBlockVariation } = select( blocksStore );
|
|
121
|
-
const match = getActiveBlockVariation(
|
|
111
|
+
const match = getActiveBlockVariation(
|
|
112
|
+
blockName,
|
|
113
|
+
blockAttributes,
|
|
114
|
+
undefined,
|
|
115
|
+
getBlock?.( firstClientId )?.innerContent
|
|
116
|
+
);
|
|
122
117
|
return match?.icon || blockType?.icon;
|
|
123
118
|
}
|
|
124
119
|
|
|
@@ -40,6 +40,7 @@ import EditSectionButton from './edit-section-button';
|
|
|
40
40
|
import { unlock } from '../../lock-unlock';
|
|
41
41
|
import { deviceTypeKey } from '../../store/private-keys';
|
|
42
42
|
import BlockToolbarIcon from './block-toolbar-icon';
|
|
43
|
+
import { hasViewportBlockStyleState } from '../../hooks/block-style-state';
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* Renders the block toolbar.
|
|
@@ -78,6 +79,7 @@ export function PrivateBlockToolbar( {
|
|
|
78
79
|
showBlockVisibilityButton,
|
|
79
80
|
showSwitchSectionStyleButton,
|
|
80
81
|
areSelectedBlocksHiddenOnViewport,
|
|
82
|
+
showStyleStateSlot,
|
|
81
83
|
canEdit,
|
|
82
84
|
} = useSelect( ( select ) => {
|
|
83
85
|
const { canEditBlock } = select( blockEditorStore );
|
|
@@ -95,6 +97,8 @@ export function PrivateBlockToolbar( {
|
|
|
95
97
|
isZoomOut,
|
|
96
98
|
isSectionBlock,
|
|
97
99
|
isBlockHiddenAtViewport,
|
|
100
|
+
getSelectedBlockStyleState,
|
|
101
|
+
isResponsiveEditing,
|
|
98
102
|
} = unlock( select( blockEditorStore ) );
|
|
99
103
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
100
104
|
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
|
|
@@ -135,6 +139,11 @@ export function PrivateBlockToolbar( {
|
|
|
135
139
|
selectedBlockClientIds.every( ( id ) =>
|
|
136
140
|
isBlockHiddenAtViewport( id, _currentDeviceType )
|
|
137
141
|
);
|
|
142
|
+
const _isEditingResponsiveStyleState =
|
|
143
|
+
isResponsiveEditing() &&
|
|
144
|
+
hasViewportBlockStyleState(
|
|
145
|
+
getSelectedBlockStyleState( selectedBlockClientId )
|
|
146
|
+
);
|
|
138
147
|
|
|
139
148
|
return {
|
|
140
149
|
blockClientId: selectedBlockClientId,
|
|
@@ -158,7 +167,8 @@ export function PrivateBlockToolbar( {
|
|
|
158
167
|
isSectionContainer: _isSectionBlock,
|
|
159
168
|
hasContentOnlyLocking: _hasTemplateLock,
|
|
160
169
|
showShuffleButton: _isZoomOut,
|
|
161
|
-
showSlots: ! _isZoomOut,
|
|
170
|
+
showSlots: ! _isZoomOut && ! _isEditingResponsiveStyleState,
|
|
171
|
+
showStyleStateSlot: ! _isZoomOut && _isEditingResponsiveStyleState,
|
|
162
172
|
showGroupButtons: ! _isZoomOut,
|
|
163
173
|
showLockButtons: ! _isZoomOut,
|
|
164
174
|
showBlockVisibilityButton: ! _isZoomOut,
|
|
@@ -261,31 +271,44 @@ export function PrivateBlockToolbar( {
|
|
|
261
271
|
<SwitchSectionStyle clientId={ blockClientIds[ 0 ] } />
|
|
262
272
|
) }
|
|
263
273
|
{ ! areSelectedBlocksHiddenOnViewport &&
|
|
264
|
-
shouldShowVisualToolbar &&
|
|
265
|
-
showSlots && (
|
|
274
|
+
shouldShowVisualToolbar && (
|
|
266
275
|
<>
|
|
267
276
|
{ ! isSectionContainer && (
|
|
277
|
+
<>
|
|
278
|
+
{ showSlots && (
|
|
279
|
+
<>
|
|
280
|
+
<BlockControls.Slot
|
|
281
|
+
group="parent"
|
|
282
|
+
className="block-editor-block-toolbar__slot"
|
|
283
|
+
/>
|
|
284
|
+
<BlockControls.Slot
|
|
285
|
+
group="block"
|
|
286
|
+
className="block-editor-block-toolbar__slot"
|
|
287
|
+
/>
|
|
288
|
+
<BlockControls.Slot className="block-editor-block-toolbar__slot" />
|
|
289
|
+
<BlockControls.Slot
|
|
290
|
+
group="inline"
|
|
291
|
+
className="block-editor-block-toolbar__slot"
|
|
292
|
+
/>
|
|
293
|
+
</>
|
|
294
|
+
) }
|
|
295
|
+
{ showStyleStateSlot && (
|
|
296
|
+
<BlockControls.Slot
|
|
297
|
+
group="style-state"
|
|
298
|
+
className="block-editor-block-toolbar__slot"
|
|
299
|
+
/>
|
|
300
|
+
) }
|
|
301
|
+
</>
|
|
302
|
+
) }
|
|
303
|
+
{ showSlots && (
|
|
268
304
|
<>
|
|
269
305
|
<BlockControls.Slot
|
|
270
|
-
group="
|
|
271
|
-
className="block-editor-block-toolbar__slot"
|
|
272
|
-
/>
|
|
273
|
-
<BlockControls.Slot
|
|
274
|
-
group="block"
|
|
275
|
-
className="block-editor-block-toolbar__slot"
|
|
276
|
-
/>
|
|
277
|
-
<BlockControls.Slot className="block-editor-block-toolbar__slot" />
|
|
278
|
-
<BlockControls.Slot
|
|
279
|
-
group="inline"
|
|
306
|
+
group="other"
|
|
280
307
|
className="block-editor-block-toolbar__slot"
|
|
281
308
|
/>
|
|
309
|
+
<__unstableBlockToolbarLastItem.Slot />
|
|
282
310
|
</>
|
|
283
311
|
) }
|
|
284
|
-
<BlockControls.Slot
|
|
285
|
-
group="other"
|
|
286
|
-
className="block-editor-block-toolbar__slot"
|
|
287
|
-
/>
|
|
288
|
-
<__unstableBlockToolbarLastItem.Slot />
|
|
289
312
|
</>
|
|
290
313
|
) }
|
|
291
314
|
<BlockEditVisuallyButton clientIds={ blockClientIds } />
|
|
@@ -13,7 +13,6 @@ import { paragraph } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import BlockToolbarIcon from '../block-toolbar-icon';
|
|
16
|
-
import { isIsolatedEditorKey } from '../../../store/private-keys';
|
|
17
16
|
|
|
18
17
|
jest.mock( '@wordpress/blocks', () => {
|
|
19
18
|
const actualImplementation = jest.requireActual( '@wordpress/blocks' );
|
|
@@ -68,15 +67,13 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
68
67
|
},
|
|
69
68
|
blockName = 'core/group',
|
|
70
69
|
getActiveBlockVariation = () => null,
|
|
71
|
-
|
|
72
|
-
isWithinEditedSection = false,
|
|
70
|
+
isSectionBlock = true,
|
|
73
71
|
} = {} ) => {
|
|
74
72
|
useSelect.mockImplementation( ( mapSelect ) =>
|
|
75
73
|
mapSelect( () => ( {
|
|
76
74
|
get: () => false,
|
|
77
75
|
getBlockName: () => blockName,
|
|
78
76
|
getBlockAttributes: () => attributes,
|
|
79
|
-
getSettings: () => settings,
|
|
80
77
|
getBlockParentsByBlockName: () => [],
|
|
81
78
|
canRemoveBlocks: () => true,
|
|
82
79
|
getTemplateLock: () => undefined,
|
|
@@ -84,7 +81,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
84
81
|
canEditBlock: () => true,
|
|
85
82
|
getBlockStyles: () => [ {} ],
|
|
86
83
|
getActiveBlockVariation,
|
|
87
|
-
|
|
84
|
+
isSectionBlock: () => isSectionBlock,
|
|
88
85
|
} ) )
|
|
89
86
|
);
|
|
90
87
|
};
|
|
@@ -210,7 +207,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
210
207
|
} );
|
|
211
208
|
|
|
212
209
|
it( 'should show the block switcher when the section is being edited', () => {
|
|
213
|
-
setupToolbarSelectors( {
|
|
210
|
+
setupToolbarSelectors( { isSectionBlock: false } );
|
|
214
211
|
|
|
215
212
|
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
216
213
|
|
|
@@ -227,9 +224,7 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
227
224
|
patternName: 'theme/header-wrapper',
|
|
228
225
|
},
|
|
229
226
|
},
|
|
230
|
-
|
|
231
|
-
[ isIsolatedEditorKey ]: true,
|
|
232
|
-
},
|
|
227
|
+
isSectionBlock: false,
|
|
233
228
|
} );
|
|
234
229
|
|
|
235
230
|
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
@@ -241,6 +236,34 @@ describe( 'BlockToolbarIcon', () => {
|
|
|
241
236
|
'core/group-icon'
|
|
242
237
|
);
|
|
243
238
|
} );
|
|
239
|
+
|
|
240
|
+
it( 'should show the block switcher when content-only editing is disabled', () => {
|
|
241
|
+
setupToolbarSelectors( {
|
|
242
|
+
isSectionBlock: false,
|
|
243
|
+
} );
|
|
244
|
+
|
|
245
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
246
|
+
|
|
247
|
+
expect(
|
|
248
|
+
screen.getByTestId( 'block-switcher' )
|
|
249
|
+
).toBeInTheDocument();
|
|
250
|
+
expect( screen.getByTestId( 'block-icon' ) ).toHaveTextContent(
|
|
251
|
+
'core/group-icon'
|
|
252
|
+
);
|
|
253
|
+
} );
|
|
254
|
+
|
|
255
|
+
it( 'should show the block icon for section blocks without pattern metadata', () => {
|
|
256
|
+
setupToolbarSelectors( {
|
|
257
|
+
attributes: {},
|
|
258
|
+
blockName: 'core/template-part',
|
|
259
|
+
} );
|
|
260
|
+
|
|
261
|
+
render( <BlockToolbarIcon { ...defaultProps } /> );
|
|
262
|
+
|
|
263
|
+
expect( screen.getByTestId( 'block-icon' ) ).toHaveTextContent(
|
|
264
|
+
'core/template-part-icon'
|
|
265
|
+
);
|
|
266
|
+
} );
|
|
244
267
|
} );
|
|
245
268
|
|
|
246
269
|
describe( 'label calculation', () => {
|
|
@@ -58,6 +58,9 @@ function selector( select ) {
|
|
|
58
58
|
isZoomOutMode: isZoomOut(),
|
|
59
59
|
isDragging: isDragging(),
|
|
60
60
|
viewportModalClientIds: getViewportModalClientIds(),
|
|
61
|
+
blockVisibilitySetting:
|
|
62
|
+
select( blockEditorStore ).getSettings().__experimentalFeatures
|
|
63
|
+
?.blockVisibility?.allowEditing,
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -82,6 +85,7 @@ export default function BlockTools( {
|
|
|
82
85
|
isZoomOutMode,
|
|
83
86
|
isDragging,
|
|
84
87
|
viewportModalClientIds,
|
|
88
|
+
blockVisibilitySetting,
|
|
85
89
|
} = useSelect( selector, [] );
|
|
86
90
|
const isMatch = useShortcutEventMatch();
|
|
87
91
|
const {
|
|
@@ -247,6 +251,9 @@ export default function BlockTools( {
|
|
|
247
251
|
} else if (
|
|
248
252
|
isMatch( 'core/block-editor/toggle-block-visibility', event )
|
|
249
253
|
) {
|
|
254
|
+
if ( blockVisibilitySetting === false ) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
250
257
|
const clientIds = getSelectedBlockClientIds();
|
|
251
258
|
if ( clientIds.length ) {
|
|
252
259
|
event.preventDefault();
|
|
@@ -28,13 +28,11 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
import {
|
|
32
|
-
BLOCK_VISIBILITY_VIEWPORT_ENTRIES,
|
|
33
|
-
BLOCK_VISIBILITY_VIEWPORTS,
|
|
34
|
-
} from './constants';
|
|
31
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from './constants';
|
|
35
32
|
import { store as blockEditorStore } from '../../store';
|
|
36
33
|
import { cleanEmptyObject } from '../../hooks/utils';
|
|
37
34
|
import {
|
|
35
|
+
getBlockVisibilityViewportEntries,
|
|
38
36
|
getViewportCheckboxState,
|
|
39
37
|
getHideEverywhereCheckboxState,
|
|
40
38
|
} from './utils';
|
|
@@ -74,6 +72,16 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
74
72
|
'core/editor/toggle-list-view'
|
|
75
73
|
);
|
|
76
74
|
}, [] );
|
|
75
|
+
const viewportSettings = useSelect(
|
|
76
|
+
( select ) =>
|
|
77
|
+
select( blockEditorStore ).getSettings().__experimentalFeatures
|
|
78
|
+
?.viewport,
|
|
79
|
+
[]
|
|
80
|
+
);
|
|
81
|
+
const viewportEntries = useMemo(
|
|
82
|
+
() => getBlockVisibilityViewportEntries( viewportSettings ),
|
|
83
|
+
[ viewportSettings ]
|
|
84
|
+
);
|
|
77
85
|
|
|
78
86
|
const initialViewportValues = useMemo( () => {
|
|
79
87
|
if ( blocks?.length === 0 ) {
|
|
@@ -85,7 +93,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
85
93
|
|
|
86
94
|
const viewportValues = {};
|
|
87
95
|
|
|
88
|
-
|
|
96
|
+
viewportEntries.forEach( ( [ , { key } ] ) => {
|
|
89
97
|
viewportValues[ key ] = getViewportCheckboxState( blocks, key );
|
|
90
98
|
} );
|
|
91
99
|
|
|
@@ -93,7 +101,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
93
101
|
hideEverywhere: getHideEverywhereCheckboxState( blocks ),
|
|
94
102
|
viewportChecked: viewportValues,
|
|
95
103
|
};
|
|
96
|
-
}, [ blocks ] );
|
|
104
|
+
}, [ blocks, viewportEntries ] );
|
|
97
105
|
|
|
98
106
|
const [ viewportChecked, setViewportChecked ] = useState(
|
|
99
107
|
initialViewportValues?.viewportChecked ?? {}
|
|
@@ -149,12 +157,17 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
149
157
|
if ( hideEverywhere !== initialViewportValues.hideEverywhere ) {
|
|
150
158
|
return true;
|
|
151
159
|
}
|
|
152
|
-
return
|
|
160
|
+
return viewportEntries.some(
|
|
153
161
|
( [ , { key } ] ) =>
|
|
154
162
|
viewportChecked[ key ] !==
|
|
155
163
|
initialViewportValues.viewportChecked[ key ]
|
|
156
164
|
);
|
|
157
|
-
}, [
|
|
165
|
+
}, [
|
|
166
|
+
hideEverywhere,
|
|
167
|
+
viewportChecked,
|
|
168
|
+
initialViewportValues,
|
|
169
|
+
viewportEntries,
|
|
170
|
+
] );
|
|
158
171
|
|
|
159
172
|
const hasIndeterminateValues = useMemo( () => {
|
|
160
173
|
if ( hideEverywhere === null ) {
|
|
@@ -171,7 +184,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
171
184
|
const newVisibility = hideEverywhere
|
|
172
185
|
? false
|
|
173
186
|
: {
|
|
174
|
-
viewport:
|
|
187
|
+
viewport: viewportEntries.reduce(
|
|
175
188
|
( acc, [ , { key } ] ) => {
|
|
176
189
|
if ( viewportChecked[ key ] ) {
|
|
177
190
|
// Values are inverted to hide the block on the selected viewport.
|
|
@@ -215,6 +228,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
215
228
|
noticeMessage,
|
|
216
229
|
onClose,
|
|
217
230
|
updateBlockAttributes,
|
|
231
|
+
viewportEntries,
|
|
218
232
|
viewportChecked,
|
|
219
233
|
]
|
|
220
234
|
);
|
|
@@ -258,7 +272,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
|
|
|
258
272
|
/>
|
|
259
273
|
{ hideEverywhere !== true && (
|
|
260
274
|
<ul className="block-editor-block-visibility-modal__sub-options">
|
|
261
|
-
{
|
|
275
|
+
{ viewportEntries.map(
|
|
262
276
|
( [ , { label, icon, key } ] ) => (
|
|
263
277
|
<li
|
|
264
278
|
key={ key }
|