@wordpress/block-editor 12.25.0 → 12.26.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 +9 -3
- package/README.md +6 -0
- package/build/components/block-actions/index.js +4 -2
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +2 -2
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/index.js +2 -2
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-edit/edit.js +2 -2
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-icon/index.js +2 -2
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -4
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -2
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +5 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
- package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
- package/build/components/block-list-appender/index.js +2 -2
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-mover/button.js +2 -2
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +2 -2
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +26 -5
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/cover.js +9 -6
- package/build/components/block-popover/cover.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -2
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +22 -4
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/index.js +2 -2
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +8 -5
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +10 -7
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +2 -2
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +3 -3
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +2 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build/components/block-tools/block-toolbar-popover.js +2 -2
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +2 -2
- package/build/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build/components/block-tools/index.js +20 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +4 -4
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +66 -22
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-variation-picker/index.js +2 -2
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -2
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +2 -2
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/colors-gradients/control.js +3 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +2 -2
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +6 -0
- package/build/components/convert-to-group-buttons/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/dimensions-tool/aspect-ratio-tool.js +30 -36
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/global-styles/background-panel.js +3 -3
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +3 -3
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +4 -4
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -2
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +4 -4
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
- package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
- package/build/components/grid-visualizer/grid-visualizer.js +11 -5
- package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
- package/build/components/iframe/index.js +69 -30
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/cropper.js +2 -2
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/index.js +1 -1
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/index.js +8 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +2 -2
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +22 -21
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +9 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +5 -3
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +11 -2
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +12 -5
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +2 -2
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +8 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +2 -2
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +72 -56
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -2
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/tabs.js +17 -5
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-list-item/index.js +3 -3
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +9 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/link-control/index.js +2 -2
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +3 -3
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -2
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/list-view/block-contents.js +2 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +11 -3
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +35 -12
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +3 -3
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +2 -2
- 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/media-placeholder/index.js +4 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +2 -2
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/plain-text/index.js +2 -2
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +18 -0
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/responsive-block-control/index.js +2 -2
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/enter.js +33 -42
- package/build/components/rich-text/event-listeners/enter.js.map +1 -1
- package/build/components/rich-text/event-listeners/paste-handler.js +22 -42
- package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +2 -2
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +9 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +2 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +30 -2
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/segmented-text-control/index.js +2 -2
- package/build/components/segmented-text-control/index.js.map +1 -1
- package/build/components/text-alignment-control/index.js +2 -2
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +2 -2
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +2 -2
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/url-input/index.js +4 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +2 -2
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer-url.js +2 -2
- package/build/components/url-popover/link-viewer-url.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +2 -2
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/components/warning/index.js +2 -2
- package/build/components/warning/index.js.map +1 -1
- package/build/components/writing-flow/index.js +2 -2
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +77 -30
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/use-input.js +44 -2
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +6 -1
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-mode-control/index.js +2 -2
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/align.js +2 -2
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/background.js +1 -1
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +3 -3
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +5 -28
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +2 -2
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +2 -2
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/layout-child.js +16 -8
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +2 -2
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +2 -2
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/text-align.js +3 -3
- package/build/hooks/text-align.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +39 -13
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-color-props.js +2 -2
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/use-typography-props.js +2 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +2 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/grid.js +7 -6
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +134 -40
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +26 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/store/private-selectors.js +6 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +4 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/selection.js +8 -0
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +12 -7
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +4 -2
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +2 -2
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +2 -2
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-edit/edit.js +2 -2
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-icon/index.js +2 -2
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +4 -4
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -2
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -2
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +5 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
- package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
- package/build-module/components/block-list-appender/index.js +2 -2
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mover/button.js +2 -2
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +2 -2
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +27 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/cover.js +9 -5
- package/build-module/components/block-popover/cover.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +2 -2
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +21 -3
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +2 -2
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -5
- 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 -7
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +2 -2
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +3 -3
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +2 -2
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build-module/components/block-tools/index.js +20 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +4 -4
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +67 -23
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +2 -2
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -2
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +2 -2
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +3 -3
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +2 -2
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +7 -1
- package/build-module/components/convert-to-group-buttons/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/dimensions-tool/aspect-ratio-tool.js +30 -36
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +3 -3
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -3
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +4 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +2 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +4 -4
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
- package/build-module/components/iframe/index.js +70 -31
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +2 -2
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/index.js +1 -1
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +2 -2
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +22 -21
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +10 -1
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +6 -4
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +2 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +8 -2
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +2 -2
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +72 -56
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -2
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/tabs.js +18 -6
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +3 -3
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +9 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/link-control/index.js +2 -2
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +3 -3
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -2
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +2 -2
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +11 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +36 -13
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +3 -3
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +2 -2
- 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/media-placeholder/index.js +4 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +2 -2
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +2 -2
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +19 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +2 -2
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/enter.js +33 -43
- package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js +23 -43
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +2 -2
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +9 -2
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +2 -2
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +31 -3
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/segmented-text-control/index.js +2 -2
- package/build-module/components/segmented-text-control/index.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +2 -2
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +2 -2
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +2 -2
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/url-input/index.js +4 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +2 -2
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer-url.js +2 -2
- package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +2 -2
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/components/warning/index.js +2 -2
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +2 -2
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +45 -3
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +6 -1
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +2 -2
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/align.js +2 -2
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/background.js +1 -1
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +3 -3
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +5 -28
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +2 -2
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +2 -2
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/layout-child.js +16 -8
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +2 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +2 -2
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/text-align.js +3 -3
- package/build-module/hooks/text-align.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +39 -13
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-color-props.js +2 -2
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +2 -2
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/grid.js +7 -6
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +5 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +136 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +24 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/store/private-selectors.js +5 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +4 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/selection.js +7 -0
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +12 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +89 -96
- package/build-style/content.css +89 -96
- package/build-style/style-rtl.css +14 -4
- package/build-style/style.css +14 -4
- 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 +32 -32
- package/src/components/block-actions/index.js +5 -1
- package/src/components/block-alignment-control/ui.js +2 -2
- package/src/components/block-card/index.js +2 -2
- package/src/components/block-compare/index.js +2 -2
- package/src/components/block-content-overlay/content.scss +4 -37
- package/src/components/block-draggable/test/helpers.native.js +8 -8
- package/src/components/block-edit/edit.js +2 -2
- package/src/components/block-icon/index.js +2 -2
- package/src/components/block-inspector/index.js +2 -1
- package/src/components/block-list/block.js +4 -4
- package/src/components/block-list/block.native.js +2 -2
- package/src/components/block-list/content.scss +46 -73
- package/src/components/block-list/index.js +2 -2
- package/src/components/block-list/use-block-props/index.js +4 -2
- package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
- package/src/components/block-list-appender/index.js +2 -2
- package/src/components/block-mover/button.js +2 -2
- package/src/components/block-mover/index.js +2 -2
- package/src/components/block-patterns-list/index.js +29 -4
- package/src/components/block-popover/README.md +1 -1
- package/src/components/block-popover/cover.js +22 -7
- package/src/components/block-popover/inbetween.js +2 -2
- package/src/components/block-popover/index.js +24 -6
- package/src/components/block-preview/index.js +2 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +14 -6
- package/src/components/block-settings-menu-controls/index.js +25 -16
- package/src/components/block-styles/index.js +2 -2
- package/src/components/block-toolbar/index.js +3 -3
- package/src/components/block-tools/block-selection-button.js +2 -2
- package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
- package/src/components/block-tools/block-toolbar-popover.js +4 -7
- package/src/components/block-tools/empty-block-inserter.js +2 -2
- package/src/components/block-tools/index.js +24 -3
- package/src/components/block-tools/insertion-point.js +4 -4
- package/src/components/block-tools/style.scss +8 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +73 -21
- package/src/components/block-variation-picker/index.js +2 -2
- package/src/components/button-block-appender/index.js +2 -2
- package/src/components/child-layout-control/index.js +14 -2
- package/src/components/colors-gradients/control.js +3 -3
- package/src/components/colors-gradients/dropdown.js +2 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/src/components/colors-gradients/test/control.js +3 -3
- package/src/components/convert-to-group-buttons/index.js +10 -1
- package/src/components/default-block-appender/index.js +2 -2
- package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
- package/src/components/dimensions-tool/test/index.js +10 -0
- package/src/components/editable-text/README.md +0 -4
- package/src/components/global-styles/background-panel.js +3 -3
- package/src/components/global-styles/color-panel.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +4 -4
- package/src/components/global-styles/filters-panel.js +2 -2
- package/src/components/global-styles/shadow-panel-components.js +6 -9
- package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
- package/src/components/global-styles/test/use-global-styles-output.js +5 -5
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
- package/src/components/grid-visualizer/grid-visualizer.js +19 -6
- package/src/components/iframe/content.scss +63 -0
- package/src/components/iframe/index.js +119 -39
- package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
- package/src/components/image-editor/cropper.js +2 -2
- package/src/components/image-editor/index.js +1 -1
- package/src/components/image-editor/test/index.js +22 -0
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/button-block-appender.js +2 -2
- package/src/components/inner-blocks/index.js +19 -17
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
- package/src/components/inserter/block-patterns-tab/index.js +17 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
- package/src/components/inserter/block-types-tab.js +7 -9
- package/src/components/inserter/hooks/use-insertion-point.js +15 -1
- package/src/components/inserter/hooks/use-patterns-state.js +18 -5
- package/src/components/inserter/index.js +4 -5
- package/src/components/inserter/library.js +6 -0
- package/src/components/inserter/media-tab/media-preview.js +2 -2
- package/src/components/inserter/menu.js +113 -107
- package/src/components/inserter/quick-inserter.js +2 -2
- package/src/components/inserter/style.scss +6 -8
- package/src/components/inserter/tabs.js +29 -15
- package/src/components/inserter-list-item/index.js +3 -3
- package/src/components/keyboard-shortcuts/index.js +12 -0
- package/src/components/line-height-control/test/index.js +16 -14
- package/src/components/link-control/index.js +2 -2
- package/src/components/link-control/link-preview.js +3 -3
- package/src/components/link-control/search-results.js +2 -2
- package/src/components/list-view/block-contents.js +2 -2
- package/src/components/list-view/block-select-button.js +14 -3
- package/src/components/list-view/block.js +54 -30
- package/src/components/list-view/drop-indicator.js +3 -3
- package/src/components/list-view/index.js +2 -2
- package/src/components/list-view/leaf.js +2 -5
- package/src/components/media-placeholder/index.js +4 -4
- package/src/components/media-replace-flow/index.js +2 -2
- package/src/components/plain-text/index.js +2 -2
- package/src/components/provider/use-block-sync.js +27 -1
- package/src/components/responsive-block-control/index.js +2 -2
- package/src/components/rich-text/README.md +0 -8
- package/src/components/rich-text/event-listeners/enter.js +28 -48
- package/src/components/rich-text/event-listeners/paste-handler.js +21 -58
- package/src/components/rich-text/format-toolbar/index.js +2 -2
- package/src/components/rich-text/index.js +10 -3
- package/src/components/rich-text/index.native.js +2 -2
- package/src/components/rich-text/multiline.js +31 -3
- package/src/components/segmented-text-control/index.js +2 -2
- package/src/components/text-alignment-control/index.js +2 -2
- package/src/components/text-decoration-control/index.js +2 -2
- package/src/components/text-transform-control/index.js +2 -2
- package/src/components/url-input/index.js +4 -4
- package/src/components/url-popover/link-editor.js +2 -2
- package/src/components/url-popover/link-viewer-url.js +2 -2
- package/src/components/url-popover/link-viewer.js +2 -2
- package/src/components/warning/index.js +2 -2
- package/src/components/writing-flow/index.js +2 -2
- package/src/components/writing-flow/use-clipboard-handler.js +107 -47
- package/src/components/writing-flow/use-input.js +75 -1
- package/src/components/writing-flow/use-tab-nav.js +10 -1
- package/src/components/writing-mode-control/index.js +2 -5
- package/src/content.scss +1 -0
- package/src/hooks/align.js +2 -2
- package/src/hooks/background.js +1 -1
- package/src/hooks/border.js +3 -3
- package/src/hooks/color.js +12 -19
- package/src/hooks/color.scss +1 -0
- package/src/hooks/content-lock-ui.js +16 -33
- package/src/hooks/custom-class-name.js +2 -2
- package/src/hooks/custom-class-name.native.js +2 -2
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/layout-child.js +34 -20
- package/src/hooks/layout.js +2 -2
- package/src/hooks/position.js +2 -2
- package/src/hooks/text-align.js +3 -3
- package/src/hooks/use-bindings-attributes.js +48 -16
- package/src/hooks/use-color-props.js +2 -2
- package/src/hooks/use-typography-props.js +2 -2
- package/src/hooks/utils.js +2 -2
- package/src/layouts/grid.js +3 -7
- package/src/private-apis.js +4 -0
- package/src/store/actions.js +225 -70
- package/src/store/private-actions.js +24 -0
- package/src/store/private-keys.js +1 -0
- package/src/store/private-selectors.js +15 -0
- package/src/store/selectors.js +4 -2
- package/src/utils/selection.js +8 -0
- package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
- package/src/utils/test/transform-styles.js +14 -0
- package/src/utils/transform-styles/index.js +12 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/rich-text/split-value.js +0 -81
- package/build/components/rich-text/split-value.js.map +0 -1
- package/build-module/components/rich-text/split-value.js +0 -75
- package/build-module/components/rich-text/split-value.js.map +0 -1
- package/src/components/rich-text/split-value.js +0 -64
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.splitValue = splitValue;
|
|
7
|
-
var _richText = require("@wordpress/rich-text");
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* Signals to the RichText owner that the block can be replaced with two blocks
|
|
14
|
-
* as a result of splitting the block by pressing enter, or with blocks as a
|
|
15
|
-
* result of splitting the block by pasting block content in the instance.
|
|
16
|
-
*/
|
|
17
|
-
function splitValue({
|
|
18
|
-
value,
|
|
19
|
-
pastedBlocks = [],
|
|
20
|
-
onReplace,
|
|
21
|
-
onSplit
|
|
22
|
-
}) {
|
|
23
|
-
if (!onReplace || !onSplit) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Ensure the value has a selection. This might happen when trying to split
|
|
28
|
-
// an empty value before there was a `selectionchange` event.
|
|
29
|
-
const {
|
|
30
|
-
start = 0,
|
|
31
|
-
end = 0
|
|
32
|
-
} = value;
|
|
33
|
-
const valueWithEnsuredSelection = {
|
|
34
|
-
...value,
|
|
35
|
-
start,
|
|
36
|
-
end
|
|
37
|
-
};
|
|
38
|
-
const blocks = [];
|
|
39
|
-
const [before, after] = (0, _richText.split)(valueWithEnsuredSelection);
|
|
40
|
-
const hasPastedBlocks = pastedBlocks.length > 0;
|
|
41
|
-
let lastPastedBlockIndex = -1;
|
|
42
|
-
|
|
43
|
-
// Consider the after value to be the original it is not empty and the
|
|
44
|
-
// before value *is* empty.
|
|
45
|
-
const isAfterOriginal = (0, _richText.isEmpty)(before) && !(0, _richText.isEmpty)(after);
|
|
46
|
-
|
|
47
|
-
// Create a block with the content before the caret if there's no pasted
|
|
48
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
49
|
-
// not want a leading empty block on paste, but we do if we split with e.g.
|
|
50
|
-
// the enter key.
|
|
51
|
-
if (!hasPastedBlocks || !(0, _richText.isEmpty)(before)) {
|
|
52
|
-
blocks.push(onSplit((0, _richText.toHTMLString)({
|
|
53
|
-
value: before
|
|
54
|
-
}), !isAfterOriginal));
|
|
55
|
-
lastPastedBlockIndex += 1;
|
|
56
|
-
}
|
|
57
|
-
if (hasPastedBlocks) {
|
|
58
|
-
blocks.push(...pastedBlocks);
|
|
59
|
-
lastPastedBlockIndex += pastedBlocks.length;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Create a block with the content after the caret if there's no pasted
|
|
63
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
64
|
-
// not want a trailing empty block on paste, but we do if we split with e.g.
|
|
65
|
-
// the enter key.
|
|
66
|
-
if (!hasPastedBlocks || !(0, _richText.isEmpty)(after)) {
|
|
67
|
-
blocks.push(onSplit((0, _richText.toHTMLString)({
|
|
68
|
-
value: after
|
|
69
|
-
}), isAfterOriginal));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// If there are pasted blocks, set the selection to the last one. Otherwise,
|
|
73
|
-
// set the selection to the second block.
|
|
74
|
-
const indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;
|
|
75
|
-
|
|
76
|
-
// If there are pasted blocks, move the caret to the end of the selected
|
|
77
|
-
// block Otherwise, retain the default value.
|
|
78
|
-
const initialPosition = hasPastedBlocks ? -1 : 0;
|
|
79
|
-
onReplace(blocks, indexToSelect, initialPosition);
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=split-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_richText","require","splitValue","value","pastedBlocks","onReplace","onSplit","start","end","valueWithEnsuredSelection","blocks","before","after","split","hasPastedBlocks","length","lastPastedBlockIndex","isAfterOriginal","isEmpty","push","toHTMLString","indexToSelect","initialPosition"],"sources":["@wordpress/block-editor/src/components/rich-text/split-value.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isEmpty, split, toHTMLString } from '@wordpress/rich-text';\n\n/*\n * Signals to the RichText owner that the block can be replaced with two blocks\n * as a result of splitting the block by pressing enter, or with blocks as a\n * result of splitting the block by pasting block content in the instance.\n */\nexport function splitValue( { value, pastedBlocks = [], onReplace, onSplit } ) {\n\tif ( ! onReplace || ! onSplit ) {\n\t\treturn;\n\t}\n\n\t// Ensure the value has a selection. This might happen when trying to split\n\t// an empty value before there was a `selectionchange` event.\n\tconst { start = 0, end = 0 } = value;\n\tconst valueWithEnsuredSelection = { ...value, start, end };\n\tconst blocks = [];\n\tconst [ before, after ] = split( valueWithEnsuredSelection );\n\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\tlet lastPastedBlockIndex = -1;\n\n\t// Consider the after value to be the original it is not empty and the\n\t// before value *is* empty.\n\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t// Create a block with the content before the caret if there's no pasted\n\t// blocks, or if there are pasted blocks and the value is not empty. We do\n\t// not want a leading empty block on paste, but we do if we split with e.g.\n\t// the enter key.\n\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\tblocks.push(\n\t\t\tonSplit( toHTMLString( { value: before } ), ! isAfterOriginal )\n\t\t);\n\t\tlastPastedBlockIndex += 1;\n\t}\n\n\tif ( hasPastedBlocks ) {\n\t\tblocks.push( ...pastedBlocks );\n\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t}\n\n\t// Create a block with the content after the caret if there's no pasted\n\t// blocks, or if there are pasted blocks and the value is not empty. We do\n\t// not want a trailing empty block on paste, but we do if we split with e.g.\n\t// the enter key.\n\tif ( ! hasPastedBlocks || ! isEmpty( after ) ) {\n\t\tblocks.push(\n\t\t\tonSplit( toHTMLString( { value: after } ), isAfterOriginal )\n\t\t);\n\t}\n\n\t// If there are pasted blocks, set the selection to the last one. Otherwise,\n\t// set the selection to the second block.\n\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t// If there are pasted blocks, move the caret to the end of the selected\n\t// block Otherwise, retain the default value.\n\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\tonReplace( blocks, indexToSelect, initialPosition );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAE;EAAEC,KAAK;EAAEC,YAAY,GAAG,EAAE;EAAEC,SAAS;EAAEC;AAAQ,CAAC,EAAG;EAC9E,IAAK,CAAED,SAAS,IAAI,CAAEC,OAAO,EAAG;IAC/B;EACD;;EAEA;EACA;EACA,MAAM;IAAEC,KAAK,GAAG,CAAC;IAAEC,GAAG,GAAG;EAAE,CAAC,GAAGL,KAAK;EACpC,MAAMM,yBAAyB,GAAG;IAAE,GAAGN,KAAK;IAAEI,KAAK;IAAEC;EAAI,CAAC;EAC1D,MAAME,MAAM,GAAG,EAAE;EACjB,MAAM,CAAEC,MAAM,EAAEC,KAAK,CAAE,GAAG,IAAAC,eAAK,EAAEJ,yBAA0B,CAAC;EAC5D,MAAMK,eAAe,GAAGV,YAAY,CAACW,MAAM,GAAG,CAAC;EAC/C,IAAIC,oBAAoB,GAAG,CAAC,CAAC;;EAE7B;EACA;EACA,MAAMC,eAAe,GAAG,IAAAC,iBAAO,EAAEP,MAAO,CAAC,IAAI,CAAE,IAAAO,iBAAO,EAAEN,KAAM,CAAC;;EAE/D;EACA;EACA;EACA;EACA,IAAK,CAAEE,eAAe,IAAI,CAAE,IAAAI,iBAAO,EAAEP,MAAO,CAAC,EAAG;IAC/CD,MAAM,CAACS,IAAI,CACVb,OAAO,CAAE,IAAAc,sBAAY,EAAE;MAAEjB,KAAK,EAAEQ;IAAO,CAAE,CAAC,EAAE,CAAEM,eAAgB,CAC/D,CAAC;IACDD,oBAAoB,IAAI,CAAC;EAC1B;EAEA,IAAKF,eAAe,EAAG;IACtBJ,MAAM,CAACS,IAAI,CAAE,GAAGf,YAAa,CAAC;IAC9BY,oBAAoB,IAAIZ,YAAY,CAACW,MAAM;EAC5C;;EAEA;EACA;EACA;EACA;EACA,IAAK,CAAED,eAAe,IAAI,CAAE,IAAAI,iBAAO,EAAEN,KAAM,CAAC,EAAG;IAC9CF,MAAM,CAACS,IAAI,CACVb,OAAO,CAAE,IAAAc,sBAAY,EAAE;MAAEjB,KAAK,EAAES;IAAM,CAAE,CAAC,EAAEK,eAAgB,CAC5D,CAAC;EACF;;EAEA;EACA;EACA,MAAMI,aAAa,GAAGP,eAAe,GAAGE,oBAAoB,GAAG,CAAC;;EAEhE;EACA;EACA,MAAMM,eAAe,GAAGR,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC;EAEhDT,SAAS,CAAEK,MAAM,EAAEW,aAAa,EAAEC,eAAgB,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { isEmpty, split, toHTMLString } from '@wordpress/rich-text';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Signals to the RichText owner that the block can be replaced with two blocks
|
|
8
|
-
* as a result of splitting the block by pressing enter, or with blocks as a
|
|
9
|
-
* result of splitting the block by pasting block content in the instance.
|
|
10
|
-
*/
|
|
11
|
-
export function splitValue({
|
|
12
|
-
value,
|
|
13
|
-
pastedBlocks = [],
|
|
14
|
-
onReplace,
|
|
15
|
-
onSplit
|
|
16
|
-
}) {
|
|
17
|
-
if (!onReplace || !onSplit) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Ensure the value has a selection. This might happen when trying to split
|
|
22
|
-
// an empty value before there was a `selectionchange` event.
|
|
23
|
-
const {
|
|
24
|
-
start = 0,
|
|
25
|
-
end = 0
|
|
26
|
-
} = value;
|
|
27
|
-
const valueWithEnsuredSelection = {
|
|
28
|
-
...value,
|
|
29
|
-
start,
|
|
30
|
-
end
|
|
31
|
-
};
|
|
32
|
-
const blocks = [];
|
|
33
|
-
const [before, after] = split(valueWithEnsuredSelection);
|
|
34
|
-
const hasPastedBlocks = pastedBlocks.length > 0;
|
|
35
|
-
let lastPastedBlockIndex = -1;
|
|
36
|
-
|
|
37
|
-
// Consider the after value to be the original it is not empty and the
|
|
38
|
-
// before value *is* empty.
|
|
39
|
-
const isAfterOriginal = isEmpty(before) && !isEmpty(after);
|
|
40
|
-
|
|
41
|
-
// Create a block with the content before the caret if there's no pasted
|
|
42
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
43
|
-
// not want a leading empty block on paste, but we do if we split with e.g.
|
|
44
|
-
// the enter key.
|
|
45
|
-
if (!hasPastedBlocks || !isEmpty(before)) {
|
|
46
|
-
blocks.push(onSplit(toHTMLString({
|
|
47
|
-
value: before
|
|
48
|
-
}), !isAfterOriginal));
|
|
49
|
-
lastPastedBlockIndex += 1;
|
|
50
|
-
}
|
|
51
|
-
if (hasPastedBlocks) {
|
|
52
|
-
blocks.push(...pastedBlocks);
|
|
53
|
-
lastPastedBlockIndex += pastedBlocks.length;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Create a block with the content after the caret if there's no pasted
|
|
57
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
58
|
-
// not want a trailing empty block on paste, but we do if we split with e.g.
|
|
59
|
-
// the enter key.
|
|
60
|
-
if (!hasPastedBlocks || !isEmpty(after)) {
|
|
61
|
-
blocks.push(onSplit(toHTMLString({
|
|
62
|
-
value: after
|
|
63
|
-
}), isAfterOriginal));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// If there are pasted blocks, set the selection to the last one. Otherwise,
|
|
67
|
-
// set the selection to the second block.
|
|
68
|
-
const indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;
|
|
69
|
-
|
|
70
|
-
// If there are pasted blocks, move the caret to the end of the selected
|
|
71
|
-
// block Otherwise, retain the default value.
|
|
72
|
-
const initialPosition = hasPastedBlocks ? -1 : 0;
|
|
73
|
-
onReplace(blocks, indexToSelect, initialPosition);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=split-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isEmpty","split","toHTMLString","splitValue","value","pastedBlocks","onReplace","onSplit","start","end","valueWithEnsuredSelection","blocks","before","after","hasPastedBlocks","length","lastPastedBlockIndex","isAfterOriginal","push","indexToSelect","initialPosition"],"sources":["@wordpress/block-editor/src/components/rich-text/split-value.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isEmpty, split, toHTMLString } from '@wordpress/rich-text';\n\n/*\n * Signals to the RichText owner that the block can be replaced with two blocks\n * as a result of splitting the block by pressing enter, or with blocks as a\n * result of splitting the block by pasting block content in the instance.\n */\nexport function splitValue( { value, pastedBlocks = [], onReplace, onSplit } ) {\n\tif ( ! onReplace || ! onSplit ) {\n\t\treturn;\n\t}\n\n\t// Ensure the value has a selection. This might happen when trying to split\n\t// an empty value before there was a `selectionchange` event.\n\tconst { start = 0, end = 0 } = value;\n\tconst valueWithEnsuredSelection = { ...value, start, end };\n\tconst blocks = [];\n\tconst [ before, after ] = split( valueWithEnsuredSelection );\n\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\tlet lastPastedBlockIndex = -1;\n\n\t// Consider the after value to be the original it is not empty and the\n\t// before value *is* empty.\n\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t// Create a block with the content before the caret if there's no pasted\n\t// blocks, or if there are pasted blocks and the value is not empty. We do\n\t// not want a leading empty block on paste, but we do if we split with e.g.\n\t// the enter key.\n\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\tblocks.push(\n\t\t\tonSplit( toHTMLString( { value: before } ), ! isAfterOriginal )\n\t\t);\n\t\tlastPastedBlockIndex += 1;\n\t}\n\n\tif ( hasPastedBlocks ) {\n\t\tblocks.push( ...pastedBlocks );\n\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t}\n\n\t// Create a block with the content after the caret if there's no pasted\n\t// blocks, or if there are pasted blocks and the value is not empty. We do\n\t// not want a trailing empty block on paste, but we do if we split with e.g.\n\t// the enter key.\n\tif ( ! hasPastedBlocks || ! isEmpty( after ) ) {\n\t\tblocks.push(\n\t\t\tonSplit( toHTMLString( { value: after } ), isAfterOriginal )\n\t\t);\n\t}\n\n\t// If there are pasted blocks, set the selection to the last one. Otherwise,\n\t// set the selection to the second block.\n\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t// If there are pasted blocks, move the caret to the end of the selected\n\t// block Otherwise, retain the default value.\n\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\tonReplace( blocks, indexToSelect, initialPosition );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,KAAK,EAAEC,YAAY,QAAQ,sBAAsB;;AAEnE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAE;EAAEC,KAAK;EAAEC,YAAY,GAAG,EAAE;EAAEC,SAAS;EAAEC;AAAQ,CAAC,EAAG;EAC9E,IAAK,CAAED,SAAS,IAAI,CAAEC,OAAO,EAAG;IAC/B;EACD;;EAEA;EACA;EACA,MAAM;IAAEC,KAAK,GAAG,CAAC;IAAEC,GAAG,GAAG;EAAE,CAAC,GAAGL,KAAK;EACpC,MAAMM,yBAAyB,GAAG;IAAE,GAAGN,KAAK;IAAEI,KAAK;IAAEC;EAAI,CAAC;EAC1D,MAAME,MAAM,GAAG,EAAE;EACjB,MAAM,CAAEC,MAAM,EAAEC,KAAK,CAAE,GAAGZ,KAAK,CAAES,yBAA0B,CAAC;EAC5D,MAAMI,eAAe,GAAGT,YAAY,CAACU,MAAM,GAAG,CAAC;EAC/C,IAAIC,oBAAoB,GAAG,CAAC,CAAC;;EAE7B;EACA;EACA,MAAMC,eAAe,GAAGjB,OAAO,CAAEY,MAAO,CAAC,IAAI,CAAEZ,OAAO,CAAEa,KAAM,CAAC;;EAE/D;EACA;EACA;EACA;EACA,IAAK,CAAEC,eAAe,IAAI,CAAEd,OAAO,CAAEY,MAAO,CAAC,EAAG;IAC/CD,MAAM,CAACO,IAAI,CACVX,OAAO,CAAEL,YAAY,CAAE;MAAEE,KAAK,EAAEQ;IAAO,CAAE,CAAC,EAAE,CAAEK,eAAgB,CAC/D,CAAC;IACDD,oBAAoB,IAAI,CAAC;EAC1B;EAEA,IAAKF,eAAe,EAAG;IACtBH,MAAM,CAACO,IAAI,CAAE,GAAGb,YAAa,CAAC;IAC9BW,oBAAoB,IAAIX,YAAY,CAACU,MAAM;EAC5C;;EAEA;EACA;EACA;EACA;EACA,IAAK,CAAED,eAAe,IAAI,CAAEd,OAAO,CAAEa,KAAM,CAAC,EAAG;IAC9CF,MAAM,CAACO,IAAI,CACVX,OAAO,CAAEL,YAAY,CAAE;MAAEE,KAAK,EAAES;IAAM,CAAE,CAAC,EAAEI,eAAgB,CAC5D,CAAC;EACF;;EAEA;EACA;EACA,MAAME,aAAa,GAAGL,eAAe,GAAGE,oBAAoB,GAAG,CAAC;;EAEhE;EACA;EACA,MAAMI,eAAe,GAAGN,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC;EAEhDR,SAAS,CAAEK,MAAM,EAAEQ,aAAa,EAAEC,eAAgB,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { isEmpty, split, toHTMLString } from '@wordpress/rich-text';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Signals to the RichText owner that the block can be replaced with two blocks
|
|
8
|
-
* as a result of splitting the block by pressing enter, or with blocks as a
|
|
9
|
-
* result of splitting the block by pasting block content in the instance.
|
|
10
|
-
*/
|
|
11
|
-
export function splitValue( { value, pastedBlocks = [], onReplace, onSplit } ) {
|
|
12
|
-
if ( ! onReplace || ! onSplit ) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Ensure the value has a selection. This might happen when trying to split
|
|
17
|
-
// an empty value before there was a `selectionchange` event.
|
|
18
|
-
const { start = 0, end = 0 } = value;
|
|
19
|
-
const valueWithEnsuredSelection = { ...value, start, end };
|
|
20
|
-
const blocks = [];
|
|
21
|
-
const [ before, after ] = split( valueWithEnsuredSelection );
|
|
22
|
-
const hasPastedBlocks = pastedBlocks.length > 0;
|
|
23
|
-
let lastPastedBlockIndex = -1;
|
|
24
|
-
|
|
25
|
-
// Consider the after value to be the original it is not empty and the
|
|
26
|
-
// before value *is* empty.
|
|
27
|
-
const isAfterOriginal = isEmpty( before ) && ! isEmpty( after );
|
|
28
|
-
|
|
29
|
-
// Create a block with the content before the caret if there's no pasted
|
|
30
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
31
|
-
// not want a leading empty block on paste, but we do if we split with e.g.
|
|
32
|
-
// the enter key.
|
|
33
|
-
if ( ! hasPastedBlocks || ! isEmpty( before ) ) {
|
|
34
|
-
blocks.push(
|
|
35
|
-
onSplit( toHTMLString( { value: before } ), ! isAfterOriginal )
|
|
36
|
-
);
|
|
37
|
-
lastPastedBlockIndex += 1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if ( hasPastedBlocks ) {
|
|
41
|
-
blocks.push( ...pastedBlocks );
|
|
42
|
-
lastPastedBlockIndex += pastedBlocks.length;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Create a block with the content after the caret if there's no pasted
|
|
46
|
-
// blocks, or if there are pasted blocks and the value is not empty. We do
|
|
47
|
-
// not want a trailing empty block on paste, but we do if we split with e.g.
|
|
48
|
-
// the enter key.
|
|
49
|
-
if ( ! hasPastedBlocks || ! isEmpty( after ) ) {
|
|
50
|
-
blocks.push(
|
|
51
|
-
onSplit( toHTMLString( { value: after } ), isAfterOriginal )
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If there are pasted blocks, set the selection to the last one. Otherwise,
|
|
56
|
-
// set the selection to the second block.
|
|
57
|
-
const indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;
|
|
58
|
-
|
|
59
|
-
// If there are pasted blocks, move the caret to the end of the selected
|
|
60
|
-
// block Otherwise, retain the default value.
|
|
61
|
-
const initialPosition = hasPastedBlocks ? -1 : 0;
|
|
62
|
-
|
|
63
|
-
onReplace( blocks, indexToSelect, initialPosition );
|
|
64
|
-
}
|