@wordpress/block-editor 15.20.0 → 15.21.1
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 +18 -0
- package/build/components/block-compare/index.cjs +2 -2
- package/build/components/block-compare/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +1 -1
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- 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-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/child-layout-control/index.cjs +10 -5
- package/build/components/child-layout-control/index.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 +5 -4
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/iframe/index.cjs +3 -0
- package/build/components/iframe/index.cjs.map +2 -2
- 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/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/utils.cjs +1 -1
- package/build/components/inserter/media-tab/utils.cjs.map +2 -2
- package/build/components/inserter/search-results.cjs +1 -1
- package/build/components/inserter/search-results.cjs.map +2 -2
- 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/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 +4 -4
- 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/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/use-block-commands/index.cjs +5 -5
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/hooks/anchor.cjs +11 -15
- package/build/hooks/anchor.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 +0 -3
- 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/position.cjs +19 -22
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/supports.cjs +0 -7
- package/build/hooks/supports.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 +29 -0
- 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-module/components/block-compare/index.mjs +1 -1
- package/build-module/components/block-compare/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +1 -1
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- 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-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/child-layout-control/index.mjs +10 -5
- package/build-module/components/child-layout-control/index.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 +9 -6
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/iframe/index.mjs +3 -0
- package/build-module/components/iframe/index.mjs.map +2 -2
- 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/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/utils.mjs +1 -1
- package/build-module/components/inserter/media-tab/utils.mjs.map +2 -2
- 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/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/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 +4 -4
- 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/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/use-block-commands/index.mjs +5 -5
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/hooks/anchor.mjs +11 -15
- package/build-module/hooks/anchor.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 +1 -4
- 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/position.mjs +20 -23
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/supports.mjs +0 -7
- package/build-module/hooks/supports.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 +26 -0
- 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-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 +51 -48
- package/src/components/block-breadcrumb/README.md +2 -2
- package/src/components/block-compare/README.md +6 -6
- package/src/components/block-compare/index.js +1 -3
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-patterns-list/index.js +1 -1
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-switcher/block-transformations-menu.js +16 -18
- package/src/components/block-switcher/index.js +4 -4
- package/src/components/block-types-list/README.md +0 -19
- package/src/components/child-layout-control/index.js +15 -8
- package/src/components/child-layout-control/test/index.js +126 -0
- package/src/components/colors/test/with-colors.js +1 -1
- 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 +23 -16
- package/src/components/iframe/index.js +3 -0
- 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/utils.js +1 -1
- package/src/components/inserter/search-results.js +1 -3
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/list-view/block-select-button.js +9 -13
- 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/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/border.js +1 -5
- package/src/hooks/color.js +1 -6
- package/src/hooks/dimensions.js +1 -5
- package/src/hooks/fit-text.js +16 -0
- package/src/hooks/position.js +23 -27
- package/src/hooks/supports.js +0 -9
- package/src/store/actions.js +13 -3
- package/src/store/private-actions.js +1 -4
- package/src/store/private-selectors.js +59 -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 +53 -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
|
@@ -630,6 +630,7 @@ function ListViewBlock( {
|
|
|
630
630
|
isExpanded={ canEditBlock ? isExpanded : undefined }
|
|
631
631
|
selectedClientIds={ selectedClientIds }
|
|
632
632
|
ariaDescribedBy={ descriptionId }
|
|
633
|
+
visibilityLabel={ blockVisibilityDescription }
|
|
633
634
|
/>
|
|
634
635
|
<AriaReferencedText id={ descriptionId }>
|
|
635
636
|
{ [
|
|
@@ -38,7 +38,6 @@ This property is similar to the `allowedTypes` property. The difference is the f
|
|
|
38
38
|
|
|
39
39
|
- Type: `String`
|
|
40
40
|
- Required: No
|
|
41
|
-
- Platform: Web
|
|
42
41
|
|
|
43
42
|
### addToGallery
|
|
44
43
|
|
|
@@ -48,7 +47,6 @@ If false the gallery media modal opens in the edit mode where the user can edit
|
|
|
48
47
|
- Type: `Boolean`
|
|
49
48
|
- Required: No
|
|
50
49
|
- Default: `false`
|
|
51
|
-
- Platform: Web
|
|
52
50
|
|
|
53
51
|
### allowedTypes
|
|
54
52
|
|
|
@@ -60,16 +58,6 @@ This property is similar to the `accept` property. The difference is the format
|
|
|
60
58
|
|
|
61
59
|
- Type: `Array`
|
|
62
60
|
- Required: No
|
|
63
|
-
- Platform: Web | Mobile
|
|
64
|
-
|
|
65
|
-
### autoOpenMediaUpload
|
|
66
|
-
|
|
67
|
-
If true, the MediaUpload component auto-opens the picker of the respective platform.
|
|
68
|
-
|
|
69
|
-
- Type: `Boolean`
|
|
70
|
-
- Required: No
|
|
71
|
-
- Default: `false`
|
|
72
|
-
- Platform: Mobile
|
|
73
61
|
|
|
74
62
|
### className
|
|
75
63
|
|
|
@@ -77,7 +65,6 @@ Class name added to the placeholder.
|
|
|
77
65
|
|
|
78
66
|
- Type: `String`
|
|
79
67
|
- Required: No
|
|
80
|
-
- Platform: Web
|
|
81
68
|
|
|
82
69
|
### disableDropZone
|
|
83
70
|
|
|
@@ -102,7 +89,6 @@ Icon to display left of the title. When passed as a `String`, the icon will be r
|
|
|
102
89
|
|
|
103
90
|
- Type: `String|Component`
|
|
104
91
|
- Required: No
|
|
105
|
-
- Platform: Web | Mobile
|
|
106
92
|
|
|
107
93
|
### isAppender
|
|
108
94
|
|
|
@@ -112,7 +98,6 @@ If false the default placeholder style is used.
|
|
|
112
98
|
- Type: `Boolean`
|
|
113
99
|
- Required: No
|
|
114
100
|
- Default: `false`
|
|
115
|
-
- Platform: Web | Mobile
|
|
116
101
|
|
|
117
102
|
### disableMediaButtons
|
|
118
103
|
|
|
@@ -121,7 +106,6 @@ If true, only the Drop Zone will be rendered. No UI controls to upload the media
|
|
|
121
106
|
- Type: `Boolean`
|
|
122
107
|
- Required: No
|
|
123
108
|
- Default: `false`
|
|
124
|
-
- Platform: Web | Mobile
|
|
125
109
|
|
|
126
110
|
### labels
|
|
127
111
|
|
|
@@ -129,7 +113,6 @@ An object that can contain a `title` and `instructions` properties. These proper
|
|
|
129
113
|
|
|
130
114
|
- Type: `Object`
|
|
131
115
|
- Required: No
|
|
132
|
-
- Platform: Web | Mobile
|
|
133
116
|
|
|
134
117
|
### multiple
|
|
135
118
|
|
|
@@ -138,7 +121,6 @@ Whether to allow multiple selection of files or not. This property will also acc
|
|
|
138
121
|
- Type: `Boolean|String`
|
|
139
122
|
- Required: No
|
|
140
123
|
- Default: `false`
|
|
141
|
-
- Platform: Web
|
|
142
124
|
|
|
143
125
|
### mediaPreview
|
|
144
126
|
|
|
@@ -146,7 +128,6 @@ The component is rendered as a preview in the placeholder.
|
|
|
146
128
|
|
|
147
129
|
- Type: `Component`
|
|
148
130
|
- Required: No
|
|
149
|
-
- Platform: Web
|
|
150
131
|
|
|
151
132
|
### onError
|
|
152
133
|
|
|
@@ -154,7 +135,6 @@ Callback called when an upload error happens.
|
|
|
154
135
|
|
|
155
136
|
- Type: `Function`
|
|
156
137
|
- Required: No
|
|
157
|
-
- Platform: Web
|
|
158
138
|
|
|
159
139
|
### onFilesPreUpload
|
|
160
140
|
|
|
@@ -164,7 +144,6 @@ It receives an array with the files to upload before to the final process. It me
|
|
|
164
144
|
- Type: `Function`
|
|
165
145
|
- Required: No
|
|
166
146
|
- Default: `Function` noop
|
|
167
|
-
- Platform: Web
|
|
168
147
|
|
|
169
148
|
### onSelect
|
|
170
149
|
|
|
@@ -173,12 +152,8 @@ The call back receives an array with the new files. Each element of the collecti
|
|
|
173
152
|
|
|
174
153
|
- Type: `Function`
|
|
175
154
|
- Required: Yes
|
|
176
|
-
- Platform: Web | Mobile
|
|
177
|
-
|
|
178
|
-
The argument of the callback is an object containing the following properties:
|
|
179
155
|
|
|
180
|
-
|
|
181
|
-
- Mobile: `{ id, url }`
|
|
156
|
+
The argument of the callback is an object containing the following properties: `{ url, alt, id, link, caption, sizes, media_details }`.
|
|
182
157
|
|
|
183
158
|
### value
|
|
184
159
|
|
|
@@ -186,7 +161,6 @@ An object or an array of objects that contain media ID (`id` property) to be sel
|
|
|
186
161
|
|
|
187
162
|
- Type: `Object|Array`
|
|
188
163
|
- Required: No
|
|
189
|
-
- Platform: Web
|
|
190
164
|
|
|
191
165
|
### onSelectURL
|
|
192
166
|
|
|
@@ -194,7 +168,6 @@ Callback called when urls can be configured. No media insertion from url will be
|
|
|
194
168
|
|
|
195
169
|
- Type: `Function`
|
|
196
170
|
- Required: No
|
|
197
|
-
- Platform: Web
|
|
198
171
|
|
|
199
172
|
### handleUpload
|
|
200
173
|
|
|
@@ -203,7 +176,6 @@ When the value is set to `false` or returned as `false`, the handling of the upl
|
|
|
203
176
|
- Type: `Boolean|Function`
|
|
204
177
|
- Required: No
|
|
205
178
|
- Default: `true`
|
|
206
|
-
- Platform: Web
|
|
207
179
|
|
|
208
180
|
## Extend
|
|
209
181
|
|
|
@@ -62,7 +62,6 @@ If allowedTypes is unset all mime types should be allowed.
|
|
|
62
62
|
|
|
63
63
|
- Type: `Array`
|
|
64
64
|
- Required: No
|
|
65
|
-
- Platform: Web | Mobile
|
|
66
65
|
|
|
67
66
|
### mode
|
|
68
67
|
|
|
@@ -71,7 +70,6 @@ Value of Frame content default mode like 'browse', 'upload' etc.
|
|
|
71
70
|
- Type: `String`
|
|
72
71
|
- Required: No
|
|
73
72
|
- Default: false
|
|
74
|
-
- Platform: Web
|
|
75
73
|
|
|
76
74
|
### multiple
|
|
77
75
|
|
|
@@ -80,7 +78,6 @@ Whether to allow multiple selection of files or not. This property will also acc
|
|
|
80
78
|
- Type: `Boolean|String`
|
|
81
79
|
- Required: No
|
|
82
80
|
- Default: false
|
|
83
|
-
- Platform: Web
|
|
84
81
|
|
|
85
82
|
### value
|
|
86
83
|
|
|
@@ -88,7 +85,6 @@ Media ID (or media IDs if multiple is true) to be selected by default when openi
|
|
|
88
85
|
|
|
89
86
|
- Type: `Number|Array`
|
|
90
87
|
- Required: No
|
|
91
|
-
- Platform: Web
|
|
92
88
|
|
|
93
89
|
### onClose
|
|
94
90
|
|
|
@@ -109,7 +105,6 @@ The `image.sizes.full` resolution does always exist. Other defined sizes are onl
|
|
|
109
105
|
|
|
110
106
|
- Type: `Function`
|
|
111
107
|
- Required: Yes
|
|
112
|
-
- Platform: Web | Mobile
|
|
113
108
|
|
|
114
109
|
### title
|
|
115
110
|
|
|
@@ -118,7 +113,6 @@ Title displayed in the media modal.
|
|
|
118
113
|
- Type: `String`
|
|
119
114
|
- Required: No
|
|
120
115
|
- Default: `Select or Upload Media`
|
|
121
|
-
- Platform: Web
|
|
122
116
|
|
|
123
117
|
### modalClass
|
|
124
118
|
|
|
@@ -126,7 +120,6 @@ CSS class added to the media modal frame.
|
|
|
126
120
|
|
|
127
121
|
- Type: `String`
|
|
128
122
|
- Required: No
|
|
129
|
-
- Platform: Web
|
|
130
123
|
|
|
131
124
|
### addToGallery
|
|
132
125
|
|
|
@@ -137,16 +130,6 @@ Only applies if `gallery === true`.
|
|
|
137
130
|
- Type: `Boolean`
|
|
138
131
|
- Required: No
|
|
139
132
|
- Default: `false`
|
|
140
|
-
- Platform: Web
|
|
141
|
-
|
|
142
|
-
### autoOpen
|
|
143
|
-
|
|
144
|
-
If true, the picker of the respective platform auto-opens.
|
|
145
|
-
|
|
146
|
-
- Type: `Boolean`
|
|
147
|
-
- Required: No
|
|
148
|
-
- Default: `false`
|
|
149
|
-
- Platform: Mobile
|
|
150
133
|
|
|
151
134
|
### gallery
|
|
152
135
|
|
|
@@ -155,7 +138,6 @@ If true, the component will initiate all the states required to represent a gall
|
|
|
155
138
|
- Type: `Boolean`
|
|
156
139
|
- Required: No
|
|
157
140
|
- Default: `false`
|
|
158
|
-
- Platform: Web
|
|
159
141
|
|
|
160
142
|
## render
|
|
161
143
|
|
|
@@ -163,7 +145,6 @@ A callback invoked to render the Button opening the media library.
|
|
|
163
145
|
|
|
164
146
|
- Type: `Function`
|
|
165
147
|
- Required: Yes
|
|
166
|
-
- Platform: Web | Mobile
|
|
167
148
|
|
|
168
149
|
The first argument of the callback is an object containing the following properties:
|
|
169
150
|
|
|
@@ -277,6 +277,46 @@ describe( 'useBlockSync hook', () => {
|
|
|
277
277
|
expect( onChange ).not.toHaveBeenCalled();
|
|
278
278
|
} );
|
|
279
279
|
|
|
280
|
+
it( 'passes undoIgnore when a non-persistent block change ignores history', async () => {
|
|
281
|
+
const onChange = jest.fn();
|
|
282
|
+
const onInput = jest.fn();
|
|
283
|
+
const value1 = [
|
|
284
|
+
{ clientId: 'a', innerBlocks: [], attributes: { foo: 1 } },
|
|
285
|
+
];
|
|
286
|
+
let registry;
|
|
287
|
+
const setRegistry = ( reg ) => {
|
|
288
|
+
registry = reg;
|
|
289
|
+
};
|
|
290
|
+
render(
|
|
291
|
+
<TestWrapper
|
|
292
|
+
setRegistry={ setRegistry }
|
|
293
|
+
value={ value1 }
|
|
294
|
+
onChange={ onChange }
|
|
295
|
+
onInput={ onInput }
|
|
296
|
+
/>
|
|
297
|
+
);
|
|
298
|
+
onChange.mockClear();
|
|
299
|
+
onInput.mockClear();
|
|
300
|
+
|
|
301
|
+
registry
|
|
302
|
+
.dispatch( blockEditorStore )
|
|
303
|
+
.__unstableMarkNextChangeAsNotPersistent( {
|
|
304
|
+
history: 'ignore',
|
|
305
|
+
} );
|
|
306
|
+
registry
|
|
307
|
+
.dispatch( blockEditorStore )
|
|
308
|
+
.updateBlockAttributes( 'a', { foo: 2 } );
|
|
309
|
+
|
|
310
|
+
expect( onInput ).toHaveBeenCalledWith(
|
|
311
|
+
[ { clientId: 'a', innerBlocks: [], attributes: { foo: 2 } } ],
|
|
312
|
+
expect.objectContaining( {
|
|
313
|
+
selection: expect.any( Object ),
|
|
314
|
+
undoIgnore: true,
|
|
315
|
+
} )
|
|
316
|
+
);
|
|
317
|
+
expect( onChange ).not.toHaveBeenCalled();
|
|
318
|
+
} );
|
|
319
|
+
|
|
280
320
|
it( 'calls onChange if a persistent change occurs', async () => {
|
|
281
321
|
const onChange = jest.fn();
|
|
282
322
|
const onInput = jest.fn();
|
|
@@ -342,6 +342,7 @@ export default function useBlockSync( {
|
|
|
342
342
|
const {
|
|
343
343
|
getSelectedBlocksInitialCaretPosition,
|
|
344
344
|
isLastBlockChangePersistent,
|
|
345
|
+
__unstableGetLastBlockChangeHistoryMode,
|
|
345
346
|
__unstableIsLastBlockChangeIgnored,
|
|
346
347
|
areInnerBlocksControlled,
|
|
347
348
|
getBlockParents,
|
|
@@ -349,6 +350,7 @@ export default function useBlockSync( {
|
|
|
349
350
|
|
|
350
351
|
let blocks = getBlocks( clientId );
|
|
351
352
|
let isPersistent = isLastBlockChangePersistent();
|
|
353
|
+
let blockHistoryMode = __unstableGetLastBlockChangeHistoryMode();
|
|
352
354
|
let previousAreBlocksDifferent = false;
|
|
353
355
|
let prevSelectionStart = getSelectionStart();
|
|
354
356
|
let prevSelectionEnd = getSelectionEnd();
|
|
@@ -367,6 +369,8 @@ export default function useBlockSync( {
|
|
|
367
369
|
}
|
|
368
370
|
|
|
369
371
|
const newIsPersistent = isLastBlockChangePersistent();
|
|
372
|
+
const newBlockHistoryMode =
|
|
373
|
+
__unstableGetLastBlockChangeHistoryMode();
|
|
370
374
|
const newBlocks = getBlocks( clientId );
|
|
371
375
|
const areBlocksDifferent = newBlocks !== blocks;
|
|
372
376
|
blocks = newBlocks;
|
|
@@ -377,6 +381,7 @@ export default function useBlockSync( {
|
|
|
377
381
|
) {
|
|
378
382
|
pendingChangesRef.current.incoming = null;
|
|
379
383
|
isPersistent = newIsPersistent;
|
|
384
|
+
blockHistoryMode = newBlockHistoryMode;
|
|
380
385
|
return;
|
|
381
386
|
}
|
|
382
387
|
|
|
@@ -409,6 +414,7 @@ export default function useBlockSync( {
|
|
|
409
414
|
registry.batch( () => {
|
|
410
415
|
if ( blocksChanged ) {
|
|
411
416
|
isPersistent = newIsPersistent;
|
|
417
|
+
blockHistoryMode = newBlockHistoryMode;
|
|
412
418
|
|
|
413
419
|
// For inner block controllers (clientId is set), restore external IDs
|
|
414
420
|
// before passing blocks to the parent.
|
|
@@ -438,9 +444,13 @@ export default function useBlockSync( {
|
|
|
438
444
|
const updateParent = isPersistent
|
|
439
445
|
? onChangeRef.current
|
|
440
446
|
: onInputRef.current;
|
|
441
|
-
|
|
447
|
+
const updateOptions = {
|
|
442
448
|
selection: selectionForParent,
|
|
443
|
-
}
|
|
449
|
+
};
|
|
450
|
+
if ( blockHistoryMode === 'ignore' ) {
|
|
451
|
+
updateOptions.undoIgnore = true;
|
|
452
|
+
}
|
|
453
|
+
updateParent( blocksForParent, updateOptions );
|
|
444
454
|
}
|
|
445
455
|
|
|
446
456
|
if (
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { insert, isCollapsed } from '@wordpress/rich-text';
|
|
5
5
|
import { applyFilters } from '@wordpress/hooks';
|
|
6
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
11
|
import { store as blockEditorStore } from '../../../store';
|
|
12
|
+
import { unlock } from '../../../lock-unlock';
|
|
13
|
+
|
|
14
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
* When typing over a selection, the selection will we wrapped by a matching
|
|
@@ -85,8 +89,5 @@ export default ( props ) => ( element ) => {
|
|
|
85
89
|
event.preventDefault();
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
|
|
89
|
-
return () => {
|
|
90
|
-
element.removeEventListener( 'beforeinput', onInput );
|
|
91
|
-
};
|
|
92
|
+
return subscribeDelegatedListener( element, 'beforeinput', onInput, true );
|
|
92
93
|
};
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
5
5
|
import { isCollapsed, isEmpty } from '@wordpress/rich-text';
|
|
6
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from '../../../lock-unlock';
|
|
12
|
+
|
|
13
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
6
14
|
|
|
7
15
|
export default ( props ) => ( element ) => {
|
|
8
16
|
function onKeyDown( event ) {
|
|
@@ -46,8 +54,5 @@ export default ( props ) => ( element ) => {
|
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
return () => {
|
|
51
|
-
element.removeEventListener( 'keydown', onKeyDown );
|
|
52
|
-
};
|
|
57
|
+
return subscribeDelegatedListener( element, 'keydown', onKeyDown );
|
|
53
58
|
};
|
|
@@ -88,9 +88,16 @@ export default ( props ) => ( element ) => {
|
|
|
88
88
|
'keydown',
|
|
89
89
|
onKeyDown
|
|
90
90
|
);
|
|
91
|
-
|
|
91
|
+
// Capture phase so this runs before ancestor (writing flow) bubble
|
|
92
|
+
// handlers, matching the timing of the previous raw element listener.
|
|
93
|
+
const unsubscribeKeyDownDeprecated = subscribeDelegatedListener(
|
|
94
|
+
element,
|
|
95
|
+
'keydown',
|
|
96
|
+
onKeyDownDeprecated,
|
|
97
|
+
true
|
|
98
|
+
);
|
|
92
99
|
return () => {
|
|
93
100
|
unsubscribeKeyDown();
|
|
94
|
-
|
|
101
|
+
unsubscribeKeyDownDeprecated();
|
|
95
102
|
};
|
|
96
103
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../../../lock-unlock';
|
|
10
|
+
|
|
11
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
12
|
+
|
|
1
13
|
export default ( props ) => ( element ) => {
|
|
2
14
|
const { inputEvents } = props.current;
|
|
3
15
|
function onInput( event ) {
|
|
@@ -6,8 +18,5 @@ export default ( props ) => ( element ) => {
|
|
|
6
18
|
}
|
|
7
19
|
}
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
return () => {
|
|
11
|
-
element.removeEventListener( 'input', onInput );
|
|
12
|
-
};
|
|
21
|
+
return subscribeDelegatedListener( element, 'input', onInput );
|
|
13
22
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { insert, toHTMLString } from '@wordpress/rich-text';
|
|
5
5
|
import { getBlockTransforms, findTransform } from '@wordpress/blocks';
|
|
6
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -13,6 +14,9 @@ import {
|
|
|
13
14
|
retrieveSelectedAttribute,
|
|
14
15
|
START_OF_SELECTED_AREA,
|
|
15
16
|
} from '../../../utils/selection';
|
|
17
|
+
import { unlock } from '../../../lock-unlock';
|
|
18
|
+
|
|
19
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
16
20
|
|
|
17
21
|
export function findSelection( blocks ) {
|
|
18
22
|
let i = blocks.length;
|
|
@@ -154,10 +158,22 @@ export default ( props ) => ( element ) => {
|
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
// Capture phase so these run before ancestor (writing flow) bubble
|
|
162
|
+
// handlers, matching the timing of the previous raw element listeners.
|
|
163
|
+
const unsubscribeInput = subscribeDelegatedListener(
|
|
164
|
+
element,
|
|
165
|
+
'input',
|
|
166
|
+
onInput,
|
|
167
|
+
true
|
|
168
|
+
);
|
|
169
|
+
const unsubscribeCompositionEnd = subscribeDelegatedListener(
|
|
170
|
+
element,
|
|
171
|
+
'compositionend',
|
|
172
|
+
onInput,
|
|
173
|
+
true
|
|
174
|
+
);
|
|
159
175
|
return () => {
|
|
160
|
-
|
|
161
|
-
|
|
176
|
+
unsubscribeInput();
|
|
177
|
+
unsubscribeCompositionEnd();
|
|
162
178
|
};
|
|
163
179
|
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Internal dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { store as blockEditorStore } from '../../../store';
|
|
10
|
+
import { unlock } from '../../../lock-unlock';
|
|
11
|
+
|
|
12
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
5
13
|
|
|
6
14
|
/**
|
|
7
15
|
* When the browser is about to auto correct, add an undo level so the user can
|
|
@@ -21,8 +29,5 @@ export default ( props ) => ( element ) => {
|
|
|
21
29
|
.__unstableMarkLastChangeAsPersistent();
|
|
22
30
|
}
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
return () => {
|
|
26
|
-
element.removeEventListener( 'beforeinput', onInput );
|
|
27
|
-
};
|
|
32
|
+
return subscribeDelegatedListener( element, 'beforeinput', onInput );
|
|
28
33
|
};
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { isKeyboardEvent } from '@wordpress/keycodes';
|
|
5
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { unlock } from '../../../lock-unlock';
|
|
11
|
+
|
|
12
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
5
13
|
|
|
6
14
|
/**
|
|
7
15
|
* Hook to prevent default behaviors for key combinations otherwise handled
|
|
@@ -17,8 +25,5 @@ export default () => ( node ) => {
|
|
|
17
25
|
event.preventDefault();
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
return () => {
|
|
22
|
-
node.removeEventListener( 'keydown', onKeydown );
|
|
23
|
-
};
|
|
28
|
+
return subscribeDelegatedListener( node, 'keydown', onKeydown, true );
|
|
24
29
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../../../lock-unlock';
|
|
10
|
+
|
|
11
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
12
|
+
|
|
1
13
|
export default ( props ) => ( element ) => {
|
|
2
14
|
const { keyboardShortcuts } = props.current;
|
|
3
15
|
function onKeyDown( event ) {
|
|
@@ -6,8 +18,5 @@ export default ( props ) => ( element ) => {
|
|
|
6
18
|
}
|
|
7
19
|
}
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
return () => {
|
|
11
|
-
element.removeEventListener( 'keydown', onKeyDown );
|
|
12
|
-
};
|
|
21
|
+
return subscribeDelegatedListener( element, 'keydown', onKeyDown, true );
|
|
13
22
|
};
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { BACKSPACE, ESCAPE } from '@wordpress/keycodes';
|
|
5
|
+
import { privateApis as composePrivateApis } from '@wordpress/compose';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import { store as blockEditorStore } from '../../../store';
|
|
11
|
+
import { unlock } from '../../../lock-unlock';
|
|
12
|
+
|
|
13
|
+
const { subscribeDelegatedListener } = unlock( composePrivateApis );
|
|
10
14
|
|
|
11
15
|
export default ( props ) => ( element ) => {
|
|
12
16
|
function onKeyDown( event ) {
|
|
@@ -38,8 +42,5 @@ export default ( props ) => ( element ) => {
|
|
|
38
42
|
__experimentalUndo();
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
return () => {
|
|
43
|
-
element.removeEventListener( 'keydown', onKeyDown );
|
|
44
|
-
};
|
|
45
|
+
return subscribeDelegatedListener( element, 'keydown', onKeyDown );
|
|
45
46
|
};
|
|
@@ -51,36 +51,6 @@ inputEventContext.displayName = 'inputEventContext';
|
|
|
51
51
|
|
|
52
52
|
const instanceIdKey = Symbol( 'instanceId' );
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Removes props used for the native version of RichText so that they are not
|
|
56
|
-
* passed to the DOM element and log warnings.
|
|
57
|
-
*
|
|
58
|
-
* @param {Object} props Props to filter.
|
|
59
|
-
*
|
|
60
|
-
* @return {Object} Filtered props.
|
|
61
|
-
*/
|
|
62
|
-
function removeNativeProps( props ) {
|
|
63
|
-
const {
|
|
64
|
-
__unstableMobileNoFocusOnMount,
|
|
65
|
-
deleteEnter,
|
|
66
|
-
placeholderTextColor,
|
|
67
|
-
textAlign,
|
|
68
|
-
selectionColor,
|
|
69
|
-
tagsToEliminate,
|
|
70
|
-
disableEditingMenu,
|
|
71
|
-
fontSize,
|
|
72
|
-
fontFamily,
|
|
73
|
-
fontWeight,
|
|
74
|
-
fontStyle,
|
|
75
|
-
minWidth,
|
|
76
|
-
maxWidth,
|
|
77
|
-
disableSuggestions,
|
|
78
|
-
disableAutocorrection,
|
|
79
|
-
...restProps
|
|
80
|
-
} = props;
|
|
81
|
-
return restProps;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
54
|
export function RichTextWrapper(
|
|
85
55
|
{
|
|
86
56
|
children,
|
|
@@ -113,8 +83,6 @@ export function RichTextWrapper(
|
|
|
113
83
|
},
|
|
114
84
|
forwardedRef
|
|
115
85
|
) {
|
|
116
|
-
props = removeNativeProps( props );
|
|
117
|
-
|
|
118
86
|
if ( onSplit ) {
|
|
119
87
|
deprecated( 'wp.blockEditor.RichText onSplit prop', {
|
|
120
88
|
since: '6.4',
|
|
@@ -532,7 +500,7 @@ const PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {
|
|
|
532
500
|
__unstableAllowPrefixTransformations,
|
|
533
501
|
readOnly,
|
|
534
502
|
...contentProps
|
|
535
|
-
} =
|
|
503
|
+
} = props;
|
|
536
504
|
return (
|
|
537
505
|
<Tag
|
|
538
506
|
ref={ ref }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# UnitControl
|
|
2
2
|
|
|
3
|
-
UnitControl component allows the user to set a value as well as a unit (e.g. `px`). The allowed units are derived from the (experimental) `theme.json` settings file
|
|
3
|
+
UnitControl component allows the user to set a value as well as a unit (e.g. `px`). The allowed units are derived from the (experimental) `theme.json` settings file.
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
// theme.json
|
|
@@ -123,7 +123,7 @@ drawer.
|
|
|
123
123
|
## Useful UI pieces
|
|
124
124
|
|
|
125
125
|
The URLPopover exposes two components that may be used as child components to make the UI creation process easier.
|
|
126
|
-
Although in the editor these components are used inside URLPopover and they were built with URLPopover use cases in mind, it
|
|
126
|
+
Although in the editor these components are used inside URLPopover and they were built with URLPopover use cases in mind, it may be possible and perfectly fine to use them standalone if they fit a use-case.
|
|
127
127
|
|
|
128
128
|
### LinkViewer
|
|
129
129
|
|
|
@@ -93,8 +93,8 @@ const getTransformCommands = () =>
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// Simple block transformation based on the `Block Transforms` API.
|
|
96
|
-
function onBlockTransform( name ) {
|
|
97
|
-
const newBlocks = switchToBlockType( blocks, name );
|
|
96
|
+
function onBlockTransform( name, variationName ) {
|
|
97
|
+
const newBlocks = switchToBlockType( blocks, name, variationName );
|
|
98
98
|
replaceBlocks( clientIds, newBlocks );
|
|
99
99
|
selectForMultipleBlocks( newBlocks );
|
|
100
100
|
}
|
|
@@ -117,7 +117,7 @@ const getTransformCommands = () =>
|
|
|
117
117
|
|
|
118
118
|
const commands = possibleBlockTransformations.map(
|
|
119
119
|
( transformation ) => {
|
|
120
|
-
const { name, title, icon } = transformation;
|
|
120
|
+
const { id, name, title, icon, variationName } = transformation;
|
|
121
121
|
/*
|
|
122
122
|
* Command menu uses Icon from @wordpress/icons, which expects a ReactElement
|
|
123
123
|
* (cloneElement). Normalize to blockDefaultIcon to avoid crash. See #55668 / PR #55676.
|
|
@@ -132,13 +132,13 @@ const getTransformCommands = () =>
|
|
|
132
132
|
return {
|
|
133
133
|
name:
|
|
134
134
|
'core/block-editor/transform-to-' +
|
|
135
|
-
name.replace(
|
|
135
|
+
( id || name ).replace( /\//g, '-' ),
|
|
136
136
|
/* translators: %s: Block or block variation name. */
|
|
137
137
|
label: sprintf( __( 'Transform to %s' ), title ),
|
|
138
138
|
icon: blockIcon?.src,
|
|
139
139
|
category: 'command',
|
|
140
140
|
callback: ( { close } ) => {
|
|
141
|
-
onBlockTransform( name );
|
|
141
|
+
onBlockTransform( name, variationName );
|
|
142
142
|
close();
|
|
143
143
|
},
|
|
144
144
|
};
|