@wordpress/block-editor 10.4.0 → 11.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 +17 -0
- package/README.md +0 -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/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-inspector/index.js +35 -33
- 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-lock/menu-item.js +1 -1
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +16 -9
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +12 -4
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +3 -2
- 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/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/index.js +19 -4
- package/build/components/block-switcher/index.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-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 +27 -4
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -2
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/colors/with-colors.js +4 -3
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +24 -40
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +7 -5
- package/build/components/font-sizes/with-font-sizes.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 +11 -8
- package/build/components/iframe/index.js.map +1 -1
- 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 +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +25 -9
- 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/index.js +8 -3
- 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 +103 -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 +1 -0
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/search-results.js +3 -1
- 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 +19 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +26 -0
- package/build/components/link-control/use-internal-input-value.js.map +1 -0
- package/build/components/list-view/block.js +10 -5
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +22 -15
- 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 +104 -0
- package/build/components/off-canvas-editor/appender.js.map +1 -0
- package/build/components/off-canvas-editor/block-contents.js +100 -0
- package/build/components/off-canvas-editor/block-contents.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 +119 -0
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build/components/off-canvas-editor/block.js +324 -0
- package/build/components/off-canvas-editor/block.js.map +1 -0
- package/build/components/off-canvas-editor/branch.js +179 -0
- package/build/components/off-canvas-editor/branch.js.map +1 -0
- package/build/components/off-canvas-editor/context.js +19 -0
- package/build/components/off-canvas-editor/context.js.map +1 -0
- package/build/components/off-canvas-editor/drop-indicator.js +118 -0
- package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build/components/off-canvas-editor/expander.js +41 -0
- package/build/components/off-canvas-editor/expander.js.map +1 -0
- package/build/components/off-canvas-editor/index.js +213 -0
- package/build/components/off-canvas-editor/index.js.map +1 -0
- package/build/components/off-canvas-editor/leaf.js +60 -0
- package/build/components/off-canvas-editor/leaf.js.map +1 -0
- 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-block-selection.js +139 -0
- package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build/components/off-canvas-editor/utils.js +60 -0
- package/build/components/off-canvas-editor/utils.js.map +1 -0
- 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-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/spacing-input-control.js +12 -3
- package/build/components/spacing-sizes-control/spacing-input-control.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/index.js +31 -2
- package/build/components/url-popover/index.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 +10 -2
- package/build/components/use-setting/index.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 +17 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +14 -7
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +65 -16
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/layout.js +59 -3
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/margin.js +4 -2
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/min-height.js +139 -0
- package/build/hooks/min-height.js.map +1 -0
- package/build/hooks/padding.js +4 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +3 -2
- package/build/hooks/style.js.map +1 -1
- package/build/layouts/flex.js +22 -21
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +26 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +420 -265
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +73 -49
- package/build/store/selectors.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/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-inspector/index.js +32 -30
- 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-lock/menu-item.js +2 -2
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +17 -10
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +13 -6
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +3 -2
- 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/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/index.js +19 -4
- package/build-module/components/block-switcher/index.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-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 +27 -5
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -2
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -4
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +24 -40
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +8 -6
- package/build-module/components/font-sizes/with-font-sizes.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 +11 -8
- package/build-module/components/iframe/index.js.map +1 -1
- 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 +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +27 -11
- 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/index.js +8 -3
- 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 +89 -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 +1 -0
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/search-results.js +3 -2
- 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 +18 -34
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +18 -0
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
- package/build-module/components/list-view/block.js +10 -5
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +21 -14
- 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 +89 -0
- package/build-module/components/off-canvas-editor/appender.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-contents.js +85 -0
- package/build-module/components/off-canvas-editor/block-contents.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 +101 -0
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block.js +298 -0
- package/build-module/components/off-canvas-editor/block.js.map +1 -0
- package/build-module/components/off-canvas-editor/branch.js +164 -0
- package/build-module/components/off-canvas-editor/branch.js.map +1 -0
- package/build-module/components/off-canvas-editor/context.js +7 -0
- package/build-module/components/off-canvas-editor/context.js.map +1 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build-module/components/off-canvas-editor/expander.js +32 -0
- package/build-module/components/off-canvas-editor/expander.js.map +1 -0
- package/build-module/components/off-canvas-editor/index.js +189 -0
- package/build-module/components/off-canvas-editor/index.js.map +1 -0
- package/build-module/components/off-canvas-editor/leaf.js +45 -0
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
- 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-block-selection.js +124 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build-module/components/off-canvas-editor/utils.js +44 -0
- package/build-module/components/off-canvas-editor/utils.js.map +1 -0
- 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-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/spacing-input-control.js +12 -3
- package/build-module/components/spacing-sizes-control/spacing-input-control.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/index.js +30 -3
- package/build-module/components/url-popover/index.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 +9 -2
- package/build-module/components/use-setting/index.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 +17 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +16 -9
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +60 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/layout.js +57 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/margin.js +4 -2
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/min-height.js +116 -0
- package/build-module/hooks/min-height.js.map +1 -0
- package/build-module/hooks/padding.js +4 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +4 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/layouts/flex.js +23 -22
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +22 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +415 -265
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +66 -48
- package/build-module/store/selectors.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 +14 -0
- package/build-style/default-editor-styles.css +14 -0
- package/build-style/style-rtl.css +305 -668
- package/build-style/style.css +305 -668
- package/package.json +32 -30
- package/src/autocompleters/block.js +2 -6
- package/src/autocompleters/link.js +2 -0
- package/src/components/alignment-control/README.md +1 -1
- package/src/components/alignment-control/test/index.js +4 -1
- package/src/components/block-alignment-control/test/index.js +4 -1
- package/src/components/block-alignment-control/test/index.native.js +4 -4
- 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-inspector/index.js +96 -81
- package/src/components/block-inspector/style.scss +9 -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} +11 -20
- package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
- package/src/components/block-lock/menu-item.js +5 -2
- package/src/components/block-lock/modal.js +19 -36
- package/src/components/block-lock/style.scss +8 -17
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +24 -6
- package/src/components/block-mover/style.scss +0 -1
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -2
- package/src/components/block-pattern-setup/index.js +2 -1
- package/src/components/block-patterns-list/index.js +47 -24
- package/src/components/block-popover/style.scss +1 -1
- 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/utils.js +3 -3
- package/src/components/block-switcher/index.js +19 -4
- package/src/components/block-switcher/test/index.js +4 -0
- package/src/components/block-toolbar/index.js +12 -5
- 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 +80 -34
- package/src/components/block-tools/style.scss +27 -5
- package/src/components/block-variation-picker/index.js +1 -4
- package/src/components/block-vertical-alignment-control/test/index.js +4 -1
- package/src/components/colors/with-colors.js +13 -23
- package/src/components/default-block-appender/{style.scss → content.scss} +1 -0
- package/src/components/font-sizes/fluid-utils.js +37 -64
- package/src/components/font-sizes/test/fluid-utils.js +5 -5
- package/src/components/font-sizes/with-font-sizes.js +14 -11
- 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 +25 -18
- package/src/components/image-editor/use-save-image.js +2 -0
- package/src/components/image-editor/zoom-dropdown.js +1 -0
- package/src/components/index.js +2 -0
- package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
- package/src/components/inner-blocks/index.js +30 -10
- 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/index.js +10 -2
- package/src/components/inserter/index.native.js +1 -1
- package/src/components/inserter/media-tab/hooks.js +88 -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 +1 -0
- package/src/components/inserter/reusable-blocks-tab.js +4 -2
- package/src/components/inserter/search-results.js +3 -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 +184 -18
- package/src/components/inserter/tabs.js +12 -1
- package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
- 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 +24 -39
- package/src/components/link-control/search-input.js +1 -2
- package/src/components/link-control/test/index.js +400 -582
- package/src/components/link-control/use-internal-input-value.js +22 -0
- package/src/components/list-view/block.js +7 -3
- package/src/components/list-view/branch.js +21 -14
- package/src/components/list-view/style.scss +20 -9
- package/src/components/media-placeholder/{style.scss → content.scss} +0 -0
- package/src/components/media-replace-flow/test/index.js +37 -9
- package/src/components/media-upload/test/index.native.js +2 -0
- package/src/components/off-canvas-editor/README.md +5 -0
- package/src/components/off-canvas-editor/appender.js +93 -0
- package/src/components/off-canvas-editor/block-contents.js +89 -0
- package/src/components/off-canvas-editor/block-edit-button.js +27 -0
- package/src/components/off-canvas-editor/block-select-button.js +113 -0
- package/src/components/off-canvas-editor/block.js +401 -0
- package/src/components/off-canvas-editor/branch.js +208 -0
- package/src/components/off-canvas-editor/context.js +8 -0
- package/src/components/off-canvas-editor/drop-indicator.js +126 -0
- package/src/components/off-canvas-editor/expander.js +26 -0
- package/src/components/off-canvas-editor/index.js +242 -0
- package/src/components/off-canvas-editor/leaf.js +52 -0
- package/src/components/off-canvas-editor/link-ui.js +166 -0
- package/src/components/off-canvas-editor/style.scss +26 -0
- package/src/components/off-canvas-editor/test/utils.js +50 -0
- package/src/components/off-canvas-editor/update-attributes.js +99 -0
- package/src/components/off-canvas-editor/use-block-selection.js +169 -0
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
- package/src/components/off-canvas-editor/utils.js +58 -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/test/index.js +69 -92
- package/src/components/rich-text/content.scss +42 -0
- package/src/components/rich-text/format-toolbar/index.js +6 -4
- package/src/components/rich-text/index.js +2 -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-undo-automatic-change.js +7 -1
- package/src/components/rich-text/utils.js +2 -21
- package/src/components/spacing-sizes-control/spacing-input-control.js +9 -0
- package/src/components/ungroup-button/index.native.js +6 -2
- package/src/components/url-input/index.js +57 -73
- package/src/components/url-popover/README.md +12 -3
- package/src/components/url-popover/index.js +33 -3
- package/src/components/url-popover/test/__snapshots__/index.js.snap +8 -6
- package/src/components/url-popover/test/index.js +21 -9
- package/src/components/use-block-display-information/index.js +14 -5
- package/src/components/use-setting/index.js +20 -2
- package/src/components/use-setting/test/index.js +99 -0
- package/src/content.scss +10 -0
- package/src/hooks/child-layout.js +190 -0
- package/src/hooks/color-panel.js +13 -1
- package/src/hooks/color.js +2 -0
- package/src/hooks/content-lock-ui.js +47 -35
- package/src/hooks/dimensions.js +119 -21
- package/src/hooks/layout.js +62 -3
- package/src/hooks/margin.js +4 -3
- package/src/hooks/min-height.js +104 -0
- package/src/hooks/padding.js +4 -3
- package/src/hooks/style.js +10 -2
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/test/use-typography-props.js +1 -1
- package/src/layouts/flex.js +43 -38
- package/src/store/actions.js +22 -0
- package/src/store/reducer.js +480 -434
- package/src/store/selectors.js +70 -64
- package/src/store/test/actions.js +18 -0
- package/src/store/test/performance.js +71 -0
- package/src/store/test/reducer.js +662 -490
- package/src/store/test/selectors.js +1839 -1306
- package/src/style.scss +4 -7
- 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-module/components/block-preview/live.js +0 -20
- package/build-module/components/block-preview/live.js.map +0 -1
- package/src/components/block-preview/live.js +0 -19
|
@@ -222,6 +222,8 @@ export default function SpacingInputControl( {
|
|
|
222
222
|
<UnitControl
|
|
223
223
|
onMouseOver={ onMouseOver }
|
|
224
224
|
onMouseOut={ onMouseOut }
|
|
225
|
+
onFocus={ onMouseOver }
|
|
226
|
+
onBlur={ onMouseOut }
|
|
225
227
|
onChange={ ( newSize ) =>
|
|
226
228
|
onChange( getNewCustomValue( newSize ) )
|
|
227
229
|
}
|
|
@@ -239,6 +241,8 @@ export default function SpacingInputControl( {
|
|
|
239
241
|
<RangeControl
|
|
240
242
|
onMouseOver={ onMouseOver }
|
|
241
243
|
onMouseOut={ onMouseOut }
|
|
244
|
+
onFocus={ onMouseOver }
|
|
245
|
+
onBlur={ onMouseOut }
|
|
242
246
|
value={ customRangeValue }
|
|
243
247
|
min={ 0 }
|
|
244
248
|
max={ CUSTOM_VALUE_SETTINGS[ selectedUnit ]?.max ?? 10 }
|
|
@@ -248,6 +252,7 @@ export default function SpacingInputControl( {
|
|
|
248
252
|
withInputField={ false }
|
|
249
253
|
onChange={ handleCustomValueSliderChange }
|
|
250
254
|
className="components-spacing-sizes-control__custom-value-range"
|
|
255
|
+
__nextHasNoMarginBottom
|
|
251
256
|
/>
|
|
252
257
|
</>
|
|
253
258
|
) }
|
|
@@ -277,6 +282,8 @@ export default function SpacingInputControl( {
|
|
|
277
282
|
label={ ariaLabel }
|
|
278
283
|
hideLabelFromVision={ true }
|
|
279
284
|
__nextHasNoMarginBottom={ true }
|
|
285
|
+
onFocus={ onMouseOver }
|
|
286
|
+
onBlur={ onMouseOut }
|
|
280
287
|
/>
|
|
281
288
|
) }
|
|
282
289
|
{ ! showRangeControl && ! showCustomValueControl && (
|
|
@@ -302,6 +309,8 @@ export default function SpacingInputControl( {
|
|
|
302
309
|
size={ '__unstable-large' }
|
|
303
310
|
onMouseOver={ onMouseOver }
|
|
304
311
|
onMouseOut={ onMouseOut }
|
|
312
|
+
onFocus={ onMouseOver }
|
|
313
|
+
onBlur={ onMouseOut }
|
|
305
314
|
/>
|
|
306
315
|
) }
|
|
307
316
|
</>
|
|
@@ -14,6 +14,7 @@ import UngroupIcon from './icon';
|
|
|
14
14
|
import { store as blockEditorStore } from '../../store';
|
|
15
15
|
|
|
16
16
|
const noop = () => {};
|
|
17
|
+
const EMPTY_BLOCKS_LIST = [];
|
|
17
18
|
|
|
18
19
|
export function UngroupButton( { onConvertFromGroup, isUngroupable = false } ) {
|
|
19
20
|
if ( ! isUngroupable ) {
|
|
@@ -45,9 +46,12 @@ export default compose( [
|
|
|
45
46
|
const isUngroupable =
|
|
46
47
|
selectedBlock &&
|
|
47
48
|
selectedBlock.innerBlocks &&
|
|
48
|
-
|
|
49
|
+
selectedBlock.innerBlocks.length > 0 &&
|
|
49
50
|
selectedBlock.name === groupingBlockName;
|
|
50
|
-
|
|
51
|
+
|
|
52
|
+
const innerBlocks = isUngroupable
|
|
53
|
+
? selectedBlock.innerBlocks
|
|
54
|
+
: EMPTY_BLOCKS_LIST;
|
|
51
55
|
|
|
52
56
|
return {
|
|
53
57
|
isUngroupable,
|
|
@@ -60,13 +60,14 @@ class URLInput extends Component {
|
|
|
60
60
|
|
|
61
61
|
this.suggestionNodes = [];
|
|
62
62
|
|
|
63
|
-
this.
|
|
63
|
+
this.suggestionsRequest = null;
|
|
64
64
|
|
|
65
65
|
this.state = {
|
|
66
66
|
suggestions: [],
|
|
67
67
|
showSuggestions: false,
|
|
68
|
+
isUpdatingSuggestions: false,
|
|
69
|
+
suggestionsValue: null,
|
|
68
70
|
selectedSuggestion: null,
|
|
69
|
-
|
|
70
71
|
suggestionsListboxId: '',
|
|
71
72
|
suggestionOptionIdPrefix: '',
|
|
72
73
|
};
|
|
@@ -103,7 +104,7 @@ class URLInput extends Component {
|
|
|
103
104
|
if (
|
|
104
105
|
prevProps.value !== value &&
|
|
105
106
|
! this.props.disableSuggestions &&
|
|
106
|
-
! this.isUpdatingSuggestions
|
|
107
|
+
! this.state.isUpdatingSuggestions
|
|
107
108
|
) {
|
|
108
109
|
if ( value?.length ) {
|
|
109
110
|
// If the new value is not empty we need to update with suggestions for it.
|
|
@@ -123,7 +124,7 @@ class URLInput extends Component {
|
|
|
123
124
|
|
|
124
125
|
componentWillUnmount() {
|
|
125
126
|
this.suggestionsRequest?.cancel?.();
|
|
126
|
-
|
|
127
|
+
this.suggestionsRequest = null;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
bindSuggestionNode( index ) {
|
|
@@ -133,14 +134,10 @@ class URLInput extends Component {
|
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
shouldShowInitialSuggestions() {
|
|
136
|
-
const { suggestions } = this.state;
|
|
137
137
|
const { __experimentalShowInitialSuggestions = false, value } =
|
|
138
138
|
this.props;
|
|
139
139
|
return (
|
|
140
|
-
!
|
|
141
|
-
__experimentalShowInitialSuggestions &&
|
|
142
|
-
! ( value && value.length ) &&
|
|
143
|
-
! ( suggestions && suggestions.length )
|
|
140
|
+
__experimentalShowInitialSuggestions && ! ( value && value.length )
|
|
144
141
|
);
|
|
145
142
|
}
|
|
146
143
|
|
|
@@ -170,8 +167,13 @@ class URLInput extends Component {
|
|
|
170
167
|
! isInitialSuggestions &&
|
|
171
168
|
( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )
|
|
172
169
|
) {
|
|
170
|
+
this.suggestionsRequest?.cancel?.();
|
|
171
|
+
this.suggestionsRequest = null;
|
|
172
|
+
|
|
173
173
|
this.setState( {
|
|
174
|
+
suggestions: [],
|
|
174
175
|
showSuggestions: false,
|
|
176
|
+
suggestionsValue: value,
|
|
175
177
|
selectedSuggestion: null,
|
|
176
178
|
loading: false,
|
|
177
179
|
} );
|
|
@@ -179,9 +181,8 @@ class URLInput extends Component {
|
|
|
179
181
|
return;
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
this.isUpdatingSuggestions = true;
|
|
183
|
-
|
|
184
184
|
this.setState( {
|
|
185
|
+
isUpdatingSuggestions: true,
|
|
185
186
|
selectedSuggestion: null,
|
|
186
187
|
loading: true,
|
|
187
188
|
} );
|
|
@@ -201,6 +202,8 @@ class URLInput extends Component {
|
|
|
201
202
|
|
|
202
203
|
this.setState( {
|
|
203
204
|
suggestions,
|
|
205
|
+
isUpdatingSuggestions: false,
|
|
206
|
+
suggestionsValue: value,
|
|
204
207
|
loading: false,
|
|
205
208
|
showSuggestions: !! suggestions.length,
|
|
206
209
|
} );
|
|
@@ -224,15 +227,16 @@ class URLInput extends Component {
|
|
|
224
227
|
'assertive'
|
|
225
228
|
);
|
|
226
229
|
}
|
|
227
|
-
this.isUpdatingSuggestions = false;
|
|
228
230
|
} )
|
|
229
231
|
.catch( () => {
|
|
230
|
-
if ( this.suggestionsRequest
|
|
231
|
-
|
|
232
|
-
loading: false,
|
|
233
|
-
} );
|
|
234
|
-
this.isUpdatingSuggestions = false;
|
|
232
|
+
if ( this.suggestionsRequest !== request ) {
|
|
233
|
+
return;
|
|
235
234
|
}
|
|
235
|
+
|
|
236
|
+
this.setState( {
|
|
237
|
+
isUpdatingSuggestions: false,
|
|
238
|
+
loading: false,
|
|
239
|
+
} );
|
|
236
240
|
} );
|
|
237
241
|
|
|
238
242
|
// Note that this assignment is handled *before* the async search request
|
|
@@ -241,12 +245,7 @@ class URLInput extends Component {
|
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
onChange( event ) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.props.onChange( inputValue );
|
|
247
|
-
if ( ! this.props.disableSuggestions ) {
|
|
248
|
-
this.updateSuggestions( inputValue );
|
|
249
|
-
}
|
|
248
|
+
this.props.onChange( event.target.value );
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
onFocus() {
|
|
@@ -258,7 +257,7 @@ class URLInput extends Component {
|
|
|
258
257
|
if (
|
|
259
258
|
value &&
|
|
260
259
|
! disableSuggestions &&
|
|
261
|
-
! this.isUpdatingSuggestions &&
|
|
260
|
+
! this.state.isUpdatingSuggestions &&
|
|
262
261
|
! ( suggestions && suggestions.length )
|
|
263
262
|
) {
|
|
264
263
|
// Ensure the suggestions are updated with the current input value.
|
|
@@ -490,19 +489,22 @@ class URLInput extends Component {
|
|
|
490
489
|
const {
|
|
491
490
|
className,
|
|
492
491
|
__experimentalRenderSuggestions: renderSuggestions,
|
|
493
|
-
value = '',
|
|
494
|
-
__experimentalShowInitialSuggestions = false,
|
|
495
492
|
} = this.props;
|
|
496
493
|
|
|
497
494
|
const {
|
|
498
495
|
showSuggestions,
|
|
499
496
|
suggestions,
|
|
497
|
+
suggestionsValue,
|
|
500
498
|
selectedSuggestion,
|
|
501
499
|
suggestionsListboxId,
|
|
502
500
|
suggestionOptionIdPrefix,
|
|
503
501
|
loading,
|
|
504
502
|
} = this.state;
|
|
505
503
|
|
|
504
|
+
if ( ! showSuggestions || suggestions.length === 0 ) {
|
|
505
|
+
return null;
|
|
506
|
+
}
|
|
507
|
+
|
|
506
508
|
const suggestionsListProps = {
|
|
507
509
|
id: suggestionsListboxId,
|
|
508
510
|
ref: this.autocompleteRef,
|
|
@@ -519,11 +521,7 @@ class URLInput extends Component {
|
|
|
519
521
|
};
|
|
520
522
|
};
|
|
521
523
|
|
|
522
|
-
if (
|
|
523
|
-
isFunction( renderSuggestions ) &&
|
|
524
|
-
showSuggestions &&
|
|
525
|
-
!! suggestions.length
|
|
526
|
-
) {
|
|
524
|
+
if ( isFunction( renderSuggestions ) ) {
|
|
527
525
|
return renderSuggestions( {
|
|
528
526
|
suggestions,
|
|
529
527
|
selectedSuggestion,
|
|
@@ -531,52 +529,38 @@ class URLInput extends Component {
|
|
|
531
529
|
buildSuggestionItemProps,
|
|
532
530
|
isLoading: loading,
|
|
533
531
|
handleSuggestionClick: this.handleOnClick,
|
|
534
|
-
isInitialSuggestions:
|
|
535
|
-
|
|
536
|
-
! ( value && value.length ),
|
|
532
|
+
isInitialSuggestions: ! suggestionsValue?.length,
|
|
533
|
+
currentInputValue: suggestionsValue,
|
|
537
534
|
} );
|
|
538
535
|
}
|
|
539
536
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
suggestion,
|
|
558
|
-
index
|
|
559
|
-
) }
|
|
560
|
-
key={ suggestion.id }
|
|
561
|
-
className={ classnames(
|
|
562
|
-
'block-editor-url-input__suggestion',
|
|
563
|
-
{
|
|
564
|
-
'is-selected':
|
|
565
|
-
index === selectedSuggestion,
|
|
566
|
-
}
|
|
567
|
-
) }
|
|
568
|
-
onClick={ () =>
|
|
569
|
-
this.handleOnClick( suggestion )
|
|
537
|
+
return (
|
|
538
|
+
<Popover placement="bottom" focusOnMount={ false }>
|
|
539
|
+
<div
|
|
540
|
+
{ ...suggestionsListProps }
|
|
541
|
+
className={ classnames(
|
|
542
|
+
'block-editor-url-input__suggestions',
|
|
543
|
+
`${ className }__suggestions`
|
|
544
|
+
) }
|
|
545
|
+
>
|
|
546
|
+
{ suggestions.map( ( suggestion, index ) => (
|
|
547
|
+
<Button
|
|
548
|
+
{ ...buildSuggestionItemProps( suggestion, index ) }
|
|
549
|
+
key={ suggestion.id }
|
|
550
|
+
className={ classnames(
|
|
551
|
+
'block-editor-url-input__suggestion',
|
|
552
|
+
{
|
|
553
|
+
'is-selected': index === selectedSuggestion,
|
|
570
554
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
555
|
+
) }
|
|
556
|
+
onClick={ () => this.handleOnClick( suggestion ) }
|
|
557
|
+
>
|
|
558
|
+
{ suggestion.title }
|
|
559
|
+
</Button>
|
|
560
|
+
) ) }
|
|
561
|
+
</div>
|
|
562
|
+
</Popover>
|
|
563
|
+
);
|
|
580
564
|
}
|
|
581
565
|
}
|
|
582
566
|
|
|
@@ -94,13 +94,13 @@ class MyURLPopover extends Component {
|
|
|
94
94
|
|
|
95
95
|
The component accepts the following props. Any other props are passed through to the underlying `Popover` component ([refer to props documentation](/packages/components/src/popover/README.md)).
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### placement
|
|
98
98
|
|
|
99
|
-
Where the Popover should be positioned relative to its parent. Defaults to "bottom
|
|
99
|
+
Where the Popover should be positioned relative to its parent. Defaults to "bottom".
|
|
100
100
|
|
|
101
101
|
- Type: `String`
|
|
102
102
|
- Required: No
|
|
103
|
-
- Default: "bottom
|
|
103
|
+
- Default: "bottom"
|
|
104
104
|
|
|
105
105
|
### focusOnMount
|
|
106
106
|
|
|
@@ -194,3 +194,12 @@ Reference passed to the auto complete element of the ([URLInput component](/pack
|
|
|
194
194
|
|
|
195
195
|
- Type: `Object`
|
|
196
196
|
- Required: no
|
|
197
|
+
|
|
198
|
+
### position
|
|
199
|
+
|
|
200
|
+
_Note: this prop is deprecated. Please use the `placement` prop instead._
|
|
201
|
+
|
|
202
|
+
Where the Popover should be positioned relative to its parent.
|
|
203
|
+
|
|
204
|
+
- Type: `String`
|
|
205
|
+
- Required: No
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Popover,
|
|
9
|
+
__experimentalPopoverPositionToPlacement as positionToPlacement,
|
|
10
|
+
} from '@wordpress/components';
|
|
7
11
|
import { chevronDown } from '@wordpress/icons';
|
|
12
|
+
import deprecated from '@wordpress/deprecated';
|
|
8
13
|
|
|
9
14
|
/**
|
|
10
15
|
* Internal dependencies
|
|
@@ -12,14 +17,39 @@ import { chevronDown } from '@wordpress/icons';
|
|
|
12
17
|
import LinkViewer from './link-viewer';
|
|
13
18
|
import LinkEditor from './link-editor';
|
|
14
19
|
|
|
20
|
+
const DEFAULT_PLACEMENT = 'bottom';
|
|
21
|
+
|
|
15
22
|
function URLPopover( {
|
|
16
23
|
additionalControls,
|
|
17
24
|
children,
|
|
18
25
|
renderSettings,
|
|
19
|
-
|
|
26
|
+
// The DEFAULT_PLACEMENT value is assigned inside the function's body
|
|
27
|
+
placement,
|
|
20
28
|
focusOnMount = 'firstElement',
|
|
29
|
+
// Deprecated
|
|
30
|
+
position,
|
|
31
|
+
// Rest
|
|
21
32
|
...popoverProps
|
|
22
33
|
} ) {
|
|
34
|
+
if ( position !== undefined ) {
|
|
35
|
+
deprecated( '`position` prop in wp.blockEditor.URLPopover', {
|
|
36
|
+
since: '6.2',
|
|
37
|
+
alternative: '`placement` prop',
|
|
38
|
+
} );
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Compute popover's placement:
|
|
42
|
+
// - give priority to `placement` prop, if defined
|
|
43
|
+
// - otherwise, compute it from the legacy `position` prop (if defined)
|
|
44
|
+
// - finally, fallback to the DEFAULT_PLACEMENT.
|
|
45
|
+
let computedPlacement;
|
|
46
|
+
if ( placement !== undefined ) {
|
|
47
|
+
computedPlacement = placement;
|
|
48
|
+
} else if ( position !== undefined ) {
|
|
49
|
+
computedPlacement = positionToPlacement( position );
|
|
50
|
+
}
|
|
51
|
+
computedPlacement = computedPlacement || DEFAULT_PLACEMENT;
|
|
52
|
+
|
|
23
53
|
const [ isSettingsExpanded, setIsSettingsExpanded ] = useState( false );
|
|
24
54
|
|
|
25
55
|
const showSettings = !! renderSettings && isSettingsExpanded;
|
|
@@ -32,7 +62,7 @@ function URLPopover( {
|
|
|
32
62
|
<Popover
|
|
33
63
|
className="block-editor-url-popover"
|
|
34
64
|
focusOnMount={ focusOnMount }
|
|
35
|
-
|
|
65
|
+
placement={ computedPlacement }
|
|
36
66
|
shift
|
|
37
67
|
{ ...popoverProps }
|
|
38
68
|
>
|
|
@@ -4,12 +4,13 @@ exports[`URLPopover matches the snapshot in its default state 1`] = `
|
|
|
4
4
|
<div>
|
|
5
5
|
<span>
|
|
6
6
|
<div
|
|
7
|
-
class="components-popover block-editor-url-popover"
|
|
8
|
-
style="position: absolute;
|
|
7
|
+
class="components-popover block-editor-url-popover is-positioned"
|
|
8
|
+
style="position: absolute; top: 0px; left: 0px; transform: none;"
|
|
9
9
|
tabindex="-1"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
12
|
class="components-popover__content"
|
|
13
|
+
style="max-height: 0px; overflow: auto;"
|
|
13
14
|
>
|
|
14
15
|
<div
|
|
15
16
|
class="block-editor-url-popover__input-container"
|
|
@@ -51,8 +52,8 @@ exports[`URLPopover matches the snapshot when the settings are toggled open 1`]
|
|
|
51
52
|
<div>
|
|
52
53
|
<span>
|
|
53
54
|
<div
|
|
54
|
-
class="components-popover block-editor-url-popover"
|
|
55
|
-
style="position: absolute;
|
|
55
|
+
class="components-popover block-editor-url-popover is-positioned"
|
|
56
|
+
style="position: absolute; top: 0px; left: 0px; transform: none;"
|
|
56
57
|
tabindex="-1"
|
|
57
58
|
>
|
|
58
59
|
<div
|
|
@@ -106,12 +107,13 @@ exports[`URLPopover matches the snapshot when there are no settings 1`] = `
|
|
|
106
107
|
<div>
|
|
107
108
|
<span>
|
|
108
109
|
<div
|
|
109
|
-
class="components-popover block-editor-url-popover"
|
|
110
|
-
style="position: absolute;
|
|
110
|
+
class="components-popover block-editor-url-popover is-positioned"
|
|
111
|
+
style="position: absolute; top: 0px; left: 0px; transform: none;"
|
|
111
112
|
tabindex="-1"
|
|
112
113
|
>
|
|
113
114
|
<div
|
|
114
115
|
class="components-popover__content"
|
|
116
|
+
style="max-height: 0px; overflow: auto;"
|
|
115
117
|
>
|
|
116
118
|
<div
|
|
117
119
|
class="block-editor-url-popover__input-container"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { act, render, screen } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9,23 +9,32 @@ import userEvent from '@testing-library/user-event';
|
|
|
9
9
|
*/
|
|
10
10
|
import URLPopover from '../';
|
|
11
11
|
|
|
12
|
+
jest.useRealTimers();
|
|
13
|
+
|
|
12
14
|
describe( 'URLPopover', () => {
|
|
13
|
-
it( 'matches the snapshot in its default state', () => {
|
|
15
|
+
it( 'matches the snapshot in its default state', async () => {
|
|
14
16
|
const { container } = render(
|
|
15
|
-
<URLPopover
|
|
17
|
+
<URLPopover
|
|
18
|
+
animate={ false }
|
|
19
|
+
renderSettings={ () => <div>Settings</div> }
|
|
20
|
+
>
|
|
16
21
|
<div>Editor</div>
|
|
17
22
|
</URLPopover>
|
|
18
23
|
);
|
|
19
24
|
|
|
25
|
+
// wait for `Popover` effects to finish
|
|
26
|
+
await act( () => Promise.resolve() );
|
|
27
|
+
|
|
20
28
|
expect( container ).toMatchSnapshot();
|
|
21
29
|
} );
|
|
22
30
|
|
|
23
31
|
it( 'matches the snapshot when the settings are toggled open', async () => {
|
|
24
|
-
const user = userEvent.setup(
|
|
25
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
26
|
-
} );
|
|
32
|
+
const user = userEvent.setup();
|
|
27
33
|
const { container } = render(
|
|
28
|
-
<URLPopover
|
|
34
|
+
<URLPopover
|
|
35
|
+
animate={ false }
|
|
36
|
+
renderSettings={ () => <div>Settings</div> }
|
|
37
|
+
>
|
|
29
38
|
<div>Editor</div>
|
|
30
39
|
</URLPopover>
|
|
31
40
|
);
|
|
@@ -37,13 +46,16 @@ describe( 'URLPopover', () => {
|
|
|
37
46
|
expect( container ).toMatchSnapshot();
|
|
38
47
|
} );
|
|
39
48
|
|
|
40
|
-
it( 'matches the snapshot when there are no settings', () => {
|
|
49
|
+
it( 'matches the snapshot when there are no settings', async () => {
|
|
41
50
|
const { container } = render(
|
|
42
|
-
<URLPopover>
|
|
51
|
+
<URLPopover animate={ false }>
|
|
43
52
|
<div>Editor</div>
|
|
44
53
|
</URLPopover>
|
|
45
54
|
);
|
|
46
55
|
|
|
56
|
+
// wait for `Popover` effects to finish
|
|
57
|
+
await act( () => Promise.resolve() );
|
|
58
|
+
|
|
47
59
|
expect( container ).toMatchSnapshot();
|
|
48
60
|
} );
|
|
49
61
|
} );
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
store as blocksStore,
|
|
7
|
+
isReusableBlock,
|
|
8
|
+
isTemplatePart,
|
|
9
|
+
} from '@wordpress/blocks';
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Internal dependencies
|
|
@@ -16,10 +20,11 @@ import { store as blockEditorStore } from '../../store';
|
|
|
16
20
|
*
|
|
17
21
|
* @typedef {Object} WPBlockDisplayInformation
|
|
18
22
|
*
|
|
19
|
-
* @property {
|
|
20
|
-
* @property {
|
|
21
|
-
* @property {
|
|
22
|
-
* @property {string}
|
|
23
|
+
* @property {boolean} isSynced True if is a reusable block or template part
|
|
24
|
+
* @property {string} title Human-readable block type label.
|
|
25
|
+
* @property {WPIcon} icon Block type icon.
|
|
26
|
+
* @property {string} description A detailed block type description.
|
|
27
|
+
* @property {string} anchor HTML anchor.
|
|
23
28
|
*/
|
|
24
29
|
|
|
25
30
|
/**
|
|
@@ -50,7 +55,10 @@ export default function useBlockDisplayInformation( clientId ) {
|
|
|
50
55
|
if ( ! blockType ) return null;
|
|
51
56
|
const attributes = getBlockAttributes( clientId );
|
|
52
57
|
const match = getActiveBlockVariation( blockName, attributes );
|
|
58
|
+
const isSynced =
|
|
59
|
+
isReusableBlock( blockType ) || isTemplatePart( blockType );
|
|
53
60
|
const blockTypeInfo = {
|
|
61
|
+
isSynced,
|
|
54
62
|
title: blockType.title,
|
|
55
63
|
icon: blockType.icon,
|
|
56
64
|
description: blockType.description,
|
|
@@ -59,6 +67,7 @@ export default function useBlockDisplayInformation( clientId ) {
|
|
|
59
67
|
if ( ! match ) return blockTypeInfo;
|
|
60
68
|
|
|
61
69
|
return {
|
|
70
|
+
isSynced,
|
|
62
71
|
title: match.title || blockType.title,
|
|
63
72
|
icon: match.icon || blockType.icon,
|
|
64
73
|
description: match.description || blockType.description,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
__EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE,
|
|
12
12
|
hasBlockSupport,
|
|
13
13
|
} from '@wordpress/blocks';
|
|
14
|
+
import { applyFilters } from '@wordpress/hooks';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
@@ -18,7 +19,13 @@ import {
|
|
|
18
19
|
import { useBlockEditContext } from '../block-edit';
|
|
19
20
|
import { store as blockEditorStore } from '../../store';
|
|
20
21
|
|
|
21
|
-
const blockedPaths = [
|
|
22
|
+
const blockedPaths = [
|
|
23
|
+
'color',
|
|
24
|
+
'border',
|
|
25
|
+
'dimensions',
|
|
26
|
+
'typography',
|
|
27
|
+
'spacing',
|
|
28
|
+
];
|
|
22
29
|
|
|
23
30
|
const deprecatedFlags = {
|
|
24
31
|
'color.palette': ( settings ) => settings.colors,
|
|
@@ -116,7 +123,18 @@ export default function useSetting( path ) {
|
|
|
116
123
|
return undefined;
|
|
117
124
|
}
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
// 0. Allow third parties to filter the block's settings at runtime.
|
|
127
|
+
let result = applyFilters(
|
|
128
|
+
'blockEditor.useSetting.before',
|
|
129
|
+
undefined,
|
|
130
|
+
path,
|
|
131
|
+
clientId,
|
|
132
|
+
blockName
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
if ( undefined !== result ) {
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
120
138
|
|
|
121
139
|
const normalizedPath = removeCustomPrefixes( path );
|
|
122
140
|
|