@wordpress/block-editor 12.10.6 → 12.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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 +11 -9
- 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 +20 -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 +7 -14
- 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 +12 -11
- 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/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 +14 -13
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +9 -8
- 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 +8 -7
- 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/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/hooks/utils.js +1 -1
- package/build/hooks/utils.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/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.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/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 +3 -2
- package/build-module/components/block-styles/index.js.map +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 +5 -3
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +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 +2 -10
- package/build-module/components/iframe/index.js.map +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 +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +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/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 +1 -1
- package/build-module/components/list-view/branch.js +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 +1 -1
- package/build-module/components/list-view/leaf.js +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/hooks/utils.js +1 -1
- package/build-module/hooks/utils.js.map +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/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.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/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 +10 -16
- package/build-style/style.css +10 -16
- 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-styles/index.js +4 -1
- package/src/components/block-switcher/index.js +17 -18
- package/src/components/block-switcher/pattern-transformations-menu.js +4 -1
- package/src/components/block-switcher/style.scss +0 -6
- 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/iframe/index.js +1 -8
- 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/index.js +2 -2
- package/src/components/inserter/index.native.js +2 -2
- package/src/components/letter-spacing-control/index.js +1 -1
- 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/hooks/utils.js +0 -2
- package/src/lock-unlock.js +1 -1
- package/src/private-apis.js +2 -0
- package/src/store/selectors.js +1 -1
- package/src/utils/pasting.js +51 -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
|
@@ -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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B,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,IAAA/B,QAAA,CAAA6E,aAAA,EAAC3E,WAAA,CAAA4E,OAAO;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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AAA,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 */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,IAAAmC,gBAAW,EAAEF,MAAO,CAAC,IAAI,CAAErB,IAAI,CAACgC,QAAQ,CAAEX,MAAO,CAAC,EAAG;QAC3D;MACD;;MAEA;MACA;MACA;MACA;MACA,IACCU,IAAI,KAAK,SAAS,IAClB,CAAE5C,+BAA+B,CAAEC,KAAM,CAAC,EACzC;QACD;MACD;MAEAyB,WAAW,CAAC,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;E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iBAAiB,CAAC;EAAG,GAAG0B,QAAe,CAAC;AAC3D;;AAEA;AACA;AACA;AAFA,IAAAI,QAAA,GAGeL,aAAa;AAAAM,OAAA,CAAAC,OAAA,GAAAF,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 _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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_blockEditor","_style","_interopRequireDefault","PlainText","Component","constructor","arguments","isAndroid","Platform","OS","onChangeTextInput","bind","onChangeRichText","componentDidMount","_input","isFocused","props","isSelected","timeoutID","setTimeout","focus","componentDidUpdate","prevProps","blur","componentWillUnmount","clearTimeout","getFontSize","style","fontSize","width","height","Dimensions","get","cssUnitOptions","parseFloat","getPxFromCssUnit","replaceLineBreakTags","value","replace","RegExp","event","onChange","nativeEvent","text","render","__experimentalVersion","onFocus","otherProps","textStyles","styles","disableFormattingProps","withoutInteractiveFormatting","disableEditingMenu","__unstableDisableFormats","disableSuggestions","forcePlainTextProps","preserveWhiteSpace","__unstablePastePlainText","multiline","fontProps","fontFamily","fontWeight","_react","createElement","RichText","identifier","unstableOnFocus","TextInput","ref","x","onBlur","scrollEnabled","exports","default"],"sources":["@wordpress/block-editor/src/components/plain-text/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TextInput, Platform, Dimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { RichText, getPxFromCssUnit } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport default class PlainText extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isAndroid = Platform.OS === 'android';\n\n\t\tthis.onChangeTextInput = this.onChangeTextInput.bind( this );\n\t\tthis.onChangeRichText = this.onChangeRichText.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\t// If isSelected is true, we should request the focus on this TextInput.\n\t\tif (\n\t\t\tthis._input &&\n\t\t\tthis._input.isFocused() === false &&\n\t\t\tthis.props.isSelected\n\t\t) {\n\t\t\tif ( this.isAndroid ) {\n\t\t\t\t/*\n\t\t\t\t * There seems to be an issue in React Native where the keyboard doesn't show if called shortly after rendering.\n\t\t\t\t * As a common work around this delay is used.\n\t\t\t\t * https://github.com/facebook/react-native/issues/19366#issuecomment-400603928\n\t\t\t\t */\n\t\t\t\tthis.timeoutID = setTimeout( () => {\n\t\t\t\t\tthis._input.focus();\n\t\t\t\t}, 100 );\n\t\t\t} else {\n\t\t\t\tthis._input.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! this.props.isSelected && prevProps.isSelected ) {\n\t\t\tthis._input?.blur();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.isAndroid ) {\n\t\t\tclearTimeout( this.timeoutID );\n\t\t}\n\t}\n\n\tfocus() {\n\t\tthis._input?.focus();\n\t}\n\n\tblur() {\n\t\tthis._input?.blur();\n\t}\n\n\tgetFontSize() {\n\t\tconst { style } = this.props;\n\n\t\tif ( ! style?.fontSize ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { width, height } = Dimensions.get( 'window' );\n\t\tconst cssUnitOptions = { height, width };\n\n\t\treturn {\n\t\t\tfontSize: parseFloat(\n\t\t\t\tgetPxFromCssUnit( style.fontSize, cssUnitOptions )\n\t\t\t),\n\t\t};\n\t}\n\n\treplaceLineBreakTags( value ) {\n\t\treturn value?.replace( RegExp( '<br>', 'gim' ), '\\n' );\n\t}\n\n\tonChangeTextInput( event ) {\n\t\tconst { onChange } = this.props;\n\t\tonChange( event.nativeEvent.text );\n\t}\n\n\tonChangeRichText( value ) {\n\t\tconst { onChange } = this.props;\n\t\t// The <br> tags have to be replaced with new line characters\n\t\t// as the content of plain text shouldn't contain HTML tags.\n\t\tonChange( this.replaceLineBreakTags( value ) );\n\t}\n\n\trender() {\n\t\tconst { style, __experimentalVersion, onFocus, ...otherProps } =\n\t\t\tthis.props;\n\t\tconst textStyles = [\n\t\t\tstyle || styles[ 'block-editor-plain-text' ],\n\t\t\tthis.getFontSize(),\n\t\t];\n\n\t\tif ( __experimentalVersion === 2 ) {\n\t\t\tconst disableFormattingProps = {\n\t\t\t\twithoutInteractiveFormatting: true,\n\t\t\t\tdisableEditingMenu: true,\n\t\t\t\t__unstableDisableFormats: true,\n\t\t\t\tdisableSuggestions: true,\n\t\t\t};\n\n\t\t\tconst forcePlainTextProps = {\n\t\t\t\tpreserveWhiteSpace: true,\n\t\t\t\t__unstablePastePlainText: true,\n\t\t\t\tmultiline: false,\n\t\t\t};\n\n\t\t\tconst fontProps = {\n\t\t\t\tfontFamily: style?.fontFamily,\n\t\t\t\tfontSize: style?.fontSize,\n\t\t\t\tfontWeight: style?.fontWeight,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<RichText\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t{ ...disableFormattingProps }\n\t\t\t\t\t{ ...forcePlainTextProps }\n\t\t\t\t\t{ ...fontProps }\n\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\tstyle={ style }\n\t\t\t\t\tonChange={ this.onChangeRichText }\n\t\t\t\t\tunstableOnFocus={ onFocus }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TextInput\n\t\t\t\t{ ...this.props }\n\t\t\t\tref={ ( x ) => ( this._input = x ) }\n\t\t\t\tonChange={ this.onChangeTextInput }\n\t\t\t\tonFocus={ this.props.onFocus } // Always assign onFocus as a props.\n\t\t\t\tonBlur={ this.props.onBlur } // Always assign onBlur as a props.\n\t\t\t\tfontFamily={\n\t\t\t\t\t( this.props.style && this.props.style.fontFamily ) ||\n\t\t\t\t\tstyles[ 'block-editor-plain-text' ].fontFamily\n\t\t\t\t}\n\t\t\t\tstyle={ textStyles }\n\t\t\t\tscrollEnabled={ false }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMK,SAAS,SAASC,kBAAS,CAAC;EAChDC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IACrB,IAAI,CAACC,SAAS,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS;IAE1C,IAAI,CAACC,iBAAiB,GAAG,IAAI,CAACA,iBAAiB,CAACC,IAAI,CAAE,IAAK,CAAC;IAC5D,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACD,IAAI,CAAE,IAAK,CAAC;EAC3D;EAEAE,iBAAiBA,CAAA,EAAG;IACnB;IACA,IACC,IAAI,CAACC,MAAM,IACX,IAAI,CAACA,MAAM,CAACC,SAAS,CAAC,CAAC,KAAK,KAAK,IACjC,IAAI,CAACC,KAAK,CAACC,UAAU,EACpB;MACD,IAAK,IAAI,CAACV,SAAS,EAAG;QACrB;AACJ;AACA;AACA;AACA;QACI,IAAI,CAACW,SAAS,GAAGC,UAAU,CAAE,MAAM;U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,EAAGpB;MAAS,CAC3B,CAAC;IAEJ;IAEA,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAAClE,YAAA,CAAAsE,SAAS;MAAA,GACJ,IAAI,CAACnD,KAAK;MACfoD,GAAG,EAAKC,CAAC,IAAQ,IAAI,CAACvD,MAAM,GAAGuD,CAAK;MACpC5B,QAAQ,EAAG,IAAI,CAAC/B,iBAAmB;MACnCoC,OAAO,EAAG,IAAI,CAAC9B,KAAK,CAAC8B,OAAS,CAAC;MAAA;MAC/BwB,MAAM,EAAG,IAAI,CAACtD,KAAK,CAACsD,MAAQ,CAAC;MAAA;MAC7BV,UAAU,EACP,IAAI,CAAC5C,KAAK,CAACW,KAAK,IAAI,IAAI,CAACX,KAAK,CAACW,KAAK,CAACiC,UAAU,IACjDX,cAAM,CAAE,yBAAyB,CAAE,CAACW,UACpC;MACDjC,KAAK,EAAGqB,UAAY;MACpBuB,aAAa,EAAG;IAAO,CACvB,CAAC;EAEJ;AACD;AAACC,OAAA,CAAAC,OAAA,GAAAtE,SAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = PreviewOptions;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _compose = require("@wordpress/compose");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
@@ -48,7 +48,7 @@ function PreviewOptions({
|
|
|
48
48
|
tablet: _icons.tablet,
|
|
49
49
|
desktop: _icons.desktop
|
|
50
50
|
};
|
|
51
|
-
return (0,
|
|
51
|
+
return (0, _react.createElement)(_components.DropdownMenu, {
|
|
52
52
|
className: "block-editor-post-preview__dropdown",
|
|
53
53
|
popoverProps: popoverProps,
|
|
54
54
|
toggleProps: toggleProps,
|
|
@@ -56,15 +56,15 @@ function PreviewOptions({
|
|
|
56
56
|
icon: deviceIcons[deviceType.toLowerCase()],
|
|
57
57
|
label: label || (0, _i18n.__)('Preview'),
|
|
58
58
|
disableOpenOnArrowDown: !isEnabled
|
|
59
|
-
}, renderProps => (0,
|
|
59
|
+
}, renderProps => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuGroup, null, (0, _react.createElement)(_components.MenuItem, {
|
|
60
60
|
className: "block-editor-post-preview__button-resize",
|
|
61
61
|
onClick: () => setDeviceType('Desktop'),
|
|
62
62
|
icon: deviceType === 'Desktop' && _icons.check
|
|
63
|
-
}, (0, _i18n.__)('Desktop')), (0,
|
|
63
|
+
}, (0, _i18n.__)('Desktop')), (0, _react.createElement)(_components.MenuItem, {
|
|
64
64
|
className: "block-editor-post-preview__button-resize",
|
|
65
65
|
onClick: () => setDeviceType('Tablet'),
|
|
66
66
|
icon: deviceType === 'Tablet' && _icons.check
|
|
67
|
-
}, (0, _i18n.__)('Tablet')), (0,
|
|
67
|
+
}, (0, _i18n.__)('Tablet')), (0, _react.createElement)(_components.MenuItem, {
|
|
68
68
|
className: "block-editor-post-preview__button-resize",
|
|
69
69
|
onClick: () => setDeviceType('Mobile'),
|
|
70
70
|
icon: deviceType === 'Mobile' && _icons.check
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_components","_i18n","_icons","PreviewOptions","children","viewLabel","className","isEnabled","deviceType","setDeviceType","label","isMobile","useViewportMatch","popoverProps","classnames","placement","toggleProps","disabled","__experimentalIsFocusable","menuProps","__","deviceIcons","mobile","tablet","desktop","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_components","_i18n","_icons","PreviewOptions","children","viewLabel","className","isEnabled","deviceType","setDeviceType","label","isMobile","useViewportMatch","popoverProps","classnames","placement","toggleProps","disabled","__experimentalIsFocusable","menuProps","__","deviceIcons","mobile","tablet","desktop","_react","createElement","DropdownMenu","icon","toLowerCase","disableOpenOnArrowDown","renderProps","Fragment","MenuGroup","MenuItem","onClick","check"],"sources":["@wordpress/block-editor/src/components/preview-options/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet } from '@wordpress/icons';\n\nexport default function PreviewOptions( {\n\tchildren,\n\tviewLabel,\n\tclassName,\n\tisEnabled = true,\n\tdeviceType,\n\tsetDeviceType,\n\tlabel,\n} ) {\n\tconst isMobile = useViewportMatch( 'small', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tclassName: classnames(\n\t\t\tclassName,\n\t\t\t'block-editor-post-preview__dropdown-content'\n\t\t),\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'block-editor-post-preview__button-toggle',\n\t\tdisabled: ! isEnabled,\n\t\t__experimentalIsFocusable: ! isEnabled,\n\t\tchildren: viewLabel,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"block-editor-post-preview__dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ label || __( 'Preview' ) }\n\t\t\tdisableOpenOnArrowDown={ ! isEnabled }\n\t\t>\n\t\t\t{ ( renderProps ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ children?.( renderProps ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMe,SAASK,cAAcA,CAAE;EACvCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,SAAS,GAAG,IAAI;EAChBC,UAAU;EACVC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAMC,QAAQ,GAAG,IAAAC,yBAAgB,EAAE,OAAO,EAAE,GAAI,CAAC;EACjD,IAAKD,QAAQ,EAAG,OAAO,IAAI;EAE3B,MAAME,YAAY,GAAG;IACpBP,SAAS,EAAE,IAAAQ,mBAAU,EACpBR,SAAS,EACT,6CACD,CAA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E,QAAS,CAAG;IAC3CmB,IAAI,EAAGpB,UAAU,KAAK,QAAQ,IAAI4B;EAAO,GAEvC,IAAAhB,QAAE,EAAE,QAAS,CACN,CAAC,EACX,IAAAK,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAAkC,QAAQ;IACR5B,SAAS,EAAC,0CAA0C;IACpD6B,OAAO,EAAGA,CAAA,KAAM1B,aAAa,CAAE,QAAS,CAAG;IAC3CmB,IAAI,EAAGpB,UAAU,KAAK,QAAQ,IAAI4B;EAAO,GAEvC,IAAAhB,QAAE,EAAE,QAAS,CACN,CACA,CAAC,EACVhB,QAAQ,GAAI2B,WAAY,CACzB,CAEU,CAAC;AAEjB"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.BlockRefs = void 0;
|
|
7
7
|
exports.BlockRefsProvider = BlockRefsProvider;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
/**
|
|
10
11
|
* WordPress dependencies
|
|
@@ -22,7 +23,7 @@ function BlockRefsProvider({
|
|
|
22
23
|
refs: new Map(),
|
|
23
24
|
callbacks: new Map()
|
|
24
25
|
}), []);
|
|
25
|
-
return (0,
|
|
26
|
+
return (0, _react.createElement)(BlockRefs.Provider, {
|
|
26
27
|
value: value
|
|
27
28
|
}, children);
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","BlockRefs","createContext","refs","Map","callbacks","exports","BlockRefsProvider","children","value","useMemo","createElement","Provider"],"sources":["@wordpress/block-editor/src/components/provider/block-refs-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo } from '@wordpress/element';\n\nexport const BlockRefs = createContext( {\n\trefs: new Map(),\n\tcallbacks: new Map(),\n} );\n\nexport function BlockRefsProvider( { children } ) {\n\tconst value = useMemo(\n\t\t() => ( { refs: new Map(), callbacks: new Map() } ),\n\t\t[]\n\t);\n\treturn (\n\t\t<BlockRefs.Provider value={ value }>{ children }</BlockRefs.Provider>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","BlockRefs","createContext","refs","Map","callbacks","exports","BlockRefsProvider","children","value","useMemo","_react","createElement","Provider"],"sources":["@wordpress/block-editor/src/components/provider/block-refs-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo } from '@wordpress/element';\n\nexport const BlockRefs = createContext( {\n\trefs: new Map(),\n\tcallbacks: new Map(),\n} );\n\nexport function BlockRefsProvider( { children } ) {\n\tconst value = useMemo(\n\t\t() => ( { refs: new Map(), callbacks: new Map() } ),\n\t\t[]\n\t);\n\treturn (\n\t\t<BlockRefs.Provider value={ value }>{ children }</BlockRefs.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,SAAS,GAAG,IAAAC,sBAAa,EAAE;EACvCC,IAAI,EAAE,IAAIC,GAAG,CAAC,CAAC;EACfC,SAAS,EAAE,IAAID,GAAG,CAAC;AACpB,CAAE,CAAC;AAACE,OAAA,CAAAL,SAAA,GAAAA,SAAA;AAEG,SAASM,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,KAAK,GAAG,IAAAC,gBAAO,EACpB,OAAQ;IAAEP,IAAI,EAAE,IAAIC,GAAG,CAAC,CAAC;IAAEC,SAAS,EAAE,IAAID,GAAG,CAAC;EAAE,CAAC,CAAE,EACnD,EACD,CAAC;EACD,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACX,SAAS,CAACY,QAAQ;IAACJ,KAAK,EAAGA;EAAO,GAAGD,QAA8B,CAAC;AAEvE"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ExperimentalBlockEditorProvider = exports.BlockEditorProvider = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _components = require("@wordpress/components");
|
|
11
12
|
var _withRegistryProvider = _interopRequireDefault(require("./with-registry-provider"));
|
|
12
13
|
var _useBlockSync = _interopRequireDefault(require("./use-block-sync"));
|
|
@@ -45,11 +46,11 @@ const ExperimentalBlockEditorProvider = (0, _withRegistryProvider.default)(props
|
|
|
45
46
|
|
|
46
47
|
// Syncs the entity provider with changes in the block-editor store.
|
|
47
48
|
(0, _useBlockSync.default)(props);
|
|
48
|
-
return (0,
|
|
49
|
+
return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(_blockRefsProvider.BlockRefsProvider, null, children));
|
|
49
50
|
});
|
|
50
51
|
exports.ExperimentalBlockEditorProvider = ExperimentalBlockEditorProvider;
|
|
51
52
|
const BlockEditorProvider = props => {
|
|
52
|
-
return (0,
|
|
53
|
+
return (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
53
54
|
...props,
|
|
54
55
|
stripExperimentalSettings: true
|
|
55
56
|
}, props.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_components","_withRegistryProvider","_interopRequireDefault","_useBlockSync","_store","_blockRefsProvider","_lockUnlock","_keyboardShortcuts","ExperimentalBlockEditorProvider","withRegistryProvider","props","children","settings","stripExperimentalSettings","__experimentalUpdateSettings","unlock","useDispatch","blockEditorStore","useEffect","__internalIsInitialized","reset","useBlockSync","_react","createElement","SlotFillProvider","default","Register","BlockRefsProvider","exports","BlockEditorProvider","_default"],"sources":["@wordpress/block-editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst { children, settings, stripExperimentalSettings = false } = props;\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Syncs the entity provider with changes in the block-editor store.\n\t\tuseBlockSync( props );\n\n\t\treturn (\n\t\t\t<SlotFillProvider>\n\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t<BlockRefsProvider>{ children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\t{ ...props }\n\t\t\tstripExperimentalSettings={ true }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,qBAAA,GAAAC,sBAAA,CAA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EhCH,KAAK,CAACC,QACwB,CAAC;AAEpC,CAAC;AAACiB,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAAA,IAAAC,QAAA,GAEaD,mBAAmB;AAAAD,OAAA,CAAAH,OAAA,GAAAK,QAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ExperimentalBlockEditorProvider = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _withRegistryProvider = _interopRequireDefault(require("./with-registry-provider"));
|
|
11
12
|
var _useBlockSync = _interopRequireDefault(require("./use-block-sync"));
|
|
12
13
|
var _store = require("../../store");
|
|
@@ -35,7 +36,7 @@ const BlockEditorProvider = (0, _withRegistryProvider.default)(function (props)
|
|
|
35
36
|
|
|
36
37
|
// Syncs the entity provider with changes in the block-editor store.
|
|
37
38
|
(0, _useBlockSync.default)(props);
|
|
38
|
-
return (0,
|
|
39
|
+
return (0, _react.createElement)(_blockRefsProvider.BlockRefsProvider, null, children);
|
|
39
40
|
});
|
|
40
41
|
exports.ExperimentalBlockEditorProvider = BlockEditorProvider;
|
|
41
42
|
var _default = BlockEditorProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_withRegistryProvider","_interopRequireDefault","_useBlockSync","_store","_blockRefsProvider","BlockEditorProvider","withRegistryProvider","props","children","settings","updateSettings","useDispatch","blockEditorStore","useEffect","useBlockSync","_react","createElement","BlockRefsProvider","exports","ExperimentalBlockEditorProvider","_default","default"],"sources":["@wordpress/block-editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nconst BlockEditorProvider = withRegistryProvider( function ( props ) {\n\tconst { children, settings } = props;\n\n\tconst { updateSettings } = useDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\tupdateSettings( settings );\n\t}, [ settings ] );\n\n\t// Syncs the entity provider with changes in the block-editor store.\n\tuseBlockSync( props );\n\n\treturn <BlockRefsProvider>{ children }</BlockRefsProvider>;\n} );\n\nexport default BlockEditorProvider;\nexport { BlockEditorProvider as ExperimentalBlockEditorProvider };\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;;AAEA,MAAMO,mBAAmB,GAAG,IAAAC,6BAAoB,EAAE,UAAWC,KAAK,EAAG;EACpE,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGF,KAAK;EAEpC,MAAM;IAAEG;EAAe,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAC1D,IAAAC,kBAAS,EAAE,MAAM;IAChBH,cAAc,CAAED,QAAS,CAAC;EAC3B,CAAC,EAAE,CAAEA,QAAQ,CAAG,CAAC;;EAEjB;EACA,IAAAK,qBAAY,EAAEP,KAAM,CAAC;EAErB,OAAO,IAAAQ,MAAA,CAAAC,aAAA,EAACZ,kBAAA,CAAAa,iBAAiB,QAAGT,QAA6B,CAAC;AAC3D,CAAE,CAAC;AAACU,OAAA,CAAAC,+BAAA,GAAAd,mBAAA;AAAA,IAAAe,QAAA,GAEWf,mBAAmB;AAAAa,OAAA,CAAAG,OAAA,GAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_blocks","_store","noop","useBlockSync","clientId","value","controlledBlocks","selection","controlledSelection","onChange","onInput","registry","useRegistry","resetBlocks","resetSelection","replaceInnerBlocks","selectBlock","setHasControlledInnerBlocks","__unstableMarkNextChangeAsNotPersistent","dispatch","blockEditorStore","hasSelectedBlock","getBlockName","getBlocks","getSelectionStart","getSelectionEnd","getBlock","select","isControlled","useSelect","areInnerBlocksControlled","pendingChanges","useRef","incoming","outgoing","subscribed","setControlledBlocks","batch","storeBlocks","map","block","cloneBlock","current","unsetControlledBlocks","onInputRef","onChangeRef","useEffect","includes","length","hadSelecton","selectionAnchor","selectionFocus","selectionStart","selectionEnd","initialPosition","selectionStillExists","getSelectedBlocksInitialCaretPosition","isLastBlockChangePersistent","__unstableIsLastBlockChangeIgnored","blocks","isPersistent","previousAreBlocksDifferent","unsubscribe","subscribe","isStillControlled","newIsPersistent","newBlocks","areBlocksDifferent","didPersistenceChange","push","updateParent"],"sources":["@wordpress/block-editor/src/components/provider/use-block-sync.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * A function to call when the block value has been updated in the block-editor\n * store.\n *\n * @callback onBlockUpdate\n * @param {Object[]} blocks The updated blocks.\n * @param {Object} options The updated block options, such as selectionStart\n * and selectionEnd.\n */\n\n/**\n * useBlockSync is a side effect which handles bidirectional sync between the\n * block-editor store and a controlling data source which provides blocks. This\n * is most commonly used by the BlockEditorProvider to synchronize the contents\n * of the block-editor store with the root entity, like a post.\n *\n * Another example would be the template part block, which provides blocks from\n * a separate entity data source than a root entity. This hook syncs edits to\n * the template part in the block editor back to the entity and vice-versa.\n *\n * Here are some of its basic functions:\n * - Initalizes the block-editor store for the given clientID to the blocks\n * given via props.\n * - Adds incoming changes (like undo) to the block-editor store.\n * - Adds outgoing changes (like editing content) to the controlling entity,\n * determining if a change should be considered persistent or not.\n * - Handles edge cases and race conditions which occur in those operations.\n * - Ignores changes which happen to other entities (like nested inner block\n * controllers.\n * - Passes selection state from the block-editor store to the controlling entity.\n *\n * @param {Object} props Props for the block sync hook\n * @param {string} props.clientId The client ID of the inner block controller.\n * If none is passed, then it is assumed to be a\n * root controller rather than an inner block\n * controller.\n * @param {Object[]} props.value The control value for the blocks. This value\n * is used to initalize the block-editor store\n * and for resetting the blocks to incoming\n * changes like undo.\n * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo.\n * @param {onBlockUpdate} props.onChange Function to call when a persistent\n * change has been made in the block-editor blocks\n * for the given clientId. For example, after\n * this function is called, an entity is marked\n * dirty because it has changes to save.\n * @param {onBlockUpdate} props.onInput Function to call when a non-persistent\n * change has been made in the block-editor blocks\n * for the given clientId. When this is called,\n * controlling sources do not become dirty.\n */\nexport default function useBlockSync( {\n\tclientId = null,\n\tvalue: controlledBlocks,\n\tselection: controlledSelection,\n\tonChange = noop,\n\tonInput = noop,\n} ) {\n\tconst registry = useRegistry();\n\n\tconst {\n\t\tresetBlocks,\n\t\tresetSelection,\n\t\treplaceInnerBlocks,\n\t\tselectBlock,\n\t\tsetHasControlledInnerBlocks,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = registry.dispatch( blockEditorStore );\n\tconst {\n\t\thasSelectedBlock,\n\t\tgetBlockName,\n\t\tgetBlocks,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlock,\n\t} = registry.select( blockEditorStore );\n\tconst isControlled = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t! clientId ||\n\t\t\t\tselect( blockEditorStore ).areInnerBlocksControlled( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst pendingChanges = useRef( { incoming: null, outgoing: [] } );\n\tconst subscribed = useRef( false );\n\n\tconst setControlledBlocks = () => {\n\t\tif ( ! controlledBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't need to persist this change because we only replace\n\t\t// controlled inner blocks when the change was caused by an entity,\n\t\t// and so it would already be persisted.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tif ( clientId ) {\n\t\t\t// It is important to batch here because otherwise,\n\t\t\t// as soon as `setHasControlledInnerBlocks` is called\n\t\t\t// the effect to restore might be triggered\n\t\t\t// before the actual blocks get set properly in state.\n\t\t\tregistry.batch( () => {\n\t\t\t\tsetHasControlledInnerBlocks( clientId, true );\n\t\t\t\tconst storeBlocks = controlledBlocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock( block )\n\t\t\t\t);\n\t\t\t\tif ( subscribed.current ) {\n\t\t\t\t\tpendingChanges.current.incoming = storeBlocks;\n\t\t\t\t}\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceInnerBlocks( clientId, storeBlocks );\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( subscribed.current ) {\n\t\t\t\tpendingChanges.current.incoming = controlledBlocks;\n\t\t\t}\n\t\t\tresetBlocks( controlledBlocks );\n\t\t}\n\t};\n\n\t// Clean up the changes made by setControlledBlocks() when the component\n\t// containing useBlockSync() unmounts.\n\tconst unsetControlledBlocks = () => {\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tif ( clientId ) {\n\t\t\tsetHasControlledInnerBlocks( clientId, false );\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\treplaceInnerBlocks( clientId, [] );\n\t\t} else {\n\t\t\tresetBlocks( [] );\n\t\t}\n\t};\n\n\t// Add a subscription to the block-editor registry to detect when changes\n\t// have been made. This lets us inform the data source of changes. This\n\t// is an effect so that the subscriber can run synchronously without\n\t// waiting for React renders for changes.\n\tconst onInputRef = useRef( onInput );\n\tconst onChangeRef = useRef( onChange );\n\tuseEffect( () => {\n\t\tonInputRef.current = onInput;\n\t\tonChangeRef.current = onChange;\n\t}, [ onInput, onChange ] );\n\n\t// Determine if blocks need to be reset when they change.\n\tuseEffect( () => {\n\t\tif ( pendingChanges.current.outgoing.includes( controlledBlocks ) ) {\n\t\t\t// Skip block reset if the value matches expected outbound sync\n\t\t\t// triggered by this component by a preceding change detection.\n\t\t\t// Only skip if the value matches expectation, since a reset should\n\t\t\t// still occur if the value is modified (not equal by reference),\n\t\t\t// to allow that the consumer may apply modifications to reflect\n\t\t\t// back on the editor.\n\t\t\tif (\n\t\t\t\tpendingChanges.current.outgoing[\n\t\t\t\t\tpendingChanges.current.outgoing.length - 1\n\t\t\t\t] === controlledBlocks\n\t\t\t) {\n\t\t\t\tpendingChanges.current.outgoing = [];\n\t\t\t}\n\t\t} else if ( getBlocks( clientId ) !== controlledBlocks ) {\n\t\t\t// Reset changing value in all other cases than the sync described\n\t\t\t// above. Since this can be reached in an update following an out-\n\t\t\t// bound sync, unset the outbound value to avoid considering it in\n\t\t\t// subsequent renders.\n\t\t\tpendingChanges.current.outgoing = [];\n\t\t\tconst hadSelecton = hasSelectedBlock();\n\t\t\tconst selectionAnchor = getSelectionStart();\n\t\t\tconst selectionFocus = getSelectionEnd();\n\t\t\tsetControlledBlocks();\n\n\t\t\tif ( controlledSelection ) {\n\t\t\t\tresetSelection(\n\t\t\t\t\tcontrolledSelection.selectionStart,\n\t\t\t\t\tcontrolledSelection.selectionEnd,\n\t\t\t\t\tcontrolledSelection.initialPosition\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst selectionStillExists = getBlock(\n\t\t\t\t\tselectionAnchor.clientId\n\t\t\t\t);\n\t\t\t\tif ( hadSelecton && ! selectionStillExists ) {\n\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t} else {\n\t\t\t\t\tresetSelection( selectionAnchor, selectionFocus );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ controlledBlocks, clientId ] );\n\n\tuseEffect( () => {\n\t\t// When the block becomes uncontrolled, it means its inner state has been reset\n\t\t// we need to take the blocks again from the external value property.\n\t\tif ( ! isControlled ) {\n\t\t\tpendingChanges.current.outgoing = [];\n\t\t\tsetControlledBlocks();\n\t\t}\n\t}, [ isControlled ] );\n\n\tuseEffect( () => {\n\t\tconst {\n\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t\tisLastBlockChangePersistent,\n\t\t\t__unstableIsLastBlockChangeIgnored,\n\t\t\tareInnerBlocksControlled,\n\t\t} = registry.select( blockEditorStore );\n\n\t\tlet blocks = getBlocks( clientId );\n\t\tlet isPersistent = isLastBlockChangePersistent();\n\t\tlet previousAreBlocksDifferent = false;\n\n\t\tsubscribed.current = true;\n\t\tconst unsubscribe = registry.subscribe( () => {\n\t\t\t// Sometimes, when changing block lists, lingering subscriptions\n\t\t\t// might trigger before they are cleaned up. If the block for which\n\t\t\t// the subscription runs is no longer in the store, this would clear\n\t\t\t// its parent entity's block list. To avoid this, we bail out if\n\t\t\t// the subscription is triggering for a block (`clientId !== null`)\n\t\t\t// and its block name can't be found because it's not on the list.\n\t\t\t// (`getBlockName( clientId ) === null`).\n\t\t\tif ( clientId !== null && getBlockName( clientId ) === null )\n\t\t\t\treturn;\n\n\t\t\t// When RESET_BLOCKS on parent blocks get called, the controlled blocks\n\t\t\t// can reset to uncontrolled, in these situations, it means we need to populate\n\t\t\t// the blocks again from the external blocks (the value property here)\n\t\t\t// and we should stop triggering onChange\n\t\t\tconst isStillControlled =\n\t\t\t\t! clientId || areInnerBlocksControlled( clientId );\n\t\t\tif ( ! isStillControlled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newIsPersistent = isLastBlockChangePersistent();\n\t\t\tconst newBlocks = getBlocks( clientId );\n\t\t\tconst areBlocksDifferent = newBlocks !== blocks;\n\t\t\tblocks = newBlocks;\n\t\t\tif (\n\t\t\t\tareBlocksDifferent &&\n\t\t\t\t( pendingChanges.current.incoming ||\n\t\t\t\t\t__unstableIsLastBlockChangeIgnored() )\n\t\t\t) {\n\t\t\t\tpendingChanges.current.incoming = null;\n\t\t\t\tisPersistent = newIsPersistent;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Since we often dispatch an action to mark the previous action as\n\t\t\t// persistent, we need to make sure that the blocks changed on the\n\t\t\t// previous action before committing the change.\n\t\t\tconst didPersistenceChange =\n\t\t\t\tpreviousAreBlocksDifferent &&\n\t\t\t\t! areBlocksDifferent &&\n\t\t\t\tnewIsPersistent &&\n\t\t\t\t! isPersistent;\n\n\t\t\tif ( areBlocksDifferent || didPersistenceChange ) {\n\t\t\t\tisPersistent = newIsPersistent;\n\t\t\t\t// We know that onChange/onInput will update controlledBlocks.\n\t\t\t\t// We need to be aware that it was caused by an outgoing change\n\t\t\t\t// so that we do not treat it as an incoming change later on,\n\t\t\t\t// which would cause a block reset.\n\t\t\t\tpendingChanges.current.outgoing.push( blocks );\n\n\t\t\t\t// Inform the controlling entity that changes have been made to\n\t\t\t\t// the block-editor store they should be aware about.\n\t\t\t\tconst updateParent = isPersistent\n\t\t\t\t\t? onChangeRef.current\n\t\t\t\t\t: onInputRef.current;\n\t\t\t\tupdateParent( blocks, {\n\t\t\t\t\tselection: {\n\t\t\t\t\t\tselectionStart: getSelectionStart(),\n\t\t\t\t\t\tselectionEnd: getSelectionEnd(),\n\t\t\t\t\t\tinitialPosition:\n\t\t\t\t\t\t\tgetSelectedBlocksInitialCaretPosition(),\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\tpreviousAreBlocksDifferent = areBlocksDifferent;\n\t\t} );\n\n\t\treturn () => {\n\t\t\tsubscribed.current = false;\n\t\t\tunsubscribe();\n\t\t};\n\t}, [ registry, clientId ] );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tunsetControlledBlocks();\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,O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B,cAAc,CAACW,OAAO,CAACT,QAAQ,GAAG,IAAI;QACtC2B,YAAY,GAAGK,eAAe;QAC9B;MACD;;MAEA;MACA;MACA;MACA,MAAMG,oBAAoB,GACzBP,0BAA0B,IAC1B,CAAEM,kBAAkB,IACpBF,eAAe,IACf,CAAEL,YAAY;MAEf,IAAKO,kBAAkB,IAAIC,oBAAoB,EAAG;QACjDR,YAAY,GAAGK,eAAe;QAC9B;QACA;QACA;QACA;QACAlC,cAAc,CAACW,OAAO,CAACR,QAAQ,CAACmC,IAAI,CAAEV,MAAO,CAAC;;QAE9C;QACA;QACA,MAAMW,YAAY,GAAGV,YAAY,GAC9Bf,WAAW,CAACH,OAAO,GACnBE,UAAU,CAACF,OAAO;QACrB4B,YAAY,CAAEX,MAAM,EAAE;UACrBpD,SAAS,EAAE;YACV6C,cAAc,EAAE5B,iBAAiB,CAAC,CAAC;YACnC6B,YAAY,EAAE5B,eAAe,CAAC,CAAC;YAC/B6B,eAAe,EACdE,qCAAqC,CAAC;UACxC;QACD,CAAE,CAAC;MACJ;MACAK,0BAA0B,GAAGM,kBAAkB;IAChD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZhC,UAAU,CAACO,OAAO,GAAG,KAAK;MAC1BoB,WAAW,CAAC,CAAC;IACd,CAAC;EACF,CAAC,EAAE,CAAEnD,QAAQ,EAAEP,QAAQ,CAAG,CAAC;EAE3B,IAAA0C,kBAAS,EAAE,MAAM;IAChB,OAAO,MAAM;MACZH,qBAAqB,CAAC,CAAC;IACxB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_blocks","_store","noop","useBlockSync","clientId","value","controlledBlocks","selection","controlledSelection","onChange","onInput","registry","useRegistry","resetBlocks","resetSelection","replaceInnerBlocks","selectBlock","setHasControlledInnerBlocks","__unstableMarkNextChangeAsNotPersistent","dispatch","blockEditorStore","hasSelectedBlock","getBlockName","getBlocks","getSelectionStart","getSelectionEnd","getBlock","select","isControlled","useSelect","areInnerBlocksControlled","pendingChanges","useRef","incoming","outgoing","subscribed","setControlledBlocks","batch","storeBlocks","map","block","cloneBlock","current","unsetControlledBlocks","onInputRef","onChangeRef","useEffect","includes","length","hadSelecton","selectionAnchor","selectionFocus","selectionStart","selectionEnd","initialPosition","selectionStillExists","getSelectedBlocksInitialCaretPosition","isLastBlockChangePersistent","__unstableIsLastBlockChangeIgnored","blocks","isPersistent","previousAreBlocksDifferent","unsubscribe","subscribe","isStillControlled","newIsPersistent","newBlocks","areBlocksDifferent","didPersistenceChange","push","updateParent"],"sources":["@wordpress/block-editor/src/components/provider/use-block-sync.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * A function to call when the block value has been updated in the block-editor\n * store.\n *\n * @callback onBlockUpdate\n * @param {Object[]} blocks The updated blocks.\n * @param {Object} options The updated block options, such as selectionStart\n * and selectionEnd.\n */\n\n/**\n * useBlockSync is a side effect which handles bidirectional sync between the\n * block-editor store and a controlling data source which provides blocks. This\n * is most commonly used by the BlockEditorProvider to synchronize the contents\n * of the block-editor store with the root entity, like a post.\n *\n * Another example would be the template part block, which provides blocks from\n * a separate entity data source than a root entity. This hook syncs edits to\n * the template part in the block editor back to the entity and vice-versa.\n *\n * Here are some of its basic functions:\n * - Initalizes the block-editor store for the given clientID to the blocks\n * given via props.\n * - Adds incoming changes (like undo) to the block-editor store.\n * - Adds outgoing changes (like editing content) to the controlling entity,\n * determining if a change should be considered persistent or not.\n * - Handles edge cases and race conditions which occur in those operations.\n * - Ignores changes which happen to other entities (like nested inner block\n * controllers.\n * - Passes selection state from the block-editor store to the controlling entity.\n *\n * @param {Object} props Props for the block sync hook\n * @param {string} props.clientId The client ID of the inner block controller.\n * If none is passed, then it is assumed to be a\n * root controller rather than an inner block\n * controller.\n * @param {Object[]} props.value The control value for the blocks. This value\n * is used to initalize the block-editor store\n * and for resetting the blocks to incoming\n * changes like undo.\n * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo.\n * @param {onBlockUpdate} props.onChange Function to call when a persistent\n * change has been made in the block-editor blocks\n * for the given clientId. For example, after\n * this function is called, an entity is marked\n * dirty because it has changes to save.\n * @param {onBlockUpdate} props.onInput Function to call when a non-persistent\n * change has been made in the block-editor blocks\n * for the given clientId. When this is called,\n * controlling sources do not become dirty.\n */\nexport default function useBlockSync( {\n\tclientId = null,\n\tvalue: controlledBlocks,\n\tselection: controlledSelection,\n\tonChange = noop,\n\tonInput = noop,\n} ) {\n\tconst registry = useRegistry();\n\n\tconst {\n\t\tresetBlocks,\n\t\tresetSelection,\n\t\treplaceInnerBlocks,\n\t\tselectBlock,\n\t\tsetHasControlledInnerBlocks,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = registry.dispatch( blockEditorStore );\n\tconst {\n\t\thasSelectedBlock,\n\t\tgetBlockName,\n\t\tgetBlocks,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlock,\n\t} = registry.select( blockEditorStore );\n\tconst isControlled = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t! clientId ||\n\t\t\t\tselect( blockEditorStore ).areInnerBlocksControlled( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst pendingChanges = useRef( { incoming: null, outgoing: [] } );\n\tconst subscribed = useRef( false );\n\n\tconst setControlledBlocks = () => {\n\t\tif ( ! controlledBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't need to persist this change because we only replace\n\t\t// controlled inner blocks when the change was caused by an entity,\n\t\t// and so it would already be persisted.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tif ( clientId ) {\n\t\t\t// It is important to batch here because otherwise,\n\t\t\t// as soon as `setHasControlledInnerBlocks` is called\n\t\t\t// the effect to restore might be triggered\n\t\t\t// before the actual blocks get set properly in state.\n\t\t\tregistry.batch( () => {\n\t\t\t\tsetHasControlledInnerBlocks( clientId, true );\n\t\t\t\tconst storeBlocks = controlledBlocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock( block )\n\t\t\t\t);\n\t\t\t\tif ( subscribed.current ) {\n\t\t\t\t\tpendingChanges.current.incoming = storeBlocks;\n\t\t\t\t}\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceInnerBlocks( clientId, storeBlocks );\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( subscribed.current ) {\n\t\t\t\tpendingChanges.current.incoming = controlledBlocks;\n\t\t\t}\n\t\t\tresetBlocks( controlledBlocks );\n\t\t}\n\t};\n\n\t// Clean up the changes made by setControlledBlocks() when the component\n\t// containing useBlockSync() unmounts.\n\tconst unsetControlledBlocks = () => {\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tif ( clientId ) {\n\t\t\tsetHasControlledInnerBlocks( clientId, false );\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\treplaceInnerBlocks( clientId, [] );\n\t\t} else {\n\t\t\tresetBlocks( [] );\n\t\t}\n\t};\n\n\t// Add a subscription to the block-editor registry to detect when changes\n\t// have been made. This lets us inform the data source of changes. This\n\t// is an effect so that the subscriber can run synchronously without\n\t// waiting for React renders for changes.\n\tconst onInputRef = useRef( onInput );\n\tconst onChangeRef = useRef( onChange );\n\tuseEffect( () => {\n\t\tonInputRef.current = onInput;\n\t\tonChangeRef.current = onChange;\n\t}, [ onInput, onChange ] );\n\n\t// Determine if blocks need to be reset when they change.\n\tuseEffect( () => {\n\t\tif ( pendingChanges.current.outgoing.includes( controlledBlocks ) ) {\n\t\t\t// Skip block reset if the value matches expected outbound sync\n\t\t\t// triggered by this component by a preceding change detection.\n\t\t\t// Only skip if the value matches expectation, since a reset should\n\t\t\t// still occur if the value is modified (not equal by reference),\n\t\t\t// to allow that the consumer may apply modifications to reflect\n\t\t\t// back on the editor.\n\t\t\tif (\n\t\t\t\tpendingChanges.current.outgoing[\n\t\t\t\t\tpendingChanges.current.outgoing.length - 1\n\t\t\t\t] === controlledBlocks\n\t\t\t) {\n\t\t\t\tpendingChanges.current.outgoing = [];\n\t\t\t}\n\t\t} else if ( getBlocks( clientId ) !== controlledBlocks ) {\n\t\t\t// Reset changing value in all other cases than the sync described\n\t\t\t// above. Since this can be reached in an update following an out-\n\t\t\t// bound sync, unset the outbound value to avoid considering it in\n\t\t\t// subsequent renders.\n\t\t\tpendingChanges.current.outgoing = [];\n\t\t\tconst hadSelecton = hasSelectedBlock();\n\t\t\tconst selectionAnchor = getSelectionStart();\n\t\t\tconst selectionFocus = getSelectionEnd();\n\t\t\tsetControlledBlocks();\n\n\t\t\tif ( controlledSelection ) {\n\t\t\t\tresetSelection(\n\t\t\t\t\tcontrolledSelection.selectionStart,\n\t\t\t\t\tcontrolledSelection.selectionEnd,\n\t\t\t\t\tcontrolledSelection.initialPosition\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst selectionStillExists = getBlock(\n\t\t\t\t\tselectionAnchor.clientId\n\t\t\t\t);\n\t\t\t\tif ( hadSelecton && ! selectionStillExists ) {\n\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t} else {\n\t\t\t\t\tresetSelection( selectionAnchor, selectionFocus );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ controlledBlocks, clientId ] );\n\n\tuseEffect( () => {\n\t\t// When the block becomes uncontrolled, it means its inner state has been reset\n\t\t// we need to take the blocks again from the external value property.\n\t\tif ( ! isControlled ) {\n\t\t\tpendingChanges.current.outgoing = [];\n\t\t\tsetControlledBlocks();\n\t\t}\n\t}, [ isControlled ] );\n\n\tuseEffect( () => {\n\t\tconst {\n\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t\tisLastBlockChangePersistent,\n\t\t\t__unstableIsLastBlockChangeIgnored,\n\t\t\tareInnerBlocksControlled,\n\t\t} = registry.select( blockEditorStore );\n\n\t\tlet blocks = getBlocks( clientId );\n\t\tlet isPersistent = isLastBlockChangePersistent();\n\t\tlet previousAreBlocksDifferent = false;\n\n\t\tsubscribed.current = true;\n\t\tconst unsubscribe = registry.subscribe( () => {\n\t\t\t// Sometimes, when changing block lists, lingering subscriptions\n\t\t\t// might trigger before they are cleaned up. If the block for which\n\t\t\t// the subscription runs is no longer in the store, this would clear\n\t\t\t// its parent entity's block list. To avoid this, we bail out if\n\t\t\t// the subscription is triggering for a block (`clientId !== null`)\n\t\t\t// and its block name can't be found because it's not on the list.\n\t\t\t// (`getBlockName( clientId ) === null`).\n\t\t\tif ( clientId !== null && getBlockName( clientId ) === null )\n\t\t\t\treturn;\n\n\t\t\t// When RESET_BLOCKS on parent blocks get called, the controlled blocks\n\t\t\t// can reset to uncontrolled, in these situations, it means we need to populate\n\t\t\t// the blocks again from the external blocks (the value property here)\n\t\t\t// and we should stop triggering onChange\n\t\t\tconst isStillControlled =\n\t\t\t\t! clientId || areInnerBlocksControlled( clientId );\n\t\t\tif ( ! isStillControlled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst newIsPersistent = isLastBlockChangePersistent();\n\t\t\tconst newBlocks = getBlocks( clientId );\n\t\t\tconst areBlocksDifferent = newBlocks !== blocks;\n\t\t\tblocks = newBlocks;\n\t\t\tif (\n\t\t\t\tareBlocksDifferent &&\n\t\t\t\t( pendingChanges.current.incoming ||\n\t\t\t\t\t__unstableIsLastBlockChangeIgnored() )\n\t\t\t) {\n\t\t\t\tpendingChanges.current.incoming = null;\n\t\t\t\tisPersistent = newIsPersistent;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Since we often dispatch an action to mark the previous action as\n\t\t\t// persistent, we need to make sure that the blocks changed on the\n\t\t\t// previous action before committing the change.\n\t\t\tconst didPersistenceChange =\n\t\t\t\tpreviousAreBlocksDifferent &&\n\t\t\t\t! areBlocksDifferent &&\n\t\t\t\tnewIsPersistent &&\n\t\t\t\t! isPersistent;\n\n\t\t\tif ( areBlocksDifferent || didPersistenceChange ) {\n\t\t\t\tisPersistent = newIsPersistent;\n\t\t\t\t// We know that onChange/onInput will update controlledBlocks.\n\t\t\t\t// We need to be aware that it was caused by an outgoing change\n\t\t\t\t// so that we do not treat it as an incoming change later on,\n\t\t\t\t// which would cause a block reset.\n\t\t\t\tpendingChanges.current.outgoing.push( blocks );\n\n\t\t\t\t// Inform the controlling entity that changes have been made to\n\t\t\t\t// the block-editor store they should be aware about.\n\t\t\t\tconst updateParent = isPersistent\n\t\t\t\t\t? onChangeRef.current\n\t\t\t\t\t: onInputRef.current;\n\t\t\t\tupdateParent( blocks, {\n\t\t\t\t\tselection: {\n\t\t\t\t\t\tselectionStart: getSelectionStart(),\n\t\t\t\t\t\tselectionEnd: getSelectionEnd(),\n\t\t\t\t\t\tinitialPosition:\n\t\t\t\t\t\t\tgetSelectedBlocksInitialCaretPosition(),\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\tpreviousAreBlocksDifferent = areBlocksDifferent;\n\t\t}, blockEditorStore );\n\n\t\treturn () => {\n\t\t\tsubscribed.current = false;\n\t\t\tunsubscribe();\n\t\t};\n\t}, [ registry, clientId ] );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tunsetControlledBlocks();\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMI,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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