@wordpress/block-editor 10.5.0 → 11.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 +18 -0
- package/README.md +2 -1
- package/build/autocompleters/block.js +2 -6
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +2 -0
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/ui.js +1 -7
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +4 -3
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-card/index.js +51 -3
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +46 -39
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +4 -3
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +4 -7
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-icon/index.js +4 -2
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-inspector/index.js +90 -37
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +5 -8
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block.js +55 -24
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +61 -28
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list-appender/index.js +46 -34
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +39 -34
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +30 -22
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +1 -1
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +16 -8
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +33 -11
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +9 -3
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +5 -9
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -3
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/utils.js +7 -10
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-toolbar/index.js +5 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +6 -8
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +8 -49
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +1 -3
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-variation-picker/index.js +2 -3
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/colors/utils.js +2 -6
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors-gradients/control.js +0 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +0 -2
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -19
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -3
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/copy-handler/index.js +37 -9
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +5 -2
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -4
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +11 -6
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -8
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/height-control/index.js +115 -0
- package/build/components/height-control/index.js.map +1 -0
- package/build/components/iframe/index.js +22 -101
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +93 -0
- package/build/components/iframe/use-compatibility-styles.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +2 -0
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +1 -0
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +25 -7
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +25 -10
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +25 -46
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +3 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +27 -0
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -0
- package/build/components/inserter/hooks/use-insertion-point.js +4 -3
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/index.js +20 -6
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +3 -4
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +106 -0
- package/build/components/inserter/media-tab/hooks.js.map +1 -0
- package/build/components/inserter/media-tab/index.js +32 -0
- package/build/components/inserter/media-tab/index.js.map +1 -0
- package/build/components/inserter/media-tab/media-list.js +100 -0
- package/build/components/inserter/media-tab/media-list.js.map +1 -0
- package/build/components/inserter/media-tab/media-panel.js +96 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -0
- package/build/components/inserter/media-tab/media-tab.js +120 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -0
- package/build/components/inserter/media-tab/utils.js +54 -0
- package/build/components/inserter/media-tab/utils.js.map +1 -0
- package/build/components/inserter/menu.js +35 -12
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +70 -0
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -0
- package/build/components/inserter/quick-inserter.js +7 -3
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +15 -14
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +7 -3
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +16 -2
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-list-item/index.js +4 -1
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +46 -0
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
- package/build/components/inspector-controls-tabs/index.js +71 -0
- package/build/components/inspector-controls-tabs/index.js.map +1 -0
- package/build/components/inspector-controls-tabs/settings-tab.js +28 -0
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/styles-tab.js +61 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +97 -0
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +18 -0
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
- package/build/components/inspector-controls-tabs/utils.js +37 -0
- package/build/components/inspector-controls-tabs/utils.js.map +1 -0
- package/build/components/link-control/index.js +1 -0
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +0 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +3 -3
- package/build/components/link-control/use-internal-input-value.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +5 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +13 -12
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/media-upload/index.native.js +2 -3
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +99 -0
- package/build/components/off-canvas-editor/appender.js.map +1 -0
- package/build/components/off-canvas-editor/block-edit-button.js +50 -0
- package/build/components/off-canvas-editor/block-edit-button.js.map +1 -0
- package/build/components/off-canvas-editor/block-select-button.js +3 -2
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build/components/off-canvas-editor/block.js +82 -38
- package/build/components/off-canvas-editor/block.js.map +1 -1
- package/build/components/off-canvas-editor/branch.js +3 -5
- package/build/components/off-canvas-editor/branch.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +24 -11
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/off-canvas-editor/leaf.js +1 -1
- package/build/components/off-canvas-editor/leaf.js.map +1 -1
- package/build/components/off-canvas-editor/link-ui.js +185 -0
- package/build/components/off-canvas-editor/link-ui.js.map +1 -0
- package/build/components/off-canvas-editor/update-attributes.js +108 -0
- package/build/components/off-canvas-editor/update-attributes.js.map +1 -0
- package/build/components/off-canvas-editor/use-inserted-block.js +58 -0
- package/build/components/off-canvas-editor/use-inserted-block.js.map +1 -0
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/format-edit.js +12 -10
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +8 -4
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +3 -3
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/use-insert-replacement-text.js +43 -0
- package/build/components/rich-text/use-insert-replacement-text.js.map +1 -0
- package/build/components/rich-text/use-paste-handler.js +21 -12
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/use-undo-automatic-change.js +9 -1
- package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build/components/rich-text/utils.js +1 -19
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +0 -1
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +12 -3
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +1 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/typewriter/index.js +1 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +4 -2
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/url-input/index.js +46 -43
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -2
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-display-information/index.js +8 -4
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-setting/index.js +9 -1
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/writing-flow/index.js +1 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/hooks/border.js +0 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/child-layout.js +209 -0
- package/build/hooks/child-layout.js.map +1 -0
- package/build/hooks/color-panel.js +0 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -2
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +1 -1
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +25 -7
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +4 -4
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +5 -3
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +57 -1
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/min-height.js +4 -10
- package/build/hooks/min-height.js.map +1 -1
- package/build/hooks/use-typography-props.js +11 -8
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/store/reducer.js +411 -274
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +58 -48
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pasting.js +6 -11
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/sorting.js +63 -0
- package/build/utils/sorting.js.map +1 -0
- package/build-module/autocompleters/block.js +2 -6
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +2 -0
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -6
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +4 -3
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-card/index.js +45 -3
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +40 -31
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/edit.js +4 -2
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +4 -6
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-icon/index.js +4 -2
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +87 -34
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +5 -8
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block.js +55 -25
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +61 -28
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +46 -34
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +39 -32
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +31 -24
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +16 -8
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +35 -13
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +9 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +5 -8
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +1 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/utils.js +7 -9
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +6 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +6 -8
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +8 -49
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +1 -2
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +2 -3
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/colors/utils.js +3 -7
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +0 -3
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +0 -2
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +4 -19
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/copy-handler/index.js +38 -10
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +5 -2
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +11 -5
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +12 -7
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -7
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +103 -0
- package/build-module/components/height-control/index.js.map +1 -0
- package/build-module/components/iframe/index.js +21 -101
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +85 -0
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +2 -0
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +1 -0
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +27 -9
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +23 -10
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +27 -49
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +3 -2
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +18 -0
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -0
- package/build-module/components/inserter/hooks/use-insertion-point.js +4 -3
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/index.js +20 -6
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +3 -5
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +92 -0
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -0
- package/build-module/components/inserter/media-tab/index.js +4 -0
- package/build-module/components/inserter/media-tab/index.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-list.js +86 -0
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js +77 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-tab.js +100 -0
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -0
- package/build-module/components/inserter/media-tab/utils.js +45 -0
- package/build-module/components/inserter/media-tab/utils.js.map +1 -0
- package/build-module/components/inserter/menu.js +33 -12
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +61 -0
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -0
- package/build-module/components/inserter/quick-inserter.js +7 -3
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +15 -13
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +7 -4
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +15 -2
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +5 -2
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +32 -0
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/index.js +56 -0
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/settings-tab.js +17 -0
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js +46 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +81 -0
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +8 -0
- package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/utils.js +26 -0
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -0
- package/build-module/components/link-control/index.js +1 -0
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +0 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +3 -3
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -1
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +5 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +12 -11
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +2 -4
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +83 -0
- package/build-module/components/off-canvas-editor/appender.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-edit-button.js +35 -0
- package/build-module/components/off-canvas-editor/block-edit-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-select-button.js +3 -2
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build-module/components/off-canvas-editor/block.js +83 -41
- package/build-module/components/off-canvas-editor/block.js.map +1 -1
- package/build-module/components/off-canvas-editor/branch.js +3 -4
- package/build-module/components/off-canvas-editor/branch.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +24 -12
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/leaf.js +1 -1
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -1
- package/build-module/components/off-canvas-editor/link-ui.js +165 -0
- package/build-module/components/off-canvas-editor/link-ui.js.map +1 -0
- package/build-module/components/off-canvas-editor/update-attributes.js +97 -0
- package/build-module/components/off-canvas-editor/update-attributes.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-inserted-block.js +47 -0
- package/build-module/components/off-canvas-editor/use-inserted-block.js.map +1 -0
- package/build-module/components/responsive-block-control/label.js +1 -2
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +12 -9
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +6 -2
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -3
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -2
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-insert-replacement-text.js +33 -0
- package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -0
- package/build-module/components/rich-text/use-paste-handler.js +22 -12
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/use-undo-automatic-change.js +9 -1
- package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
- package/build-module/components/rich-text/utils.js +1 -16
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +0 -1
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -3
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +1 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +3 -2
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +46 -43
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +9 -5
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +8 -1
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +1 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/hooks/border.js +0 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/child-layout.js +189 -0
- package/build-module/hooks/child-layout.js.map +1 -0
- package/build-module/hooks/color-panel.js +0 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -2
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +1 -1
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +25 -8
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +5 -5
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +5 -3
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +55 -0
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/min-height.js +3 -9
- package/build-module/hooks/min-height.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +11 -8
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/store/reducer.js +409 -274
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +55 -48
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pasting.js +6 -10
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/sorting.js +56 -0
- package/build-module/utils/sorting.js.map +1 -0
- package/build-style/content-rtl.css +701 -0
- package/build-style/content.css +701 -0
- package/build-style/default-editor-styles-rtl.css +17 -3
- package/build-style/default-editor-styles.css +17 -3
- package/build-style/style-rtl.css +313 -665
- package/build-style/style.css +313 -665
- package/package.json +32 -30
- package/src/autocompleters/block.js +2 -6
- package/src/autocompleters/link.js +2 -0
- package/src/components/alignment-control/test/index.js +6 -1
- package/src/components/alignment-control/ui.js +1 -7
- package/src/components/block-alignment-control/test/index.js +6 -1
- package/src/components/block-alignment-control/use-available-alignments.js +4 -3
- package/src/components/block-card/index.js +46 -2
- package/src/components/block-card/style.scss +4 -0
- package/src/components/block-content-overlay/{style.scss → content.scss} +7 -1
- package/src/components/block-draggable/content.scss +20 -0
- package/src/components/block-draggable/index.native.js +54 -40
- package/src/components/block-draggable/style.scss +0 -21
- package/src/components/block-draggable/test/helpers.native.js +7 -9
- package/src/components/block-draggable/test/index.native.js +35 -45
- package/src/components/block-edit/edit.js +5 -2
- package/src/components/block-edit/edit.native.js +5 -6
- package/src/components/block-icon/index.js +4 -2
- package/src/components/block-icon/test/index.js +9 -5
- package/src/components/block-inspector/index.js +173 -85
- package/src/components/block-inspector/style.scss +16 -1
- package/src/components/block-list/block-list-context.native.js +5 -8
- package/src/components/block-list/block.js +74 -23
- package/src/components/block-list/block.native.js +78 -23
- package/src/components/block-list/{style.scss → content.scss} +1 -15
- package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
- package/src/components/block-list-appender/index.js +65 -54
- package/src/components/block-list-appender/index.native.js +45 -34
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +42 -28
- package/src/components/block-mobile-toolbar/index.native.js +1 -1
- package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap +125 -0
- package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +439 -0
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +42 -2
- package/src/components/block-mover/test/index.native.js +157 -1
- package/src/components/block-pattern-setup/index.js +17 -7
- package/src/components/block-pattern-setup/style.scss +29 -1
- package/src/components/block-patterns-list/index.js +47 -24
- package/src/components/block-preview/README.md +15 -10
- package/src/components/block-preview/auto.js +7 -1
- package/src/components/block-preview/content.scss +4 -0
- package/src/components/block-preview/index.js +7 -12
- package/src/components/block-preview/style.scss +0 -7
- package/src/components/block-preview/test/index.js +18 -35
- package/src/components/block-selection-clearer/test/index.js +12 -12
- package/src/components/block-settings-menu/block-settings-dropdown.js +32 -20
- package/src/components/block-styles/index.native.js +1 -2
- package/src/components/block-styles/utils.js +5 -7
- package/src/components/block-switcher/test/index.js +6 -1
- package/src/components/block-toolbar/index.js +12 -5
- package/src/components/block-toolbar/index.native.js +8 -11
- package/src/components/block-toolbar/style.scss +10 -0
- package/src/components/block-tools/insertion-point.js +3 -47
- package/src/components/block-tools/selected-block-popover.js +1 -3
- package/src/components/block-tools/style.scss +12 -5
- package/src/components/block-variation-picker/index.js +6 -5
- package/src/components/block-vertical-alignment-control/test/index.js +6 -1
- package/src/components/colors/test/with-colors.js +2 -0
- package/src/components/colors/utils.js +5 -3
- package/src/components/colors-gradients/control.js +0 -7
- package/src/components/colors-gradients/dropdown.js +0 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -22
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
- package/src/components/copy-handler/index.js +53 -7
- package/src/components/default-block-appender/{style.scss → content.scss} +0 -0
- package/src/components/default-block-appender/test/index.js +2 -0
- package/src/components/font-sizes/fluid-utils.js +7 -1
- package/src/components/font-sizes/utils.js +5 -3
- package/src/components/font-sizes/with-font-sizes.js +4 -4
- package/src/components/gradients/use-gradient.js +2 -7
- package/src/components/height-control/index.js +123 -0
- package/src/components/height-control/stories/index.js +21 -0
- package/src/components/height-control/style.scss +5 -0
- package/src/components/iframe/index.js +33 -121
- package/src/components/iframe/use-compatibility-styles.js +95 -0
- package/src/components/image-editor/use-save-image.js +2 -0
- package/src/components/image-editor/zoom-dropdown.js +1 -0
- package/src/components/image-size-control/test/index.js +147 -79
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
- package/src/components/inner-blocks/index.js +26 -7
- package/src/components/inner-blocks/use-inner-block-template-sync.js +28 -10
- package/src/components/inserter/block-patterns-explorer/sidebar.js +1 -0
- package/src/components/inserter/block-patterns-tab.js +28 -71
- package/src/components/inserter/block-types-tab.js +3 -2
- package/src/components/inserter/hooks/use-debounced-input.js +17 -0
- package/src/components/inserter/hooks/use-insertion-point.js +3 -2
- package/src/components/inserter/index.js +24 -3
- package/src/components/inserter/index.native.js +1 -1
- package/src/components/inserter/media-tab/hooks.js +89 -0
- package/src/components/inserter/media-tab/index.js +3 -0
- package/src/components/inserter/media-tab/media-list.js +93 -0
- package/src/components/inserter/media-tab/media-panel.js +83 -0
- package/src/components/inserter/media-tab/media-tab.js +135 -0
- package/src/components/inserter/media-tab/utils.js +37 -0
- package/src/components/inserter/menu.js +55 -13
- package/src/components/inserter/mobile-tab-navigation.js +85 -0
- package/src/components/inserter/quick-inserter.js +4 -0
- package/src/components/inserter/search-items.js +1 -2
- package/src/components/inserter/search-results.js +5 -2
- package/src/components/inserter/stories/index.js +1 -1
- package/src/components/inserter/stories/{fixtures.js → utils/fixtures.js} +0 -0
- package/src/components/inserter/style.scss +176 -11
- package/src/components/inserter/tabs.js +12 -1
- package/src/components/inserter-list-item/index.js +11 -1
- package/src/components/inserter-list-item/style.scss +26 -0
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/advanced-controls-panel.js +37 -0
- package/src/components/inspector-controls-tabs/index.js +62 -0
- package/src/components/inspector-controls-tabs/settings-tab.js +18 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +51 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +89 -0
- package/src/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +9 -0
- package/src/components/inspector-controls-tabs/utils.js +28 -0
- package/src/components/line-height-control/test/index.js +5 -5
- package/src/components/link-control/README.md +1 -1
- package/src/components/link-control/index.js +1 -0
- package/src/components/link-control/search-input.js +0 -1
- package/src/components/link-control/test/index.js +204 -403
- package/src/components/link-control/use-internal-input-value.js +3 -3
- package/src/components/list-view/block-select-button.js +1 -1
- package/src/components/list-view/block.js +3 -0
- package/src/components/list-view/branch.js +10 -8
- package/src/components/list-view/style.scss +21 -16
- package/src/components/media-placeholder/{style.scss → content.scss} +0 -0
- package/src/components/media-replace-flow/test/index.js +39 -9
- package/src/components/media-upload/test/index.native.js +2 -0
- package/src/components/off-canvas-editor/appender.js +98 -0
- package/src/components/off-canvas-editor/block-edit-button.js +27 -0
- package/src/components/off-canvas-editor/block-select-button.js +6 -2
- package/src/components/off-canvas-editor/block.js +160 -77
- package/src/components/off-canvas-editor/branch.js +3 -5
- package/src/components/off-canvas-editor/index.js +68 -33
- package/src/components/off-canvas-editor/leaf.js +5 -1
- package/src/components/off-canvas-editor/link-ui.js +166 -0
- package/src/components/off-canvas-editor/style.scss +19 -386
- package/src/components/off-canvas-editor/test/use-inserted-block.js +108 -0
- package/src/components/off-canvas-editor/update-attributes.js +99 -0
- package/src/components/off-canvas-editor/use-inserted-block.js +47 -0
- package/src/components/plain-text/{style.scss → content.scss} +0 -0
- package/src/components/recursion-provider/test/index.js +27 -29
- package/src/components/responsive-block-control/label.js +2 -3
- package/src/components/responsive-block-control/test/index.js +4 -2
- package/src/components/rich-text/content.scss +42 -0
- package/src/components/rich-text/format-edit.js +6 -10
- package/src/components/rich-text/format-toolbar/index.js +6 -4
- package/src/components/rich-text/index.js +3 -2
- package/src/components/rich-text/index.native.js +0 -2
- package/src/components/rich-text/style.scss +0 -43
- package/src/components/rich-text/use-insert-replacement-text.js +31 -0
- package/src/components/rich-text/use-paste-handler.js +33 -14
- package/src/components/rich-text/use-undo-automatic-change.js +7 -1
- package/src/components/rich-text/utils.js +2 -21
- package/src/components/spacing-sizes-control/index.js +0 -1
- package/src/components/spacing-sizes-control/spacing-input-control.js +9 -0
- package/src/components/spacing-sizes-control/utils.js +1 -1
- package/src/components/typewriter/index.js +3 -1
- package/src/components/ungroup-button/index.native.js +6 -2
- package/src/components/url-input/index.js +57 -73
- package/src/components/url-input/test/button.js +2 -0
- package/src/components/url-popover/image-url-input-ui.js +5 -4
- package/src/components/url-popover/test/__snapshots__/index.js.snap +8 -6
- package/src/components/url-popover/test/index.js +37 -9
- package/src/components/use-block-display-information/index.js +14 -5
- package/src/components/use-setting/index.js +13 -1
- package/src/components/use-setting/test/index.js +99 -0
- package/src/components/warning/test/index.js +2 -0
- package/src/components/writing-flow/index.js +1 -1
- package/src/content.scss +10 -0
- package/src/hooks/border.js +0 -1
- package/src/hooks/child-layout.js +190 -0
- package/src/hooks/color-panel.js +0 -1
- package/src/hooks/color.js +0 -2
- package/src/hooks/content-lock-ui.js +1 -1
- package/src/hooks/dimensions.js +45 -7
- package/src/hooks/font-family.js +3 -5
- package/src/hooks/font-size.js +13 -4
- package/src/hooks/layout.js +60 -0
- package/src/hooks/min-height.js +2 -19
- package/src/hooks/test/use-typography-props.js +26 -0
- package/src/hooks/use-typography-props.js +15 -7
- package/src/store/reducer.js +471 -428
- package/src/store/selectors.js +57 -59
- package/src/store/test/performance.js +71 -0
- package/src/store/test/reducer.js +623 -491
- package/src/store/test/selectors.js +1820 -1306
- package/src/style.scss +4 -7
- package/src/utils/pasting.js +3 -9
- package/src/utils/sorting.js +54 -0
- package/src/utils/test/sorting.js +49 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-preview/live.js +0 -30
- package/build/components/block-preview/live.js.map +0 -1
- package/build/components/colors-gradients/use-common-single-multiple-selects.js +0 -21
- package/build/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
- package/build/components/rich-text/file-paste-handler.js +0 -21
- package/build/components/rich-text/file-paste-handler.js.map +0 -1
- package/build-module/components/block-preview/live.js +0 -20
- package/build-module/components/block-preview/live.js.map +0 -1
- package/build-module/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
- package/build-module/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
- package/build-module/components/rich-text/file-paste-handler.js +0 -13
- package/build-module/components/rich-text/file-paste-handler.js.map +0 -1
- package/src/components/block-preview/live.js +0 -19
- package/src/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
- package/src/components/rich-text/file-paste-handler.js +0 -13
|
@@ -93,11 +93,13 @@ describe( 'BlockDraggable', () => {
|
|
|
93
93
|
it( 'enables drag mode when unselected', async () =>
|
|
94
94
|
withReanimatedTimer( async () => {
|
|
95
95
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
96
|
-
const { getByLabelText } = screen;
|
|
97
96
|
|
|
98
97
|
// Start dragging from block's content
|
|
98
|
+
const [ paragraphBlock ] = screen.getAllByLabelText(
|
|
99
|
+
/Paragraph Block\. Row 1/
|
|
100
|
+
);
|
|
99
101
|
fireLongPress(
|
|
100
|
-
|
|
102
|
+
paragraphBlock,
|
|
101
103
|
'draggable-trigger-content'
|
|
102
104
|
);
|
|
103
105
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -112,12 +114,12 @@ describe( 'BlockDraggable', () => {
|
|
|
112
114
|
it( 'enables drag mode when selected', async () =>
|
|
113
115
|
withReanimatedTimer( async () => {
|
|
114
116
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
115
|
-
|
|
117
|
+
|
|
116
118
|
const blockDraggableWrapper = getByGestureTestId(
|
|
117
119
|
'block-draggable-wrapper'
|
|
118
120
|
);
|
|
119
121
|
|
|
120
|
-
const paragraphBlock =
|
|
122
|
+
const [ paragraphBlock ] = screen.getAllByLabelText(
|
|
121
123
|
/Paragraph Block\. Row 1/
|
|
122
124
|
);
|
|
123
125
|
fireEvent.press( paragraphBlock );
|
|
@@ -146,9 +148,8 @@ describe( 'BlockDraggable', () => {
|
|
|
146
148
|
it( 'does not enable drag mode when selected and editing text', async () =>
|
|
147
149
|
withReanimatedTimer( async () => {
|
|
148
150
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
149
|
-
const { getByLabelText } = screen;
|
|
150
151
|
|
|
151
|
-
const paragraphBlock =
|
|
152
|
+
const [ paragraphBlock ] = screen.getAllByLabelText(
|
|
152
153
|
/Paragraph Block\. Row 1/
|
|
153
154
|
);
|
|
154
155
|
|
|
@@ -178,13 +179,12 @@ describe( 'BlockDraggable', () => {
|
|
|
178
179
|
it( 'finishes editing text and enables drag mode when long-pressing over a different block', async () =>
|
|
179
180
|
withReanimatedTimer( async () => {
|
|
180
181
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
181
|
-
const { getByLabelText } = screen;
|
|
182
182
|
|
|
183
|
-
const paragraphBlock =
|
|
183
|
+
const [ paragraphBlock ] = screen.getAllByLabelText(
|
|
184
184
|
/Paragraph Block\. Row 1/
|
|
185
185
|
);
|
|
186
|
-
const spacerBlock =
|
|
187
|
-
|
|
186
|
+
const [ spacerBlock ] =
|
|
187
|
+
screen.getAllByLabelText( /Spacer Block\. Row 3/ );
|
|
188
188
|
|
|
189
189
|
// Select Paragraph block and start editing text
|
|
190
190
|
fireEvent.press( paragraphBlock );
|
|
@@ -208,12 +208,11 @@ describe( 'BlockDraggable', () => {
|
|
|
208
208
|
it( 'enables drag mode when unselected', async () =>
|
|
209
209
|
withReanimatedTimer( async () => {
|
|
210
210
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
211
|
-
const { getAllByLabelText } = screen;
|
|
212
211
|
|
|
213
212
|
// We select the first Image block as the Gallery block
|
|
214
213
|
// also contains Image blocks.
|
|
215
|
-
const imageBlock =
|
|
216
|
-
getAllByLabelText( /Image Block\. Row 2/ )
|
|
214
|
+
const [ imageBlock ] =
|
|
215
|
+
screen.getAllByLabelText( /Image Block\. Row 2/ );
|
|
217
216
|
// Start dragging from block's content
|
|
218
217
|
fireLongPress( imageBlock, 'draggable-trigger-content' );
|
|
219
218
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -228,15 +227,14 @@ describe( 'BlockDraggable', () => {
|
|
|
228
227
|
it( 'enables drag mode when selected', async () =>
|
|
229
228
|
withReanimatedTimer( async () => {
|
|
230
229
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
231
|
-
const { getAllByLabelText } = screen;
|
|
232
230
|
const blockDraggableWrapper = getByGestureTestId(
|
|
233
231
|
'block-draggable-wrapper'
|
|
234
232
|
);
|
|
235
233
|
|
|
236
234
|
// We select the first Image block as the Gallery block
|
|
237
235
|
// also contains Image blocks.
|
|
238
|
-
const imageBlock =
|
|
239
|
-
getAllByLabelText( /Image Block\. Row 2/ )
|
|
236
|
+
const [ imageBlock ] =
|
|
237
|
+
screen.getAllByLabelText( /Image Block\. Row 2/ );
|
|
240
238
|
fireEvent.press( imageBlock );
|
|
241
239
|
|
|
242
240
|
// Start dragging from block's content
|
|
@@ -262,15 +260,15 @@ describe( 'BlockDraggable', () => {
|
|
|
262
260
|
it( 'enables drag mode when unselected', async () =>
|
|
263
261
|
withReanimatedTimer( async () => {
|
|
264
262
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
265
|
-
const { getByLabelText } = screen;
|
|
266
263
|
|
|
267
264
|
// Start dragging from block's content, specifically the first
|
|
268
265
|
// trigger index, which corresponds to the Gallery block content.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
'draggable-trigger-content',
|
|
272
|
-
{ triggerIndex: 0 }
|
|
266
|
+
const [ galleryBlock ] = screen.getAllByLabelText(
|
|
267
|
+
/Gallery Block\. Row 4/
|
|
273
268
|
);
|
|
269
|
+
fireLongPress( galleryBlock, 'draggable-trigger-content', {
|
|
270
|
+
triggerIndex: 0,
|
|
271
|
+
} );
|
|
274
272
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
275
273
|
|
|
276
274
|
// "firePanGesture" finishes the dragging gesture
|
|
@@ -283,12 +281,11 @@ describe( 'BlockDraggable', () => {
|
|
|
283
281
|
it( 'enables drag mode when selected', async () =>
|
|
284
282
|
withReanimatedTimer( async () => {
|
|
285
283
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
286
|
-
const { getByLabelText } = screen;
|
|
287
284
|
const blockDraggableWrapper = getByGestureTestId(
|
|
288
285
|
'block-draggable-wrapper'
|
|
289
286
|
);
|
|
290
287
|
|
|
291
|
-
const galleryBlock =
|
|
288
|
+
const [ galleryBlock ] = screen.getAllByLabelText(
|
|
292
289
|
/Gallery Block\. Row 4/
|
|
293
290
|
);
|
|
294
291
|
await waitForStoreResolvers( () =>
|
|
@@ -319,16 +316,15 @@ describe( 'BlockDraggable', () => {
|
|
|
319
316
|
it( 'enables drag mode when nested block is selected', async () =>
|
|
320
317
|
withReanimatedTimer( async () => {
|
|
321
318
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
322
|
-
const { getByLabelText } = screen;
|
|
323
319
|
const blockDraggableWrapper = getByGestureTestId(
|
|
324
320
|
'block-draggable-wrapper'
|
|
325
321
|
);
|
|
326
322
|
|
|
327
|
-
const galleryBlock =
|
|
323
|
+
const [ galleryBlock ] = screen.getAllByLabelText(
|
|
328
324
|
/Gallery Block\. Row 4/
|
|
329
325
|
);
|
|
330
|
-
const galleryItem =
|
|
331
|
-
within( galleryBlock ).
|
|
326
|
+
const [ galleryItem ] =
|
|
327
|
+
within( galleryBlock ).getAllByLabelText(
|
|
332
328
|
/Image Block\. Row 2/
|
|
333
329
|
);
|
|
334
330
|
fireEvent.press( galleryBlock );
|
|
@@ -361,13 +357,11 @@ describe( 'BlockDraggable', () => {
|
|
|
361
357
|
it( 'enables drag mode when unselected', async () =>
|
|
362
358
|
withReanimatedTimer( async () => {
|
|
363
359
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
364
|
-
const { getByLabelText } = screen;
|
|
365
360
|
|
|
366
361
|
// Start dragging from block's content
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
);
|
|
362
|
+
const [ spacerBlock ] =
|
|
363
|
+
screen.getAllByLabelText( /Spacer Block\. Row 3/ );
|
|
364
|
+
fireLongPress( spacerBlock, 'draggable-trigger-content' );
|
|
371
365
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
372
366
|
|
|
373
367
|
// "firePanGesture" finishes the dragging gesture
|
|
@@ -380,13 +374,12 @@ describe( 'BlockDraggable', () => {
|
|
|
380
374
|
it( 'enables drag mode when selected', async () =>
|
|
381
375
|
withReanimatedTimer( async () => {
|
|
382
376
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
383
|
-
const { getByLabelText } = screen;
|
|
384
377
|
const blockDraggableWrapper = getByGestureTestId(
|
|
385
378
|
'block-draggable-wrapper'
|
|
386
379
|
);
|
|
387
380
|
|
|
388
|
-
const spacerBlock =
|
|
389
|
-
|
|
381
|
+
const [ spacerBlock ] =
|
|
382
|
+
screen.getAllByLabelText( /Spacer Block\. Row 3/ );
|
|
390
383
|
await waitForStoreResolvers( () =>
|
|
391
384
|
fireEvent.press( spacerBlock )
|
|
392
385
|
);
|
|
@@ -413,9 +406,7 @@ describe( 'BlockDraggable', () => {
|
|
|
413
406
|
|
|
414
407
|
it( 'moves blocks', async () =>
|
|
415
408
|
withReanimatedTimer( async () => {
|
|
416
|
-
const
|
|
417
|
-
BLOCKS
|
|
418
|
-
);
|
|
409
|
+
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
419
410
|
const blockDraggableWrapper = getByGestureTestId(
|
|
420
411
|
'block-draggable-wrapper'
|
|
421
412
|
);
|
|
@@ -423,10 +414,10 @@ describe( 'BlockDraggable', () => {
|
|
|
423
414
|
expect( getEditorHtml() ).toMatchSnapshot( 'Initial order' );
|
|
424
415
|
|
|
425
416
|
// Move Paragraph block from first to second position
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
'draggable-trigger-content'
|
|
417
|
+
const [ paragraphBlock ] = screen.getAllByLabelText(
|
|
418
|
+
/Paragraph Block\. Row 1/
|
|
429
419
|
);
|
|
420
|
+
fireLongPress( paragraphBlock, 'draggable-trigger-content' );
|
|
430
421
|
firePanGesture( blockDraggableWrapper, [
|
|
431
422
|
{
|
|
432
423
|
id: TOUCH_EVENT_ID,
|
|
@@ -453,10 +444,9 @@ describe( 'BlockDraggable', () => {
|
|
|
453
444
|
);
|
|
454
445
|
|
|
455
446
|
// Move Spacer block from third to first position
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
);
|
|
447
|
+
const [ spacerBlock ] =
|
|
448
|
+
screen.getAllByLabelText( /Spacer Block\. Row 3/ );
|
|
449
|
+
fireLongPress( spacerBlock, 'draggable-trigger-content' );
|
|
460
450
|
firePanGesture( blockDraggableWrapper, [
|
|
461
451
|
{
|
|
462
452
|
id: TOUCH_EVENT_ID,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { pick } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -38,7 +37,11 @@ export const Edit = ( props ) => {
|
|
|
38
37
|
// Assign context values using the block type's declared context needs.
|
|
39
38
|
const context = useMemo( () => {
|
|
40
39
|
return blockType && blockType.usesContext
|
|
41
|
-
?
|
|
40
|
+
? Object.fromEntries(
|
|
41
|
+
Object.entries( blockContext ).filter( ( [ key ] ) =>
|
|
42
|
+
blockType.usesContext.includes( key )
|
|
43
|
+
)
|
|
44
|
+
)
|
|
42
45
|
: DEFAULT_BLOCK_CONTEXT;
|
|
43
46
|
}, [ blockType, blockContext ] );
|
|
44
47
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { pick } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -34,7 +29,11 @@ export const Edit = ( props ) => {
|
|
|
34
29
|
// Assign context values using the block type's declared context needs.
|
|
35
30
|
const context = useMemo( () => {
|
|
36
31
|
return blockType && blockType.usesContext
|
|
37
|
-
?
|
|
32
|
+
? Object.fromEntries(
|
|
33
|
+
Object.entries( blockContext ).filter( ( [ key ] ) =>
|
|
34
|
+
blockType.usesContext.includes( key )
|
|
35
|
+
)
|
|
36
|
+
)
|
|
38
37
|
: DEFAULT_BLOCK_CONTEXT;
|
|
39
38
|
}, [ blockType, blockContext ] );
|
|
40
39
|
|
|
@@ -10,14 +10,16 @@ import { Icon } from '@wordpress/components';
|
|
|
10
10
|
import { blockDefault } from '@wordpress/icons';
|
|
11
11
|
import { memo } from '@wordpress/element';
|
|
12
12
|
|
|
13
|
-
function BlockIcon( { icon, showColors = false, className } ) {
|
|
13
|
+
function BlockIcon( { icon, showColors = false, className, context } ) {
|
|
14
14
|
if ( icon?.src === 'block-default' ) {
|
|
15
15
|
icon = {
|
|
16
16
|
src: blockDefault,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const renderedIcon =
|
|
20
|
+
const renderedIcon = (
|
|
21
|
+
<Icon icon={ icon && icon.src ? icon.src : icon } context={ context } />
|
|
22
|
+
);
|
|
21
23
|
const style = showColors
|
|
22
24
|
? {
|
|
23
25
|
backgroundColor: icon && icon.background,
|
|
@@ -13,6 +13,10 @@ import { image } from '@wordpress/icons';
|
|
|
13
13
|
*/
|
|
14
14
|
import BlockIcon from '../';
|
|
15
15
|
|
|
16
|
+
function getIconWrapper( container ) {
|
|
17
|
+
return container.firstChild;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
describe( 'BlockIcon', () => {
|
|
17
21
|
it( 'renders a Icon', () => {
|
|
18
22
|
const { container } = render( <BlockIcon icon={ image } /> );
|
|
@@ -23,13 +27,13 @@ describe( 'BlockIcon', () => {
|
|
|
23
27
|
it( 'renders a span without the has-colors classname', () => {
|
|
24
28
|
const { container } = render( <BlockIcon icon={ image } /> );
|
|
25
29
|
|
|
26
|
-
expect( container
|
|
30
|
+
expect( getIconWrapper( container ) ).not.toHaveClass( 'has-colors' );
|
|
27
31
|
} );
|
|
28
32
|
|
|
29
33
|
it( 'renders a span with the has-colors classname', () => {
|
|
30
34
|
const { container } = render( <BlockIcon icon={ image } showColors /> );
|
|
31
35
|
|
|
32
|
-
expect( container
|
|
36
|
+
expect( getIconWrapper( container ) ).toHaveClass( 'has-colors' );
|
|
33
37
|
} );
|
|
34
38
|
|
|
35
39
|
it( 'supports adding a className to the wrapper', () => {
|
|
@@ -37,7 +41,7 @@ describe( 'BlockIcon', () => {
|
|
|
37
41
|
<BlockIcon icon={ image } className="foo-bar" />
|
|
38
42
|
);
|
|
39
43
|
|
|
40
|
-
expect( container
|
|
44
|
+
expect( getIconWrapper( container ) ).toHaveClass( 'foo-bar' );
|
|
41
45
|
} );
|
|
42
46
|
|
|
43
47
|
it( 'skips adding background and foreground styles when colors are not enabled', () => {
|
|
@@ -51,7 +55,7 @@ describe( 'BlockIcon', () => {
|
|
|
51
55
|
/>
|
|
52
56
|
);
|
|
53
57
|
|
|
54
|
-
expect( container
|
|
58
|
+
expect( getIconWrapper( container ) ).not.toHaveAttribute( 'style' );
|
|
55
59
|
} );
|
|
56
60
|
|
|
57
61
|
it( 'adds background and foreground styles when colors are enabled', () => {
|
|
@@ -66,7 +70,7 @@ describe( 'BlockIcon', () => {
|
|
|
66
70
|
/>
|
|
67
71
|
);
|
|
68
72
|
|
|
69
|
-
expect( container
|
|
73
|
+
expect( getIconWrapper( container ) ).toHaveStyle( {
|
|
70
74
|
backgroundColor: 'white',
|
|
71
75
|
color: 'black',
|
|
72
76
|
} );
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
store as blocksStore,
|
|
10
10
|
} from '@wordpress/blocks';
|
|
11
11
|
import {
|
|
12
|
-
PanelBody,
|
|
13
|
-
__experimentalUseSlotFills as useSlotFills,
|
|
14
12
|
FlexItem,
|
|
13
|
+
PanelBody,
|
|
15
14
|
__experimentalHStack as HStack,
|
|
16
15
|
__experimentalVStack as VStack,
|
|
17
16
|
Button,
|
|
17
|
+
__unstableMotion as motion,
|
|
18
18
|
} from '@wordpress/components';
|
|
19
19
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
20
20
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
@@ -24,20 +24,20 @@ import { useMemo, useCallback } from '@wordpress/element';
|
|
|
24
24
|
*/
|
|
25
25
|
import SkipToSelectedBlock from '../skip-to-selected-block';
|
|
26
26
|
import BlockCard from '../block-card';
|
|
27
|
-
import {
|
|
28
|
-
default as InspectorControls,
|
|
29
|
-
InspectorAdvancedControls,
|
|
30
|
-
} from '../inspector-controls';
|
|
31
|
-
import BlockStyles from '../block-styles';
|
|
32
27
|
import MultiSelectionInspector from '../multi-selection-inspector';
|
|
33
|
-
import DefaultStylePicker from '../default-style-picker';
|
|
34
28
|
import BlockVariationTransforms from '../block-variation-transforms';
|
|
35
29
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
36
30
|
import { store as blockEditorStore } from '../../store';
|
|
37
31
|
import BlockIcon from '../block-icon';
|
|
32
|
+
import BlockStyles from '../block-styles';
|
|
33
|
+
import DefaultStylePicker from '../default-style-picker';
|
|
34
|
+
import { default as InspectorControls } from '../inspector-controls';
|
|
35
|
+
import { default as InspectorControlsTabs } from '../inspector-controls-tabs';
|
|
36
|
+
import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';
|
|
37
|
+
import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
|
|
38
38
|
|
|
39
39
|
function useContentBlocks( blockTypes, block ) {
|
|
40
|
-
const
|
|
40
|
+
const contentBlocksObjectAux = useMemo( () => {
|
|
41
41
|
return blockTypes.reduce( ( result, blockType ) => {
|
|
42
42
|
if (
|
|
43
43
|
blockType.name !== 'core/list-item' &&
|
|
@@ -53,7 +53,7 @@ function useContentBlocks( blockTypes, block ) {
|
|
|
53
53
|
}, [ blockTypes ] );
|
|
54
54
|
const isContentBlock = useCallback(
|
|
55
55
|
( blockName ) => {
|
|
56
|
-
return !!
|
|
56
|
+
return !! contentBlocksObjectAux[ blockName ];
|
|
57
57
|
},
|
|
58
58
|
[ blockTypes ]
|
|
59
59
|
);
|
|
@@ -108,7 +108,10 @@ function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
|
|
|
108
108
|
const contentBlocks = useContentBlocks( blockTypes, block );
|
|
109
109
|
return (
|
|
110
110
|
<div className="block-editor-block-inspector">
|
|
111
|
-
<BlockCard
|
|
111
|
+
<BlockCard
|
|
112
|
+
{ ...blockInformation }
|
|
113
|
+
className={ blockInformation.isSynced && 'is-synced' }
|
|
114
|
+
/>
|
|
112
115
|
<BlockVariationTransforms blockClientId={ topLevelLockedBlock } />
|
|
113
116
|
<VStack
|
|
114
117
|
spacing={ 1 }
|
|
@@ -166,28 +169,55 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
166
169
|
};
|
|
167
170
|
}, [] );
|
|
168
171
|
|
|
172
|
+
const availableTabs = useInspectorControlsTabs( blockType?.name );
|
|
173
|
+
const showTabs = availableTabs?.length > 1;
|
|
174
|
+
|
|
175
|
+
const isOffCanvasNavigationEditorEnabled =
|
|
176
|
+
window?.__experimentalEnableOffCanvasNavigationEditor === true;
|
|
177
|
+
|
|
178
|
+
const blockInspectorAnimationSettings = useSelect(
|
|
179
|
+
( select ) => {
|
|
180
|
+
if ( isOffCanvasNavigationEditorEnabled ) {
|
|
181
|
+
const globalBlockInspectorAnimationSettings =
|
|
182
|
+
select( blockEditorStore ).getSettings()
|
|
183
|
+
.__experimentalBlockInspectorAnimation;
|
|
184
|
+
return globalBlockInspectorAnimationSettings?.[
|
|
185
|
+
blockType.name
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
return null;
|
|
189
|
+
},
|
|
190
|
+
[ selectedBlockClientId, isOffCanvasNavigationEditorEnabled, blockType ]
|
|
191
|
+
);
|
|
192
|
+
|
|
169
193
|
if ( count > 1 ) {
|
|
170
194
|
return (
|
|
171
195
|
<div className="block-editor-block-inspector">
|
|
172
196
|
<MultiSelectionInspector />
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
197
|
+
{ showTabs ? (
|
|
198
|
+
<InspectorControlsTabs tabs={ availableTabs } />
|
|
199
|
+
) : (
|
|
200
|
+
<>
|
|
201
|
+
<InspectorControls.Slot />
|
|
202
|
+
<InspectorControls.Slot
|
|
203
|
+
__experimentalGroup="color"
|
|
204
|
+
label={ __( 'Color' ) }
|
|
205
|
+
className="color-block-support-panel__inner-wrapper"
|
|
206
|
+
/>
|
|
207
|
+
<InspectorControls.Slot
|
|
208
|
+
__experimentalGroup="typography"
|
|
209
|
+
label={ __( 'Typography' ) }
|
|
210
|
+
/>
|
|
211
|
+
<InspectorControls.Slot
|
|
212
|
+
__experimentalGroup="dimensions"
|
|
213
|
+
label={ __( 'Dimensions' ) }
|
|
214
|
+
/>
|
|
215
|
+
<InspectorControls.Slot
|
|
216
|
+
__experimentalGroup="border"
|
|
217
|
+
label={ __( 'Border' ) }
|
|
218
|
+
/>
|
|
219
|
+
</>
|
|
220
|
+
) }
|
|
191
221
|
</div>
|
|
192
222
|
);
|
|
193
223
|
}
|
|
@@ -220,15 +250,72 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
220
250
|
/>
|
|
221
251
|
);
|
|
222
252
|
}
|
|
253
|
+
|
|
223
254
|
return (
|
|
224
|
-
<
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
255
|
+
<BlockInspectorSingleBlockWrapper
|
|
256
|
+
animate={
|
|
257
|
+
isOffCanvasNavigationEditorEnabled &&
|
|
258
|
+
blockInspectorAnimationSettings
|
|
259
|
+
}
|
|
260
|
+
wrapper={ ( children ) => (
|
|
261
|
+
<AnimatedContainer
|
|
262
|
+
blockInspectorAnimationSettings={
|
|
263
|
+
blockInspectorAnimationSettings
|
|
264
|
+
}
|
|
265
|
+
selectedBlockClientId={ selectedBlockClientId }
|
|
266
|
+
>
|
|
267
|
+
{ children }
|
|
268
|
+
</AnimatedContainer>
|
|
269
|
+
) }
|
|
270
|
+
>
|
|
271
|
+
<BlockInspectorSingleBlock
|
|
272
|
+
clientId={ selectedBlockClientId }
|
|
273
|
+
blockName={ blockType.name }
|
|
274
|
+
/>
|
|
275
|
+
</BlockInspectorSingleBlockWrapper>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {
|
|
280
|
+
return animate ? wrapper( children ) : children;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const AnimatedContainer = ( {
|
|
284
|
+
blockInspectorAnimationSettings,
|
|
285
|
+
selectedBlockClientId,
|
|
286
|
+
children,
|
|
287
|
+
} ) => {
|
|
288
|
+
const animationOrigin =
|
|
289
|
+
blockInspectorAnimationSettings &&
|
|
290
|
+
blockInspectorAnimationSettings.enterDirection === 'leftToRight'
|
|
291
|
+
? -50
|
|
292
|
+
: 50;
|
|
293
|
+
|
|
294
|
+
return (
|
|
295
|
+
<motion.div
|
|
296
|
+
animate={ {
|
|
297
|
+
x: 0,
|
|
298
|
+
opacity: 1,
|
|
299
|
+
transition: {
|
|
300
|
+
ease: 'easeInOut',
|
|
301
|
+
duration: 0.14,
|
|
302
|
+
},
|
|
303
|
+
} }
|
|
304
|
+
initial={ {
|
|
305
|
+
x: animationOrigin,
|
|
306
|
+
opacity: 0,
|
|
307
|
+
} }
|
|
308
|
+
key={ selectedBlockClientId }
|
|
309
|
+
>
|
|
310
|
+
{ children }
|
|
311
|
+
</motion.div>
|
|
228
312
|
);
|
|
229
313
|
};
|
|
230
314
|
|
|
231
315
|
const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
316
|
+
const availableTabs = useInspectorControlsTabs( blockName );
|
|
317
|
+
const showTabs = availableTabs?.length > 1;
|
|
318
|
+
|
|
232
319
|
const hasBlockStyles = useSelect(
|
|
233
320
|
( select ) => {
|
|
234
321
|
const { getBlockStyles } = select( blocksStore );
|
|
@@ -238,67 +325,68 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
238
325
|
[ blockName ]
|
|
239
326
|
);
|
|
240
327
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
328
|
+
|
|
241
329
|
return (
|
|
242
330
|
<div className="block-editor-block-inspector">
|
|
243
|
-
<BlockCard
|
|
331
|
+
<BlockCard
|
|
332
|
+
{ ...blockInformation }
|
|
333
|
+
className={ blockInformation.isSynced && 'is-synced' }
|
|
334
|
+
/>
|
|
244
335
|
<BlockVariationTransforms blockClientId={ clientId } />
|
|
245
|
-
{
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
336
|
+
{ showTabs && (
|
|
337
|
+
<InspectorControlsTabs
|
|
338
|
+
hasBlockStyles={ hasBlockStyles }
|
|
339
|
+
clientId={ clientId }
|
|
340
|
+
blockName={ blockName }
|
|
341
|
+
tabs={ availableTabs }
|
|
342
|
+
/>
|
|
343
|
+
) }
|
|
344
|
+
{ ! showTabs && (
|
|
345
|
+
<>
|
|
346
|
+
{ hasBlockStyles && (
|
|
347
|
+
<div>
|
|
348
|
+
<PanelBody title={ __( 'Styles' ) }>
|
|
349
|
+
<BlockStyles clientId={ clientId } />
|
|
350
|
+
{ hasBlockSupport(
|
|
351
|
+
blockName,
|
|
352
|
+
'defaultStylePicker',
|
|
353
|
+
true
|
|
354
|
+
) && (
|
|
355
|
+
<DefaultStylePicker
|
|
356
|
+
blockName={ blockName }
|
|
357
|
+
/>
|
|
358
|
+
) }
|
|
359
|
+
</PanelBody>
|
|
360
|
+
</div>
|
|
361
|
+
) }
|
|
362
|
+
<InspectorControls.Slot />
|
|
363
|
+
<InspectorControls.Slot
|
|
364
|
+
__experimentalGroup="color"
|
|
365
|
+
label={ __( 'Color' ) }
|
|
366
|
+
className="color-block-support-panel__inner-wrapper"
|
|
367
|
+
/>
|
|
368
|
+
<InspectorControls.Slot
|
|
369
|
+
__experimentalGroup="typography"
|
|
370
|
+
label={ __( 'Typography' ) }
|
|
371
|
+
/>
|
|
372
|
+
<InspectorControls.Slot
|
|
373
|
+
__experimentalGroup="dimensions"
|
|
374
|
+
label={ __( 'Dimensions' ) }
|
|
375
|
+
/>
|
|
376
|
+
<InspectorControls.Slot
|
|
377
|
+
__experimentalGroup="border"
|
|
378
|
+
label={ __( 'Border' ) }
|
|
379
|
+
/>
|
|
380
|
+
<div>
|
|
381
|
+
<AdvancedControls />
|
|
382
|
+
</div>
|
|
383
|
+
</>
|
|
256
384
|
) }
|
|
257
|
-
<InspectorControls.Slot />
|
|
258
|
-
<InspectorControls.Slot
|
|
259
|
-
__experimentalGroup="color"
|
|
260
|
-
label={ __( 'Color' ) }
|
|
261
|
-
className="color-block-support-panel__inner-wrapper"
|
|
262
|
-
/>
|
|
263
|
-
<InspectorControls.Slot
|
|
264
|
-
__experimentalGroup="typography"
|
|
265
|
-
label={ __( 'Typography' ) }
|
|
266
|
-
/>
|
|
267
|
-
<InspectorControls.Slot
|
|
268
|
-
__experimentalGroup="dimensions"
|
|
269
|
-
label={ __( 'Dimensions' ) }
|
|
270
|
-
/>
|
|
271
|
-
<InspectorControls.Slot
|
|
272
|
-
__experimentalGroup="border"
|
|
273
|
-
label={ __( 'Border' ) }
|
|
274
|
-
/>
|
|
275
|
-
<div>
|
|
276
|
-
<AdvancedControls />
|
|
277
|
-
</div>
|
|
278
385
|
<SkipToSelectedBlock key="back" />
|
|
279
386
|
</div>
|
|
280
387
|
);
|
|
281
388
|
};
|
|
282
389
|
|
|
283
|
-
const AdvancedControls = () => {
|
|
284
|
-
const fills = useSlotFills( InspectorAdvancedControls.slotName );
|
|
285
|
-
const hasFills = Boolean( fills && fills.length );
|
|
286
|
-
|
|
287
|
-
if ( ! hasFills ) {
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return (
|
|
292
|
-
<PanelBody
|
|
293
|
-
className="block-editor-block-inspector__advanced"
|
|
294
|
-
title={ __( 'Advanced' ) }
|
|
295
|
-
initialOpen={ false }
|
|
296
|
-
>
|
|
297
|
-
<InspectorControls.Slot __experimentalGroup="advanced" />
|
|
298
|
-
</PanelBody>
|
|
299
|
-
);
|
|
300
|
-
};
|
|
301
|
-
|
|
302
390
|
/**
|
|
303
391
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md
|
|
304
392
|
*/
|