@wordpress/block-editor 7.0.1 → 8.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 +11 -0
- package/README.md +47 -4
- package/build/components/autocomplete/index.js +1 -1
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +8 -4
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +61 -14
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +25 -3
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-content-overlay/index.js +2 -4
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-controls/fill.js +6 -6
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/groups.js +3 -1
- package/build/components/block-controls/groups.js.map +1 -1
- package/build/components/block-controls/hook.js +57 -0
- package/build/components/block-controls/hook.js.map +1 -0
- package/build/components/block-edit/context.js +6 -5
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/edit.js +1 -1
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-icon/index.js +5 -1
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +13 -9
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +14 -7
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-html.js +5 -0
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +31 -12
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +4 -4
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +15 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +6 -7
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/grid-item.native.js +68 -0
- package/build/components/block-list/grid-item.native.js.map +1 -0
- package/build/components/block-list/index.js +19 -15
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +13 -9
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +6 -6
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +4 -6
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-multi-selection.js +21 -6
- package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +9 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +9 -1
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-mover/index.js +4 -4
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +4 -4
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +0 -1
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-patterns-list/index.js +1 -8
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +42 -14
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings/container.native.js +5 -2
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +26 -5
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +10 -3
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +5 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/preview.native.js +2 -2
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +1 -1
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +10 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-title/index.js +3 -2
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +3 -0
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-popover.js +8 -7
- package/build/components/block-tools/block-popover.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +2 -4
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +4 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +96 -7
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-types-list/index.native.js +3 -2
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/utils.js +17 -8
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/colors/utils.js +11 -3
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors-gradients/control.js +22 -57
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +83 -7
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/contrast-checker/index.js +18 -12
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/copy-handler/index.js +9 -3
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +2 -2
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/duotone-control/index.js +41 -39
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editor-styles/index.js +9 -3
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +44 -12
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-sizes/index.native.js +24 -0
- package/build/components/font-sizes/index.native.js.map +1 -1
- package/build/components/iframe/index.js +46 -63
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +126 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
- package/build/components/image-editor/constants.js +16 -0
- package/build/components/image-editor/constants.js.map +1 -0
- package/build/components/image-editor/context.js +59 -0
- package/build/components/image-editor/context.js.map +1 -0
- package/build/components/image-editor/cropper.js +83 -0
- package/build/components/image-editor/cropper.js.map +1 -0
- package/build/components/image-editor/form-controls.js +36 -0
- package/build/components/image-editor/form-controls.js.map +1 -0
- package/build/components/image-editor/index.js +60 -0
- package/build/components/image-editor/index.js.map +1 -0
- package/build/components/image-editor/rotation-button.js +37 -0
- package/build/components/image-editor/rotation-button.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +84 -0
- package/build/components/image-editor/use-save-image.js.map +1 -0
- package/build/components/image-editor/use-transform-image.js +135 -0
- package/build/components/image-editor/use-transform-image.js.map +1 -0
- package/build/components/image-editor/zoom-dropdown.js +55 -0
- package/build/components/image-editor/zoom-dropdown.js.map +1 -0
- package/build/components/image-size-control/use-dimension-handler.js +14 -3
- package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build/components/index.js +42 -37
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +12 -7
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +11 -1
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +28 -10
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +42 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +24 -13
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +62 -0
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +111 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js +78 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-tab.js +74 -35
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +3 -6
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-clipboard-block.native.js +5 -4
- package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build/components/inserter/index.js +12 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -7
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +2 -0
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +2 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +18 -17
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/pattern-panel.js +19 -10
- package/build/components/inserter/pattern-panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +1 -1
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.native.js +9 -2
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -4
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +44 -0
- package/build/components/inserter/utils.native.js.map +1 -0
- package/build/components/inspector-controls/block-support-slot-container.js +28 -0
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -0
- package/build/components/inspector-controls/block-support-tools-panel.js +78 -0
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -0
- package/build/components/inspector-controls/fill.js +64 -0
- package/build/components/inspector-controls/fill.js.map +1 -0
- package/build/components/inspector-controls/{index.native.js → fill.native.js} +20 -19
- package/build/components/inspector-controls/fill.native.js.map +1 -0
- package/build/components/inspector-controls/groups.js +25 -0
- package/build/components/inspector-controls/groups.js.map +1 -0
- package/build/components/inspector-controls/index.js +22 -20
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +67 -0
- package/build/components/inspector-controls/slot.js.map +1 -0
- package/build/components/inspector-controls/slot.native.js +38 -0
- package/build/components/inspector-controls/slot.native.js.map +1 -0
- package/build/components/letter-spacing-control/index.js +9 -6
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +39 -0
- package/build/components/line-height-control/index.native.js.map +1 -0
- package/build/components/link-control/index.js +93 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +45 -15
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +25 -7
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +1 -20
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +54 -69
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +102 -76
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +53 -23
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/list-item.js +3 -2
- package/build/components/list-view/list-item.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +13 -54
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/media-placeholder/index.js +35 -21
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +2 -1
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +5 -3
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +1 -4
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -1
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +30 -1
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +66 -0
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -0
- package/build/components/rich-text/format-edit.js +28 -2
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +32 -11
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +29 -7
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +43 -5
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/input-event.js +25 -24
- package/build/components/rich-text/input-event.js.map +1 -1
- package/build/components/rich-text/shortcut.js +23 -9
- package/build/components/rich-text/shortcut.js.map +1 -1
- package/build/components/rich-text/use-input-events.js +27 -0
- package/build/components/rich-text/use-input-events.js.map +1 -0
- package/build/components/rich-text/use-paste-handler.js +45 -10
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/use-shortcuts.js +27 -0
- package/build/components/rich-text/use-shortcuts.js.map +1 -0
- package/build/components/rich-text/utils.js +22 -0
- package/build/components/rich-text/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/url-input/index.js +25 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-display-block-controls/index.js +5 -7
- package/build/components/use-display-block-controls/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +13 -10
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +2 -13
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-setting/index.js +49 -14
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +6 -0
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +18 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +14 -14
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +4 -2
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border-color.js +9 -5
- package/build/hooks/border-color.js.map +1 -1
- package/build/hooks/border.js +5 -5
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +5 -2
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +6 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/compat.js +23 -0
- package/build/hooks/compat.js.map +1 -0
- package/build/hooks/custom-class-name.js +3 -1
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/dimensions.js +63 -28
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +63 -18
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-appearance.js +49 -6
- package/build/hooks/font-appearance.js.map +1 -1
- package/build/hooks/font-family.js +123 -32
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -9
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +163 -0
- package/build/hooks/gap.js.map +1 -0
- package/build/hooks/index.js +12 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +47 -30
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/letter-spacing.js +45 -8
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/line-height.js +45 -8
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +43 -0
- package/build/hooks/lock.js.map +1 -0
- package/build/hooks/margin.js +6 -3
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +6 -3
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +39 -11
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/text-decoration.js +42 -6
- package/build/hooks/text-decoration.js.map +1 -1
- package/build/hooks/text-transform.js +42 -6
- package/build/hooks/text-transform.js.map +1 -1
- package/build/hooks/typography.js +109 -9
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +60 -0
- package/build/hooks/typography.native.js.map +1 -0
- package/build/hooks/use-cached-truthy.js +29 -0
- package/build/hooks/use-cached-truthy.js.map +1 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +215 -11
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +99 -6
- package/build/layouts/flow.js.map +1 -1
- package/build/store/actions.js +331 -266
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +16 -1
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/index.js +1 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +165 -114
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +203 -115
- package/build/store/selectors.js.map +1 -1
- package/build/utils/index.js +10 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +295 -0
- package/build/utils/parse-css-unit-to-px.js.map +1 -0
- package/build/utils/transform-styles/transforms/wrap.js +16 -0
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/components/autocomplete/index.js +2 -2
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +8 -4
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +64 -17
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +25 -3
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +2 -4
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +6 -5
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/groups.js +3 -1
- package/build-module/components/block-controls/groups.js.map +1 -1
- package/build-module/components/block-controls/hook.js +42 -0
- package/build-module/components/block-controls/hook.js.map +1 -0
- package/build-module/components/block-edit/context.js +4 -4
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/edit.js +1 -1
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-icon/index.js +5 -1
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-icon/index.native.js +14 -9
- package/build-module/components/block-icon/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +12 -6
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-html.js +5 -0
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +30 -12
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +3 -4
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +16 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +6 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/grid-item.native.js +57 -0
- package/build-module/components/block-list/grid-item.native.js.map +1 -0
- package/build-module/components/block-list/index.js +17 -14
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +13 -9
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +7 -7
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +2 -2
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-multi-selection.js +21 -6
- package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +9 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +9 -1
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mover/index.js +4 -4
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +4 -4
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +0 -1
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +40 -16
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +6 -3
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +28 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +10 -3
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +5 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +2 -2
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +10 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-title/index.js +3 -2
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +3 -0
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-popover.js +9 -8
- package/build-module/components/block-tools/block-popover.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -4
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +4 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +96 -8
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +3 -2
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +16 -9
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -3
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +26 -63
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +84 -7
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +13 -10
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/copy-handler/index.js +9 -3
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +2 -2
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +43 -39
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +7 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +40 -12
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-sizes/index.native.js +3 -1
- package/build-module/components/font-sizes/index.native.js.map +1 -1
- package/build-module/components/iframe/index.js +47 -65
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +115 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
- package/build-module/components/image-editor/constants.js +7 -0
- package/build-module/components/image-editor/constants.js.map +1 -0
- package/build-module/components/image-editor/context.js +44 -0
- package/build-module/components/image-editor/context.js.map +1 -0
- package/build-module/components/image-editor/cropper.js +69 -0
- package/build-module/components/image-editor/cropper.js.map +1 -0
- package/build-module/components/image-editor/form-controls.js +26 -0
- package/build-module/components/image-editor/form-controls.js.map +1 -0
- package/build-module/components/image-editor/index.js +37 -0
- package/build-module/components/image-editor/index.js.map +1 -0
- package/build-module/components/image-editor/rotation-button.js +26 -0
- package/build-module/components/image-editor/rotation-button.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +70 -0
- package/build-module/components/image-editor/use-save-image.js.map +1 -0
- package/build-module/components/image-editor/use-transform-image.js +127 -0
- package/build-module/components/image-editor/use-transform-image.js.map +1 -0
- package/build-module/components/image-editor/zoom-dropdown.js +43 -0
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -0
- package/build-module/components/image-size-control/use-dimension-handler.js +13 -2
- package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build-module/components/index.js +5 -6
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +2 -3
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +10 -1
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +29 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +41 -5
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -13
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +50 -0
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +92 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +69 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab.js +75 -36
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +2 -5
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js +5 -4
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build-module/components/inserter/index.js +12 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +1 -7
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +2 -0
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +17 -17
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/pattern-panel.js +21 -13
- package/build-module/components/inserter/pattern-panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +1 -1
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +4 -5
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +8 -2
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -4
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +35 -0
- package/build-module/components/inserter/utils.native.js.map +1 -0
- package/build-module/components/inspector-controls/block-support-slot-container.js +18 -0
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js +67 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -0
- package/build-module/components/inspector-controls/fill.js +50 -0
- package/build-module/components/inspector-controls/fill.js.map +1 -0
- package/build-module/components/inspector-controls/{index.native.js → fill.native.js} +16 -18
- package/build-module/components/inspector-controls/fill.native.js.map +1 -0
- package/build-module/components/inspector-controls/groups.js +16 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -0
- package/build-module/components/inspector-controls/index.js +16 -17
- package/build-module/components/inspector-controls/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +52 -0
- package/build-module/components/inspector-controls/slot.js.map +1 -0
- package/build-module/components/inspector-controls/slot.native.js +27 -0
- package/build-module/components/inspector-controls/slot.native.js.map +1 -0
- package/build-module/components/letter-spacing-control/index.js +9 -6
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +29 -0
- package/build-module/components/line-height-control/index.native.js.map +1 -0
- package/build-module/components/link-control/index.js +93 -35
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +46 -17
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +24 -7
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +1 -18
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +56 -71
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +102 -78
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +55 -27
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/list-item.js +3 -2
- package/build-module/components/list-view/list-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +13 -54
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +35 -21
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +2 -1
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +5 -3
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +1 -4
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +1 -1
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +29 -2
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +54 -0
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -0
- package/build-module/components/rich-text/format-edit.js +28 -3
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +29 -11
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +22 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +43 -6
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/input-event.js +24 -22
- package/build-module/components/rich-text/input-event.js.map +1 -1
- package/build-module/components/rich-text/shortcut.js +22 -9
- package/build-module/components/rich-text/shortcut.js.map +1 -1
- package/build-module/components/rich-text/use-input-events.js +19 -0
- package/build-module/components/rich-text/use-input-events.js.map +1 -0
- package/build-module/components/rich-text/use-paste-handler.js +44 -10
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/use-shortcuts.js +19 -0
- package/build-module/components/rich-text/use-shortcuts.js.map +1 -0
- package/build-module/components/rich-text/utils.js +20 -0
- package/build-module/components/rich-text/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/url-input/index.js +25 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.js +5 -7
- package/build-module/components/use-display-block-controls/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +13 -10
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -2
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +2 -10
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +48 -14
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +6 -0
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +18 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +15 -15
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +5 -3
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border-color.js +10 -5
- package/build-module/hooks/border-color.js.map +1 -1
- package/build-module/hooks/border.js +5 -5
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +6 -3
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +6 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/compat.js +20 -0
- package/build-module/hooks/compat.js.map +1 -0
- package/build-module/hooks/custom-class-name.js +4 -2
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/dimensions.js +57 -26
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +62 -18
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-appearance.js +45 -6
- package/build-module/hooks/font-appearance.js.map +1 -1
- package/build-module/hooks/font-family.js +117 -33
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +47 -9
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +140 -0
- package/build-module/hooks/gap.js.map +1 -0
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +2 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +47 -30
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/letter-spacing.js +41 -8
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/line-height.js +41 -8
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +33 -0
- package/build-module/hooks/lock.js.map +1 -0
- package/build-module/hooks/margin.js +7 -4
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +7 -4
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +39 -11
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/text-decoration.js +38 -6
- package/build-module/hooks/text-decoration.js.map +1 -1
- package/build-module/hooks/text-transform.js +38 -6
- package/build-module/hooks/text-transform.js.map +1 -1
- package/build-module/hooks/typography.js +118 -19
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +41 -0
- package/build-module/hooks/typography.native.js.map +1 -0
- package/build-module/hooks/use-cached-truthy.js +21 -0
- package/build-module/hooks/use-cached-truthy.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +210 -12
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +99 -7
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/store/actions.js +294 -242
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +15 -1
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/index.js +1 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +167 -115
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +189 -104
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +285 -0
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -0
- package/build-module/utils/transform-styles/transforms/wrap.js +16 -0
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/default-editor-styles-rtl.css +114 -0
- package/build-style/default-editor-styles.css +114 -0
- package/build-style/style-rtl.css +292 -181
- package/build-style/style.css +292 -181
- package/build-types/components/block-context/index.d.ts +1 -1
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/package.json +28 -27
- package/src/components/autocomplete/index.js +5 -2
- package/src/components/block-actions/index.js +9 -5
- package/src/components/block-alignment-control/style.scss +5 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +15 -1
- package/src/components/block-alignment-control/test/index.native.js +37 -0
- package/src/components/block-alignment-control/ui.js +98 -27
- package/src/components/block-alignment-control/use-available-alignments.js +31 -10
- package/src/components/block-content-overlay/index.js +3 -6
- package/src/components/block-content-overlay/style.scss +9 -21
- package/src/components/block-controls/fill.js +7 -4
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-controls/hook.js +44 -0
- package/src/components/block-draggable/style.scss +19 -4
- package/src/components/block-edit/context.js +4 -3
- package/src/components/block-edit/edit.js +1 -4
- package/src/components/block-icon/index.js +4 -1
- package/src/components/block-icon/index.native.js +11 -12
- package/src/components/block-inspector/index.js +19 -9
- package/src/components/block-list/block-html.js +5 -0
- package/src/components/block-list/block-list-item.native.js +34 -11
- package/src/components/block-list/block-list-item.native.scss +4 -0
- package/src/components/block-list/block-selection-button.native.js +8 -5
- package/src/components/block-list/block.js +13 -9
- package/src/components/block-list/block.native.js +7 -5
- package/src/components/block-list/grid-item.native.js +58 -0
- package/src/components/block-list/index.js +33 -27
- package/src/components/block-list/index.native.js +10 -4
- package/src/components/block-list/style.native.scss +0 -1
- package/src/components/block-list/style.scss +15 -0
- package/src/components/block-list/use-block-props/index.js +4 -7
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +2 -8
- package/src/components/block-list/use-block-props/use-multi-selection.js +30 -4
- package/src/components/block-list/use-in-between-inserter.js +9 -0
- package/src/components/block-list-appender/index.js +8 -0
- package/src/components/block-mover/index.js +4 -4
- package/src/components/block-mover/index.native.js +4 -4
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +10 -6
- package/src/components/block-mover/test/index.native.js +26 -28
- package/src/components/block-navigation/dropdown.js +0 -1
- package/src/components/block-patterns-list/index.js +1 -8
- package/src/components/block-patterns-list/style.scss +22 -12
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-preview/auto.js +36 -18
- package/src/components/block-preview/style.scss +0 -20
- package/src/components/block-settings/container.native.js +7 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +26 -13
- package/src/components/block-settings-menu-controls/index.js +9 -6
- package/src/components/block-styles/index.js +6 -1
- package/src/components/block-styles/preview.native.js +2 -2
- package/src/components/block-switcher/block-styles-menu.js +1 -1
- package/src/components/block-switcher/index.js +7 -3
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-switcher/test/index.js +3 -0
- package/src/components/block-title/index.js +5 -2
- package/src/components/block-toolbar/index.js +4 -0
- package/src/components/block-tools/block-contextual-toolbar.js +7 -5
- package/src/components/block-tools/block-popover.js +8 -8
- package/src/components/block-tools/block-selection-button.js +2 -4
- package/src/components/block-tools/index.js +5 -2
- package/src/components/block-tools/insertion-point.js +97 -9
- package/src/components/block-tools/style.scss +4 -35
- package/src/components/block-types-list/index.native.js +8 -2
- package/src/components/block-types-list/style.scss +0 -3
- package/src/components/block-variation-picker/README.md +47 -14
- package/src/components/block-variation-picker/style.native.scss +4 -0
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/test/utils.js +216 -0
- package/src/components/border-radius-control/utils.js +18 -10
- package/src/components/color-palette/test/__snapshots__/control.js.snap +128 -71
- package/src/components/colors/test/utils.js +41 -0
- package/src/components/colors/utils.js +9 -5
- package/src/components/colors-gradients/control.js +70 -110
- package/src/components/colors-gradients/panel-color-gradient-settings.js +79 -7
- package/src/components/colors-gradients/style.scss +10 -18
- package/src/components/colors-gradients/test/control.js +41 -66
- package/src/components/contrast-checker/index.js +14 -10
- package/src/components/copy-handler/index.js +6 -1
- package/src/components/default-block-appender/index.js +2 -2
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +3 -3
- package/src/components/duotone-control/index.js +49 -41
- package/src/components/duotone-control/style.scss +27 -12
- package/src/components/editor-styles/index.js +8 -4
- package/src/components/font-appearance-control/index.js +62 -24
- package/src/components/font-appearance-control/style.scss +1 -1
- package/src/components/font-sizes/index.native.js +7 -1
- package/src/components/iframe/index.js +64 -75
- package/src/components/image-editor/aspect-ratio-dropdown.js +129 -0
- package/src/components/image-editor/constants.js +6 -0
- package/src/components/image-editor/context.js +56 -0
- package/src/components/image-editor/cropper.js +74 -0
- package/src/components/image-editor/form-controls.js +22 -0
- package/src/components/image-editor/index.js +52 -0
- package/src/components/image-editor/rotation-button.js +24 -0
- package/src/components/image-editor/use-save-image.js +97 -0
- package/src/components/image-editor/use-transform-image.js +162 -0
- package/src/components/image-editor/zoom-dropdown.js +40 -0
- package/src/components/image-size-control/use-dimension-handler.js +18 -1
- package/src/components/index.js +10 -8
- package/src/components/index.native.js +5 -3
- package/src/components/inner-blocks/button-block-appender.js +9 -0
- package/src/components/inner-blocks/index.js +43 -14
- package/src/components/inner-blocks/index.native.js +48 -4
- package/src/components/inner-blocks/use-nested-settings-update.js +26 -11
- package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
- package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
- package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
- package/src/components/inserter/block-patterns-tab.js +107 -73
- package/src/components/inserter/block-types-tab.native.js +3 -6
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
- package/src/components/inserter/hooks/use-clipboard-block.native.js +3 -2
- package/src/components/inserter/index.js +15 -3
- package/src/components/inserter/index.native.js +2 -19
- package/src/components/inserter/library.js +2 -0
- package/src/components/inserter/menu.js +4 -1
- package/src/components/inserter/menu.native.js +18 -15
- package/src/components/inserter/pattern-panel.js +33 -16
- package/src/components/inserter/preview-panel.js +1 -1
- package/src/components/inserter/quick-inserter.js +1 -1
- package/src/components/inserter/reusable-blocks-tab.native.js +4 -6
- package/src/components/inserter/search-results.native.js +8 -1
- package/src/components/inserter/style.native.scss +8 -5
- package/src/components/inserter/style.scss +80 -16
- package/src/components/inserter/tabs.native.js +1 -7
- package/src/components/inserter/test/block-types-tab.native.js +3 -2
- package/src/components/inserter/test/fixtures/index.native.js +12 -0
- package/src/components/inserter/utils.native.js +35 -0
- package/src/components/inserter-list-item/style.scss +4 -2
- package/src/components/inspector-controls/README.md +43 -198
- package/src/components/inspector-controls/block-support-slot-container.js +10 -0
- package/src/components/inspector-controls/block-support-tools-panel.js +60 -0
- package/src/components/inspector-controls/fill.js +53 -0
- package/src/components/inspector-controls/{index.native.js → fill.native.js} +14 -14
- package/src/components/inspector-controls/groups.js +22 -0
- package/src/components/inspector-controls/index.js +16 -18
- package/src/components/inspector-controls/slot.js +45 -0
- package/src/components/inspector-controls/slot.native.js +22 -0
- package/src/components/letter-spacing-control/index.js +12 -6
- package/src/components/line-height-control/index.native.js +25 -0
- package/src/components/link-control/README.md +47 -14
- package/src/components/link-control/index.js +102 -31
- package/src/components/link-control/link-preview.js +53 -20
- package/src/components/link-control/search-input.js +21 -7
- package/src/components/link-control/style.scss +66 -19
- package/src/components/link-control/test/index.js +311 -4
- package/src/components/list-view/block-contents.js +17 -38
- package/src/components/list-view/block.js +73 -84
- package/src/components/list-view/branch.js +123 -94
- package/src/components/list-view/index.js +95 -37
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/list-item.js +5 -4
- package/src/components/list-view/style.scss +70 -33
- package/src/components/list-view/use-list-view-client-ids.js +9 -68
- package/src/components/media-placeholder/README.md +9 -0
- package/src/components/media-placeholder/index.js +31 -20
- package/src/components/media-placeholder/index.native.js +2 -1
- package/src/components/media-placeholder/style.scss +2 -0
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +4 -1
- package/src/components/media-replace-flow/style.scss +11 -12
- package/src/components/media-upload/README.md +1 -1
- package/src/components/navigable-toolbar/index.js +1 -4
- package/src/components/observe-typing/index.js +3 -2
- package/src/components/plain-text/index.native.js +26 -4
- package/src/components/rich-text/embed-handler-picker.native.js +68 -0
- package/src/components/rich-text/format-edit.js +36 -2
- package/src/components/rich-text/format-toolbar/index.js +25 -6
- package/src/components/rich-text/index.js +38 -12
- package/src/components/rich-text/index.native.js +37 -4
- package/src/components/rich-text/input-event.js +21 -20
- package/src/components/rich-text/shortcut.js +24 -9
- package/src/components/rich-text/style.scss +7 -5
- package/src/components/rich-text/use-input-events.js +19 -0
- package/src/components/rich-text/use-paste-handler.js +47 -12
- package/src/components/rich-text/use-shortcuts.js +19 -0
- package/src/components/rich-text/utils.js +16 -0
- package/src/components/skip-to-selected-block/README.md +39 -0
- package/src/components/tool-selector/style.scss +5 -5
- package/src/components/typewriter/index.js +3 -2
- package/src/components/url-input/index.js +26 -10
- package/src/components/use-display-block-controls/index.js +7 -10
- package/src/components/use-moving-animation/index.js +9 -8
- package/src/components/use-on-block-drop/index.js +5 -1
- package/src/components/use-resize-canvas/index.js +2 -17
- package/src/components/use-setting/index.js +48 -16
- package/src/components/writing-flow/use-multi-selection.js +6 -0
- package/src/components/writing-flow/use-tab-nav.js +21 -11
- package/src/default-editor-styles.scss +24 -0
- package/src/hooks/align.js +28 -20
- package/src/hooks/anchor.js +5 -5
- package/src/hooks/border-color.js +12 -1
- package/src/hooks/border.js +8 -11
- package/src/hooks/color-panel.js +4 -1
- package/src/hooks/color.js +11 -4
- package/src/hooks/compat.js +23 -0
- package/src/hooks/custom-class-name.js +3 -3
- package/src/hooks/dimensions.js +94 -50
- package/src/hooks/duotone.js +70 -21
- package/src/hooks/font-appearance.js +38 -7
- package/src/hooks/font-family.js +129 -33
- package/src/hooks/font-size.js +42 -6
- package/src/hooks/gap.js +146 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/index.native.js +2 -0
- package/src/hooks/layout.js +82 -56
- package/src/hooks/layout.scss +8 -0
- package/src/hooks/letter-spacing.js +37 -8
- package/src/hooks/line-height.js +37 -9
- package/src/hooks/lock.js +34 -0
- package/src/hooks/margin.js +13 -3
- package/src/hooks/padding.js +13 -3
- package/src/hooks/style.js +57 -18
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/text-decoration.js +34 -6
- package/src/hooks/text-transform.js +34 -6
- package/src/hooks/typography.js +167 -21
- package/src/hooks/typography.native.js +64 -0
- package/src/hooks/typography.scss +16 -0
- package/src/hooks/use-cached-truthy.js +20 -0
- package/src/index.js +1 -0
- package/src/layouts/flex.js +237 -14
- package/src/layouts/flow.js +81 -14
- package/src/store/actions.js +248 -378
- package/src/store/defaults.js +2 -0
- package/src/store/defaults.native.js +15 -0
- package/src/store/index.js +1 -2
- package/src/store/reducer.js +248 -145
- package/src/store/selectors.js +212 -158
- package/src/store/test/actions.js +407 -705
- package/src/store/test/reducer.js +184 -146
- package/src/store/test/selectors.js +197 -177
- package/src/style.scss +2 -15
- package/src/utils/index.js +1 -0
- package/src/utils/parse-css-unit-to-px.js +272 -0
- package/src/utils/test/parse-css-unit-to-px.js +166 -0
- package/src/utils/transform-styles/transforms/test/wrap.js +1 -1
- package/src/utils/transform-styles/transforms/wrap.js +16 -0
- package/tsconfig.tsbuildinfo +1 -466
- package/build/components/block-list/head.js +0 -27
- package/build/components/block-list/head.js.map +0 -1
- package/build/components/duotone-control/duotone-picker-popover.js +0 -44
- package/build/components/duotone-control/duotone-picker-popover.js.map +0 -1
- package/build/components/inspector-advanced-controls/index.js +0 -46
- package/build/components/inspector-advanced-controls/index.js.map +0 -1
- package/build/components/inspector-controls/index.native.js.map +0 -1
- package/build/components/list-view/block-slot.js +0 -121
- package/build/components/list-view/block-slot.js.map +0 -1
- package/build/components/list-view/editor.js +0 -35
- package/build/components/list-view/editor.js.map +0 -1
- package/build/components/text-decoration-and-transform/index.js +0 -39
- package/build/components/text-decoration-and-transform/index.js.map +0 -1
- package/build/components/use-simulated-media-query/index.js +0 -137
- package/build/components/use-simulated-media-query/index.js.map +0 -1
- package/build/store/controls.js +0 -44
- package/build/store/controls.js.map +0 -1
- package/build-module/components/block-list/head.js +0 -19
- package/build-module/components/block-list/head.js.map +0 -1
- package/build-module/components/duotone-control/duotone-picker-popover.js +0 -35
- package/build-module/components/duotone-control/duotone-picker-popover.js.map +0 -1
- package/build-module/components/inspector-advanced-controls/index.js +0 -36
- package/build-module/components/inspector-advanced-controls/index.js.map +0 -1
- package/build-module/components/inspector-controls/index.native.js.map +0 -1
- package/build-module/components/list-view/block-slot.js +0 -96
- package/build-module/components/list-view/block-slot.js.map +0 -1
- package/build-module/components/list-view/editor.js +0 -25
- package/build-module/components/list-view/editor.js.map +0 -1
- package/build-module/components/text-decoration-and-transform/index.js +0 -30
- package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
- package/build-module/components/use-simulated-media-query/index.js +0 -126
- package/build-module/components/use-simulated-media-query/index.js.map +0 -1
- package/build-module/store/controls.js +0 -32
- package/build-module/store/controls.js.map +0 -1
- package/src/components/block-list/head.js +0 -18
- package/src/components/duotone-control/duotone-picker-popover.js +0 -36
- package/src/components/inspector-advanced-controls/README.md +0 -72
- package/src/components/inspector-advanced-controls/index.js +0 -32
- package/src/components/list-view/block-slot.js +0 -120
- package/src/components/list-view/editor.js +0 -29
- package/src/components/text-decoration-and-transform/index.js +0 -36
- package/src/components/text-decoration-and-transform/style.scss +0 -3
- package/src/components/use-simulated-media-query/index.js +0 -144
- package/src/store/controls.js +0 -39
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { fromPairs } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
|
-
import { useMemo,
|
|
4
|
+
import { useMemo, useState, useCallback } from '@wordpress/element';
|
|
10
5
|
import { _x } from '@wordpress/i18n';
|
|
11
6
|
import { useAsyncList } from '@wordpress/compose';
|
|
12
7
|
|
|
@@ -16,59 +11,30 @@ import { useAsyncList } from '@wordpress/compose';
|
|
|
16
11
|
import PatternInserterPanel from './pattern-panel';
|
|
17
12
|
import usePatternsState from './hooks/use-patterns-state';
|
|
18
13
|
import BlockPatternList from '../block-patterns-list';
|
|
14
|
+
import PatternsExplorerModal from './block-patterns-explorer/explorer';
|
|
19
15
|
|
|
20
16
|
function BlockPatternsCategory( {
|
|
21
17
|
rootClientId,
|
|
22
18
|
onInsert,
|
|
23
19
|
selectedCategory,
|
|
24
|
-
|
|
20
|
+
populatedCategories,
|
|
25
21
|
} ) {
|
|
26
|
-
const [ allPatterns,
|
|
22
|
+
const [ allPatterns, , onClick ] = usePatternsState(
|
|
27
23
|
onInsert,
|
|
28
24
|
rootClientId
|
|
29
25
|
);
|
|
30
26
|
|
|
31
|
-
// Remove any empty categories
|
|
32
|
-
const populatedCategories = useMemo(
|
|
33
|
-
() =>
|
|
34
|
-
allCategories.filter( ( category ) =>
|
|
35
|
-
allPatterns.some( ( pattern ) =>
|
|
36
|
-
pattern.categories?.includes( category.name )
|
|
37
|
-
)
|
|
38
|
-
),
|
|
39
|
-
[ allPatterns, allCategories ]
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const patternCategory = selectedCategory
|
|
43
|
-
? selectedCategory
|
|
44
|
-
: populatedCategories[ 0 ];
|
|
45
|
-
|
|
46
|
-
useEffect( () => {
|
|
47
|
-
if (
|
|
48
|
-
allPatterns.some(
|
|
49
|
-
( pattern ) => getPatternIndex( pattern ) === Infinity
|
|
50
|
-
) &&
|
|
51
|
-
! populatedCategories.find(
|
|
52
|
-
( category ) => category.name === 'uncategorized'
|
|
53
|
-
)
|
|
54
|
-
) {
|
|
55
|
-
populatedCategories.push( {
|
|
56
|
-
name: 'uncategorized',
|
|
57
|
-
label: _x( 'Uncategorized' ),
|
|
58
|
-
} );
|
|
59
|
-
}
|
|
60
|
-
}, [ populatedCategories, allPatterns ] );
|
|
61
|
-
|
|
62
27
|
const getPatternIndex = useCallback(
|
|
63
28
|
( pattern ) => {
|
|
64
|
-
if ( ! pattern.categories
|
|
29
|
+
if ( ! pattern.categories?.length ) {
|
|
65
30
|
return Infinity;
|
|
66
31
|
}
|
|
67
|
-
const indexedCategories =
|
|
68
|
-
|
|
69
|
-
name
|
|
70
|
-
|
|
71
|
-
|
|
32
|
+
const indexedCategories = populatedCategories.reduce(
|
|
33
|
+
( accumulator, { name }, index ) => {
|
|
34
|
+
accumulator[ name ] = index;
|
|
35
|
+
return accumulator;
|
|
36
|
+
},
|
|
37
|
+
{}
|
|
72
38
|
);
|
|
73
39
|
return Math.min(
|
|
74
40
|
...pattern.categories.map( ( cat ) =>
|
|
@@ -84,12 +50,11 @@ function BlockPatternsCategory( {
|
|
|
84
50
|
const currentCategoryPatterns = useMemo(
|
|
85
51
|
() =>
|
|
86
52
|
allPatterns.filter( ( pattern ) =>
|
|
87
|
-
|
|
53
|
+
selectedCategory.name === 'uncategorized'
|
|
88
54
|
? getPatternIndex( pattern ) === Infinity
|
|
89
|
-
: pattern.categories
|
|
90
|
-
pattern.categories.includes( patternCategory.name )
|
|
55
|
+
: pattern.categories?.includes( selectedCategory.name )
|
|
91
56
|
),
|
|
92
|
-
[ allPatterns,
|
|
57
|
+
[ allPatterns, selectedCategory ]
|
|
93
58
|
);
|
|
94
59
|
|
|
95
60
|
// Ordering the patterns is important for the async rendering.
|
|
@@ -101,25 +66,21 @@ function BlockPatternsCategory( {
|
|
|
101
66
|
|
|
102
67
|
const currentShownPatterns = useAsyncList( orderedPatterns );
|
|
103
68
|
|
|
69
|
+
if ( ! currentCategoryPatterns.length ) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
104
73
|
return (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
onClickPattern={ onClick }
|
|
116
|
-
label={ patternCategory.label }
|
|
117
|
-
orientation="vertical"
|
|
118
|
-
isDraggable
|
|
119
|
-
/>
|
|
120
|
-
</PatternInserterPanel>
|
|
121
|
-
) }
|
|
122
|
-
</>
|
|
74
|
+
<div className="block-editor-inserter__panel-content">
|
|
75
|
+
<BlockPatternList
|
|
76
|
+
shownPatterns={ currentShownPatterns }
|
|
77
|
+
blockPatterns={ currentCategoryPatterns }
|
|
78
|
+
onClickPattern={ onClick }
|
|
79
|
+
label={ selectedCategory.label }
|
|
80
|
+
orientation="vertical"
|
|
81
|
+
isDraggable
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
123
84
|
);
|
|
124
85
|
}
|
|
125
86
|
|
|
@@ -129,13 +90,86 @@ function BlockPatternsTabs( {
|
|
|
129
90
|
onClickCategory,
|
|
130
91
|
selectedCategory,
|
|
131
92
|
} ) {
|
|
93
|
+
const [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );
|
|
94
|
+
const [ allPatterns, allCategories ] = usePatternsState();
|
|
95
|
+
|
|
96
|
+
const hasRegisteredCategory = useCallback(
|
|
97
|
+
( pattern ) => {
|
|
98
|
+
if ( ! pattern.categories || ! pattern.categories.length ) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return pattern.categories.some( ( cat ) =>
|
|
103
|
+
allCategories.some( ( category ) => category.name === cat )
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
[ allCategories ]
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// Remove any empty categories
|
|
110
|
+
const populatedCategories = useMemo( () => {
|
|
111
|
+
const categories = allCategories
|
|
112
|
+
.filter( ( category ) =>
|
|
113
|
+
allPatterns.some( ( pattern ) =>
|
|
114
|
+
pattern.categories?.includes( category.name )
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
.sort( ( { name: currentName }, { name: nextName } ) => {
|
|
118
|
+
if ( ! [ currentName, nextName ].includes( 'featured' ) ) {
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
return currentName === 'featured' ? -1 : 1;
|
|
122
|
+
} );
|
|
123
|
+
|
|
124
|
+
if (
|
|
125
|
+
allPatterns.some(
|
|
126
|
+
( pattern ) => ! hasRegisteredCategory( pattern )
|
|
127
|
+
) &&
|
|
128
|
+
! categories.find(
|
|
129
|
+
( category ) => category.name === 'uncategorized'
|
|
130
|
+
)
|
|
131
|
+
) {
|
|
132
|
+
categories.push( {
|
|
133
|
+
name: 'uncategorized',
|
|
134
|
+
label: _x( 'Uncategorized' ),
|
|
135
|
+
} );
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return categories;
|
|
139
|
+
}, [ allPatterns, allCategories ] );
|
|
140
|
+
|
|
141
|
+
const patternCategory = selectedCategory
|
|
142
|
+
? selectedCategory
|
|
143
|
+
: populatedCategories[ 0 ];
|
|
144
|
+
|
|
132
145
|
return (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
<>
|
|
147
|
+
{ ! showPatternsExplorer && (
|
|
148
|
+
<>
|
|
149
|
+
<PatternInserterPanel
|
|
150
|
+
selectedCategory={ patternCategory }
|
|
151
|
+
patternCategories={ populatedCategories }
|
|
152
|
+
onClickCategory={ onClickCategory }
|
|
153
|
+
openPatternExplorer={ () =>
|
|
154
|
+
setShowPatternsExplorer( true )
|
|
155
|
+
}
|
|
156
|
+
/>
|
|
157
|
+
<BlockPatternsCategory
|
|
158
|
+
rootClientId={ rootClientId }
|
|
159
|
+
onInsert={ onInsert }
|
|
160
|
+
selectedCategory={ patternCategory }
|
|
161
|
+
populatedCategories={ populatedCategories }
|
|
162
|
+
/>
|
|
163
|
+
</>
|
|
164
|
+
) }
|
|
165
|
+
{ showPatternsExplorer && (
|
|
166
|
+
<PatternsExplorerModal
|
|
167
|
+
initialCategory={ patternCategory }
|
|
168
|
+
patternCategories={ populatedCategories }
|
|
169
|
+
onModalClose={ () => setShowPatternsExplorer( false ) }
|
|
170
|
+
/>
|
|
171
|
+
) }
|
|
172
|
+
</>
|
|
139
173
|
);
|
|
140
174
|
}
|
|
141
175
|
|
|
@@ -10,8 +10,7 @@ import BlockTypesList from '../block-types-list';
|
|
|
10
10
|
import useClipboardBlock from './hooks/use-clipboard-block';
|
|
11
11
|
import { store as blockEditorStore } from '../../store';
|
|
12
12
|
import useBlockTypeImpressions from './hooks/use-block-type-impressions';
|
|
13
|
-
|
|
14
|
-
const NON_BLOCK_CATEGORIES = [ 'reusable' ];
|
|
13
|
+
import { filterInserterItems } from './utils';
|
|
15
14
|
|
|
16
15
|
function BlockTypesTab( { onSelect, rootClientId, listProps } ) {
|
|
17
16
|
const clipboardBlock = useClipboardBlock( rootClientId );
|
|
@@ -19,10 +18,8 @@ function BlockTypesTab( { onSelect, rootClientId, listProps } ) {
|
|
|
19
18
|
const { blockTypes } = useSelect(
|
|
20
19
|
( select ) => {
|
|
21
20
|
const { getInserterItems } = select( blockEditorStore );
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const blockItems = allItems.filter(
|
|
25
|
-
( { category } ) => ! NON_BLOCK_CATEGORIES.includes( category )
|
|
21
|
+
const blockItems = filterInserterItems(
|
|
22
|
+
getInserterItems( rootClientId )
|
|
26
23
|
);
|
|
27
24
|
|
|
28
25
|
return {
|
|
@@ -10,29 +10,22 @@ import { setBlockTypeImpressions } from '@wordpress/react-native-bridge';
|
|
|
10
10
|
import { store as blockEditorStore } from '../../../store';
|
|
11
11
|
|
|
12
12
|
function useBlockTypeImpressions( blockTypes ) {
|
|
13
|
-
const { blockTypeImpressions
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
[]
|
|
26
|
-
);
|
|
13
|
+
const { blockTypeImpressions } = useSelect( ( select ) => {
|
|
14
|
+
const { getSettings: getBlockEditorSettings } = select(
|
|
15
|
+
blockEditorStore
|
|
16
|
+
);
|
|
17
|
+
const { impressions } = getBlockEditorSettings();
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
blockTypeImpressions: impressions,
|
|
21
|
+
};
|
|
22
|
+
}, [] );
|
|
27
23
|
const { updateSettings } = useDispatch( blockEditorStore );
|
|
28
24
|
|
|
29
|
-
const items =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} ) )
|
|
34
|
-
: blockTypes;
|
|
35
|
-
|
|
25
|
+
const items = blockTypes.map( ( blockType ) => ( {
|
|
26
|
+
...blockType,
|
|
27
|
+
isNew: blockTypeImpressions[ blockType.name ] > 0,
|
|
28
|
+
} ) );
|
|
36
29
|
const trackBlockTypeSelected = ( { name } ) => {
|
|
37
30
|
if ( blockTypeImpressions[ name ] > 0 ) {
|
|
38
31
|
const updatedBlockTypeImpressions = {
|
|
@@ -21,12 +21,13 @@ export default function useClipboardBlock( destinationRootClientId ) {
|
|
|
21
21
|
clipboardBlock?.name,
|
|
22
22
|
destinationRootClientId
|
|
23
23
|
);
|
|
24
|
+
const blockType = getBlockType( clipboardBlock?.name );
|
|
24
25
|
|
|
25
|
-
if ( ! canAddClipboardBlock ) {
|
|
26
|
+
if ( ! canAddClipboardBlock || ! blockType ) {
|
|
26
27
|
return undefined;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const {
|
|
30
|
+
const { name, icon } = blockType;
|
|
30
31
|
const { attributes: initialAttributes, innerBlocks } = clipboardBlock;
|
|
31
32
|
|
|
32
33
|
return {
|
|
@@ -102,6 +102,7 @@ class Inserter extends Component {
|
|
|
102
102
|
disabled,
|
|
103
103
|
blockTitle,
|
|
104
104
|
hasSingleBlockType,
|
|
105
|
+
directInsertBlock,
|
|
105
106
|
toggleProps,
|
|
106
107
|
hasItems,
|
|
107
108
|
renderToggle = defaultRenderToggle,
|
|
@@ -113,6 +114,7 @@ class Inserter extends Component {
|
|
|
113
114
|
disabled: disabled || ! hasItems,
|
|
114
115
|
blockTitle,
|
|
115
116
|
hasSingleBlockType,
|
|
117
|
+
directInsertBlock,
|
|
116
118
|
toggleProps,
|
|
117
119
|
} );
|
|
118
120
|
}
|
|
@@ -168,12 +170,13 @@ class Inserter extends Component {
|
|
|
168
170
|
const {
|
|
169
171
|
position,
|
|
170
172
|
hasSingleBlockType,
|
|
173
|
+
directInsertBlock,
|
|
171
174
|
insertOnlyAllowedBlock,
|
|
172
175
|
__experimentalIsQuick: isQuick,
|
|
173
176
|
onSelectOrClose,
|
|
174
177
|
} = this.props;
|
|
175
178
|
|
|
176
|
-
if ( hasSingleBlockType ) {
|
|
179
|
+
if ( hasSingleBlockType || directInsertBlock?.length ) {
|
|
177
180
|
return this.renderToggle( { onToggle: insertOnlyAllowedBlock } );
|
|
178
181
|
}
|
|
179
182
|
|
|
@@ -202,6 +205,7 @@ export default compose( [
|
|
|
202
205
|
getBlockRootClientId,
|
|
203
206
|
hasInserterItems,
|
|
204
207
|
__experimentalGetAllowedBlocks,
|
|
208
|
+
__experimentalGetDirectInsertBlock,
|
|
205
209
|
} = select( blockEditorStore );
|
|
206
210
|
const { getBlockVariations } = select( blocksStore );
|
|
207
211
|
|
|
@@ -210,6 +214,10 @@ export default compose( [
|
|
|
210
214
|
|
|
211
215
|
const allowedBlocks = __experimentalGetAllowedBlocks( rootClientId );
|
|
212
216
|
|
|
217
|
+
const directInsertBlock = __experimentalGetDirectInsertBlock(
|
|
218
|
+
rootClientId
|
|
219
|
+
);
|
|
220
|
+
|
|
213
221
|
const hasSingleBlockType =
|
|
214
222
|
size( allowedBlocks ) === 1 &&
|
|
215
223
|
size(
|
|
@@ -226,6 +234,7 @@ export default compose( [
|
|
|
226
234
|
hasSingleBlockType,
|
|
227
235
|
blockTitle: allowedBlockType ? allowedBlockType.title : '',
|
|
228
236
|
allowedBlockType,
|
|
237
|
+
directInsertBlock,
|
|
229
238
|
rootClientId,
|
|
230
239
|
};
|
|
231
240
|
} ),
|
|
@@ -238,10 +247,11 @@ export default compose( [
|
|
|
238
247
|
isAppender,
|
|
239
248
|
hasSingleBlockType,
|
|
240
249
|
allowedBlockType,
|
|
250
|
+
directInsertBlock,
|
|
241
251
|
onSelectOrClose,
|
|
242
252
|
} = ownProps;
|
|
243
253
|
|
|
244
|
-
if ( ! hasSingleBlockType ) {
|
|
254
|
+
if ( ! hasSingleBlockType && ! directInsertBlock?.length ) {
|
|
245
255
|
return;
|
|
246
256
|
}
|
|
247
257
|
|
|
@@ -274,7 +284,9 @@ export default compose( [
|
|
|
274
284
|
|
|
275
285
|
const { insertBlock } = dispatch( blockEditorStore );
|
|
276
286
|
|
|
277
|
-
const blockToInsert =
|
|
287
|
+
const blockToInsert = directInsertBlock?.length
|
|
288
|
+
? createBlock( ...directInsertBlock )
|
|
289
|
+
: createBlock( allowedBlockType.name );
|
|
278
290
|
|
|
279
291
|
insertBlock( blockToInsert, getInsertionIndex(), rootClientId );
|
|
280
292
|
|
|
@@ -32,19 +32,9 @@ import { store as blockEditorStore } from '../../store';
|
|
|
32
32
|
|
|
33
33
|
const VOICE_OVER_ANNOUNCEMENT_DELAY = 1000;
|
|
34
34
|
|
|
35
|
-
const defaultRenderToggle = ( {
|
|
36
|
-
displayEditorOnboardingTooltip,
|
|
37
|
-
onToggle,
|
|
38
|
-
disabled,
|
|
39
|
-
style,
|
|
40
|
-
onLongPress,
|
|
41
|
-
} ) => (
|
|
35
|
+
const defaultRenderToggle = ( { onToggle, disabled, style, onLongPress } ) => (
|
|
42
36
|
<ToolbarButton
|
|
43
|
-
title={
|
|
44
|
-
displayEditorOnboardingTooltip
|
|
45
|
-
? __( 'Tap to add content' )
|
|
46
|
-
: __( 'Add block' )
|
|
47
|
-
}
|
|
37
|
+
title={ __( 'Add block' ) }
|
|
48
38
|
icon={
|
|
49
39
|
<Icon
|
|
50
40
|
icon={ plusCircleFilled }
|
|
@@ -52,8 +42,6 @@ const defaultRenderToggle = ( {
|
|
|
52
42
|
color={ style.color }
|
|
53
43
|
/>
|
|
54
44
|
}
|
|
55
|
-
showTooltip={ displayEditorOnboardingTooltip }
|
|
56
|
-
tooltipPosition="top right"
|
|
57
45
|
onClick={ onToggle }
|
|
58
46
|
extraProps={ {
|
|
59
47
|
hint: __( 'Double tap to add a block' ),
|
|
@@ -227,7 +215,6 @@ export class Inserter extends Component {
|
|
|
227
215
|
*/
|
|
228
216
|
renderInserterToggle( { onToggle, isOpen } ) {
|
|
229
217
|
const {
|
|
230
|
-
displayEditorOnboardingTooltip,
|
|
231
218
|
disabled,
|
|
232
219
|
renderToggle = defaultRenderToggle,
|
|
233
220
|
getStylesFromColorScheme,
|
|
@@ -274,7 +261,6 @@ export class Inserter extends Component {
|
|
|
274
261
|
return (
|
|
275
262
|
<>
|
|
276
263
|
{ renderToggle( {
|
|
277
|
-
displayEditorOnboardingTooltip,
|
|
278
264
|
onToggle: onPress,
|
|
279
265
|
isOpen,
|
|
280
266
|
disabled,
|
|
@@ -410,9 +396,6 @@ export default compose( [
|
|
|
410
396
|
|
|
411
397
|
return {
|
|
412
398
|
blockTypeImpressions: getBlockEditorSettings().impressions,
|
|
413
|
-
displayEditorOnboardingTooltip:
|
|
414
|
-
getBlockEditorSettings().editorOnboarding &&
|
|
415
|
-
getBlockEditorSettings().firstGutenbergEditorSession,
|
|
416
399
|
destinationRootClientId,
|
|
417
400
|
insertionIndexDefault: getDefaultInsertionIndex(),
|
|
418
401
|
insertionIndexBefore,
|
|
@@ -21,6 +21,7 @@ function InserterLibrary( {
|
|
|
21
21
|
showInserterHelpPanel,
|
|
22
22
|
showMostUsedBlocks = false,
|
|
23
23
|
__experimentalInsertionIndex,
|
|
24
|
+
__experimentalFilterValue,
|
|
24
25
|
onSelect = noop,
|
|
25
26
|
shouldFocusBlock = false,
|
|
26
27
|
} ) {
|
|
@@ -44,6 +45,7 @@ function InserterLibrary( {
|
|
|
44
45
|
showInserterHelpPanel={ showInserterHelpPanel }
|
|
45
46
|
showMostUsedBlocks={ showMostUsedBlocks }
|
|
46
47
|
__experimentalInsertionIndex={ __experimentalInsertionIndex }
|
|
48
|
+
__experimentalFilterValue={ __experimentalFilterValue }
|
|
47
49
|
shouldFocusBlock={ shouldFocusBlock }
|
|
48
50
|
/>
|
|
49
51
|
);
|
|
@@ -27,9 +27,12 @@ function InserterMenu( {
|
|
|
27
27
|
onSelect,
|
|
28
28
|
showInserterHelpPanel,
|
|
29
29
|
showMostUsedBlocks,
|
|
30
|
+
__experimentalFilterValue = '',
|
|
30
31
|
shouldFocusBlock = true,
|
|
31
32
|
} ) {
|
|
32
|
-
const [ filterValue, setFilterValue ] = useState(
|
|
33
|
+
const [ filterValue, setFilterValue ] = useState(
|
|
34
|
+
__experimentalFilterValue
|
|
35
|
+
);
|
|
33
36
|
const [ hoveredItem, setHoveredItem ] = useState( null );
|
|
34
37
|
const [ selectedPatternCategory, setSelectedPatternCategory ] = useState(
|
|
35
38
|
null
|
|
@@ -22,10 +22,9 @@ import InserterSearchResults from './search-results';
|
|
|
22
22
|
import { store as blockEditorStore } from '../../store';
|
|
23
23
|
import InserterTabs from './tabs';
|
|
24
24
|
import styles from './style.scss';
|
|
25
|
+
import { filterInserterItems } from './utils';
|
|
25
26
|
|
|
26
27
|
const MIN_ITEMS_FOR_SEARCH = 2;
|
|
27
|
-
const REUSABLE_BLOCKS_CATEGORY = 'reusable';
|
|
28
|
-
|
|
29
28
|
function InserterMenu( {
|
|
30
29
|
onSelect,
|
|
31
30
|
onDismiss,
|
|
@@ -37,10 +36,10 @@ function InserterMenu( {
|
|
|
37
36
|
} ) {
|
|
38
37
|
const [ filterValue, setFilterValue ] = useState( '' );
|
|
39
38
|
const [ showTabs, setShowTabs ] = useState( true );
|
|
40
|
-
// eslint-disable-next-line no-undef
|
|
41
|
-
const [ showSearchForm, setShowSearchForm ] = useState( __DEV__ );
|
|
42
39
|
const [ tabIndex, setTabIndex ] = useState( 0 );
|
|
43
40
|
|
|
41
|
+
const isIOS = Platform.OS === 'ios';
|
|
42
|
+
|
|
44
43
|
const {
|
|
45
44
|
showInsertionPoint,
|
|
46
45
|
hideInsertionPoint,
|
|
@@ -69,9 +68,9 @@ function InserterMenu( {
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
const allItems = getInserterItems( targetRootClientId );
|
|
72
|
-
const reusableBlockItems = allItems
|
|
73
|
-
|
|
74
|
-
);
|
|
71
|
+
const reusableBlockItems = filterInserterItems( allItems, {
|
|
72
|
+
onlyReusable: true,
|
|
73
|
+
} );
|
|
75
74
|
|
|
76
75
|
return {
|
|
77
76
|
items: allItems,
|
|
@@ -103,11 +102,6 @@ function InserterMenu( {
|
|
|
103
102
|
}
|
|
104
103
|
showInsertionPoint( destinationRootClientId, insertionIndex );
|
|
105
104
|
|
|
106
|
-
// Show search form if there are enough items to filter.
|
|
107
|
-
if ( items.length < MIN_ITEMS_FOR_SEARCH ) {
|
|
108
|
-
setShowSearchForm( false );
|
|
109
|
-
}
|
|
110
|
-
|
|
111
105
|
return hideInsertionPoint;
|
|
112
106
|
}, [] );
|
|
113
107
|
|
|
@@ -176,6 +170,9 @@ function InserterMenu( {
|
|
|
176
170
|
setShowTabs,
|
|
177
171
|
] );
|
|
178
172
|
|
|
173
|
+
const showSearchForm = items.length > MIN_ITEMS_FOR_SEARCH;
|
|
174
|
+
const isFullScreen = ! isIOS && showSearchForm;
|
|
175
|
+
|
|
179
176
|
return (
|
|
180
177
|
<BottomSheet
|
|
181
178
|
isVisible={ true }
|
|
@@ -199,18 +196,24 @@ function InserterMenu( {
|
|
|
199
196
|
</>
|
|
200
197
|
}
|
|
201
198
|
hasNavigation
|
|
202
|
-
setMinHeightToMaxHeight={
|
|
203
|
-
contentStyle={ styles
|
|
199
|
+
setMinHeightToMaxHeight={ true }
|
|
200
|
+
contentStyle={ styles[ 'inserter-menu__list' ] }
|
|
201
|
+
isFullScreen={ isFullScreen }
|
|
202
|
+
allowDragIndicator={ true }
|
|
204
203
|
>
|
|
205
204
|
<BottomSheetConsumer>
|
|
206
205
|
{ ( { listProps } ) => (
|
|
207
|
-
<TouchableHighlight
|
|
206
|
+
<TouchableHighlight
|
|
207
|
+
accessible={ false }
|
|
208
|
+
style={ styles[ 'inserter-menu__list-wrapper' ] }
|
|
209
|
+
>
|
|
208
210
|
{ ! showTabs || filterValue ? (
|
|
209
211
|
<InserterSearchResults
|
|
210
212
|
rootClientId={ rootClientId }
|
|
211
213
|
filterValue={ filterValue }
|
|
212
214
|
onSelect={ onSelectItem }
|
|
213
215
|
listProps={ listProps }
|
|
216
|
+
isFullScreen={ isFullScreen }
|
|
214
217
|
/>
|
|
215
218
|
) : (
|
|
216
219
|
<InserterTabs
|
|
@@ -6,15 +6,17 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { SelectControl } from '@wordpress/components';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
+
import { Flex, FlexItem, SelectControl, Button } from '@wordpress/components';
|
|
10
|
+
import { __, _x } from '@wordpress/i18n';
|
|
11
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
11
12
|
|
|
12
13
|
function PatternInserterPanel( {
|
|
13
14
|
selectedCategory,
|
|
14
15
|
patternCategories,
|
|
15
16
|
onClickCategory,
|
|
16
|
-
|
|
17
|
+
openPatternExplorer,
|
|
17
18
|
} ) {
|
|
19
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
18
20
|
const categoryOptions = () => {
|
|
19
21
|
const options = [];
|
|
20
22
|
|
|
@@ -36,12 +38,10 @@ function PatternInserterPanel( {
|
|
|
36
38
|
);
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
};
|
|
41
|
+
const className = classnames(
|
|
42
|
+
'block-editor-inserter__panel-header',
|
|
43
|
+
'block-editor-inserter__panel-header-patterns'
|
|
44
|
+
);
|
|
45
45
|
|
|
46
46
|
// In iOS-based mobile devices, the onBlur will fire when selecting an option
|
|
47
47
|
// from a Select element. To prevent closing the useDialog on iOS devices, we
|
|
@@ -54,8 +54,13 @@ function PatternInserterPanel( {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
<Flex
|
|
58
|
+
justify="space-between"
|
|
59
|
+
align="start"
|
|
60
|
+
gap="4"
|
|
61
|
+
className={ className }
|
|
62
|
+
>
|
|
63
|
+
<FlexItem isBlock>
|
|
59
64
|
<SelectControl
|
|
60
65
|
className="block-editor-inserter__panel-dropdown"
|
|
61
66
|
label={ __( 'Filter patterns' ) }
|
|
@@ -65,11 +70,23 @@ function PatternInserterPanel( {
|
|
|
65
70
|
onBlur={ onBlur }
|
|
66
71
|
options={ categoryOptions() }
|
|
67
72
|
/>
|
|
68
|
-
</
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
</FlexItem>
|
|
74
|
+
{ ! isMobile && (
|
|
75
|
+
<FlexItem>
|
|
76
|
+
<Button
|
|
77
|
+
variant="secondary"
|
|
78
|
+
className="block-editor-inserter__patterns-explorer-expand"
|
|
79
|
+
label={ __( 'Explore all patterns' ) }
|
|
80
|
+
onClick={ () => openPatternExplorer() }
|
|
81
|
+
>
|
|
82
|
+
{ _x(
|
|
83
|
+
'Explore',
|
|
84
|
+
'Label for showing all block patterns'
|
|
85
|
+
) }
|
|
86
|
+
</Button>
|
|
87
|
+
</FlexItem>
|
|
88
|
+
) }
|
|
89
|
+
</Flex>
|
|
73
90
|
);
|
|
74
91
|
}
|
|
75
92
|
|
|
@@ -22,7 +22,7 @@ function InserterPreviewPanel( { item } ) {
|
|
|
22
22
|
return (
|
|
23
23
|
<div className="block-editor-inserter__preview-container">
|
|
24
24
|
<div className="block-editor-inserter__preview">
|
|
25
|
-
{ isReusable || hoveredItemBlockType
|
|
25
|
+
{ isReusable || hoveredItemBlockType?.example ? (
|
|
26
26
|
<div className="block-editor-inserter__preview-content">
|
|
27
27
|
<BlockPreview
|
|
28
28
|
__experimentalPadding={ 16 }
|
|
@@ -75,7 +75,7 @@ export default function QuickInserter( {
|
|
|
75
75
|
// When clicking Browse All select the appropriate block so as
|
|
76
76
|
// the insertion point can work as expected
|
|
77
77
|
const onBrowseAll = () => {
|
|
78
|
-
setInserterIsOpened( { rootClientId, insertionIndex } );
|
|
78
|
+
setInserterIsOpened( { rootClientId, insertionIndex, filterValue } );
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
return (
|