@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,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
Dimensions,
|
|
6
|
-
FlatList,
|
|
7
|
-
SectionList,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
Text,
|
|
10
|
-
TouchableWithoutFeedback,
|
|
11
|
-
View,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
18
|
-
import { BottomSheet, Gradient } from '@wordpress/components';
|
|
19
|
-
import {
|
|
20
|
-
usePreferredColorScheme,
|
|
21
|
-
usePreferredColorSchemeStyle,
|
|
22
|
-
} from '@wordpress/compose';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
import styles from './style.scss';
|
|
28
|
-
import InserterButton from '../inserter-button';
|
|
29
|
-
|
|
30
|
-
const MIN_COL_NUM = 3;
|
|
31
|
-
|
|
32
|
-
export default function BlockTypesList( {
|
|
33
|
-
name,
|
|
34
|
-
sections,
|
|
35
|
-
onSelect,
|
|
36
|
-
label,
|
|
37
|
-
listProps,
|
|
38
|
-
initialNumToRender = 3,
|
|
39
|
-
} ) {
|
|
40
|
-
const [ numberOfColumns, setNumberOfColumns ] = useState( MIN_COL_NUM );
|
|
41
|
-
const [ itemWidth, setItemWidth ] = useState();
|
|
42
|
-
const [ maxWidth, setMaxWidth ] = useState();
|
|
43
|
-
|
|
44
|
-
useEffect( () => {
|
|
45
|
-
const dimensionsChangeSubscription = Dimensions.addEventListener(
|
|
46
|
-
'change',
|
|
47
|
-
onLayout
|
|
48
|
-
);
|
|
49
|
-
onLayout();
|
|
50
|
-
return () => {
|
|
51
|
-
dimensionsChangeSubscription.remove();
|
|
52
|
-
};
|
|
53
|
-
}, [] );
|
|
54
|
-
|
|
55
|
-
function calculateItemWidth() {
|
|
56
|
-
const { paddingLeft: itemPaddingLeft, paddingRight: itemPaddingRight } =
|
|
57
|
-
InserterButton.Styles.modalItem;
|
|
58
|
-
const { width } = InserterButton.Styles.modalIconWrapper;
|
|
59
|
-
return width + itemPaddingLeft + itemPaddingRight;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function onLayout() {
|
|
63
|
-
const columnStyle = styles[ 'block-types-list__column' ];
|
|
64
|
-
const sumLeftRightPadding =
|
|
65
|
-
columnStyle.paddingLeft + columnStyle.paddingRight;
|
|
66
|
-
|
|
67
|
-
const bottomSheetWidth = BottomSheet.getWidth();
|
|
68
|
-
const containerTotalWidth = bottomSheetWidth - sumLeftRightPadding;
|
|
69
|
-
const itemTotalWidth = calculateItemWidth();
|
|
70
|
-
|
|
71
|
-
const columnsFitToWidth = Math.floor(
|
|
72
|
-
containerTotalWidth / itemTotalWidth
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
const numColumns = Math.max( MIN_COL_NUM, columnsFitToWidth );
|
|
76
|
-
|
|
77
|
-
setNumberOfColumns( numColumns );
|
|
78
|
-
setMaxWidth( containerTotalWidth / numColumns );
|
|
79
|
-
|
|
80
|
-
if ( columnsFitToWidth < MIN_COL_NUM ) {
|
|
81
|
-
const updatedItemWidth =
|
|
82
|
-
( bottomSheetWidth - 2 * sumLeftRightPadding ) / MIN_COL_NUM;
|
|
83
|
-
setItemWidth( updatedItemWidth );
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const contentContainerStyle = StyleSheet.flatten(
|
|
88
|
-
listProps.contentContainerStyle
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
const renderSection = ( { item } ) => {
|
|
92
|
-
return (
|
|
93
|
-
<TouchableWithoutFeedback accessible={ false }>
|
|
94
|
-
<FlatList
|
|
95
|
-
data={ item.list }
|
|
96
|
-
key={ `InserterUI-${ name }-${ numberOfColumns }` } // Re-render when numberOfColumns changes.
|
|
97
|
-
numColumns={ numberOfColumns }
|
|
98
|
-
ItemSeparatorComponent={ () => (
|
|
99
|
-
<TouchableWithoutFeedback accessible={ false }>
|
|
100
|
-
<View
|
|
101
|
-
style={
|
|
102
|
-
styles[ 'block-types-list__row-separator' ]
|
|
103
|
-
}
|
|
104
|
-
/>
|
|
105
|
-
</TouchableWithoutFeedback>
|
|
106
|
-
) }
|
|
107
|
-
scrollEnabled={ false }
|
|
108
|
-
renderItem={ renderListItem }
|
|
109
|
-
/>
|
|
110
|
-
</TouchableWithoutFeedback>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const renderListItem = ( { item } ) => {
|
|
115
|
-
return (
|
|
116
|
-
<InserterButton
|
|
117
|
-
item={ item }
|
|
118
|
-
itemWidth={ itemWidth }
|
|
119
|
-
maxWidth={ maxWidth }
|
|
120
|
-
onSelect={ onSelect }
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const colorScheme = usePreferredColorScheme();
|
|
126
|
-
const sectionHeaderGradientValue =
|
|
127
|
-
colorScheme === 'light'
|
|
128
|
-
? 'linear-gradient(#fff 70%, rgba(255, 255, 255, 0))'
|
|
129
|
-
: 'linear-gradient(#2e2e2e 70%, rgba(46, 46, 46, 0))';
|
|
130
|
-
const sectionHeaderTitleStyles = usePreferredColorSchemeStyle(
|
|
131
|
-
styles[ 'block-types-list__section-header-title' ],
|
|
132
|
-
styles[ 'block-types-list__section-header-title--dark' ]
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const renderSectionHeader = ( { section: { metadata } } ) => {
|
|
136
|
-
if ( ! metadata?.icon || ! metadata?.title ) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<TouchableWithoutFeedback accessible={ false }>
|
|
142
|
-
<Gradient
|
|
143
|
-
gradientValue={ sectionHeaderGradientValue }
|
|
144
|
-
style={ styles[ 'block-types-list__section-header' ] }
|
|
145
|
-
>
|
|
146
|
-
{ metadata?.icon }
|
|
147
|
-
<Text style={ sectionHeaderTitleStyles }>
|
|
148
|
-
{ metadata?.title }
|
|
149
|
-
</Text>
|
|
150
|
-
</Gradient>
|
|
151
|
-
</TouchableWithoutFeedback>
|
|
152
|
-
);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
return (
|
|
156
|
-
<SectionList
|
|
157
|
-
onLayout={ onLayout }
|
|
158
|
-
testID={ `InserterUI-${ name }` }
|
|
159
|
-
accessibilityLabel={ label }
|
|
160
|
-
keyboardShouldPersistTaps="always"
|
|
161
|
-
sections={ sections }
|
|
162
|
-
initialNumToRender={ initialNumToRender }
|
|
163
|
-
renderItem={ renderSection }
|
|
164
|
-
renderSectionHeader={ renderSectionHeader }
|
|
165
|
-
{ ...listProps }
|
|
166
|
-
contentContainerStyle={ {
|
|
167
|
-
...contentContainerStyle,
|
|
168
|
-
paddingBottom: Math.max(
|
|
169
|
-
listProps.safeAreaBottomInset,
|
|
170
|
-
contentContainerStyle.paddingBottom
|
|
171
|
-
),
|
|
172
|
-
} }
|
|
173
|
-
/>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
.block-types-list__row-separator {
|
|
2
|
-
height: 12px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.block-types-list__column {
|
|
6
|
-
padding: $grid-unit-20;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.block-types-list__section-header {
|
|
10
|
-
align-items: center;
|
|
11
|
-
flex-direction: row;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
padding-bottom: 16;
|
|
14
|
-
padding-top: 32;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.block-types-list__section-header-title {
|
|
18
|
-
color: $black;
|
|
19
|
-
font-size: 16px;
|
|
20
|
-
margin-left: 10px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.block-types-list__section-header-title--dark {
|
|
24
|
-
color: $white;
|
|
25
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
Text,
|
|
8
|
-
TouchableWithoutFeedback,
|
|
9
|
-
Platform,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { useDispatch } from '@wordpress/data';
|
|
16
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
17
|
-
import { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';
|
|
18
|
-
import { __ } from '@wordpress/i18n';
|
|
19
|
-
import {
|
|
20
|
-
PanelBody,
|
|
21
|
-
BottomSheet,
|
|
22
|
-
FooterMessageControl,
|
|
23
|
-
} from '@wordpress/components';
|
|
24
|
-
import { Icon, close } from '@wordpress/icons';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Internal dependencies
|
|
28
|
-
*/
|
|
29
|
-
import styles from './style.scss';
|
|
30
|
-
import { store as blockEditorStore } from '../../store';
|
|
31
|
-
import InserterButton from '../inserter-button';
|
|
32
|
-
|
|
33
|
-
const hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };
|
|
34
|
-
|
|
35
|
-
function BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {
|
|
36
|
-
const { replaceInnerBlocks } = useDispatch( blockEditorStore );
|
|
37
|
-
const isIOS = Platform.OS === 'ios';
|
|
38
|
-
|
|
39
|
-
const cancelButtonStyle = usePreferredColorSchemeStyle(
|
|
40
|
-
styles.cancelButton,
|
|
41
|
-
styles.cancelButtonDark
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const leftButton = (
|
|
45
|
-
<TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>
|
|
46
|
-
<View>
|
|
47
|
-
{ isIOS ? (
|
|
48
|
-
<Text
|
|
49
|
-
style={ cancelButtonStyle }
|
|
50
|
-
maxFontSizeMultiplier={ 2 }
|
|
51
|
-
>
|
|
52
|
-
{ __( 'Cancel' ) }
|
|
53
|
-
</Text>
|
|
54
|
-
) : (
|
|
55
|
-
<Icon
|
|
56
|
-
icon={ close }
|
|
57
|
-
size={ 24 }
|
|
58
|
-
style={ styles.closeIcon }
|
|
59
|
-
/>
|
|
60
|
-
) }
|
|
61
|
-
</View>
|
|
62
|
-
</TouchableWithoutFeedback>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const onVariationSelect = ( variation ) => {
|
|
66
|
-
replaceInnerBlocks(
|
|
67
|
-
clientId,
|
|
68
|
-
createBlocksFromInnerBlocksTemplate( variation.innerBlocks )
|
|
69
|
-
);
|
|
70
|
-
onClose();
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<BottomSheet
|
|
75
|
-
isVisible={ isVisible }
|
|
76
|
-
onClose={ onClose }
|
|
77
|
-
title={ __( 'Select a layout' ) }
|
|
78
|
-
contentStyle={ styles.contentStyle }
|
|
79
|
-
leftButton={ leftButton }
|
|
80
|
-
testID="block-variation-modal"
|
|
81
|
-
>
|
|
82
|
-
<ScrollView
|
|
83
|
-
horizontal
|
|
84
|
-
showsHorizontalScrollIndicator={ false }
|
|
85
|
-
contentContainerStyle={ styles.contentContainerStyle }
|
|
86
|
-
style={ styles.containerStyle }
|
|
87
|
-
>
|
|
88
|
-
{ variations.map( ( v ) => (
|
|
89
|
-
<InserterButton
|
|
90
|
-
item={ v }
|
|
91
|
-
key={ v.name }
|
|
92
|
-
onSelect={ () => onVariationSelect( v ) }
|
|
93
|
-
/>
|
|
94
|
-
) ) }
|
|
95
|
-
</ScrollView>
|
|
96
|
-
<PanelBody>
|
|
97
|
-
<FooterMessageControl
|
|
98
|
-
label={ __(
|
|
99
|
-
'Note: Column layout may vary between themes and screen sizes'
|
|
100
|
-
) }
|
|
101
|
-
/>
|
|
102
|
-
</PanelBody>
|
|
103
|
-
</BottomSheet>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export default BlockVariationPicker;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.contentContainerStyle {
|
|
2
|
-
flex-direction: row;
|
|
3
|
-
padding-bottom: $grid-unit-15;
|
|
4
|
-
padding-left: $grid-unit-20 * 0.5;
|
|
5
|
-
padding-right: $grid-unit-20 * 0.5;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.containerStyle {
|
|
9
|
-
padding-top: $grid-unit-15;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.contentStyle {
|
|
13
|
-
padding-left: 0;
|
|
14
|
-
padding-right: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cancelButton {
|
|
18
|
-
color: $blue-wordpress;
|
|
19
|
-
font-size: 16px;
|
|
20
|
-
padding-left: $grid-unit-20;
|
|
21
|
-
padding-right: $grid-unit-20;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.cancelButtonDark {
|
|
25
|
-
color: $blue-30;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.closeIcon {
|
|
29
|
-
color: $gray;
|
|
30
|
-
margin-left: $grid-unit-20;
|
|
31
|
-
padding: $grid-unit-20;
|
|
32
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { withPreferredColorScheme } from '@wordpress/compose';
|
|
10
|
-
import { Button } from '@wordpress/components';
|
|
11
|
-
import { Icon, plusCircleFilled } from '@wordpress/icons';
|
|
12
|
-
import { useCallback } from '@wordpress/element';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import Inserter from '../inserter';
|
|
18
|
-
import styles from './styles.scss';
|
|
19
|
-
|
|
20
|
-
function ButtonBlockAppender( {
|
|
21
|
-
rootClientId,
|
|
22
|
-
getStylesFromColorScheme,
|
|
23
|
-
showSeparator,
|
|
24
|
-
isFloating = false,
|
|
25
|
-
onAddBlock,
|
|
26
|
-
} ) {
|
|
27
|
-
const onAppenderPress = useCallback(
|
|
28
|
-
( onToggle ) => () => {
|
|
29
|
-
if ( onAddBlock ) {
|
|
30
|
-
onAddBlock();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if ( onToggle ) {
|
|
35
|
-
onToggle();
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
[ onAddBlock ]
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const appenderStyle = {
|
|
42
|
-
...styles.appender,
|
|
43
|
-
...getStylesFromColorScheme(
|
|
44
|
-
styles.appenderLight,
|
|
45
|
-
styles.appenderDark
|
|
46
|
-
),
|
|
47
|
-
};
|
|
48
|
-
const addBlockButtonStyle = getStylesFromColorScheme(
|
|
49
|
-
styles.addBlockButton,
|
|
50
|
-
isFloating
|
|
51
|
-
? styles.floatingAddBlockButtonDark
|
|
52
|
-
: styles.addBlockButtonDark
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<Inserter
|
|
58
|
-
rootClientId={ rootClientId }
|
|
59
|
-
renderToggle={ ( { onToggle, disabled, isOpen } ) => (
|
|
60
|
-
<Button
|
|
61
|
-
testID="appender-button"
|
|
62
|
-
onClick={ onAppenderPress( onToggle ) }
|
|
63
|
-
aria-expanded={ isOpen }
|
|
64
|
-
disabled={ disabled }
|
|
65
|
-
fixedRatio={ false }
|
|
66
|
-
>
|
|
67
|
-
<View
|
|
68
|
-
style={ [
|
|
69
|
-
appenderStyle,
|
|
70
|
-
isFloating && styles.floatingAppender,
|
|
71
|
-
] }
|
|
72
|
-
>
|
|
73
|
-
<Icon
|
|
74
|
-
icon={ plusCircleFilled }
|
|
75
|
-
style={ addBlockButtonStyle }
|
|
76
|
-
color={ addBlockButtonStyle.color }
|
|
77
|
-
size={ addBlockButtonStyle.size }
|
|
78
|
-
/>
|
|
79
|
-
</View>
|
|
80
|
-
</Button>
|
|
81
|
-
) }
|
|
82
|
-
isAppender
|
|
83
|
-
showSeparator={ showSeparator }
|
|
84
|
-
/>
|
|
85
|
-
</>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md
|
|
91
|
-
*/
|
|
92
|
-
export default withPreferredColorScheme( ButtonBlockAppender );
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
.appender {
|
|
2
|
-
flex: 1;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
padding: 9px;
|
|
6
|
-
margin-left: $grid-unit;
|
|
7
|
-
margin-right: $grid-unit;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.floatingAppender {
|
|
12
|
-
flex: none;
|
|
13
|
-
background-color: transparent;
|
|
14
|
-
border-width: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.appenderLight {
|
|
18
|
-
background-color: $white;
|
|
19
|
-
border: $border-width solid $light-gray-500;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.appenderDark {
|
|
23
|
-
background-color: $background-dark-secondary;
|
|
24
|
-
border: $border-width solid $gray-70;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.addBlockButton {
|
|
28
|
-
color: $white;
|
|
29
|
-
background-color: $gray;
|
|
30
|
-
border-radius: $button-size-small * 0.5;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
size: $button-size-small;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.addBlockButtonDark {
|
|
36
|
-
color: $background-dark-secondary;
|
|
37
|
-
background-color: $gray-40;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.floatingAddBlockButtonDark {
|
|
41
|
-
color: $black;
|
|
42
|
-
background-color: $gray-40;
|
|
43
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
## Caption
|
|
2
|
-
|
|
3
|
-
The `Caption` component renders the [caption part](https://wordpress.org/documentation/article/gallery-block/#caption) of some blocks (image, gallery...).
|
|
4
|
-
|
|
5
|
-
This component encapsulates the "caption" behaviour and styles over a `<RichText>` so it can be used in other components such as the `BlockCaption` component.
|
|
6
|
-
|
|
7
|
-
## Development guidelines
|
|
8
|
-
|
|
9
|
-
### Usage
|
|
10
|
-
|
|
11
|
-
Renders a Caption area:
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
import { Caption } from '@wordpress/block-editor';
|
|
15
|
-
const BlockCaption = ( {
|
|
16
|
-
onBlur,
|
|
17
|
-
onChange,
|
|
18
|
-
onFocus,
|
|
19
|
-
isSelected,
|
|
20
|
-
shouldDisplay,
|
|
21
|
-
text,
|
|
22
|
-
insertBlocksAfter,
|
|
23
|
-
} ) => (
|
|
24
|
-
<View >
|
|
25
|
-
<Caption
|
|
26
|
-
isSelected={ isSelected }
|
|
27
|
-
onBlur={ onBlur }
|
|
28
|
-
onChange={ onChange }
|
|
29
|
-
onFocus={ onFocus }
|
|
30
|
-
shouldDisplay={ shouldDisplay }
|
|
31
|
-
value={ text }
|
|
32
|
-
insertBlocksAfter={ insertBlocksAfter }
|
|
33
|
-
/>
|
|
34
|
-
</View>
|
|
35
|
-
);
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Props
|
|
39
|
-
|
|
40
|
-
The properties `isSelected`, `onBlur`, `onChange`, `onFocus`, `shouldDisplay`, `value`, `insertBlocksAfter` of this component are passed directly to their related props of its inner `<RichText>` component ([see detailed info about the RichText component's props](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md)).
|
|
41
|
-
|
|
42
|
-
## Related components
|
|
43
|
-
|
|
44
|
-
Caption components is mostly used by the [`BlockCaption`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-caption) component.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { createBlock } from '@wordpress/blocks';
|
|
10
|
-
import { RichText } from '@wordpress/block-editor';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
12
|
-
|
|
13
|
-
const Caption = ( {
|
|
14
|
-
accessibilityLabelCreator,
|
|
15
|
-
accessible,
|
|
16
|
-
inlineToolbar,
|
|
17
|
-
isSelected,
|
|
18
|
-
onBlur,
|
|
19
|
-
onChange,
|
|
20
|
-
onFocus,
|
|
21
|
-
placeholder = __( 'Add caption' ),
|
|
22
|
-
placeholderTextColor,
|
|
23
|
-
shouldDisplay = true,
|
|
24
|
-
style,
|
|
25
|
-
value,
|
|
26
|
-
insertBlocksAfter = () => {},
|
|
27
|
-
} ) => (
|
|
28
|
-
<View
|
|
29
|
-
accessibilityLabel={
|
|
30
|
-
accessibilityLabelCreator
|
|
31
|
-
? accessibilityLabelCreator( value )
|
|
32
|
-
: undefined
|
|
33
|
-
}
|
|
34
|
-
accessibilityRole="button"
|
|
35
|
-
accessible={ accessible }
|
|
36
|
-
style={ { flex: 1, display: shouldDisplay ? 'flex' : 'none' } }
|
|
37
|
-
>
|
|
38
|
-
<RichText
|
|
39
|
-
__unstableMobileNoFocusOnMount
|
|
40
|
-
fontSize={ style && style.fontSize ? style.fontSize : 14 }
|
|
41
|
-
inlineToolbar={ inlineToolbar }
|
|
42
|
-
isSelected={ isSelected }
|
|
43
|
-
onBlur={ onBlur }
|
|
44
|
-
onChange={ onChange }
|
|
45
|
-
placeholder={ placeholder }
|
|
46
|
-
placeholderTextColor={ placeholderTextColor }
|
|
47
|
-
style={ style }
|
|
48
|
-
tagName="p"
|
|
49
|
-
textAlign="center"
|
|
50
|
-
underlineColorAndroid="transparent"
|
|
51
|
-
unstableOnFocus={ onFocus }
|
|
52
|
-
value={ value }
|
|
53
|
-
__unstableOnSplitAtEnd={ () =>
|
|
54
|
-
insertBlocksAfter( createBlock( 'core/paragraph' ) )
|
|
55
|
-
}
|
|
56
|
-
deleteEnter
|
|
57
|
-
/>
|
|
58
|
-
</View>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
export default Caption;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useNavigation } from '@react-navigation/native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { ColorControl, PanelBody } from '@wordpress/components';
|
|
10
|
-
import { useMemo } from '@wordpress/element';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { blockSettingsScreens } from '../block-settings';
|
|
16
|
-
|
|
17
|
-
export default function PanelColorGradientSettings( {
|
|
18
|
-
settings,
|
|
19
|
-
title,
|
|
20
|
-
children,
|
|
21
|
-
} ) {
|
|
22
|
-
const navigation = useNavigation();
|
|
23
|
-
|
|
24
|
-
const mappedSettings = useMemo( () => {
|
|
25
|
-
return settings.map(
|
|
26
|
-
( {
|
|
27
|
-
onColorChange,
|
|
28
|
-
onColorCleared,
|
|
29
|
-
colorValue,
|
|
30
|
-
onGradientChange,
|
|
31
|
-
gradientValue,
|
|
32
|
-
label,
|
|
33
|
-
} ) => (
|
|
34
|
-
<ColorControl
|
|
35
|
-
onPress={ () => {
|
|
36
|
-
navigation.navigate( blockSettingsScreens.color, {
|
|
37
|
-
onColorChange,
|
|
38
|
-
colorValue: gradientValue || colorValue,
|
|
39
|
-
gradientValue,
|
|
40
|
-
onGradientChange,
|
|
41
|
-
onColorCleared,
|
|
42
|
-
label,
|
|
43
|
-
} );
|
|
44
|
-
} }
|
|
45
|
-
key={ `color-setting-${ label }` }
|
|
46
|
-
label={ label }
|
|
47
|
-
color={ gradientValue || colorValue }
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
);
|
|
51
|
-
}, [ settings ] );
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
<PanelBody title={ title }>{ mappedSettings }</PanelBody>
|
|
56
|
-
<PanelBody>{ children }</PanelBody>
|
|
57
|
-
</>
|
|
58
|
-
);
|
|
59
|
-
}
|