@wordpress/block-editor 12.18.2 → 12.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/autocompleters/block.js +1 -2
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +1 -2
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/ui.js +1 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +1 -2
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-alignment-control/constants.js +2 -4
- package/build/components/block-alignment-control/constants.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -2
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -2
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +1 -2
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +1 -2
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-canvas/index.js +1 -2
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-caption/index.native.js +1 -2
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-card/index.js +1 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/index.js +1 -2
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-context/index.js +1 -2
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/groups.js +1 -2
- package/build/components/block-controls/groups.js.map +1 -1
- package/build/components/block-controls/index.js +1 -2
- package/build/components/block-controls/index.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 +1 -2
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +3 -4
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/context.js +4 -8
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/edit.js +1 -2
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +1 -2
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +1 -2
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-icon/index.js +1 -2
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +1 -2
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +1 -2
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +11 -9
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-crash-boundary.js +1 -2
- package/build/components/block-list/block-crash-boundary.js.map +1 -1
- package/build/components/block-list/block-html.js +1 -2
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +1 -2
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -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 +1 -2
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +1 -2
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +1 -2
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +32 -21
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +7 -6
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/grid-item.native.js +1 -2
- package/build/components/block-list/grid-item.native.js.map +1 -1
- package/build/components/block-list/index.js +19 -9
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +1 -2
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/layout.js +2 -4
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/private-block-context.js +1 -2
- package/build/components/block-list/private-block-context.js.map +1 -1
- package/build/components/block-list/subdirectory-icon.js +1 -2
- package/build/components/block-list/subdirectory-icon.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +8 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-scroll-upon-insertion.native.js +1 -2
- package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
- package/build/components/block-list-appender/index.js +5 -52
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +11 -22
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +2 -4
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +1 -2
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +3 -6
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +0 -2
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +1 -2
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-pattern-setup/constants.js +1 -2
- package/build/components/block-pattern-setup/constants.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +1 -2
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +1 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js +1 -2
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +1 -2
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +1 -2
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -4
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +1 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-popover/use-popover-scroll.js +1 -2
- package/build/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build/components/block-preview/auto.js +2 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +1 -2
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +4 -2
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +1 -2
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +1 -2
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings/index.native.js +2 -2
- package/build/components/block-settings/index.native.js.map +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.js +1 -2
- package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +1 -2
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +1 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-menu-first-item.js +1 -2
- package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
- package/build/components/block-settings-menu/index.js +1 -2
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +1 -2
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -2
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -2
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +1 -2
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +1 -2
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +1 -2
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +13 -11
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +1 -2
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -2
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-title/use-block-display-title.js +21 -28
- package/build/components/block-title/use-block-display-title.js.map +1 -1
- package/build/components/block-toolbar/block-name-context.js +1 -2
- package/build/components/block-toolbar/block-name-context.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-last-item.js +1 -2
- package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -2
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +20 -18
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +4 -12
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +1 -2
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +1 -2
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +1 -2
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -2
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +1 -2
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +1 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/icons.js +5 -10
- package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +1 -2
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/button-block-appender/index.js +2 -4
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/button-block-appender/index.native.js +1 -2
- package/build/components/button-block-appender/index.native.js.map +1 -1
- package/build/components/caption/index.native.js +1 -2
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/color-palette/index.js +1 -2
- package/build/components/color-palette/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +1 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/color-style-selector/index.js +1 -2
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/index.js +2 -2
- package/build/components/colors/index.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -2
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/contrast-checker/index.js +1 -2
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +1 -2
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +1 -2
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/default-block-appender/index.js +31 -40
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +1 -2
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/dimensions-tool/index.js +1 -2
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -2
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editable-text/index.js +1 -2
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +1 -2
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/floating-toolbar/nav-up-icon.js +1 -2
- package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +1 -2
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/global-styles/border-panel.js +56 -8
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +1 -2
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/context.js +2 -4
- package/build/components/global-styles/context.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +2 -4
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/index.js +2 -15
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +133 -0
- package/build/components/global-styles/shadow-panel-components.js.map +1 -0
- package/build/components/global-styles/typography-panel.js +6 -7
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +38 -14
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +1 -2
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/constants.js +3 -6
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +1 -2
- package/build/components/image-link-destinations/index.native.js.map +1 -1
- package/build/components/index.js +2 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +2 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +1 -2
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/constants.native.js +1 -2
- package/build/components/inner-blocks/constants.native.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +1 -2
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +33 -30
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +2 -6
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +2 -3
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build/components/inner-blocks/with-client-id.js +1 -2
- package/build/components/inner-blocks/with-client-id.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +1 -2
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -2
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -9
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +1 -2
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -2
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -2
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -2
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +1 -2
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -2
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +2 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -2
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +1 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +1 -2
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +1 -2
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +1 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +1 -2
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/no-results.js +1 -2
- package/build/components/inserter/no-results.js.map +1 -1
- package/build/components/inserter/no-results.native.js +1 -2
- package/build/components/inserter/no-results.native.js.map +1 -1
- package/build/components/inserter/panel.js +1 -2
- package/build/components/inserter/panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +1 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +3 -2
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +1 -2
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-items.js +0 -1
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +1 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/search-results.native.js +1 -2
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.js +1 -2
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -2
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/tips.js +1 -2
- package/build/components/inserter/tips.js.map +1 -1
- package/build/components/inserter-button/index.native.js +1 -2
- package/build/components/inserter-button/index.native.js.map +1 -1
- package/build/components/inserter-button/sparkles.js +1 -2
- package/build/components/inserter-button/sparkles.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +11 -2
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +1 -2
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inserter-listbox/context.js +1 -2
- package/build/components/inserter-listbox/context.js.map +1 -1
- package/build/components/inserter-listbox/group.js +1 -2
- package/build/components/inserter-listbox/group.js.map +1 -1
- package/build/components/inserter-listbox/index.js +1 -2
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +1 -2
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +1 -2
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inserter-menu-extension/index.js +1 -2
- package/build/components/inserter-menu-extension/index.js.map +1 -1
- package/build/components/inspector-controls/groups.js +1 -2
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/index.js +1 -2
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -4
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -2
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +6 -6
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +1 -2
- package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +3 -6
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/justify-content-control/ui.js +1 -2
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/line-height-control/index.js +1 -2
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/utils.js +4 -8
- package/build/components/line-height-control/utils.js.map +1 -1
- package/build/components/link-control/constants.js +7 -14
- package/build/components/link-control/constants.js.map +1 -1
- package/build/components/link-control/index.js +2 -16
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +13 -15
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-create-button.js +1 -2
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +1 -2
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +1 -2
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +1 -2
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-create-page.js +0 -1
- package/build/components/link-control/use-create-page.js.map +1 -1
- package/build/components/link-control/use-rich-url-data.js +1 -2
- package/build/components/link-control/use-rich-url-data.js.map +1 -1
- package/build/components/link-control/viewer-slot.js +1 -2
- package/build/components/link-control/viewer-slot.js.map +1 -1
- package/build/components/list-view/appender.js +1 -2
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/block-contents.js +1 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +33 -28
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +1 -2
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/context.js +1 -2
- package/build/components/list-view/context.js.map +1 -1
- package/build/components/list-view/index.js +20 -17
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +1 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +159 -0
- package/build/components/list-view/use-clipboard-handler.js.map +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js +1 -2
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +4 -4
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +1 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +1 -2
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +1 -2
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +1 -2
- package/build/components/media-replace-flow/index.native.js.map +1 -1
- package/build/components/media-upload/check.js +1 -2
- package/build/components/media-upload/check.js.map +1 -1
- package/build/components/media-upload/constants.native.js +8 -16
- package/build/components/media-upload/constants.native.js.map +1 -1
- package/build/components/media-upload/index.js +1 -2
- package/build/components/media-upload/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -2
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/media-upload-progress/constants.js +6 -12
- package/build/components/media-upload-progress/constants.js.map +1 -1
- package/build/components/media-upload-progress/index.native.js +1 -2
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +1 -2
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +5 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -2
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +1 -2
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +1 -2
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +1 -2
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/index.js +3 -5
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +2 -4
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +1 -2
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +3 -7
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +1 -2
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +1 -2
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -2
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.native.js +1 -2
- package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +1 -2
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.native.js +1 -2
- package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build/components/rich-text/index.js +6 -7
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +1 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +1 -2
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +1 -6
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -2
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +1 -2
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +3 -1
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +5 -10
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/tool-selector/index.js +1 -2
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +1 -2
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +1 -2
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js +1 -2
- package/build/components/unsupported-block-details/index.native.js.map +1 -1
- package/build/components/url-input/button.js +1 -2
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +1 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +18 -8
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +5 -5
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +15 -5
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-flash-editable-blocks/index.js +60 -0
- package/build/components/use-flash-editable-blocks/index.js.map +1 -0
- package/build/components/use-moving-animation/index.js +1 -2
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +4 -4
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-settings/index.js +3 -162
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/video-player/gridicon-play.native.js +1 -2
- package/build/components/video-player/gridicon-play.native.js.map +1 -1
- package/build/components/video-player/index.native.js +2 -4
- package/build/components/video-player/index.native.js.map +1 -1
- package/build/components/warning/index.js +1 -2
- package/build/components/warning/index.js.map +1 -1
- package/build/components/warning/index.native.js +1 -2
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/index.js +1 -2
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +3 -48
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +13 -2
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/utils.js +86 -0
- package/build/components/writing-flow/utils.js.map +1 -0
- package/build/hooks/align.js +1 -2
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +2 -2
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +1 -2
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +1 -2
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/background.js +52 -14
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -2
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +1 -2
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +42 -7
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +4 -6
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +1 -2
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +1 -2
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +1 -2
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +5 -10
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +1 -3
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +2 -4
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +25 -31
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +2 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +1 -2
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +2 -4
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +1 -2
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +1 -2
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +3 -8
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +4 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +3 -6
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +10 -9
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/layouts/constrained.js +1 -2
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/definitions.js +1 -2
- package/build/layouts/definitions.js.map +1 -1
- package/build/layouts/flex.js +1 -2
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +1 -2
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/grid.js +1 -2
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +8 -5
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +3 -4
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +2 -4
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +2 -4
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +1 -2
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/get-block-settings.js +180 -0
- package/build/store/get-block-settings.js.map +1 -0
- package/build/store/index.js +4 -6
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +37 -3
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +55 -29
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +27 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +98 -102
- package/build/store/selectors.js.map +1 -1
- package/build/store/undo-ignore.js +1 -2
- package/build/store/undo-ignore.js.map +1 -1
- package/build/utils/selection.js +1 -2
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +3 -4
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +0 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +10 -7
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +32 -20
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +6 -4
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +18 -7
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +8 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +5 -51
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +0 -2
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +0 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-preview/auto.js +2 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +4 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +12 -9
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-title/use-block-display-title.js +22 -28
- package/build-module/components/block-title/use-block-display-title.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +20 -17
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +2 -10
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +0 -1
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +30 -37
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +57 -9
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +2 -4
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/index.js +0 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +121 -0
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -0
- package/build-module/components/global-styles/typography-panel.js +2 -3
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +30 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +33 -29
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +1 -4
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +2 -3
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +2 -2
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +3 -2
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +0 -1
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +12 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/link-control/index.js +1 -14
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +16 -18
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/use-create-page.js +0 -1
- package/build-module/components/link-control/use-create-page.js.map +1 -1
- package/build-module/components/list-view/block.js +32 -26
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +17 -11
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +153 -0
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -0
- package/build-module/components/list-view/utils.js +4 -4
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +5 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +3 -6
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +3 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +0 -4
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +4 -2
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +21 -11
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +5 -4
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +15 -5
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-flash-editable-blocks/index.js +53 -0
- package/build-module/components/use-flash-editable-blocks/index.js.map +1 -0
- package/build-module/components/use-on-block-drop/index.js +4 -4
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +3 -159
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +4 -49
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +13 -2
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +79 -0
- package/build-module/components/writing-flow/utils.js.map +1 -0
- package/build-module/hooks/background.js +48 -10
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/border.js +38 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/duotone.js +0 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-size.js +23 -27
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/style.js +3 -7
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +8 -11
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/private-apis.js +5 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/get-block-settings.js +171 -0
- package/build-module/store/get-block-settings.js.map +1 -0
- package/build-module/store/private-actions.js +35 -3
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +42 -19
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +24 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +65 -34
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +23 -15
- package/build-style/content.css +23 -15
- package/build-style/style-rtl.css +66 -53
- package/build-style/style.css +66 -53
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +1 -1
- package/src/components/block-card/style.scss +3 -1
- package/src/components/block-controls/README.md +2 -2
- package/src/components/block-inspector/index.js +11 -9
- package/src/components/block-list/block.js +45 -20
- package/src/components/block-list/block.native.js +7 -4
- package/src/components/block-list/content.scss +23 -28
- package/src/components/block-list/index.js +49 -25
- package/src/components/block-list/use-block-props/index.js +8 -0
- package/src/components/block-list-appender/index.js +7 -74
- package/src/components/block-mover/style.scss +4 -3
- package/src/components/block-preview/auto.js +2 -1
- package/src/components/block-removal-warning-modal/index.js +17 -10
- package/src/components/block-switcher/index.js +22 -13
- package/src/components/block-title/test/index.js +86 -85
- package/src/components/block-title/use-block-display-title.js +25 -36
- package/src/components/block-toolbar/style.scss +8 -1
- package/src/components/block-tools/block-selection-button.js +23 -26
- package/src/components/block-tools/index.js +2 -12
- package/src/components/colors-gradients/control.js +0 -1
- package/src/components/default-block-appender/index.js +26 -38
- package/src/components/default-block-appender/test/index.js +24 -16
- package/src/components/font-sizes/README.MD +0 -9
- package/src/components/global-styles/border-panel.js +72 -1
- package/src/components/global-styles/get-global-styles-changes.js +2 -8
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/shadow-panel-components.js +125 -0
- package/src/components/global-styles/style.scss +8 -9
- package/src/components/global-styles/test/get-global-styles-changes.js +3 -3
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/test/utils.js +86 -0
- package/src/components/global-styles/typography-panel.js +1 -2
- package/src/components/global-styles/use-global-styles-output.js +5 -1
- package/src/components/global-styles/utils.js +36 -0
- package/src/components/inner-blocks/index.js +31 -32
- package/src/components/inner-blocks/index.native.js +3 -9
- package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -3
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +4 -10
- package/src/components/inserter/block-patterns-tab/utils.js +2 -2
- package/src/components/inserter/quick-inserter.js +4 -2
- package/src/components/inserter/style.scss +3 -13
- package/src/components/inserter-draggable-blocks/index.js +12 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +4 -2
- package/src/components/link-control/index.js +1 -20
- package/src/components/link-control/link-preview.js +19 -24
- package/src/components/link-control/style.scss +5 -11
- package/src/components/link-control/test/index.js +11 -90
- package/src/components/list-view/block.js +49 -41
- package/src/components/list-view/index.js +22 -9
- package/src/components/list-view/use-clipboard-handler.js +199 -0
- package/src/components/list-view/utils.js +4 -4
- package/src/components/media-replace-flow/style.scss +1 -1
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/navigable-toolbar/index.js +8 -4
- package/src/components/provider/index.js +1 -1
- package/src/components/responsive-block-control/index.js +3 -5
- package/src/components/rich-text/index.js +3 -1
- package/src/components/spacing-sizes-control/index.js +2 -1
- package/src/components/url-input/style.scss +4 -2
- package/src/components/url-popover/image-url-input-ui.js +22 -10
- package/src/components/url-popover/index.js +75 -69
- package/src/components/url-popover/style.scss +12 -21
- package/src/components/use-block-drop-zone/index.js +17 -3
- package/src/components/use-flash-editable-blocks/index.js +62 -0
- package/src/components/use-on-block-drop/index.js +11 -4
- package/src/components/use-settings/index.js +9 -232
- package/src/components/writing-flow/use-clipboard-handler.js +6 -78
- package/src/components/writing-flow/use-drag-selection.js +12 -3
- package/src/components/writing-flow/utils.js +103 -0
- package/src/hooks/background.js +53 -8
- package/src/hooks/border.js +47 -6
- package/src/hooks/font-size.js +33 -33
- package/src/hooks/style.js +5 -9
- package/src/hooks/test/background.js +50 -0
- package/src/hooks/test/font-size.js +164 -0
- package/src/hooks/use-bindings-attributes.js +8 -18
- package/src/private-apis.js +4 -0
- package/src/store/get-block-settings.js +225 -0
- package/src/store/private-actions.js +44 -2
- package/src/store/private-selectors.js +53 -38
- package/src/store/reducer.js +29 -1
- package/src/store/selectors.js +74 -48
- package/src/store/test/get-block-settings.js +90 -0
- package/src/store/test/private-actions.js +18 -0
- package/src/store/test/private-selectors.js +19 -0
- package/src/store/test/reducer.js +19 -0
- package/build/components/global-styles/effects-panel.js +0 -219
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/hooks/effects.js +0 -66
- package/build/hooks/effects.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -210
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/hooks/effects.js +0 -51
- package/build-module/hooks/effects.js.map +0 -1
- package/src/components/global-styles/effects-panel.js +0 -244
- package/src/components/use-settings/test/index.js +0 -141
- package/src/hooks/effects.js +0 -57
- package/src/hooks/test/effects.js +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fill","_interopRequireDefault","require","_slot","BlockControls","BlockControlsFill","Slot","BlockControlsSlot","BlockFormatControls","props","_react","createElement","default","group","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-controls/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport BlockControlsFill from './fill';\nimport BlockControlsSlot from './slot';\n\nconst BlockControls = BlockControlsFill;\n\nBlockControls.Slot = BlockControlsSlot;\n\n// This is just here for backward compatibility.\nexport const BlockFormatControls = ( props ) => {\n\treturn <BlockControlsFill group=\"inline\" { ...props } />;\n};\nBlockFormatControls.Slot = ( props ) => {\n\treturn <BlockControlsSlot group=\"inline\" { ...props } />;\n};\n\nexport default BlockControls;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,aAAa,GAAGC,aAAiB;AAEvCD,aAAa,CAACE,IAAI,GAAGC,aAAiB;;AAEtC;AACO,MAAMC,mBAAmB,GAAKC,KAAK,IAAM;EAC/C,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACX,KAAA,CAAAY,OAAiB;IAACC,KAAK,EAAC,QAAQ;IAAA,GAAMJ;EAAK,CAAI,CAAC;AACzD,CAAC;AAACK,OAAA,CAAAN,mBAAA,GAAAA,mBAAA;AACFA,mBAAmB,CAACF,IAAI,GAAKG,KAAK,IAAM;EACvC,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,KAAA,CAAAS,OAAiB;IAACC,KAAK,EAAC,QAAQ;IAAA,GAAMJ;EAAK,CAAI,CAAC;AACzD,CAAC;AAAC,IAAAM,QAAA,
|
|
1
|
+
{"version":3,"names":["_fill","_interopRequireDefault","require","_slot","BlockControls","BlockControlsFill","Slot","BlockControlsSlot","BlockFormatControls","props","_react","createElement","default","group","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-controls/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport BlockControlsFill from './fill';\nimport BlockControlsSlot from './slot';\n\nconst BlockControls = BlockControlsFill;\n\nBlockControls.Slot = BlockControlsSlot;\n\n// This is just here for backward compatibility.\nexport const BlockFormatControls = ( props ) => {\n\treturn <BlockControlsFill group=\"inline\" { ...props } />;\n};\nBlockFormatControls.Slot = ( props ) => {\n\treturn <BlockControlsSlot group=\"inline\" { ...props } />;\n};\n\nexport default BlockControls;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,aAAa,GAAGC,aAAiB;AAEvCD,aAAa,CAACE,IAAI,GAAGC,aAAiB;;AAEtC;AACO,MAAMC,mBAAmB,GAAKC,KAAK,IAAM;EAC/C,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACX,KAAA,CAAAY,OAAiB;IAACC,KAAK,EAAC,QAAQ;IAAA,GAAMJ;EAAK,CAAI,CAAC;AACzD,CAAC;AAACK,OAAA,CAAAN,mBAAA,GAAAA,mBAAA;AACFA,mBAAmB,CAACF,IAAI,GAAKG,KAAK,IAAM;EACvC,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,KAAA,CAAAS,OAAiB;IAACC,KAAK,EAAC,QAAQ;IAAA,GAAMJ;EAAK,CAAI,CAAC;AACzD,CAAC;AAAC,IAAAM,QAAA,GAAAD,OAAA,CAAAF,OAAA,GAEaR,aAAa"}
|
|
@@ -13,8 +13,8 @@ var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
|
13
13
|
var _store = require("../../store");
|
|
14
14
|
var _blockListContext = require("../block-list/block-list-context");
|
|
15
15
|
var _droppingInsertionPoint = _interopRequireDefault(require("./dropping-insertion-point.scss"));
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
/**
|
|
19
19
|
* External dependencies
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","_interopRequireWildcard","require","_reactNativeSafeAreaContext","_data","_reactNativeBridge","_store","_blockListContext","_droppingInsertionPoint","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DroppingInsertionPoint","scroll","currentYPosition","isDragging","targetBlockIndex","getBlockOrder","isBlockBeingDragged","isDraggingBlocks","getPreviousBlockClientId","getNextBlockClientId","useSelect","blockEditorStore","blocksLayouts","findBlockLayoutByClientId","useBlockListContext","top","bottom","useSafeAreaInsets","height","useSafeAreaFrame","safeAreaOffset","maxHeight","styles","blockYPosition","useSharedValue","opacity","useAnimatedReaction","value","getSelectedBlockIndicatorPosition","positions","currentYPositionWithScroll","offsetY","midpoint","setIndicatorPosition","index","insertionPointIndex","order","isDraggingAnyBlocks","length","previousClientId","nextClientId","previousElement","current","nextElement","previousElementPosition","y","nextElementPosition","elementsPositions","Math","floor","nextPosition","withTiming","generateHapticFeedback","previous","runOnJS","animatedStyles","useAnimatedStyle","translationY","shouldHideIndicator","transform","translateY","insertionPointStyles","_react","createElement","View","pointerEvents","style"],"sources":["@wordpress/block-editor/src/components/block-draggable/dropping-insertion-point.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport Animated, {\n\tuseSharedValue,\n\tuseAnimatedStyle,\n\twithTiming,\n\tuseAnimatedReaction,\n\trunOnJS,\n} from 'react-native-reanimated';\nimport {\n\tuseSafeAreaInsets,\n\tuseSafeAreaFrame,\n} from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { generateHapticFeedback } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useBlockListContext } from '../block-list/block-list-context';\nimport styles from './dropping-insertion-point.scss';\n\n/**\n * Dropping zone indicator component.\n *\n * This component shows where a block can be dropped when it's being dragged.\n *\n * @param {Object} props Component props.\n * @param {Object} props.scroll Scroll offset object.\n * @param {Object} props.currentYPosition Current Y coordinate position when dragging.\n * @param {import('react-native-reanimated').SharedValue} props.isDragging Whether or not dragging has started.\n * @param {import('react-native-reanimated').SharedValue} props.targetBlockIndex Current block target index.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nexport default function DroppingInsertionPoint( {\n\tscroll,\n\tcurrentYPosition,\n\tisDragging,\n\ttargetBlockIndex,\n} ) {\n\tconst {\n\t\tgetBlockOrder,\n\t\tisBlockBeingDragged,\n\t\tisDraggingBlocks,\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t} = useSelect( blockEditorStore );\n\n\tconst { blocksLayouts, findBlockLayoutByClientId } = useBlockListContext();\n\tconst { top, bottom } = useSafeAreaInsets();\n\tconst { height } = useSafeAreaFrame();\n\tconst safeAreaOffset = top + bottom;\n\tconst maxHeight =\n\t\theight -\n\t\t( safeAreaOffset + styles[ 'dropping-insertion-point' ].height );\n\n\tconst blockYPosition = useSharedValue( 0 );\n\tconst opacity = useSharedValue( 0 );\n\n\tuseAnimatedReaction(\n\t\t() => isDragging.value,\n\t\t( value ) => {\n\t\t\tif ( ! value ) {\n\t\t\t\topacity.value = 0;\n\t\t\t\tblockYPosition.value = 0;\n\t\t\t}\n\t\t}\n\t);\n\n\tfunction getSelectedBlockIndicatorPosition( positions ) {\n\t\tconst currentYPositionWithScroll =\n\t\t\tcurrentYPosition.value + scroll.offsetY.value;\n\t\tconst midpoint = ( positions.top + positions.bottom ) / 2;\n\n\t\treturn midpoint < currentYPositionWithScroll\n\t\t\t? positions.bottom\n\t\t\t: positions.top;\n\t}\n\n\tfunction setIndicatorPosition( index ) {\n\t\tconst insertionPointIndex = index;\n\t\tconst order = getBlockOrder();\n\t\tconst isDraggingAnyBlocks = isDraggingBlocks();\n\n\t\tif (\n\t\t\t! isDraggingAnyBlocks ||\n\t\t\tinsertionPointIndex === null ||\n\t\t\t! order.length\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet previousClientId = order[ insertionPointIndex - 1 ];\n\t\tlet nextClientId = order[ insertionPointIndex ];\n\n\t\twhile ( isBlockBeingDragged( previousClientId ) ) {\n\t\t\tpreviousClientId = getPreviousBlockClientId( previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( nextClientId ) ) {\n\t\t\tnextClientId = getNextBlockClientId( nextClientId );\n\t\t}\n\n\t\tconst previousElement = previousClientId\n\t\t\t? findBlockLayoutByClientId(\n\t\t\t\t\tblocksLayouts.current,\n\t\t\t\t\tpreviousClientId\n\t\t\t )\n\t\t\t: null;\n\t\tconst nextElement = nextClientId\n\t\t\t? findBlockLayoutByClientId( blocksLayouts.current, nextClientId )\n\t\t\t: null;\n\n\t\tconst previousElementPosition = previousElement\n\t\t\t? previousElement.y + previousElement.height\n\t\t\t: 0;\n\t\tconst nextElementPosition = nextElement ? nextElement.y : 0;\n\n\t\tconst elementsPositions = {\n\t\t\ttop: Math.floor(\n\t\t\t\tpreviousElement ? previousElementPosition : nextElementPosition\n\t\t\t),\n\t\t\tbottom: Math.floor(\n\t\t\t\tnextElement ? nextElementPosition : previousElementPosition\n\t\t\t),\n\t\t};\n\n\t\tconst nextPosition =\n\t\t\telementsPositions.top !== elementsPositions.bottom\n\t\t\t\t? getSelectedBlockIndicatorPosition( elementsPositions )\n\t\t\t\t: elementsPositions.top;\n\n\t\tif ( nextPosition && blockYPosition.value !== nextPosition ) {\n\t\t\topacity.value = 0;\n\t\t\tblockYPosition.value = nextPosition;\n\t\t\topacity.value = withTiming( 1 );\n\t\t\tgenerateHapticFeedback();\n\t\t}\n\t}\n\n\tuseAnimatedReaction(\n\t\t() => targetBlockIndex.value,\n\t\t( value, previous ) => {\n\t\t\tif ( value !== previous ) {\n\t\t\t\trunOnJS( setIndicatorPosition )( value );\n\t\t\t}\n\t\t}\n\t);\n\n\tconst animatedStyles = useAnimatedStyle( () => {\n\t\tconst translationY = blockYPosition.value - scroll.offsetY.value;\n\t\t// Prevents overflowing behind the header/footer\n\t\tconst shouldHideIndicator =\n\t\t\ttranslationY < 0 || translationY > maxHeight;\n\n\t\treturn {\n\t\t\topacity: shouldHideIndicator ? 0 : opacity.value,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: translationY,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t} );\n\n\tconst insertionPointStyles = [\n\t\tstyles[ 'dropping-insertion-point' ],\n\t\tanimatedStyles,\n\t];\n\n\treturn (\n\t\t<Animated.View pointerEvents=\"none\" style={ insertionPointStyles } />\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,sBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,2BAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,uBAAA,GAAAC,sBAAA,CAAAP,OAAA;AAAqD,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAc,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL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K,KAAK0B,QAAQ,EAAG;MACzB,IAAAC,8BAAO,EAAErB,oBAAqB,CAAC,CAAEN,KAAM,CAAC;IACzC;EACD,CACD,CAAC;EAED,MAAM4B,cAAc,GAAG,IAAAC,uCAAgB,EAAE,MAAM;IAC9C,MAAMC,YAAY,GAAGlC,cAAc,CAACI,KAAK,GAAG1B,MAAM,CAAC8B,OAAO,CAACJ,KAAK;IAChE;IACA,MAAM+B,mBAAmB,GACxBD,YAAY,GAAG,CAAC,IAAIA,YAAY,GAAGpC,SAAS;IAE7C,OAAO;MACNI,OAAO,EAAEiC,mBAAmB,GAAG,CAAC,GAAGjC,OAAO,CAACE,KAAK;MAChDgC,SAAS,EAAE,CACV;QACCC,UAAU,EAAEH;MACb,CAAC;IAEH,CAAC;EACF,CAAE,CAAC;EAEH,MAAMI,oBAAoB,GAAG,CAC5BvC,+BAAM,CAAE,0BAA0B,CAAE,EACpCiC,cAAc,CACd;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA,EAAC/F,sBAAA,CAAAiB,OAAQ,CAAC+E,IAAI;IAACC,aAAa,EAAC,MAAM;IAACC,KAAK,EAAGL;EAAsB,CAAE,CAAC;AAEvE"}
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","_interopRequireWildcard","require","_reactNativeSafeAreaContext","_data","_reactNativeBridge","_store","_blockListContext","_droppingInsertionPoint","_interopRequireDefault","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","DroppingInsertionPoint","scroll","currentYPosition","isDragging","targetBlockIndex","getBlockOrder","isBlockBeingDragged","isDraggingBlocks","getPreviousBlockClientId","getNextBlockClientId","useSelect","blockEditorStore","blocksLayouts","findBlockLayoutByClientId","useBlockListContext","top","bottom","useSafeAreaInsets","height","useSafeAreaFrame","safeAreaOffset","maxHeight","styles","blockYPosition","useSharedValue","opacity","useAnimatedReaction","value","getSelectedBlockIndicatorPosition","positions","currentYPositionWithScroll","offsetY","midpoint","setIndicatorPosition","index","insertionPointIndex","order","isDraggingAnyBlocks","length","previousClientId","nextClientId","previousElement","current","nextElement","previousElementPosition","y","nextElementPosition","elementsPositions","Math","floor","nextPosition","withTiming","generateHapticFeedback","previous","runOnJS","animatedStyles","useAnimatedStyle","translationY","shouldHideIndicator","transform","translateY","insertionPointStyles","_react","createElement","View","pointerEvents","style"],"sources":["@wordpress/block-editor/src/components/block-draggable/dropping-insertion-point.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport Animated, {\n\tuseSharedValue,\n\tuseAnimatedStyle,\n\twithTiming,\n\tuseAnimatedReaction,\n\trunOnJS,\n} from 'react-native-reanimated';\nimport {\n\tuseSafeAreaInsets,\n\tuseSafeAreaFrame,\n} from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { generateHapticFeedback } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useBlockListContext } from '../block-list/block-list-context';\nimport styles from './dropping-insertion-point.scss';\n\n/**\n * Dropping zone indicator component.\n *\n * This component shows where a block can be dropped when it's being dragged.\n *\n * @param {Object} props Component props.\n * @param {Object} props.scroll Scroll offset object.\n * @param {Object} props.currentYPosition Current Y coordinate position when dragging.\n * @param {import('react-native-reanimated').SharedValue} props.isDragging Whether or not dragging has started.\n * @param {import('react-native-reanimated').SharedValue} props.targetBlockIndex Current block target index.\n *\n * @return {JSX.Element} The component to be rendered.\n */\nexport default function DroppingInsertionPoint( {\n\tscroll,\n\tcurrentYPosition,\n\tisDragging,\n\ttargetBlockIndex,\n} ) {\n\tconst {\n\t\tgetBlockOrder,\n\t\tisBlockBeingDragged,\n\t\tisDraggingBlocks,\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t} = useSelect( blockEditorStore );\n\n\tconst { blocksLayouts, findBlockLayoutByClientId } = useBlockListContext();\n\tconst { top, bottom } = useSafeAreaInsets();\n\tconst { height } = useSafeAreaFrame();\n\tconst safeAreaOffset = top + bottom;\n\tconst maxHeight =\n\t\theight -\n\t\t( safeAreaOffset + styles[ 'dropping-insertion-point' ].height );\n\n\tconst blockYPosition = useSharedValue( 0 );\n\tconst opacity = useSharedValue( 0 );\n\n\tuseAnimatedReaction(\n\t\t() => isDragging.value,\n\t\t( value ) => {\n\t\t\tif ( ! value ) {\n\t\t\t\topacity.value = 0;\n\t\t\t\tblockYPosition.value = 0;\n\t\t\t}\n\t\t}\n\t);\n\n\tfunction getSelectedBlockIndicatorPosition( positions ) {\n\t\tconst currentYPositionWithScroll =\n\t\t\tcurrentYPosition.value + scroll.offsetY.value;\n\t\tconst midpoint = ( positions.top + positions.bottom ) / 2;\n\n\t\treturn midpoint < currentYPositionWithScroll\n\t\t\t? positions.bottom\n\t\t\t: positions.top;\n\t}\n\n\tfunction setIndicatorPosition( index ) {\n\t\tconst insertionPointIndex = index;\n\t\tconst order = getBlockOrder();\n\t\tconst isDraggingAnyBlocks = isDraggingBlocks();\n\n\t\tif (\n\t\t\t! isDraggingAnyBlocks ||\n\t\t\tinsertionPointIndex === null ||\n\t\t\t! order.length\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet previousClientId = order[ insertionPointIndex - 1 ];\n\t\tlet nextClientId = order[ insertionPointIndex ];\n\n\t\twhile ( isBlockBeingDragged( previousClientId ) ) {\n\t\t\tpreviousClientId = getPreviousBlockClientId( previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( nextClientId ) ) {\n\t\t\tnextClientId = getNextBlockClientId( nextClientId );\n\t\t}\n\n\t\tconst previousElement = previousClientId\n\t\t\t? findBlockLayoutByClientId(\n\t\t\t\t\tblocksLayouts.current,\n\t\t\t\t\tpreviousClientId\n\t\t\t )\n\t\t\t: null;\n\t\tconst nextElement = nextClientId\n\t\t\t? findBlockLayoutByClientId( blocksLayouts.current, nextClientId )\n\t\t\t: null;\n\n\t\tconst previousElementPosition = previousElement\n\t\t\t? previousElement.y + previousElement.height\n\t\t\t: 0;\n\t\tconst nextElementPosition = nextElement ? nextElement.y : 0;\n\n\t\tconst elementsPositions = {\n\t\t\ttop: Math.floor(\n\t\t\t\tpreviousElement ? previousElementPosition : nextElementPosition\n\t\t\t),\n\t\t\tbottom: Math.floor(\n\t\t\t\tnextElement ? nextElementPosition : previousElementPosition\n\t\t\t),\n\t\t};\n\n\t\tconst nextPosition =\n\t\t\telementsPositions.top !== elementsPositions.bottom\n\t\t\t\t? getSelectedBlockIndicatorPosition( elementsPositions )\n\t\t\t\t: elementsPositions.top;\n\n\t\tif ( nextPosition && blockYPosition.value !== nextPosition ) {\n\t\t\topacity.value = 0;\n\t\t\tblockYPosition.value = nextPosition;\n\t\t\topacity.value = withTiming( 1 );\n\t\t\tgenerateHapticFeedback();\n\t\t}\n\t}\n\n\tuseAnimatedReaction(\n\t\t() => targetBlockIndex.value,\n\t\t( value, previous ) => {\n\t\t\tif ( value !== previous ) {\n\t\t\t\trunOnJS( setIndicatorPosition )( value );\n\t\t\t}\n\t\t}\n\t);\n\n\tconst animatedStyles = useAnimatedStyle( () => {\n\t\tconst translationY = blockYPosition.value - scroll.offsetY.value;\n\t\t// Prevents overflowing behind the header/footer\n\t\tconst shouldHideIndicator =\n\t\t\ttranslationY < 0 || translationY > maxHeight;\n\n\t\treturn {\n\t\t\topacity: shouldHideIndicator ? 0 : opacity.value,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: translationY,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t} );\n\n\tconst insertionPointStyles = [\n\t\tstyles[ 'dropping-insertion-point' ],\n\t\tanimatedStyles,\n\t];\n\n\treturn (\n\t\t<Animated.View pointerEvents=\"none\" style={ insertionPointStyles } />\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,sBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,2BAAA,GAAAD,OAAA;AAQA,IA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AE,EACpCiC,cAAc,CACd;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA,EAAC9F,sBAAA,CAAAgB,OAAQ,CAAC+E,IAAI;IAACC,aAAa,EAAC,MAAM;IAACC,KAAK,EAAGL;EAAsB,CAAE,CAAC;AAEvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_components","_data","_element","_compose","_draggableChip","_interopRequireDefault","_useScrollWhenDragging","_store","_useBlockRefs","_useBlockDropZone","BlockDraggable","appendToOwnerDocument","children","clientIds","cloneClassname","elementId","onDragStart","onDragEnd","fadeWhenDisabled","dragComponent","srcRootClientId","isDraggable","icon","visibleInserter","getBlockType","useSelect","select","canMoveBlocks","getBlockRootClientId","getBlockName","getBlockAttributes","isBlockInsertionPointVisible","blockEditorStore","_getBlockType","getActiveBlockVariation","blocksStore","rootClientId","blockName","variation","isDragging","useRef","startScrolling","scrollOnDragOver","stopScrolling","useScrollWhenDragging","getAllowedBlocks","getBlockNamesByClientId","startDraggingBlocks","stopDraggingBlocks","useDispatch","useEffect","current","blockRef","useBlockRef","editorRoot","closest","onDragOver","event","target","draggedBlockNames","targetClientId","getAttribute","allowedBlocks","targetBlockName","dropTargetValid","length","targetRootClientId","targetRootBlockName","rootAllowedBlocks","isDropTargetValid","window","document","body","classList","add","remove","throttledOnDragOver","throttle","addEventListener","removeEventListener","draggable","transferData","type","srcClientIds","_react","createElement","Draggable","__experimentalTransferDataType","requestAnimationFrame","__experimentalDragComponent","undefined","default","count","onDraggableStart","onDraggableEnd","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-draggable/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { Draggable } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { throttle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggableChip from './draggable-chip';\nimport useScrollWhenDragging from './use-scroll-when-dragging';\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';\nimport { isDropTargetValid } from '../use-block-drop-zone';\n\nconst BlockDraggable = ( {\n\tappendToOwnerDocument,\n\tchildren,\n\tclientIds,\n\tcloneClassname,\n\telementId,\n\tonDragStart,\n\tonDragEnd,\n\tfadeWhenDisabled = false,\n\tdragComponent,\n} ) => {\n\tconst {\n\t\tsrcRootClientId,\n\t\tisDraggable,\n\t\ticon,\n\t\tvisibleInserter,\n\t\tgetBlockType,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanMoveBlocks,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType: _getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\tconst blockName = getBlockName( clientIds[ 0 ] );\n\t\t\tconst variation = getActiveBlockVariation(\n\t\t\t\tblockName,\n\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tsrcRootClientId: rootClientId,\n\t\t\t\tisDraggable: canMoveBlocks( clientIds, rootClientId ),\n\t\t\t\ticon: variation?.icon || _getBlockType( blockName )?.icon,\n\t\t\t\tvisibleInserter: isBlockInsertionPointVisible(),\n\t\t\t\tgetBlockType: _getBlockType,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tconst isDragging = useRef( false );\n\tconst [ startScrolling, scrollOnDragOver, stopScrolling ] =\n\t\tuseScrollWhenDragging();\n\n\tconst { getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { startDraggingBlocks, stopDraggingBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// Stop dragging blocks if the block draggable is unmounted.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging.current ) {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\t// Find the root of the editor iframe.\n\tconst blockRef = useBlockRef( clientIds[ 0 ] );\n\tconst editorRoot = blockRef.current?.closest( 'body' );\n\n\t/*\n\t * Add a dragover event listener to the editor root to track the blocks being dragged over.\n\t * The listener has to be inside the editor iframe otherwise the target isn't accessible.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! editorRoot || ! fadeWhenDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onDragOver = ( event ) => {\n\t\t\tif ( ! event.target.closest( '[data-block]' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst draggedBlockNames = getBlockNamesByClientId( clientIds );\n\t\t\tconst targetClientId = event.target\n\t\t\t\t.closest( '[data-block]' )\n\t\t\t\t.getAttribute( 'data-block' );\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( targetClientId );\n\t\t\tconst targetBlockName = getBlockNamesByClientId( [\n\t\t\t\ttargetClientId,\n\t\t\t] )[ 0 ];\n\n\t\t\t/*\n\t\t\t * Check if the target is valid to drop in.\n\t\t\t * If the target's allowedBlocks is an empty array,\n\t\t\t * it isn't a container block, in which case we check\n\t\t\t * its parent's validity instead.\n\t\t\t */\n\t\t\tlet dropTargetValid;\n\t\t\tif ( allowedBlocks?.length === 0 ) {\n\t\t\t\tconst targetRootClientId =\n\t\t\t\t\tgetBlockRootClientId( targetClientId );\n\t\t\t\tconst targetRootBlockName = getBlockNamesByClientId( [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t] )[ 0 ];\n\t\t\t\tconst rootAllowedBlocks =\n\t\t\t\t\tgetAllowedBlocks( targetRootClientId );\n\t\t\t\tdropTargetValid = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\trootAllowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetRootBlockName\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdropTargetValid = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\tallowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetBlockName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Update the body class to reflect if drop target is valid.\n\t\t\t * This has to be done on the document body because the draggable\n\t\t\t * chip is rendered outside of the editor iframe.\n\t\t\t */\n\t\t\tif ( ! dropTargetValid && ! visibleInserter ) {\n\t\t\t\twindow?.document?.body?.classList?.add(\n\t\t\t\t\t'block-draggable-invalid-drag-token'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\twindow?.document?.body?.classList?.remove(\n\t\t\t\t\t'block-draggable-invalid-drag-token'\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst throttledOnDragOver = throttle( onDragOver, 200 );\n\n\t\teditorRoot.addEventListener( 'dragover', throttledOnDragOver );\n\n\t\treturn () => {\n\t\t\teditorRoot.removeEventListener( 'dragover', throttledOnDragOver );\n\t\t};\n\t}, [\n\t\tclientIds,\n\t\teditorRoot,\n\t\tfadeWhenDisabled,\n\t\tgetAllowedBlocks,\n\t\tgetBlockNamesByClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockType,\n\t\tvisibleInserter,\n\t] );\n\n\tif ( ! isDraggable ) {\n\t\treturn children( { draggable: false } );\n\t}\n\n\tconst transferData = {\n\t\ttype: 'block',\n\t\tsrcClientIds: clientIds,\n\t\tsrcRootClientId,\n\t};\n\n\treturn (\n\t\t<Draggable\n\t\t\tappendToOwnerDocument={ appendToOwnerDocument }\n\t\t\tcloneClassname={ cloneClassname }\n\t\t\t__experimentalTransferDataType=\"wp-blocks\"\n\t\t\ttransferData={ transferData }\n\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t// Defer hiding the dragged source element to the next\n\t\t\t\t// frame to enable dragging.\n\t\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\t\tstartDraggingBlocks( clientIds );\n\t\t\t\t\tisDragging.current = true;\n\n\t\t\t\t\tstartScrolling( event );\n\n\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\tonDragStart();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonDragOver={ scrollOnDragOver }\n\t\t\tonDragEnd={ () => {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t\tisDragging.current = false;\n\n\t\t\t\tstopScrolling();\n\n\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\tonDragEnd();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t__experimentalDragComponent={\n\t\t\t\t// Check against `undefined` so that `null` can be used to disable\n\t\t\t\t// the default drag component.\n\t\t\t\tdragComponent !== undefined ? (\n\t\t\t\t\tdragComponent\n\t\t\t\t) : (\n\t\t\t\t\t<BlockDraggableChip\n\t\t\t\t\t\tcount={ clientIds.length }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tfadeWhenDisabled\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\telementId={ elementId }\n\t\t>\n\t\t\t{ ( { onDraggableStart, onDraggableEnd } ) => {\n\t\t\t\treturn children( {\n\t\t\t\t\tdraggable: true,\n\t\t\t\t\tonDragStart: onDraggableStart,\n\t\t\t\t\tonDragEnd: onDraggableEnd,\n\t\t\t\t} );\n\t\t\t} }\n\t\t</Draggable>\n\t);\n};\n\nexport default BlockDraggable;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,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E6E;IACZ,CAAE,CAAC;EACJ,CACU,CAAC;AAEd,CAAC;AAAC,IAAAC,QAAA,GAEarF,cAAc;AAAAsF,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_components","_data","_element","_compose","_draggableChip","_interopRequireDefault","_useScrollWhenDragging","_store","_useBlockRefs","_useBlockDropZone","BlockDraggable","appendToOwnerDocument","children","clientIds","cloneClassname","elementId","onDragStart","onDragEnd","fadeWhenDisabled","dragComponent","srcRootClientId","isDraggable","icon","visibleInserter","getBlockType","useSelect","select","canMoveBlocks","getBlockRootClientId","getBlockName","getBlockAttributes","isBlockInsertionPointVisible","blockEditorStore","_getBlockType","getActiveBlockVariation","blocksStore","rootClientId","blockName","variation","isDragging","useRef","startScrolling","scrollOnDragOver","stopScrolling","useScrollWhenDragging","getAllowedBlocks","getBlockNamesByClientId","startDraggingBlocks","stopDraggingBlocks","useDispatch","useEffect","current","blockRef","useBlockRef","editorRoot","closest","onDragOver","event","target","draggedBlockNames","targetClientId","getAttribute","allowedBlocks","targetBlockName","dropTargetValid","length","targetRootClientId","targetRootBlockName","rootAllowedBlocks","isDropTargetValid","window","document","body","classList","add","remove","throttledOnDragOver","throttle","addEventListener","removeEventListener","draggable","transferData","type","srcClientIds","_react","createElement","Draggable","__experimentalTransferDataType","requestAnimationFrame","__experimentalDragComponent","undefined","default","count","onDraggableStart","onDraggableEnd","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-draggable/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { Draggable } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { throttle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggableChip from './draggable-chip';\nimport useScrollWhenDragging from './use-scroll-when-dragging';\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';\nimport { isDropTargetValid } from '../use-block-drop-zone';\n\nconst BlockDraggable = ( {\n\tappendToOwnerDocument,\n\tchildren,\n\tclientIds,\n\tcloneClassname,\n\telementId,\n\tonDragStart,\n\tonDragEnd,\n\tfadeWhenDisabled = false,\n\tdragComponent,\n} ) => {\n\tconst {\n\t\tsrcRootClientId,\n\t\tisDraggable,\n\t\ticon,\n\t\tvisibleInserter,\n\t\tgetBlockType,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanMoveBlocks,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType: _getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\tconst blockName = getBlockName( clientIds[ 0 ] );\n\t\t\tconst variation = getActiveBlockVariation(\n\t\t\t\tblockName,\n\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tsrcRootClientId: rootClientId,\n\t\t\t\tisDraggable: canMoveBlocks( clientIds, rootClientId ),\n\t\t\t\ticon: variation?.icon || _getBlockType( blockName )?.icon,\n\t\t\t\tvisibleInserter: isBlockInsertionPointVisible(),\n\t\t\t\tgetBlockType: _getBlockType,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tconst isDragging = useRef( false );\n\tconst [ startScrolling, scrollOnDragOver, stopScrolling ] =\n\t\tuseScrollWhenDragging();\n\n\tconst { getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { startDraggingBlocks, stopDraggingBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// Stop dragging blocks if the block draggable is unmounted.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging.current ) {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\t// Find the root of the editor iframe.\n\tconst blockRef = useBlockRef( clientIds[ 0 ] );\n\tconst editorRoot = blockRef.current?.closest( 'body' );\n\n\t/*\n\t * Add a dragover event listener to the editor root to track the blocks being dragged over.\n\t * The listener has to be inside the editor iframe otherwise the target isn't accessible.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! editorRoot || ! fadeWhenDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onDragOver = ( event ) => {\n\t\t\tif ( ! event.target.closest( '[data-block]' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst draggedBlockNames = getBlockNamesByClientId( clientIds );\n\t\t\tconst targetClientId = event.target\n\t\t\t\t.closest( '[data-block]' )\n\t\t\t\t.getAttribute( 'data-block' );\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( targetClientId );\n\t\t\tconst targetBlockName = getBlockNamesByClientId( [\n\t\t\t\ttargetClientId,\n\t\t\t] )[ 0 ];\n\n\t\t\t/*\n\t\t\t * Check if the target is valid to drop in.\n\t\t\t * If the target's allowedBlocks is an empty array,\n\t\t\t * it isn't a container block, in which case we check\n\t\t\t * its parent's validity instead.\n\t\t\t */\n\t\t\tlet dropTargetValid;\n\t\t\tif ( allowedBlocks?.length === 0 ) {\n\t\t\t\tconst targetRootClientId =\n\t\t\t\t\tgetBlockRootClientId( targetClientId );\n\t\t\t\tconst targetRootBlockName = getBlockNamesByClientId( [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t] )[ 0 ];\n\t\t\t\tconst rootAllowedBlocks =\n\t\t\t\t\tgetAllowedBlocks( targetRootClientId );\n\t\t\t\tdropTargetValid = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\trootAllowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetRootBlockName\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdropTargetValid = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\tallowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetBlockName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Update the body class to reflect if drop target is valid.\n\t\t\t * This has to be done on the document body because the draggable\n\t\t\t * chip is rendered outside of the editor iframe.\n\t\t\t */\n\t\t\tif ( ! dropTargetValid && ! visibleInserter ) {\n\t\t\t\twindow?.document?.body?.classList?.add(\n\t\t\t\t\t'block-draggable-invalid-drag-token'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\twindow?.document?.body?.classList?.remove(\n\t\t\t\t\t'block-draggable-invalid-drag-token'\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst throttledOnDragOver = throttle( onDragOver, 200 );\n\n\t\teditorRoot.addEventListener( 'dragover', throttledOnDragOver );\n\n\t\treturn () => {\n\t\t\teditorRoot.removeEventListener( 'dragover', throttledOnDragOver );\n\t\t};\n\t}, [\n\t\tclientIds,\n\t\teditorRoot,\n\t\tfadeWhenDisabled,\n\t\tgetAllowedBlocks,\n\t\tgetBlockNamesByClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockType,\n\t\tvisibleInserter,\n\t] );\n\n\tif ( ! isDraggable ) {\n\t\treturn children( { draggable: false } );\n\t}\n\n\tconst transferData = {\n\t\ttype: 'block',\n\t\tsrcClientIds: clientIds,\n\t\tsrcRootClientId,\n\t};\n\n\treturn (\n\t\t<Draggable\n\t\t\tappendToOwnerDocument={ appendToOwnerDocument }\n\t\t\tcloneClassname={ cloneClassname }\n\t\t\t__experimentalTransferDataType=\"wp-blocks\"\n\t\t\ttransferData={ transferData }\n\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t// Defer hiding the dragged source element to the next\n\t\t\t\t// frame to enable dragging.\n\t\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\t\tstartDraggingBlocks( clientIds );\n\t\t\t\t\tisDragging.current = true;\n\n\t\t\t\t\tstartScrolling( event );\n\n\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\tonDragStart();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonDragOver={ scrollOnDragOver }\n\t\t\tonDragEnd={ () => {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t\tisDragging.current = false;\n\n\t\t\t\tstopScrolling();\n\n\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\tonDragEnd();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t__experimentalDragComponent={\n\t\t\t\t// Check against `undefined` so that `null` can be used to disable\n\t\t\t\t// the default drag component.\n\t\t\t\tdragComponent !== undefined ? (\n\t\t\t\t\tdragComponent\n\t\t\t\t) : (\n\t\t\t\t\t<BlockDraggableChip\n\t\t\t\t\t\tcount={ clientIds.length }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tfadeWhenDisabled\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\telementId={ elementId }\n\t\t>\n\t\t\t{ ( { onDraggableStart, onDraggableEnd } ) => {\n\t\t\t\treturn children( {\n\t\t\t\t\tdraggable: true,\n\t\t\t\t\tonDragStart: onDraggableStart,\n\t\t\t\t\tonDragEnd: onDraggableEnd,\n\t\t\t\t} );\n\t\t\t} }\n\t\t</Draggable>\n\t);\n};\n\nexport default BlockDraggable;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,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GAAAC,OAAA,CAAAL,OAAA,GAEajF,cAAc"}
|
|
@@ -21,8 +21,8 @@ var _store = require("../../store");
|
|
|
21
21
|
var _droppingInsertionPoint = _interopRequireDefault(require("./dropping-insertion-point"));
|
|
22
22
|
var _useBlockDropZone = _interopRequireDefault(require("../use-block-drop-zone"));
|
|
23
23
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
26
|
/**
|
|
27
27
|
* External dependencies
|
|
28
28
|
*/
|
|
@@ -421,6 +421,5 @@ const BlockDraggable = ({
|
|
|
421
421
|
isDraggable: true
|
|
422
422
|
})));
|
|
423
423
|
};
|
|
424
|
-
var _default = BlockDraggable;
|
|
425
|
-
exports.default = _default;
|
|
424
|
+
var _default = exports.default = BlockDraggable;
|
|
426
425
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_reactNativeSafeAreaContext","_reactNativeReanimated","_interopRequireWildcard","_components","_data","_element","_blocks","_reactNativeBridge","_reactNativeAztec","_interopRequireDefault","_useScrollWhenDragging","_draggableChip","_store","_droppingInsertionPoint","_useBlockDropZone","_style","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CHIP_OFFSET_TO_TOUCH_POSITION","BLOCK_OPACITY_ANIMATION_CONFIG","duration","BLOCK_OPACITY_ANIMATION_DELAY","DEFAULT_LONG_PRESS_MIN_DURATION","DEFAULT_IOS_LONG_PRESS_MIN_DURATION","BlockDraggableWrapper","children","isRTL","draggedBlockIcon","setDraggedBlockIcon","useState","selectBlock","startDraggingBlocks","stopDraggingBlocks","useDispatch","blockEditorStore","left","right","useSafeAreaInsets","width","useSafeAreaFrame","safeAreaOffset","contentWidth","scroll","offsetY","useSharedValue","chip","x","y","height","currentYPosition","isDragging","startScrolling","scrollOnDragOver","stopScrolling","draggingScrollHandler","useScrollWhenDragging","scrollHandler","event","contentOffset","value","onBlockDragOverWorklet","onBlockDragEnd","onBlockDrop","targetBlockIndex","useBlockDropZone","useEffect","setDraggedBlockIconByClientId","clientId","blockName","select","getBlockName","blockIcon","getBlockType","icon","onStartDragging","position","runOnUI","generateHapticFeedback","stopDragging","onStopDragging","srcRootClientId","srcClientIds","type","undefined","onChipLayout","nativeEvent","layout","startDragging","id","dragPosition","runOnJS","updateDragging","chipDynamicStyles","useAnimatedStyle","chipOffset","translateX","transform","translateY","chipStyles","styles","exitingAnimation","currentHeight","currentWidth","animations","withTiming","scale","initialValues","_react","createElement","Fragment","Draggable","onDragStart","onDragOver","onDragEnd","testID","onScroll","View","onLayout","style","pointerEvents","entering","ZoomInEasyDown","exiting","exports","useIsScreenReaderEnabled","isScreenReaderEnabled","setIsScreenReaderEnabled","mounted","changeListener","AccessibilityInfo","addEventListener","enabled","then","screenReaderEnabled","remove","useIsEditingText","isEditingText","setIsEditingText","RCTAztecView","InputState","isFocused","onFocusChangeAztec","addFocusChangeListener","removeFocusChangeListener","BlockDraggable","draggingClientId","wasBeingDragged","useRef","draggingAnimation","opacity","startDraggingBlock","stopDraggingBlock","withDelay","isDraggable","isBeingDragged","isBlockSelected","useSelect","_select","getBlockRootClientId","getTemplateLock","isBlockBeingDragged","getSelectedBlockClientId","rootClientId","templateLock","selectedBlockClientId","current","onLongPressDraggable","useCallback","blurCurrentFocusedElement","animatedWrapperStyles","wrapperStyles","canDragBlock","DraggableTrigger","minDuration","Platform","ios","android","onLongPress","_default"],"sources":["@wordpress/block-editor/src/components/block-draggable/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo } from 'react-native';\nimport {\n\tuseSafeAreaInsets,\n\tuseSafeAreaFrame,\n} from 'react-native-safe-area-context';\nimport Animated, {\n\trunOnJS,\n\trunOnUI,\n\tuseAnimatedStyle,\n\tuseSharedValue,\n\twithDelay,\n\twithTiming,\n\tZoomInEasyDown,\n} from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { Draggable, DraggableTrigger } from '@wordpress/components';\nimport { select, useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tPlatform,\n} from '@wordpress/element';\nimport { getBlockType } from '@wordpress/blocks';\nimport { generateHapticFeedback } from '@wordpress/react-native-bridge';\nimport RCTAztecView from '@wordpress/react-native-aztec';\n\n/**\n * Internal dependencies\n */\nimport useScrollWhenDragging from './use-scroll-when-dragging';\nimport DraggableChip from './draggable-chip';\nimport { store as blockEditorStore } from '../../store';\nimport DroppingInsertionPoint from './dropping-insertion-point';\nimport useBlockDropZone from '../use-block-drop-zone';\nimport styles from './style.scss';\n\nconst CHIP_OFFSET_TO_TOUCH_POSITION = 32;\nconst BLOCK_OPACITY_ANIMATION_CONFIG = { duration: 350 };\nconst BLOCK_OPACITY_ANIMATION_DELAY = 250;\nconst DEFAULT_LONG_PRESS_MIN_DURATION = 500;\nconst DEFAULT_IOS_LONG_PRESS_MIN_DURATION =\n\tDEFAULT_LONG_PRESS_MIN_DURATION - 50;\n\n/**\n * Block draggable wrapper component\n *\n * This component handles all the interactions for dragging blocks.\n * It relies on the block list and its context for dragging, hence it\n * should be rendered between the `BlockListProvider` component and the\n * block list rendering. It also requires listening to scroll events,\n * therefore for this purpose, it returns the `onScroll` event handler\n * that should be attached to the list that renders the blocks.\n *\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {boolean} props.isRTL Check if current locale is RTL.\n *\n * @return {Function} Render function that passes `onScroll` event handler.\n */\nconst BlockDraggableWrapper = ( { children, isRTL } ) => {\n\tconst [ draggedBlockIcon, setDraggedBlockIcon ] = useState();\n\n\tconst { selectBlock, startDraggingBlocks, stopDraggingBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { left, right } = useSafeAreaInsets();\n\tconst { width } = useSafeAreaFrame();\n\tconst safeAreaOffset = left + right;\n\tconst contentWidth = width - safeAreaOffset;\n\n\tconst scroll = {\n\t\toffsetY: useSharedValue( 0 ),\n\t};\n\tconst chip = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t\twidth: useSharedValue( 0 ),\n\t\theight: useSharedValue( 0 ),\n\t};\n\tconst currentYPosition = useSharedValue( 0 );\n\tconst isDragging = useSharedValue( false );\n\n\tconst [\n\t\tstartScrolling,\n\t\tscrollOnDragOver,\n\t\tstopScrolling,\n\t\tdraggingScrollHandler,\n\t] = useScrollWhenDragging();\n\n\tconst scrollHandler = ( event ) => {\n\t\t'worklet';\n\t\tconst { contentOffset } = event;\n\t\tscroll.offsetY.value = contentOffset.y;\n\n\t\tdraggingScrollHandler( event );\n\t};\n\n\tconst {\n\t\tonBlockDragOverWorklet,\n\t\tonBlockDragEnd,\n\t\tonBlockDrop,\n\t\ttargetBlockIndex,\n\t} = useBlockDropZone();\n\n\t// Stop dragging blocks if the block draggable is unmounted.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging.value ) {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tconst setDraggedBlockIconByClientId = ( clientId ) => {\n\t\tconst blockName = select( blockEditorStore ).getBlockName( clientId );\n\t\tconst blockIcon = getBlockType( blockName )?.icon;\n\t\tif ( blockIcon ) {\n\t\t\tsetDraggedBlockIcon( blockIcon );\n\t\t}\n\t};\n\n\tconst onStartDragging = ( { clientId, position } ) => {\n\t\tif ( clientId ) {\n\t\t\tstartDraggingBlocks( [ clientId ] );\n\t\t\tsetDraggedBlockIconByClientId( clientId );\n\t\t\trunOnUI( startScrolling )( position.y );\n\t\t\tgenerateHapticFeedback();\n\t\t} else {\n\t\t\t// We stop dragging if no block is found.\n\t\t\trunOnUI( stopDragging )();\n\t\t}\n\t};\n\n\tconst onStopDragging = ( { clientId } ) => {\n\t\tif ( clientId ) {\n\t\t\tonBlockDrop( {\n\t\t\t\t// Dropping is only allowed at root level\n\t\t\t\tsrcRootClientId: '',\n\t\t\t\tsrcClientIds: [ clientId ],\n\t\t\t\ttype: 'block',\n\t\t\t} );\n\t\t\tselectBlock( clientId );\n\t\t\tsetDraggedBlockIcon( undefined );\n\t\t}\n\t\tonBlockDragEnd();\n\t\tstopDraggingBlocks();\n\t};\n\n\tconst onChipLayout = ( { nativeEvent: { layout } } ) => {\n\t\tif ( layout.width > 0 ) {\n\t\t\tchip.width.value = layout.width;\n\t\t}\n\t\tif ( layout.height > 0 ) {\n\t\t\tchip.height.value = layout.height;\n\t\t}\n\t};\n\n\tconst startDragging = ( { x, y, id } ) => {\n\t\t'worklet';\n\t\tconst dragPosition = { x, y };\n\t\tchip.x.value = dragPosition.x;\n\t\tchip.y.value = dragPosition.y;\n\t\tcurrentYPosition.value = dragPosition.y;\n\n\t\tisDragging.value = true;\n\n\t\trunOnJS( onStartDragging )( { clientId: id, position: dragPosition } );\n\t};\n\n\tconst updateDragging = ( { x, y } ) => {\n\t\t'worklet';\n\t\tconst dragPosition = { x, y };\n\t\tchip.x.value = dragPosition.x;\n\t\tchip.y.value = dragPosition.y;\n\t\tcurrentYPosition.value = dragPosition.y;\n\n\t\tonBlockDragOverWorklet( { x, y: y + scroll.offsetY.value } );\n\n\t\t// Update scrolling velocity\n\t\tscrollOnDragOver( dragPosition.y );\n\t};\n\n\tconst stopDragging = ( { id } ) => {\n\t\t'worklet';\n\t\tisDragging.value = false;\n\n\t\tstopScrolling();\n\t\trunOnJS( onStopDragging )( { clientId: id } );\n\t};\n\n\tconst chipDynamicStyles = useAnimatedStyle( () => {\n\t\tconst chipOffset = chip.width.value / 2;\n\t\tconst translateX = ! isRTL\n\t\t\t? chip.x.value - chipOffset\n\t\t\t: -( contentWidth - ( chip.x.value + chipOffset ) );\n\n\t\treturn {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateX,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttranslateY:\n\t\t\t\t\t\tchip.y.value -\n\t\t\t\t\t\tchip.height.value -\n\t\t\t\t\t\tCHIP_OFFSET_TO_TOUCH_POSITION,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t} );\n\tconst chipStyles = [\n\t\tchipDynamicStyles,\n\t\tstyles[ 'draggable-chip__wrapper' ],\n\t];\n\n\tconst exitingAnimation = ( { currentHeight, currentWidth } ) => {\n\t\t'worklet';\n\t\tconst translateX = ! isRTL ? 0 : currentWidth * -1;\n\t\tconst duration = 150;\n\t\tconst animations = {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: withTiming( currentHeight, {\n\t\t\t\t\t\tduration,\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttranslateX: withTiming( translateX, {\n\t\t\t\t\t\tduration,\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t\t{ scale: withTiming( 0, { duration } ) },\n\t\t\t],\n\t\t};\n\t\tconst initialValues = {\n\t\t\ttransform: [ { translateY: 0 }, { translateX }, { scale: 1 } ],\n\t\t};\n\t\treturn {\n\t\t\tinitialValues,\n\t\t\tanimations,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DroppingInsertionPoint\n\t\t\t\tscroll={ scroll }\n\t\t\t\tcurrentYPosition={ currentYPosition }\n\t\t\t\tisDragging={ isDragging }\n\t\t\t\ttargetBlockIndex={ targetBlockIndex }\n\t\t\t/>\n\t\t\t<Draggable\n\t\t\t\tonDragStart={ startDragging }\n\t\t\t\tonDragOver={ updateDragging }\n\t\t\t\tonDragEnd={ stopDragging }\n\t\t\t\ttestID=\"block-draggable-wrapper\"\n\t\t\t>\n\t\t\t\t{ children( { onScroll: scrollHandler } ) }\n\t\t\t</Draggable>\n\t\t\t<Animated.View\n\t\t\t\tonLayout={ onChipLayout }\n\t\t\t\tstyle={ chipStyles }\n\t\t\t\tpointerEvents=\"none\"\n\t\t\t>\n\t\t\t\t{ draggedBlockIcon && (\n\t\t\t\t\t<Animated.View\n\t\t\t\t\t\tentering={ ZoomInEasyDown.duration( 200 ) }\n\t\t\t\t\t\texiting={ exitingAnimation }\n\t\t\t\t\t>\n\t\t\t\t\t\t<DraggableChip icon={ draggedBlockIcon } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t) }\n\t\t\t</Animated.View>\n\t\t</>\n\t);\n};\n\nfunction useIsScreenReaderEnabled() {\n\tconst [ isScreenReaderEnabled, setIsScreenReaderEnabled ] =\n\t\tuseState( false );\n\n\tuseEffect( () => {\n\t\tlet mounted = true;\n\n\t\tconst changeListener = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\t( enabled ) => setIsScreenReaderEnabled( enabled )\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( screenReaderEnabled ) => {\n\t\t\t\tif ( mounted && screenReaderEnabled ) {\n\t\t\t\t\tsetIsScreenReaderEnabled( screenReaderEnabled );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tmounted = false;\n\n\t\t\tchangeListener.remove();\n\t\t};\n\t}, [] );\n\n\treturn isScreenReaderEnabled;\n}\n\nfunction useIsEditingText() {\n\tconst [ isEditingText, setIsEditingText ] = useState( () =>\n\t\tRCTAztecView.InputState.isFocused()\n\t);\n\n\tuseEffect( () => {\n\t\tconst onFocusChangeAztec = ( { isFocused } ) => {\n\t\t\tsetIsEditingText( isFocused );\n\t\t};\n\n\t\tRCTAztecView.InputState.addFocusChangeListener( onFocusChangeAztec );\n\n\t\treturn () => {\n\t\t\tRCTAztecView.InputState.removeFocusChangeListener(\n\t\t\t\tonFocusChangeAztec\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\treturn isEditingText;\n}\n\n/**\n * Block draggable component\n *\n * This component serves for animating the block when it is being dragged.\n * Hence, it should be wrapped around the rendering of a block.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {string} props.clientId Client id of the block.\n * @param {string} [props.draggingClientId] Client id to use for dragging. If not defined, the value from `clientId` will be used.\n * @param {boolean} [props.enabled] Enables the draggable trigger.\n * @param {string} [props.testID] Id used for querying the long-press gesture handler in tests.\n *\n * @return {Function} Render function which includes the parameter `isDraggable` to determine if the block can be dragged.\n */\nconst BlockDraggable = ( {\n\tclientId,\n\tchildren,\n\tdraggingClientId,\n\tenabled = true,\n\ttestID,\n} ) => {\n\tconst wasBeingDragged = useRef( false );\n\tconst isEditingText = useIsEditingText();\n\tconst isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n\tconst draggingAnimation = {\n\t\topacity: useSharedValue( 1 ),\n\t};\n\n\tconst startDraggingBlock = () => {\n\t\tdraggingAnimation.opacity.value = withTiming(\n\t\t\t0.4,\n\t\t\tBLOCK_OPACITY_ANIMATION_CONFIG\n\t\t);\n\t};\n\n\tconst stopDraggingBlock = () => {\n\t\tdraggingAnimation.opacity.value = withDelay(\n\t\t\tBLOCK_OPACITY_ANIMATION_DELAY,\n\t\t\twithTiming( 1, BLOCK_OPACITY_ANIMATION_CONFIG )\n\t\t);\n\t};\n\n\tconst { isDraggable, isBeingDragged, isBlockSelected } = useSelect(\n\t\t( _select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tisBlockBeingDragged,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t} = _select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst templateLock = rootClientId\n\t\t\t\t? getTemplateLock( rootClientId )\n\t\t\t\t: null;\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\treturn {\n\t\t\t\tisBeingDragged: isBlockBeingDragged( clientId ),\n\t\t\t\tisDraggable: 'all' !== templateLock,\n\t\t\t\tisBlockSelected:\n\t\t\t\t\tselectedBlockClientId && selectedBlockClientId === clientId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( isBeingDragged !== wasBeingDragged.current ) {\n\t\t\tif ( isBeingDragged ) {\n\t\t\t\tstartDraggingBlock();\n\t\t\t} else {\n\t\t\t\tstopDraggingBlock();\n\t\t\t}\n\t\t}\n\t\twasBeingDragged.current = isBeingDragged;\n\t}, [ isBeingDragged ] );\n\n\tconst onLongPressDraggable = useCallback( () => {\n\t\t// Ensure that no text input is focused when starting the dragging gesture in order to prevent conflicts with text editing.\n\t\tRCTAztecView.InputState.blurCurrentFocusedElement();\n\t}, [] );\n\n\tconst animatedWrapperStyles = useAnimatedStyle( () => {\n\t\treturn {\n\t\t\topacity: draggingAnimation.opacity.value,\n\t\t};\n\t} );\n\tconst wrapperStyles = [\n\t\tanimatedWrapperStyles,\n\t\tstyles[ 'draggable-wrapper__container' ],\n\t];\n\n\tconst canDragBlock =\n\t\tenabled &&\n\t\t! isScreenReaderEnabled &&\n\t\t( ! isBlockSelected || ! isEditingText );\n\n\tif ( ! isDraggable ) {\n\t\treturn children( { isDraggable: false } );\n\t}\n\n\treturn (\n\t\t<DraggableTrigger\n\t\t\tid={ draggingClientId || clientId }\n\t\t\tenabled={ enabled && canDragBlock }\n\t\t\tminDuration={ Platform.select( {\n\t\t\t\t// On iOS, using a lower min duration than the default\n\t\t\t\t// value prevents the long-press gesture from being\n\t\t\t\t// triggered in underneath elements. This is required to\n\t\t\t\t// prevent enabling text editing when dragging is available.\n\t\t\t\tios: canDragBlock\n\t\t\t\t\t? DEFAULT_IOS_LONG_PRESS_MIN_DURATION\n\t\t\t\t\t: DEFAULT_LONG_PRESS_MIN_DURATION,\n\t\t\t\tandroid: DEFAULT_LONG_PRESS_MIN_DURATION,\n\t\t\t} ) }\n\t\t\tonLongPress={ onLongPressDraggable }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<Animated.View style={ wrapperStyles }>\n\t\t\t\t{ children( { isDraggable: true } ) }\n\t\t\t</Animated.View>\n\t\t</DraggableTrigger>\n\t);\n};\n\nexport { BlockDraggableWrapper };\nexport default BlockDraggable;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AAIA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAaA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAOA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAC,sBAAA,CAAAV,OAAA;AAKA,IAAAW,sBAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,cAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,uBAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,iBAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,MAAA,GAAAN,sBAAA,CAAAV,OAAA;AAAkC,SAAAiB,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD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ACjBxC,OAAO,IACP,CAAEN,qBAAqB,KACrB,CAAE8B,eAAe,IAAI,CAAEnB,aAAa,CAAE;EAEzC,IAAK,CAAEiB,WAAW,EAAG;IACpB,OAAOhI,QAAQ,CAAE;MAAEgI,WAAW,EAAE;IAAM,CAAE,CAAC;EAC1C;EAEA,OACC,IAAA9C,MAAA,CAAAC,aAAA,EAAC7H,WAAA,CAAA6L,gBAAgB;IAChBpF,EAAE,EAAGyD,gBAAgB,IAAI9E,QAAU;IACnCgE,OAAO,EAAGA,OAAO,IAAIwC,YAAc;IACnCE,WAAW,EAAGC,iBAAQ,CAACzG,MAAM,CAAE;MAC9B;MACA;MACA;MACA;MACA0G,GAAG,EAAEJ,YAAY,GACdpJ,mCAAmC,GACnCD,+BAA+B;MAClC0J,OAAO,EAAE1J;IACV,CAAE,CAAG;IACL2J,WAAW,EAAGX,oBAAsB;IACpCpD,MAAM,EAAGA;EAAQ,GAEjB,IAAAP,MAAA,CAAAC,aAAA,EAAC/H,sBAAA,CAAAsB,OAAQ,CAACiH,IAAI;IAACE,KAAK,EAAGoD;EAAe,GACnCjJ,QAAQ,CAAE;IAAEgI,WAAW,EAAE;EAAK,CAAE,CACpB,CACE,CAAC;AAErB,CAAC;AAAC,IAAAyB,QAAA,GAGalC,cAAc;AAAArB,OAAA,CAAAxH,OAAA,GAAA+K,QAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeSafeAreaContext","_reactNativeReanimated","_interopRequireWildcard","_components","_data","_element","_blocks","_reactNativeBridge","_reactNativeAztec","_interopRequireDefault","_useScrollWhenDragging","_draggableChip","_store","_droppingInsertionPoint","_useBlockDropZone","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","CHIP_OFFSET_TO_TOUCH_POSITION","BLOCK_OPACITY_ANIMATION_CONFIG","duration","BLOCK_OPACITY_ANIMATION_DELAY","DEFAULT_LONG_PRESS_MIN_DURATION","DEFAULT_IOS_LONG_PRESS_MIN_DURATION","BlockDraggableWrapper","children","isRTL","draggedBlockIcon","setDraggedBlockIcon","useState","selectBlock","startDraggingBlocks","stopDraggingBlocks","useDispatch","blockEditorStore","left","right","useSafeAreaInsets","width","useSafeAreaFrame","safeAreaOffset","contentWidth","scroll","offsetY","useSharedValue","chip","x","y","height","currentYPosition","isDragging","startScrolling","scrollOnDragOver","stopScrolling","draggingScrollHandler","useScrollWhenDragging","scrollHandler","event","contentOffset","value","onBlockDragOverWorklet","onBlockDragEnd","onBlockDrop","targetBlockIndex","useBlockDropZone","useEffect","setDraggedBlockIconByClientId","clientId","blockName","select","getBlockName","blockIcon","getBlockType","icon","onStartDragging","position","runOnUI","generateHapticFeedback","stopDragging","onStopDragging","srcRootClientId","srcClientIds","type","undefined","onChipLayout","nativeEvent","layout","startDragging","id","dragPosition","runOnJS","updateDragging","chipDynamicStyles","useAnimatedStyle","chipOffset","translateX","transform","translateY","chipStyles","styles","exitingAnimation","currentHeight","currentWidth","animations","withTiming","scale","initialValues","_react","createElement","Fragment","Draggable","onDragStart","onDragOver","onDragEnd","testID","onScroll","View","onLayout","style","pointerEvents","entering","ZoomInEasyDown","exiting","exports","useIsScreenReaderEnabled","isScreenReaderEnabled","setIsScreenReaderEnabled","mounted","changeListener","AccessibilityInfo","addEventListener","enabled","then","screenReaderEnabled","remove","useIsEditingText","isEditingText","setIsEditingText","RCTAztecView","InputState","isFocused","onFocusChangeAztec","addFocusChangeListener","removeFocusChangeListener","BlockDraggable","draggingClientId","wasBeingDragged","useRef","draggingAnimation","opacity","startDraggingBlock","stopDraggingBlock","withDelay","isDraggable","isBeingDragged","isBlockSelected","useSelect","_select","getBlockRootClientId","getTemplateLock","isBlockBeingDragged","getSelectedBlockClientId","rootClientId","templateLock","selectedBlockClientId","current","onLongPressDraggable","useCallback","blurCurrentFocusedElement","animatedWrapperStyles","wrapperStyles","canDragBlock","DraggableTrigger","minDuration","Platform","ios","android","onLongPress","_default"],"sources":["@wordpress/block-editor/src/components/block-draggable/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo } from 'react-native';\nimport {\n\tuseSafeAreaInsets,\n\tuseSafeAreaFrame,\n} from 'react-native-safe-area-context';\nimport Animated, {\n\trunOnJS,\n\trunOnUI,\n\tuseAnimatedStyle,\n\tuseSharedValue,\n\twithDelay,\n\twithTiming,\n\tZoomInEasyDown,\n} from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { Draggable, DraggableTrigger } from '@wordpress/components';\nimport { select, useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tPlatform,\n} from '@wordpress/element';\nimport { getBlockType } from '@wordpress/blocks';\nimport { generateHapticFeedback } from '@wordpress/react-native-bridge';\nimport RCTAztecView from '@wordpress/react-native-aztec';\n\n/**\n * Internal dependencies\n */\nimport useScrollWhenDragging from './use-scroll-when-dragging';\nimport DraggableChip from './draggable-chip';\nimport { store as blockEditorStore } from '../../store';\nimport DroppingInsertionPoint from './dropping-insertion-point';\nimport useBlockDropZone from '../use-block-drop-zone';\nimport styles from './style.scss';\n\nconst CHIP_OFFSET_TO_TOUCH_POSITION = 32;\nconst BLOCK_OPACITY_ANIMATION_CONFIG = { duration: 350 };\nconst BLOCK_OPACITY_ANIMATION_DELAY = 250;\nconst DEFAULT_LONG_PRESS_MIN_DURATION = 500;\nconst DEFAULT_IOS_LONG_PRESS_MIN_DURATION =\n\tDEFAULT_LONG_PRESS_MIN_DURATION - 50;\n\n/**\n * Block draggable wrapper component\n *\n * This component handles all the interactions for dragging blocks.\n * It relies on the block list and its context for dragging, hence it\n * should be rendered between the `BlockListProvider` component and the\n * block list rendering. It also requires listening to scroll events,\n * therefore for this purpose, it returns the `onScroll` event handler\n * that should be attached to the list that renders the blocks.\n *\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {boolean} props.isRTL Check if current locale is RTL.\n *\n * @return {Function} Render function that passes `onScroll` event handler.\n */\nconst BlockDraggableWrapper = ( { children, isRTL } ) => {\n\tconst [ draggedBlockIcon, setDraggedBlockIcon ] = useState();\n\n\tconst { selectBlock, startDraggingBlocks, stopDraggingBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { left, right } = useSafeAreaInsets();\n\tconst { width } = useSafeAreaFrame();\n\tconst safeAreaOffset = left + right;\n\tconst contentWidth = width - safeAreaOffset;\n\n\tconst scroll = {\n\t\toffsetY: useSharedValue( 0 ),\n\t};\n\tconst chip = {\n\t\tx: useSharedValue( 0 ),\n\t\ty: useSharedValue( 0 ),\n\t\twidth: useSharedValue( 0 ),\n\t\theight: useSharedValue( 0 ),\n\t};\n\tconst currentYPosition = useSharedValue( 0 );\n\tconst isDragging = useSharedValue( false );\n\n\tconst [\n\t\tstartScrolling,\n\t\tscrollOnDragOver,\n\t\tstopScrolling,\n\t\tdraggingScrollHandler,\n\t] = useScrollWhenDragging();\n\n\tconst scrollHandler = ( event ) => {\n\t\t'worklet';\n\t\tconst { contentOffset } = event;\n\t\tscroll.offsetY.value = contentOffset.y;\n\n\t\tdraggingScrollHandler( event );\n\t};\n\n\tconst {\n\t\tonBlockDragOverWorklet,\n\t\tonBlockDragEnd,\n\t\tonBlockDrop,\n\t\ttargetBlockIndex,\n\t} = useBlockDropZone();\n\n\t// Stop dragging blocks if the block draggable is unmounted.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging.value ) {\n\t\t\t\tstopDraggingBlocks();\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tconst setDraggedBlockIconByClientId = ( clientId ) => {\n\t\tconst blockName = select( blockEditorStore ).getBlockName( clientId );\n\t\tconst blockIcon = getBlockType( blockName )?.icon;\n\t\tif ( blockIcon ) {\n\t\t\tsetDraggedBlockIcon( blockIcon );\n\t\t}\n\t};\n\n\tconst onStartDragging = ( { clientId, position } ) => {\n\t\tif ( clientId ) {\n\t\t\tstartDraggingBlocks( [ clientId ] );\n\t\t\tsetDraggedBlockIconByClientId( clientId );\n\t\t\trunOnUI( startScrolling )( position.y );\n\t\t\tgenerateHapticFeedback();\n\t\t} else {\n\t\t\t// We stop dragging if no block is found.\n\t\t\trunOnUI( stopDragging )();\n\t\t}\n\t};\n\n\tconst onStopDragging = ( { clientId } ) => {\n\t\tif ( clientId ) {\n\t\t\tonBlockDrop( {\n\t\t\t\t// Dropping is only allowed at root level\n\t\t\t\tsrcRootClientId: '',\n\t\t\t\tsrcClientIds: [ clientId ],\n\t\t\t\ttype: 'block',\n\t\t\t} );\n\t\t\tselectBlock( clientId );\n\t\t\tsetDraggedBlockIcon( undefined );\n\t\t}\n\t\tonBlockDragEnd();\n\t\tstopDraggingBlocks();\n\t};\n\n\tconst onChipLayout = ( { nativeEvent: { layout } } ) => {\n\t\tif ( layout.width > 0 ) {\n\t\t\tchip.width.value = layout.width;\n\t\t}\n\t\tif ( layout.height > 0 ) {\n\t\t\tchip.height.value = layout.height;\n\t\t}\n\t};\n\n\tconst startDragging = ( { x, y, id } ) => {\n\t\t'worklet';\n\t\tconst dragPosition = { x, y };\n\t\tchip.x.value = dragPosition.x;\n\t\tchip.y.value = dragPosition.y;\n\t\tcurrentYPosition.value = dragPosition.y;\n\n\t\tisDragging.value = true;\n\n\t\trunOnJS( onStartDragging )( { clientId: id, position: dragPosition } );\n\t};\n\n\tconst updateDragging = ( { x, y } ) => {\n\t\t'worklet';\n\t\tconst dragPosition = { x, y };\n\t\tchip.x.value = dragPosition.x;\n\t\tchip.y.value = dragPosition.y;\n\t\tcurrentYPosition.value = dragPosition.y;\n\n\t\tonBlockDragOverWorklet( { x, y: y + scroll.offsetY.value } );\n\n\t\t// Update scrolling velocity\n\t\tscrollOnDragOver( dragPosition.y );\n\t};\n\n\tconst stopDragging = ( { id } ) => {\n\t\t'worklet';\n\t\tisDragging.value = false;\n\n\t\tstopScrolling();\n\t\trunOnJS( onStopDragging )( { clientId: id } );\n\t};\n\n\tconst chipDynamicStyles = useAnimatedStyle( () => {\n\t\tconst chipOffset = chip.width.value / 2;\n\t\tconst translateX = ! isRTL\n\t\t\t? chip.x.value - chipOffset\n\t\t\t: -( contentWidth - ( chip.x.value + chipOffset ) );\n\n\t\treturn {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateX,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttranslateY:\n\t\t\t\t\t\tchip.y.value -\n\t\t\t\t\t\tchip.height.value -\n\t\t\t\t\t\tCHIP_OFFSET_TO_TOUCH_POSITION,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t} );\n\tconst chipStyles = [\n\t\tchipDynamicStyles,\n\t\tstyles[ 'draggable-chip__wrapper' ],\n\t];\n\n\tconst exitingAnimation = ( { currentHeight, currentWidth } ) => {\n\t\t'worklet';\n\t\tconst translateX = ! isRTL ? 0 : currentWidth * -1;\n\t\tconst duration = 150;\n\t\tconst animations = {\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: withTiming( currentHeight, {\n\t\t\t\t\t\tduration,\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttranslateX: withTiming( translateX, {\n\t\t\t\t\t\tduration,\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t\t{ scale: withTiming( 0, { duration } ) },\n\t\t\t],\n\t\t};\n\t\tconst initialValues = {\n\t\t\ttransform: [ { translateY: 0 }, { translateX }, { scale: 1 } ],\n\t\t};\n\t\treturn {\n\t\t\tinitialValues,\n\t\t\tanimations,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DroppingInsertionPoint\n\t\t\t\tscroll={ scroll }\n\t\t\t\tcurrentYPosition={ currentYPosition }\n\t\t\t\tisDragging={ isDragging }\n\t\t\t\ttargetBlockIndex={ targetBlockIndex }\n\t\t\t/>\n\t\t\t<Draggable\n\t\t\t\tonDragStart={ startDragging }\n\t\t\t\tonDragOver={ updateDragging }\n\t\t\t\tonDragEnd={ stopDragging }\n\t\t\t\ttestID=\"block-draggable-wrapper\"\n\t\t\t>\n\t\t\t\t{ children( { onScroll: scrollHandler } ) }\n\t\t\t</Draggable>\n\t\t\t<Animated.View\n\t\t\t\tonLayout={ onChipLayout }\n\t\t\t\tstyle={ chipStyles }\n\t\t\t\tpointerEvents=\"none\"\n\t\t\t>\n\t\t\t\t{ draggedBlockIcon && (\n\t\t\t\t\t<Animated.View\n\t\t\t\t\t\tentering={ ZoomInEasyDown.duration( 200 ) }\n\t\t\t\t\t\texiting={ exitingAnimation }\n\t\t\t\t\t>\n\t\t\t\t\t\t<DraggableChip icon={ draggedBlockIcon } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t) }\n\t\t\t</Animated.View>\n\t\t</>\n\t);\n};\n\nfunction useIsScreenReaderEnabled() {\n\tconst [ isScreenReaderEnabled, setIsScreenReaderEnabled ] =\n\t\tuseState( false );\n\n\tuseEffect( () => {\n\t\tlet mounted = true;\n\n\t\tconst changeListener = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\t( enabled ) => setIsScreenReaderEnabled( enabled )\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( screenReaderEnabled ) => {\n\t\t\t\tif ( mounted && screenReaderEnabled ) {\n\t\t\t\t\tsetIsScreenReaderEnabled( screenReaderEnabled );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tmounted = false;\n\n\t\t\tchangeListener.remove();\n\t\t};\n\t}, [] );\n\n\treturn isScreenReaderEnabled;\n}\n\nfunction useIsEditingText() {\n\tconst [ isEditingText, setIsEditingText ] = useState( () =>\n\t\tRCTAztecView.InputState.isFocused()\n\t);\n\n\tuseEffect( () => {\n\t\tconst onFocusChangeAztec = ( { isFocused } ) => {\n\t\t\tsetIsEditingText( isFocused );\n\t\t};\n\n\t\tRCTAztecView.InputState.addFocusChangeListener( onFocusChangeAztec );\n\n\t\treturn () => {\n\t\t\tRCTAztecView.InputState.removeFocusChangeListener(\n\t\t\t\tonFocusChangeAztec\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\treturn isEditingText;\n}\n\n/**\n * Block draggable component\n *\n * This component serves for animating the block when it is being dragged.\n * Hence, it should be wrapped around the rendering of a block.\n *\n * @param {Object} props Component props.\n * @param {JSX.Element} props.children Children to be rendered.\n * @param {string} props.clientId Client id of the block.\n * @param {string} [props.draggingClientId] Client id to use for dragging. If not defined, the value from `clientId` will be used.\n * @param {boolean} [props.enabled] Enables the draggable trigger.\n * @param {string} [props.testID] Id used for querying the long-press gesture handler in tests.\n *\n * @return {Function} Render function which includes the parameter `isDraggable` to determine if the block can be dragged.\n */\nconst BlockDraggable = ( {\n\tclientId,\n\tchildren,\n\tdraggingClientId,\n\tenabled = true,\n\ttestID,\n} ) => {\n\tconst wasBeingDragged = useRef( false );\n\tconst isEditingText = useIsEditingText();\n\tconst isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n\tconst draggingAnimation = {\n\t\topacity: useSharedValue( 1 ),\n\t};\n\n\tconst startDraggingBlock = () => {\n\t\tdraggingAnimation.opacity.value = withTiming(\n\t\t\t0.4,\n\t\t\tBLOCK_OPACITY_ANIMATION_CONFIG\n\t\t);\n\t};\n\n\tconst stopDraggingBlock = () => {\n\t\tdraggingAnimation.opacity.value = withDelay(\n\t\t\tBLOCK_OPACITY_ANIMATION_DELAY,\n\t\t\twithTiming( 1, BLOCK_OPACITY_ANIMATION_CONFIG )\n\t\t);\n\t};\n\n\tconst { isDraggable, isBeingDragged, isBlockSelected } = useSelect(\n\t\t( _select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tisBlockBeingDragged,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t} = _select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst templateLock = rootClientId\n\t\t\t\t? getTemplateLock( rootClientId )\n\t\t\t\t: null;\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\treturn {\n\t\t\t\tisBeingDragged: isBlockBeingDragged( clientId ),\n\t\t\t\tisDraggable: 'all' !== templateLock,\n\t\t\t\tisBlockSelected:\n\t\t\t\t\tselectedBlockClientId && selectedBlockClientId === clientId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( isBeingDragged !== wasBeingDragged.current ) {\n\t\t\tif ( isBeingDragged ) {\n\t\t\t\tstartDraggingBlock();\n\t\t\t} else {\n\t\t\t\tstopDraggingBlock();\n\t\t\t}\n\t\t}\n\t\twasBeingDragged.current = isBeingDragged;\n\t}, [ isBeingDragged ] );\n\n\tconst onLongPressDraggable = useCallback( () => {\n\t\t// Ensure that no text input is focused when starting the dragging gesture in order to prevent conflicts with text editing.\n\t\tRCTAztecView.InputState.blurCurrentFocusedElement();\n\t}, [] );\n\n\tconst animatedWrapperStyles = useAnimatedStyle( () => {\n\t\treturn {\n\t\t\topacity: draggingAnimation.opacity.value,\n\t\t};\n\t} );\n\tconst wrapperStyles = [\n\t\tanimatedWrapperStyles,\n\t\tstyles[ 'draggable-wrapper__container' ],\n\t];\n\n\tconst canDragBlock =\n\t\tenabled &&\n\t\t! isScreenReaderEnabled &&\n\t\t( ! isBlockSelected || ! isEditingText );\n\n\tif ( ! isDraggable ) {\n\t\treturn children( { isDraggable: false } );\n\t}\n\n\treturn (\n\t\t<DraggableTrigger\n\t\t\tid={ draggingClientId || clientId }\n\t\t\tenabled={ enabled && canDragBlock }\n\t\t\tminDuration={ Platform.select( {\n\t\t\t\t// On iOS, using a lower min duration than the default\n\t\t\t\t// value prevents the long-press gesture from being\n\t\t\t\t// triggered in underneath elements. This is required to\n\t\t\t\t// prevent enabling text editing when dragging is available.\n\t\t\t\tios: canDragBlock\n\t\t\t\t\t? DEFAULT_IOS_LONG_PRESS_MIN_DURATION\n\t\t\t\t\t: DEFAULT_LONG_PRESS_MIN_DURATION,\n\t\t\t\tandroid: DEFAULT_LONG_PRESS_MIN_DURATION,\n\t\t\t} ) }\n\t\t\tonLongPress={ onLongPressDraggable }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<Animated.View style={ wrapperStyles }>\n\t\t\t\t{ children( { isDraggable: true } ) }\n\t\t\t</Animated.View>\n\t\t</DraggableTrigger>\n\t);\n};\n\nexport { BlockDraggableWrapper };\nexport default BlockDraggable;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AAIA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAaA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAOA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAC,sBAAA,CAAAV,OAAA;AAKA,IAAAW,sBAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,cAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,uBAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,iBAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,MAAA,GAAAN,sBAAA,CAAAV,OAAA;AAAkC,SAAAiB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAf,wBAAAe,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA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EAAC5H,WAAA,CAAA4L,gBAAgB;IAChBpF,EAAE,EAAGyD,gBAAgB,IAAI9E,QAAU;IACnCgE,OAAO,EAAGA,OAAO,IAAIwC,YAAc;IACnCE,WAAW,EAAGC,iBAAQ,CAACzG,MAAM,CAAE;MAC9B;MACA;MACA;MACA;MACA0G,GAAG,EAAEJ,YAAY,GACdpJ,mCAAmC,GACnCD,+BAA+B;MAClC0J,OAAO,EAAE1J;IACV,CAAE,CAAG;IACL2J,WAAW,EAAGX,oBAAsB;IACpCpD,MAAM,EAAGA;EAAQ,GAEjB,IAAAP,MAAA,CAAAC,aAAA,EAAC9H,sBAAA,CAAAqB,OAAQ,CAACiH,IAAI;IAACE,KAAK,EAAGoD;EAAe,GACnCjJ,QAAQ,CAAE;IAAEgI,WAAW,EAAE;EAAK,CAAE,CACpB,CACE,CAAC;AAErB,CAAC;AAAC,IAAAyB,QAAA,GAAAvD,OAAA,CAAAxH,OAAA,GAGa6I,cAAc"}
|
|
@@ -10,17 +10,13 @@ var _element = require("@wordpress/element");
|
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const mayDisplayControlsKey = Symbol('mayDisplayControls');
|
|
14
|
-
exports.
|
|
15
|
-
const
|
|
16
|
-
exports.
|
|
17
|
-
const blockEditingModeKey = Symbol('blockEditingMode');
|
|
18
|
-
exports.blockEditingModeKey = blockEditingModeKey;
|
|
19
|
-
const DEFAULT_BLOCK_EDIT_CONTEXT = {
|
|
13
|
+
const mayDisplayControlsKey = exports.mayDisplayControlsKey = Symbol('mayDisplayControls');
|
|
14
|
+
const mayDisplayParentControlsKey = exports.mayDisplayParentControlsKey = Symbol('mayDisplayParentControls');
|
|
15
|
+
const blockEditingModeKey = exports.blockEditingModeKey = Symbol('blockEditingMode');
|
|
16
|
+
const DEFAULT_BLOCK_EDIT_CONTEXT = exports.DEFAULT_BLOCK_EDIT_CONTEXT = {
|
|
20
17
|
name: '',
|
|
21
18
|
isSelected: false
|
|
22
19
|
};
|
|
23
|
-
exports.DEFAULT_BLOCK_EDIT_CONTEXT = DEFAULT_BLOCK_EDIT_CONTEXT;
|
|
24
20
|
const Context = (0, _element.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT);
|
|
25
21
|
const {
|
|
26
22
|
Provider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","mayDisplayControlsKey","
|
|
1
|
+
{"version":3,"names":["_element","require","mayDisplayControlsKey","exports","Symbol","mayDisplayParentControlsKey","blockEditingModeKey","DEFAULT_BLOCK_EDIT_CONTEXT","name","isSelected","Context","createContext","Provider","BlockEditContextProvider","useBlockEditContext","useContext"],"sources":["@wordpress/block-editor/src/components/block-edit/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\nexport const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );\nexport const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );\nexport const blockEditingModeKey = Symbol( 'blockEditingMode' );\n\nexport const DEFAULT_BLOCK_EDIT_CONTEXT = {\n\tname: '',\n\tisSelected: false,\n};\n\nconst Context = createContext( DEFAULT_BLOCK_EDIT_CONTEXT );\nconst { Provider } = Context;\n\nexport { Provider as BlockEditContextProvider };\n\n/**\n * A hook that returns the block edit context.\n *\n * @return {Object} Block edit context\n */\nexport function useBlockEditContext() {\n\treturn useContext( Context );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,MAAM,CAAE,oBAAqB,CAAC;AAC5D,MAAMC,2BAA2B,GAAAF,OAAA,CAAAE,2BAAA,GAAGD,MAAM,CAAE,0BAA2B,CAAC;AACxE,MAAME,mBAAmB,GAAAH,OAAA,CAAAG,mBAAA,GAAGF,MAAM,CAAE,kBAAmB,CAAC;AAExD,MAAMG,0BAA0B,GAAAJ,OAAA,CAAAI,0BAAA,GAAG;EACzCC,IAAI,EAAE,EAAE;EACRC,UAAU,EAAE;AACb,CAAC;AAED,MAAMC,OAAO,GAAG,IAAAC,sBAAa,EAAEJ,0BAA2B,CAAC;AAC3D,MAAM;EAAEK;AAAS,CAAC,GAAGF,OAAO;AAACP,OAAA,CAAAU,wBAAA,GAAAD,QAAA;AAI7B;AACA;AACA;AACA;AACA;AACO,SAASE,mBAAmBA,CAAA,EAAG;EACrC,OAAO,IAAAC,mBAAU,EAAEL,OAAQ,CAAC;AAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_blocks","_element","_blockContext","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","Component","edit","save","_react","createElement","EditWithFilters","withFilters","EditWithGeneratedProps","attributes","blockContext","useContext","BlockContext","context","useMemo","usesContext","Object","fromEntries","entries","filter","key","includes","apiVersion","generatedClassName","hasBlockSupport","getBlockDefaultClassName","className","classnames","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport {\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { attributes = {}, name } = props;\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn <EditWithFilters { ...props } context={ context } />;\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = classnames(\n\t\tgeneratedClassName,\n\t\tattributes.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tcontext={ context }\n\t\t\tclassName={ className }\n\t\t/>\n\t);\n};\n\nexport default EditWithGeneratedProps;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAMC,IA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EAAGA;IAAS,CAAE,CAAC;EAC5D;;EAEA;EACA,MAAMU,kBAAkB,GAAG,IAAAC,uBAAe,EAAEzB,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,GACvE,IAAA0B,gCAAwB,EAAE3B,IAAK,CAAC,GAChC,IAAI;EACP,MAAM4B,SAAS,GAAG,IAAAC,mBAAU,EAC3BJ,kBAAkB,EAClBd,UAAU,CAACiB,SAAS,EACpB7B,KAAK,CAAC6B,SACP,CAAC;EAED,OACC,IAAAtB,MAAA,CAAAC,aAAA,EAACC,eAAe;IAAA,GACVT,KAAK;IACVgB,OAAO,EAAGA,OAAS;IACnBa,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ,CAAC;AAAC,IAAAE,QAAA,
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_blocks","_element","_blockContext","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","Component","edit","save","_react","createElement","EditWithFilters","withFilters","EditWithGeneratedProps","attributes","blockContext","useContext","BlockContext","context","useMemo","usesContext","Object","fromEntries","entries","filter","key","includes","apiVersion","generatedClassName","hasBlockSupport","getBlockDefaultClassName","className","classnames","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport {\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { attributes = {}, name } = props;\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn <EditWithFilters { ...props } context={ context } />;\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = classnames(\n\t\tgeneratedClassName,\n\t\tattributes.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tcontext={ context }\n\t\t\tclassName={ className }\n\t\t/>\n\t);\n};\n\nexport default EditWithGeneratedProps;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA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U,GAAG,CAAC,EAAG;IAC/B,OAAO,IAAAlB,MAAA,CAAAC,aAAA,EAACC,eAAe;MAAA,GAAMT,KAAK;MAAGgB,OAAO,EAAGA;IAAS,CAAE,CAAC;EAC5D;;EAEA;EACA,MAAMU,kBAAkB,GAAG,IAAAC,uBAAe,EAAEzB,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,GACvE,IAAA0B,gCAAwB,EAAE3B,IAAK,CAAC,GAChC,IAAI;EACP,MAAM4B,SAAS,GAAG,IAAAC,mBAAU,EAC3BJ,kBAAkB,EAClBd,UAAU,CAACiB,SAAS,EACpB7B,KAAK,CAAC6B,SACP,CAAC;EAED,OACC,IAAAtB,MAAA,CAAAC,aAAA,EAACC,eAAe;IAAA,GACVT,KAAK;IACVgB,OAAO,EAAGA,OAAS;IACnBa,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEatB,sBAAsB"}
|
|
@@ -48,6 +48,5 @@ const Edit = props => {
|
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
exports.Edit = Edit;
|
|
51
|
-
var _default = (0, _components.withFilters)('editor.BlockEdit')(Edit);
|
|
52
|
-
exports.default = _default;
|
|
51
|
+
var _default = exports.default = (0, _components.withFilters)('editor.BlockEdit')(Edit);
|
|
53
52
|
//# sourceMappingURL=edit.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_blocks","_element","_blockContext","_interopRequireDefault","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","blockContext","useContext","BlockContext","context","useMemo","usesContext","Object","fromEntries","entries","filter","key","includes","Component","edit","_react","createElement","exports","_default","
|
|
1
|
+
{"version":3,"names":["_components","require","_blocks","_element","_blockContext","_interopRequireDefault","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","getBlockType","blockContext","useContext","BlockContext","context","useMemo","usesContext","Object","fromEntries","entries","filter","key","includes","Component","edit","_react","createElement","exports","_default","default","withFilters"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nexport const Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tconst Component = blockType.edit;\n\n\treturn <Component { ...props } context={ context } />;\n};\n\nexport default withFilters( 'editor.BlockEdit' )( Edit );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,qBAAqB,GAAG,CAAC,CAAC;AAEzB,MAAMC,IAAI,GAAKC,KAAK,IAAM;EAChC,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,SAAS,GAAG,IAAAC,oBAAY,EAAEF,IAAK,CAAC;EAEtC,MAAMG,YAAY,GAAG,IAAAC,mBAAU,EAAEC,qBAAa,CAAC;;EAE/C;EACA,MAAMC,OAAO,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC9B,OAAON,SAAS,IAAIA,SAAS,CAACO,WAAW,GACtCC,MAAM,CAACC,WAAW,CAClBD,MAAM,CAACE,OAAO,CAAER,YAAa,CAAC,CAACS,MAAM,CAAE,CAAE,CAAEC,GAAG,CAAE,KAC/CZ,SAAS,CAACO,WAAW,CAACM,QAAQ,CAAED,GAAI,CACrC,CACA,CAAC,GACDhB,qBAAqB;EACzB,CAAC,EAAE,CAAEI,SAAS,EAAEE,YAAY,CAAG,CAAC;EAEhC,IAAK,CAAEF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMc,SAAS,GAAGd,SAAS,CAACe,IAAI;EAEhC,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACH,SAAS;IAAA,GAAMhB,KAAK;IAAGO,OAAO,EAAGA;EAAS,CAAE,CAAC;AACtD,CAAC;AAACa,OAAA,CAAArB,IAAA,GAAAA,IAAA;AAAA,IAAAsB,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEa,IAAAC,uBAAW,EAAE,kBAAmB,CAAC,CAAExB,IAAK,CAAC"}
|
|
@@ -26,6 +26,5 @@ function BlockFullHeightAlignmentControl({
|
|
|
26
26
|
disabled: isDisabled
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
var _default = BlockFullHeightAlignmentControl;
|
|
30
|
-
exports.default = _default;
|
|
29
|
+
var _default = exports.default = BlockFullHeightAlignmentControl;
|
|
31
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_icons","BlockFullHeightAlignmentControl","isActive","label","__","onToggle","isDisabled","_react","createElement","ToolbarButton","icon","fullscreen","onClick","disabled","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-full-height-alignment-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { fullscreen } from '@wordpress/icons';\n\nfunction BlockFullHeightAlignmentControl( {\n\tisActive,\n\tlabel = __( 'Toggle full height' ),\n\tonToggle,\n\tisDisabled,\n} ) {\n\treturn (\n\t\t<ToolbarButton\n\t\t\tisActive={ isActive }\n\t\t\ticon={ fullscreen }\n\t\t\tlabel={ label }\n\t\t\tonClick={ () => onToggle( ! isActive ) }\n\t\t\tdisabled={ isDisabled }\n\t\t/>\n\t);\n}\n\nexport default BlockFullHeightAlignmentControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,+BAA+BA,CAAE;EACzCC,QAAQ;EACRC,KAAK,GAAG,IAAAC,QAAE,EAAE,oBAAqB,CAAC;EAClCC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,aAAa;IACbP,QAAQ,EAAGA,QAAU;IACrBQ,IAAI,EAAGC,iBAAY;IACnBR,KAAK,EAAGA,KAAO;IACfS,OAAO,EAAGA,CAAA,KAAMP,QAAQ,CAAE,CAAEH,QAAS,CAAG;IACxCW,QAAQ,EAAGP;EAAY,CACvB,CAAC;AAEJ;AAAC,IAAAQ,QAAA,
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_icons","BlockFullHeightAlignmentControl","isActive","label","__","onToggle","isDisabled","_react","createElement","ToolbarButton","icon","fullscreen","onClick","disabled","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-full-height-alignment-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { fullscreen } from '@wordpress/icons';\n\nfunction BlockFullHeightAlignmentControl( {\n\tisActive,\n\tlabel = __( 'Toggle full height' ),\n\tonToggle,\n\tisDisabled,\n} ) {\n\treturn (\n\t\t<ToolbarButton\n\t\t\tisActive={ isActive }\n\t\t\ticon={ fullscreen }\n\t\t\tlabel={ label }\n\t\t\tonClick={ () => onToggle( ! isActive ) }\n\t\t\tdisabled={ isDisabled }\n\t\t/>\n\t);\n}\n\nexport default BlockFullHeightAlignmentControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,+BAA+BA,CAAE;EACzCC,QAAQ;EACRC,KAAK,GAAG,IAAAC,QAAE,EAAE,oBAAqB,CAAC;EAClCC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,aAAa;IACbP,QAAQ,EAAGA,QAAU;IACrBQ,IAAI,EAAGC,iBAAY;IACnBR,KAAK,EAAGA,KAAO;IACfS,OAAO,EAAGA,CAAA,KAAMP,QAAQ,CAAE,CAAEH,QAAS,CAAG;IACxCW,QAAQ,EAAGP;EAAY,CACvB,CAAC;AAEJ;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcf,+BAA+B"}
|
|
@@ -48,6 +48,5 @@ function BlockIcon({
|
|
|
48
48
|
/**
|
|
49
49
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-icon/README.md
|
|
50
50
|
*/
|
|
51
|
-
var _default = (0, _element.memo)(BlockIcon);
|
|
52
|
-
exports.default = _default;
|
|
51
|
+
var _default = exports.default = (0, _element.memo)(BlockIcon);
|
|
53
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_icons","_element","BlockIcon","icon","showColors","className","context","src","blockDefault","renderedIcon","_react","createElement","Icon","style","backgroundColor","background","color","foreground","classnames","_default","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_icons","_element","BlockIcon","icon","showColors","className","context","src","blockDefault","renderedIcon","_react","createElement","Icon","style","backgroundColor","background","color","foreground","classnames","_default","exports","default","memo"],"sources":["@wordpress/block-editor/src/components/block-icon/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { blockDefault } from '@wordpress/icons';\nimport { memo } from '@wordpress/element';\n\nfunction BlockIcon( { icon, showColors = false, className, context } ) {\n\tif ( icon?.src === 'block-default' ) {\n\t\ticon = {\n\t\t\tsrc: blockDefault,\n\t\t};\n\t}\n\n\tconst renderedIcon = (\n\t\t<Icon icon={ icon && icon.src ? icon.src : icon } context={ context } />\n\t);\n\tconst style = showColors\n\t\t? {\n\t\t\t\tbackgroundColor: icon && icon.background,\n\t\t\t\tcolor: icon && icon.foreground,\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<span\n\t\t\tstyle={ style }\n\t\t\tclassName={ classnames( 'block-editor-block-icon', className, {\n\t\t\t\t'has-colors': showColors,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ renderedIcon }\n\t\t</span>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-icon/README.md\n */\nexport default memo( BlockIcon );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASI,SAASA,CAAE;EAAEC,IAAI;EAAEC,UAAU,GAAG,KAAK;EAAEC,SAAS;EAAEC;AAAQ,CAAC,EAAG;EACtE,IAAKH,IAAI,EAAEI,GAAG,KAAK,eAAe,EAAG;IACpCJ,IAAI,GAAG;MACNI,GAAG,EAAEC;IACN,CAAC;EACF;EAEA,MAAMC,YAAY,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAACZ,WAAA,CAAAa,IAAI;IAACT,IAAI,EAAGA,IAAI,IAAIA,IAAI,CAACI,GAAG,GAAGJ,IAAI,CAACI,GAAG,GAAGJ,IAAM;IAACG,OAAO,EAAGA;EAAS,CAAE,CACvE;EACD,MAAMO,KAAK,GAAGT,UAAU,GACrB;IACAU,eAAe,EAAEX,IAAI,IAAIA,IAAI,CAACY,UAAU;IACxCC,KAAK,EAAEb,IAAI,IAAIA,IAAI,CAACc;EACpB,CAAC,GACD,CAAC,CAAC;EAEL,OACC,IAAAP,MAAA,CAAAC,aAAA;IACCE,KAAK,EAAGA,KAAO;IACfR,SAAS,EAAG,IAAAa,mBAAU,EAAE,yBAAyB,EAAEb,SAAS,EAAE;MAC7D,YAAY,EAAED;IACf,CAAE;EAAG,GAEHK,YACG,CAAC;AAET;;AAEA;AACA;AACA;AAFA,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGe,IAAAC,aAAI,EAAEpB,SAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_components","_icons","_compose","_style","_interopRequireDefault","BlockIcon","icon","fill","size","showColors","src","blockDefault","defaultFill","usePreferredColorSchemeStyle","styles","iconPlaceholder","iconPlaceholderDark","iconForeground","foreground","undefined","renderedIcon","_react","createElement","Icon","style","backgroundColor","background","View","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-icon/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { blockDefault } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport function BlockIcon( { icon, fill, size, showColors = false } ) {\n\tif ( icon?.src === 'block-default' ) {\n\t\ticon = {\n\t\t\tsrc: blockDefault,\n\t\t};\n\t}\n\n\tconst defaultFill = usePreferredColorSchemeStyle(\n\t\tstyles.iconPlaceholder,\n\t\tstyles.iconPlaceholderDark\n\t)?.fill;\n\tconst iconForeground = showColors ? icon?.foreground : undefined;\n\n\tconst renderedIcon = (\n\t\t<Icon\n\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\tfill={ fill || iconForeground || defaultFill }\n\t\t\t{ ...( size && { size } ) }\n\t\t/>\n\t);\n\tconst style = showColors\n\t\t? {\n\t\t\t\tbackgroundColor: icon && icon.background,\n\t\t }\n\t\t: {};\n\n\treturn <View style={ style }>{ renderedIcon }</View>;\n}\n\nexport default BlockIcon;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGO,SAASM,SAASA,CAAE;EAAEC,IAAI;EAAEC,IAAI;EAAEC,IAAI;EAAEC,UAAU,GAAG;AAAM,CAAC,EAAG;EACrE,IAAKH,IAAI,EAAEI,GAAG,KAAK,eAAe,EAAG;IACpCJ,IAAI,GAAG;MACNI,GAAG,EAAEC;IACN,CAAC;EACF;EAEA,MAAMC,WAAW,GAAG,IAAAC,qCAA4B,EAC/CC,cAAM,CAACC,eAAe,EACtBD,cAAM,CAACE,mBACR,CAAC,EAAET,IAAI;EACP,MAAMU,cAAc,GAAGR,UAAU,GAAGH,IAAI,EAAEY,UAAU,GAAGC,SAAS;EAEhE,MAAMC,YAAY,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,IAAI;IACJjB,IAAI,EAAGA,IAAI,IAAIA,IAAI,CAACI,GAAG,GAAGJ,IAAI,CAACI,GAAG,GAAGJ,IAAM;IAC3CC,IAAI,EAAGA,IAAI,IAAIU,cAAc,IAAIL,WAAa;IAAA,IACvCJ,IAAI,IAAI;MAAEA;IAAK,CAAC;EAAA,CACvB,CACD;EACD,MAAMgB,KAAK,GAAGf,UAAU,GACrB;IACAgB,eAAe,EAAEnB,IAAI,IAAIA,IAAI,CAACoB;EAC9B,CAAC,GACD,CAAC,CAAC;EAEL,OAAO,IAAAL,MAAA,CAAAC,aAAA,EAACxB,YAAA,CAAA6B,IAAI;IAACH,KAAK,EAAGA;EAAO,GAAGJ,YAAoB,CAAC;AACrD;AAAC,IAAAQ,QAAA,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_components","_icons","_compose","_style","_interopRequireDefault","BlockIcon","icon","fill","size","showColors","src","blockDefault","defaultFill","usePreferredColorSchemeStyle","styles","iconPlaceholder","iconPlaceholderDark","iconForeground","foreground","undefined","renderedIcon","_react","createElement","Icon","style","backgroundColor","background","View","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-icon/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { blockDefault } from '@wordpress/icons';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport function BlockIcon( { icon, fill, size, showColors = false } ) {\n\tif ( icon?.src === 'block-default' ) {\n\t\ticon = {\n\t\t\tsrc: blockDefault,\n\t\t};\n\t}\n\n\tconst defaultFill = usePreferredColorSchemeStyle(\n\t\tstyles.iconPlaceholder,\n\t\tstyles.iconPlaceholderDark\n\t)?.fill;\n\tconst iconForeground = showColors ? icon?.foreground : undefined;\n\n\tconst renderedIcon = (\n\t\t<Icon\n\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\tfill={ fill || iconForeground || defaultFill }\n\t\t\t{ ...( size && { size } ) }\n\t\t/>\n\t);\n\tconst style = showColors\n\t\t? {\n\t\t\t\tbackgroundColor: icon && icon.background,\n\t\t }\n\t\t: {};\n\n\treturn <View style={ style }>{ renderedIcon }</View>;\n}\n\nexport default BlockIcon;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGO,SAASM,SAASA,CAAE;EAAEC,IAAI;EAAEC,IAAI;EAAEC,IAAI;EAAEC,UAAU,GAAG;AAAM,CAAC,EAAG;EACrE,IAAKH,IAAI,EAAEI,GAAG,KAAK,eAAe,EAAG;IACpCJ,IAAI,GAAG;MACNI,GAAG,EAAEC;IACN,CAAC;EACF;EAEA,MAAMC,WAAW,GAAG,IAAAC,qCAA4B,EAC/CC,cAAM,CAACC,eAAe,EACtBD,cAAM,CAACE,mBACR,CAAC,EAAET,IAAI;EACP,MAAMU,cAAc,GAAGR,UAAU,GAAGH,IAAI,EAAEY,UAAU,GAAGC,SAAS;EAEhE,MAAMC,YAAY,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,IAAI;IACJjB,IAAI,EAAGA,IAAI,IAAIA,IAAI,CAACI,GAAG,GAAGJ,IAAI,CAACI,GAAG,GAAGJ,IAAM;IAC3CC,IAAI,EAAGA,IAAI,IAAIU,cAAc,IAAIL,WAAa;IAAA,IACvCJ,IAAI,IAAI;MAAEA;IAAK,CAAC;EAAA,CACvB,CACD;EACD,MAAMgB,KAAK,GAAGf,UAAU,GACrB;IACAgB,eAAe,EAAEnB,IAAI,IAAIA,IAAI,CAACoB;EAC9B,CAAC,GACD,CAAC,CAAC;EAEL,OAAO,IAAAL,MAAA,CAAAC,aAAA,EAACxB,YAAA,CAAA6B,IAAI;IAACH,KAAK,EAAGA;EAAO,GAAGJ,YAAoB,CAAC;AACrD;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_lockUnlock","_context","createPrivateSlotFill","unlock","componentsPrivateApis","Fill","Slot","BlockInfo","props","context","useBlockEditContext","mayDisplayControlsKey","_react","createElement","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-info-slot-fill/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n} from '../block-edit/context';\n\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst { Fill, Slot } = createPrivateSlotFill( 'BlockInformation' );\n\nconst BlockInfo = ( props ) => {\n\tconst context = useBlockEditContext();\n\tif ( ! context[ mayDisplayControlsKey ] ) {\n\t\treturn null;\n\t}\n\treturn <Fill { ...props } />;\n};\nBlockInfo.Slot = ( props ) => <Slot { ...props } />;\n\nexport default BlockInfo;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,MAAM;EAAEG;AAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AACjE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGJ,qBAAqB,CAAE,kBAAmB,CAAC;AAElE,MAAMK,SAAS,GAAKC,KAAK,IAAM;EAC9B,MAAMC,OAAO,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACrC,IAAK,CAAED,OAAO,CAAEE,8BAAqB,CAAE,EAAG;IACzC,OAAO,IAAI;EACZ;EACA,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,IAAI;IAAA,GAAMG;EAAK,CAAI,CAAC;AAC7B,CAAC;AACDD,SAAS,CAACD,IAAI,GAAKE,KAAK,IAAM,IAAAI,MAAA,CAAAC,aAAA,EAACP,IAAI;EAAA,GAAME;AAAK,CAAI,CAAC;AAAC,IAAAM,QAAA,
|
|
1
|
+
{"version":3,"names":["_components","require","_lockUnlock","_context","createPrivateSlotFill","unlock","componentsPrivateApis","Fill","Slot","BlockInfo","props","context","useBlockEditContext","mayDisplayControlsKey","_react","createElement","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-info-slot-fill/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n} from '../block-edit/context';\n\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst { Fill, Slot } = createPrivateSlotFill( 'BlockInformation' );\n\nconst BlockInfo = ( props ) => {\n\tconst context = useBlockEditContext();\n\tif ( ! context[ mayDisplayControlsKey ] ) {\n\t\treturn null;\n\t}\n\treturn <Fill { ...props } />;\n};\nBlockInfo.Slot = ( props ) => <Slot { ...props } />;\n\nexport default BlockInfo;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,MAAM;EAAEG;AAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AACjE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGJ,qBAAqB,CAAE,kBAAmB,CAAC;AAElE,MAAMK,SAAS,GAAKC,KAAK,IAAM;EAC9B,MAAMC,OAAO,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACrC,IAAK,CAAED,OAAO,CAAEE,8BAAqB,CAAE,EAAG;IACzC,OAAO,IAAI;EACZ;EACA,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,IAAI;IAAA,GAAMG;EAAK,CAAI,CAAC;AAC7B,CAAC;AACDD,SAAS,CAACD,IAAI,GAAKE,KAAK,IAAM,IAAAI,MAAA,CAAAC,aAAA,EAACP,IAAI;EAAA,GAAME;AAAK,CAAI,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAErCT,SAAS"}
|