@wordpress/block-editor 15.21.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 +17 -1
- package/build/components/block-compare/index.cjs +2 -2
- package/build/components/block-compare/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/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 +1 -1
- package/build/components/global-styles/dimensions-panel.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/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 +23 -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-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/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 +2 -2
- package/build-module/components/global-styles/dimensions-panel.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/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 +21 -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 +49 -46
- 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-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/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 +12 -13
- 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/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 +42 -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/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,62 +0,0 @@
|
|
|
1
|
-
.blockHolder {
|
|
2
|
-
flex: 1 1 auto;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.solidBorderColor {
|
|
6
|
-
border-color: $blue-40;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.solidBorderColorDark {
|
|
10
|
-
border-color: $blue-50;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.dimmed {
|
|
14
|
-
opacity: $dimmed-opacity;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.blockTitle {
|
|
18
|
-
background-color: $gray;
|
|
19
|
-
padding-left: 8px;
|
|
20
|
-
padding-top: 4px;
|
|
21
|
-
padding-bottom: 4px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.aztec_container {
|
|
25
|
-
flex: 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.blockCode {
|
|
29
|
-
font-family: $default-monospace-font;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.blockText {
|
|
33
|
-
min-height: 50px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.solidBorder {
|
|
37
|
-
position: absolute;
|
|
38
|
-
top: -6px;
|
|
39
|
-
bottom: -6px;
|
|
40
|
-
left: -6px;
|
|
41
|
-
right: -6px;
|
|
42
|
-
border-width: 2px;
|
|
43
|
-
border-radius: 2px;
|
|
44
|
-
border-style: solid;
|
|
45
|
-
z-index: 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.solidBorderCompact {
|
|
49
|
-
top: 0;
|
|
50
|
-
bottom: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
right: 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.solidBorderTextContent {
|
|
56
|
-
left: 0;
|
|
57
|
-
right: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.fullWidthPadding {
|
|
61
|
-
padding: $block-selected-to-content;
|
|
62
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import styles from './block-list-item.scss';
|
|
10
|
-
|
|
11
|
-
function Grid( props ) {
|
|
12
|
-
/**
|
|
13
|
-
* Since we don't have `calc()`, we must calculate our spacings here in
|
|
14
|
-
* order to preserve even spacing between tiles and equal width for tiles
|
|
15
|
-
* in a given row.
|
|
16
|
-
*
|
|
17
|
-
* In order to ensure equal sizing of tile contents, we distribute the
|
|
18
|
-
* spacing such that each tile has an equal "share" of the fixed spacing. To
|
|
19
|
-
* keep the tiles properly aligned within their rows, we calculate the left
|
|
20
|
-
* and right paddings based on the tile's relative position within the row.
|
|
21
|
-
*
|
|
22
|
-
* Note: we use padding instead of margins so that the fixed spacing is
|
|
23
|
-
* included within the relative spacing (i.e. width percentage), and
|
|
24
|
-
* wrapping behavior is preserved.
|
|
25
|
-
*
|
|
26
|
-
* - The left most tile in a row must have left padding of zero.
|
|
27
|
-
* - The right most tile in a row must have a right padding of zero.
|
|
28
|
-
*
|
|
29
|
-
* The values of these left and right paddings are interpolated for tiles in
|
|
30
|
-
* between. The right padding is complementary with the left padding of the
|
|
31
|
-
* next tile (i.e. the right padding of [tile n] + the left padding of
|
|
32
|
-
* [tile n + 1] will be equal for all tiles except the last one in a given
|
|
33
|
-
* row).
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
const { numOfColumns, children, tileCount, index, maxWidth } = props;
|
|
37
|
-
const lastTile = tileCount - 1;
|
|
38
|
-
const lastRow = Math.floor( lastTile / numOfColumns );
|
|
39
|
-
|
|
40
|
-
const row = Math.floor( index / numOfColumns );
|
|
41
|
-
const rowLength =
|
|
42
|
-
row === lastRow ? ( lastTile % numOfColumns ) + 1 : numOfColumns;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<View
|
|
46
|
-
style={ [
|
|
47
|
-
{
|
|
48
|
-
width: maxWidth / rowLength,
|
|
49
|
-
},
|
|
50
|
-
styles.gridItem,
|
|
51
|
-
] }
|
|
52
|
-
>
|
|
53
|
-
{ children }
|
|
54
|
-
</View>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default Grid;
|
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View, Platform, Pressable } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { useRef, useState, useCallback } from '@wordpress/element';
|
|
10
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
-
import { createBlock } from '@wordpress/blocks';
|
|
12
|
-
import {
|
|
13
|
-
KeyboardAwareFlatList,
|
|
14
|
-
WIDE_ALIGNMENTS,
|
|
15
|
-
alignmentHelpers,
|
|
16
|
-
} from '@wordpress/components';
|
|
17
|
-
import { __ } from '@wordpress/i18n';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
import styles from './style.scss';
|
|
23
|
-
import BlockListAppender from '../block-list-appender';
|
|
24
|
-
import BlockListItem from './block-list-item';
|
|
25
|
-
import BlockListItemCell from './block-list-item-cell';
|
|
26
|
-
import {
|
|
27
|
-
BlockListProvider,
|
|
28
|
-
DEFAULT_BLOCK_LIST_CONTEXT,
|
|
29
|
-
} from './block-list-context';
|
|
30
|
-
import { BlockDraggableWrapper } from '../block-draggable';
|
|
31
|
-
import { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';
|
|
32
|
-
import { store as blockEditorStore } from '../../store';
|
|
33
|
-
|
|
34
|
-
const identity = ( x ) => x;
|
|
35
|
-
|
|
36
|
-
const stylesMemo = {};
|
|
37
|
-
const getStyles = ( isStackedHorizontally, horizontalAlignment ) => {
|
|
38
|
-
const styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;
|
|
39
|
-
if ( stylesMemo[ styleName ] ) {
|
|
40
|
-
return stylesMemo[ styleName ];
|
|
41
|
-
}
|
|
42
|
-
const computedStyles = [
|
|
43
|
-
isStackedHorizontally && styles.horizontal,
|
|
44
|
-
horizontalAlignment && styles[ `is-aligned-${ horizontalAlignment }` ],
|
|
45
|
-
styles.overflowVisible,
|
|
46
|
-
];
|
|
47
|
-
stylesMemo[ styleName ] = computedStyles;
|
|
48
|
-
return computedStyles;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default function BlockList( {
|
|
52
|
-
blockWidth: initialBlockWidth,
|
|
53
|
-
contentResizeMode,
|
|
54
|
-
contentStyle,
|
|
55
|
-
filterInnerBlocks,
|
|
56
|
-
gridProperties,
|
|
57
|
-
header,
|
|
58
|
-
horizontal,
|
|
59
|
-
horizontalAlignment,
|
|
60
|
-
marginHorizontal = styles.defaultBlock.marginLeft,
|
|
61
|
-
marginVertical = styles.defaultBlock.marginTop,
|
|
62
|
-
onAddBlock,
|
|
63
|
-
onDeleteBlock,
|
|
64
|
-
orientation,
|
|
65
|
-
parentWidth,
|
|
66
|
-
renderAppender,
|
|
67
|
-
renderFooterAppender,
|
|
68
|
-
rootClientId,
|
|
69
|
-
withFooter = true,
|
|
70
|
-
} ) {
|
|
71
|
-
const {
|
|
72
|
-
blockClientIds,
|
|
73
|
-
blockCount,
|
|
74
|
-
blockInsertionPointIsVisible,
|
|
75
|
-
isReadOnly,
|
|
76
|
-
isRootList,
|
|
77
|
-
isFloatingToolbarVisible,
|
|
78
|
-
isStackedHorizontally,
|
|
79
|
-
maxWidth,
|
|
80
|
-
isRTL,
|
|
81
|
-
} = useSelect(
|
|
82
|
-
( select ) => {
|
|
83
|
-
const {
|
|
84
|
-
getBlockCount,
|
|
85
|
-
getBlockHierarchyRootClientId,
|
|
86
|
-
getBlockOrder,
|
|
87
|
-
getSelectedBlockClientId,
|
|
88
|
-
isBlockInsertionPointVisible,
|
|
89
|
-
getSettings,
|
|
90
|
-
} = select( blockEditorStore );
|
|
91
|
-
|
|
92
|
-
const selectedBlockClientId = getSelectedBlockClientId();
|
|
93
|
-
const rootBlockId = getBlockHierarchyRootClientId(
|
|
94
|
-
selectedBlockClientId
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
let blockOrder = getBlockOrder( rootClientId );
|
|
98
|
-
// Display only block which fulfill the condition in passed `filterInnerBlocks` function.
|
|
99
|
-
if ( filterInnerBlocks ) {
|
|
100
|
-
blockOrder = filterInnerBlocks( blockOrder );
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const {
|
|
104
|
-
isRTL: isRTLSetting,
|
|
105
|
-
maxWidth: maxWidthSetting,
|
|
106
|
-
readOnly,
|
|
107
|
-
} = getSettings();
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
blockClientIds: blockOrder,
|
|
111
|
-
blockCount: getBlockCount(),
|
|
112
|
-
blockInsertionPointIsVisible:
|
|
113
|
-
Platform.OS === 'ios' && isBlockInsertionPointVisible(),
|
|
114
|
-
isReadOnly: readOnly,
|
|
115
|
-
isRootList: rootClientId === undefined,
|
|
116
|
-
isFloatingToolbarVisible:
|
|
117
|
-
!! selectedBlockClientId && !! getBlockCount( rootBlockId ),
|
|
118
|
-
isStackedHorizontally: orientation === 'horizontal',
|
|
119
|
-
maxWidth: maxWidthSetting,
|
|
120
|
-
isRTL: isRTLSetting,
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
[ filterInnerBlocks, orientation, rootClientId ]
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const { insertBlock, clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
127
|
-
|
|
128
|
-
const extraData = useRef( {
|
|
129
|
-
parentWidth,
|
|
130
|
-
renderFooterAppender,
|
|
131
|
-
renderAppender,
|
|
132
|
-
onDeleteBlock,
|
|
133
|
-
contentStyle,
|
|
134
|
-
} );
|
|
135
|
-
|
|
136
|
-
const [ blockWidth, setBlockWidth ] = useState( initialBlockWidth || 0 );
|
|
137
|
-
|
|
138
|
-
const addBlockToEndOfPost = ( newBlock ) => {
|
|
139
|
-
insertBlock( newBlock, blockCount );
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const scrollRef = useRef( null );
|
|
143
|
-
|
|
144
|
-
const shouldFlatListPreventAutomaticScroll = () =>
|
|
145
|
-
blockInsertionPointIsVisible;
|
|
146
|
-
|
|
147
|
-
const shouldShowInnerBlockAppender = () =>
|
|
148
|
-
renderAppender && blockClientIds.length > 0;
|
|
149
|
-
|
|
150
|
-
const getExtraData = () => {
|
|
151
|
-
if (
|
|
152
|
-
extraData.current.parentWidth !== parentWidth ||
|
|
153
|
-
extraData.current.renderFooterAppender !== renderFooterAppender ||
|
|
154
|
-
extraData.current.onDeleteBlock !== onDeleteBlock ||
|
|
155
|
-
extraData.current.contentStyle !== contentStyle ||
|
|
156
|
-
extraData.current.renderAppender !== renderAppender ||
|
|
157
|
-
extraData.current.blockWidth !== blockWidth ||
|
|
158
|
-
extraData.current.gridProperties !== gridProperties
|
|
159
|
-
) {
|
|
160
|
-
extraData.current = {
|
|
161
|
-
parentWidth,
|
|
162
|
-
renderFooterAppender,
|
|
163
|
-
onDeleteBlock,
|
|
164
|
-
contentStyle,
|
|
165
|
-
renderAppender,
|
|
166
|
-
blockWidth,
|
|
167
|
-
gridProperties,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
return extraData.current;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const onLayout = ( { nativeEvent } ) => {
|
|
174
|
-
const { layout } = nativeEvent;
|
|
175
|
-
|
|
176
|
-
const layoutWidth = Math.floor( layout.width );
|
|
177
|
-
if ( isRootList && blockWidth !== layoutWidth ) {
|
|
178
|
-
setBlockWidth( Math.min( layoutWidth, maxWidth ) );
|
|
179
|
-
} else if ( ! isRootList && ! blockWidth ) {
|
|
180
|
-
setBlockWidth( Math.min( layoutWidth, maxWidth ) );
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
const renderItem = ( { item: clientId, index } ) => {
|
|
185
|
-
// Extracting the grid item properties here to avoid
|
|
186
|
-
// re-renders in the blockListItem component.
|
|
187
|
-
const isGridItem = !! gridProperties;
|
|
188
|
-
const gridItemProps = gridProperties && {
|
|
189
|
-
numOfColumns: gridProperties.numColumns,
|
|
190
|
-
tileCount: blockClientIds.length,
|
|
191
|
-
tileIndex: blockClientIds.indexOf( clientId ),
|
|
192
|
-
};
|
|
193
|
-
return (
|
|
194
|
-
<BlockListItem
|
|
195
|
-
index={ index }
|
|
196
|
-
isStackedHorizontally={ isStackedHorizontally }
|
|
197
|
-
rootClientId={ rootClientId }
|
|
198
|
-
clientId={ clientId }
|
|
199
|
-
parentWidth={ parentWidth }
|
|
200
|
-
contentResizeMode={ contentResizeMode }
|
|
201
|
-
contentStyle={ contentStyle }
|
|
202
|
-
onAddBlock={ onAddBlock }
|
|
203
|
-
marginVertical={ marginVertical }
|
|
204
|
-
marginHorizontal={ marginHorizontal }
|
|
205
|
-
onDeleteBlock={ onDeleteBlock }
|
|
206
|
-
shouldShowInnerBlockAppender={ shouldShowInnerBlockAppender }
|
|
207
|
-
blockWidth={ blockWidth }
|
|
208
|
-
isGridItem={ isGridItem }
|
|
209
|
-
{ ...gridItemProps }
|
|
210
|
-
/>
|
|
211
|
-
);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const { blockToolbar, floatingToolbar } = styles;
|
|
215
|
-
|
|
216
|
-
const containerStyle = {
|
|
217
|
-
flex: isRootList ? 1 : 0,
|
|
218
|
-
// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.
|
|
219
|
-
marginVertical: isRootList ? 0 : -marginVertical,
|
|
220
|
-
marginHorizontal: isRootList ? 0 : -marginHorizontal,
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const isContentStretch = contentResizeMode === 'stretch';
|
|
224
|
-
const isMultiBlocks = blockClientIds.length > 1;
|
|
225
|
-
const { isWider } = alignmentHelpers;
|
|
226
|
-
const extraScrollHeight =
|
|
227
|
-
blockToolbar.height +
|
|
228
|
-
( isFloatingToolbarVisible ? floatingToolbar.height : 0 );
|
|
229
|
-
|
|
230
|
-
return (
|
|
231
|
-
<View
|
|
232
|
-
style={ containerStyle }
|
|
233
|
-
onAccessibilityEscape={ clearSelectedBlock }
|
|
234
|
-
onLayout={ onLayout }
|
|
235
|
-
testID="block-list-wrapper"
|
|
236
|
-
>
|
|
237
|
-
{ isRootList ? (
|
|
238
|
-
<BlockListProvider
|
|
239
|
-
value={ {
|
|
240
|
-
...DEFAULT_BLOCK_LIST_CONTEXT,
|
|
241
|
-
scrollRef: scrollRef.current,
|
|
242
|
-
} }
|
|
243
|
-
>
|
|
244
|
-
<BlockDraggableWrapper isRTL={ isRTL }>
|
|
245
|
-
{ ( { onScroll } ) => (
|
|
246
|
-
<KeyboardAwareFlatList
|
|
247
|
-
accessibilityLabel="block-list"
|
|
248
|
-
ref={ scrollRef }
|
|
249
|
-
extraScrollHeight={ extraScrollHeight }
|
|
250
|
-
keyboardShouldPersistTaps="always"
|
|
251
|
-
extraData={ getExtraData() }
|
|
252
|
-
scrollEnabled={ isRootList }
|
|
253
|
-
contentContainerStyle={ [
|
|
254
|
-
horizontal &&
|
|
255
|
-
styles.horizontalContentContainer,
|
|
256
|
-
isWider( blockWidth, 'medium' ) &&
|
|
257
|
-
( isContentStretch && isMultiBlocks
|
|
258
|
-
? styles.horizontalContentContainerStretch
|
|
259
|
-
: styles.horizontalContentContainerCenter ),
|
|
260
|
-
] }
|
|
261
|
-
data={ blockClientIds }
|
|
262
|
-
keyExtractor={ identity }
|
|
263
|
-
renderItem={ renderItem }
|
|
264
|
-
CellRendererComponent={ BlockListItemCell }
|
|
265
|
-
shouldPreventAutomaticScroll={
|
|
266
|
-
shouldFlatListPreventAutomaticScroll
|
|
267
|
-
}
|
|
268
|
-
ListHeaderComponent={ header }
|
|
269
|
-
ListEmptyComponent={
|
|
270
|
-
! isReadOnly && (
|
|
271
|
-
<EmptyList
|
|
272
|
-
orientation={ orientation }
|
|
273
|
-
rootClientId={ rootClientId }
|
|
274
|
-
renderAppender={ renderAppender }
|
|
275
|
-
renderFooterAppender={
|
|
276
|
-
renderFooterAppender
|
|
277
|
-
}
|
|
278
|
-
/>
|
|
279
|
-
)
|
|
280
|
-
}
|
|
281
|
-
ListFooterComponent={
|
|
282
|
-
<Footer
|
|
283
|
-
addBlockToEndOfPost={
|
|
284
|
-
addBlockToEndOfPost
|
|
285
|
-
}
|
|
286
|
-
isReadOnly={ isReadOnly }
|
|
287
|
-
renderFooterAppender={
|
|
288
|
-
renderFooterAppender
|
|
289
|
-
}
|
|
290
|
-
withFooter={ withFooter }
|
|
291
|
-
/>
|
|
292
|
-
}
|
|
293
|
-
onScroll={ onScroll }
|
|
294
|
-
/>
|
|
295
|
-
) }
|
|
296
|
-
</BlockDraggableWrapper>
|
|
297
|
-
</BlockListProvider>
|
|
298
|
-
) : (
|
|
299
|
-
<>
|
|
300
|
-
{ blockClientIds.length > 0 ? (
|
|
301
|
-
<View style={ [ { flex: 0 }, styles.overflowVisible ] }>
|
|
302
|
-
<View
|
|
303
|
-
style={ [
|
|
304
|
-
...getStyles(
|
|
305
|
-
isStackedHorizontally,
|
|
306
|
-
horizontalAlignment
|
|
307
|
-
),
|
|
308
|
-
horizontal &&
|
|
309
|
-
styles.horizontalContentContainer,
|
|
310
|
-
] }
|
|
311
|
-
>
|
|
312
|
-
{ blockClientIds.map(
|
|
313
|
-
( currentClientId, index ) => {
|
|
314
|
-
return (
|
|
315
|
-
<View key={ currentClientId }>
|
|
316
|
-
{ renderItem( {
|
|
317
|
-
item: currentClientId,
|
|
318
|
-
index,
|
|
319
|
-
} ) }
|
|
320
|
-
</View>
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
) }
|
|
324
|
-
<Footer
|
|
325
|
-
addBlockToEndOfPost={ addBlockToEndOfPost }
|
|
326
|
-
isReadOnly={ isReadOnly }
|
|
327
|
-
renderFooterAppender={
|
|
328
|
-
renderFooterAppender
|
|
329
|
-
}
|
|
330
|
-
withFooter={ withFooter }
|
|
331
|
-
/>
|
|
332
|
-
</View>
|
|
333
|
-
</View>
|
|
334
|
-
) : (
|
|
335
|
-
<EmptyList
|
|
336
|
-
orientation={ orientation }
|
|
337
|
-
rootClientId={ rootClientId }
|
|
338
|
-
renderAppender={ renderAppender }
|
|
339
|
-
renderFooterAppender={ renderFooterAppender }
|
|
340
|
-
/>
|
|
341
|
-
) }
|
|
342
|
-
</>
|
|
343
|
-
) }
|
|
344
|
-
{ shouldShowInnerBlockAppender() && (
|
|
345
|
-
<View
|
|
346
|
-
style={ {
|
|
347
|
-
marginHorizontal:
|
|
348
|
-
marginHorizontal - styles.innerAppender.marginLeft,
|
|
349
|
-
} }
|
|
350
|
-
>
|
|
351
|
-
<BlockListAppender
|
|
352
|
-
rootClientId={ rootClientId }
|
|
353
|
-
renderAppender={ renderAppender }
|
|
354
|
-
showSeparator
|
|
355
|
-
/>
|
|
356
|
-
</View>
|
|
357
|
-
) }
|
|
358
|
-
</View>
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function Footer( {
|
|
363
|
-
addBlockToEndOfPost,
|
|
364
|
-
isReadOnly,
|
|
365
|
-
renderFooterAppender,
|
|
366
|
-
withFooter,
|
|
367
|
-
} ) {
|
|
368
|
-
const onAddParagraphBlock = useCallback( () => {
|
|
369
|
-
const paragraphBlock = createBlock( 'core/paragraph' );
|
|
370
|
-
addBlockToEndOfPost( paragraphBlock );
|
|
371
|
-
}, [ addBlockToEndOfPost ] );
|
|
372
|
-
|
|
373
|
-
if ( ! isReadOnly && withFooter ) {
|
|
374
|
-
return (
|
|
375
|
-
<Pressable
|
|
376
|
-
accessibilityLabel={ __( 'Add paragraph block' ) }
|
|
377
|
-
testID={ __( 'Add paragraph block' ) }
|
|
378
|
-
onPress={ onAddParagraphBlock }
|
|
379
|
-
>
|
|
380
|
-
<View style={ styles.blockListFooter } />
|
|
381
|
-
</Pressable>
|
|
382
|
-
);
|
|
383
|
-
} else if ( renderFooterAppender ) {
|
|
384
|
-
return <View>{ renderFooterAppender() }</View>;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return null;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function EmptyList( {
|
|
391
|
-
orientation,
|
|
392
|
-
renderAppender,
|
|
393
|
-
renderFooterAppender,
|
|
394
|
-
rootClientId,
|
|
395
|
-
} ) {
|
|
396
|
-
const { shouldShowInsertionPoint } = useSelect( ( select ) => {
|
|
397
|
-
const {
|
|
398
|
-
getBlockOrder,
|
|
399
|
-
getBlockInsertionPoint,
|
|
400
|
-
isBlockInsertionPointVisible,
|
|
401
|
-
} = select( blockEditorStore );
|
|
402
|
-
|
|
403
|
-
const isStackedHorizontally = orientation === 'horizontal';
|
|
404
|
-
const blockClientIds = getBlockOrder( rootClientId );
|
|
405
|
-
const insertionPoint = getBlockInsertionPoint();
|
|
406
|
-
const blockInsertionPointIsVisible = isBlockInsertionPointVisible();
|
|
407
|
-
|
|
408
|
-
return {
|
|
409
|
-
shouldShowInsertionPoint:
|
|
410
|
-
! isStackedHorizontally &&
|
|
411
|
-
blockInsertionPointIsVisible &&
|
|
412
|
-
insertionPoint.rootClientId === rootClientId &&
|
|
413
|
-
// If list is empty, show the insertion point (via the default appender)
|
|
414
|
-
( blockClientIds.length === 0 ||
|
|
415
|
-
// Or if the insertion point is right before the denoted block.
|
|
416
|
-
! blockClientIds[ insertionPoint.index ] ),
|
|
417
|
-
};
|
|
418
|
-
} );
|
|
419
|
-
const align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;
|
|
420
|
-
const [ wrapperStyles ] = useEditorWrapperStyles( { align } );
|
|
421
|
-
|
|
422
|
-
if ( renderFooterAppender || renderAppender === false ) {
|
|
423
|
-
return null;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
const containerStyles = [ styles.defaultAppender, wrapperStyles ];
|
|
427
|
-
|
|
428
|
-
return (
|
|
429
|
-
<View style={ containerStyles }>
|
|
430
|
-
<BlockListAppender
|
|
431
|
-
rootClientId={ rootClientId }
|
|
432
|
-
renderAppender={ renderAppender }
|
|
433
|
-
showSeparator={ shouldShowInsertionPoint }
|
|
434
|
-
/>
|
|
435
|
-
</View>
|
|
436
|
-
);
|
|
437
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Text, View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { withPreferredColorScheme } from '@wordpress/compose';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import styles from './style.scss';
|
|
16
|
-
|
|
17
|
-
const BlockInsertionPoint = ( { getStylesFromColorScheme, testID } ) => {
|
|
18
|
-
const lineStyle = getStylesFromColorScheme(
|
|
19
|
-
styles.lineStyleAddHere,
|
|
20
|
-
styles.lineStyleAddHereDark
|
|
21
|
-
);
|
|
22
|
-
const labelStyle = getStylesFromColorScheme(
|
|
23
|
-
styles.labelStyleAddHere,
|
|
24
|
-
styles.labelStyleAddHereDark
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<View style={ styles.containerStyleAddHere } testID={ testID }>
|
|
29
|
-
<View style={ lineStyle }></View>
|
|
30
|
-
<Text style={ labelStyle }>{ __( 'ADD BLOCK HERE' ) }</Text>
|
|
31
|
-
<View style={ lineStyle }></View>
|
|
32
|
-
</View>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default withPreferredColorScheme( BlockInsertionPoint );
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
flex: 1;
|
|
3
|
-
justify-content: flex-start;
|
|
4
|
-
background-color: #fff;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.horizontalContentContainer {
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
justify-content: flex-start;
|
|
10
|
-
align-items: stretch;
|
|
11
|
-
overflow: visible;
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.horizontalContentContainerStretch {
|
|
16
|
-
justify-content: space-evenly;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.horizontalContentContainerCenter {
|
|
20
|
-
justify-content: center;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.switch {
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
justify-content: flex-start;
|
|
26
|
-
align-items: center;
|
|
27
|
-
margin: 10px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.switchLabel {
|
|
31
|
-
margin-left: 10px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.lineStyleAddHere {
|
|
35
|
-
flex: 1;
|
|
36
|
-
background-color: #0087be; // blue_wordpress
|
|
37
|
-
align-self: center;
|
|
38
|
-
height: 2px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.lineStyleAddHereDark {
|
|
42
|
-
background-color: $gray-50;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.labelStyleAddHere {
|
|
46
|
-
flex: 1;
|
|
47
|
-
text-align: center;
|
|
48
|
-
font-family: $default-monospace-font;
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
color: $gray;
|
|
51
|
-
margin: 0 8px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.labelStyleAddHereDark {
|
|
55
|
-
color: $gray-20;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.containerStyleAddHere {
|
|
59
|
-
flex-direction: row;
|
|
60
|
-
padding-left: 12px;
|
|
61
|
-
padding-right: 12px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.blockListFooter {
|
|
65
|
-
height: 80px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.defaultBlock {
|
|
69
|
-
margin: $block-edge-to-content * 0.5 $block-edge-to-content;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.defaultAppender {
|
|
73
|
-
margin-top: $grid-unit;
|
|
74
|
-
margin-bottom: $grid-unit;
|
|
75
|
-
width: 100%;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.innerAppender {
|
|
79
|
-
margin: $block-edge-to-content * 0.5;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.blockBorder {
|
|
83
|
-
width: $block-selected-border-width;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.headerToolbar {
|
|
87
|
-
height: $mobile-header-toolbar-height;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.blockToolbar {
|
|
91
|
-
height: $mobile-block-toolbar-height;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.floatingToolbar {
|
|
95
|
-
height: $mobile-floating-toolbar-height + 2 * $mobile-floating-toolbar-margin;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.horizontal {
|
|
99
|
-
flex-direction: row;
|
|
100
|
-
flex-wrap: wrap;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.is-aligned-left {
|
|
104
|
-
justify-content: flex-start;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.is-aligned-center {
|
|
108
|
-
justify-content: center;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.is-aligned-right {
|
|
112
|
-
justify-content: flex-end;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.overflowVisible {
|
|
116
|
-
overflow: visible;
|
|
117
|
-
}
|