@wordpress/block-editor 15.21.0 → 15.22.1-next.v.202606191442.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 +23 -1
- package/build/components/block-card/index.cjs +4 -5
- package/build/components/block-card/index.cjs.map +2 -2
- package/build/components/block-compare/index.cjs +2 -2
- package/build/components/block-compare/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +3 -4
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-mover/mover-description.cjs +6 -6
- package/build/components/block-mover/mover-description.cjs.map +1 -1
- package/build/components/block-patterns-list/index.cjs +1 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs +4 -4
- package/build/components/block-patterns-paging/index.cjs.map +2 -2
- package/build/components/block-popover/use-popover-scroll.cjs.map +1 -1
- package/build/components/block-quick-navigation/index.cjs +7 -5
- package/build/components/block-quick-navigation/index.cjs.map +2 -2
- package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
- package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs +4 -4
- package/build/components/block-switcher/index.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs +10 -4
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +51 -19
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/dimensions-tool/index.cjs +4 -5
- package/build/components/dimensions-tool/index.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +1 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/global-styles/advanced-panel.cjs +23 -15
- package/build/components/global-styles/advanced-panel.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +2 -2
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +2 -0
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +2 -2
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/grid/grid-item-resizer.cjs.map +1 -1
- package/build/components/grid/grid-visualizer.cjs.map +1 -1
- package/build/components/iframe/index.cjs +6 -3
- package/build/components/iframe/index.cjs.map +3 -3
- package/build/components/image-editor/use-transform-image.cjs.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
- package/build/components/inserter/get-appender-label.cjs.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
- package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
- package/build/components/inserter/index.cjs +179 -220
- package/build/components/inserter/index.cjs.map +3 -3
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter/search-items.cjs.map +1 -1
- package/build/components/inserter/search-results.cjs +1 -1
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/inspector-controls/fill.cjs +1 -3
- package/build/components/inspector-controls/fill.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
- package/build/components/line-height-control/index.cjs.map +1 -1
- package/build/components/link-control/index.cjs +1 -1
- package/build/components/link-control/index.cjs.map +1 -1
- package/build/components/link-control/normalize-url.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +10 -12
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +2 -1
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/utils.cjs.map +1 -1
- package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
- package/build/components/provider/index.cjs.map +1 -1
- package/build/components/provider/use-block-sync.cjs +11 -2
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +5 -5
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +4 -4
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +7 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +1 -1
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +1 -23
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/rich-text/prevent-event-discovery.cjs +1 -1
- package/build/components/rich-text/prevent-event-discovery.cjs.map +1 -1
- package/build/components/use-block-commands/index.cjs +5 -5
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
- package/build/hooks/anchor.cjs +12 -16
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs.map +1 -1
- package/build/hooks/block-fields/index.cjs +13 -2
- package/build/hooks/block-fields/index.cjs.map +2 -2
- package/build/hooks/border.cjs +0 -3
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/color.cjs +1 -4
- package/build/hooks/color.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +13 -5
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/fit-text.cjs +11 -0
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +27 -2
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/list-view.cjs +10 -7
- package/build/hooks/list-view.cjs.map +2 -2
- package/build/hooks/position.cjs +19 -22
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/spacing-visualizer.cjs.map +1 -1
- package/build/hooks/state-utils.cjs.map +1 -1
- package/build/hooks/style.cjs +42 -2
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/supports.cjs +0 -7
- package/build/hooks/supports.cjs.map +2 -2
- package/build/private-apis.cjs +4 -0
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +7 -3
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +1 -2
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +42 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +14 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +60 -41
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/dom.cjs.map +1 -1
- package/build/utils/selection.cjs +1 -1
- package/build-module/components/block-card/index.mjs +5 -6
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-compare/index.mjs +1 -1
- package/build-module/components/block-compare/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +3 -5
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-mover/mover-description.mjs +6 -6
- package/build-module/components/block-mover/mover-description.mjs.map +1 -1
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +4 -4
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-popover/use-popover-scroll.mjs.map +1 -1
- package/build-module/components/block-quick-navigation/index.mjs +8 -6
- package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
- package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
- package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +4 -4
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs +10 -4
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +51 -19
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/index.mjs +4 -5
- package/build-module/components/dimensions-tool/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/global-styles/advanced-panel.mjs +23 -15
- package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +3 -3
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -0
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +3 -4
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
- package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
- package/build-module/components/iframe/index.mjs +6 -3
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/image-editor/use-transform-image.mjs.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
- package/build-module/components/inserter/get-appender-label.mjs.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +185 -222
- package/build-module/components/inserter/index.mjs.map +3 -3
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter/search-items.mjs.map +1 -1
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +2 -2
- package/build-module/components/inspector-controls/fill.mjs +1 -3
- package/build-module/components/inspector-controls/fill.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -1
- package/build-module/components/line-height-control/index.mjs.map +1 -1
- package/build-module/components/link-control/index.mjs +1 -1
- package/build-module/components/link-control/index.mjs.map +1 -1
- package/build-module/components/link-control/normalize-url.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +10 -12
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +2 -1
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs.map +1 -1
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
- package/build-module/components/provider/index.mjs.map +1 -1
- package/build-module/components/provider/use-block-sync.mjs +11 -2
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +5 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +1 -1
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -23
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/rich-text/prevent-event-discovery.mjs +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.mjs.map +1 -1
- package/build-module/components/use-block-commands/index.mjs +5 -5
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-tab-nav.mjs.map +1 -1
- package/build-module/hooks/anchor.mjs +12 -16
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs.map +1 -1
- package/build-module/hooks/block-fields/index.mjs +13 -2
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/hooks/border.mjs +1 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -5
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +13 -6
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/fit-text.mjs +11 -0
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +27 -2
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/list-view.mjs +10 -7
- package/build-module/hooks/list-view.mjs.map +2 -2
- package/build-module/hooks/position.mjs +20 -23
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
- package/build-module/hooks/state-utils.mjs.map +1 -1
- package/build-module/hooks/style.mjs +44 -3
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/supports.mjs +0 -7
- package/build-module/hooks/supports.mjs.map +2 -2
- package/build-module/private-apis.mjs +8 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +7 -3
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +1 -2
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +39 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +14 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +62 -42
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/dom.mjs.map +1 -1
- package/build-module/utils/selection.mjs +1 -1
- package/build-style/content-rtl.css +12 -0
- package/build-style/content.css +12 -0
- package/build-style/style-rtl.css +26 -8
- package/build-style/style.css +26 -8
- package/package.json +54 -46
- package/src/components/block-breadcrumb/README.md +2 -2
- package/src/components/block-card/index.js +7 -13
- package/src/components/block-compare/README.md +6 -6
- package/src/components/block-compare/index.js +1 -3
- package/src/components/block-inspector/index.js +2 -10
- package/src/components/block-patterns-list/index.js +1 -2
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-quick-navigation/index.js +7 -7
- package/src/components/block-switcher/block-transformations-menu.js +16 -18
- package/src/components/block-switcher/index.js +4 -4
- package/src/components/block-tools/use-block-toolbar-popover-props.js +10 -4
- package/src/components/block-types-list/README.md +0 -19
- package/src/components/child-layout-control/index.js +65 -20
- package/src/components/child-layout-control/test/index.js +64 -0
- package/src/components/dimensions-tool/index.js +4 -9
- package/src/components/dimensions-tool/scale-tool.js +1 -2
- package/src/components/dimensions-tool/test/index.js +89 -11
- package/src/components/global-styles/advanced-panel.js +5 -1
- package/src/components/global-styles/background-panel.js +3 -3
- package/src/components/global-styles/border-panel.js +2 -0
- package/src/components/global-styles/dimensions-panel.js +13 -15
- package/src/components/global-styles/shadow-panel-components.js +0 -1
- package/src/components/iframe/index.js +8 -3
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/index.js +257 -288
- package/src/components/inserter/media-tab/media-preview.js +0 -1
- package/src/components/inserter/search-results.js +1 -3
- package/src/components/inspector-controls/fill.js +6 -8
- package/src/components/inspector-controls-tabs/index.js +0 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/list-view/block-select-button.js +9 -14
- package/src/components/list-view/block.js +1 -0
- package/src/components/media-placeholder/README.md +1 -29
- package/src/components/media-upload/README.md +0 -19
- package/src/components/preset-input-control/custom-value-controls.js +0 -1
- package/src/components/provider/test/use-block-sync.js +40 -0
- package/src/components/provider/use-block-sync.js +12 -2
- package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
- package/src/components/rich-text/event-listeners/delete.js +9 -4
- package/src/components/rich-text/event-listeners/enter.js +9 -2
- package/src/components/rich-text/event-listeners/input-events.js +13 -4
- package/src/components/rich-text/event-listeners/input-rules.js +20 -4
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
- package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
- package/src/components/rich-text/index.js +1 -33
- package/src/components/unit-control/README.md +1 -1
- package/src/components/url-popover/README.md +1 -1
- package/src/components/use-block-commands/index.js +5 -5
- package/src/hooks/anchor.js +9 -17
- package/src/hooks/block-fields/index.js +27 -2
- package/src/hooks/border.js +1 -5
- package/src/hooks/color.js +1 -6
- package/src/hooks/dimensions.js +15 -8
- package/src/hooks/fit-text.js +16 -0
- package/src/hooks/layout-child.js +41 -2
- package/src/hooks/list-view.js +10 -11
- package/src/hooks/position.js +23 -27
- package/src/hooks/style.js +80 -2
- package/src/hooks/supports.js +0 -9
- package/src/hooks/test/dimensions.js +71 -0
- package/src/hooks/test/layout-child.js +165 -0
- package/src/hooks/test/style.js +126 -4
- package/src/private-apis.js +8 -0
- package/src/store/actions.js +13 -3
- package/src/store/private-actions.js +1 -4
- package/src/store/private-selectors.js +89 -0
- package/src/store/reducer.js +19 -7
- package/src/store/selectors.js +91 -53
- package/src/store/test/actions.js +21 -0
- package/src/store/test/private-selectors.js +138 -0
- package/src/store/test/reducer.js +46 -0
- package/src/store/test/selectors.js +77 -0
- package/build/components/media-upload-progress/constants.cjs +0 -46
- package/build/components/media-upload-progress/constants.cjs.map +0 -7
- package/build/components/rich-text/native/format-edit.cjs +0 -60
- package/build/components/rich-text/native/format-edit.cjs.map +0 -7
- package/build/components/rich-text/native/index.cjs +0 -28
- package/build/components/rich-text/native/index.cjs.map +0 -7
- package/build/components/rich-text/native/use-format-types.cjs +0 -139
- package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
- package/build-module/components/media-upload-progress/constants.mjs +0 -16
- package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
- package/build-module/components/rich-text/native/format-edit.mjs +0 -39
- package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
- package/build-module/components/rich-text/native/index.mjs +0 -7
- package/build-module/components/rich-text/native/index.mjs.map +0 -7
- package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
- package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
- package/src/components/audio-player/audio-url-parser.native.js +0 -20
- package/src/components/audio-player/index.native.js +0 -225
- package/src/components/audio-player/styles.native.scss +0 -114
- package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
- package/src/components/block-alignment-control/test/index.native.js +0 -37
- package/src/components/block-alignment-control/ui.native.js +0 -86
- package/src/components/block-caption/README.md +0 -104
- package/src/components/block-caption/index.native.js +0 -89
- package/src/components/block-caption/styles.native.scss +0 -7
- package/src/components/block-controls/slot.native.js +0 -33
- package/src/components/block-draggable/draggable-chip.native.js +0 -49
- package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
- package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
- package/src/components/block-draggable/index.native.js +0 -467
- package/src/components/block-draggable/style.native.scss +0 -19
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
- package/src/components/block-draggable/test/helpers.native.js +0 -182
- package/src/components/block-draggable/test/index.native.js +0 -419
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
- package/src/components/block-edit/edit.native.js +0 -49
- package/src/components/block-edit/test/edit.native.js +0 -65
- package/src/components/block-heading-level-dropdown/index.native.js +0 -68
- package/src/components/block-icon/index.native.js +0 -47
- package/src/components/block-icon/style.native.scss +0 -7
- package/src/components/block-list/block-crash-boundary.native.js +0 -43
- package/src/components/block-list/block-crash-warning.native.js +0 -21
- package/src/components/block-list/block-invalid-warning.native.js +0 -70
- package/src/components/block-list/block-list-context.native.js +0 -172
- package/src/components/block-list/block-list-item-cell.native.js +0 -62
- package/src/components/block-list/block-list-item.native.js +0 -209
- package/src/components/block-list/block-list-item.native.scss +0 -16
- package/src/components/block-list/block-outline.native.js +0 -77
- package/src/components/block-list/block-selection-button.native.js +0 -100
- package/src/components/block-list/block-selection-button.native.scss +0 -34
- package/src/components/block-list/block.native.js +0 -716
- package/src/components/block-list/block.native.scss +0 -62
- package/src/components/block-list/grid-item.native.js +0 -58
- package/src/components/block-list/index.native.js +0 -437
- package/src/components/block-list/insertion-point.native.js +0 -36
- package/src/components/block-list/style.native.scss +0 -117
- package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
- package/src/components/block-list/test/block-list-context.native.js +0 -243
- package/src/components/block-list/test/block-outline.native.js +0 -255
- package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
- package/src/components/block-list/test/index.native.js +0 -205
- package/src/components/block-list/use-block-props/index.native.js +0 -10
- package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
- package/src/components/block-list-appender/index.native.js +0 -70
- package/src/components/block-list-appender/style.native.scss +0 -8
- package/src/components/block-media-update-progress/README.md +0 -100
- package/src/components/block-media-update-progress/index.native.js +0 -299
- package/src/components/block-media-update-progress/styles.native.scss +0 -9
- package/src/components/block-media-update-progress/test/index.native.js +0 -543
- package/src/components/block-mover/index.native.js +0 -193
- package/src/components/block-mover/mover-description.native.js +0 -155
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
- package/src/components/block-mover/test/index.native.js +0 -186
- package/src/components/block-settings/button.native.js +0 -41
- package/src/components/block-settings/container.native.js +0 -91
- package/src/components/block-settings/container.native.scss +0 -4
- package/src/components/block-settings/index.native.js +0 -5
- package/src/components/block-styles/index.native.js +0 -94
- package/src/components/block-styles/preview.native.js +0 -109
- package/src/components/block-styles/style.native.scss +0 -64
- package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
- package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
- package/src/components/block-toolbar/index.native.js +0 -126
- package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
- package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
- package/src/components/block-toolbar/test/index.native.js +0 -36
- package/src/components/block-types-list/index.native.js +0 -175
- package/src/components/block-types-list/style.native.scss +0 -25
- package/src/components/block-variation-picker/index.native.js +0 -107
- package/src/components/block-variation-picker/style.native.scss +0 -32
- package/src/components/button-block-appender/index.native.js +0 -92
- package/src/components/button-block-appender/styles.native.scss +0 -43
- package/src/components/caption/README.md +0 -44
- package/src/components/caption/index.native.js +0 -61
- package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
- package/src/components/contrast-checker/index.native.js +0 -113
- package/src/components/contrast-checker/style.native.scss +0 -26
- package/src/components/convert-to-group-buttons/index.native.js +0 -79
- package/src/components/default-block-appender/index.native.js +0 -113
- package/src/components/default-block-appender/style.native.scss +0 -18
- package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
- package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
- package/src/components/floating-toolbar/index.native.js +0 -141
- package/src/components/floating-toolbar/styles.native.scss +0 -43
- package/src/components/font-sizes/index.native.js +0 -7
- package/src/components/global-styles/color-panel.native.js +0 -207
- package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
- package/src/components/global-styles/use-global-styles-context.native.js +0 -592
- package/src/components/gradients/index.native.js +0 -2
- package/src/components/image-link-destinations/index.native.js +0 -152
- package/src/components/image-link-destinations/style.native.scss +0 -16
- package/src/components/index.native.js +0 -108
- package/src/components/inner-blocks/constants.native.js +0 -5
- package/src/components/inner-blocks/index.native.js +0 -221
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
- package/src/components/inserter/block-types-tab.native.js +0 -76
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
- package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
- package/src/components/inserter/index.native.js +0 -424
- package/src/components/inserter/menu.native.js +0 -237
- package/src/components/inserter/no-results.native.js +0 -49
- package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
- package/src/components/inserter/search-results.native.js +0 -67
- package/src/components/inserter/style.native.scss +0 -83
- package/src/components/inserter/tabs.native.js +0 -152
- package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
- package/src/components/inserter/test/fixtures/index.native.js +0 -12
- package/src/components/inserter/test/index.native.js +0 -273
- package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
- package/src/components/inserter/test/utils.native.js +0 -37
- package/src/components/inserter/utils.native.js +0 -46
- package/src/components/inserter-button/index.native.js +0 -108
- package/src/components/inserter-button/style.native.scss +0 -72
- package/src/components/inspector-controls/fill.native.js +0 -62
- package/src/components/inspector-controls/slot.native.js +0 -35
- package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
- package/src/components/line-height-control/index.native.js +0 -28
- package/src/components/media-placeholder/index.native.js +0 -258
- package/src/components/media-placeholder/styles.native.scss +0 -108
- package/src/components/media-replace-flow/index.native.js +0 -12
- package/src/components/media-upload/constants.native.js +0 -14
- package/src/components/media-upload/index.native.js +0 -356
- package/src/components/media-upload/style.native.scss +0 -4
- package/src/components/media-upload/test/index.native.js +0 -172
- package/src/components/media-upload-progress/README.md +0 -100
- package/src/components/media-upload-progress/constants.js +0 -6
- package/src/components/media-upload-progress/index.native.js +0 -233
- package/src/components/media-upload-progress/styles.native.scss +0 -15
- package/src/components/media-upload-progress/test/index.native.js +0 -220
- package/src/components/plain-text/index.native.js +0 -164
- package/src/components/plain-text/style.native.scss +0 -10
- package/src/components/provider/index.native.js +0 -32
- package/src/components/rich-text/embed-handler-picker.native.js +0 -65
- package/src/components/rich-text/file-paste-handler.native.js +0 -3
- package/src/components/rich-text/format-toolbar/index.native.js +0 -21
- package/src/components/rich-text/format-toolbar-container.native.js +0 -16
- package/src/components/rich-text/index.native.js +0 -701
- package/src/components/rich-text/input-event.native.js +0 -10
- package/src/components/rich-text/native/format-edit.js +0 -44
- package/src/components/rich-text/native/get-format-colors.native.js +0 -47
- package/src/components/rich-text/native/index.js +0 -1
- package/src/components/rich-text/native/index.native.js +0 -1389
- package/src/components/rich-text/native/style.native.scss +0 -28
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
- package/src/components/rich-text/native/test/index.native.js +0 -345
- package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
- package/src/components/rich-text/native/use-format-types.js +0 -146
- package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
- package/src/components/rich-text/shortcut.native.js +0 -10
- package/src/components/ungroup-button/README.md +0 -23
- package/src/components/ungroup-button/index.native.js +0 -77
- package/src/components/unsupported-block-details/index.native.js +0 -187
- package/src/components/unsupported-block-details/style.native.scss +0 -56
- package/src/components/url-input/index.native.js +0 -33
- package/src/components/use-block-drop-zone/index.native.js +0 -207
- package/src/components/use-on-block-drop/index.native.js +0 -115
- package/src/components/use-unsupported-block-editor/index.native.js +0 -59
- package/src/components/video-player/gridicon-play.native.js +0 -13
- package/src/components/video-player/index.native.js +0 -133
- package/src/components/video-player/styles.native.scss +0 -29
- package/src/components/warning/index.native.js +0 -64
- package/src/components/warning/style.native.scss +0 -47
- package/src/hooks/align.native.js +0 -49
- package/src/hooks/custom-class-name.native.js +0 -70
- package/src/hooks/index.native.js +0 -36
- package/src/hooks/layout.native.js +0 -23
- package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
- package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
- package/src/hooks/test/align.native.js +0 -134
- package/src/hooks/test/anchor.native.js +0 -32
- package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
- package/src/hooks/typography.native.js +0 -60
- package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
- package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
- package/src/index.native.js +0 -6
- package/src/private-apis.native.js +0 -21
- package/src/store/defaults.native.js +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Ungroup Button
|
|
2
|
-
|
|
3
|
-
The `UngroupButton` components adds an icon on the BlockControls toolbar when a group block is selected. Then, it's possible to ungroup the inner blocks. After click on the icon, it removes the group block holding the InnerBlocks components which are moved one level up in the hierarchy.
|
|
4
|
-
|
|
5
|
-
This only happens in the mobile WordPress apps.
|
|
6
|
-
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
## Development guidelines
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
Display the `UngroupButton` icon.
|
|
14
|
-
|
|
15
|
-
```jsx
|
|
16
|
-
import { UngroupButton } from '@wordpress/block-editor';
|
|
17
|
-
|
|
18
|
-
const MyUngroupButton = () => <UngroupButton />;
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Related components
|
|
22
|
-
|
|
23
|
-
Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { store as blocksStore } from '@wordpress/blocks';
|
|
5
|
-
import { ToolbarGroup, ToolbarButton } from '@wordpress/components';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
8
|
-
import { compose } from '@wordpress/compose';
|
|
9
|
-
import { ungroup } from '@wordpress/icons';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { store as blockEditorStore } from '../../store';
|
|
15
|
-
|
|
16
|
-
const noop = () => {};
|
|
17
|
-
const EMPTY_BLOCKS_LIST = [];
|
|
18
|
-
|
|
19
|
-
export function UngroupButton( { onConvertFromGroup, isUngroupable = false } ) {
|
|
20
|
-
if ( ! isUngroupable ) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return (
|
|
24
|
-
<ToolbarGroup>
|
|
25
|
-
<ToolbarButton
|
|
26
|
-
title={ __( 'Ungroup' ) }
|
|
27
|
-
icon={ ungroup }
|
|
28
|
-
onClick={ onConvertFromGroup }
|
|
29
|
-
/>
|
|
30
|
-
</ToolbarGroup>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default compose( [
|
|
35
|
-
withSelect( ( select ) => {
|
|
36
|
-
const { getSelectedBlockClientId, getBlock } =
|
|
37
|
-
select( blockEditorStore );
|
|
38
|
-
|
|
39
|
-
const { getGroupingBlockName } = select( blocksStore );
|
|
40
|
-
|
|
41
|
-
const selectedId = getSelectedBlockClientId();
|
|
42
|
-
const selectedBlock = getBlock( selectedId );
|
|
43
|
-
|
|
44
|
-
const groupingBlockName = getGroupingBlockName();
|
|
45
|
-
|
|
46
|
-
const isUngroupable =
|
|
47
|
-
selectedBlock &&
|
|
48
|
-
selectedBlock.innerBlocks &&
|
|
49
|
-
selectedBlock.innerBlocks.length > 0 &&
|
|
50
|
-
selectedBlock.name === groupingBlockName;
|
|
51
|
-
|
|
52
|
-
const innerBlocks = isUngroupable
|
|
53
|
-
? selectedBlock.innerBlocks
|
|
54
|
-
: EMPTY_BLOCKS_LIST;
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
isUngroupable,
|
|
58
|
-
clientId: selectedId,
|
|
59
|
-
innerBlocks,
|
|
60
|
-
};
|
|
61
|
-
} ),
|
|
62
|
-
withDispatch( ( dispatch, { clientId, innerBlocks, onToggle = noop } ) => {
|
|
63
|
-
const { replaceBlocks } = dispatch( blockEditorStore );
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
onConvertFromGroup() {
|
|
67
|
-
if ( ! innerBlocks.length ) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
replaceBlocks( clientId, innerBlocks );
|
|
72
|
-
|
|
73
|
-
onToggle();
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
} ),
|
|
77
|
-
] )( UngroupButton );
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View, Text } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import {
|
|
10
|
-
BottomSheet,
|
|
11
|
-
Icon as WCIcon,
|
|
12
|
-
TextControl,
|
|
13
|
-
} from '@wordpress/components';
|
|
14
|
-
import {
|
|
15
|
-
requestUnsupportedBlockFallback,
|
|
16
|
-
sendActionButtonPressedAction,
|
|
17
|
-
actionButtons,
|
|
18
|
-
} from '@wordpress/react-native-bridge';
|
|
19
|
-
import { help } from '@wordpress/icons';
|
|
20
|
-
import { __ } from '@wordpress/i18n';
|
|
21
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
22
|
-
import { getBlockType } from '@wordpress/blocks';
|
|
23
|
-
import { useCallback, useState } from '@wordpress/element';
|
|
24
|
-
import { applyFilters } from '@wordpress/hooks';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Internal dependencies
|
|
28
|
-
*/
|
|
29
|
-
import styles from './style.scss';
|
|
30
|
-
import useUnsupportedBlockEditor from '../use-unsupported-block-editor';
|
|
31
|
-
|
|
32
|
-
const EMPTY_ARRAY = [];
|
|
33
|
-
|
|
34
|
-
const UnsupportedBlockDetails = ( {
|
|
35
|
-
clientId,
|
|
36
|
-
showSheet,
|
|
37
|
-
onCloseSheet,
|
|
38
|
-
customBlockTitle = '',
|
|
39
|
-
icon,
|
|
40
|
-
title,
|
|
41
|
-
description,
|
|
42
|
-
actionButtonLabel,
|
|
43
|
-
customActions = EMPTY_ARRAY,
|
|
44
|
-
} ) => {
|
|
45
|
-
const [ sendFallbackMessage, setSendFallbackMessage ] = useState( false );
|
|
46
|
-
const [ sendButtonPressMessage, setSendButtonPressMessage ] =
|
|
47
|
-
useState( false );
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
blockName,
|
|
51
|
-
blockContent,
|
|
52
|
-
isUnsupportedBlockEditorSupported,
|
|
53
|
-
canEnableUnsupportedBlockEditor,
|
|
54
|
-
isEditableInUnsupportedBlockEditor,
|
|
55
|
-
} = useUnsupportedBlockEditor( clientId );
|
|
56
|
-
|
|
57
|
-
// Styles
|
|
58
|
-
const textStyle = usePreferredColorSchemeStyle(
|
|
59
|
-
styles[ 'unsupported-block-details__text' ],
|
|
60
|
-
styles[ 'unsupported-block-details__text--dark' ]
|
|
61
|
-
);
|
|
62
|
-
const titleStyle = usePreferredColorSchemeStyle(
|
|
63
|
-
styles[ 'unsupported-block-details__title' ],
|
|
64
|
-
styles[ 'unsupported-block-details__title--dark' ]
|
|
65
|
-
);
|
|
66
|
-
const descriptionStyle = usePreferredColorSchemeStyle(
|
|
67
|
-
styles[ 'unsupported-block-details__description' ],
|
|
68
|
-
styles[ 'unsupported-block-details__description--dark' ]
|
|
69
|
-
);
|
|
70
|
-
const iconStyle = usePreferredColorSchemeStyle(
|
|
71
|
-
styles[ 'unsupported-block-details__icon' ],
|
|
72
|
-
styles[ 'unsupported-block-details__icon--dark' ]
|
|
73
|
-
);
|
|
74
|
-
const actionButtonStyle = usePreferredColorSchemeStyle(
|
|
75
|
-
styles[ 'unsupported-block-details__action-button' ],
|
|
76
|
-
styles[ 'unsupported-block-details__action-button--dark' ]
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const blockTitle =
|
|
80
|
-
customBlockTitle || getBlockType( blockName )?.title || blockName;
|
|
81
|
-
|
|
82
|
-
const requestFallback = useCallback( () => {
|
|
83
|
-
if (
|
|
84
|
-
canEnableUnsupportedBlockEditor &&
|
|
85
|
-
isUnsupportedBlockEditorSupported === false
|
|
86
|
-
) {
|
|
87
|
-
onCloseSheet();
|
|
88
|
-
setSendButtonPressMessage( true );
|
|
89
|
-
} else {
|
|
90
|
-
onCloseSheet();
|
|
91
|
-
setSendFallbackMessage( true );
|
|
92
|
-
}
|
|
93
|
-
}, [
|
|
94
|
-
canEnableUnsupportedBlockEditor,
|
|
95
|
-
isUnsupportedBlockEditorSupported,
|
|
96
|
-
onCloseSheet,
|
|
97
|
-
] );
|
|
98
|
-
|
|
99
|
-
// The description can include extra notes via WP hooks.
|
|
100
|
-
const descriptionWithNotes = applyFilters(
|
|
101
|
-
'native.unsupported_block_details_extra_note',
|
|
102
|
-
description,
|
|
103
|
-
blockName
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
const webEditorDefaultLabel = applyFilters(
|
|
107
|
-
'native.unsupported_block_details_web_editor_action',
|
|
108
|
-
__( 'Edit using web editor' )
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const canUseWebEditor =
|
|
112
|
-
( isUnsupportedBlockEditorSupported ||
|
|
113
|
-
canEnableUnsupportedBlockEditor ) &&
|
|
114
|
-
isEditableInUnsupportedBlockEditor;
|
|
115
|
-
const actions = [
|
|
116
|
-
...[
|
|
117
|
-
canUseWebEditor && {
|
|
118
|
-
label: actionButtonLabel || webEditorDefaultLabel,
|
|
119
|
-
onPress: requestFallback,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
...customActions,
|
|
123
|
-
].filter( Boolean );
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<BottomSheet
|
|
127
|
-
isVisible={ showSheet }
|
|
128
|
-
hideHeader
|
|
129
|
-
onClose={ onCloseSheet }
|
|
130
|
-
onModalHide={ () => {
|
|
131
|
-
if ( sendFallbackMessage ) {
|
|
132
|
-
// On iOS, onModalHide is called when the controller is still part of the hierarchy.
|
|
133
|
-
// A small delay will ensure that the controller has already been removed.
|
|
134
|
-
this.timeout = setTimeout( () => {
|
|
135
|
-
// For the Classic block, the content is kept in the `content` attribute.
|
|
136
|
-
requestUnsupportedBlockFallback(
|
|
137
|
-
blockContent,
|
|
138
|
-
clientId,
|
|
139
|
-
blockName,
|
|
140
|
-
blockTitle
|
|
141
|
-
);
|
|
142
|
-
}, 100 );
|
|
143
|
-
setSendFallbackMessage( false );
|
|
144
|
-
} else if ( sendButtonPressMessage ) {
|
|
145
|
-
this.timeout = setTimeout( () => {
|
|
146
|
-
sendActionButtonPressedAction(
|
|
147
|
-
actionButtons.missingBlockAlertActionButton
|
|
148
|
-
);
|
|
149
|
-
}, 100 );
|
|
150
|
-
setSendButtonPressMessage( false );
|
|
151
|
-
}
|
|
152
|
-
} }
|
|
153
|
-
>
|
|
154
|
-
<View style={ styles[ 'unsupported-block-details__container' ] }>
|
|
155
|
-
<WCIcon
|
|
156
|
-
icon={ icon || help }
|
|
157
|
-
color={ iconStyle.color }
|
|
158
|
-
size={ iconStyle.size }
|
|
159
|
-
/>
|
|
160
|
-
<Text style={ [ textStyle, titleStyle ] }>{ title }</Text>
|
|
161
|
-
{ isEditableInUnsupportedBlockEditor &&
|
|
162
|
-
descriptionWithNotes && (
|
|
163
|
-
<Text style={ [ textStyle, descriptionStyle ] }>
|
|
164
|
-
{ descriptionWithNotes }
|
|
165
|
-
</Text>
|
|
166
|
-
) }
|
|
167
|
-
</View>
|
|
168
|
-
{ actions.map( ( { label, onPress }, index ) => (
|
|
169
|
-
<TextControl
|
|
170
|
-
key={ `${ label } - ${ index }` }
|
|
171
|
-
label={ label }
|
|
172
|
-
separatorType="topFullWidth"
|
|
173
|
-
onPress={ onPress }
|
|
174
|
-
labelStyle={ actionButtonStyle }
|
|
175
|
-
/>
|
|
176
|
-
) ) }
|
|
177
|
-
<TextControl
|
|
178
|
-
label={ __( 'Dismiss' ) }
|
|
179
|
-
separatorType="topFullWidth"
|
|
180
|
-
onPress={ onCloseSheet }
|
|
181
|
-
labelStyle={ actionButtonStyle }
|
|
182
|
-
/>
|
|
183
|
-
</BottomSheet>
|
|
184
|
-
);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export default UnsupportedBlockDetails;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
.unsupported-block-details__container {
|
|
2
|
-
flex-direction: column;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: flex-end;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.unsupported-block-details__icon {
|
|
8
|
-
size: 36;
|
|
9
|
-
height: 36;
|
|
10
|
-
padding-top: 8;
|
|
11
|
-
padding-bottom: 8;
|
|
12
|
-
color: $gray;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.unsupported-block-details__icon--dark {
|
|
16
|
-
color: $gray-20;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.unsupported-block-details__text {
|
|
20
|
-
text-align: center;
|
|
21
|
-
color: $gray-dark;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.unsupported-block-details__text--dark {
|
|
25
|
-
color: $white;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.unsupported-block-details__title {
|
|
29
|
-
padding-top: 8;
|
|
30
|
-
padding-bottom: 12;
|
|
31
|
-
font-size: 20;
|
|
32
|
-
font-weight: bold;
|
|
33
|
-
color: $gray-dark;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.unsupported-block-details__title--dark {
|
|
37
|
-
color: $white;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.unsupported-block-details__description {
|
|
41
|
-
padding-bottom: 24;
|
|
42
|
-
font-size: 16;
|
|
43
|
-
color: $gray-darken-20;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.unsupported-block-details__description--dark {
|
|
47
|
-
color: $gray-20;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.unsupported-block-details__action-button {
|
|
51
|
-
color: $blue-50;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.unsupported-block-details__action-button--dark {
|
|
55
|
-
color: $blue-30;
|
|
56
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { TextInput } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
|
|
11
|
-
export default function URLInput( {
|
|
12
|
-
value = '',
|
|
13
|
-
autoFocus = true,
|
|
14
|
-
onChange,
|
|
15
|
-
...extraProps
|
|
16
|
-
} ) {
|
|
17
|
-
/* eslint-disable jsx-a11y/no-autofocus */
|
|
18
|
-
return (
|
|
19
|
-
<TextInput
|
|
20
|
-
autoFocus={ autoFocus }
|
|
21
|
-
editable
|
|
22
|
-
selectTextOnFocus
|
|
23
|
-
autoCapitalize="none"
|
|
24
|
-
autoCorrect={ false }
|
|
25
|
-
textContentType="URL"
|
|
26
|
-
value={ value }
|
|
27
|
-
onChangeText={ onChange }
|
|
28
|
-
placeholder={ __( 'Paste URL' ) }
|
|
29
|
-
{ ...extraProps }
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
/* eslint-enable jsx-a11y/no-autofocus */
|
|
33
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
runOnJS,
|
|
6
|
-
useDerivedValue,
|
|
7
|
-
useSharedValue,
|
|
8
|
-
} from 'react-native-reanimated';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { useSelect } from '@wordpress/data';
|
|
14
|
-
import { useCallback } from '@wordpress/element';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { store as blockEditorStore } from '../../store';
|
|
20
|
-
import { useBlockListContext } from '../block-list/block-list-context';
|
|
21
|
-
import { getDistanceToNearestEdge } from '../../utils/math';
|
|
22
|
-
import useOnBlockDrop from '../use-on-block-drop';
|
|
23
|
-
|
|
24
|
-
const UPDATE_TARGET_BLOCK_INDEX_THRESHOLD = 20; // In pixels
|
|
25
|
-
|
|
26
|
-
/** @typedef {import('../../utils/math').WPPoint} WPPoint */
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The orientation of a block list.
|
|
30
|
-
*
|
|
31
|
-
* @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Given a list of blocks layouts finds the index that a block should be dropped at.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} blocksLayouts Blocks layouts object.
|
|
38
|
-
* @param {WPPoint} position The position of the item being dragged.
|
|
39
|
-
* @param {WPBlockListOrientation} orientation The orientation of a block list.
|
|
40
|
-
* @param {boolean} isRTL Check if current locale is RTL.
|
|
41
|
-
*
|
|
42
|
-
* @return {number|undefined} The block index that's closest to the drag position.
|
|
43
|
-
*/
|
|
44
|
-
export function getNearestBlockIndex(
|
|
45
|
-
blocksLayouts,
|
|
46
|
-
position,
|
|
47
|
-
orientation,
|
|
48
|
-
isRTL
|
|
49
|
-
) {
|
|
50
|
-
const allowedEdges =
|
|
51
|
-
orientation === 'horizontal'
|
|
52
|
-
? [ 'left', 'right' ]
|
|
53
|
-
: [ 'top', 'bottom' ];
|
|
54
|
-
|
|
55
|
-
const isRightToLeft = isRTL;
|
|
56
|
-
|
|
57
|
-
let candidateIndex;
|
|
58
|
-
let candidateDistance;
|
|
59
|
-
|
|
60
|
-
// Only enabled for root level blocks.
|
|
61
|
-
blocksLayouts.forEach( ( element, index ) => {
|
|
62
|
-
const { x, y, width, height } = element;
|
|
63
|
-
const rect = {
|
|
64
|
-
x: element.x,
|
|
65
|
-
y: element.y,
|
|
66
|
-
top: y,
|
|
67
|
-
right: x + width,
|
|
68
|
-
bottom: y + height,
|
|
69
|
-
left: x,
|
|
70
|
-
width,
|
|
71
|
-
height,
|
|
72
|
-
};
|
|
73
|
-
const [ distance, edge ] = getDistanceToNearestEdge(
|
|
74
|
-
position,
|
|
75
|
-
rect,
|
|
76
|
-
allowedEdges
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
if ( candidateDistance === undefined || distance < candidateDistance ) {
|
|
80
|
-
// If the user is dropping to the trailing edge of the block
|
|
81
|
-
// add 1 to the index to represent dragging after.
|
|
82
|
-
// Take RTL languages into account where the left edge is
|
|
83
|
-
// the trailing edge.
|
|
84
|
-
const isTrailingEdge =
|
|
85
|
-
edge === 'bottom' ||
|
|
86
|
-
( ! isRightToLeft && edge === 'right' ) ||
|
|
87
|
-
( isRightToLeft && edge === 'left' );
|
|
88
|
-
const offset = isTrailingEdge ? 1 : 0;
|
|
89
|
-
|
|
90
|
-
// Update the currently known best candidate.
|
|
91
|
-
candidateDistance = distance;
|
|
92
|
-
candidateIndex = index + offset;
|
|
93
|
-
}
|
|
94
|
-
} );
|
|
95
|
-
return candidateIndex;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @typedef {Object} WPBlockDropZoneConfig
|
|
100
|
-
* @property {string} rootClientId The root client id for the block list.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* A React hook that can be used to make a block list handle drag and drop.
|
|
105
|
-
*
|
|
106
|
-
* @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
|
|
107
|
-
*
|
|
108
|
-
* @return {Object} An object that contains `targetBlockIndex` and the event
|
|
109
|
-
* handlers `onBlockDragOver`, `onBlockDragEnd` and `onBlockDrop`.
|
|
110
|
-
*/
|
|
111
|
-
export default function useBlockDropZone( {
|
|
112
|
-
// An undefined value represents a top-level block. Default to an empty
|
|
113
|
-
// string for this so that `targetRootClientId` can be easily compared to
|
|
114
|
-
// values returned by the `getRootBlockClientId` selector, which also uses
|
|
115
|
-
// an empty string to represent top-level blocks.
|
|
116
|
-
rootClientId: targetRootClientId = '',
|
|
117
|
-
} = {} ) {
|
|
118
|
-
const targetBlockIndex = useSharedValue( null );
|
|
119
|
-
const dragPosition = {
|
|
120
|
-
x: useSharedValue( 0 ),
|
|
121
|
-
y: useSharedValue( 0 ),
|
|
122
|
-
};
|
|
123
|
-
const prevDragPosition = {
|
|
124
|
-
x: useSharedValue( 0 ),
|
|
125
|
-
y: useSharedValue( 0 ),
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const { getBlockListSettings, getSettings } = useSelect( blockEditorStore );
|
|
129
|
-
const { blocksLayouts, getBlockLayoutsOrderedByYCoord } =
|
|
130
|
-
useBlockListContext();
|
|
131
|
-
|
|
132
|
-
const getSortedBlocksLayouts = useCallback( () => {
|
|
133
|
-
return getBlockLayoutsOrderedByYCoord( blocksLayouts.current );
|
|
134
|
-
// We use the value of `blocksLayouts` as the dependency.
|
|
135
|
-
}, [ blocksLayouts.current ] );
|
|
136
|
-
|
|
137
|
-
const isRTL = getSettings().isRTL;
|
|
138
|
-
|
|
139
|
-
const onBlockDrop = useOnBlockDrop();
|
|
140
|
-
|
|
141
|
-
const updateTargetBlockIndex = useCallback(
|
|
142
|
-
( event ) => {
|
|
143
|
-
const sortedBlockLayouts = getSortedBlocksLayouts();
|
|
144
|
-
|
|
145
|
-
const targetIndex = getNearestBlockIndex(
|
|
146
|
-
sortedBlockLayouts,
|
|
147
|
-
{ x: event.x, y: event.y },
|
|
148
|
-
getBlockListSettings( targetRootClientId )?.orientation,
|
|
149
|
-
isRTL
|
|
150
|
-
);
|
|
151
|
-
if ( targetIndex !== null ) {
|
|
152
|
-
targetBlockIndex.value = targetIndex ?? 0;
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
[
|
|
156
|
-
getSortedBlocksLayouts,
|
|
157
|
-
getBlockListSettings,
|
|
158
|
-
targetRootClientId,
|
|
159
|
-
isRTL,
|
|
160
|
-
targetBlockIndex,
|
|
161
|
-
]
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
useDerivedValue( () => {
|
|
165
|
-
const x = dragPosition.x.value;
|
|
166
|
-
const y = dragPosition.y.value;
|
|
167
|
-
const prevX = prevDragPosition.x.value;
|
|
168
|
-
const prevY = prevDragPosition.y.value;
|
|
169
|
-
// `updateTargetBlockIndex` performs expensive calculations, so we throttle
|
|
170
|
-
// the call using a offset threshold based on the dragging position.
|
|
171
|
-
if (
|
|
172
|
-
Math.abs( x - prevX ) >= UPDATE_TARGET_BLOCK_INDEX_THRESHOLD ||
|
|
173
|
-
Math.abs( y - prevY ) >= UPDATE_TARGET_BLOCK_INDEX_THRESHOLD
|
|
174
|
-
) {
|
|
175
|
-
runOnJS( updateTargetBlockIndex )( { x, y } );
|
|
176
|
-
prevDragPosition.x.value = x;
|
|
177
|
-
prevDragPosition.y.value = y;
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
return false;
|
|
181
|
-
} );
|
|
182
|
-
|
|
183
|
-
return {
|
|
184
|
-
onBlockDragOver( { x, y } ) {
|
|
185
|
-
dragPosition.x.value = x;
|
|
186
|
-
dragPosition.y.value = y;
|
|
187
|
-
},
|
|
188
|
-
onBlockDragOverWorklet( { x, y } ) {
|
|
189
|
-
'worklet';
|
|
190
|
-
dragPosition.x.value = x;
|
|
191
|
-
dragPosition.y.value = y;
|
|
192
|
-
},
|
|
193
|
-
onBlockDragEnd() {
|
|
194
|
-
targetBlockIndex.value = null;
|
|
195
|
-
},
|
|
196
|
-
onBlockDrop: ( event ) => {
|
|
197
|
-
if ( targetBlockIndex.value !== null ) {
|
|
198
|
-
onBlockDrop( {
|
|
199
|
-
...event,
|
|
200
|
-
targetRootClientId,
|
|
201
|
-
targetBlockIndex: targetBlockIndex.value,
|
|
202
|
-
} );
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
targetBlockIndex,
|
|
206
|
-
};
|
|
207
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { cloneBlock } from '@wordpress/blocks';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { store as blockEditorStore } from '../../store';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A function that returns an event handler function for block drop events.
|
|
14
|
-
*
|
|
15
|
-
* @param {Function} getBlockIndex A function that gets the index of a block.
|
|
16
|
-
* @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks.
|
|
17
|
-
* @param {Function} moveBlocksToPosition A function that moves blocks.
|
|
18
|
-
* @param {Function} insertBlocks A function that inserts blocks.
|
|
19
|
-
* @param {Function} clearSelectedBlock A function that clears block selection.
|
|
20
|
-
* @return {Function} The event handler for a block drop event.
|
|
21
|
-
*/
|
|
22
|
-
export function onBlockDrop(
|
|
23
|
-
getBlockIndex,
|
|
24
|
-
getClientIdsOfDescendants,
|
|
25
|
-
moveBlocksToPosition,
|
|
26
|
-
insertBlocks,
|
|
27
|
-
clearSelectedBlock
|
|
28
|
-
) {
|
|
29
|
-
return ( {
|
|
30
|
-
blocks,
|
|
31
|
-
srcClientIds: sourceClientIds,
|
|
32
|
-
srcRootClientId: sourceRootClientId,
|
|
33
|
-
targetBlockIndex,
|
|
34
|
-
targetRootClientId,
|
|
35
|
-
type: dropType,
|
|
36
|
-
} ) => {
|
|
37
|
-
// If the user is inserting a block.
|
|
38
|
-
if ( dropType === 'inserter' ) {
|
|
39
|
-
clearSelectedBlock();
|
|
40
|
-
const blocksToInsert = blocks.map( ( block ) =>
|
|
41
|
-
cloneBlock( block )
|
|
42
|
-
);
|
|
43
|
-
insertBlocks(
|
|
44
|
-
blocksToInsert,
|
|
45
|
-
targetBlockIndex,
|
|
46
|
-
targetRootClientId,
|
|
47
|
-
true,
|
|
48
|
-
null
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// If the user is moving a block.
|
|
53
|
-
if ( dropType === 'block' ) {
|
|
54
|
-
const sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );
|
|
55
|
-
|
|
56
|
-
// If the user is dropping to the same position, return early.
|
|
57
|
-
if (
|
|
58
|
-
sourceRootClientId === targetRootClientId &&
|
|
59
|
-
sourceBlockIndex === targetBlockIndex
|
|
60
|
-
) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// If the user is attempting to drop a block within its own
|
|
65
|
-
// nested blocks, return early as this would create infinite
|
|
66
|
-
// recursion.
|
|
67
|
-
if (
|
|
68
|
-
sourceClientIds.includes( targetRootClientId ) ||
|
|
69
|
-
getClientIdsOfDescendants( sourceClientIds ).some(
|
|
70
|
-
( id ) => id === targetRootClientId
|
|
71
|
-
)
|
|
72
|
-
) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const isAtSameLevel = sourceRootClientId === targetRootClientId;
|
|
77
|
-
const draggedBlockCount = sourceClientIds.length;
|
|
78
|
-
|
|
79
|
-
// If the block is kept at the same level and moved downwards,
|
|
80
|
-
// subtract to take into account that the blocks being dragged
|
|
81
|
-
// were removed from the block list above the insertion point.
|
|
82
|
-
const insertIndex =
|
|
83
|
-
isAtSameLevel && sourceBlockIndex < targetBlockIndex
|
|
84
|
-
? targetBlockIndex - draggedBlockCount
|
|
85
|
-
: targetBlockIndex;
|
|
86
|
-
|
|
87
|
-
moveBlocksToPosition(
|
|
88
|
-
sourceClientIds,
|
|
89
|
-
sourceRootClientId,
|
|
90
|
-
targetRootClientId,
|
|
91
|
-
insertIndex
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* A React hook for handling block drop events.
|
|
99
|
-
*
|
|
100
|
-
* @return {Function} The event handler for a block drop event.
|
|
101
|
-
*/
|
|
102
|
-
export default function useOnBlockDrop() {
|
|
103
|
-
const { getBlockIndex, getClientIdsOfDescendants } =
|
|
104
|
-
useSelect( blockEditorStore );
|
|
105
|
-
const { insertBlocks, moveBlocksToPosition, clearSelectedBlock } =
|
|
106
|
-
useDispatch( blockEditorStore );
|
|
107
|
-
|
|
108
|
-
return onBlockDrop(
|
|
109
|
-
getBlockIndex,
|
|
110
|
-
getClientIdsOfDescendants,
|
|
111
|
-
moveBlocksToPosition,
|
|
112
|
-
insertBlocks,
|
|
113
|
-
clearSelectedBlock
|
|
114
|
-
);
|
|
115
|
-
}
|