@wordpress/block-editor 12.18.1 → 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/hooks.js +2 -3
- package/build/components/global-styles/hooks.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 +18 -36
- 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 +7 -8
- 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 +66 -35
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +8 -6
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +2 -1
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +2 -1
- package/build/components/url-popover/link-viewer.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 -8
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +0 -6
- package/build/hooks/index.native.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 +12 -11
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-shadow-props.js +0 -15
- package/build/hooks/use-shadow-props.js.map +1 -1
- package/build/hooks/utils.js +3 -6
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.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/object.js +0 -17
- package/build/utils/object.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/hooks.js +2 -3
- package/build-module/components/global-styles/hooks.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 +17 -35
- 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 +4 -2
- 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 +69 -38
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +8 -5
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +2 -1
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +2 -1
- package/build-module/components/url-popover/link-viewer.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/index.js +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -1
- package/build-module/hooks/index.native.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 +10 -13
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-shadow-props.js +0 -14
- package/build-module/hooks/use-shadow-props.js.map +1 -1
- package/build-module/hooks/utils.js +3 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.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-module/utils/object.js +0 -16
- package/build-module/utils/object.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 +97 -67
- package/build-style/style.css +97 -67
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +3 -3
- 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/hooks.js +0 -2
- 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 +14 -47
- 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/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 +4 -3
- 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 +98 -37
- package/src/components/url-popover/index.js +75 -67
- package/src/components/url-popover/link-editor.js +1 -0
- package/src/components/url-popover/link-viewer.js +1 -0
- package/src/components/url-popover/style.scss +42 -31
- 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/index.js +1 -1
- package/src/hooks/index.native.js +1 -1
- 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 +10 -23
- package/src/hooks/use-shadow-props.js +0 -14
- package/src/hooks/utils.js +4 -16
- package/src/index.js +0 -1
- 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/src/utils/object.js +0 -16
- 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
|
@@ -4,18 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.hasMergedOrigins = hasMergedOrigins;
|
|
8
|
-
exports.mergeOrigins = mergeOrigins;
|
|
9
7
|
exports.useSetting = useSetting;
|
|
10
8
|
exports.useSettings = useSettings;
|
|
11
|
-
var _blocks = require("@wordpress/blocks");
|
|
12
9
|
var _data = require("@wordpress/data");
|
|
13
10
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
14
|
-
var _element = require("@wordpress/element");
|
|
15
|
-
var _hooks = require("@wordpress/hooks");
|
|
16
11
|
var _blockEdit = require("../block-edit");
|
|
17
12
|
var _store = require("../../store");
|
|
18
|
-
var
|
|
13
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
19
14
|
/**
|
|
20
15
|
* WordPress dependencies
|
|
21
16
|
*/
|
|
@@ -24,98 +19,6 @@ var _object = require("../../utils/object");
|
|
|
24
19
|
* Internal dependencies
|
|
25
20
|
*/
|
|
26
21
|
|
|
27
|
-
const blockedPaths = ['color', 'border', 'dimensions', 'typography', 'spacing'];
|
|
28
|
-
const deprecatedFlags = {
|
|
29
|
-
'color.palette': settings => settings.colors,
|
|
30
|
-
'color.gradients': settings => settings.gradients,
|
|
31
|
-
'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors,
|
|
32
|
-
'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
|
|
33
|
-
'typography.fontSizes': settings => settings.fontSizes,
|
|
34
|
-
'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
|
|
35
|
-
'typography.lineHeight': settings => settings.enableCustomLineHeight,
|
|
36
|
-
'spacing.units': settings => {
|
|
37
|
-
if (settings.enableCustomUnits === undefined) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (settings.enableCustomUnits === true) {
|
|
41
|
-
return ['px', 'em', 'rem', 'vh', 'vw', '%'];
|
|
42
|
-
}
|
|
43
|
-
return settings.enableCustomUnits;
|
|
44
|
-
},
|
|
45
|
-
'spacing.padding': settings => settings.enableCustomSpacing
|
|
46
|
-
};
|
|
47
|
-
const prefixedFlags = {
|
|
48
|
-
/*
|
|
49
|
-
* These were only available in the plugin
|
|
50
|
-
* and can be removed when the minimum WordPress version
|
|
51
|
-
* for the plugin is 5.9.
|
|
52
|
-
*/
|
|
53
|
-
'border.customColor': 'border.color',
|
|
54
|
-
'border.customStyle': 'border.style',
|
|
55
|
-
'border.customWidth': 'border.width',
|
|
56
|
-
'typography.customFontStyle': 'typography.fontStyle',
|
|
57
|
-
'typography.customFontWeight': 'typography.fontWeight',
|
|
58
|
-
'typography.customLetterSpacing': 'typography.letterSpacing',
|
|
59
|
-
'typography.customTextDecorations': 'typography.textDecoration',
|
|
60
|
-
'typography.customTextTransforms': 'typography.textTransform',
|
|
61
|
-
/*
|
|
62
|
-
* These were part of WordPress 5.8 and we need to keep them.
|
|
63
|
-
*/
|
|
64
|
-
'border.customRadius': 'border.radius',
|
|
65
|
-
'spacing.customMargin': 'spacing.margin',
|
|
66
|
-
'spacing.customPadding': 'spacing.padding',
|
|
67
|
-
'typography.customLineHeight': 'typography.lineHeight'
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Remove `custom` prefixes for flags that did not land in 5.8.
|
|
72
|
-
*
|
|
73
|
-
* This provides continued support for `custom` prefixed properties. It will
|
|
74
|
-
* be removed once third party devs have had sufficient time to update themes,
|
|
75
|
-
* plugins, etc.
|
|
76
|
-
*
|
|
77
|
-
* @see https://github.com/WordPress/gutenberg/pull/34485
|
|
78
|
-
*
|
|
79
|
-
* @param {string} path Path to desired value in settings.
|
|
80
|
-
* @return {string} The value for defined setting.
|
|
81
|
-
*/
|
|
82
|
-
const removeCustomPrefixes = path => {
|
|
83
|
-
return prefixedFlags[path] || path;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* For settings like `color.palette`, which have a value that is an object
|
|
88
|
-
* with `default`, `theme`, `custom`, with field values that are arrays of
|
|
89
|
-
* items, merge these three arrays into one and return it. The calculation
|
|
90
|
-
* is memoized so that identical input values produce identical output.
|
|
91
|
-
* @param {Object} value Object to merge
|
|
92
|
-
* @return {Array} Array of merged items
|
|
93
|
-
*/
|
|
94
|
-
function mergeOrigins(value) {
|
|
95
|
-
let result = mergeCache.get(value);
|
|
96
|
-
if (!result) {
|
|
97
|
-
result = ['default', 'theme', 'custom'].flatMap(key => {
|
|
98
|
-
var _value$key;
|
|
99
|
-
return (_value$key = value[key]) !== null && _value$key !== void 0 ? _value$key : [];
|
|
100
|
-
});
|
|
101
|
-
mergeCache.set(value, result);
|
|
102
|
-
}
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
const mergeCache = new WeakMap();
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* For settings like `color.palette`, which have a value that is an object
|
|
109
|
-
* with `default`, `theme`, `custom`, with field values that are arrays of
|
|
110
|
-
* items, see if any of the three origins have values.
|
|
111
|
-
*
|
|
112
|
-
* @param {Object} value Object to check
|
|
113
|
-
* @return {boolean} Whether the object has values in any of the three origins
|
|
114
|
-
*/
|
|
115
|
-
function hasMergedOrigins(value) {
|
|
116
|
-
return ['default', 'theme', 'custom'].some(key => value?.[key]?.length);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
22
|
/**
|
|
120
23
|
* Hook that retrieves the given settings for the block instance in use.
|
|
121
24
|
*
|
|
@@ -131,73 +34,11 @@ function hasMergedOrigins(value) {
|
|
|
131
34
|
*/
|
|
132
35
|
function useSettings(...paths) {
|
|
133
36
|
const {
|
|
134
|
-
name: blockName,
|
|
135
37
|
clientId = null
|
|
136
38
|
} = (0, _blockEdit.useBlockEditContext)();
|
|
137
|
-
|
|
39
|
+
return (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getBlockSettings(clientId, ...paths),
|
|
138
40
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
139
|
-
|
|
140
|
-
return (0, _data.useSelect)(select => {
|
|
141
|
-
const candidates = clientId ? [clientId, ...select(_store.store).getBlockParents(clientId, /* ascending */true)].filter(candidateClientId => {
|
|
142
|
-
const candidateBlockName = select(_store.store).getBlockName(candidateClientId);
|
|
143
|
-
return (0, _blocks.hasBlockSupport)(candidateBlockName, '__experimentalSettings', false);
|
|
144
|
-
}) : [];
|
|
145
|
-
return paths.map(path => {
|
|
146
|
-
if (blockedPaths.includes(path)) {
|
|
147
|
-
// eslint-disable-next-line no-console
|
|
148
|
-
console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
|
|
149
|
-
return undefined;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// 0. Allow third parties to filter the block's settings at runtime.
|
|
153
|
-
let result = (0, _hooks.applyFilters)('blockEditor.useSetting.before', undefined, path, clientId, blockName);
|
|
154
|
-
if (undefined !== result) {
|
|
155
|
-
return result;
|
|
156
|
-
}
|
|
157
|
-
const normalizedPath = removeCustomPrefixes(path);
|
|
158
|
-
|
|
159
|
-
// 1. Take settings from the block instance or its ancestors.
|
|
160
|
-
// Start from the current block and work our way up the ancestors.
|
|
161
|
-
for (const candidateClientId of candidates) {
|
|
162
|
-
var _getValueFromObjectPa;
|
|
163
|
-
const candidateAtts = select(_store.store).getBlockAttributes(candidateClientId);
|
|
164
|
-
result = (_getValueFromObjectPa = (0, _object.getValueFromObjectPath)(candidateAtts.settings?.blocks?.[blockName], normalizedPath)) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : (0, _object.getValueFromObjectPath)(candidateAtts.settings, normalizedPath);
|
|
165
|
-
if (result !== undefined) {
|
|
166
|
-
// Stop the search for more distant ancestors and move on.
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// 2. Fall back to the settings from the block editor store (__experimentalFeatures).
|
|
172
|
-
const settings = select(_store.store).getSettings();
|
|
173
|
-
if (result === undefined && blockName) {
|
|
174
|
-
result = (0, _object.getValueFromObjectPath)(settings.__experimentalFeatures?.blocks?.[blockName], normalizedPath);
|
|
175
|
-
}
|
|
176
|
-
if (result === undefined) {
|
|
177
|
-
result = (0, _object.getValueFromObjectPath)(settings.__experimentalFeatures, normalizedPath);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Return if the setting was found in either the block instance or the store.
|
|
181
|
-
if (result !== undefined) {
|
|
182
|
-
if (_blocks.__EXPERIMENTAL_PATHS_WITH_MERGE[normalizedPath]) {
|
|
183
|
-
return mergeOrigins(result);
|
|
184
|
-
}
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// 3. Otherwise, use deprecated settings.
|
|
189
|
-
const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings);
|
|
190
|
-
if (deprecatedSettingsValue !== undefined) {
|
|
191
|
-
return deprecatedSettingsValue;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// 4. Fallback for typography.dropCap:
|
|
195
|
-
// This is only necessary to support typography.dropCap.
|
|
196
|
-
// when __experimentalFeatures are not present (core without plugin).
|
|
197
|
-
// To remove when __experimentalFeatures are ported to core.
|
|
198
|
-
return normalizedPath === 'typography.dropCap' ? true : undefined;
|
|
199
|
-
});
|
|
200
|
-
}, [blockName, clientId, paths]);
|
|
41
|
+
[clientId, ...paths]);
|
|
201
42
|
}
|
|
202
43
|
|
|
203
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_hooks","_blockEdit","_store","_object","blockedPaths","deprecatedFlags","settings","colors","gradients","disableCustomColors","undefined","disableCustomGradients","fontSizes","disableCustomFontSizes","enableCustomLineHeight","enableCustomUnits","enableCustomSpacing","prefixedFlags","removeCustomPrefixes","path","mergeOrigins","value","result","mergeCache","get","flatMap","key","_value$key","set","WeakMap","hasMergedOrigins","some","length","useSettings","paths","name","blockName","clientId","useBlockEditContext","useMemo","useSelect","select","candidates","blockEditorStore","getBlockParents","filter","candidateClientId","candidateBlockName","getBlockName","hasBlockSupport","map","includes","console","warn","applyFilters","normalizedPath","_getValueFromObjectPa","candidateAtts","getBlockAttributes","getValueFromObjectPath","blocks","getSettings","__experimentalFeatures","PATHS_WITH_MERGE","deprecatedSettingsValue","useSetting","deprecated","since","alternative","note"],"sources":["@wordpress/block-editor/src/components/use-settings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { useMemo } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\nimport { getValueFromObjectPath } from '../../utils/object';\n\nconst blockedPaths = [\n\t'color',\n\t'border',\n\t'dimensions',\n\t'typography',\n\t'spacing',\n];\n\nconst deprecatedFlags = {\n\t'color.palette': ( settings ) => settings.colors,\n\t'color.gradients': ( settings ) => settings.gradients,\n\t'color.custom': ( settings ) =>\n\t\tsettings.disableCustomColors === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomColors,\n\t'color.customGradient': ( settings ) =>\n\t\tsettings.disableCustomGradients === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomGradients,\n\t'typography.fontSizes': ( settings ) => settings.fontSizes,\n\t'typography.customFontSize': ( settings ) =>\n\t\tsettings.disableCustomFontSizes === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomFontSizes,\n\t'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,\n\t'spacing.units': ( settings ) => {\n\t\tif ( settings.enableCustomUnits === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( settings.enableCustomUnits === true ) {\n\t\t\treturn [ 'px', 'em', 'rem', 'vh', 'vw', '%' ];\n\t\t}\n\n\t\treturn settings.enableCustomUnits;\n\t},\n\t'spacing.padding': ( settings ) => settings.enableCustomSpacing,\n};\n\nconst prefixedFlags = {\n\t/*\n\t * These were only available in the plugin\n\t * and can be removed when the minimum WordPress version\n\t * for the plugin is 5.9.\n\t */\n\t'border.customColor': 'border.color',\n\t'border.customStyle': 'border.style',\n\t'border.customWidth': 'border.width',\n\t'typography.customFontStyle': 'typography.fontStyle',\n\t'typography.customFontWeight': 'typography.fontWeight',\n\t'typography.customLetterSpacing': 'typography.letterSpacing',\n\t'typography.customTextDecorations': 'typography.textDecoration',\n\t'typography.customTextTransforms': 'typography.textTransform',\n\t/*\n\t * These were part of WordPress 5.8 and we need to keep them.\n\t */\n\t'border.customRadius': 'border.radius',\n\t'spacing.customMargin': 'spacing.margin',\n\t'spacing.customPadding': 'spacing.padding',\n\t'typography.customLineHeight': 'typography.lineHeight',\n};\n\n/**\n * Remove `custom` prefixes for flags that did not land in 5.8.\n *\n * This provides continued support for `custom` prefixed properties. It will\n * be removed once third party devs have had sufficient time to update themes,\n * plugins, etc.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34485\n *\n * @param {string} path Path to desired value in settings.\n * @return {string} The value for defined setting.\n */\nconst removeCustomPrefixes = ( path ) => {\n\treturn prefixedFlags[ path ] || path;\n};\n\n/**\n * For settings like `color.palette`, which have a value that is an object\n * with `default`, `theme`, `custom`, with field values that are arrays of\n * items, merge these three arrays into one and return it. The calculation\n * is memoized so that identical input values produce identical output.\n * @param {Object} value Object to merge\n * @return {Array} Array of merged items\n */\nexport function mergeOrigins( value ) {\n\tlet result = mergeCache.get( value );\n\tif ( ! result ) {\n\t\tresult = [ 'default', 'theme', 'custom' ].flatMap(\n\t\t\t( key ) => value[ key ] ?? []\n\t\t);\n\t\tmergeCache.set( value, result );\n\t}\n\treturn result;\n}\nconst mergeCache = new WeakMap();\n\n/**\n * For settings like `color.palette`, which have a value that is an object\n * with `default`, `theme`, `custom`, with field values that are arrays of\n * items, see if any of the three origins have values.\n *\n * @param {Object} value Object to check\n * @return {boolean} Whether the object has values in any of the three origins\n */\nexport function hasMergedOrigins( value ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => value?.[ key ]?.length\n\t);\n}\n\n/**\n * Hook that retrieves the given settings for the block instance in use.\n *\n * It looks up the settings first in the block instance hierarchy.\n * If none are found, it'll look them up in the block editor settings.\n *\n * @param {string[]} paths The paths to the settings.\n * @return {any[]} Returns the values defined for the settings.\n * @example\n * ```js\n * const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' );\n * ```\n */\nexport function useSettings( ...paths ) {\n\tconst { name: blockName, clientId = null } = useBlockEditContext();\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tpaths = useMemo( () => paths, paths );\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst candidates = clientId\n\t\t\t\t? [\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...select( blockEditorStore ).getBlockParents(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t/* ascending */ true\n\t\t\t\t\t\t),\n\t\t\t\t ].filter( ( candidateClientId ) => {\n\t\t\t\t\t\tconst candidateBlockName =\n\t\t\t\t\t\t\tselect( blockEditorStore ).getBlockName(\n\t\t\t\t\t\t\t\tcandidateClientId\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\treturn hasBlockSupport(\n\t\t\t\t\t\t\tcandidateBlockName,\n\t\t\t\t\t\t\t'__experimentalSettings',\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t } )\n\t\t\t\t: [];\n\n\t\t\treturn paths.map( ( path ) => {\n\t\t\t\tif ( blockedPaths.includes( path ) ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t'Top level useSetting paths are disabled. Please use a subpath to query the information needed.'\n\t\t\t\t\t);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\t// 0. Allow third parties to filter the block's settings at runtime.\n\t\t\t\tlet result = applyFilters(\n\t\t\t\t\t'blockEditor.useSetting.before',\n\t\t\t\t\tundefined,\n\t\t\t\t\tpath,\n\t\t\t\t\tclientId,\n\t\t\t\t\tblockName\n\t\t\t\t);\n\n\t\t\t\tif ( undefined !== result ) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tconst normalizedPath = removeCustomPrefixes( path );\n\n\t\t\t\t// 1. Take settings from the block instance or its ancestors.\n\t\t\t\t// Start from the current block and work our way up the ancestors.\n\t\t\t\tfor ( const candidateClientId of candidates ) {\n\t\t\t\t\tconst candidateAtts =\n\t\t\t\t\t\tselect( blockEditorStore ).getBlockAttributes(\n\t\t\t\t\t\t\tcandidateClientId\n\t\t\t\t\t\t);\n\t\t\t\t\tresult =\n\t\t\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\t\t\tcandidateAtts.settings?.blocks?.[ blockName ],\n\t\t\t\t\t\t\tnormalizedPath\n\t\t\t\t\t\t) ??\n\t\t\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\t\t\tcandidateAtts.settings,\n\t\t\t\t\t\t\tnormalizedPath\n\t\t\t\t\t\t);\n\t\t\t\t\tif ( result !== undefined ) {\n\t\t\t\t\t\t// Stop the search for more distant ancestors and move on.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// 2. Fall back to the settings from the block editor store (__experimentalFeatures).\n\t\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\t\tif ( result === undefined && blockName ) {\n\t\t\t\t\tresult = getValueFromObjectPath(\n\t\t\t\t\t\tsettings.__experimentalFeatures?.blocks?.[ blockName ],\n\t\t\t\t\t\tnormalizedPath\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( result === undefined ) {\n\t\t\t\t\tresult = getValueFromObjectPath(\n\t\t\t\t\t\tsettings.__experimentalFeatures,\n\t\t\t\t\t\tnormalizedPath\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Return if the setting was found in either the block instance or the store.\n\t\t\t\tif ( result !== undefined ) {\n\t\t\t\t\tif ( PATHS_WITH_MERGE[ normalizedPath ] ) {\n\t\t\t\t\t\treturn mergeOrigins( result );\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\t// 3. Otherwise, use deprecated settings.\n\t\t\t\tconst deprecatedSettingsValue =\n\t\t\t\t\tdeprecatedFlags[ normalizedPath ]?.( settings );\n\t\t\t\tif ( deprecatedSettingsValue !== undefined ) {\n\t\t\t\t\treturn deprecatedSettingsValue;\n\t\t\t\t}\n\n\t\t\t\t// 4. Fallback for typography.dropCap:\n\t\t\t\t// This is only necessary to support typography.dropCap.\n\t\t\t\t// when __experimentalFeatures are not present (core without plugin).\n\t\t\t\t// To remove when __experimentalFeatures are ported to core.\n\t\t\t\treturn normalizedPath === 'typography.dropCap'\n\t\t\t\t\t? true\n\t\t\t\t\t: undefined;\n\t\t\t} );\n\t\t},\n\t\t[ blockName, clientId, paths ]\n\t);\n}\n\n/**\n * Hook that retrieves the given setting for the block instance in use.\n *\n * It looks up the setting first in the block instance hierarchy.\n * If none is found, it'll look it up in the block editor settings.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @deprecated 6.5.0 Use useSettings instead.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport function useSetting( path ) {\n\tdeprecated( 'wp.blockEditor.useSetting', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useSettings',\n\t\tnote: 'The new useSettings function can retrieve multiple settings at once, with better performance.',\n\t} );\n\n\tconst [ value ] = useSettings( path );\n\treturn value;\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAjBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMS,YAAY,GAAG,CACpB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,CACT;AAED,MAAMC,eAAe,GAAG;EACvB,eAAe,EAAIC,QAAQ,IAAMA,QAAQ,CAACC,MAAM;EAChD,iBAAiB,EAAID,QAAQ,IAAMA,QAAQ,CAACE,SAAS;EACrD,cAAc,EAAIF,QAAQ,IACzBA,QAAQ,CAACG,mBAAmB,KAAKC,SAAS,G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names":["_data","require","_deprecated","_interopRequireDefault","_blockEdit","_store","_lockUnlock","useSettings","paths","clientId","useBlockEditContext","useSelect","select","unlock","blockEditorStore","getBlockSettings","useSetting","path","deprecated","since","alternative","note","value"],"sources":["@wordpress/block-editor/src/components/use-settings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Hook that retrieves the given settings for the block instance in use.\n *\n * It looks up the settings first in the block instance hierarchy.\n * If none are found, it'll look them up in the block editor settings.\n *\n * @param {string[]} paths The paths to the settings.\n * @return {any[]} Returns the values defined for the settings.\n * @example\n * ```js\n * const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' );\n * ```\n */\nexport function useSettings( ...paths ) {\n\tconst { clientId = null } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getBlockSettings(\n\t\t\t\tclientId,\n\t\t\t\t...paths\n\t\t\t),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ clientId, ...paths ]\n\t);\n}\n\n/**\n * Hook that retrieves the given setting for the block instance in use.\n *\n * It looks up the setting first in the block instance hierarchy.\n * If none is found, it'll look it up in the block editor settings.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @deprecated 6.5.0 Use useSettings instead.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport function useSetting( path ) {\n\tdeprecated( 'wp.blockEditor.useSetting', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useSettings',\n\t\tnote: 'The new useSettings function can retrieve multiple settings at once, with better performance.',\n\t} );\n\n\tconst [ value ] = useSettings( path );\n\treturn value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAAE,GAAGC,KAAK,EAAG;EACvC,MAAM;IAAEC,QAAQ,GAAG;EAAK,CAAC,GAAG,IAAAC,8BAAmB,EAAC,CAAC;EACjD,OAAO,IAAAC,eAAS,EACbC,MAAM,IACP,IAAAC,kBAAM,EAAED,MAAM,CAAEE,YAAiB,CAAE,CAAC,CAACC,gBAAgB,CACpDN,QAAQ,EACR,GAAGD,KACJ,CAAC;EACF;EACA,CAAEC,QAAQ,EAAE,GAAGD,KAAK,CACrB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,UAAUA,CAAEC,IAAI,EAAG;EAClC,IAAAC,mBAAU,EAAE,2BAA2B,EAAE;IACxCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,4BAA4B;IACzCC,IAAI,EAAE;EACP,CAAE,CAAC;EAEH,MAAM,CAAEC,KAAK,CAAE,GAAGf,WAAW,CAAEU,IAAK,CAAC;EACrC,OAAOK,KAAK;AACb"}
|
|
@@ -9,12 +9,11 @@ var _components = require("@wordpress/components");
|
|
|
9
9
|
/**
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
|
-
var _default = (0, _react.createElement)(_components.SVG, {
|
|
12
|
+
var _default = exports.default = (0, _react.createElement)(_components.SVG, {
|
|
13
13
|
viewBox: "0 0 24 24",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg"
|
|
15
15
|
}, (0, _react.createElement)(_components.Path, {
|
|
16
16
|
d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-2 14.5v-9l6 4.5z",
|
|
17
17
|
fill: "white"
|
|
18
18
|
}));
|
|
19
|
-
exports.default = _default;
|
|
20
19
|
//# sourceMappingURL=gridicon-play.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_default","_react","createElement","SVG","viewBox","xmlns","Path","d","fill"
|
|
1
|
+
{"version":3,"names":["_components","require","_default","exports","default","_react","createElement","SVG","viewBox","xmlns","Path","d","fill"],"sources":["@wordpress/block-editor/src/components/video-player/gridicon-play.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport default (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Path\n\t\t\td=\"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-2 14.5v-9l6 4.5z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</SVG>\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,GAAG;EAACC,OAAO,EAAC,WAAW;EAACC,KAAK,EAAC;AAA4B,GAC1D,IAAAJ,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAU,IAAI;EACJC,CAAC,EAAC,6DAA6D;EAC/DC,IAAI,EAAC;AAAO,CACZ,CACG,CAAC"}
|
|
@@ -26,8 +26,7 @@ var _gridiconPlay = _interopRequireDefault(require("./gridicon-play"));
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
// Default Video ratio 16:9
|
|
29
|
-
const VIDEO_ASPECT_RATIO = 16 / 9;
|
|
30
|
-
exports.VIDEO_ASPECT_RATIO = VIDEO_ASPECT_RATIO;
|
|
29
|
+
const VIDEO_ASPECT_RATIO = exports.VIDEO_ASPECT_RATIO = 16 / 9;
|
|
31
30
|
class Video extends _element.Component {
|
|
32
31
|
constructor() {
|
|
33
32
|
super(...arguments);
|
|
@@ -129,6 +128,5 @@ class Video extends _element.Component {
|
|
|
129
128
|
})));
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
var _default = Video;
|
|
133
|
-
exports.default = _default;
|
|
131
|
+
var _default = exports.default = Video;
|
|
134
132
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_reactNative","_reactNativeVideo","_interopRequireDefault","_styles","_gridiconPlay","VIDEO_ASPECT_RATIO","exports","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","__","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","_react","createElement","View","styles","videoContainer","default","ref","controls","ignoreSilentSwitch","paused","onLayout","onFullscreenPlayerWillPresent","onFullscreenPlayerDidDismiss","TouchableOpacity","disabled","onPress","overlayContainer","blackOverlay","Icon","icon","PlayIcon","playIcon","size","_default"],"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AAjBA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACO,MAAMQ,kBAAkB,
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_reactNative","_reactNativeVideo","_interopRequireDefault","_styles","_gridiconPlay","VIDEO_ASPECT_RATIO","exports","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","__","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","_react","createElement","View","styles","videoContainer","default","ref","controls","ignoreSilentSwitch","paused","onLayout","onFullscreenPlayerWillPresent","onFullscreenPlayerDidDismiss","TouchableOpacity","disabled","onPress","overlayContainer","blackOverlay","Icon","icon","PlayIcon","playIcon","size","_default"],"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAA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,EAAG,KAAO;MAClBC,kBAAkB,EAAG,QAAU;MAC/BC,MAAM,EAAG,CAAE3C,YAAc;MACzB4C,QAAQ,EAAG,IAAI,CAACxC,aAAe;MAC/ByC,6BAA6B,EAAGA,CAAA,KAAM;QACrC,IAAI,CAACpC,QAAQ,CAAE;UAAET,YAAY,EAAE;QAAK,CAAE,CAAC;MACxC,CAAG;MACH8C,4BAA4B,EAAGA,CAAA,KAAM;QACpC,IAAI,CAACrC,QAAQ,CAAE;UAAET,YAAY,EAAE;QAAM,CAAE,CAAC;MACzC;IAAG,CACH,CAAC,EACAiC,cAAc;IACf;IACA;IACA,IAAAC,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAA8D,gBAAgB;MAChBC,QAAQ,EAAG,CAAEjB,UAAY;MACzBkB,OAAO,EAAG,IAAI,CAAC/C,WAAa;MAC5B8B,KAAK,EAAG,CAAEA,KAAK,EAAEK,eAAM,CAACa,gBAAgB;IAAI,GAE5C,IAAAhB,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAAmD,IAAI;MAACJ,KAAK,EAAGK,eAAM,CAACc;IAAc,CAAE,CAAC,EACtC,IAAAjB,MAAA,CAAAC,aAAA,EAACpD,WAAA,CAAAqE,IAAI;MACJC,IAAI,EAAGC,qBAAU;MACjBtB,KAAK,EAAGK,eAAM,CAACkB,QAAU;MACzBC,IAAI,EAAGnB,eAAM,CAACkB,QAAQ,CAACC;IAAM,CAC7B,CACgB,CAEd,CAAC;EAET;AACD;AAAC,IAAAC,QAAA,GAAAlE,OAAA,CAAAgD,OAAA,GAEc/C,KAAK"}
|
|
@@ -59,6 +59,5 @@ function Warning({
|
|
|
59
59
|
/**
|
|
60
60
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md
|
|
61
61
|
*/
|
|
62
|
-
var _default = Warning;
|
|
63
|
-
exports.default = _default;
|
|
62
|
+
var _default = exports.default = Warning;
|
|
64
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_icons","Warning","className","actions","children","secondaryActions","_react","createElement","style","display","all","classnames","Children","count","map","action","i","key","DropdownMenu","icon","moreVertical","label","__","popoverProps","position","noIcons","MenuGroup","item","pos","MenuItem","onClick","title","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/warning/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div style={ { display: 'contents', all: 'initial' } }>\n\t\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t\t<p className=\"block-editor-warning__message\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASK,OAAO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CAAAC,aAAA,EAACT,WAAA,CAAA+B,QAAQ;IACRC,OAAO,EAAGH,IAAI,CAACG,OAAS;IACxBb,GAAG,EAAGW;EAAK,GAETD,IAAI,CAACI,KACE,CAEZ,CACU,CAEC,CAEX,CAEF,CACD,CACD,CAAC;AAER;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_icons","Warning","className","actions","children","secondaryActions","_react","createElement","style","display","all","classnames","Children","count","map","action","i","key","DropdownMenu","icon","moreVertical","label","__","popoverProps","position","noIcons","MenuGroup","item","pos","MenuItem","onClick","title","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/warning/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div style={ { display: 'contents', all: 'initial' } }>\n\t\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t\t<p className=\"block-editor-warning__message\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC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aAAa;MACvBtB,SAAS,EACR;IACF,CAAG;IACHuB,OAAO;EAAA,GAEL,MACD,IAAAnB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA4B,SAAS,QACPrB,gBAAgB,CAACS,GAAG,CACrB,CAAEa,IAAI,EAAEC,GAAG,KACV,IAAAtB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA+B,QAAQ;IACRC,OAAO,EAAGH,IAAI,CAACG,OAAS;IACxBb,GAAG,EAAGW;EAAK,GAETD,IAAI,CAACI,KACE,CAEZ,CACU,CAEC,CAEX,CAEF,CACD,CACD,CAAC;AAER;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGejC,OAAO"}
|
|
@@ -50,6 +50,5 @@ function Warning({
|
|
|
50
50
|
style: messageStyle
|
|
51
51
|
}, message));
|
|
52
52
|
}
|
|
53
|
-
var _default = (0, _compose.withPreferredColorScheme)(Warning);
|
|
54
|
-
exports.default = _default;
|
|
53
|
+
var _default = exports.default = (0, _compose.withPreferredColorScheme)(Warning);
|
|
55
54
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_components","_compose","_blocks","_style","_interopRequireDefault","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","normalizeIconObject","internalIconClass","titleStyle","styles","titleDark","messageStyle","messageDark","_react","createElement","View","style","container","containerDark","Icon","className","src","Text","_default","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_components","_compose","_blocks","_style","_interopRequireDefault","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","normalizeIconObject","internalIconClass","titleStyle","styles","titleDark","messageStyle","messageDark","_react","createElement","View","style","container","containerDark","Icon","className","src","Text","_default","exports","default","withPreferredColorScheme"],"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { normalizeIconObject } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nfunction Warning( {\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\tconst titleStyle = getStylesFromColorScheme(\n\t\tstyles.title,\n\t\tstyles.titleDark\n\t);\n\tconst messageStyle = getStylesFromColorScheme(\n\t\tstyles.message,\n\t\tstyles.messageDark\n\t);\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t\t{ ...viewProps }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<View style={ styles.icon }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={ iconClass || internalIconClass }\n\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ title && <Text style={ titleStyle }>{ title }</Text> }\n\t\t\t{ message && <Text style={ messageStyle }>{ message }</Text> }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASM,OAAOA,CAAE;EACjBC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,oB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
|
|
|
69
69
|
* @param {Object} props Component properties.
|
|
70
70
|
* @param {Element} props.children Children to be rendered.
|
|
71
71
|
*/
|
|
72
|
-
var _default = (0, _element.forwardRef)(WritingFlow);
|
|
73
|
-
exports.default = _default;
|
|
72
|
+
var _default = exports.default = (0, _element.forwardRef)(WritingFlow);
|
|
74
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_i18n","_compose","_element","_useMultiSelection","_useTabNav","_useArrowNav","_useSelectAll","_useDragSelection","_useSelectionObserver","_useClickSelection","_useInput","_useClipboardHandler","_store","useWritingFlow","before","ref","after","useTabNav","hasMultiSelection","useSelect","select","blockEditorStore","useMergeRefs","useClipboardHandler","useInput","useDragSelection","useSelectionObserver","useClickSelection","useMultiSelection","useSelectAll","useArrowNav","useRefEffect","node","tabIndex","classList","add","setAttribute","__","remove","removeAttribute","WritingFlow","children","props","forwardedRef","_react","createElement","Fragment","className","classNames","_default","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_i18n","_compose","_element","_useMultiSelection","_useTabNav","_useArrowNav","_useSelectAll","_useDragSelection","_useSelectionObserver","_useClickSelection","_useInput","_useClipboardHandler","_store","useWritingFlow","before","ref","after","useTabNav","hasMultiSelection","useSelect","select","blockEditorStore","useMergeRefs","useClipboardHandler","useInput","useDragSelection","useSelectionObserver","useClickSelection","useMultiSelection","useSelectAll","useArrowNav","useRefEffect","node","tabIndex","classList","add","setAttribute","__","remove","removeAttribute","WritingFlow","children","props","forwardedRef","_react","createElement","Fragment","className","classNames","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMultiSelection from './use-multi-selection';\nimport useTabNav from './use-tab-nav';\nimport useArrowNav from './use-arrow-nav';\nimport useSelectAll from './use-select-all';\nimport useDragSelection from './use-drag-selection';\nimport useSelectionObserver from './use-selection-observer';\nimport useClickSelection from './use-click-selection';\nimport useInput from './use-input';\nimport useClipboardHandler from './use-clipboard-handler';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useWritingFlow() {\n\tconst [ before, ref, after ] = useTabNav();\n\tconst hasMultiSelection = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasMultiSelection(),\n\t\t[]\n\t);\n\n\treturn [\n\t\tbefore,\n\t\tuseMergeRefs( [\n\t\t\tref,\n\t\t\tuseClipboardHandler(),\n\t\t\tuseInput(),\n\t\t\tuseDragSelection(),\n\t\t\tuseSelectionObserver(),\n\t\t\tuseClickSelection(),\n\t\t\tuseMultiSelection(),\n\t\t\tuseSelectAll(),\n\t\t\tuseArrowNav(),\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tnode.tabIndex = 0;\n\n\t\t\t\t\tif ( ! hasMultiSelection ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.classList.add( 'has-multi-selection' );\n\t\t\t\t\tnode.setAttribute(\n\t\t\t\t\t\t'aria-label',\n\t\t\t\t\t\t__( 'Multiple selected blocks' )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tnode.classList.remove( 'has-multi-selection' );\n\t\t\t\t\t\tnode.removeAttribute( 'aria-label' );\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ hasMultiSelection ]\n\t\t\t),\n\t\t] ),\n\t\tafter,\n\t];\n}\n\nfunction WritingFlow( { children, ...props }, forwardedRef ) {\n\tconst [ before, ref, after ] = useWritingFlow();\n\treturn (\n\t\t<>\n\t\t\t{ before }\n\t\t\t<div\n\t\t\t\t{ ...props }\n\t\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\t\tclassName={ classNames(\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'block-editor-writing-flow'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t\t{ after }\n\t\t</>\n\t);\n}\n\n/**\n * Handles selection and navigation across blocks. This component should be\n * wrapped around BlockList.\n *\n * @param {Object} props Component properties.\n * @param {Element} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,aAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,qBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,oBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAYO,SAASe,cAAcA,CAAA,EAAG;EAChC,MAAM,CAAEC,MAAM,EAAEC,GAAG,EAAEC,KAAK,CAAE,GAAG,IAAAC,kBAAS,EAAC,CAAC;EAC1C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CA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,EAAG,IAAAC,mBAAU,EACrBN,KAAK,CAACK,SAAS,EACf,2BACD;EAAG,GAEDN,QACE,CAAC,EACJzB,KACD,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAAAiC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAOe,IAAAC,mBAAU,EAAEZ,WAAY,CAAC"}
|
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useClipboardHandler;
|
|
7
|
-
var _blocks = require("@wordpress/blocks");
|
|
8
7
|
var _dom = require("@wordpress/dom");
|
|
9
8
|
var _data = require("@wordpress/data");
|
|
10
9
|
var _compose = require("@wordpress/compose");
|
|
11
|
-
var _pasting = require("../../utils/pasting");
|
|
12
10
|
var _store = require("../../store");
|
|
13
11
|
var _useNotifyCopy = require("../../utils/use-notify-copy");
|
|
12
|
+
var _utils = require("./utils");
|
|
14
13
|
/**
|
|
15
14
|
* WordPress dependencies
|
|
16
15
|
*/
|
|
@@ -94,13 +93,7 @@ function useClipboardHandler() {
|
|
|
94
93
|
const inBetweenBlocks = getBlocksByClientId(selectedBlockClientIds.slice(1, selectedBlockClientIds.length - 1));
|
|
95
94
|
blocks = [head, ...inBetweenBlocks, tail];
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
if (wrapperBlockName) {
|
|
99
|
-
blocks = (0, _blocks.createBlock)(wrapperBlockName, JSON.parse(event.clipboardData.getData('__unstableWrapperBlockAttributes')), blocks);
|
|
100
|
-
}
|
|
101
|
-
const serialized = (0, _blocks.serialize)(blocks);
|
|
102
|
-
event.clipboardData.setData('text/plain', toPlainText(serialized));
|
|
103
|
-
event.clipboardData.setData('text/html', serialized);
|
|
96
|
+
(0, _utils.setClipboardBlocks)(event, blocks);
|
|
104
97
|
}
|
|
105
98
|
}
|
|
106
99
|
if (event.type === 'cut') {
|
|
@@ -117,29 +110,7 @@ function useClipboardHandler() {
|
|
|
117
110
|
const {
|
|
118
111
|
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML
|
|
119
112
|
} = getSettings();
|
|
120
|
-
const
|
|
121
|
-
plainText,
|
|
122
|
-
html,
|
|
123
|
-
files
|
|
124
|
-
} = (0, _pasting.getPasteEventData)(event);
|
|
125
|
-
let blocks = [];
|
|
126
|
-
if (files.length) {
|
|
127
|
-
const fromTransforms = (0, _blocks.getBlockTransforms)('from');
|
|
128
|
-
blocks = files.reduce((accumulator, file) => {
|
|
129
|
-
const transformation = (0, _blocks.findTransform)(fromTransforms, transform => transform.type === 'files' && transform.isMatch([file]));
|
|
130
|
-
if (transformation) {
|
|
131
|
-
accumulator.push(transformation.transform([file]));
|
|
132
|
-
}
|
|
133
|
-
return accumulator;
|
|
134
|
-
}, []).flat();
|
|
135
|
-
} else {
|
|
136
|
-
blocks = (0, _blocks.pasteHandler)({
|
|
137
|
-
HTML: html,
|
|
138
|
-
plainText,
|
|
139
|
-
mode: 'BLOCKS',
|
|
140
|
-
canUserUseUnfilteredHTML
|
|
141
|
-
});
|
|
142
|
-
}
|
|
113
|
+
const blocks = (0, _utils.getPasteBlocks)(event, canUserUseUnfilteredHTML);
|
|
143
114
|
if (selectedBlockClientIds.length === 1) {
|
|
144
115
|
const [selectedBlockClientId] = selectedBlockClientIds;
|
|
145
116
|
if (blocks.every(block => canInsertBlockType(block.name, selectedBlockClientId))) {
|
|
@@ -160,20 +131,4 @@ function useClipboardHandler() {
|
|
|
160
131
|
};
|
|
161
132
|
}, []);
|
|
162
133
|
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Given a string of HTML representing serialized blocks, returns the plain
|
|
166
|
-
* text extracted after stripping the HTML of any tags and fixing line breaks.
|
|
167
|
-
*
|
|
168
|
-
* @param {string} html Serialized blocks.
|
|
169
|
-
* @return {string} The plain-text content with any html removed.
|
|
170
|
-
*/
|
|
171
|
-
function toPlainText(html) {
|
|
172
|
-
// Manually handle BR tags as line breaks prior to `stripHTML` call
|
|
173
|
-
html = html.replace(/<br>/g, '\n');
|
|
174
|
-
const plainText = (0, _dom.__unstableStripHTML)(html).trim();
|
|
175
|
-
|
|
176
|
-
// Merge any consecutive line breaks
|
|
177
|
-
return plainText.replace(/\n\n+/g, '\n\n');
|
|
178
|
-
}
|
|
179
134
|
//# sourceMappingURL=use-clipboard-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_dom","_data","_compose","_pasting","_store","_useNotifyCopy","useClipboardHandler","getBlocksByClientId","getSelectedBlockClientIds","hasMultiSelection","getSettings","__unstableIsFullySelected","__unstableIsSelectionCollapsed","__unstableIsSelectionMergeable","__unstableGetSelectedBlocksWithPartialSelection","canInsertBlockType","useSelect","blockEditorStore","flashBlock","removeBlocks","replaceBlocks","__unstableDeleteSelection","__unstableExpandSelection","insertBlocks","useDispatch","notifyCopy","useNotifyCopy","useRefEffect","node","handler","event","defaultPrevented","selectedBlockClientIds","length","target","ownerDocument","hasSelection","type","documentHasUncollapsedSelection","documentHasSelection","contains","activeElement","preventDefault","isSelectionMergeable","shouldHandleWholeBlocks","expandSelectionIsNeeded","blocks","head","tail","inBetweenBlocks","slice","wrapperBlockName","clipboardData","getData","createBlock","JSON","parse","serialized","serialize","setData","toPlainText","contentEditable","__experimentalCanUserUseUnfilteredHTML","canUserUseUnfilteredHTML","plainText","html","files","getPasteEventData","fromTransforms","getBlockTransforms","reduce","accumulator","file","transformation","findTransform","transform","isMatch","push","flat","pasteHandler","HTML","mode","selectedBlockClientId","every","block","name","undefined","addEventListener","removeEventListener","replace","stripHTML","trim"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-clipboard-handler.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tserialize,\n\tpasteHandler,\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n} from '@wordpress/blocks';\nimport {\n\tdocumentHasSelection,\n\tdocumentHasUncollapsedSelection,\n\t__unstableStripHTML as stripHTML,\n} from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { getPasteEventData } from '../../utils/pasting';\nimport { store as blockEditorStore } from '../../store';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\n\nexport default function useClipboardHandler() {\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSettings,\n\t\t__unstableIsFullySelected,\n\t\t__unstableIsSelectionCollapsed,\n\t\t__unstableIsSelectionMergeable,\n\t\t__unstableGetSelectedBlocksWithPartialSelection,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tflashBlock,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\tinsertBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction handler( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\t// This was likely already handled in rich-text/use-paste-handler.js.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\tif ( selectedBlockClientIds.length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Always handle multiple selected blocks.\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tconst { target } = event;\n\t\t\t\tconst { ownerDocument } = target;\n\t\t\t\t// If copying, only consider actual text selection as selection.\n\t\t\t\t// Otherwise, any focus on an input field is considered.\n\t\t\t\tconst hasSelection =\n\t\t\t\t\tevent.type === 'copy' || event.type === 'cut'\n\t\t\t\t\t\t? documentHasUncollapsedSelection( ownerDocument )\n\t\t\t\t\t\t: documentHasSelection( ownerDocument );\n\n\t\t\t\t// Let native copy behaviour take over in input fields.\n\t\t\t\tif ( hasSelection ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! node.contains( event.target.ownerDocument.activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconst isSelectionMergeable = __unstableIsSelectionMergeable();\n\t\t\tconst shouldHandleWholeBlocks =\n\t\t\t\t__unstableIsSelectionCollapsed() || __unstableIsFullySelected();\n\t\t\tconst expandSelectionIsNeeded =\n\t\t\t\t! shouldHandleWholeBlocks && ! isSelectionMergeable;\n\t\t\tif ( event.type === 'copy' || event.type === 'cut' ) {\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tflashBlock( selectedBlockClientIds[ 0 ] );\n\t\t\t\t}\n\t\t\t\t// If we have a partial selection that is not mergeable, just\n\t\t\t\t// expand the selection to the whole blocks.\n\t\t\t\tif ( expandSelectionIsNeeded ) {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t} else {\n\t\t\t\t\tnotifyCopy( event.type, selectedBlockClientIds );\n\t\t\t\t\tlet blocks;\n\t\t\t\t\t// Check if we have partial selection.\n\t\t\t\t\tif ( shouldHandleWholeBlocks ) {\n\t\t\t\t\t\tblocks = getBlocksByClientId( selectedBlockClientIds );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [ head, tail ] =\n\t\t\t\t\t\t\t__unstableGetSelectedBlocksWithPartialSelection();\n\t\t\t\t\t\tconst inBetweenBlocks = getBlocksByClientId(\n\t\t\t\t\t\t\tselectedBlockClientIds.slice(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length - 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tblocks = [ head, ...inBetweenBlocks, tail ];\n\t\t\t\t\t}\n\n\t\t\t\t\tconst wrapperBlockName = event.clipboardData.getData(\n\t\t\t\t\t\t'__unstableWrapperBlockName'\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( wrapperBlockName ) {\n\t\t\t\t\t\tblocks = createBlock(\n\t\t\t\t\t\t\twrapperBlockName,\n\t\t\t\t\t\t\tJSON.parse(\n\t\t\t\t\t\t\t\tevent.clipboardData.getData(\n\t\t\t\t\t\t\t\t\t'__unstableWrapperBlockAttributes'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tblocks\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst serialized = serialize( blocks );\n\n\t\t\t\t\tevent.clipboardData.setData(\n\t\t\t\t\t\t'text/plain',\n\t\t\t\t\t\ttoPlainText( serialized )\n\t\t\t\t\t);\n\t\t\t\t\tevent.clipboardData.setData( 'text/html', serialized );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( event.type === 'cut' ) {\n\t\t\t\t// We need to also check if at the start we needed to\n\t\t\t\t// expand the selection, as in this point we might have\n\t\t\t\t// programmatically fully selected the blocks above.\n\t\t\t\tif ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) {\n\t\t\t\t\tremoveBlocks( selectedBlockClientIds );\n\t\t\t\t} else {\n\t\t\t\t\tevent.target.ownerDocument.activeElement.contentEditable = false;\n\t\t\t\t\t__unstableDeleteSelection();\n\t\t\t\t}\n\t\t\t} else if ( event.type === 'paste' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalCanUserUseUnfilteredHTML:\n\t\t\t\t\t\tcanUserUseUnfilteredHTML,\n\t\t\t\t} = getSettings();\n\t\t\t\tconst { plainText, html, files } = getPasteEventData( event );\n\t\t\t\tlet blocks = [];\n\n\t\t\t\tif ( files.length ) {\n\t\t\t\t\tconst fromTransforms = getBlockTransforms( 'from' );\n\t\t\t\t\tblocks = files\n\t\t\t\t\t\t.reduce( ( accumulator, file ) => {\n\t\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\t\tfromTransforms,\n\t\t\t\t\t\t\t\t( transform ) =>\n\t\t\t\t\t\t\t\t\ttransform.type === 'files' &&\n\t\t\t\t\t\t\t\t\ttransform.isMatch( [ file ] )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t\t\ttransformation.transform( [ file ] )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn accumulator;\n\t\t\t\t\t\t}, [] )\n\t\t\t\t\t\t.flat();\n\t\t\t\t} else {\n\t\t\t\t\tblocks = pasteHandler( {\n\t\t\t\t\t\tHTML: html,\n\t\t\t\t\t\tplainText,\n\t\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\t\tcanUserUseUnfilteredHTML,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tconst [ selectedBlockClientId ] = selectedBlockClientIds;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.every( ( block ) =>\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\tblocks,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlockClientIds,\n\t\t\t\t\tblocks,\n\t\t\t\t\tblocks.length - 1,\n\t\t\t\t\t-1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tnode.ownerDocument.addEventListener( 'copy', handler );\n\t\tnode.ownerDocument.addEventListener( 'cut', handler );\n\t\tnode.ownerDocument.addEventListener( 'paste', handler );\n\n\t\treturn () => {\n\t\t\tnode.ownerDocument.removeEventListener( 'copy', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'cut', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'paste', handler );\n\t\t};\n\t}, [] );\n}\n\n/**\n * Given a string of HTML representing serialized blocks, returns the plain\n * text extracted after stripping the HTML of any tags and fixing line breaks.\n *\n * @param {string} html Serialized blocks.\n * @return {string} The plain-text content with any html removed.\n */\nfunction toPlainText( html ) {\n\t// Manually handle BR tags as line breaks prior to `stripHTML` call\n\thtml = html.replace( /<br>/g, '\\n' );\n\n\tconst plainText = stripHTML( html ).trim();\n\n\t// Merge any consecutive line breaks\n\treturn plainText.replace( /\\n\\n+/g, '\\n\\n' );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAvBA;AACA;AACA;;AAgBA;AACA;AACA;;AAKe,SAASO,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IACLC,mBAAmB;IACnBC,yBAAyB;IACzBC,iBAAiB;IACjBC,WAAW;IACXC,yBAAyB;IACzBC,8BAA8B;IAC9BC,8BAA8B;IAC9BC,+CAA+C;IAC/CC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAiB,CAAC;EACjC,MAAM;IACLC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,yBAAyB;IACzBC,yBAAyB;IACzBC;EACD,CAAC,GAAG,IAAAC,iBAAW,EAAEP,YAAiB,CAAC;EACnC,MAAMQ,UAAU,GAAG,IAAAC,4BAAa,EAAC,CAAC;EAElC,OAAO,IAAAC,qBAAY,EAAIC,IAAI,IAAM;IAChC,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,IA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Bc,MAAM,EACNA,MAAM,CAACb,MAAM,GAAG,CAAC,EACjB,CAAC,CACF,CAAC;MACF;IACD;IAEAL,IAAI,CAACO,aAAa,CAACoD,gBAAgB,CAAE,MAAM,EAAE1D,OAAQ,CAAC;IACtDD,IAAI,CAACO,aAAa,CAACoD,gBAAgB,CAAE,KAAK,EAAE1D,OAAQ,CAAC;IACrDD,IAAI,CAACO,aAAa,CAACoD,gBAAgB,CAAE,OAAO,EAAE1D,OAAQ,CAAC;IAEvD,OAAO,MAAM;MACZD,IAAI,CAACO,aAAa,CAACqD,mBAAmB,CAAE,MAAM,EAAE3D,OAAQ,CAAC;MACzDD,IAAI,CAACO,aAAa,CAACqD,mBAAmB,CAAE,KAAK,EAAE3D,OAAQ,CAAC;MACxDD,IAAI,CAACO,aAAa,CAACqD,mBAAmB,CAAE,OAAO,EAAE3D,OAAQ,CAAC;IAC3D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS+B,WAAWA,CAAEK,IAAI,EAAG;EAC5B;EACAA,IAAI,GAAGA,IAAI,CAACwB,OAAO,CAAE,OAAO,EAAE,IAAK,CAAC;EAEpC,MAAMzB,SAAS,GAAG,IAAA0B,wBAAS,EAAEzB,IAAK,CAAC,CAAC0B,IAAI,CAAC,CAAC;;EAE1C;EACA,OAAO3B,SAAS,CAACyB,OAAO,CAAE,QAAQ,EAAE,MAAO,CAAC;AAC7C"}
|
|
1
|
+
{"version":3,"names":["_dom","require","_data","_compose","_store","_useNotifyCopy","_utils","useClipboardHandler","getBlocksByClientId","getSelectedBlockClientIds","hasMultiSelection","getSettings","__unstableIsFullySelected","__unstableIsSelectionCollapsed","__unstableIsSelectionMergeable","__unstableGetSelectedBlocksWithPartialSelection","canInsertBlockType","useSelect","blockEditorStore","flashBlock","removeBlocks","replaceBlocks","__unstableDeleteSelection","__unstableExpandSelection","insertBlocks","useDispatch","notifyCopy","useNotifyCopy","useRefEffect","node","handler","event","defaultPrevented","selectedBlockClientIds","length","target","ownerDocument","hasSelection","type","documentHasUncollapsedSelection","documentHasSelection","contains","activeElement","preventDefault","isSelectionMergeable","shouldHandleWholeBlocks","expandSelectionIsNeeded","blocks","head","tail","inBetweenBlocks","slice","setClipboardBlocks","contentEditable","__experimentalCanUserUseUnfilteredHTML","canUserUseUnfilteredHTML","getPasteBlocks","selectedBlockClientId","every","block","name","undefined","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-clipboard-handler.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tdocumentHasSelection,\n\tdocumentHasUncollapsedSelection,\n} from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\nimport { getPasteBlocks, setClipboardBlocks } from './utils';\n\nexport default function useClipboardHandler() {\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSettings,\n\t\t__unstableIsFullySelected,\n\t\t__unstableIsSelectionCollapsed,\n\t\t__unstableIsSelectionMergeable,\n\t\t__unstableGetSelectedBlocksWithPartialSelection,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tflashBlock,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\tinsertBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction handler( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\t// This was likely already handled in rich-text/use-paste-handler.js.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\tif ( selectedBlockClientIds.length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Always handle multiple selected blocks.\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tconst { target } = event;\n\t\t\t\tconst { ownerDocument } = target;\n\t\t\t\t// If copying, only consider actual text selection as selection.\n\t\t\t\t// Otherwise, any focus on an input field is considered.\n\t\t\t\tconst hasSelection =\n\t\t\t\t\tevent.type === 'copy' || event.type === 'cut'\n\t\t\t\t\t\t? documentHasUncollapsedSelection( ownerDocument )\n\t\t\t\t\t\t: documentHasSelection( ownerDocument );\n\n\t\t\t\t// Let native copy behaviour take over in input fields.\n\t\t\t\tif ( hasSelection ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! node.contains( event.target.ownerDocument.activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconst isSelectionMergeable = __unstableIsSelectionMergeable();\n\t\t\tconst shouldHandleWholeBlocks =\n\t\t\t\t__unstableIsSelectionCollapsed() || __unstableIsFullySelected();\n\t\t\tconst expandSelectionIsNeeded =\n\t\t\t\t! shouldHandleWholeBlocks && ! isSelectionMergeable;\n\t\t\tif ( event.type === 'copy' || event.type === 'cut' ) {\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tflashBlock( selectedBlockClientIds[ 0 ] );\n\t\t\t\t}\n\t\t\t\t// If we have a partial selection that is not mergeable, just\n\t\t\t\t// expand the selection to the whole blocks.\n\t\t\t\tif ( expandSelectionIsNeeded ) {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t} else {\n\t\t\t\t\tnotifyCopy( event.type, selectedBlockClientIds );\n\t\t\t\t\tlet blocks;\n\t\t\t\t\t// Check if we have partial selection.\n\t\t\t\t\tif ( shouldHandleWholeBlocks ) {\n\t\t\t\t\t\tblocks = getBlocksByClientId( selectedBlockClientIds );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [ head, tail ] =\n\t\t\t\t\t\t\t__unstableGetSelectedBlocksWithPartialSelection();\n\t\t\t\t\t\tconst inBetweenBlocks = getBlocksByClientId(\n\t\t\t\t\t\t\tselectedBlockClientIds.slice(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length - 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tblocks = [ head, ...inBetweenBlocks, tail ];\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClipboardBlocks( event, blocks );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( event.type === 'cut' ) {\n\t\t\t\t// We need to also check if at the start we needed to\n\t\t\t\t// expand the selection, as in this point we might have\n\t\t\t\t// programmatically fully selected the blocks above.\n\t\t\t\tif ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) {\n\t\t\t\t\tremoveBlocks( selectedBlockClientIds );\n\t\t\t\t} else {\n\t\t\t\t\tevent.target.ownerDocument.activeElement.contentEditable = false;\n\t\t\t\t\t__unstableDeleteSelection();\n\t\t\t\t}\n\t\t\t} else if ( event.type === 'paste' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalCanUserUseUnfilteredHTML:\n\t\t\t\t\t\tcanUserUseUnfilteredHTML,\n\t\t\t\t} = getSettings();\n\t\t\t\tconst blocks = getPasteBlocks(\n\t\t\t\t\tevent,\n\t\t\t\t\tcanUserUseUnfilteredHTML\n\t\t\t\t);\n\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tconst [ selectedBlockClientId ] = selectedBlockClientIds;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.every( ( block ) =>\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\tblocks,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlockClientIds,\n\t\t\t\t\tblocks,\n\t\t\t\t\tblocks.length - 1,\n\t\t\t\t\t-1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tnode.ownerDocument.addEventListener( 'copy', handler );\n\t\tnode.ownerDocument.addEventListener( 'cut', handler );\n\t\tnode.ownerDocument.addEventListener( 'paste', handler );\n\n\t\treturn () => {\n\t\t\tnode.ownerDocument.removeEventListener( 'copy', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'cut', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'paste', handler );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAfA;AACA;AACA;;AAQA;AACA;AACA;;AAKe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IACLC,mBAAmB;IACnBC,yBAAyB;IACzBC,iBAAiB;IACjBC,WAAW;IACXC,yBAAyB;IACzBC,8BAA8B;IAC9BC,8BAA8B;IAC9BC,+CAA+C;IAC/CC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAiB,CAAC;EACjC,MAAM;IACLC,UAAU;IACVC,YAAY;IACZC,aAAa;IACbC,yBAAyB;IACzBC,yBAAyB;IACzBC;EACD,CAAC,GAAG,IAAAC,iBAAW,EAAEP,YAAiB,CAAC;EACnC,MAAMQ,UAAU,GAAG,IAAAC,4BAAa,EAAC,CAAC;EAElC,OAAO,IAAAC,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D,CACD,CAAC,EACA;YACDjC,YAAY,CACXuB,MAAM,EACNc,SAAS,EACTJ,qBACD,CAAC;YACD;UACD;QACD;QAEApC,aAAa,CACZY,sBAAsB,EACtBc,MAAM,EACNA,MAAM,CAACb,MAAM,GAAG,CAAC,EACjB,CAAC,CACF,CAAC;MACF;IACD;IAEAL,IAAI,CAACO,aAAa,CAAC0B,gBAAgB,CAAE,MAAM,EAAEhC,OAAQ,CAAC;IACtDD,IAAI,CAACO,aAAa,CAAC0B,gBAAgB,CAAE,KAAK,EAAEhC,OAAQ,CAAC;IACrDD,IAAI,CAACO,aAAa,CAAC0B,gBAAgB,CAAE,OAAO,EAAEhC,OAAQ,CAAC;IAEvD,OAAO,MAAM;MACZD,IAAI,CAACO,aAAa,CAAC2B,mBAAmB,CAAE,MAAM,EAAEjC,OAAQ,CAAC;MACzDD,IAAI,CAACO,aAAa,CAAC2B,mBAAmB,CAAE,KAAK,EAAEjC,OAAQ,CAAC;MACxDD,IAAI,CAACO,aAAa,CAAC2B,mBAAmB,CAAE,OAAO,EAAEjC,OAAQ,CAAC;IAC3D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
|
|
@@ -70,19 +70,30 @@ function useDragSelection() {
|
|
|
70
70
|
setContentEditableWrapper(node, false);
|
|
71
71
|
const selection = defaultView.getSelection();
|
|
72
72
|
if (selection.rangeCount) {
|
|
73
|
+
const range = selection.getRangeAt(0);
|
|
73
74
|
const {
|
|
74
75
|
commonAncestorContainer
|
|
75
|
-
} =
|
|
76
|
+
} = range;
|
|
77
|
+
const clonedRange = range.cloneRange();
|
|
76
78
|
if (anchorElement.contains(commonAncestorContainer)) {
|
|
77
79
|
anchorElement.focus();
|
|
80
|
+
selection.removeAllRanges();
|
|
81
|
+
selection.addRange(clonedRange);
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
86
|
function onMouseLeave({
|
|
83
87
|
buttons,
|
|
84
|
-
target
|
|
88
|
+
target,
|
|
89
|
+
relatedTarget
|
|
85
90
|
}) {
|
|
91
|
+
// If we're moving into a child element, ignore. We're tracking
|
|
92
|
+
// the mouse leaving the element to a parent, no a child.
|
|
93
|
+
if (target.contains(relatedTarget)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
86
97
|
// Avoid triggering a multi-selection if the user is already
|
|
87
98
|
// dragging blocks.
|
|
88
99
|
if (isDraggingBlocks()) {
|