@wordpress/block-editor 12.10.3 → 12.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +13 -11
- package/build/autocompleters/block.js +3 -2
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +3 -3
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/index.js +3 -3
- package/build/components/alignment-control/index.js.map +1 -1
- package/build/components/alignment-control/ui.js +2 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +3 -2
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +2 -2
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/index.js +3 -3
- package/build/components/block-alignment-control/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +4 -4
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +2 -2
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +5 -5
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +12 -12
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-canvas/index.js +13 -15
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-caption/index.native.js +3 -3
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-card/index.js +7 -7
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/block-view.js +9 -8
- package/build/components/block-compare/block-view.js.map +1 -1
- package/build/components/block-compare/index.js +5 -5
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-context/index.js +2 -1
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/fill.js +5 -5
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/index.js +3 -3
- package/build/components/block-controls/index.js.map +1 -1
- package/build/components/block-controls/slot.js +3 -2
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +4 -4
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +6 -6
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +4 -4
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
- package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
- package/build/components/block-draggable/index.js +4 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +9 -8
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +5 -4
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +3 -2
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-edit/index.js +3 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-edit-visually-button/index.js +2 -2
- package/build/components/block-edit-visually-button/index.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +2 -2
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.js +4 -4
- package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +6 -6
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +6 -6
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-icon/index.js +4 -3
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +3 -3
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -3
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +34 -34
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-crash-warning.js +2 -2
- package/build/components/block-list/block-crash-warning.js.map +1 -1
- package/build/components/block-list/block-html.js +3 -2
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +6 -5
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +3 -3
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +3 -2
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +10 -10
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +2 -2
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +9 -9
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +16 -15
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +10 -9
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/grid-item.native.js +2 -2
- package/build/components/block-list/grid-item.native.js.map +1 -1
- package/build/components/block-list/index.js +14 -13
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +21 -20
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +5 -5
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/layout.js +3 -2
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/subdirectory-icon.js +3 -3
- package/build/components/block-list/subdirectory-icon.js.map +1 -1
- package/build/components/block-list-appender/index.js +5 -5
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +4 -4
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-lock/menu-item.js +4 -3
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +21 -20
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +5 -4
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +5 -4
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +6 -5
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +7 -7
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +5 -4
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +8 -7
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-parent-selector/index.js +6 -5
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +20 -19
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +12 -12
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +19 -18
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +12 -12
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +3 -3
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/inbetween.js +4 -3
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +4 -3
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +9 -8
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +7 -6
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +7 -7
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +7 -6
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +2 -2
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +3 -3
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +12 -12
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.js +21 -17
- package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +2 -2
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +17 -16
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +2 -2
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +9 -9
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +9 -8
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +4 -3
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +4 -4
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +3 -2
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-styles/preview.native.js +8 -7
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +3 -3
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +11 -10
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +2 -2
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +6 -5
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +17 -17
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +18 -17
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +7 -7
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +6 -5
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +16 -15
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +8 -7
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-tools/back-compat.js +3 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +6 -5
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +11 -10
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +10 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +9 -8
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +9 -8
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +4 -4
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +11 -10
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.js +8 -8
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +8 -8
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +10 -9
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/icons.js +11 -11
- package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build/components/block-vertical-alignment-control/index.js +3 -3
- package/build/components/block-vertical-alignment-control/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +2 -2
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +2 -2
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +10 -9
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +5 -5
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +3 -3
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/button-block-appender/index.js +7 -6
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/button-block-appender/index.native.js +5 -5
- package/build/components/button-block-appender/index.native.js.map +1 -1
- package/build/components/caption/index.native.js +3 -3
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js +8 -7
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/color-palette/control.js +2 -2
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +2 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/color-style-selector/index.js +9 -9
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/with-colors.js +5 -4
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +12 -12
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +13 -13
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -7
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +5 -4
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/contrast-checker/index.js +3 -3
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +6 -5
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +3 -3
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +4 -4
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/copy-handler/index.js +29 -209
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +9 -8
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +4 -4
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +4 -4
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/default-style-picker/index.js +4 -3
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +3 -3
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/dimensions-tool/index.js +5 -4
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +6 -5
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/dimensions-tool/width-height-tool.js +7 -7
- package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
- package/build/components/duotone-control/index.js +18 -10
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editable-text/index.js +3 -2
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/editor-styles/index.js +5 -4
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +8 -7
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/floating-toolbar/nav-up-icon.js +4 -4
- package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
- package/build/components/font-appearance-control/index.js +4 -3
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +2 -2
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +2 -2
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +4 -3
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +7 -6
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +8 -7
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +21 -20
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +4 -3
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +27 -26
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +23 -22
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +17 -16
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +4 -4
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +22 -21
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/gradients/with-gradient.js +2 -2
- package/build/components/gradients/with-gradient.js.map +1 -1
- package/build/components/height-control/index.js +9 -8
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +6 -5
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +7 -7
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/context.js +2 -1
- package/build/components/image-editor/context.js.map +1 -1
- package/build/components/image-editor/cropper.js +4 -4
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/form-controls.js +3 -3
- package/build/components/image-editor/form-controls.js.map +1 -1
- package/build/components/image-editor/index.js +5 -5
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/image-editor/rotation-button.js +2 -2
- package/build/components/image-editor/rotation-button.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +4 -4
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +9 -9
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +2 -2
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/constants.native.js +13 -0
- package/build/components/inner-blocks/constants.native.js.map +1 -0
- package/build/components/inner-blocks/default-block-appender.js +2 -2
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -8
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +21 -8
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +95 -0
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
- package/build/components/inner-blocks/with-client-id.js +2 -2
- package/build/components/inner-blocks/with-client-id.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +7 -6
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +6 -5
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +8 -8
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-filter.js +21 -19
- package/build/components/inserter/block-patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +19 -18
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +10 -9
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +2 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/index.js +9 -8
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +11 -10
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +3 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +4 -33
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +3 -3
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +7 -6
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +18 -17
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +12 -11
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/media-tab/utils.js +2 -2
- package/build/components/inserter/media-tab/utils.js.map +1 -1
- package/build/components/inserter/menu.js +19 -18
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +9 -8
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +12 -12
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/no-results.js +4 -4
- package/build/components/inserter/no-results.js.map +1 -1
- package/build/components/inserter/no-results.native.js +4 -4
- package/build/components/inserter/no-results.native.js.map +1 -1
- package/build/components/inserter/panel.js +5 -5
- package/build/components/inserter/panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +8 -7
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +7 -6
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +5 -4
- package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +3 -2
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.js +11 -10
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/search-results.native.js +4 -3
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.js +2 -1
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter/tabs.native.js +7 -6
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/tips.js +6 -5
- package/build/components/inserter/tips.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +3 -3
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +9 -8
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inserter-listbox/group.js +2 -1
- package/build/components/inserter-listbox/group.js.map +1 -1
- package/build/components/inserter-listbox/index.js +2 -2
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +5 -4
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +2 -1
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +3 -2
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +3 -2
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +7 -6
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +4 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/index.js +3 -3
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +5 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +2 -2
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -3
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +5 -5
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +5 -4
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +5 -4
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +2 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +11 -11
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +8 -8
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/index.js +3 -3
- package/build/components/justify-content-control/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +2 -2
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +3 -3
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +2 -2
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/link-control/index.js +18 -17
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +20 -20
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-create-button.js +4 -3
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +5 -4
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +5 -5
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +7 -7
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +5 -4
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +4 -4
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/list-view/appender.js +5 -4
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/aria-referenced-text.js +2 -1
- package/build/components/list-view/aria-referenced-text.js.map +1 -1
- package/build/components/list-view/block-contents.js +5 -4
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +16 -15
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +15 -45
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +17 -9
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +4 -3
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/expander.js +3 -3
- package/build/components/list-view/expander.js.map +1 -1
- package/build/components/list-view/index.js +16 -10
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +3 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/utils.js +35 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +22 -21
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +13 -12
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +14 -13
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +2 -2
- package/build/components/media-replace-flow/index.native.js.map +1 -1
- package/build/components/media-upload/{constants.js → constants.native.js} +2 -4
- package/build/components/media-upload/constants.native.js.map +1 -0
- package/build/components/media-upload/index.js +1 -1
- package/build/components/media-upload/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +12 -11
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/media-upload-progress/index.native.js +5 -4
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +6 -6
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +4 -3
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +2 -2
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +2 -2
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +4 -3
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +4 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +5 -5
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +2 -1
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/index.js +4 -3
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +3 -2
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +4 -3
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +5 -4
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +2 -1
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +3 -3
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/resolution-tool/index.js +3 -3
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +10 -9
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/responsive-block-control/label.js +3 -3
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/content.js +3 -2
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +2 -1
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +4 -3
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +4 -4
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.native.js +3 -3
- package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +9 -9
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.native.js +3 -3
- package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +9 -8
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +8 -15
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +3 -2
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/toolbar-button.js +3 -3
- package/build/components/rich-text/toolbar-button.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +5 -87
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/utils.js +2 -5
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +2 -2
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +9 -8
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +2 -2
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -8
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/sides-dropdown/index.js +6 -6
- package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +6 -6
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +6 -6
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/tool-selector/index.js +11 -10
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +3 -3
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +2 -2
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/unit-control/index.js +2 -2
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js +127 -0
- package/build/components/unsupported-block-details/index.native.js.map +1 -0
- package/build/components/url-input/button.js +9 -8
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +9 -8
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-input/index.native.js +2 -2
- package/build/components/url-input/index.native.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +19 -18
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +8 -7
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +4 -4
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer-url.js +3 -3
- package/build/components/url-popover/link-viewer-url.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +4 -4
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -2
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-unsupported-block-editor/index.native.js +57 -0
- package/build/components/use-unsupported-block-editor/index.native.js.map +1 -0
- package/build/components/video-player/gridicon-play.native.js +3 -3
- package/build/components/video-player/gridicon-play.native.js.map +1 -1
- package/build/components/video-player/index.native.js +6 -5
- package/build/components/video-player/index.native.js.map +1 -1
- package/build/components/warning/index.js +10 -9
- package/build/components/warning/index.js.map +1 -1
- package/build/components/warning/index.native.js +6 -6
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/index.js +7 -5
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +179 -0
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -0
- package/build/components/writing-flow/use-tab-nav.js +4 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-mode-control/index.js +6 -6
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/align.js +6 -6
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +10 -9
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +17 -16
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +11 -10
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-rename-ui.js +17 -16
- package/build/hooks/block-rename-ui.js.map +1 -1
- package/build/hooks/border.js +6 -5
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +7 -6
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +9 -8
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/contrast-checker.js +2 -1
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/custom-class-name.js +7 -7
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +8 -8
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/dimensions.js +5 -4
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +10 -9
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-size.js +5 -5
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +14 -13
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +3 -3
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/margin.js +3 -2
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +3 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +10 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +11 -10
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +4 -3
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +4 -4
- package/build/hooks/typography.native.js.map +1 -1
- package/build/layouts/constrained.js +11 -11
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +18 -18
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/grid.js +10 -10
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +8 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +55 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pasting.js +46 -0
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js +5 -0
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build/utils/use-notify-copy.js +53 -0
- package/build/utils/use-notify-copy.js.map +1 -0
- package/build-module/autocompleters/block.js +1 -1
- package/build-module/autocompleters/link.js +1 -1
- package/build-module/components/alignment-control/index.js +1 -1
- package/build-module/components/alignment-control/ui.js +1 -1
- package/build-module/components/autocomplete/index.js +1 -1
- package/build-module/components/block-actions/index.js +1 -1
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/index.js +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +1 -1
- package/build-module/components/block-breadcrumb/index.js +2 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +7 -9
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-caption/index.native.js +1 -1
- package/build-module/components/block-card/index.js +1 -1
- package/build-module/components/block-compare/block-view.js +1 -1
- package/build-module/components/block-compare/index.js +1 -1
- package/build-module/components/block-context/index.js +1 -1
- package/build-module/components/block-controls/fill.js +1 -1
- package/build-module/components/block-controls/index.js +1 -1
- package/build-module/components/block-controls/slot.js +1 -1
- package/build-module/components/block-controls/slot.native.js +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +1 -1
- package/build-module/components/block-draggable/dropping-insertion-point.native.js +1 -1
- package/build-module/components/block-draggable/index.js +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -1
- package/build-module/components/block-edit/edit.js +1 -1
- package/build-module/components/block-edit/edit.native.js +1 -1
- package/build-module/components/block-edit/index.js +1 -1
- package/build-module/components/block-edit-visually-button/index.js +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +3 -3
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +3 -3
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +3 -3
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-icon/index.js +1 -1
- package/build-module/components/block-icon/index.native.js +1 -1
- package/build-module/components/block-info-slot-fill/index.js +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-list/block-crash-warning.js +1 -1
- package/build-module/components/block-list/block-html.js +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +1 -1
- package/build-module/components/block-list/block-list-item.native.js +3 -3
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +1 -1
- package/build-module/components/block-list/block.js +1 -1
- package/build-module/components/block-list/block.native.js +1 -1
- package/build-module/components/block-list/grid-item.native.js +1 -1
- package/build-module/components/block-list/index.js +1 -1
- package/build-module/components/block-list/index.native.js +1 -1
- package/build-module/components/block-list/insertion-point.native.js +1 -1
- package/build-module/components/block-list/layout.js +1 -1
- package/build-module/components/block-list/subdirectory-icon.js +1 -1
- package/build-module/components/block-list-appender/index.js +1 -1
- package/build-module/components/block-list-appender/index.native.js +1 -1
- package/build-module/components/block-lock/menu-item.js +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/toolbar.js +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +1 -1
- package/build-module/components/block-mover/button.js +1 -1
- package/build-module/components/block-mover/index.js +1 -1
- package/build-module/components/block-mover/index.native.js +1 -1
- package/build-module/components/block-navigation/dropdown.js +1 -1
- package/build-module/components/block-parent-selector/index.js +2 -2
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -1
- package/build-module/components/block-patterns-paging/index.js +1 -1
- package/build-module/components/block-popover/drop-zone.js +1 -1
- package/build-module/components/block-popover/inbetween.js +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-preview/auto.js +1 -1
- package/build-module/components/block-preview/index.js +2 -2
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +1 -1
- package/build-module/components/block-selection-clearer/index.js +1 -1
- package/build-module/components/block-settings/button.native.js +1 -1
- package/build-module/components/block-settings/container.native.js +1 -1
- package/build-module/components/block-settings-menu/block-html-convert-button.js +20 -17
- package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -1
- package/build-module/components/block-settings-menu/index.js +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +2 -2
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.native.js +1 -1
- package/build-module/components/block-styles/menu-items.js +1 -1
- package/build-module/components/block-styles/preview-panel.js +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +1 -1
- package/build-module/components/block-switcher/index.js +6 -6
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/index.js +1 -1
- package/build-module/components/block-toolbar/index.native.js +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -1
- package/build-module/components/block-tools/insertion-point.js +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +1 -1
- package/build-module/components/block-types-list/index.js +1 -1
- package/build-module/components/block-types-list/index.native.js +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -1
- package/build-module/components/block-variation-picker/index.native.js +1 -1
- package/build-module/components/block-variation-transforms/index.js +1 -1
- package/build-module/components/block-vertical-alignment-control/icons.js +1 -1
- package/build-module/components/block-vertical-alignment-control/index.js +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
- package/build-module/components/border-radius-control/all-input-control.js +1 -1
- package/build-module/components/border-radius-control/index.js +2 -2
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/button-block-appender/index.js +1 -1
- package/build-module/components/button-block-appender/index.native.js +1 -1
- package/build-module/components/caption/index.native.js +1 -1
- package/build-module/components/child-layout-control/index.js +2 -2
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-palette/control.js +1 -1
- package/build-module/components/color-palette/with-color-context.js +1 -1
- package/build-module/components/color-style-selector/index.js +1 -1
- package/build-module/components/colors/with-colors.js +2 -2
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -1
- package/build-module/components/colors-gradients/dropdown.js +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -1
- package/build-module/components/contrast-checker/index.js +1 -1
- package/build-module/components/contrast-checker/index.native.js +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +1 -1
- package/build-module/components/copy-handler/index.js +25 -205
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/default-block-appender/index.js +1 -1
- package/build-module/components/default-block-appender/index.native.js +1 -1
- package/build-module/components/default-style-picker/index.js +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +1 -1
- package/build-module/components/dimensions-tool/index.js +2 -2
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +2 -2
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/dimensions-tool/width-height-tool.js +3 -3
- package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
- package/build-module/components/duotone-control/index.js +10 -2
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +1 -1
- package/build-module/components/editor-styles/index.js +1 -1
- package/build-module/components/floating-toolbar/index.native.js +1 -1
- package/build-module/components/floating-toolbar/nav-up-icon.js +1 -1
- package/build-module/components/font-appearance-control/index.js +2 -2
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -1
- package/build-module/components/global-styles/color-panel.js +1 -1
- package/build-module/components/global-styles/color-panel.native.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/effects-panel.js +1 -1
- package/build-module/components/global-styles/filters-panel.js +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/gradients/with-gradient.js +1 -1
- package/build-module/components/height-control/index.js +2 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
- package/build-module/components/image-editor/context.js +1 -1
- package/build-module/components/image-editor/cropper.js +1 -1
- package/build-module/components/image-editor/form-controls.js +1 -1
- package/build-module/components/image-editor/index.js +1 -1
- package/build-module/components/image-editor/rotation-button.js +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +1 -1
- package/build-module/components/image-size-control/index.js +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +1 -1
- package/build-module/components/inner-blocks/constants.native.js +6 -0
- package/build-module/components/inner-blocks/constants.native.js.map +1 -0
- package/build-module/components/inner-blocks/default-block-appender.js +1 -1
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.native.js +13 -1
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +86 -0
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
- package/build-module/components/inner-blocks/with-client-id.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -1
- package/build-module/components/inserter/block-patterns-filter.js +14 -13
- package/build-module/components/inserter/block-patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +2 -2
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -1
- package/build-module/components/inserter/index.js +3 -3
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +3 -3
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +5 -34
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +1 -1
- package/build-module/components/inserter/media-tab/utils.js +1 -1
- package/build-module/components/inserter/menu.js +1 -1
- package/build-module/components/inserter/menu.native.js +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
- package/build-module/components/inserter/no-results.js +1 -1
- package/build-module/components/inserter/no-results.native.js +1 -1
- package/build-module/components/inserter/panel.js +1 -1
- package/build-module/components/inserter/preview-panel.js +1 -1
- package/build-module/components/inserter/quick-inserter.js +1 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
- package/build-module/components/inserter/search-results.js +1 -1
- package/build-module/components/inserter/search-results.native.js +1 -1
- package/build-module/components/inserter/tabs.js +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -1
- package/build-module/components/inserter/tips.js +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +1 -1
- package/build-module/components/inserter-list-item/index.js +1 -1
- package/build-module/components/inserter-listbox/group.js +1 -1
- package/build-module/components/inserter-listbox/index.js +1 -1
- package/build-module/components/inserter-listbox/item.js +1 -1
- package/build-module/components/inserter-listbox/row.js +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -1
- package/build-module/components/inspector-controls/fill.native.js +1 -1
- package/build-module/components/inspector-controls/index.js +1 -1
- package/build-module/components/inspector-controls/slot.js +1 -1
- package/build-module/components/inspector-controls/slot.native.js +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
- package/build-module/components/inspector-popover-header/index.js +1 -1
- package/build-module/components/justify-content-control/index.js +1 -1
- package/build-module/components/justify-content-control/ui.js +1 -1
- package/build-module/components/letter-spacing-control/index.js +2 -2
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +1 -1
- package/build-module/components/line-height-control/index.native.js +1 -1
- package/build-module/components/link-control/index.js +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/search-create-button.js +1 -1
- package/build-module/components/link-control/search-input.js +1 -1
- package/build-module/components/link-control/search-item.js +1 -1
- package/build-module/components/link-control/search-results.js +1 -1
- package/build-module/components/link-control/settings-drawer.js +1 -1
- package/build-module/components/link-control/settings.js +1 -1
- package/build-module/components/list-view/appender.js +1 -1
- package/build-module/components/list-view/aria-referenced-text.js +1 -1
- package/build-module/components/list-view/block-contents.js +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -1
- package/build-module/components/list-view/block.js +4 -35
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -2
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +1 -1
- package/build-module/components/list-view/expander.js +1 -1
- package/build-module/components/list-view/index.js +9 -4
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +1 -1
- package/build-module/components/list-view/utils.js +34 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +1 -1
- package/build-module/components/media-placeholder/index.native.js +1 -1
- package/build-module/components/media-replace-flow/index.js +1 -1
- package/build-module/components/media-replace-flow/index.native.js +1 -1
- package/build-module/components/media-upload/{constants.js → constants.native.js} +1 -2
- package/build-module/components/media-upload/constants.native.js.map +1 -0
- package/build-module/components/media-upload/index.js +1 -1
- package/build-module/components/media-upload/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +7 -7
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/media-upload-progress/index.native.js +1 -1
- package/build-module/components/multi-selection-inspector/index.js +1 -1
- package/build-module/components/navigable-toolbar/index.js +1 -1
- package/build-module/components/observe-typing/index.js +1 -1
- package/build-module/components/panel-color-settings/index.js +1 -1
- package/build-module/components/plain-text/index.js +1 -1
- package/build-module/components/plain-text/index.native.js +1 -1
- package/build-module/components/preview-options/index.js +1 -1
- package/build-module/components/provider/block-refs-provider.js +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.native.js +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +1 -1
- package/build-module/components/publish-date-time-picker/index.js +1 -1
- package/build-module/components/recursion-provider/index.js +1 -1
- package/build-module/components/resizable-box-popover/index.js +1 -1
- package/build-module/components/resolution-tool/index.js +1 -1
- package/build-module/components/responsive-block-control/index.js +1 -1
- package/build-module/components/responsive-block-control/label.js +1 -1
- package/build-module/components/rich-text/content.js +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +1 -1
- package/build-module/components/rich-text/format-edit.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.native.js +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +1 -1
- package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.native.js +2 -10
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +1 -1
- package/build-module/components/rich-text/toolbar-button.js +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +7 -89
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/utils.js +1 -3
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +1 -1
- package/build-module/components/spacing-sizes-control/index.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
- package/build-module/components/text-decoration-control/index.js +2 -2
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +2 -2
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +1 -1
- package/build-module/components/typewriter/index.js +2 -2
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +1 -1
- package/build-module/components/unit-control/index.js +1 -1
- package/build-module/components/unsupported-block-details/index.native.js +118 -0
- package/build-module/components/unsupported-block-details/index.native.js.map +1 -0
- package/build-module/components/url-input/button.js +1 -1
- package/build-module/components/url-input/index.js +1 -1
- package/build-module/components/url-input/index.native.js +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +1 -1
- package/build-module/components/url-popover/index.js +1 -1
- package/build-module/components/url-popover/link-editor.js +1 -1
- package/build-module/components/url-popover/link-viewer-url.js +1 -1
- package/build-module/components/url-popover/link-viewer.js +1 -1
- package/build-module/components/use-on-block-drop/index.js +2 -2
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-unsupported-block-editor/index.native.js +51 -0
- package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -0
- package/build-module/components/video-player/gridicon-play.native.js +1 -1
- package/build-module/components/video-player/index.native.js +1 -1
- package/build-module/components/warning/index.js +1 -1
- package/build-module/components/warning/index.native.js +1 -1
- package/build-module/components/writing-flow/index.js +5 -4
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +172 -0
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -0
- package/build-module/components/writing-flow/use-tab-nav.js +1 -1
- package/build-module/components/writing-mode-control/index.js +2 -2
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/align.js +1 -1
- package/build-module/hooks/anchor.js +3 -3
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +1 -1
- package/build-module/hooks/block-hooks.js +1 -1
- package/build-module/hooks/block-rename-ui.js +1 -1
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/content-lock-ui.js +1 -1
- package/build-module/hooks/contrast-checker.js +1 -1
- package/build-module/hooks/custom-class-name.js +3 -3
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +3 -3
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/dimensions.js +1 -1
- package/build-module/hooks/duotone.js +1 -1
- package/build-module/hooks/font-size.js +2 -2
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +1 -1
- package/build-module/hooks/line-height.js +2 -2
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/margin.js +1 -1
- package/build-module/hooks/padding.js +1 -1
- package/build-module/hooks/position.js +3 -3
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +1 -1
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.native.js +1 -1
- package/build-module/layouts/constrained.js +1 -1
- package/build-module/layouts/flex.js +1 -1
- package/build-module/layouts/grid.js +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +8 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +52 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pasting.js +47 -0
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +5 -0
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/utils/use-notify-copy.js +46 -0
- package/build-module/utils/use-notify-copy.js.map +1 -0
- package/build-style/content-rtl.css +10 -11
- package/build-style/content.css +10 -11
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +11 -12
- package/build-style/style.css +11 -12
- package/package.json +31 -32
- package/src/components/block-actions/index.js +1 -1
- package/src/components/block-breadcrumb/index.js +1 -1
- package/src/components/block-canvas/index.js +6 -12
- package/src/components/block-context/README.md +1 -1
- package/src/components/block-heading-level-dropdown/heading-level-icon.js +2 -2
- package/src/components/block-heading-level-dropdown/index.js +2 -2
- package/src/components/block-heading-level-dropdown/index.native.js +2 -2
- package/src/components/block-list/block-list-item.native.js +2 -2
- package/src/components/block-parent-selector/index.js +1 -1
- package/src/components/block-preview/index.js +1 -1
- package/src/components/block-settings-menu/block-html-convert-button.js +28 -19
- package/src/components/block-settings-menu-controls/index.js +1 -1
- package/src/components/block-switcher/index.js +17 -18
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +2 -2
- package/src/components/block-tools/block-selection-button.js +1 -1
- package/src/components/border-radius-control/index.js +1 -1
- package/src/components/child-layout-control/index.js +1 -1
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors/with-colors.js +1 -1
- package/src/components/copy-handler/README.md +2 -0
- package/src/components/copy-handler/index.js +21 -291
- package/src/components/dimensions-tool/index.js +1 -1
- package/src/components/dimensions-tool/scale-tool.js +1 -1
- package/src/components/dimensions-tool/width-height-tool.js +1 -1
- package/src/components/duotone-control/index.js +14 -2
- package/src/components/editable-text/README.md +2 -2
- package/src/components/font-appearance-control/index.js +1 -1
- package/src/components/font-family/README.md +1 -1
- package/src/components/height-control/README.md +1 -1
- package/src/components/height-control/index.js +1 -1
- package/src/components/image-size-control/README.md +2 -2
- package/src/components/index.js +1 -1
- package/src/components/inner-blocks/constants.native.js +5 -0
- package/src/components/inner-blocks/index.native.js +15 -0
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +100 -0
- package/src/components/inserter/block-patterns-filter.js +22 -10
- package/src/components/inserter/block-patterns-tab.js +0 -3
- package/src/components/inserter/index.js +2 -2
- package/src/components/inserter/index.native.js +2 -2
- package/src/components/inserter/media-tab/hooks.js +10 -44
- package/src/components/inserter/style.scss +1 -1
- package/src/components/letter-spacing-control/index.js +1 -1
- package/src/components/list-view/block.js +3 -43
- package/src/components/list-view/branch.js +11 -1
- package/src/components/list-view/index.js +8 -4
- package/src/components/list-view/utils.js +37 -0
- package/src/components/media-placeholder/README.md +3 -3
- package/src/components/media-upload/{constants.js → constants.native.js} +0 -1
- package/src/components/media-upload/index.js +1 -1
- package/src/components/media-upload/index.native.js +9 -5
- package/src/components/panel-color-settings/README.md +5 -1
- package/src/components/plain-text/README.md +1 -1
- package/src/components/provider/README.md +1 -1
- package/src/components/provider/use-block-sync.js +1 -1
- package/src/components/publish-date-time-picker/README.md +1 -1
- package/src/components/responsive-block-control/README.md +1 -3
- package/src/components/rich-text/README.md +3 -3
- package/src/components/rich-text/index.native.js +0 -13
- package/src/components/rich-text/use-paste-handler.js +5 -99
- package/src/components/rich-text/utils.js +0 -3
- package/src/components/text-decoration-control/index.js +1 -1
- package/src/components/text-transform-control/index.js +1 -1
- package/src/components/typewriter/index.js +1 -1
- package/src/components/unit-control/README.md +1 -1
- package/src/components/unsupported-block-details/index.native.js +183 -0
- package/src/components/unsupported-block-details/style.native.scss +56 -0
- package/src/components/url-input/README.md +4 -4
- package/src/components/use-on-block-drop/index.js +2 -2
- package/src/components/use-unsupported-block-editor/index.native.js +59 -0
- package/src/components/writing-flow/index.js +4 -2
- package/src/components/writing-flow/use-clipboard-handler.js +242 -0
- package/src/components/writing-mode-control/index.js +1 -1
- package/src/hooks/anchor.js +2 -2
- package/src/hooks/custom-class-name.js +2 -2
- package/src/hooks/custom-fields.js +2 -2
- package/src/hooks/font-size.js +1 -1
- package/src/hooks/line-height.js +1 -1
- package/src/hooks/position.js +2 -2
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +7 -11
- package/src/store/private-selectors.js +72 -0
- package/src/store/reducer.js +17 -0
- package/src/store/selectors.js +1 -1
- package/src/store/test/actions.js +10 -16
- package/src/utils/pasting.js +51 -0
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +13 -6
- package/src/utils/transform-styles/transforms/test/wrap.js +9 -0
- package/src/utils/transform-styles/transforms/wrap.js +5 -0
- package/src/utils/use-notify-copy.js +63 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-settings-menu/block-convert-button.js +0 -27
- package/build/components/block-settings-menu/block-convert-button.js.map +0 -1
- package/build/components/media-upload/constants.js.map +0 -1
- package/build-module/components/block-settings-menu/block-convert-button.js +0 -20
- package/build-module/components/block-settings-menu/block-convert-button.js.map +0 -1
- package/build-module/components/media-upload/constants.js.map +0 -1
- package/src/components/block-settings-menu/block-convert-button.js +0 -14
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.MediaUpload = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _components = require("@wordpress/components");
|
|
12
13
|
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
@@ -77,7 +78,7 @@ class MediaUpload extends _element.Component {
|
|
|
77
78
|
// ID is the value sent to native.
|
|
78
79
|
value: _reactNativeBridge.mediaSources.deviceCamera + '-IMAGE',
|
|
79
80
|
// This is needed to diferenciate image-camera from video-camera sources.
|
|
80
|
-
label:
|
|
81
|
+
label: _constants.OPTION_TAKE_PHOTO,
|
|
81
82
|
requiresModal: true,
|
|
82
83
|
types: [_constants.MEDIA_TYPE_IMAGE],
|
|
83
84
|
icon: _icons.capturePhoto
|
|
@@ -85,7 +86,7 @@ class MediaUpload extends _element.Component {
|
|
|
85
86
|
const cameraVideoSource = {
|
|
86
87
|
id: _reactNativeBridge.mediaSources.deviceCamera,
|
|
87
88
|
value: _reactNativeBridge.mediaSources.deviceCamera,
|
|
88
|
-
label:
|
|
89
|
+
label: _constants.OPTION_TAKE_VIDEO,
|
|
89
90
|
requiresModal: true,
|
|
90
91
|
types: [_constants.MEDIA_TYPE_VIDEO],
|
|
91
92
|
icon: _icons.captureVideo
|
|
@@ -101,7 +102,7 @@ class MediaUpload extends _element.Component {
|
|
|
101
102
|
const siteLibrarySource = {
|
|
102
103
|
id: _reactNativeBridge.mediaSources.siteMediaLibrary,
|
|
103
104
|
value: _reactNativeBridge.mediaSources.siteMediaLibrary,
|
|
104
|
-
label:
|
|
105
|
+
label: _constants.OPTION_WORDPRESS_MEDIA_LIBRARY,
|
|
105
106
|
requiresModal: true,
|
|
106
107
|
types: [_constants.MEDIA_TYPE_IMAGE, _constants.MEDIA_TYPE_VIDEO, _constants.MEDIA_TYPE_AUDIO, _constants.MEDIA_TYPE_ANY],
|
|
107
108
|
icon: _icons.wordpress,
|
|
@@ -110,7 +111,7 @@ class MediaUpload extends _element.Component {
|
|
|
110
111
|
const urlSource = {
|
|
111
112
|
id: URL_MEDIA_SOURCE,
|
|
112
113
|
value: URL_MEDIA_SOURCE,
|
|
113
|
-
label:
|
|
114
|
+
label: _constants.OPTION_INSERT_FROM_URL,
|
|
114
115
|
types: [_constants.MEDIA_TYPE_AUDIO, _constants.MEDIA_TYPE_IMAGE, _constants.MEDIA_TYPE_VIDEO],
|
|
115
116
|
icon: _icons.globe
|
|
116
117
|
};
|
|
@@ -222,7 +223,7 @@ class MediaUpload extends _element.Component {
|
|
|
222
223
|
pickerTitle = (0, _i18n.__)('Choose file');
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
|
-
const getMediaOptions = () => (0,
|
|
226
|
+
const getMediaOptions = () => (0, _react.createElement)(_components.Picker, {
|
|
226
227
|
title: pickerTitle,
|
|
227
228
|
hideCancelButton: true,
|
|
228
229
|
ref: instance => this.picker = instance,
|
|
@@ -230,7 +231,7 @@ class MediaUpload extends _element.Component {
|
|
|
230
231
|
onChange: this.onPickerSelect,
|
|
231
232
|
testID: "media-options-picker"
|
|
232
233
|
});
|
|
233
|
-
return (0,
|
|
234
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(URLInput, {
|
|
234
235
|
isVisible: this.state.showURLInput,
|
|
235
236
|
onClose: () => {
|
|
236
237
|
if (this.state.url !== '') {
|
|
@@ -255,13 +256,13 @@ class MediaUpload extends _element.Component {
|
|
|
255
256
|
}
|
|
256
257
|
exports.MediaUpload = MediaUpload;
|
|
257
258
|
function URLInput(props) {
|
|
258
|
-
return (0,
|
|
259
|
+
return (0, _react.createElement)(_components.BottomSheet, {
|
|
259
260
|
hideHeader: true,
|
|
260
261
|
isVisible: props.isVisible,
|
|
261
262
|
onClose: props.onClose
|
|
262
|
-
}, (0,
|
|
263
|
+
}, (0, _react.createElement)(_components.PanelBody, {
|
|
263
264
|
style: _style.default['media-upload__link-input']
|
|
264
|
-
}, (0,
|
|
265
|
+
}, (0, _react.createElement)(_components.TextControl
|
|
265
266
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
266
267
|
, {
|
|
267
268
|
autoFocus: true,
|
|
@@ -269,7 +270,7 @@ function URLInput(props) {
|
|
|
269
270
|
autoCorrect: false,
|
|
270
271
|
autoComplete: _reactNative.Platform.isIOS ? 'url' : 'off',
|
|
271
272
|
keyboardType: "url",
|
|
272
|
-
label:
|
|
273
|
+
label: _constants.OPTION_INSERT_FROM_URL,
|
|
273
274
|
onChange: props.onChange,
|
|
274
275
|
placeholder: (0, _i18n.__)('Type a URL'),
|
|
275
276
|
value: props.value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_reactNative","_i18n","_components","_reactNativeBridge","_icons","_blockEditor","_compose","_data","_constants","_style","_interopRequireDefault","URL_MEDIA_SOURCE","PICKER_OPENING_DELAY","MediaUpload","Component","pickerTimeout","constructor","props","onPickerPresent","bind","onPickerSelect","getAllSources","state","url","showURLInput","otherMediaOptions","componentDidMount","allowedTypes","autoOpen","getOtherMediaOptions","otherMediaOptionsWithIcons","map","option","requiresModal","types","id","value","setState","componentWillUnmount","clearTimeout","onSelectURL","cameraImageSource","mediaSources","deviceCamera","label","__","MEDIA_TYPE_IMAGE","icon","capturePhoto","cameraVideoSource","MEDIA_TYPE_VIDEO","captureVideo","deviceLibrarySource","deviceLibrary","image","siteLibrarySource","siteMediaLibrary","MEDIA_TYPE_AUDIO","MEDIA_TYPE_ANY","wordpress","mediaLibrary","urlSource","globe","internalSources","concat","getMediaOptionsItems","__experimentalOnlyMediaLibrary","isAudioBlockMediaUploadEnabled","filter","source","every","allowedType","includes","some","getChooseFromDeviceIcon","mobile","isIOS","Platform","OS","picker","setTimeout","presentPicker","onSelect","multiple","mediaSource","shift","type","requestMediaPicker","media","render","isReplacingMedia","isOneType","length","isImage","isVideo","isAudio","isAnyType","isImageOrVideo","pickerTitle","getMediaOptions","createElement","Picker","title","hideCancelButton","ref","instance","options","onChange","testID","Fragment","URLInput","isVisible","onClose","open","exports","BottomSheet","hideHeader","PanelBody","style","styles","TextControl","autoFocus","autoCapitalize","autoCorrect","autoComplete","keyboardType","placeholder","_default","compose","withSelect","select","capabilities","blockEditorStore","getSettings","default"],"sources":["@wordpress/block-editor/src/components/media-upload/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, React } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBottomSheet,\n\tPanelBody,\n\tPicker,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tgetOtherMediaOptions,\n\trequestMediaPicker,\n\tmediaSources,\n} from '@wordpress/react-native-bridge';\nimport {\n\tcapturePhoto,\n\tcaptureVideo,\n\timage,\n\twordpress,\n\tmobile,\n\tglobe,\n} from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMEDIA_TYPE_IMAGE,\n\tMEDIA_TYPE_VIDEO,\n\tMEDIA_TYPE_AUDIO,\n\tMEDIA_TYPE_ANY,\n} from './constants';\nimport styles from './style.scss';\n\nconst URL_MEDIA_SOURCE = 'URL';\n\nconst PICKER_OPENING_DELAY = 200;\n\nexport class MediaUpload extends Component {\n\tpickerTimeout;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onPickerPresent = this.onPickerPresent.bind( this );\n\t\tthis.onPickerSelect = this.onPickerSelect.bind( this );\n\t\tthis.getAllSources = this.getAllSources.bind( this );\n\t\tthis.state = {\n\t\t\turl: '',\n\t\t\tshowURLInput: false,\n\t\t\totherMediaOptions: [],\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { allowedTypes = [], autoOpen } = this.props;\n\t\tgetOtherMediaOptions( allowedTypes, ( otherMediaOptions ) => {\n\t\t\tconst otherMediaOptionsWithIcons = otherMediaOptions.map(\n\t\t\t\t( option ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...option,\n\t\t\t\t\t\trequiresModal: true,\n\t\t\t\t\t\ttypes: allowedTypes,\n\t\t\t\t\t\tid: option.value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis.setState( { otherMediaOptions: otherMediaOptionsWithIcons } );\n\t\t} );\n\n\t\tif ( autoOpen ) {\n\t\t\tthis.onPickerPresent();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.pickerTimeout );\n\t}\n\n\tgetAllSources() {\n\t\tconst { onSelectURL } = this.props;\n\n\t\tconst cameraImageSource = {\n\t\t\tid: mediaSources.deviceCamera, // ID is the value sent to native.\n\t\t\tvalue: mediaSources.deviceCamera + '-IMAGE', // This is needed to diferenciate image-camera from video-camera sources.\n\t\t\tlabel: __( 'Take a Photo' ),\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_IMAGE ],\n\t\t\ticon: capturePhoto,\n\t\t};\n\n\t\tconst cameraVideoSource = {\n\t\t\tid: mediaSources.deviceCamera,\n\t\t\tvalue: mediaSources.deviceCamera,\n\t\t\tlabel: __( 'Take a Video' ),\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_VIDEO ],\n\t\t\ticon: captureVideo,\n\t\t};\n\n\t\tconst deviceLibrarySource = {\n\t\t\tid: mediaSources.deviceLibrary,\n\t\t\tvalue: mediaSources.deviceLibrary,\n\t\t\tlabel: __( 'Choose from device' ),\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],\n\t\t\ticon: image,\n\t\t};\n\n\t\tconst siteLibrarySource = {\n\t\t\tid: mediaSources.siteMediaLibrary,\n\t\t\tvalue: mediaSources.siteMediaLibrary,\n\t\t\tlabel: __( 'WordPress Media Library' ),\n\t\t\trequiresModal: true,\n\t\t\ttypes: [\n\t\t\t\tMEDIA_TYPE_IMAGE,\n\t\t\t\tMEDIA_TYPE_VIDEO,\n\t\t\t\tMEDIA_TYPE_AUDIO,\n\t\t\t\tMEDIA_TYPE_ANY,\n\t\t\t],\n\t\t\ticon: wordpress,\n\t\t\tmediaLibrary: true,\n\t\t};\n\n\t\tconst urlSource = {\n\t\t\tid: URL_MEDIA_SOURCE,\n\t\t\tvalue: URL_MEDIA_SOURCE,\n\t\t\tlabel: __( 'Insert from URL' ),\n\t\t\ttypes: [ MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],\n\t\t\ticon: globe,\n\t\t};\n\n\t\t// Only include `urlSource` option if `onSelectURL` prop is present, in order to match the web behavior.\n\t\tconst internalSources = [\n\t\t\tdeviceLibrarySource,\n\t\t\tcameraImageSource,\n\t\t\tcameraVideoSource,\n\t\t\tsiteLibrarySource,\n\t\t\t...( onSelectURL ? [ urlSource ] : [] ),\n\t\t];\n\n\t\treturn internalSources.concat( this.state.otherMediaOptions );\n\t}\n\n\tgetMediaOptionsItems() {\n\t\tconst {\n\t\t\tallowedTypes = [],\n\t\t\t__experimentalOnlyMediaLibrary,\n\t\t\tisAudioBlockMediaUploadEnabled,\n\t\t} = this.props;\n\n\t\treturn this.getAllSources()\n\t\t\t.filter( ( source ) => {\n\t\t\t\tif ( __experimentalOnlyMediaLibrary ) {\n\t\t\t\t\treturn source.mediaLibrary;\n\t\t\t\t} else if (\n\t\t\t\t\tallowedTypes.every(\n\t\t\t\t\t\t( allowedType ) =>\n\t\t\t\t\t\t\tallowedType === MEDIA_TYPE_AUDIO &&\n\t\t\t\t\t\t\tsource.types.includes( allowedType )\n\t\t\t\t\t) &&\n\t\t\t\t\tsource.id !== URL_MEDIA_SOURCE\n\t\t\t\t) {\n\t\t\t\t\treturn isAudioBlockMediaUploadEnabled === true;\n\t\t\t\t}\n\n\t\t\t\treturn allowedTypes.some( ( allowedType ) =>\n\t\t\t\t\tsource.types.includes( allowedType )\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.map( ( source ) => {\n\t\t\t\treturn {\n\t\t\t\t\t...source,\n\t\t\t\t\ticon: source.icon || this.getChooseFromDeviceIcon(),\n\t\t\t\t};\n\t\t\t} );\n\t}\n\n\tgetChooseFromDeviceIcon() {\n\t\treturn mobile;\n\t}\n\n\tonPickerPresent() {\n\t\tconst { autoOpen } = this.props;\n\t\tconst isIOS = Platform.OS === 'ios';\n\n\t\tif ( this.picker ) {\n\t\t\t// the delay below is required because on iOS this action sheet gets dismissed by the close event of the Inserter\n\t\t\t// so this delay allows the Inserter to be closed fully before presenting action sheet.\n\t\t\tif ( autoOpen && isIOS ) {\n\t\t\t\tthis.pickerTimeout = setTimeout(\n\t\t\t\t\t() => this.picker.presentPicker(),\n\t\t\t\t\tPICKER_OPENING_DELAY\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.picker.presentPicker();\n\t\t\t}\n\t\t}\n\t}\n\n\tonPickerSelect( value ) {\n\t\tconst { allowedTypes = [], onSelect, multiple = false } = this.props;\n\n\t\tif ( value === URL_MEDIA_SOURCE ) {\n\t\t\tthis.setState( { showURLInput: true } );\n\t\t\treturn;\n\t\t}\n\n\t\tconst mediaSource = this.getAllSources()\n\t\t\t.filter( ( source ) => source.value === value )\n\t\t\t.shift();\n\t\tconst types = allowedTypes.filter( ( type ) =>\n\t\t\tmediaSource.types.includes( type )\n\t\t);\n\n\t\trequestMediaPicker( mediaSource.id, types, multiple, ( media ) => {\n\t\t\tif ( ( multiple && media ) || ( media && media.id ) ) {\n\t\t\t\tonSelect( media );\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst { allowedTypes = [], isReplacingMedia, multiple } = this.props;\n\t\tconst isOneType = allowedTypes.length === 1;\n\t\tconst isImage = isOneType && allowedTypes.includes( MEDIA_TYPE_IMAGE );\n\t\tconst isVideo = isOneType && allowedTypes.includes( MEDIA_TYPE_VIDEO );\n\t\tconst isAudio = isOneType && allowedTypes.includes( MEDIA_TYPE_AUDIO );\n\t\tconst isAnyType = isOneType && allowedTypes.includes( MEDIA_TYPE_ANY );\n\n\t\tconst isImageOrVideo =\n\t\t\tallowedTypes.length === 2 &&\n\t\t\tallowedTypes.includes( MEDIA_TYPE_IMAGE ) &&\n\t\t\tallowedTypes.includes( MEDIA_TYPE_VIDEO );\n\n\t\tlet pickerTitle;\n\t\tif ( isImage ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace image' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = multiple\n\t\t\t\t\t? __( 'Choose images' )\n\t\t\t\t\t: __( 'Choose image' );\n\t\t\t}\n\t\t} else if ( isVideo ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace video' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose video' );\n\t\t\t}\n\t\t} else if ( isImageOrVideo ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace image or video' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose image or video' );\n\t\t\t}\n\t\t} else if ( isAudio ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace audio' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose audio' );\n\t\t\t}\n\t\t} else if ( isAnyType ) {\n\t\t\tpickerTitle = __( 'Choose file' );\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace file' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose file' );\n\t\t\t}\n\t\t}\n\n\t\tconst getMediaOptions = () => (\n\t\t\t<Picker\n\t\t\t\ttitle={ pickerTitle }\n\t\t\t\thideCancelButton\n\t\t\t\tref={ ( instance ) => ( this.picker = instance ) }\n\t\t\t\toptions={ this.getMediaOptionsItems() }\n\t\t\t\tonChange={ this.onPickerSelect }\n\t\t\t\ttestID=\"media-options-picker\"\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<URLInput\n\t\t\t\t\tisVisible={ this.state.showURLInput }\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tif ( this.state.url !== '' ) {\n\t\t\t\t\t\t\tthis.props.onSelectURL( this.state.url );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.setState( { showURLInput: false, url: '' } );\n\t\t\t\t\t} }\n\t\t\t\t\tonChange={ ( url ) => {\n\t\t\t\t\t\tthis.setState( { url } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ this.state.url }\n\t\t\t\t/>\n\t\t\t\t{ this.props.render( {\n\t\t\t\t\topen: this.onPickerPresent,\n\t\t\t\t\tgetMediaOptions,\n\t\t\t\t} ) }\n\t\t\t</>\n\t\t);\n\t}\n}\n\nfunction URLInput( props ) {\n\treturn (\n\t\t<BottomSheet\n\t\t\thideHeader\n\t\t\tisVisible={ props.isVisible }\n\t\t\tonClose={ props.onClose }\n\t\t>\n\t\t\t<PanelBody style={ styles[ 'media-upload__link-input' ] }>\n\t\t\t\t<TextControl\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus\n\t\t\t\t\tautoCapitalize=\"none\"\n\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\tautoComplete={ Platform.isIOS ? 'url' : 'off' }\n\t\t\t\t\tkeyboardType=\"url\"\n\t\t\t\t\tlabel={ __( 'Insert from URL' ) }\n\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\tplaceholder={ __( 'Type a URL' ) }\n\t\t\t\t\tvalue={ props.value }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { capabilities } = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tisAudioBlockMediaUploadEnabled:\n\t\t\t\tcapabilities?.isAudioBlockMediaUploadEnabled === true,\n\t\t};\n\t} ),\n] )( MediaUpload );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AALA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,kBAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAQA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,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AAkB,CAAG;IACjC8D,QAAQ,EAAG1F,KAAK,CAAC0F,QAAU;IAC3BmB,WAAW,EAAG,IAAAjF,QAAE,EAAE,YAAa,CAAG;IAClCT,KAAK,EAAGnB,KAAK,CAACmB;EAAO,CACrB,CACS,CACC,CAAC;AAEhB;AAAC,IAAA2F,QAAA,GAEc,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAa,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,WAAW,CAAC,CAAC;EACjE,OAAO;IACNlE,8BAA8B,EAC7BgE,YAAY,EAAEhE,8BAA8B,KAAK;EACnD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEtD,WAAY,CAAC;AAAAqG,OAAA,CAAAoB,OAAA,GAAAP,QAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_i18n","_components","_reactNativeBridge","_icons","_blockEditor","_compose","_data","_constants","_style","_interopRequireDefault","URL_MEDIA_SOURCE","PICKER_OPENING_DELAY","MediaUpload","Component","pickerTimeout","constructor","props","onPickerPresent","bind","onPickerSelect","getAllSources","state","url","showURLInput","otherMediaOptions","componentDidMount","allowedTypes","autoOpen","getOtherMediaOptions","otherMediaOptionsWithIcons","map","option","requiresModal","types","id","value","setState","componentWillUnmount","clearTimeout","onSelectURL","cameraImageSource","mediaSources","deviceCamera","label","OPTION_TAKE_PHOTO","MEDIA_TYPE_IMAGE","icon","capturePhoto","cameraVideoSource","OPTION_TAKE_VIDEO","MEDIA_TYPE_VIDEO","captureVideo","deviceLibrarySource","deviceLibrary","__","image","siteLibrarySource","siteMediaLibrary","OPTION_WORDPRESS_MEDIA_LIBRARY","MEDIA_TYPE_AUDIO","MEDIA_TYPE_ANY","wordpress","mediaLibrary","urlSource","OPTION_INSERT_FROM_URL","globe","internalSources","concat","getMediaOptionsItems","__experimentalOnlyMediaLibrary","isAudioBlockMediaUploadEnabled","filter","source","every","allowedType","includes","some","getChooseFromDeviceIcon","mobile","isIOS","Platform","OS","picker","setTimeout","presentPicker","onSelect","multiple","mediaSource","shift","type","requestMediaPicker","media","render","isReplacingMedia","isOneType","length","isImage","isVideo","isAudio","isAnyType","isImageOrVideo","pickerTitle","getMediaOptions","_react","createElement","Picker","title","hideCancelButton","ref","instance","options","onChange","testID","Fragment","URLInput","isVisible","onClose","open","exports","BottomSheet","hideHeader","PanelBody","style","styles","TextControl","autoFocus","autoCapitalize","autoCorrect","autoComplete","keyboardType","placeholder","_default","compose","withSelect","select","capabilities","blockEditorStore","getSettings","default"],"sources":["@wordpress/block-editor/src/components/media-upload/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, React } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBottomSheet,\n\tPanelBody,\n\tPicker,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tgetOtherMediaOptions,\n\trequestMediaPicker,\n\tmediaSources,\n} from '@wordpress/react-native-bridge';\nimport {\n\tcapturePhoto,\n\tcaptureVideo,\n\timage,\n\twordpress,\n\tmobile,\n\tglobe,\n} from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMEDIA_TYPE_IMAGE,\n\tMEDIA_TYPE_VIDEO,\n\tMEDIA_TYPE_AUDIO,\n\tMEDIA_TYPE_ANY,\n\tOPTION_TAKE_VIDEO,\n\tOPTION_TAKE_PHOTO,\n\tOPTION_INSERT_FROM_URL,\n\tOPTION_WORDPRESS_MEDIA_LIBRARY,\n} from './constants';\nimport styles from './style.scss';\n\nconst URL_MEDIA_SOURCE = 'URL';\n\nconst PICKER_OPENING_DELAY = 200;\n\nexport class MediaUpload extends Component {\n\tpickerTimeout;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.onPickerPresent = this.onPickerPresent.bind( this );\n\t\tthis.onPickerSelect = this.onPickerSelect.bind( this );\n\t\tthis.getAllSources = this.getAllSources.bind( this );\n\t\tthis.state = {\n\t\t\turl: '',\n\t\t\tshowURLInput: false,\n\t\t\totherMediaOptions: [],\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { allowedTypes = [], autoOpen } = this.props;\n\t\tgetOtherMediaOptions( allowedTypes, ( otherMediaOptions ) => {\n\t\t\tconst otherMediaOptionsWithIcons = otherMediaOptions.map(\n\t\t\t\t( option ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...option,\n\t\t\t\t\t\trequiresModal: true,\n\t\t\t\t\t\ttypes: allowedTypes,\n\t\t\t\t\t\tid: option.value,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis.setState( { otherMediaOptions: otherMediaOptionsWithIcons } );\n\t\t} );\n\n\t\tif ( autoOpen ) {\n\t\t\tthis.onPickerPresent();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.pickerTimeout );\n\t}\n\n\tgetAllSources() {\n\t\tconst { onSelectURL } = this.props;\n\n\t\tconst cameraImageSource = {\n\t\t\tid: mediaSources.deviceCamera, // ID is the value sent to native.\n\t\t\tvalue: mediaSources.deviceCamera + '-IMAGE', // This is needed to diferenciate image-camera from video-camera sources.\n\t\t\tlabel: OPTION_TAKE_PHOTO,\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_IMAGE ],\n\t\t\ticon: capturePhoto,\n\t\t};\n\n\t\tconst cameraVideoSource = {\n\t\t\tid: mediaSources.deviceCamera,\n\t\t\tvalue: mediaSources.deviceCamera,\n\t\t\tlabel: OPTION_TAKE_VIDEO,\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_VIDEO ],\n\t\t\ticon: captureVideo,\n\t\t};\n\n\t\tconst deviceLibrarySource = {\n\t\t\tid: mediaSources.deviceLibrary,\n\t\t\tvalue: mediaSources.deviceLibrary,\n\t\t\tlabel: __( 'Choose from device' ),\n\t\t\trequiresModal: true,\n\t\t\ttypes: [ MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],\n\t\t\ticon: image,\n\t\t};\n\n\t\tconst siteLibrarySource = {\n\t\t\tid: mediaSources.siteMediaLibrary,\n\t\t\tvalue: mediaSources.siteMediaLibrary,\n\t\t\tlabel: OPTION_WORDPRESS_MEDIA_LIBRARY,\n\t\t\trequiresModal: true,\n\t\t\ttypes: [\n\t\t\t\tMEDIA_TYPE_IMAGE,\n\t\t\t\tMEDIA_TYPE_VIDEO,\n\t\t\t\tMEDIA_TYPE_AUDIO,\n\t\t\t\tMEDIA_TYPE_ANY,\n\t\t\t],\n\t\t\ticon: wordpress,\n\t\t\tmediaLibrary: true,\n\t\t};\n\n\t\tconst urlSource = {\n\t\t\tid: URL_MEDIA_SOURCE,\n\t\t\tvalue: URL_MEDIA_SOURCE,\n\t\t\tlabel: OPTION_INSERT_FROM_URL,\n\t\t\ttypes: [ MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],\n\t\t\ticon: globe,\n\t\t};\n\n\t\t// Only include `urlSource` option if `onSelectURL` prop is present, in order to match the web behavior.\n\t\tconst internalSources = [\n\t\t\tdeviceLibrarySource,\n\t\t\tcameraImageSource,\n\t\t\tcameraVideoSource,\n\t\t\tsiteLibrarySource,\n\t\t\t...( onSelectURL ? [ urlSource ] : [] ),\n\t\t];\n\n\t\treturn internalSources.concat( this.state.otherMediaOptions );\n\t}\n\n\tgetMediaOptionsItems() {\n\t\tconst {\n\t\t\tallowedTypes = [],\n\t\t\t__experimentalOnlyMediaLibrary,\n\t\t\tisAudioBlockMediaUploadEnabled,\n\t\t} = this.props;\n\n\t\treturn this.getAllSources()\n\t\t\t.filter( ( source ) => {\n\t\t\t\tif ( __experimentalOnlyMediaLibrary ) {\n\t\t\t\t\treturn source.mediaLibrary;\n\t\t\t\t} else if (\n\t\t\t\t\tallowedTypes.every(\n\t\t\t\t\t\t( allowedType ) =>\n\t\t\t\t\t\t\tallowedType === MEDIA_TYPE_AUDIO &&\n\t\t\t\t\t\t\tsource.types.includes( allowedType )\n\t\t\t\t\t) &&\n\t\t\t\t\tsource.id !== URL_MEDIA_SOURCE\n\t\t\t\t) {\n\t\t\t\t\treturn isAudioBlockMediaUploadEnabled === true;\n\t\t\t\t}\n\n\t\t\t\treturn allowedTypes.some( ( allowedType ) =>\n\t\t\t\t\tsource.types.includes( allowedType )\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.map( ( source ) => {\n\t\t\t\treturn {\n\t\t\t\t\t...source,\n\t\t\t\t\ticon: source.icon || this.getChooseFromDeviceIcon(),\n\t\t\t\t};\n\t\t\t} );\n\t}\n\n\tgetChooseFromDeviceIcon() {\n\t\treturn mobile;\n\t}\n\n\tonPickerPresent() {\n\t\tconst { autoOpen } = this.props;\n\t\tconst isIOS = Platform.OS === 'ios';\n\n\t\tif ( this.picker ) {\n\t\t\t// the delay below is required because on iOS this action sheet gets dismissed by the close event of the Inserter\n\t\t\t// so this delay allows the Inserter to be closed fully before presenting action sheet.\n\t\t\tif ( autoOpen && isIOS ) {\n\t\t\t\tthis.pickerTimeout = setTimeout(\n\t\t\t\t\t() => this.picker.presentPicker(),\n\t\t\t\t\tPICKER_OPENING_DELAY\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.picker.presentPicker();\n\t\t\t}\n\t\t}\n\t}\n\n\tonPickerSelect( value ) {\n\t\tconst { allowedTypes = [], onSelect, multiple = false } = this.props;\n\n\t\tif ( value === URL_MEDIA_SOURCE ) {\n\t\t\tthis.setState( { showURLInput: true } );\n\t\t\treturn;\n\t\t}\n\n\t\tconst mediaSource = this.getAllSources()\n\t\t\t.filter( ( source ) => source.value === value )\n\t\t\t.shift();\n\t\tconst types = allowedTypes.filter( ( type ) =>\n\t\t\tmediaSource.types.includes( type )\n\t\t);\n\n\t\trequestMediaPicker( mediaSource.id, types, multiple, ( media ) => {\n\t\t\tif ( ( multiple && media ) || ( media && media.id ) ) {\n\t\t\t\tonSelect( media );\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst { allowedTypes = [], isReplacingMedia, multiple } = this.props;\n\t\tconst isOneType = allowedTypes.length === 1;\n\t\tconst isImage = isOneType && allowedTypes.includes( MEDIA_TYPE_IMAGE );\n\t\tconst isVideo = isOneType && allowedTypes.includes( MEDIA_TYPE_VIDEO );\n\t\tconst isAudio = isOneType && allowedTypes.includes( MEDIA_TYPE_AUDIO );\n\t\tconst isAnyType = isOneType && allowedTypes.includes( MEDIA_TYPE_ANY );\n\n\t\tconst isImageOrVideo =\n\t\t\tallowedTypes.length === 2 &&\n\t\t\tallowedTypes.includes( MEDIA_TYPE_IMAGE ) &&\n\t\t\tallowedTypes.includes( MEDIA_TYPE_VIDEO );\n\n\t\tlet pickerTitle;\n\t\tif ( isImage ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace image' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = multiple\n\t\t\t\t\t? __( 'Choose images' )\n\t\t\t\t\t: __( 'Choose image' );\n\t\t\t}\n\t\t} else if ( isVideo ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace video' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose video' );\n\t\t\t}\n\t\t} else if ( isImageOrVideo ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace image or video' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose image or video' );\n\t\t\t}\n\t\t} else if ( isAudio ) {\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace audio' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose audio' );\n\t\t\t}\n\t\t} else if ( isAnyType ) {\n\t\t\tpickerTitle = __( 'Choose file' );\n\t\t\tif ( isReplacingMedia ) {\n\t\t\t\tpickerTitle = __( 'Replace file' );\n\t\t\t} else {\n\t\t\t\tpickerTitle = __( 'Choose file' );\n\t\t\t}\n\t\t}\n\n\t\tconst getMediaOptions = () => (\n\t\t\t<Picker\n\t\t\t\ttitle={ pickerTitle }\n\t\t\t\thideCancelButton\n\t\t\t\tref={ ( instance ) => ( this.picker = instance ) }\n\t\t\t\toptions={ this.getMediaOptionsItems() }\n\t\t\t\tonChange={ this.onPickerSelect }\n\t\t\t\ttestID=\"media-options-picker\"\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<URLInput\n\t\t\t\t\tisVisible={ this.state.showURLInput }\n\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\tif ( this.state.url !== '' ) {\n\t\t\t\t\t\t\tthis.props.onSelectURL( this.state.url );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.setState( { showURLInput: false, url: '' } );\n\t\t\t\t\t} }\n\t\t\t\t\tonChange={ ( url ) => {\n\t\t\t\t\t\tthis.setState( { url } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ this.state.url }\n\t\t\t\t/>\n\t\t\t\t{ this.props.render( {\n\t\t\t\t\topen: this.onPickerPresent,\n\t\t\t\t\tgetMediaOptions,\n\t\t\t\t} ) }\n\t\t\t</>\n\t\t);\n\t}\n}\n\nfunction URLInput( props ) {\n\treturn (\n\t\t<BottomSheet\n\t\t\thideHeader\n\t\t\tisVisible={ props.isVisible }\n\t\t\tonClose={ props.onClose }\n\t\t>\n\t\t\t<PanelBody style={ styles[ 'media-upload__link-input' ] }>\n\t\t\t\t<TextControl\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus\n\t\t\t\t\tautoCapitalize=\"none\"\n\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\tautoComplete={ Platform.isIOS ? 'url' : 'off' }\n\t\t\t\t\tkeyboardType=\"url\"\n\t\t\t\t\tlabel={ OPTION_INSERT_FROM_URL }\n\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\tplaceholder={ __( 'Type a URL' ) }\n\t\t\t\t\tvalue={ props.value }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { capabilities } = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tisAudioBlockMediaUploadEnabled:\n\t\t\t\tcapabilities?.isAudioBlockMediaUploadEnabled === true,\n\t\t};\n\t} ),\n] )( MediaUpload );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,kBAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAQA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,UAAA,GAAAT,OAAA;AAUA,IAAAU,MAAA,GAAAC,sBAAA,CAAAX,OAAA;AA9CA;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;;AAaA,MAAMY,gBAAgB,GAAG,KAAK;AAE9B,MAAMC,oBAAoB,GAAG,GAAG;AAEzB,MAAMC,WAAW,SAASC,kBAAS,CAAC;EAC1CC,aAAa;EAEbC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACC,IAAI,CAAE,IAAK,CAAC;IACxD,IAAI,CAACC,cAAc,GAAG,IAAI,CAACA,cAAc,CAACD,IAAI,CAAE,IAAK,CAAC;IACtD,IAAI,CAACE,aAAa,GAAG,IAAI,CAACA,aAAa,CAACF,IAAI,CA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,WAAA;AAED,SAASsG,QAAQA,CAAElG,KAAK,EAAG;EAC1B,OACC,IAAAuF,MAAA,CAAAC,aAAA,EAACvG,WAAA,CAAAsH,WAAW;IACXC,UAAU;IACVL,SAAS,EAAGnG,KAAK,CAACmG,SAAW;IAC7BC,OAAO,EAAGpG,KAAK,CAACoG;EAAS,GAEzB,IAAAb,MAAA,CAAAC,aAAA,EAACvG,WAAA,CAAAwH,SAAS;IAACC,KAAK,EAAGC,cAAM,CAAE,0BAA0B;EAAI,GACxD,IAAApB,MAAA,CAAAC,aAAA,EAACvG,WAAA,CAAA2H;EACA;EAAA;IACAC,SAAS;IACTC,cAAc,EAAC,MAAM;IACrBC,WAAW,EAAG,KAAO;IACrBC,YAAY,EAAGhD,qBAAQ,CAACD,KAAK,GAAG,KAAK,GAAG,KAAO;IAC/CkD,YAAY,EAAC,KAAK;IAClBtF,KAAK,EAAGqB,iCAAwB;IAChC+C,QAAQ,EAAG/F,KAAK,CAAC+F,QAAU;IAC3BmB,WAAW,EAAG,IAAA5E,QAAE,EAAE,YAAa,CAAG;IAClCnB,KAAK,EAAGnB,KAAK,CAACmB;EAAO,CACrB,CACS,CACC,CAAC;AAEhB;AAAC,IAAAgG,QAAA,GAEc,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAa,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,WAAW,CAAC,CAAC;EACjE,OAAO;IACNnE,8BAA8B,EAC7BiE,YAAY,EAAEjE,8BAA8B,KAAK;EACnD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE1D,WAAY,CAAC;AAAA0G,OAAA,CAAAoB,OAAA,GAAAP,QAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.MediaUploadProgress = exports.MEDIA_UPLOAD_STATE_UPLOADING = exports.MEDIA_UPLOAD_STATE_SUCCEEDED = exports.MEDIA_UPLOAD_STATE_RESET = exports.MEDIA_UPLOAD_STATE_FAILED = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _components = require("@wordpress/components");
|
|
11
12
|
var _i18n = require("@wordpress/i18n");
|
|
12
13
|
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
@@ -132,12 +133,12 @@ class MediaUploadProgress extends _element.Component {
|
|
|
132
133
|
// eslint-disable-next-line @wordpress/i18n-no-collapsible-whitespace
|
|
133
134
|
const retryMessage = (0, _i18n.__)('Failed to insert media.\nTap for more info.');
|
|
134
135
|
const progressBarStyle = [_styles.default.progressBar, showSpinner || _styles.default.progressBarHidden, this.props.progressBarStyle];
|
|
135
|
-
return (0,
|
|
136
|
+
return (0, _react.createElement)(_reactNative.View, {
|
|
136
137
|
style: [_styles.default.mediaUploadProgress, this.props.containerStyle],
|
|
137
138
|
pointerEvents: "box-none"
|
|
138
|
-
}, (0,
|
|
139
|
+
}, (0, _react.createElement)(_reactNative.View, {
|
|
139
140
|
style: progressBarStyle
|
|
140
|
-
}, showSpinner && (0,
|
|
141
|
+
}, showSpinner && (0, _react.createElement)(_components.Spinner, {
|
|
141
142
|
progress: progress,
|
|
142
143
|
style: this.props.spinnerStyle,
|
|
143
144
|
testID: "spinner"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_components","_i18n","_reactNativeBridge","_styles","_interopRequireDefault","MEDIA_UPLOAD_STATE_UPLOADING","exports","MEDIA_UPLOAD_STATE_SUCCEEDED","MEDIA_UPLOAD_STATE_FAILED","MEDIA_UPLOAD_STATE_RESET","MediaUploadProgress","Component","constructor","props","state","progress","isUploadInProgress","isUploadFailed","mediaUpload","bind","componentDidMount","addMediaUploadListener","componentWillUnmount","removeMediaUploadListener","payload","mediaId","updateMediaProgress","finishMediaUploadWithSuccess","finishMediaUploadWithFailure","mediaUploadStateReset","setState","onUpdateMediaProgress","onFinishMediaUploadWithSuccess","onFinishMediaUploadWithFailure","onMediaUploadStateReset","subscriptionParentMediaUpload","subscribeMediaUpload","remove","render","renderContent","showSpinner","retryMessage","__","progressBarStyle","styles","progressBar","progressBarHidden","_react","createElement","View","style","mediaUploadProgress","containerStyle","pointerEvents","Spinner","spinnerStyle","testID","_default","default"],"sources":["@wordpress/block-editor/src/components/media-upload-progress/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { subscribeMediaUpload } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nexport const MEDIA_UPLOAD_STATE_UPLOADING = 1;\nexport const MEDIA_UPLOAD_STATE_SUCCEEDED = 2;\nexport const MEDIA_UPLOAD_STATE_FAILED = 3;\nexport const MEDIA_UPLOAD_STATE_RESET = 4;\n\nexport class MediaUploadProgress extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.state = {\n\t\t\tprogress: 0,\n\t\t\tisUploadInProgress: false,\n\t\t\tisUploadFailed: false,\n\t\t};\n\n\t\tthis.mediaUpload = this.mediaUpload.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.addMediaUploadListener();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.removeMediaUploadListener();\n\t}\n\n\tmediaUpload( payload ) {\n\t\tconst { mediaId } = this.props;\n\n\t\tif ( payload.mediaId !== mediaId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( payload.state ) {\n\t\t\tcase MEDIA_UPLOAD_STATE_UPLOADING:\n\t\t\t\tthis.updateMediaProgress( payload );\n\t\t\t\tbreak;\n\t\t\tcase MEDIA_UPLOAD_STATE_SUCCEEDED:\n\t\t\t\tthis.finishMediaUploadWithSuccess( payload );\n\t\t\t\tbreak;\n\t\t\tcase MEDIA_UPLOAD_STATE_FAILED:\n\t\t\t\tthis.finishMediaUploadWithFailure( payload );\n\t\t\t\tbreak;\n\t\t\tcase MEDIA_UPLOAD_STATE_RESET:\n\t\t\t\tthis.mediaUploadStateReset( payload );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tupdateMediaProgress( payload ) {\n\t\tthis.setState( {\n\t\t\tprogress: payload.progress,\n\t\t\tisUploadInProgress: true,\n\t\t\tisUploadFailed: false,\n\t\t} );\n\t\tif ( this.props.onUpdateMediaProgress ) {\n\t\t\tthis.props.onUpdateMediaProgress( payload );\n\t\t}\n\t}\n\n\tfinishMediaUploadWithSuccess( payload ) {\n\t\tthis.setState( { isUploadInProgress: false } );\n\t\tif ( this.props.onFinishMediaUploadWithSuccess ) {\n\t\t\tthis.props.onFinishMediaUploadWithSuccess( payload );\n\t\t}\n\t}\n\n\tfinishMediaUploadWithFailure( payload ) {\n\t\tthis.setState( { isUploadInProgress: false, isUploadFailed: true } );\n\t\tif ( this.props.onFinishMediaUploadWithFailure ) {\n\t\t\tthis.props.onFinishMediaUploadWithFailure( payload );\n\t\t}\n\t}\n\n\tmediaUploadStateReset( payload ) {\n\t\tthis.setState( { isUploadInProgress: false, isUploadFailed: false } );\n\t\tif ( this.props.onMediaUploadStateReset ) {\n\t\t\tthis.props.onMediaUploadStateReset( payload );\n\t\t}\n\t}\n\n\taddMediaUploadListener() {\n\t\t// If we already have a subscription not worth doing it again.\n\t\tif ( this.subscriptionParentMediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.subscriptionParentMediaUpload = subscribeMediaUpload(\n\t\t\t( payload ) => {\n\t\t\t\tthis.mediaUpload( payload );\n\t\t\t}\n\t\t);\n\t}\n\n\tremoveMediaUploadListener() {\n\t\tif ( this.subscriptionParentMediaUpload ) {\n\t\t\tthis.subscriptionParentMediaUpload.remove();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { renderContent = () => null } = this.props;\n\t\tconst { isUploadInProgress, isUploadFailed } = this.state;\n\t\tconst showSpinner = this.state.isUploadInProgress;\n\t\tconst progress = this.state.progress * 100;\n\t\t// eslint-disable-next-line @wordpress/i18n-no-collapsible-whitespace\n\t\tconst retryMessage = __(\n\t\t\t'Failed to insert media.\\nTap for more info.'\n\t\t);\n\n\t\tconst progressBarStyle = [\n\t\t\tstyles.progressBar,\n\t\t\tshowSpinner || styles.progressBarHidden,\n\t\t\tthis.props.progressBarStyle,\n\t\t];\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.mediaUploadProgress,\n\t\t\t\t\tthis.props.containerStyle,\n\t\t\t\t] }\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t>\n\t\t\t\t<View style={ progressBarStyle }>\n\t\t\t\t\t{ showSpinner && (\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tprogress={ progress }\n\t\t\t\t\t\t\tstyle={ this.props.spinnerStyle }\n\t\t\t\t\t\t\ttestID=\"spinner\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t\t{ renderContent( {\n\t\t\t\t\tisUploadInProgress,\n\t\t\t\t\tisUploadFailed,\n\t\t\t\t\tretryMessage,\n\t\t\t\t} ) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default MediaUploadProgress;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGO,MAAMO,4BAA4B,GAAG,C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AAAI,mBAAA,GAAAA,mBAAA;AAAA,IAAA+C,QAAA,GAEc/C,mBAAmB;AAAAJ,OAAA,CAAAoD,OAAA,GAAAD,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _blocks = require("@wordpress/blocks");
|
|
@@ -25,17 +25,17 @@ function MultiSelectionInspector({
|
|
|
25
25
|
blocks
|
|
26
26
|
}) {
|
|
27
27
|
const words = (0, _wordcount.count)((0, _blocks.serialize)(blocks), 'words');
|
|
28
|
-
return (0,
|
|
28
|
+
return (0, _react.createElement)("div", {
|
|
29
29
|
className: "block-editor-multi-selection-inspector__card"
|
|
30
|
-
}, (0,
|
|
30
|
+
}, (0, _react.createElement)(_blockIcon.default, {
|
|
31
31
|
icon: _icons.copy,
|
|
32
32
|
showColors: true
|
|
33
|
-
}), (0,
|
|
33
|
+
}), (0, _react.createElement)("div", {
|
|
34
34
|
className: "block-editor-multi-selection-inspector__card-content"
|
|
35
|
-
}, (0,
|
|
35
|
+
}, (0, _react.createElement)("div", {
|
|
36
36
|
className: "block-editor-multi-selection-inspector__card-title"
|
|
37
37
|
}, (0, _i18n.sprintf)( /* translators: %d: number of blocks */
|
|
38
|
-
(0, _i18n._n)('%d Block', '%d Blocks', blocks.length), blocks.length)), (0,
|
|
38
|
+
(0, _i18n._n)('%d Block', '%d Blocks', blocks.length), blocks.length)), (0, _react.createElement)("div", {
|
|
39
39
|
className: "block-editor-multi-selection-inspector__card-description"
|
|
40
40
|
}, (0, _i18n.sprintf)( /* translators: %d: number of words */
|
|
41
41
|
(0, _i18n._n)('%d word selected.', '%d words selected.', words), words))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_blocks","_wordcount","_icons","_blockIcon","_interopRequireDefault","_store","MultiSelectionInspector","blocks","words","wordCount","serialize","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_blocks","_wordcount","_icons","_blockIcon","_interopRequireDefault","_store","MultiSelectionInspector","blocks","words","wordCount","serialize","_react","createElement","className","default","icon","copy","showColors","sprintf","_n","length","_default","withSelect","select","getMultiSelectedBlocks","blockEditorStore","exports"],"sources":["@wordpress/block-editor/src/components/multi-selection-inspector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { serialize } from '@wordpress/blocks';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nfunction MultiSelectionInspector( { blocks } ) {\n\tconst words = wordCount( serialize( blocks ), 'words' );\n\n\treturn (\n\t\t<div className=\"block-editor-multi-selection-inspector__card\">\n\t\t\t<BlockIcon icon={ copy } showColors />\n\t\t\t<div className=\"block-editor-multi-selection-inspector__card-content\">\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-title\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks */\n\t\t\t\t\t\t_n( '%d Block', '%d Blocks', blocks.length ),\n\t\t\t\t\t\tblocks.length\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of words */\n\t\t\t\t\t\t_n( '%d word selected.', '%d words selected.', words ),\n\t\t\t\t\t\twords\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getMultiSelectedBlocks } = select( blockEditorStore );\n\treturn {\n\t\tblocks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EAC7D,OAAO;IACNlB,MAAM,EAAEiB,sBAAsB,CAAC;EAChC,CAAC;AACF,CAAE,CAAC,CAAElB,uBAAwB,CAAC;AAAAoB,OAAA,CAAAZ,OAAA,GAAAO,QAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
11
12
|
var _dom = require("@wordpress/dom");
|
|
12
13
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
@@ -144,13 +145,13 @@ function NavigableToolbar({
|
|
|
144
145
|
const isAccessibleToolbar = useIsAccessibleToolbar(ref);
|
|
145
146
|
useToolbarFocus(ref, focusOnMount, isAccessibleToolbar, initialIndex, onIndexChange, shouldUseKeyboardFocusShortcut);
|
|
146
147
|
if (isAccessibleToolbar) {
|
|
147
|
-
return (0,
|
|
148
|
+
return (0, _react.createElement)(_components.Toolbar, {
|
|
148
149
|
label: props['aria-label'],
|
|
149
150
|
ref: ref,
|
|
150
151
|
...props
|
|
151
152
|
}, children);
|
|
152
153
|
}
|
|
153
|
-
return (0,
|
|
154
|
+
return (0, _react.createElement)(_components.NavigableMenu, {
|
|
154
155
|
orientation: "horizontal",
|
|
155
156
|
role: "toolbar",
|
|
156
157
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_deprecated","_interopRequireDefault","_dom","_keyboardShortcuts","hasOnlyToolbarItem","elements","dataProp","some","element","dataset","getAllToolbarItemsIn","container","Array","from","querySelectorAll","hasFocusWithin","contains","ownerDocument","activeElement","focusFirstTabbableIn","firstTabbable","focus","tabbable","find","preventScroll","useIsAccessibleToolbar","ref","initialAccessibleToolbarState","isAccessibleToolbar","setIsAccessibleToolbar","useState","determineIsAccessibleToolbar","useCallback","tabbables","current","onlyToolbarItem","deprecated","since","alternative","link","useLayoutEffect","observer","window","MutationObserver","observe","childList","subtree","disconnect","useToolbarFocus","focusOnMount","defaultIndex","onIndexChange","shouldUseKeyboardFocusShortcut","initialFocusOnMount","initialIndex","focusToolbar","focusToolbarViaShortcut","useShortcut","useEffect","navigableToolbarRef","raf","requestAnimationFrame","items","index","cancelAnimationFrame","findIndex","item","tabIndex","NavigableToolbar","children","__experimentalInitialIndex","__experimentalOnIndexChange","props","useRef","createElement","Toolbar","label","NavigableMenu","orientation","role","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/navigable-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NavigableMenu, Toolbar } from '@wordpress/components';\nimport {\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { focus } from '@wordpress/dom';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\nfunction hasOnlyToolbarItem( elements ) {\n\tconst dataProp = 'toolbarItem';\n\treturn ! elements.some( ( element ) => ! ( dataProp in element.dataset ) );\n}\n\nfunction getAllToolbarItemsIn( container ) {\n\treturn Array.from( container.querySelectorAll( '[data-toolbar-item]' ) );\n}\n\nfunction hasFocusWithin( container ) {\n\treturn container.contains( container.ownerDocument.activeElement );\n}\n\nfunction focusFirstTabbableIn( container ) {\n\tconst [ firstTabbable ] = focus.tabbable.find( container );\n\tif ( firstTabbable ) {\n\t\tfirstTabbable.focus( {\n\t\t\t// When focusing newly mounted toolbars,\n\t\t\t// the position of the popover is often not right on the first render\n\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\tpreventScroll: true,\n\t\t} );\n\t}\n}\n\nfunction useIsAccessibleToolbar( ref ) {\n\t/*\n\t * By default, we'll assume the starting accessible state of the Toolbar\n\t * is true, as it seems to be the most common case.\n\t *\n\t * Transitioning from an (initial) false to true state causes the\n\t * <Toolbar /> component to mount twice, which is causing undesired\n\t * side-effects. These side-effects appear to only affect certain\n\t * E2E tests.\n\t *\n\t * This was initial discovered in this pull-request:\n\t * https://github.com/WordPress/gutenberg/pull/23425\n\t */\n\tconst initialAccessibleToolbarState = true;\n\n\t// By default, it's gonna render NavigableMenu. If all the tabbable elements\n\t// inside the toolbar are ToolbarItem components (or derived components like\n\t// ToolbarButton), then we can wrap them with the accessible Toolbar\n\t// component.\n\tconst [ isAccessibleToolbar, setIsAccessibleToolbar ] = useState(\n\t\tinitialAccessibleToolbarState\n\t);\n\n\tconst determineIsAccessibleToolbar = useCallback( () => {\n\t\tconst tabbables = focus.tabbable.find( ref.current );\n\t\tconst onlyToolbarItem = hasOnlyToolbarItem( tabbables );\n\t\tif ( ! onlyToolbarItem ) {\n\t\t\tdeprecated( 'Using custom components as toolbar controls', {\n\t\t\t\tsince: '5.6',\n\t\t\t\talternative:\n\t\t\t\t\t'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components',\n\t\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols',\n\t\t\t} );\n\t\t}\n\t\tsetIsAccessibleToolbar( onlyToolbarItem );\n\t}, [] );\n\n\tuseLayoutEffect( () => {\n\t\t// Toolbar buttons may be rendered asynchronously, so we use\n\t\t// MutationObserver to check if the toolbar subtree has been modified.\n\t\tconst observer = new window.MutationObserver(\n\t\t\tdetermineIsAccessibleToolbar\n\t\t);\n\t\tobserver.observe( ref.current, { childList: true, subtree: true } );\n\t\treturn () => observer.disconnect();\n\t}, [ isAccessibleToolbar ] );\n\n\treturn isAccessibleToolbar;\n}\n\nfunction useToolbarFocus(\n\tref,\n\tfocusOnMount,\n\tisAccessibleToolbar,\n\tdefaultIndex,\n\tonIndexChange,\n\tshouldUseKeyboardFocusShortcut\n) {\n\t// Make sure we don't use modified versions of this prop.\n\tconst [ initialFocusOnMount ] = useState( focusOnMount );\n\tconst [ initialIndex ] = useState( defaultIndex );\n\n\tconst focusToolbar = useCallback( () => {\n\t\tfocusFirstTabbableIn( ref.current );\n\t}, [] );\n\n\tconst focusToolbarViaShortcut = () => {\n\t\tif ( shouldUseKeyboardFocusShortcut ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t};\n\n\t// Focus on toolbar when pressing alt+F10 when the toolbar is visible.\n\tuseShortcut( 'core/block-editor/focus-toolbar', focusToolbarViaShortcut );\n\n\tuseEffect( () => {\n\t\tif ( initialFocusOnMount ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t}, [ isAccessibleToolbar, initialFocusOnMount, focusToolbar ] );\n\n\tuseEffect( () => {\n\t\t// Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing\n\t\tconst navigableToolbarRef = ref.current;\n\t\t// If initialIndex is passed, we focus on that toolbar item when the\n\t\t// toolbar gets mounted and initial focus is not forced.\n\t\t// We have to wait for the next browser paint because block controls aren't\n\t\t// rendered right away when the toolbar gets mounted.\n\t\tlet raf = 0;\n\t\tif ( ! initialFocusOnMount ) {\n\t\t\traf = window.requestAnimationFrame( () => {\n\t\t\t\tconst items = getAllToolbarItemsIn( navigableToolbarRef );\n\t\t\t\tconst index = initialIndex || 0;\n\t\t\t\tif ( items[ index ] && hasFocusWithin( navigableToolbarRef ) ) {\n\t\t\t\t\titems[ index ].focus( {\n\t\t\t\t\t\t// When focusing newly mounted toolbars,\n\t\t\t\t\t\t// the position of the popover is often not right on the first render\n\t\t\t\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tif ( ! onIndexChange || ! navigableToolbarRef ) return;\n\t\t\t// When the toolbar element is unmounted and onIndexChange is passed, we\n\t\t\t// pass the focused toolbar item index so it can be hydrated later.\n\t\t\tconst items = getAllToolbarItemsIn( navigableToolbarRef );\n\t\t\tconst index = items.findIndex( ( item ) => item.tabIndex === 0 );\n\t\t\tonIndexChange( index );\n\t\t};\n\t}, [ initialIndex, initialFocusOnMount ] );\n}\n\nfunction NavigableToolbar( {\n\tchildren,\n\tfocusOnMount,\n\tshouldUseKeyboardFocusShortcut = true,\n\t__experimentalInitialIndex: initialIndex,\n\t__experimentalOnIndexChange: onIndexChange,\n\t...props\n} ) {\n\tconst ref = useRef();\n\tconst isAccessibleToolbar = useIsAccessibleToolbar( ref );\n\n\tuseToolbarFocus(\n\t\tref,\n\t\tfocusOnMount,\n\t\tisAccessibleToolbar,\n\t\tinitialIndex,\n\t\tonIndexChange,\n\t\tshouldUseKeyboardFocusShortcut\n\t);\n\n\tif ( isAccessibleToolbar ) {\n\t\treturn (\n\t\t\t<Toolbar label={ props[ 'aria-label' ] } ref={ ref } { ...props }>\n\t\t\t\t{ children }\n\t\t\t</Toolbar>\n\t\t);\n\t}\n\n\treturn (\n\t\t<NavigableMenu\n\t\t\torientation=\"horizontal\"\n\t\t\trole=\"toolbar\"\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</NavigableMenu>\n\t);\n}\n\nexport default NavigableToolbar;\n"],"mappings":";;;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AADA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAbA;AACA;AACA;;AAaA,SAASM,kBAAkBA,CAAEC,QAAQ,EAAG;EACvC,MAAMC,QAAQ,GAAG,aAAa;EAC9B,OAAO,CAAED,QAAQ,CAACE,IAAI,CAAIC,OAAO,IAAM,EAAIF,QAAQ,IAAIE,OAAO,CAACC,OAAO,CAAG,CAAC;AAC3E;AAEA,SAASC,oBAAoBA,CAAEC,S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AO;MAACC,KAAK,EAAGJ,KAAK,CAAE,YAAY,CAAI;MAAC9C,GAAG,EAAGA,GAAK;MAAA,GAAM8C;IAAK,GAC5DH,QACM,CAAC;EAEZ;EAEA,OACC,IAAAxE,QAAA,CAAA6E,aAAA,EAAC3E,WAAA,CAAA8E,aAAa;IACbC,WAAW,EAAC,YAAY;IACxBC,IAAI,EAAC,SAAS;IACdrD,GAAG,EAAGA,GAAK;IAAA,GACN8C;EAAK,GAERH,QACY,CAAC;AAElB;AAAC,IAAAW,QAAA,GAEcZ,gBAAgB;AAAAa,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_components","require","_element","_deprecated","_interopRequireDefault","_dom","_keyboardShortcuts","hasOnlyToolbarItem","elements","dataProp","some","element","dataset","getAllToolbarItemsIn","container","Array","from","querySelectorAll","hasFocusWithin","contains","ownerDocument","activeElement","focusFirstTabbableIn","firstTabbable","focus","tabbable","find","preventScroll","useIsAccessibleToolbar","ref","initialAccessibleToolbarState","isAccessibleToolbar","setIsAccessibleToolbar","useState","determineIsAccessibleToolbar","useCallback","tabbables","current","onlyToolbarItem","deprecated","since","alternative","link","useLayoutEffect","observer","window","MutationObserver","observe","childList","subtree","disconnect","useToolbarFocus","focusOnMount","defaultIndex","onIndexChange","shouldUseKeyboardFocusShortcut","initialFocusOnMount","initialIndex","focusToolbar","focusToolbarViaShortcut","useShortcut","useEffect","navigableToolbarRef","raf","requestAnimationFrame","items","index","cancelAnimationFrame","findIndex","item","tabIndex","NavigableToolbar","children","__experimentalInitialIndex","__experimentalOnIndexChange","props","useRef","_react","createElement","Toolbar","label","NavigableMenu","orientation","role","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/navigable-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NavigableMenu, Toolbar } from '@wordpress/components';\nimport {\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { focus } from '@wordpress/dom';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\n\nfunction hasOnlyToolbarItem( elements ) {\n\tconst dataProp = 'toolbarItem';\n\treturn ! elements.some( ( element ) => ! ( dataProp in element.dataset ) );\n}\n\nfunction getAllToolbarItemsIn( container ) {\n\treturn Array.from( container.querySelectorAll( '[data-toolbar-item]' ) );\n}\n\nfunction hasFocusWithin( container ) {\n\treturn container.contains( container.ownerDocument.activeElement );\n}\n\nfunction focusFirstTabbableIn( container ) {\n\tconst [ firstTabbable ] = focus.tabbable.find( container );\n\tif ( firstTabbable ) {\n\t\tfirstTabbable.focus( {\n\t\t\t// When focusing newly mounted toolbars,\n\t\t\t// the position of the popover is often not right on the first render\n\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\tpreventScroll: true,\n\t\t} );\n\t}\n}\n\nfunction useIsAccessibleToolbar( ref ) {\n\t/*\n\t * By default, we'll assume the starting accessible state of the Toolbar\n\t * is true, as it seems to be the most common case.\n\t *\n\t * Transitioning from an (initial) false to true state causes the\n\t * <Toolbar /> component to mount twice, which is causing undesired\n\t * side-effects. These side-effects appear to only affect certain\n\t * E2E tests.\n\t *\n\t * This was initial discovered in this pull-request:\n\t * https://github.com/WordPress/gutenberg/pull/23425\n\t */\n\tconst initialAccessibleToolbarState = true;\n\n\t// By default, it's gonna render NavigableMenu. If all the tabbable elements\n\t// inside the toolbar are ToolbarItem components (or derived components like\n\t// ToolbarButton), then we can wrap them with the accessible Toolbar\n\t// component.\n\tconst [ isAccessibleToolbar, setIsAccessibleToolbar ] = useState(\n\t\tinitialAccessibleToolbarState\n\t);\n\n\tconst determineIsAccessibleToolbar = useCallback( () => {\n\t\tconst tabbables = focus.tabbable.find( ref.current );\n\t\tconst onlyToolbarItem = hasOnlyToolbarItem( tabbables );\n\t\tif ( ! onlyToolbarItem ) {\n\t\t\tdeprecated( 'Using custom components as toolbar controls', {\n\t\t\t\tsince: '5.6',\n\t\t\t\talternative:\n\t\t\t\t\t'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components',\n\t\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols',\n\t\t\t} );\n\t\t}\n\t\tsetIsAccessibleToolbar( onlyToolbarItem );\n\t}, [] );\n\n\tuseLayoutEffect( () => {\n\t\t// Toolbar buttons may be rendered asynchronously, so we use\n\t\t// MutationObserver to check if the toolbar subtree has been modified.\n\t\tconst observer = new window.MutationObserver(\n\t\t\tdetermineIsAccessibleToolbar\n\t\t);\n\t\tobserver.observe( ref.current, { childList: true, subtree: true } );\n\t\treturn () => observer.disconnect();\n\t}, [ isAccessibleToolbar ] );\n\n\treturn isAccessibleToolbar;\n}\n\nfunction useToolbarFocus(\n\tref,\n\tfocusOnMount,\n\tisAccessibleToolbar,\n\tdefaultIndex,\n\tonIndexChange,\n\tshouldUseKeyboardFocusShortcut\n) {\n\t// Make sure we don't use modified versions of this prop.\n\tconst [ initialFocusOnMount ] = useState( focusOnMount );\n\tconst [ initialIndex ] = useState( defaultIndex );\n\n\tconst focusToolbar = useCallback( () => {\n\t\tfocusFirstTabbableIn( ref.current );\n\t}, [] );\n\n\tconst focusToolbarViaShortcut = () => {\n\t\tif ( shouldUseKeyboardFocusShortcut ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t};\n\n\t// Focus on toolbar when pressing alt+F10 when the toolbar is visible.\n\tuseShortcut( 'core/block-editor/focus-toolbar', focusToolbarViaShortcut );\n\n\tuseEffect( () => {\n\t\tif ( initialFocusOnMount ) {\n\t\t\tfocusToolbar();\n\t\t}\n\t}, [ isAccessibleToolbar, initialFocusOnMount, focusToolbar ] );\n\n\tuseEffect( () => {\n\t\t// Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing\n\t\tconst navigableToolbarRef = ref.current;\n\t\t// If initialIndex is passed, we focus on that toolbar item when the\n\t\t// toolbar gets mounted and initial focus is not forced.\n\t\t// We have to wait for the next browser paint because block controls aren't\n\t\t// rendered right away when the toolbar gets mounted.\n\t\tlet raf = 0;\n\t\tif ( ! initialFocusOnMount ) {\n\t\t\traf = window.requestAnimationFrame( () => {\n\t\t\t\tconst items = getAllToolbarItemsIn( navigableToolbarRef );\n\t\t\t\tconst index = initialIndex || 0;\n\t\t\t\tif ( items[ index ] && hasFocusWithin( navigableToolbarRef ) ) {\n\t\t\t\t\titems[ index ].focus( {\n\t\t\t\t\t\t// When focusing newly mounted toolbars,\n\t\t\t\t\t\t// the position of the popover is often not right on the first render\n\t\t\t\t\t\t// This prevents the layout shifts when focusing the dialogs.\n\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tif ( ! onIndexChange || ! navigableToolbarRef ) return;\n\t\t\t// When the toolbar element is unmounted and onIndexChange is passed, we\n\t\t\t// pass the focused toolbar item index so it can be hydrated later.\n\t\t\tconst items = getAllToolbarItemsIn( navigableToolbarRef );\n\t\t\tconst index = items.findIndex( ( item ) => item.tabIndex === 0 );\n\t\t\tonIndexChange( index );\n\t\t};\n\t}, [ initialIndex, initialFocusOnMount ] );\n}\n\nfunction NavigableToolbar( {\n\tchildren,\n\tfocusOnMount,\n\tshouldUseKeyboardFocusShortcut = true,\n\t__experimentalInitialIndex: initialIndex,\n\t__experimentalOnIndexChange: onIndexChange,\n\t...props\n} ) {\n\tconst ref = useRef();\n\tconst isAccessibleToolbar = useIsAccessibleToolbar( ref );\n\n\tuseToolbarFocus(\n\t\tref,\n\t\tfocusOnMount,\n\t\tisAccessibleToolbar,\n\t\tinitialIndex,\n\t\tonIndexChange,\n\t\tshouldUseKeyboardFocusShortcut\n\t);\n\n\tif ( isAccessibleToolbar ) {\n\t\treturn (\n\t\t\t<Toolbar label={ props[ 'aria-label' ] } ref={ ref } { ...props }>\n\t\t\t\t{ children }\n\t\t\t</Toolbar>\n\t\t);\n\t}\n\n\treturn (\n\t\t<NavigableMenu\n\t\t\torientation=\"horizontal\"\n\t\t\trole=\"toolbar\"\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</NavigableMenu>\n\t);\n}\n\nexport default NavigableToolbar;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAbA;AACA;AACA;;AAaA,SAASM,kBAAkBA,CAAEC,QAAQ,EAAG;EACvC,MAAMC,QAAQ,GAAG,aAAa;EAC9B,OAAO,CAAED,QAAQ,CAACE,IAAI,CAAIC,OAAO,IAAM,EAAIF,QAAQ,IAAIE,OAAO,CAACC,OAAO,CAAG,CAAC;AAC3E;AAEA,SAASC,oBAAoBA,CAAEC,SAAS,EAAG;EAC1C,OAAOC,KAAK,CAACC,IAAI,CAAEF,SAAS,CAACG,gBAAgB,CAAE,qBAAsB,CAAE,CAAC;AACzE;AAEA,SAASC,cAAcA,CAAEJ,SAAS,EAAG;EACpC,OAAOA,SAAS,CAACK,QAAQ,CAAEL,SAAS,CAACM,aAAa,CAACC,aAAc,CAAC;AACnE;AAEA,SAASC,oBAAoBA,CAAER,SAAS,EAAG;EAC1C,MAAM,CAAES,aAAa,CAAE,GAAGC,UAAK,CAACC,QAAQ,CAACC,IAAI,CAAEZ,SAAU,CAAC;EAC1D,IAAKS,aAAa,EAAG;IACpBA,aAAa,CAACC,KAAK,CAAE;MACpB;MACA;MACA;MACAG,aAAa,EAAE;IAChB,CAAE,CAAC;EACJ;AACD;AAEA,SAASC,sBAAsBA,CAAEC,GAAG,EAAG;EACtC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMC,6BAA6B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IAAMA,IAAI,CAACC,QAAQ,KAAK,CAAE,CAAC;MAChEhB,aAAa,CAAEY,KAAM,CAAC;IACvB,CAAC;EACF,CAAC,EAAE,CAAET,YAAY,EAAED,mBAAmB,CAAG,CAAC;AAC3C;AAEA,SAASe,gBAAgBA,CAAE;EAC1BC,QAAQ;EACRpB,YAAY;EACZG,8BAA8B,GAAG,IAAI;EACrCkB,0BAA0B,EAAEhB,YAAY;EACxCiB,2BAA2B,EAAEpB,aAAa;EAC1C,GAAGqB;AACJ,CAAC,EAAG;EACH,MAAM9C,GAAG,GAAG,IAAA+C,eAAM,EAAC,CAAC;EACpB,MAAM7C,mBAAmB,GAAGH,sBAAsB,CAAEC,GAAI,CAAC;EAEzDsB,eAAe,CACdtB,GAAG,EACHuB,YAAY,EACZrB,mBAAmB,EACnB0B,YAAY,EACZH,aAAa,EACbC,8BACD,CAAC;EAED,IAAKxB,mBAAmB,EAAG;IAC1B,OACC,IAAA8C,MAAA,CAAAC,aAAA,EAAC9E,WAAA,CAAA+E,OAAO;MAACC,KAAK,EAAGL,KAAK,CAAE,YAAY,CAAI;MAAC9C,GAAG,EAAGA,GAAK;MAAA,GAAM8C;IAAK,GAC5DH,QACM,CAAC;EAEZ;EAEA,OACC,IAAAK,MAAA,CAAAC,aAAA,EAAC9E,WAAA,CAAAiF,aAAa;IACbC,WAAW,EAAC,YAAY;IACxBC,IAAI,EAAC,SAAS;IACdtD,GAAG,EAAGA,GAAK;IAAA,GACN8C;EAAK,GAERH,QACY,CAAC;AAElB;AAAC,IAAAY,QAAA,GAEcb,gBAAgB;AAAAc,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.useMouseMoveTypingReset = useMouseMoveTypingReset;
|
|
8
8
|
exports.useTypingObserver = useTypingObserver;
|
|
9
|
-
var
|
|
9
|
+
var _react = require("react");
|
|
10
10
|
var _compose = require("@wordpress/compose");
|
|
11
11
|
var _data = require("@wordpress/data");
|
|
12
12
|
var _dom = require("@wordpress/dom");
|
|
@@ -228,7 +228,7 @@ function useTypingObserver() {
|
|
|
228
228
|
function ObserveTyping({
|
|
229
229
|
children
|
|
230
230
|
}) {
|
|
231
|
-
return (0,
|
|
231
|
+
return (0, _react.createElement)("div", {
|
|
232
232
|
ref: useTypingObserver()
|
|
233
233
|
}, children);
|
|
234
234
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_dom","_keycodes","_store","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","useSelect","select","blockEditorStore","stopTyping","useDispatch","useRefEffect","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","hasInlineToolbar","_isTyping","getSettings","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","isTextField","stopTypingOnEscapeKey","ESCAPE","TAB","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","useMergeRefs","ObserveTyping","children","_element","createElement","ref","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping, hasInlineToolbar } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping, getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t\thasInlineToolbar: getSettings().hasInlineToolbar,\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\tif ( ! hasInlineToolbar ) {\n\t\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, hasInlineToolbar, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAcA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAeA;AACA;AACA;;AA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C,CAAC;IACd;IAEAb,IAAI,CAACO,gBAAgB,CAAE,UAAU,EAAEuB,sBAAuB,CAAC;IAC3D9B,IAAI,CAACO,gBAAgB,CAAE,SAAS,EAAEuB,sBAAuB,CAAC;IAE1D,OAAO,MAAM;MACZ9B,IAAI,CAACQ,mBAAmB,CAAE,UAAU,EAAEsB,sBAAuB,CAAC;MAC9D9B,IAAI,CAACQ,mBAAmB,CAAE,SAAS,EAAEsB,sBAAuB,CAAC;IAC9D,CAAC;EACF,CAAC,EACD,CAAErC,QAAQ,EAAEiB,gBAAgB,EAAEG,WAAW,EAAEhB,UAAU,CACtD,CAAC;EAED,OAAO,IAAAoC,qBAAY,EAAE,CAAEnB,IAAI,EAAEC,IAAI,CAAG,CAAC;AACtC;AAEA,SAASmB,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,OAAO,IAAAC,QAAA,CAAAC,aAAA;IAAKC,GAAG,EAAG7B,iBAAiB,CAAC;EAAG,GAAG0B,QAAe,CAAC;AAC3D;;AAEA;AACA;AACA;AAFA,IAAAI,QAAA,GAGeL,aAAa;AAAAM,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_dom","_keycodes","_store","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","useSelect","select","blockEditorStore","stopTyping","useDispatch","useRefEffect","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","hasInlineToolbar","_isTyping","getSettings","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","isTextField","stopTypingOnEscapeKey","ESCAPE","TAB","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","useMergeRefs","ObserveTyping","children","_react","createElement","ref","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping, hasInlineToolbar } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping, getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t\thasInlineToolbar: getSettings().hasInlineToolbar,\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\tif ( ! hasInlineToolbar ) {\n\t\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, hasInlineToolbar, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAcA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMK,2BAA2B,GAAG,IAAIC,GAAG,CAAE,CAC5CC,YAAE,EACFC,eAAK,EACLC,cAAI,EACJC,cAAI,EACJC,eAAK,EACLC,mBAAS,CACR,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CAAEC,KAAK,EAAG;EACjD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGF,KAAK;EACnC,OAAO,CAAEE,QAAQ,IAAIX,2BAA2B,CAACY,GAAG,CAAEF,OAAQ,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACO,SAASG,uBAAuBA,CAAA,EAAG;EACzC,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACH,QAAQ,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAM;IAAEI;EAAW,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAiB,CAAC;EAEtD,OAAO,IAAAG,qBAAY,EAChBC,IAAI,IAAM;IACX,IAAK,CAAEP,QAAQ,EAAG;MACjB;IACD;IAEA,MAAM;MAAEQ;IAAc,CAAC,GAAGD,IAAI;IAC9B,IAAIE,WAAW;IACf,IAAIC,WAAW;;IAEf;A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exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _panelColorGradientSettings = _interopRequireDefault(require("../colors-gradients/panel-color-gradient-settings"));
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
@@ -30,7 +30,7 @@ const PanelColorSettings = ({
|
|
|
30
30
|
onColorChange: onChange
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, _react.createElement)(_panelColorGradientSettings.default, {
|
|
34
34
|
settings: settings,
|
|
35
35
|
gradients: [],
|
|
36
36
|
disableCustomGradients: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_panelColorGradientSettings","_interopRequireDefault","require","PanelColorSettings","colorSettings","props","settings","map","setting","value","onChange","otherSettings","colorValue","onColorChange","
|
|
1
|
+
{"version":3,"names":["_panelColorGradientSettings","_interopRequireDefault","require","PanelColorSettings","colorSettings","props","settings","map","setting","value","onChange","otherSettings","colorValue","onColorChange","_react","createElement","default","gradients","disableCustomGradients","_default","exports"],"sources":["@wordpress/block-editor/src/components/panel-color-settings/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PanelColorGradientSettings from '../colors-gradients/panel-color-gradient-settings';\n\nconst PanelColorSettings = ( { colorSettings, ...props } ) => {\n\tconst settings = colorSettings.map( ( setting ) => {\n\t\tif ( ! setting ) {\n\t\t\treturn setting;\n\t\t}\n\t\tconst { value, onChange, ...otherSettings } = setting;\n\t\treturn {\n\t\t\t...otherSettings,\n\t\t\tcolorValue: value,\n\t\t\tonColorChange: onChange,\n\t\t};\n\t} );\n\treturn (\n\t\t<PanelColorGradientSettings\n\t\t\tsettings={ settings }\n\t\t\tgradients={ [] }\n\t\t\tdisableCustomGradients={ true }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\nexport default PanelColorSettings;\n"],"mappings":";;;;;;;;AAGA,IAAAA,2BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,kBAAkB,GAAGA,CAAE;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC7D,MAAMC,QAAQ,GAAGF,aAAa,CAACG,GAAG,CAAIC,OAAO,IAAM;IAClD,IAAK,CAAEA,OAAO,EAAG;MAChB,OAAOA,OAAO;IACf;IACA,MAAM;MAAEC,KAAK;MAAEC,QAAQ;MAAE,GAAGC;IAAc,CAAC,GAAGH,OAAO;IACrD,OAAO;MACN,GAAGG,aAAa;MAChBC,UAAU,EAAEH,KAAK;MACjBI,aAAa,EAAEH;IAChB,CAAC;EACF,CAAE,CAAC;EACH,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACf,2BAAA,CAAAgB,OAA0B;IAC1BV,QAAQ,EAAGA,QAAU;IACrBW,SAAS,EAAG,EAAI;IAChBC,sBAAsB,EAAG,IAAM;IAAA,GAC1Bb;EAAK,CACV,CAAC;AAEJ,CAAC;AAAC,IAAAc,QAAA,GACahB,kBAAkB;AAAAiB,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _reactAutosizeTextarea = _interopRequireDefault(require("react-autosize-textarea"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
11
12
|
var _editableText = _interopRequireDefault(require("../editable-text"));
|
|
12
13
|
/**
|
|
13
14
|
* External dependencies
|
|
@@ -29,7 +30,7 @@ const PlainText = (0, _element.forwardRef)(({
|
|
|
29
30
|
...props
|
|
30
31
|
}, ref) => {
|
|
31
32
|
if (__experimentalVersion === 2) {
|
|
32
|
-
return (0,
|
|
33
|
+
return (0, _react.createElement)(_editableText.default, {
|
|
33
34
|
ref: ref,
|
|
34
35
|
...props
|
|
35
36
|
});
|
|
@@ -39,7 +40,7 @@ const PlainText = (0, _element.forwardRef)(({
|
|
|
39
40
|
onChange,
|
|
40
41
|
...remainingProps
|
|
41
42
|
} = props;
|
|
42
|
-
return (0,
|
|
43
|
+
return (0, _react.createElement)(_reactAutosizeTextarea.default, {
|
|
43
44
|
ref: ref,
|
|
44
45
|
className: (0, _classnames.default)('block-editor-plain-text', className),
|
|
45
46
|
onChange: event => onChange(event.target.value),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactAutosizeTextarea","_interopRequireDefault","require","_classnames","_element","_editableText","PlainText","forwardRef","__experimentalVersion","props","ref","_react","createElement","default","className","onChange","remainingProps","classnames","event","target","value","_default","exports"],"sources":["@wordpress/block-editor/src/components/plain-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport TextareaAutosize from 'react-autosize-textarea';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EditableText from '../editable-text';\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md\n */\nconst PlainText = forwardRef( ( { __experimentalVersion, ...props }, ref ) => {\n\tif ( __experimentalVersion === 2 ) {\n\t\treturn <EditableText ref={ ref } { ...props } />;\n\t}\n\n\tconst { className, onChange, ...remainingProps } = props;\n\n\treturn (\n\t\t<TextareaAutosize\n\t\t\tref={ ref }\n\t\t\tclassName={ classnames( 'block-editor-plain-text', className ) }\n\t\t\tonChange={ ( event ) => onChange( event.target.value ) }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n} );\n\nexport default PlainText;\n"],"mappings":";;;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAdA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMI,SAAS,GAAG,IAAAC,mBAAU,EAAE,CAAE;EAAEC,qBAAqB;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAM;EAC7E,IAAKF,qBAAqB,KAAK,CAAC,EAAG;IAClC,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACP,aAAA,CAAAQ,OAAY;MAACH,GAAG,EAAGA,GAAK;MAAA,GAAMD;IAAK,CAAI,CAAC;EACjD;EAEA,MAAM;IAAEK,SAAS;IAAEC,QAAQ;IAAE,GAAGC;EAAe,CAAC,GAAGP,KAAK;EAExD,OACC,IAAAE,MAAA,CAAAC,aAAA,EAACZ,sBAAA,CAAAa,OAAgB;IAChBH,GAAG,EAAGA,GAAK;IACXI,SAAS,EAAG,IAAAG,mBAAU,EAAE,yBAAyB,EAAEH,SAAU,CAAG;IAChEC,QAAQ,EAAKG,KAAK,IAAMH,QAAQ,CAAEG,KAAK,CAACC,MAAM,CAACC,KAAM,CAAG;IAAA,GACnDJ;EAAc,CACnB,CAAC;AAEJ,CAAE,CAAC;AAAC,IAAAK,QAAA,GAEWf,SAAS;AAAAgB,OAAA,CAAAT,OAAA,GAAAQ,QAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
12
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
12
13
|
/**
|
|
@@ -122,7 +123,7 @@ class PlainText extends _element.Component {
|
|
|
122
123
|
fontSize: style?.fontSize,
|
|
123
124
|
fontWeight: style?.fontWeight
|
|
124
125
|
};
|
|
125
|
-
return (0,
|
|
126
|
+
return (0, _react.createElement)(_blockEditor.RichText, {
|
|
126
127
|
...otherProps,
|
|
127
128
|
...disableFormattingProps,
|
|
128
129
|
...forcePlainTextProps,
|
|
@@ -133,7 +134,7 @@ class PlainText extends _element.Component {
|
|
|
133
134
|
unstableOnFocus: onFocus
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
|
-
return (0,
|
|
137
|
+
return (0, _react.createElement)(_reactNative.TextInput, {
|
|
137
138
|
...this.props,
|
|
138
139
|
ref: x => this._input = x,
|
|
139
140
|
onChange: this.onChangeTextInput,
|