@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,114 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
background-color: $light-ultra-dim;
|
|
3
|
-
border-radius: 4px;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.containerDark {
|
|
9
|
-
background-color: $dark-ultra-dim;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@mixin circle($width) {
|
|
13
|
-
width: $width;
|
|
14
|
-
height: $width;
|
|
15
|
-
border-radius: $width*0.5;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iconContainer {
|
|
19
|
-
background-color: $light-ultra-dim;
|
|
20
|
-
margin: 12px 16px;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
@include circle(37px);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.iconContainerDark {
|
|
27
|
-
background-color: $dark-ultra-dim;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icon {
|
|
31
|
-
color: $light-secondary;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.iconDark {
|
|
35
|
-
color: $dark-secondary;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.iconDisabled {
|
|
39
|
-
color: $light-quaternary;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.iconDisabledDark {
|
|
43
|
-
color: $dark-quaternary;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.disabledIcon {
|
|
47
|
-
color: $black;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.titleContainer {
|
|
51
|
-
padding: 12px 16px 12px 0;
|
|
52
|
-
flex: 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.titleContainerIOS {
|
|
56
|
-
margin-top: -1px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.titleContainerAndroid {
|
|
60
|
-
margin-top: -2px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.title {
|
|
64
|
-
font-size: 17;
|
|
65
|
-
margin-bottom: 1px;
|
|
66
|
-
color: $light-primary;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.titleDark {
|
|
70
|
-
color: $dark-primary;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.subtitleContainer {
|
|
74
|
-
flex-direction: row;
|
|
75
|
-
align-items: center;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.subtitle {
|
|
79
|
-
font-size: 12;
|
|
80
|
-
color: $light-secondary;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.subtitleDark {
|
|
84
|
-
color: $dark-secondary;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.buttonBackground {
|
|
88
|
-
margin: 12px 16px;
|
|
89
|
-
padding: 8px 16px;
|
|
90
|
-
border-radius: 500px;
|
|
91
|
-
background-color: $light-ultra-dim;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.buttonBackgroundDark {
|
|
95
|
-
background-color: $dark-ultra-dim;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.buttonText {
|
|
99
|
-
font-size: 14;
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
color: $blue-wordpress;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.errorIcon {
|
|
105
|
-
margin-right: 4px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.uploadFailed {
|
|
109
|
-
color: $red-50;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.uploadFailedDark {
|
|
113
|
-
color: $red-30;
|
|
114
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { parseAudioUrl } from '../audio-url-parser.native';
|
|
5
|
-
|
|
6
|
-
const supportedAudioUrlsWithExtensions = [
|
|
7
|
-
'https://www.mp3.com/file.mp3?key1=value1&key2=value2#anchorforsomereason',
|
|
8
|
-
'https://www.mp3.com/file.mp3?key1=value1&key2=value2',
|
|
9
|
-
'https://www.mp3.com/file.mp3',
|
|
10
|
-
`https://www.mp3.com/folder/file.mp3`,
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const supportedAudioUrlsWithoutExtensions = [
|
|
14
|
-
'https://www.mp3.com/file?key1=value1&key2=value2#anchorforsomereason',
|
|
15
|
-
'https://www.mp3.com/file?key1=value1&key2=value2',
|
|
16
|
-
'https://www.mp3.com/file',
|
|
17
|
-
'https://www.mp3.com/folder/file',
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const supportedLocalAudioUrls = [
|
|
21
|
-
'file.mp3',
|
|
22
|
-
'file:///storage/emulated/0/Download/file.mp3',
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
describe( 'supportedAudioUrlsWithExtensions', () => {
|
|
26
|
-
supportedAudioUrlsWithExtensions.forEach( ( url ) => {
|
|
27
|
-
it( `supports ${ url }`, () => {
|
|
28
|
-
const { title, extension } = parseAudioUrl( url );
|
|
29
|
-
expect( title ).toBe( 'file' );
|
|
30
|
-
expect( extension ).toBe( 'MP3 ' );
|
|
31
|
-
} );
|
|
32
|
-
} );
|
|
33
|
-
} );
|
|
34
|
-
|
|
35
|
-
describe( 'supportedAudioUrlsWithoutExtensions', () => {
|
|
36
|
-
supportedAudioUrlsWithoutExtensions.forEach( ( url ) => {
|
|
37
|
-
it( `supports ${ url }`, () => {
|
|
38
|
-
const { title, extension } = parseAudioUrl( url );
|
|
39
|
-
expect( title ).toBe( 'file' );
|
|
40
|
-
expect( extension ).toBe( '' );
|
|
41
|
-
} );
|
|
42
|
-
} );
|
|
43
|
-
} );
|
|
44
|
-
|
|
45
|
-
describe( 'supportedLocalAudioUrls', () => {
|
|
46
|
-
supportedLocalAudioUrls.forEach( ( url ) => {
|
|
47
|
-
it( `supports ${ url }`, () => {
|
|
48
|
-
const { title, extension } = parseAudioUrl( url );
|
|
49
|
-
expect( title ).toBe( 'file' );
|
|
50
|
-
expect( extension ).toBe( 'MP3 ' );
|
|
51
|
-
} );
|
|
52
|
-
} );
|
|
53
|
-
} );
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { render, fireEvent } from 'test/helpers';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import BlockAlignmentUI from '../ui';
|
|
10
|
-
|
|
11
|
-
it( 'should call onChange with undefined when the control is already active', () => {
|
|
12
|
-
const onChangeMock = jest.fn();
|
|
13
|
-
const screen = render(
|
|
14
|
-
<BlockAlignmentUI value="right" onChange={ onChangeMock } />
|
|
15
|
-
);
|
|
16
|
-
const alignButton = screen.getByLabelText( 'Align' );
|
|
17
|
-
fireEvent.press( alignButton );
|
|
18
|
-
const rightAlignmentButton = screen.getByLabelText( 'Align right' );
|
|
19
|
-
fireEvent.press( rightAlignmentButton );
|
|
20
|
-
|
|
21
|
-
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
22
|
-
expect( onChangeMock ).toHaveBeenCalledWith( undefined );
|
|
23
|
-
} );
|
|
24
|
-
|
|
25
|
-
it( 'should call onChange with alignment value when the control is inactive', () => {
|
|
26
|
-
const onChangeMock = jest.fn();
|
|
27
|
-
const screen = render(
|
|
28
|
-
<BlockAlignmentUI value="left" onChange={ onChangeMock } />
|
|
29
|
-
);
|
|
30
|
-
const alignButton = screen.getByLabelText( 'Align' );
|
|
31
|
-
fireEvent.press( alignButton );
|
|
32
|
-
const centerAlignmentButton = screen.getByLabelText( 'Align center' );
|
|
33
|
-
fireEvent.press( centerAlignmentButton );
|
|
34
|
-
|
|
35
|
-
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
36
|
-
expect( onChangeMock ).toHaveBeenCalledWith( 'center' );
|
|
37
|
-
} );
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
6
|
-
ToolbarDropdownMenu,
|
|
7
|
-
ToolbarGroup,
|
|
8
|
-
BottomSheetSelectControl,
|
|
9
|
-
} from '@wordpress/components';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import useAvailableAlignments from './use-available-alignments';
|
|
15
|
-
import {
|
|
16
|
-
BLOCK_ALIGNMENTS_CONTROLS,
|
|
17
|
-
DEFAULT_CONTROL,
|
|
18
|
-
POPOVER_PROPS,
|
|
19
|
-
} from './constants';
|
|
20
|
-
|
|
21
|
-
function BlockAlignmentUI( {
|
|
22
|
-
value,
|
|
23
|
-
onChange,
|
|
24
|
-
controls,
|
|
25
|
-
isToolbar,
|
|
26
|
-
isCollapsed = true,
|
|
27
|
-
isBottomSheetControl = false,
|
|
28
|
-
} ) {
|
|
29
|
-
const enabledControls = useAvailableAlignments( controls );
|
|
30
|
-
const hasEnabledControls = !! enabledControls.length;
|
|
31
|
-
|
|
32
|
-
if ( ! hasEnabledControls ) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function onChangeAlignment( align ) {
|
|
37
|
-
onChange( [ value, 'none' ].includes( align ) ? undefined : align );
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[ value ];
|
|
41
|
-
const defaultAlignmentControl =
|
|
42
|
-
BLOCK_ALIGNMENTS_CONTROLS[ DEFAULT_CONTROL ];
|
|
43
|
-
|
|
44
|
-
const toolbarUIComponent = isToolbar ? ToolbarGroup : ToolbarDropdownMenu;
|
|
45
|
-
const UIComponent = isBottomSheetControl
|
|
46
|
-
? BottomSheetSelectControl
|
|
47
|
-
: toolbarUIComponent;
|
|
48
|
-
|
|
49
|
-
const commonProps = {
|
|
50
|
-
label: __( 'Align' ),
|
|
51
|
-
};
|
|
52
|
-
const extraProps = isBottomSheetControl
|
|
53
|
-
? {
|
|
54
|
-
options: enabledControls.map( ( { name: controlName } ) => {
|
|
55
|
-
const control = BLOCK_ALIGNMENTS_CONTROLS[ controlName ];
|
|
56
|
-
return {
|
|
57
|
-
value: controlName,
|
|
58
|
-
label: control.title,
|
|
59
|
-
icon: control.icon,
|
|
60
|
-
};
|
|
61
|
-
} ),
|
|
62
|
-
value: activeAlignmentControl ? value : 'none',
|
|
63
|
-
onChange: ( align ) => onChangeAlignment( align ),
|
|
64
|
-
}
|
|
65
|
-
: {
|
|
66
|
-
icon: activeAlignmentControl
|
|
67
|
-
? activeAlignmentControl.icon
|
|
68
|
-
: defaultAlignmentControl.icon,
|
|
69
|
-
isCollapsed: isToolbar ? isCollapsed : undefined,
|
|
70
|
-
controls: enabledControls.map( ( { name: controlName } ) => {
|
|
71
|
-
return {
|
|
72
|
-
...BLOCK_ALIGNMENTS_CONTROLS[ controlName ],
|
|
73
|
-
isActive:
|
|
74
|
-
value === controlName ||
|
|
75
|
-
( ! value && controlName === 'none' ),
|
|
76
|
-
onClick: () => onChangeAlignment( controlName ),
|
|
77
|
-
};
|
|
78
|
-
} ),
|
|
79
|
-
popoverProps: POPOVER_PROPS,
|
|
80
|
-
toggleProps: { description: __( 'Change alignment' ) },
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return <UIComponent { ...commonProps } { ...extraProps } />;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default BlockAlignmentUI;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
## Block Caption
|
|
2
|
-
|
|
3
|
-
The `BlockCaption` component renders block-level UI for adding and editing captions. It wraps logic around the more generic `Caption` component to provide an editable caption field that is designed specifically for block-level use.
|
|
4
|
-
|
|
5
|
-
`BlockCaption` is used in several native blocks, including `Video`, `Image`, `Audio`, etc.
|
|
6
|
-
|
|
7
|
-
## Development guidelines
|
|
8
|
-
|
|
9
|
-
### Usage
|
|
10
|
-
|
|
11
|
-
Renders an editable caption field designed specifically for block-level use.
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
import { BlockCaption, RichText } from '@wordpress/block-editor';
|
|
15
|
-
|
|
16
|
-
const MyBlockCaption = (
|
|
17
|
-
clientId,
|
|
18
|
-
isCaptionSelected,
|
|
19
|
-
onFocusCaption,
|
|
20
|
-
onBlur,
|
|
21
|
-
insertBlocksAfter
|
|
22
|
-
) => (
|
|
23
|
-
<BlockCaption
|
|
24
|
-
clientId={ clientId }
|
|
25
|
-
accessible={ true }
|
|
26
|
-
accessibilityLabelCreator={ ( caption ) =>
|
|
27
|
-
RichText.isEmpty( caption )
|
|
28
|
-
? /* translators: accessibility text. Empty caption. */
|
|
29
|
-
'Caption. Empty'
|
|
30
|
-
: sprintf(
|
|
31
|
-
/* translators: accessibility text. %s: caption. */
|
|
32
|
-
__( 'Caption. %s' ),
|
|
33
|
-
caption
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
isSelected={ isCaptionSelected }
|
|
37
|
-
onFocus={ onFocusCaption }
|
|
38
|
-
onBlur={ onBlur }
|
|
39
|
-
insertBlocksAfter={ insertBlocksAfter }
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Props
|
|
45
|
-
|
|
46
|
-
The `clientId` prop is the only required prop.
|
|
47
|
-
|
|
48
|
-
The `onBlur`, `onFocus`, `isSelected`, and `insertBlocksAfter` props are all passed directly to the `Caption` component, which then passes them to the inner `RichText` component. ([See detailed info about the RichText component's props](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md)). These props are not strictly required, but necessary for many implementations of the component to function as expected.
|
|
49
|
-
|
|
50
|
-
The `accessible` prop is `false` by default and must be set to `true` in order to set an accessibility label via the `accessibilityLabelCreator` prop.
|
|
51
|
-
|
|
52
|
-
### `clientId`
|
|
53
|
-
|
|
54
|
-
- **Type:** `String`
|
|
55
|
-
- **Required:** `Yes`
|
|
56
|
-
|
|
57
|
-
The client ID of the block that the caption is associated with. This is prop is required in order for the component to perform key functionality, including retrieving the current caption from the block attributes.
|
|
58
|
-
|
|
59
|
-
### `accessible`
|
|
60
|
-
|
|
61
|
-
- **Type:** `Boolean`
|
|
62
|
-
- **Default:** `false`
|
|
63
|
-
- **Required:** `No`
|
|
64
|
-
|
|
65
|
-
Boolean to indicate whether component is an accessibility element. When set to true, the component and all of its children will be treated as a single accessible element. Refer to [the relevant React Native documentation](https://reactnative.dev/docs/accessibility#accessible) for the most up-to-date information on this prop.
|
|
66
|
-
|
|
67
|
-
### `accessibilityLabelCreator`
|
|
68
|
-
|
|
69
|
-
- **Type:** `Function`
|
|
70
|
-
- **Required:** `No`
|
|
71
|
-
|
|
72
|
-
Function that returns an accessibility label, which screen readers will use for the component. The `accessible` prop must be set to `true` in order for this prop to have any effect.
|
|
73
|
-
|
|
74
|
-
### `onBlur`
|
|
75
|
-
|
|
76
|
-
- **Type:** `Function`
|
|
77
|
-
- **Required:** `No`
|
|
78
|
-
|
|
79
|
-
Handler for `onBlur` events, called when the component loses focus. Although not required, it's highly recommended to pass down the component's `onBlur` function to ensure that loss of focus is always handled correctly.
|
|
80
|
-
|
|
81
|
-
### `onFocus`
|
|
82
|
-
|
|
83
|
-
- **Type:** `Function`
|
|
84
|
-
- **Required:** `No`
|
|
85
|
-
|
|
86
|
-
Handler for `onFocus` events, called when the component is brought into focus. Similar to `onBlur`, it's not required but recommended. Passing down this prop helps to ensure focus is always handled as expected on the native side.
|
|
87
|
-
|
|
88
|
-
### `isSelected`
|
|
89
|
-
|
|
90
|
-
- **Type:** `Boolean`
|
|
91
|
-
- **Required:** `No`
|
|
92
|
-
|
|
93
|
-
Boolean that indicates whether the caption is currently selected. This is used by the child `RichText` component to determine whether to display formatting controls.
|
|
94
|
-
|
|
95
|
-
### `insertBlocksAfter`
|
|
96
|
-
|
|
97
|
-
- **Type:** `Function`
|
|
98
|
-
- **Required:** `No`
|
|
99
|
-
|
|
100
|
-
Function to handle how blocks are inserted after pressing enter at the end of the component.
|
|
101
|
-
|
|
102
|
-
## Related components
|
|
103
|
-
|
|
104
|
-
`BlockCaption` passes props directly to the [`Caption`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/caption) component. In turn, the `Caption` component uses the [`RichText`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/) component. It is recommended to refer to each of those components' documentation for more information on their props and usage.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Caption, RichText } from '@wordpress/block-editor';
|
|
10
|
-
import { compose } from '@wordpress/compose';
|
|
11
|
-
import { withDispatch, withSelect } from '@wordpress/data';
|
|
12
|
-
import { hasBlockSupport } from '@wordpress/blocks';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import styles from './styles.scss';
|
|
18
|
-
import { store as blockEditorStore } from '../../store';
|
|
19
|
-
|
|
20
|
-
const BlockCaption = ( {
|
|
21
|
-
accessible,
|
|
22
|
-
accessibilityLabelCreator,
|
|
23
|
-
onBlur,
|
|
24
|
-
onChange,
|
|
25
|
-
onFocus,
|
|
26
|
-
isSelected,
|
|
27
|
-
shouldDisplay,
|
|
28
|
-
text,
|
|
29
|
-
insertBlocksAfter,
|
|
30
|
-
} ) => (
|
|
31
|
-
<View style={ [ styles.container, shouldDisplay && styles.padding ] }>
|
|
32
|
-
<Caption
|
|
33
|
-
accessibilityLabelCreator={ accessibilityLabelCreator }
|
|
34
|
-
accessible={ accessible }
|
|
35
|
-
isSelected={ isSelected }
|
|
36
|
-
onBlur={ onBlur }
|
|
37
|
-
onChange={ onChange }
|
|
38
|
-
onFocus={ onFocus }
|
|
39
|
-
shouldDisplay={ shouldDisplay }
|
|
40
|
-
value={ text }
|
|
41
|
-
insertBlocksAfter={ insertBlocksAfter }
|
|
42
|
-
/>
|
|
43
|
-
</View>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
export default compose( [
|
|
47
|
-
withSelect( ( select, { clientId } ) => {
|
|
48
|
-
const {
|
|
49
|
-
getBlockAttributes,
|
|
50
|
-
getSelectedBlockClientId,
|
|
51
|
-
getBlockName,
|
|
52
|
-
getBlockRootClientId,
|
|
53
|
-
} = select( blockEditorStore );
|
|
54
|
-
const { caption } = getBlockAttributes( clientId ) || {};
|
|
55
|
-
const isBlockSelected = getSelectedBlockClientId() === clientId;
|
|
56
|
-
|
|
57
|
-
// Detect whether the block is an inner block by checking if it has a parent block.
|
|
58
|
-
// getBlockRootClientId() will return an empty string for all top-level blocks.
|
|
59
|
-
// If the block is an inner block, its parent may explicitly hide child block controls.
|
|
60
|
-
// See: https://github.com/wordpress-mobile/gutenberg-mobile/pull/4256
|
|
61
|
-
const parentId = getBlockRootClientId( clientId );
|
|
62
|
-
const parentBlockName = getBlockName( parentId );
|
|
63
|
-
|
|
64
|
-
const hideCaption = hasBlockSupport(
|
|
65
|
-
parentBlockName,
|
|
66
|
-
'__experimentalHideChildBlockControls',
|
|
67
|
-
false
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
// We'll render the caption so that the soft keyboard is not forced to close on Android
|
|
71
|
-
// but still hide it by setting its display style to none. See wordpress-mobile/gutenberg-mobile#1221
|
|
72
|
-
const shouldDisplay =
|
|
73
|
-
! hideCaption &&
|
|
74
|
-
( ! RichText.isEmpty( caption ) > 0 || isBlockSelected );
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
shouldDisplay,
|
|
78
|
-
text: caption,
|
|
79
|
-
};
|
|
80
|
-
} ),
|
|
81
|
-
withDispatch( ( dispatch, { clientId } ) => {
|
|
82
|
-
const { updateBlockAttributes } = dispatch( blockEditorStore );
|
|
83
|
-
return {
|
|
84
|
-
onChange: ( caption ) => {
|
|
85
|
-
updateBlockAttributes( clientId, { caption } );
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
} ),
|
|
89
|
-
] )( BlockCaption );
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { ToolbarGroup } from '@wordpress/components';
|
|
5
|
-
import warning from '@wordpress/warning';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import groups from './groups';
|
|
11
|
-
|
|
12
|
-
export default function BlockControlsSlot( { group = 'default', ...props } ) {
|
|
13
|
-
const Slot = groups[ group ]?.Slot;
|
|
14
|
-
if ( ! Slot ) {
|
|
15
|
-
warning( `Unknown BlockControls group "${ group }" provided.` );
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if ( group === 'default' ) {
|
|
20
|
-
return <Slot { ...props } />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Slot { ...props }>
|
|
25
|
-
{ ( fills ) => {
|
|
26
|
-
if ( ! fills.length ) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return <ToolbarGroup>{ fills }</ToolbarGroup>;
|
|
30
|
-
} }
|
|
31
|
-
</Slot>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { dragHandle } from '@wordpress/icons';
|
|
10
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import BlockIcon from '../block-icon';
|
|
16
|
-
import styles from './style.scss';
|
|
17
|
-
|
|
18
|
-
const shadowStyle = {
|
|
19
|
-
shadowColor: '#000',
|
|
20
|
-
shadowOffset: {
|
|
21
|
-
width: 0,
|
|
22
|
-
height: 2,
|
|
23
|
-
},
|
|
24
|
-
shadowOpacity: 0.25,
|
|
25
|
-
shadowRadius: 3.84,
|
|
26
|
-
|
|
27
|
-
elevation: 5,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Block draggable chip component
|
|
32
|
-
*
|
|
33
|
-
* @param {Object} props Component props.
|
|
34
|
-
* @param {Object} [props.icon] Block icon.
|
|
35
|
-
* @return {React.JSX.Element} Chip component.
|
|
36
|
-
*/
|
|
37
|
-
export default function BlockDraggableChip( { icon } ) {
|
|
38
|
-
const containerStyle = usePreferredColorSchemeStyle(
|
|
39
|
-
styles[ 'draggable-chip__container' ],
|
|
40
|
-
styles[ 'draggable-chip__container--dark' ]
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<View style={ [ containerStyle, shadowStyle ] } testID="draggable-chip">
|
|
45
|
-
<BlockIcon icon={ dragHandle } />
|
|
46
|
-
{ icon && <BlockIcon icon={ icon } /> }
|
|
47
|
-
</View>
|
|
48
|
-
);
|
|
49
|
-
}
|