@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { isEmpty } from 'lodash';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
__experimentalStyleProvider as StyleProvider,
|
|
11
|
+
__experimentalToolsPanelContext as ToolsPanelContext,
|
|
12
|
+
} from '@wordpress/components';
|
|
13
|
+
import warning from '@wordpress/warning';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import useDisplayBlockControls from '../use-display-block-controls';
|
|
19
|
+
import groups from './groups';
|
|
20
|
+
|
|
21
|
+
export default function InspectorControlsFill( {
|
|
22
|
+
__experimentalGroup: group = 'default',
|
|
23
|
+
children,
|
|
24
|
+
} ) {
|
|
25
|
+
const isDisplayed = useDisplayBlockControls();
|
|
26
|
+
const Fill = groups[ group ]?.Fill;
|
|
27
|
+
if ( ! Fill ) {
|
|
28
|
+
warning( `Unknown InspectorControl group "${ group }" provided.` );
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if ( ! isDisplayed ) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<StyleProvider document={ document }>
|
|
37
|
+
<Fill>
|
|
38
|
+
{ ( fillProps ) => {
|
|
39
|
+
// Children passed to InspectorControlsFill will not have
|
|
40
|
+
// access to any React Context whose Provider is part of
|
|
41
|
+
// the InspectorControlsSlot tree. So we re-create the
|
|
42
|
+
// Provider in this subtree.
|
|
43
|
+
const value = ! isEmpty( fillProps ) ? fillProps : null;
|
|
44
|
+
return (
|
|
45
|
+
<ToolsPanelContext.Provider value={ value }>
|
|
46
|
+
{ children }
|
|
47
|
+
</ToolsPanelContext.Provider>
|
|
48
|
+
);
|
|
49
|
+
} }
|
|
50
|
+
</Fill>
|
|
51
|
+
</StyleProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -7,18 +7,27 @@ import { View } from 'react-native';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Children } from '@wordpress/element';
|
|
10
|
-
import {
|
|
10
|
+
import { BottomSheetConsumer } from '@wordpress/components';
|
|
11
|
+
import warning from '@wordpress/warning';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
16
|
+
import groups from './groups';
|
|
15
17
|
import { useBlockEditContext } from '../block-edit/context';
|
|
16
18
|
import { BlockSettingsButton } from '../block-settings';
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export default function InspectorControlsFill( {
|
|
21
|
+
children,
|
|
22
|
+
__experimentalGroup: group = 'default',
|
|
23
|
+
...props
|
|
24
|
+
} ) {
|
|
21
25
|
const { isSelected } = useBlockEditContext();
|
|
26
|
+
const Fill = groups[ group ]?.Fill;
|
|
27
|
+
if ( ! Fill ) {
|
|
28
|
+
warning( `Unknown InspectorControl group "${ group }" provided.` );
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
22
31
|
if ( ! isSelected ) {
|
|
23
32
|
return null;
|
|
24
33
|
}
|
|
@@ -35,13 +44,4 @@ const FillWithSettingsButton = ( { children, ...props } ) => {
|
|
|
35
44
|
{ Children.count( children ) > 0 && <BlockSettingsButton /> }
|
|
36
45
|
</>
|
|
37
46
|
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const InspectorControls = FillWithSettingsButton;
|
|
41
|
-
|
|
42
|
-
InspectorControls.Slot = Slot;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md
|
|
46
|
-
*/
|
|
47
|
-
export default InspectorControls;
|
|
47
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createSlotFill } from '@wordpress/components';
|
|
5
|
+
|
|
6
|
+
const InspectorControlsDefault = createSlotFill( 'InspectorControls' );
|
|
7
|
+
const InspectorControlsAdvanced = createSlotFill( 'InspectorAdvancedControls' );
|
|
8
|
+
const InspectorControlsDimensions = createSlotFill(
|
|
9
|
+
'InspectorControlsDimensions'
|
|
10
|
+
);
|
|
11
|
+
const InspectorControlsTypography = createSlotFill(
|
|
12
|
+
'InspectorControlsTypography'
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const groups = {
|
|
16
|
+
default: InspectorControlsDefault,
|
|
17
|
+
advanced: InspectorControlsAdvanced,
|
|
18
|
+
dimensions: InspectorControlsDimensions,
|
|
19
|
+
typography: InspectorControlsTypography,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default groups;
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalStyleProvider as StyleProvider,
|
|
6
|
-
createSlotFill,
|
|
7
|
-
} from '@wordpress/components';
|
|
8
|
-
|
|
9
1
|
/**
|
|
10
2
|
* Internal dependencies
|
|
11
3
|
*/
|
|
12
|
-
import
|
|
4
|
+
import InspectorControlsFill from './fill';
|
|
5
|
+
import InspectorControlsSlot from './slot';
|
|
13
6
|
|
|
14
|
-
const
|
|
7
|
+
const InspectorControls = InspectorControlsFill;
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
return useDisplayBlockControls() ? (
|
|
18
|
-
<StyleProvider document={ document }>
|
|
19
|
-
<Fill>{ children }</Fill>
|
|
20
|
-
</StyleProvider>
|
|
21
|
-
) : null;
|
|
22
|
-
}
|
|
9
|
+
InspectorControls.Slot = InspectorControlsSlot;
|
|
23
10
|
|
|
24
|
-
|
|
11
|
+
// This is just here for backward compatibility.
|
|
12
|
+
export const InspectorAdvancedControls = ( props ) => {
|
|
13
|
+
return (
|
|
14
|
+
<InspectorControlsFill { ...props } __experimentalGroup="advanced" />
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
InspectorAdvancedControls.Slot = ( props ) => {
|
|
18
|
+
return (
|
|
19
|
+
<InspectorControlsSlot { ...props } __experimentalGroup="advanced" />
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalUseSlot as useSlot } from '@wordpress/components';
|
|
5
|
+
import warning from '@wordpress/warning';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import BlockSupportToolsPanel from './block-support-tools-panel';
|
|
11
|
+
import BlockSupportSlotContainer from './block-support-slot-container';
|
|
12
|
+
import groups from './groups';
|
|
13
|
+
|
|
14
|
+
export default function InspectorControlsSlot( {
|
|
15
|
+
__experimentalGroup: group = 'default',
|
|
16
|
+
bubblesVirtually = true,
|
|
17
|
+
label,
|
|
18
|
+
...props
|
|
19
|
+
} ) {
|
|
20
|
+
const Slot = groups[ group ]?.Slot;
|
|
21
|
+
const slot = useSlot( Slot?.__unstableName );
|
|
22
|
+
if ( ! Slot || ! slot ) {
|
|
23
|
+
warning( `Unknown InspectorControl group "${ group }" provided.` );
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const hasFills = Boolean( slot.fills && slot.fills.length );
|
|
28
|
+
if ( ! hasFills ) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ( label ) {
|
|
33
|
+
return (
|
|
34
|
+
<BlockSupportToolsPanel group={ group } label={ label }>
|
|
35
|
+
<BlockSupportSlotContainer
|
|
36
|
+
{ ...props }
|
|
37
|
+
bubblesVirtually={ bubblesVirtually }
|
|
38
|
+
Slot={ Slot }
|
|
39
|
+
/>
|
|
40
|
+
</BlockSupportToolsPanel>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return <Slot { ...props } bubblesVirtually={ bubblesVirtually } />;
|
|
45
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import warning from '@wordpress/warning';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import groups from './groups';
|
|
10
|
+
|
|
11
|
+
export default function InspectorControlsSlot( {
|
|
12
|
+
__experimentalGroup: group = 'default',
|
|
13
|
+
...props
|
|
14
|
+
} ) {
|
|
15
|
+
const Slot = groups[ group ]?.Slot;
|
|
16
|
+
if ( ! Slot ) {
|
|
17
|
+
warning( `Unknown InspectorControl group "${ group }" provided.` );
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <Slot { ...props } />;
|
|
22
|
+
}
|
|
@@ -15,12 +15,18 @@ import useSetting from '../../components/use-setting';
|
|
|
15
15
|
/**
|
|
16
16
|
* Control for letter-spacing.
|
|
17
17
|
*
|
|
18
|
-
* @param {Object} props
|
|
19
|
-
* @param {string} props.value
|
|
20
|
-
* @param {Function} props.onChange
|
|
21
|
-
* @
|
|
18
|
+
* @param {Object} props Component props.
|
|
19
|
+
* @param {string} props.value Currently selected letter-spacing.
|
|
20
|
+
* @param {Function} props.onChange Handles change in letter-spacing selection.
|
|
21
|
+
* @param {boolean} props.__unstableInputWidth Input width to pass through to inner UnitControl.
|
|
22
|
+
*
|
|
23
|
+
* @return {WPElement} Letter-spacing control.
|
|
22
24
|
*/
|
|
23
|
-
export default function LetterSpacingControl( {
|
|
25
|
+
export default function LetterSpacingControl( {
|
|
26
|
+
value,
|
|
27
|
+
onChange,
|
|
28
|
+
__unstableInputWidth = '60px',
|
|
29
|
+
} ) {
|
|
24
30
|
const units = useCustomUnits( {
|
|
25
31
|
availableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],
|
|
26
32
|
defaultValues: { px: '2', em: '.2', rem: '.2' },
|
|
@@ -29,7 +35,7 @@ export default function LetterSpacingControl( { value, onChange } ) {
|
|
|
29
35
|
<UnitControl
|
|
30
36
|
label={ __( 'Letter-spacing' ) }
|
|
31
37
|
value={ value }
|
|
32
|
-
__unstableInputWidth=
|
|
38
|
+
__unstableInputWidth={ __unstableInputWidth }
|
|
33
39
|
units={ units }
|
|
34
40
|
onChange={ onChange }
|
|
35
41
|
/>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { UnitControl } from '@wordpress/components';
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { BASE_DEFAULT_VALUE, STEP, isLineHeightDefined } from './utils';
|
|
10
|
+
|
|
11
|
+
export default function LineHeightControl( { value: lineHeight, onChange } ) {
|
|
12
|
+
const isDefined = isLineHeightDefined( lineHeight );
|
|
13
|
+
const value = isDefined ? lineHeight : BASE_DEFAULT_VALUE;
|
|
14
|
+
return (
|
|
15
|
+
<UnitControl
|
|
16
|
+
label={ __( 'Line Height' ) }
|
|
17
|
+
min={ 0 }
|
|
18
|
+
max={ 5 }
|
|
19
|
+
step={ STEP }
|
|
20
|
+
value={ value }
|
|
21
|
+
onChange={ onChange }
|
|
22
|
+
units={ false }
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -2,17 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Renders a link control. A link control is a controlled input which maintains a value associated with a link (HTML anchor element) and relevant settings for how that link is expected to behave.
|
|
4
4
|
|
|
5
|
-
It is designed to provide a standardized UI for the creation of a link throughout the Editor.
|
|
6
|
-
|
|
7
|
-
## History
|
|
8
|
-
|
|
9
|
-
Much of the context for this component can be found in [the original Issue](https://github.com/WordPress/gutenberg/issues/17557).
|
|
10
|
-
|
|
11
|
-
Previously iterations of a hyperlink UI existed within the Gutenberg interface but these tended to be highly tailored to their individual use cases and were not standardized, each having their own implementation.
|
|
12
|
-
|
|
13
|
-
These older UIs tended to make use of two existing components: `URLInput` and `URLPopover`. When a requirement was raised to implement a new UI for hyperlink creation, an assessment of these existing components was undertaken and it was determined that they were too opinionated as to be easily refactored to accommodate the new use cases required by the new UI. Attempting to do so would also have meant unavoidable breaking changes to the interface of `URLInput` which would have (most probably) caused breaking changes to ripple across not only the Core codebase, but also that of 3rd party Plugins.
|
|
14
|
-
|
|
15
|
-
As a result, it was agreed that a new component `LinkControl` would be created to realise the new hyperlink creation interface. This new UI would begin life as an experimental component which would consume `URLInput` internally. The API of `URLInput` would be enhanced as required with "experimental" features to facilitate the implementation of the new UI.
|
|
5
|
+
It is designed to provide a standardized UI for the creation of a link throughout the Editor, see History section at bottom for further background.
|
|
16
6
|
|
|
17
7
|
## Relationship to `<URLInput>`
|
|
18
8
|
|
|
@@ -29,7 +19,7 @@ The distinction between the two components is perhaps best summarized by the fol
|
|
|
29
19
|
|
|
30
20
|
When creating links the `LinkControl` component will handle two kinds of input from users:
|
|
31
21
|
|
|
32
|
-
1. Entity searches - the user may input free-text based search queries for entities retrieved from remote data sources (in the context of WordPress these are
|
|
22
|
+
1. Entity searches - the user may input free-text based search queries for entities retrieved from remote data sources (in the context of WordPress these are post-type entities). For example, a user might search for a `Page` they have just created by name (eg: About) and the UI will return a matching result if found.
|
|
33
23
|
2. Direct entry - the user may also enter any arbitrary URL-like text. This includes full URLs (https://), URL fragements (eg: `#myinternallink`), `tel` protocol links (eg: `tel: 0800 1234`) and `mailto` protocol links (eg: `mailto: hello@wordpress.org`).
|
|
34
24
|
|
|
35
25
|
In addition, `<LinkControl>` also allows for on the fly creation of links based on the **current content of the `<input>` element**. When enabled, a default "Create new" search suggestion is appended to all non-URL-like search results.
|
|
@@ -38,7 +28,9 @@ When this suggestion is selected it will call the `createSuggestion` prop afford
|
|
|
38
28
|
|
|
39
29
|
### Data sources
|
|
40
30
|
|
|
41
|
-
By default `LinkControl` utilizes the `__experimentalFetchLinkSuggestions` API from `core/block-editor` in order to retrieve search suggestions for matching
|
|
31
|
+
By default `LinkControl` utilizes the `__experimentalFetchLinkSuggestions` API from `core/block-editor` in order to retrieve search suggestions for matching post-type entities.
|
|
32
|
+
|
|
33
|
+
By default this provides no functionality and so you must implement and provide this in your own Editor instance ([example](https://github.com/WordPress/gutenberg/blob/65c752816f46a9334b84f4801d80dea00ed76fba/packages/editor/src/components/provider/use-block-editor-settings.js#L114-L115)).
|
|
42
34
|
|
|
43
35
|
## Props
|
|
44
36
|
|
|
@@ -63,7 +55,7 @@ The resulting default properties of `value` include:
|
|
|
63
55
|
- Required: No
|
|
64
56
|
- Default:
|
|
65
57
|
|
|
66
|
-
```
|
|
58
|
+
```js
|
|
67
59
|
[
|
|
68
60
|
{
|
|
69
61
|
id: 'opensInNewTab',
|
|
@@ -74,6 +66,14 @@ The resulting default properties of `value` include:
|
|
|
74
66
|
|
|
75
67
|
An array of settings objects associated with a link (for example: a setting to determine whether or not the link opens in a new tab). Each object will be used to render a `ToggleControl` for that setting.
|
|
76
68
|
|
|
69
|
+
To disable settings, pass in an empty array. for example:
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
<LinkControl
|
|
73
|
+
settings={ [] }
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
77
|
### onChange
|
|
78
78
|
|
|
79
79
|
- Type: `Function`
|
|
@@ -105,6 +105,22 @@ Whether to present suggestions when typing the URL.
|
|
|
105
105
|
|
|
106
106
|
Whether to present initial suggestions immediately.
|
|
107
107
|
|
|
108
|
+
### suggestionsQuery
|
|
109
|
+
|
|
110
|
+
- Type: `Object`
|
|
111
|
+
- Required: No
|
|
112
|
+
|
|
113
|
+
Controls the query parameters used to search for suggestions. For example, to limit a query to just `Page` types use:
|
|
114
|
+
|
|
115
|
+
```jsx
|
|
116
|
+
<LinkControl
|
|
117
|
+
suggestionQuery={ {
|
|
118
|
+
type: 'post',
|
|
119
|
+
subtype: 'page',
|
|
120
|
+
} }
|
|
121
|
+
/>
|
|
122
|
+
```
|
|
123
|
+
|
|
108
124
|
### forceIsEditingLink
|
|
109
125
|
|
|
110
126
|
- Type: `boolean`
|
|
@@ -176,6 +192,13 @@ A `suggestion` should have the following shape:
|
|
|
176
192
|
)}
|
|
177
193
|
/>
|
|
178
194
|
```
|
|
195
|
+
### renderControlBottom
|
|
196
|
+
|
|
197
|
+
- Type: `Function`
|
|
198
|
+
- Required: No
|
|
199
|
+
- Default: null
|
|
200
|
+
|
|
201
|
+
A render prop that can be used to pass optional controls to be rendered at the bottom of the component.
|
|
179
202
|
|
|
180
203
|
# LinkControlSearchInput
|
|
181
204
|
|
|
@@ -527,3 +550,13 @@ If true, type of the suggestion is rendered (e.g. post, tag)
|
|
|
527
550
|
The suggestion to render.
|
|
528
551
|
|
|
529
552
|
See the [createSuggestion](#createSuggestion) section of this file to learn more about suggestions.
|
|
553
|
+
|
|
554
|
+
## History
|
|
555
|
+
|
|
556
|
+
Much of the context for this component can be found in [the original Issue](https://github.com/WordPress/gutenberg/issues/17557).
|
|
557
|
+
|
|
558
|
+
Previously iterations of a hyperlink UI existed within the Gutenberg interface but these tended to be highly tailored to their individual use cases and were not standardized, each having their own implementation.
|
|
559
|
+
|
|
560
|
+
These older UIs tended to make use of two existing components: `URLInput` and `URLPopover`. When a requirement was raised to implement a new UI for hyperlink creation, an assessment of these existing components was undertaken and it was determined that they were too opinionated as to be easily refactored to accommodate the new use cases required by the new UI. Attempting to do so would also have meant unavoidable breaking changes to the interface of `URLInput` which would have (most probably) caused breaking changes to ripple across not only the Core codebase, but also that of 3rd party Plugins.
|
|
561
|
+
|
|
562
|
+
As a result, it was agreed that a new component `LinkControl` would be created to realise the new hyperlink creation interface. This new UI would begin life as an experimental component which would consume `URLInput` internally. The API of `URLInput` would be enhanced as required with "experimental" features to facilitate the implementation of the new UI.
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { noop } from 'lodash';
|
|
5
|
+
import classnames from 'classnames';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
9
|
-
import { Button, Spinner, Notice } from '@wordpress/components';
|
|
10
|
+
import { Button, Spinner, Notice, TextControl } from '@wordpress/components';
|
|
10
11
|
import { keyboardReturn } from '@wordpress/icons';
|
|
11
12
|
import { __ } from '@wordpress/i18n';
|
|
12
13
|
import { useRef, useState, useEffect } from '@wordpress/element';
|
|
@@ -93,6 +94,7 @@ import { DEFAULT_LINK_SETTINGS } from './constants';
|
|
|
93
94
|
* @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions.
|
|
94
95
|
* @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL.
|
|
95
96
|
* @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion.
|
|
97
|
+
* @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component.
|
|
96
98
|
*/
|
|
97
99
|
|
|
98
100
|
/**
|
|
@@ -119,6 +121,8 @@ function LinkControl( {
|
|
|
119
121
|
noURLSuggestion = false,
|
|
120
122
|
createSuggestionButtonText,
|
|
121
123
|
hasRichPreviews = false,
|
|
124
|
+
hasTextControl = false,
|
|
125
|
+
renderControlBottom = null,
|
|
122
126
|
} ) {
|
|
123
127
|
if ( withCreateSuggestion === undefined && createSuggestion ) {
|
|
124
128
|
withCreateSuggestion = true;
|
|
@@ -126,8 +130,13 @@ function LinkControl( {
|
|
|
126
130
|
|
|
127
131
|
const isMounting = useRef( true );
|
|
128
132
|
const wrapperNode = useRef();
|
|
133
|
+
const textInputRef = useRef();
|
|
134
|
+
|
|
129
135
|
const [ internalInputValue, setInternalInputValue ] = useState(
|
|
130
|
-
|
|
136
|
+
value?.url || ''
|
|
137
|
+
);
|
|
138
|
+
const [ internalTextValue, setInternalTextValue ] = useState(
|
|
139
|
+
value?.title || ''
|
|
131
140
|
);
|
|
132
141
|
const currentInputValue = propInputValue || internalInputValue;
|
|
133
142
|
const [ isEditingLink, setIsEditingLink ] = useState(
|
|
@@ -137,6 +146,8 @@ function LinkControl( {
|
|
|
137
146
|
);
|
|
138
147
|
const isEndingEditWithFocus = useRef( false );
|
|
139
148
|
|
|
149
|
+
const currentInputIsEmpty = ! currentInputValue?.trim()?.length;
|
|
150
|
+
|
|
140
151
|
useEffect( () => {
|
|
141
152
|
if (
|
|
142
153
|
forceIsEditingLink !== undefined &&
|
|
@@ -147,22 +158,53 @@ function LinkControl( {
|
|
|
147
158
|
}, [ forceIsEditingLink ] );
|
|
148
159
|
|
|
149
160
|
useEffect( () => {
|
|
161
|
+
// We don't auto focus into the Link UI on mount
|
|
162
|
+
// because otherwise using the keyboard to select text
|
|
163
|
+
// *within* the link format is not possible.
|
|
150
164
|
if ( isMounting.current ) {
|
|
151
165
|
isMounting.current = false;
|
|
152
166
|
return;
|
|
153
167
|
}
|
|
168
|
+
// Unless we are mounting, we always want to focus either:
|
|
169
|
+
// - the URL input
|
|
170
|
+
// - the first focusable element in the Link UI.
|
|
171
|
+
// But in editing mode if there is a text input present then
|
|
172
|
+
// the URL input is at index 1. If not then it is at index 0.
|
|
173
|
+
const whichFocusTargetIndex = textInputRef?.current ? 1 : 0;
|
|
154
174
|
|
|
155
|
-
//
|
|
156
|
-
//
|
|
175
|
+
// Scenario - when:
|
|
176
|
+
// - switching between editable and non editable LinkControl
|
|
177
|
+
// - clicking on a link
|
|
178
|
+
// ...then move focus to the *first* element to avoid focus loss
|
|
179
|
+
// and to ensure focus is *within* the Link UI.
|
|
157
180
|
const nextFocusTarget =
|
|
158
|
-
focus.focusable.find( wrapperNode.current )[
|
|
159
|
-
|
|
181
|
+
focus.focusable.find( wrapperNode.current )[
|
|
182
|
+
whichFocusTargetIndex
|
|
183
|
+
] || wrapperNode.current;
|
|
160
184
|
|
|
161
185
|
nextFocusTarget.focus();
|
|
162
186
|
|
|
163
187
|
isEndingEditWithFocus.current = false;
|
|
164
188
|
}, [ isEditingLink ] );
|
|
165
189
|
|
|
190
|
+
useEffect( () => {
|
|
191
|
+
/**
|
|
192
|
+
* If the value's `text` property changes then sync this
|
|
193
|
+
* back up with state.
|
|
194
|
+
*/
|
|
195
|
+
if ( value?.title && value.title !== internalTextValue ) {
|
|
196
|
+
setInternalTextValue( value.title );
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Update the state value internalInputValue if the url value changes
|
|
201
|
+
* for example when clicking on another anchor
|
|
202
|
+
*/
|
|
203
|
+
if ( value?.url ) {
|
|
204
|
+
setInternalInputValue( value.url );
|
|
205
|
+
}
|
|
206
|
+
}, [ value ] );
|
|
207
|
+
|
|
166
208
|
/**
|
|
167
209
|
* Cancels editing state and marks that focus may need to be restored after
|
|
168
210
|
* the next render, if focus was within the wrapper when editing finished.
|
|
@@ -180,22 +222,47 @@ function LinkControl( {
|
|
|
180
222
|
);
|
|
181
223
|
|
|
182
224
|
const handleSelectSuggestion = ( updatedValue ) => {
|
|
183
|
-
onChange(
|
|
225
|
+
onChange( {
|
|
226
|
+
...updatedValue,
|
|
227
|
+
title: internalTextValue || updatedValue?.title,
|
|
228
|
+
} );
|
|
184
229
|
stopEditing();
|
|
185
230
|
};
|
|
186
231
|
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
|
|
232
|
+
const handleSubmit = () => {
|
|
233
|
+
if (
|
|
234
|
+
currentInputValue !== value?.url ||
|
|
235
|
+
internalTextValue !== value?.title
|
|
236
|
+
) {
|
|
237
|
+
onChange( {
|
|
238
|
+
url: currentInputValue,
|
|
239
|
+
title: internalTextValue,
|
|
240
|
+
} );
|
|
190
241
|
}
|
|
191
242
|
stopEditing();
|
|
192
243
|
};
|
|
193
244
|
|
|
245
|
+
const handleSubmitWithEnter = ( event ) => {
|
|
246
|
+
const { keyCode } = event;
|
|
247
|
+
if (
|
|
248
|
+
keyCode === ENTER &&
|
|
249
|
+
! currentInputIsEmpty // disallow submitting empty values.
|
|
250
|
+
) {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
handleSubmit();
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
194
256
|
const shownUnlinkControl =
|
|
195
257
|
onRemove && value && ! isEditingLink && ! isCreatingPage;
|
|
196
258
|
|
|
197
259
|
const showSettingsDrawer = !! settings?.length;
|
|
198
260
|
|
|
261
|
+
// Only show text control once a URL value has been committed
|
|
262
|
+
// and it isn't just empty whitespace.
|
|
263
|
+
// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.
|
|
264
|
+
const showTextControl = value?.url?.trim()?.length > 0 && hasTextControl;
|
|
265
|
+
|
|
199
266
|
return (
|
|
200
267
|
<div
|
|
201
268
|
tabIndex={ -1 }
|
|
@@ -210,10 +277,26 @@ function LinkControl( {
|
|
|
210
277
|
|
|
211
278
|
{ ( isEditingLink || ! value ) && ! isCreatingPage && (
|
|
212
279
|
<>
|
|
213
|
-
<div
|
|
280
|
+
<div
|
|
281
|
+
className={ classnames( {
|
|
282
|
+
'block-editor-link-control__search-input-wrapper': true,
|
|
283
|
+
'has-text-control': showTextControl,
|
|
284
|
+
} ) }
|
|
285
|
+
>
|
|
286
|
+
{ showTextControl && (
|
|
287
|
+
<TextControl
|
|
288
|
+
ref={ textInputRef }
|
|
289
|
+
className="block-editor-link-control__field block-editor-link-control__text-content"
|
|
290
|
+
label="Text"
|
|
291
|
+
value={ internalTextValue }
|
|
292
|
+
onChange={ setInternalTextValue }
|
|
293
|
+
onKeyDown={ handleSubmitWithEnter }
|
|
294
|
+
/>
|
|
295
|
+
) }
|
|
296
|
+
|
|
214
297
|
<LinkControlSearchInput
|
|
215
298
|
currentLink={ value }
|
|
216
|
-
className="block-editor-link-control__search-input"
|
|
299
|
+
className="block-editor-link-control__field block-editor-link-control__search-input"
|
|
217
300
|
placeholder={ searchInputPlaceholder }
|
|
218
301
|
value={ currentInputValue }
|
|
219
302
|
withCreateSuggestion={ withCreateSuggestion }
|
|
@@ -228,20 +311,15 @@ function LinkControl( {
|
|
|
228
311
|
createSuggestionButtonText={
|
|
229
312
|
createSuggestionButtonText
|
|
230
313
|
}
|
|
314
|
+
useLabel={ showTextControl }
|
|
231
315
|
>
|
|
232
316
|
<div className="block-editor-link-control__search-actions">
|
|
233
317
|
<Button
|
|
234
|
-
onClick={
|
|
235
|
-
onKeyDown={ ( event ) => {
|
|
236
|
-
const { keyCode } = event;
|
|
237
|
-
if ( keyCode === ENTER ) {
|
|
238
|
-
event.preventDefault();
|
|
239
|
-
handleSubmitButton();
|
|
240
|
-
}
|
|
241
|
-
} }
|
|
318
|
+
onClick={ handleSubmit }
|
|
242
319
|
label={ __( 'Submit' ) }
|
|
243
320
|
icon={ keyboardReturn }
|
|
244
321
|
className="block-editor-link-control__search-submit"
|
|
322
|
+
disabled={ currentInputIsEmpty } // disallow submitting empty values.
|
|
245
323
|
/>
|
|
246
324
|
</div>
|
|
247
325
|
</LinkControlSearchInput>
|
|
@@ -264,28 +342,21 @@ function LinkControl( {
|
|
|
264
342
|
value={ value }
|
|
265
343
|
onEditClick={ () => setIsEditingLink( true ) }
|
|
266
344
|
hasRichPreviews={ hasRichPreviews }
|
|
345
|
+
hasUnlinkControl={ shownUnlinkControl }
|
|
346
|
+
onRemove={ onRemove }
|
|
267
347
|
/>
|
|
268
348
|
) }
|
|
269
349
|
|
|
270
|
-
{
|
|
350
|
+
{ showSettingsDrawer && (
|
|
271
351
|
<div className="block-editor-link-control__tools">
|
|
272
352
|
<LinkControlSettingsDrawer
|
|
273
353
|
value={ value }
|
|
274
354
|
settings={ settings }
|
|
275
355
|
onChange={ onChange }
|
|
276
356
|
/>
|
|
277
|
-
{ shownUnlinkControl && (
|
|
278
|
-
<Button
|
|
279
|
-
className="block-editor-link-control__unlink"
|
|
280
|
-
isDestructive
|
|
281
|
-
variant="link"
|
|
282
|
-
onClick={ onRemove }
|
|
283
|
-
>
|
|
284
|
-
{ __( 'Unlink' ) }
|
|
285
|
-
</Button>
|
|
286
|
-
) }
|
|
287
357
|
</div>
|
|
288
358
|
) }
|
|
359
|
+
{ renderControlBottom && renderControlBottom() }
|
|
289
360
|
</div>
|
|
290
361
|
);
|
|
291
362
|
}
|