@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
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
5
|
-
import { StyleSheet } from 'react-native';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { Icon, check, chevronRight } from '@wordpress/icons';
|
|
12
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
13
|
-
import { BottomSheet, PanelBody } from '@wordpress/components';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
import styles from './style.native.scss';
|
|
19
|
-
import { blockSettingsScreens } from '../block-settings';
|
|
20
|
-
|
|
21
|
-
const LINK_DESTINATION_NONE = 'none';
|
|
22
|
-
const LINK_DESTINATION_MEDIA = 'media';
|
|
23
|
-
const LINK_DESTINATION_ATTACHMENT = 'attachment';
|
|
24
|
-
const LINK_DESTINATION_CUSTOM = 'custom';
|
|
25
|
-
|
|
26
|
-
function LinkDestination( {
|
|
27
|
-
children,
|
|
28
|
-
isSelected,
|
|
29
|
-
label,
|
|
30
|
-
onPress,
|
|
31
|
-
value,
|
|
32
|
-
valueStyle,
|
|
33
|
-
} ) {
|
|
34
|
-
const optionIcon = usePreferredColorSchemeStyle(
|
|
35
|
-
styles.optionIcon,
|
|
36
|
-
styles.optionIconDark
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<BottomSheet.Cell
|
|
41
|
-
icon={ check }
|
|
42
|
-
iconStyle={ StyleSheet.flatten( [
|
|
43
|
-
optionIcon,
|
|
44
|
-
! isSelected && styles.unselectedOptionIcon,
|
|
45
|
-
] ) }
|
|
46
|
-
label={ label }
|
|
47
|
-
leftAlign
|
|
48
|
-
onPress={ onPress }
|
|
49
|
-
value={ value }
|
|
50
|
-
valueStyle={ valueStyle }
|
|
51
|
-
separatorType="leftMargin"
|
|
52
|
-
>
|
|
53
|
-
{ children }
|
|
54
|
-
</BottomSheet.Cell>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function ImageLinkDestinationsScreen( props ) {
|
|
59
|
-
const navigation = useNavigation();
|
|
60
|
-
const route = useRoute();
|
|
61
|
-
const { url = '' } = props;
|
|
62
|
-
const {
|
|
63
|
-
inputValue = url,
|
|
64
|
-
imageUrl,
|
|
65
|
-
attachmentPageUrl,
|
|
66
|
-
linkDestination,
|
|
67
|
-
} = route.params || {};
|
|
68
|
-
|
|
69
|
-
function goToLinkPicker() {
|
|
70
|
-
navigation.navigate( blockSettingsScreens.linkPicker, {
|
|
71
|
-
inputValue:
|
|
72
|
-
linkDestination === LINK_DESTINATION_CUSTOM ? inputValue : '',
|
|
73
|
-
} );
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const setLinkDestination = ( newLinkDestination ) => () => {
|
|
77
|
-
let newUrl;
|
|
78
|
-
switch ( newLinkDestination ) {
|
|
79
|
-
case LINK_DESTINATION_MEDIA:
|
|
80
|
-
newUrl = imageUrl;
|
|
81
|
-
break;
|
|
82
|
-
case LINK_DESTINATION_ATTACHMENT:
|
|
83
|
-
newUrl = attachmentPageUrl;
|
|
84
|
-
break;
|
|
85
|
-
default:
|
|
86
|
-
newUrl = '';
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
navigation.navigate( blockSettingsScreens.settings, {
|
|
91
|
-
// The `inputValue` name is reused from LinkPicker, as it helps avoid
|
|
92
|
-
// bugs from stale values remaining in the React Navigation route
|
|
93
|
-
// parameters.
|
|
94
|
-
inputValue: newUrl,
|
|
95
|
-
// Clear link text value that may be set from LinkPicker.
|
|
96
|
-
text: '',
|
|
97
|
-
} );
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<>
|
|
102
|
-
<BottomSheet.NavBar>
|
|
103
|
-
<BottomSheet.NavBar.BackButton onPress={ navigation.goBack } />
|
|
104
|
-
<BottomSheet.NavBar.Heading>
|
|
105
|
-
{ __( 'Link To' ) }
|
|
106
|
-
</BottomSheet.NavBar.Heading>
|
|
107
|
-
</BottomSheet.NavBar>
|
|
108
|
-
<PanelBody>
|
|
109
|
-
<LinkDestination
|
|
110
|
-
isSelected={ linkDestination === LINK_DESTINATION_NONE }
|
|
111
|
-
label={ __( 'None' ) }
|
|
112
|
-
onPress={ setLinkDestination( LINK_DESTINATION_NONE ) }
|
|
113
|
-
/>
|
|
114
|
-
<LinkDestination
|
|
115
|
-
isSelected={ linkDestination === LINK_DESTINATION_MEDIA }
|
|
116
|
-
label={ __( 'Media File' ) }
|
|
117
|
-
onPress={ setLinkDestination( LINK_DESTINATION_MEDIA ) }
|
|
118
|
-
/>
|
|
119
|
-
{ !! attachmentPageUrl && (
|
|
120
|
-
<LinkDestination
|
|
121
|
-
isSelected={
|
|
122
|
-
linkDestination === LINK_DESTINATION_ATTACHMENT
|
|
123
|
-
}
|
|
124
|
-
label={ __( 'Attachment Page' ) }
|
|
125
|
-
onPress={ setLinkDestination(
|
|
126
|
-
LINK_DESTINATION_ATTACHMENT
|
|
127
|
-
) }
|
|
128
|
-
/>
|
|
129
|
-
) }
|
|
130
|
-
<LinkDestination
|
|
131
|
-
isSelected={ linkDestination === LINK_DESTINATION_CUSTOM }
|
|
132
|
-
label={ __( 'Custom URL' ) }
|
|
133
|
-
onPress={ goToLinkPicker }
|
|
134
|
-
value={
|
|
135
|
-
linkDestination === LINK_DESTINATION_CUSTOM
|
|
136
|
-
? inputValue
|
|
137
|
-
: ''
|
|
138
|
-
}
|
|
139
|
-
valueStyle={
|
|
140
|
-
linkDestination === LINK_DESTINATION_CUSTOM
|
|
141
|
-
? undefined
|
|
142
|
-
: styles.placeholderTextColor
|
|
143
|
-
}
|
|
144
|
-
>
|
|
145
|
-
<Icon icon={ chevronRight }></Icon>
|
|
146
|
-
</LinkDestination>
|
|
147
|
-
</PanelBody>
|
|
148
|
-
</>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export default ImageLinkDestinationsScreen;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// Block Creation Components.
|
|
2
|
-
export {
|
|
3
|
-
BlockAlignmentControl,
|
|
4
|
-
BlockAlignmentToolbar,
|
|
5
|
-
} from './block-alignment-control';
|
|
6
|
-
export { BlockContextProvider } from './block-context';
|
|
7
|
-
export {
|
|
8
|
-
default as BlockControls,
|
|
9
|
-
BlockFormatControls,
|
|
10
|
-
} from './block-controls';
|
|
11
|
-
export { default as BlockEdit, useBlockEditContext } from './block-edit';
|
|
12
|
-
export { default as BlockIcon } from './block-icon';
|
|
13
|
-
export {
|
|
14
|
-
BlockVerticalAlignmentToolbar,
|
|
15
|
-
BlockVerticalAlignmentControl,
|
|
16
|
-
} from './block-vertical-alignment-control';
|
|
17
|
-
export * from './colors';
|
|
18
|
-
export * from './gradients';
|
|
19
|
-
export * from './font-sizes';
|
|
20
|
-
export { AlignmentControl, AlignmentToolbar } from './alignment-control';
|
|
21
|
-
export { default as InnerBlocks, useInnerBlocksProps } from './inner-blocks';
|
|
22
|
-
export {
|
|
23
|
-
default as InspectorControls,
|
|
24
|
-
InspectorAdvancedControls,
|
|
25
|
-
} from './inspector-controls';
|
|
26
|
-
export {
|
|
27
|
-
JustifyToolbar,
|
|
28
|
-
JustifyContentControl,
|
|
29
|
-
} from './justify-content-control';
|
|
30
|
-
export { default as LineHeightControl } from './line-height-control';
|
|
31
|
-
export { default as HeadingLevelDropdown } from './block-heading-level-dropdown';
|
|
32
|
-
export { default as PlainText } from './plain-text';
|
|
33
|
-
export {
|
|
34
|
-
default as RichText,
|
|
35
|
-
RichTextShortcut,
|
|
36
|
-
RichTextToolbarButton,
|
|
37
|
-
__unstableRichTextInputEvent,
|
|
38
|
-
} from './rich-text';
|
|
39
|
-
export { default as MediaReplaceFlow } from './media-replace-flow';
|
|
40
|
-
export { default as MediaPlaceholder } from './media-placeholder';
|
|
41
|
-
export { default as MediaUpload } from './media-upload';
|
|
42
|
-
export {
|
|
43
|
-
MEDIA_TYPE_IMAGE,
|
|
44
|
-
MEDIA_TYPE_VIDEO,
|
|
45
|
-
MEDIA_TYPE_AUDIO,
|
|
46
|
-
MEDIA_TYPE_ANY,
|
|
47
|
-
} from './media-upload/constants';
|
|
48
|
-
export { default as MediaUploadProgress } from './media-upload-progress';
|
|
49
|
-
export {
|
|
50
|
-
MEDIA_UPLOAD_STATE_UPLOADING,
|
|
51
|
-
MEDIA_UPLOAD_STATE_SUCCEEDED,
|
|
52
|
-
MEDIA_UPLOAD_STATE_PAUSED,
|
|
53
|
-
MEDIA_UPLOAD_STATE_FAILED,
|
|
54
|
-
MEDIA_UPLOAD_STATE_RESET,
|
|
55
|
-
} from './media-upload-progress/constants';
|
|
56
|
-
export { default as BlockMediaUpdateProgress } from './block-media-update-progress';
|
|
57
|
-
export { default as URLInput } from './url-input';
|
|
58
|
-
export { default as BlockInvalidWarning } from './block-list/block-invalid-warning';
|
|
59
|
-
export { default as BlockCaption } from './block-caption';
|
|
60
|
-
export { default as Caption } from './caption';
|
|
61
|
-
export { default as PanelColorSettings } from './panel-color-settings';
|
|
62
|
-
export { default as __experimentalPanelColorGradientSettings } from './colors-gradients/panel-color-gradient-settings';
|
|
63
|
-
export { useSettings, default as useSetting } from './use-settings';
|
|
64
|
-
export {
|
|
65
|
-
RecursionProvider,
|
|
66
|
-
DeprecatedExperimentalRecursionProvider as __experimentalRecursionProvider,
|
|
67
|
-
useHasRecursion,
|
|
68
|
-
DeprecatedExperimentalUseHasRecursion as __experimentalUseHasRecursion,
|
|
69
|
-
} from './recursion-provider';
|
|
70
|
-
export { default as Warning } from './warning';
|
|
71
|
-
export { default as ContrastChecker } from './contrast-checker';
|
|
72
|
-
export { default as useMultipleOriginColorsAndGradients } from './colors-gradients/use-multiple-origin-colors-and-gradients';
|
|
73
|
-
export { default as UnsupportedBlockDetails } from './unsupported-block-details';
|
|
74
|
-
export {
|
|
75
|
-
useGlobalStyles,
|
|
76
|
-
getGlobalStyles,
|
|
77
|
-
getColorsAndGradients,
|
|
78
|
-
useMobileGlobalStylesColors,
|
|
79
|
-
} from './global-styles/use-global-styles-context';
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
BottomSheetSettings,
|
|
83
|
-
BlockSettingsButton,
|
|
84
|
-
blockSettingsScreens,
|
|
85
|
-
} from './block-settings';
|
|
86
|
-
export { default as VideoPlayer, VIDEO_ASPECT_RATIO } from './video-player';
|
|
87
|
-
export { default as AudioPlayer } from './audio-player';
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
getSpacingPresetCssVar,
|
|
91
|
-
getCustomValueFromPreset,
|
|
92
|
-
isValueSpacingPreset,
|
|
93
|
-
} from './spacing-sizes-control/utils';
|
|
94
|
-
// Content Related Components.
|
|
95
|
-
export { default as BlockList } from './block-list';
|
|
96
|
-
export { default as BlockMover } from './block-mover';
|
|
97
|
-
export { default as BlockToolbar } from './block-toolbar';
|
|
98
|
-
export { default as BlockVariationPicker } from './block-variation-picker';
|
|
99
|
-
export { default as BlockStyles } from './block-styles';
|
|
100
|
-
export { default as DefaultBlockAppender } from './default-block-appender';
|
|
101
|
-
export { default as __unstableEditorStyles } from './editor-styles';
|
|
102
|
-
export { default as Inserter } from './inserter';
|
|
103
|
-
export { default as InserterButton } from './inserter-button';
|
|
104
|
-
export { useBlockProps } from './block-list/use-block-props';
|
|
105
|
-
export { default as FloatingToolbar } from './floating-toolbar';
|
|
106
|
-
|
|
107
|
-
// State Related Components.
|
|
108
|
-
export { default as BlockEditorProvider } from './provider';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Hermes has a limit for the call stack depth to avoid infinite recursion.
|
|
2
|
-
// When creating a deep nested structure of inner blocks, the editor might exceed
|
|
3
|
-
// this limit and crash. In order to avoid this, we set a maximum depth level where
|
|
4
|
-
// we stop rendering blocks.
|
|
5
|
-
export const MAX_NESTING_DEPTH = 10;
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __unstableGetInnerBlocksProps as getInnerBlocksProps } from '@wordpress/blocks';
|
|
5
|
-
import { useRef } from '@wordpress/element';
|
|
6
|
-
import { useSelect } from '@wordpress/data';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import ButtonBlockAppender from './button-block-appender';
|
|
12
|
-
import DefaultBlockAppender from './default-block-appender';
|
|
13
|
-
import useNestedSettingsUpdate from './use-nested-settings-update';
|
|
14
|
-
import useInnerBlockTemplateSync from './use-inner-block-template-sync';
|
|
15
|
-
import useBlockContext from './use-block-context';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
import BlockList from '../block-list';
|
|
21
|
-
import { useBlockEditContext } from '../block-edit/context';
|
|
22
|
-
import useBlockSync from '../provider/use-block-sync';
|
|
23
|
-
import { BlockContextProvider } from '../block-context';
|
|
24
|
-
import { defaultLayout, LayoutProvider } from '../block-list/layout';
|
|
25
|
-
import { store as blockEditorStore } from '../../store';
|
|
26
|
-
import WarningMaxDepthExceeded from './warning-max-depth-exceeded';
|
|
27
|
-
import { MAX_NESTING_DEPTH } from './constants';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* This hook is used to lightly mark an element as an inner blocks wrapper
|
|
31
|
-
* element. Call this hook and pass the returned props to the element to mark as
|
|
32
|
-
* an inner blocks wrapper, automatically rendering inner blocks as children. If
|
|
33
|
-
* you define a ref for the element, it is important to pass the ref to this
|
|
34
|
-
* hook, which the hook in turn will pass to the component through the props it
|
|
35
|
-
* returns. Optionally, you can also pass any other props through this hook, and
|
|
36
|
-
* they will be merged and returned.
|
|
37
|
-
*
|
|
38
|
-
* @see https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/inner-blocks/README.md
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} props Optional. Props to pass to the element. Must contain
|
|
41
|
-
* the ref if one is defined.
|
|
42
|
-
* @param {Object} options Optional. Inner blocks options.
|
|
43
|
-
*/
|
|
44
|
-
export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
45
|
-
const fallbackRef = useRef();
|
|
46
|
-
const { clientId } = useBlockEditContext();
|
|
47
|
-
|
|
48
|
-
const ref = props.ref || fallbackRef;
|
|
49
|
-
const InnerBlocks =
|
|
50
|
-
options.value && options.onChange
|
|
51
|
-
? ControlledInnerBlocks
|
|
52
|
-
: UncontrolledInnerBlocks;
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
...props,
|
|
56
|
-
ref,
|
|
57
|
-
children: (
|
|
58
|
-
<InnerBlocks
|
|
59
|
-
{ ...options }
|
|
60
|
-
clientId={ clientId }
|
|
61
|
-
wrapperRef={ ref }
|
|
62
|
-
/>
|
|
63
|
-
),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* InnerBlocks is a component which allows a single block to have multiple blocks
|
|
69
|
-
* as children. The UncontrolledInnerBlocks component is used whenever the inner
|
|
70
|
-
* blocks are not controlled by another entity. In other words, it is normally
|
|
71
|
-
* used for inner blocks in the post editor
|
|
72
|
-
*
|
|
73
|
-
* @param {Object} props The component props.
|
|
74
|
-
*/
|
|
75
|
-
function UncontrolledInnerBlocks( props ) {
|
|
76
|
-
const {
|
|
77
|
-
clientId,
|
|
78
|
-
allowedBlocks,
|
|
79
|
-
prioritizedInserterBlocks,
|
|
80
|
-
defaultBlock,
|
|
81
|
-
directInsert,
|
|
82
|
-
__experimentalDefaultBlock,
|
|
83
|
-
__experimentalDirectInsert,
|
|
84
|
-
template,
|
|
85
|
-
templateLock,
|
|
86
|
-
templateInsertUpdatesSelection,
|
|
87
|
-
__experimentalCaptureToolbars: captureToolbars,
|
|
88
|
-
orientation,
|
|
89
|
-
renderAppender,
|
|
90
|
-
renderFooterAppender,
|
|
91
|
-
parentWidth,
|
|
92
|
-
horizontal,
|
|
93
|
-
contentResizeMode,
|
|
94
|
-
contentStyle,
|
|
95
|
-
onAddBlock,
|
|
96
|
-
onDeleteBlock,
|
|
97
|
-
marginVertical,
|
|
98
|
-
marginHorizontal,
|
|
99
|
-
horizontalAlignment,
|
|
100
|
-
filterInnerBlocks,
|
|
101
|
-
blockWidth,
|
|
102
|
-
layout = defaultLayout,
|
|
103
|
-
gridProperties,
|
|
104
|
-
} = props;
|
|
105
|
-
|
|
106
|
-
const context = useBlockContext( clientId );
|
|
107
|
-
|
|
108
|
-
const { nestingLevel, parentLock } = useSelect(
|
|
109
|
-
( select ) => {
|
|
110
|
-
const { getBlockParents, getTemplateLock, getBlockRootClientId } =
|
|
111
|
-
select( blockEditorStore );
|
|
112
|
-
return {
|
|
113
|
-
nestingLevel: getBlockParents( clientId )?.length,
|
|
114
|
-
parentLock: getTemplateLock( getBlockRootClientId( clientId ) ),
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
[ clientId ]
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
useNestedSettingsUpdate(
|
|
121
|
-
clientId,
|
|
122
|
-
parentLock,
|
|
123
|
-
allowedBlocks,
|
|
124
|
-
prioritizedInserterBlocks,
|
|
125
|
-
defaultBlock,
|
|
126
|
-
directInsert,
|
|
127
|
-
__experimentalDefaultBlock,
|
|
128
|
-
__experimentalDirectInsert,
|
|
129
|
-
templateLock,
|
|
130
|
-
captureToolbars,
|
|
131
|
-
orientation,
|
|
132
|
-
layout
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
useInnerBlockTemplateSync(
|
|
136
|
-
clientId,
|
|
137
|
-
template,
|
|
138
|
-
templateLock,
|
|
139
|
-
templateInsertUpdatesSelection
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
if ( nestingLevel >= MAX_NESTING_DEPTH ) {
|
|
143
|
-
return <WarningMaxDepthExceeded clientId={ clientId } />;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<LayoutProvider value={ layout }>
|
|
148
|
-
<BlockContextProvider value={ context }>
|
|
149
|
-
<BlockList
|
|
150
|
-
marginVertical={ marginVertical }
|
|
151
|
-
marginHorizontal={ marginHorizontal }
|
|
152
|
-
rootClientId={ clientId }
|
|
153
|
-
renderAppender={ renderAppender }
|
|
154
|
-
renderFooterAppender={ renderFooterAppender }
|
|
155
|
-
withFooter={ false }
|
|
156
|
-
orientation={ orientation }
|
|
157
|
-
parentWidth={ parentWidth }
|
|
158
|
-
horizontalAlignment={ horizontalAlignment }
|
|
159
|
-
horizontal={ horizontal }
|
|
160
|
-
contentResizeMode={ contentResizeMode }
|
|
161
|
-
contentStyle={ contentStyle }
|
|
162
|
-
onAddBlock={ onAddBlock }
|
|
163
|
-
onDeleteBlock={ onDeleteBlock }
|
|
164
|
-
filterInnerBlocks={ filterInnerBlocks }
|
|
165
|
-
gridProperties={ gridProperties }
|
|
166
|
-
blockWidth={ blockWidth }
|
|
167
|
-
/>
|
|
168
|
-
</BlockContextProvider>
|
|
169
|
-
</LayoutProvider>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* The controlled inner blocks component wraps the uncontrolled inner blocks
|
|
175
|
-
* component with the blockSync hook. This keeps the innerBlocks of the block in
|
|
176
|
-
* the block-editor store in sync with the blocks of the controlling entity. An
|
|
177
|
-
* example of an inner block controller is a template part block, which provides
|
|
178
|
-
* its own blocks from the template part entity data source.
|
|
179
|
-
*
|
|
180
|
-
* @param {Object} props The component props.
|
|
181
|
-
*/
|
|
182
|
-
function ControlledInnerBlocks( props ) {
|
|
183
|
-
useBlockSync( props );
|
|
184
|
-
return <UncontrolledInnerBlocks { ...props } />;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Wrapped InnerBlocks component which detects whether to use the controlled or
|
|
189
|
-
* uncontrolled variations of the InnerBlocks component. This is the component
|
|
190
|
-
* which should be used throughout the application.
|
|
191
|
-
*
|
|
192
|
-
* @param {Object} props The component props.
|
|
193
|
-
*/
|
|
194
|
-
const InnerBlocks = ( props ) => {
|
|
195
|
-
const { clientId } = useBlockEditContext();
|
|
196
|
-
|
|
197
|
-
const allProps = {
|
|
198
|
-
clientId,
|
|
199
|
-
...props,
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// Detects if the InnerBlocks should be controlled by an incoming value.
|
|
203
|
-
return props.value && props.onChange ? (
|
|
204
|
-
<ControlledInnerBlocks { ...allProps } />
|
|
205
|
-
) : (
|
|
206
|
-
<UncontrolledInnerBlocks { ...allProps } />
|
|
207
|
-
);
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
// Expose default appender placeholders as components.
|
|
211
|
-
InnerBlocks.DefaultBlockAppender = DefaultBlockAppender;
|
|
212
|
-
InnerBlocks.ButtonBlockAppender = ButtonBlockAppender;
|
|
213
|
-
|
|
214
|
-
useInnerBlocksProps.save = getInnerBlocksProps;
|
|
215
|
-
|
|
216
|
-
InnerBlocks.Content = () => useInnerBlocksProps.save().children;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
|
|
220
|
-
*/
|
|
221
|
-
export default InnerBlocks;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
-
import { useState } from '@wordpress/element';
|
|
11
|
-
import { useSelect } from '@wordpress/data';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import Warning from '../warning';
|
|
17
|
-
import UnsupportedBlockDetails from '../unsupported-block-details';
|
|
18
|
-
import { store as blockEditorStore } from '../../store';
|
|
19
|
-
import { MAX_NESTING_DEPTH } from './constants';
|
|
20
|
-
import useUnsupportedBlockEditor from '../use-unsupported-block-editor';
|
|
21
|
-
import {
|
|
22
|
-
useConvertToGroupButtons,
|
|
23
|
-
useConvertToGroupButtonProps,
|
|
24
|
-
} from '../convert-to-group-buttons';
|
|
25
|
-
|
|
26
|
-
const EMPTY_ARRAY = [];
|
|
27
|
-
|
|
28
|
-
const WarningMaxDepthExceeded = ( { clientId } ) => {
|
|
29
|
-
const [ showDetails, setShowDetails ] = useState( false );
|
|
30
|
-
|
|
31
|
-
const isSelected = useSelect(
|
|
32
|
-
( select ) => select( blockEditorStore ).isBlockSelected( clientId ),
|
|
33
|
-
[ clientId ]
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
// We rely on the logic related to the Group/Ungroup buttons used in the block options to
|
|
37
|
-
// determine whether to use the Ungroup action.
|
|
38
|
-
const convertToGroupButtonProps = useConvertToGroupButtonProps( [
|
|
39
|
-
clientId,
|
|
40
|
-
] );
|
|
41
|
-
const { isUngroupable } = convertToGroupButtonProps;
|
|
42
|
-
const convertToGroupButtons = useConvertToGroupButtons( {
|
|
43
|
-
...convertToGroupButtonProps,
|
|
44
|
-
} );
|
|
45
|
-
const onUngroup = convertToGroupButtons.ungroup.onSelect;
|
|
46
|
-
|
|
47
|
-
const {
|
|
48
|
-
isUnsupportedBlockEditorSupported,
|
|
49
|
-
canEnableUnsupportedBlockEditor,
|
|
50
|
-
} = useUnsupportedBlockEditor( clientId );
|
|
51
|
-
|
|
52
|
-
/* translators: Warning related to having blocks deeply nested. %d: The deepest nesting level. */
|
|
53
|
-
const descriptionFormat = __(
|
|
54
|
-
'Blocks nested deeper than %d levels may not render properly in the mobile editor.'
|
|
55
|
-
);
|
|
56
|
-
let description = sprintf( descriptionFormat, MAX_NESTING_DEPTH );
|
|
57
|
-
if (
|
|
58
|
-
! isUnsupportedBlockEditorSupported &&
|
|
59
|
-
! canEnableUnsupportedBlockEditor
|
|
60
|
-
) {
|
|
61
|
-
// When UBE can't be used, the description mentions using the web browser to edit the block.
|
|
62
|
-
description +=
|
|
63
|
-
' ' +
|
|
64
|
-
/* translators: Recommendation included in a warning related to having blocks deeply nested. */
|
|
65
|
-
__(
|
|
66
|
-
'For this reason, we recommend editing the block using your web browser.'
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
// Otherwise, the description mentions using the web editor (i.e. UBE).
|
|
70
|
-
else {
|
|
71
|
-
description +=
|
|
72
|
-
' ' +
|
|
73
|
-
/* translators: Recommendation included in a warning related to having blocks deeply nested. */
|
|
74
|
-
__(
|
|
75
|
-
'For this reason, we recommend editing the block using the web editor.'
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
// If the block can be flattened, we also suggest to ungroup the block.
|
|
79
|
-
if ( isUngroupable ) {
|
|
80
|
-
description +=
|
|
81
|
-
' ' +
|
|
82
|
-
/* translators: Alternative option included in a warning related to having blocks deeply nested. */
|
|
83
|
-
__(
|
|
84
|
-
'Alternatively, you can flatten the content by ungrouping the block.'
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<TouchableWithoutFeedback
|
|
90
|
-
disabled={ ! isSelected }
|
|
91
|
-
accessibilityLabel={ __( 'Warning message' ) }
|
|
92
|
-
accessibilityRole="button"
|
|
93
|
-
accessibilityHint={ __( 'Tap here to show more details.' ) }
|
|
94
|
-
onPress={ () => setShowDetails( true ) }
|
|
95
|
-
>
|
|
96
|
-
<View>
|
|
97
|
-
<Warning
|
|
98
|
-
message={ __(
|
|
99
|
-
'Block cannot be rendered because it is deeply nested. Tap here for more details.'
|
|
100
|
-
) }
|
|
101
|
-
/>
|
|
102
|
-
<UnsupportedBlockDetails
|
|
103
|
-
clientId={ clientId }
|
|
104
|
-
showSheet={ showDetails }
|
|
105
|
-
onCloseSheet={ () => setShowDetails( false ) }
|
|
106
|
-
title={ __( 'Deeply nested block' ) }
|
|
107
|
-
description={ description }
|
|
108
|
-
customActions={
|
|
109
|
-
isUngroupable
|
|
110
|
-
? [
|
|
111
|
-
{
|
|
112
|
-
label: __( 'Ungroup block' ),
|
|
113
|
-
onPress: onUngroup,
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
: EMPTY_ARRAY
|
|
117
|
-
}
|
|
118
|
-
/>
|
|
119
|
-
</View>
|
|
120
|
-
</TouchableWithoutFeedback>
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export default WarningMaxDepthExceeded;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useMemo } from '@wordpress/element';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import BlockTypesList from '../block-types-list';
|
|
11
|
-
import useClipboardBlock from './hooks/use-clipboard-block';
|
|
12
|
-
import useBlockTypeImpressions from './hooks/use-block-type-impressions';
|
|
13
|
-
import { createInserterSection, filterInserterItems } from './utils';
|
|
14
|
-
import useBlockTypesState from './hooks/use-block-types-state';
|
|
15
|
-
|
|
16
|
-
const getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];
|
|
17
|
-
|
|
18
|
-
function BlockTypesTab( { onSelect, rootClientId, listProps } ) {
|
|
19
|
-
const [ rawBlockTypes, , collections ] = useBlockTypesState(
|
|
20
|
-
rootClientId,
|
|
21
|
-
onSelect,
|
|
22
|
-
true
|
|
23
|
-
);
|
|
24
|
-
const clipboardBlock = useClipboardBlock( rootClientId );
|
|
25
|
-
const filteredBlockTypes = filterInserterItems( rawBlockTypes );
|
|
26
|
-
const blockTypes = clipboardBlock
|
|
27
|
-
? [ clipboardBlock, ...filteredBlockTypes ]
|
|
28
|
-
: filteredBlockTypes;
|
|
29
|
-
const { items, trackBlockTypeSelected } =
|
|
30
|
-
useBlockTypeImpressions( blockTypes );
|
|
31
|
-
|
|
32
|
-
const handleSelect = ( ...args ) => {
|
|
33
|
-
trackBlockTypeSelected( ...args );
|
|
34
|
-
onSelect( ...args );
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const collectionSections = useMemo( () => {
|
|
38
|
-
const result = [];
|
|
39
|
-
Object.keys( collections ).forEach( ( namespace ) => {
|
|
40
|
-
const data = items.filter(
|
|
41
|
-
( item ) => getBlockNamespace( item ) === namespace
|
|
42
|
-
);
|
|
43
|
-
if ( data.length > 0 ) {
|
|
44
|
-
result.push(
|
|
45
|
-
createInserterSection( {
|
|
46
|
-
key: `collection-${ namespace }`,
|
|
47
|
-
metadata: {
|
|
48
|
-
icon: collections[ namespace ].icon,
|
|
49
|
-
title: collections[ namespace ].title,
|
|
50
|
-
},
|
|
51
|
-
items: data,
|
|
52
|
-
} )
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
} );
|
|
56
|
-
|
|
57
|
-
return result;
|
|
58
|
-
}, [ items, collections ] );
|
|
59
|
-
|
|
60
|
-
const sections = [
|
|
61
|
-
createInserterSection( { key: 'default', items } ),
|
|
62
|
-
...collectionSections,
|
|
63
|
-
];
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<BlockTypesList
|
|
67
|
-
name="Blocks"
|
|
68
|
-
sections={ sections }
|
|
69
|
-
onSelect={ handleSelect }
|
|
70
|
-
listProps={ listProps }
|
|
71
|
-
label={ __( 'Blocks menu' ) }
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default BlockTypesTab;
|