@wordpress/block-editor 14.4.0 → 14.5.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 +2 -0
- package/README.md +6 -2
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/background-image-control/index.js +1 -1
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +1 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +1 -1
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +1 -0
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +10 -7
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/index.js +45 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +1 -4
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-rename/modal.js +2 -2
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
- package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/index.js +2 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -0
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +1 -0
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/index.js +0 -7
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +7 -3
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +3 -2
- package/build/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +3 -20
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +3 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -0
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +1 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +2 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/iframe/index.js +49 -9
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +1 -1
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +1 -10
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +1 -1
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/media-tab/utils.js.map +1 -1
- package/build/components/inserter/menu.js +5 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +1 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-results.js +1 -1
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/is-url-like.js.map +1 -1
- package/build/components/link-control/search-create-button.js +1 -1
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +3 -5
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-results.js +5 -15
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/use-rich-url-data.js.map +1 -1
- package/build/components/list-view/appender.js +1 -1
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +2 -2
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/utils.js +1 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +1 -1
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +2 -2
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -0
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +1 -0
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +3 -3
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/responsive-block-control/label.js +1 -1
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build/components/rich-text/index.js +3 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +1 -0
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/toolbar-button.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +1 -0
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +1 -0
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/tool-selector/index.js +9 -3
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +1 -0
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js.map +1 -1
- package/build/components/url-input/index.js +1 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -2
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +21 -5
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -1
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/generated-class-name.js +1 -0
- package/build/hooks/generated-class-name.js.map +1 -1
- package/build/hooks/grid-visualizer.js +13 -11
- package/build/hooks/grid-visualizer.js.map +1 -1
- package/build/hooks/layout-child.js +41 -3
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -1
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/spacing-visualizer.js.map +1 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/text-align.js.map +1 -1
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/use-zoom-out.js +24 -16
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/grid.js.map +1 -1
- package/build/layouts/utils.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +5 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +2 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +22 -15
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +9 -6
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +1 -1
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/object.js +1 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/pasting.js.map +1 -1
- package/build-module/autocompleters/block.js +1 -3
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +1 -3
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/audio-player/index.native.js +1 -2
- package/build-module/components/audio-player/index.native.js.map +1 -1
- package/build-module/components/background-image-control/index.js +2 -3
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -2
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +1 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +1 -2
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/block-view.js +1 -2
- package/build-module/components/block-compare/block-view.js.map +1 -1
- package/build-module/components/block-compare/index.js +1 -2
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +1 -3
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +2 -3
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -3
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/index.js +1 -2
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
- package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -3
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-crash-warning.js +1 -1
- package/build-module/components/block-list/block-crash-warning.js.map +1 -1
- package/build-module/components/block-list/block-crash-warning.native.js +1 -1
- package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +1 -3
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +1 -2
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +1 -2
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +1 -3
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +1 -2
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -2
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +1 -3
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +1 -2
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +10 -7
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +1 -3
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +2 -3
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +1 -3
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +1 -2
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +1 -3
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -2
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +1 -2
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +1 -2
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +1 -3
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -3
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +1 -2
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +45 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +2 -7
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +1 -2
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +1 -2
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +1 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +3 -4
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-rename/rename-control.js +1 -3
- package/build-module/components/block-rename/rename-control.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +1 -3
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -3
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +1 -2
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -2
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +1 -2
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -2
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +3 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -2
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +1 -0
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +1 -3
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +1 -3
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -9
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +1 -2
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +7 -3
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +2 -1
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +5 -23
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/block-types-list/index.js +1 -2
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +1 -2
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -2
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +1 -2
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +4 -4
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -3
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.native.js +1 -2
- package/build-module/components/button-block-appender/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +1 -3
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +1 -3
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +1 -2
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -3
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +1 -2
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -2
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +1 -2
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +1 -3
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
- package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -2
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +1 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/floating-toolbar/index.native.js +1 -2
- package/build-module/components/floating-toolbar/index.native.js.map +1 -1
- package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
- package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +2 -2
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -2
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -3
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +1 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +1 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +1 -2
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +1 -3
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/height-control/index.js +1 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +50 -12
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +1 -3
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/form-controls.js +1 -3
- package/build-module/components/image-editor/form-controls.js.map +1 -1
- package/build-module/components/image-editor/index.js +1 -2
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +1 -1
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +1 -3
- package/build-module/components/image-link-destinations/index.native.js.map +1 -1
- package/build-module/components/image-size-control/index.js +1 -3
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -3
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +1 -3
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +3 -13
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.native.js +1 -3
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -2
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +2 -4
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +1 -3
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/media-tab/utils.js.map +1 -1
- package/build-module/components/inserter/menu.js +6 -5
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +1 -3
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -2
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/no-results.js +1 -2
- package/build-module/components/inserter/no-results.js.map +1 -1
- package/build-module/components/inserter/no-results.native.js +1 -2
- package/build-module/components/inserter/no-results.native.js.map +1 -1
- package/build-module/components/inserter/panel.js +1 -3
- package/build-module/components/inserter/panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +1 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -3
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-results.js +2 -3
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +1 -2
- package/build-module/components/inserter-button/index.native.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +1 -2
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +1 -2
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +1 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -2
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +1 -2
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +1 -3
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/is-url-like.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -3
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +1 -1
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +4 -7
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-results.js +6 -17
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +1 -3
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +1 -2
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
- package/build-module/components/list-view/appender.js +2 -3
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +1 -3
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -2
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +1 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +1 -2
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +2 -2
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/utils.js +1 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +1 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +2 -4
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +1 -3
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +1 -3
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/media-upload-progress/index.native.js +1 -2
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +3 -4
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +1 -0
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -2
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +1 -2
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +1 -0
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +4 -5
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/responsive-block-control/label.js +2 -4
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/delete.js +2 -2
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/enter.js +2 -2
- package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
- package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -3
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
- package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -5
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +1 -3
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.js +1 -1
- package/build-module/components/rich-text/native/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +1 -3
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +1 -0
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/toolbar-button.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +1 -0
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +1 -2
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -3
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +1 -0
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -2
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +10 -6
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -0
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/unsupported-block-details/index.native.js +1 -2
- package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
- package/build-module/components/url-input/button.js +1 -2
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +2 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +1 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +1 -2
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +1 -2
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +1 -2
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -2
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/video-player/index.native.js +1 -2
- package/build-module/components/video-player/index.native.js.map +1 -1
- package/build-module/components/warning/index.js +1 -2
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +1 -2
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/components/writing-flow/index.js +1 -3
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +21 -5
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +1 -3
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/block-bindings.js +1 -3
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +2 -3
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +1 -2
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/dimensions.js +1 -3
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +1 -3
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/generated-class-name.js +1 -0
- package/build-module/hooks/generated-class-name.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +14 -14
- package/build-module/hooks/grid-visualizer.js.map +1 -1
- package/build-module/hooks/layout-child.js +42 -6
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +1 -3
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +1 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js.map +1 -1
- package/build-module/hooks/style.js +1 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/text-align.js.map +1 -1
- package/build-module/hooks/typography.native.js +1 -2
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +1 -2
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +24 -17
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +1 -3
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/grid.js +1 -3
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +5 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +21 -12
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +9 -6
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +1 -1
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/get-px-from-css-unit.js +1 -1
- package/build-module/utils/get-px-from-css-unit.js.map +1 -1
- package/build-module/utils/object.js +1 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +13 -26
- package/build-style/content.css +13 -26
- package/build-style/style-rtl.css +23 -41
- package/build-style/style.css +23 -41
- package/package.json +33 -33
- package/src/components/block-canvas/style.scss +0 -1
- package/src/components/block-list/content.scss +3 -2
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
- package/src/components/block-list/zoom-out-separator.js +8 -6
- package/src/components/block-popover/index.js +64 -2
- package/src/components/block-preview/auto.js +1 -4
- package/src/components/block-tools/index.js +0 -11
- package/src/components/block-tools/style.scss +1 -1
- package/src/components/block-tools/use-show-block-tools.js +10 -3
- package/src/components/block-tools/zoom-out-popover.js +2 -1
- package/src/components/block-tools/zoom-out-toolbar.js +2 -23
- package/src/components/iframe/content.scss +27 -32
- package/src/components/iframe/index.js +63 -13
- package/src/components/iframe/style.scss +18 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
- package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
- package/src/components/inserter/category-tabs/index.js +1 -11
- package/src/components/inserter/menu.js +7 -2
- package/src/components/inserter/quick-inserter.js +1 -1
- package/src/components/inserter/style.scss +1 -41
- package/src/components/link-control/search-input.js +4 -5
- package/src/components/link-control/search-results.js +2 -13
- package/src/components/link-control/test/index.js +84 -46
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/responsive-block-control/style.scss +0 -1
- package/src/components/rich-text/style.scss +5 -0
- package/src/components/tool-selector/index.js +7 -2
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/components/writing-flow/use-tab-nav.js +28 -4
- package/src/hooks/grid-visualizer.js +23 -9
- package/src/hooks/layout-child.js +48 -3
- package/src/hooks/use-zoom-out.js +36 -20
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +3 -2
- package/src/store/reducer.js +0 -17
- package/src/store/selectors.js +23 -12
- package/src/store/test/private-selectors.js +7 -1
- package/src/store/test/selectors.js +13 -2
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.js +9 -6
- package/src/utils/test/use-block-bindings-utils.js +174 -0
|
@@ -14,7 +14,7 @@ var _dom = require("@wordpress/dom");
|
|
|
14
14
|
* WordPress dependencies
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const getBlockPositionDescription = (position, siblingCount, level) => (0, _i18n.sprintf)(
|
|
17
|
+
const getBlockPositionDescription = (position, siblingCount, level) => (0, _i18n.sprintf)(/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
|
18
18
|
(0, _i18n.__)('Block %1$d of %2$d, Level %3$d.'), position, siblingCount, level);
|
|
19
19
|
exports.getBlockPositionDescription = getBlockPositionDescription;
|
|
20
20
|
const getBlockPropertiesDescription = (blockInformation, isLocked) => [blockInformation?.positionLabel ? `${(0, _i18n.sprintf)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_dom","getBlockPositionDescription","position","siblingCount","level","sprintf","__","exports","getBlockPropertiesDescription","blockInformation","isLocked","positionLabel","undefined","filter","Boolean","join","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end","focusListItem","focusClientId","treeGridElement","getFocusElement","row","querySelector","focus","focusable","find","focusElement","window","requestAnimationFrame","getDragDisplacementValues","blockIndexes","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","isDragged","displacement","isNesting","isAfterDraggedBlocks","thisBlockIndex"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d.' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\nexport const getBlockPropertiesDescription = ( blockInformation, isLocked ) =>\n\t[\n\t\tblockInformation?.positionLabel\n\t\t\t? `${ sprintf(\n\t\t\t\t\t// translators: %s: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t\t__( 'Position: %s' ),\n\t\t\t\t\tblockInformation.positionLabel\n\t\t\t ) }.`\n\t\t\t: undefined,\n\t\tisLocked ? __( 'This block is locked.' ) : undefined,\n\t]\n\t\t.filter( Boolean )\n\t\t.join( ' ' );\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Shift focus to the list view item associated with a particular clientId.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} focusClientId The client ID of the block to focus.\n * @param {?HTMLElement} treeGridElement The container element to search within.\n */\nexport function focusListItem( focusClientId, treeGridElement ) {\n\tconst getFocusElement = () => {\n\t\tconst row = treeGridElement?.querySelector(\n\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t);\n\t\tif ( ! row ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\treturn focus.focusable.find( row )[ 0 ];\n\t};\n\n\tlet focusElement = getFocusElement();\n\tif ( focusElement ) {\n\t\tfocusElement.focus();\n\t} else {\n\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t// This could happen when all blocks have been deleted and the default block\n\t\t// hasn't been added to the editor yet.\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tfocusElement = getFocusElement();\n\n\t\t\t// Ignore if the element still doesn't exist.\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t}\n\t\t} );\n\t}\n}\n\n/**\n * Get values for the block that flag whether the block should be displaced up or down,\n * whether the block is being nested, and whether the block appears after the dragged\n * blocks. These values are used to determine the class names to apply to the block.\n * The list view rows are displaced visually via CSS rules. Displacement rules:\n * - `normal`: no displacement — used to apply a translateY of `0` so that the block\n * appears in its original position, and moves to that position smoothly when dragging\n * outside of the list view area.\n * - `up`: the block should be displaced up, creating room beneath the block for the drop indicator.\n * - `down`: the block should be displaced down, creating room above the block for the drop indicator.\n *\n * @param {Object} props\n * @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId.\n * @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to.\n * @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to.\n * @param {string} props.clientId The client id for the current block.\n * @param {?number} props.firstDraggedBlockIndex The index of the first dragged block.\n * @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement.\n * @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values.\n */\nexport function getDragDisplacementValues( {\n\tblockIndexes,\n\tblockDropTargetIndex,\n\tblockDropPosition,\n\tclientId,\n\tfirstDraggedBlockIndex,\n\tisDragged,\n} ) {\n\tlet displacement;\n\tlet isNesting;\n\tlet isAfterDraggedBlocks;\n\n\tif ( ! isDragged ) {\n\t\tisNesting = false;\n\t\tconst thisBlockIndex = blockIndexes[ clientId ];\n\t\tisAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;\n\n\t\t// Determine where to displace the position of the current block, relative\n\t\t// to the blocks being dragged (in their original position) and the drop target\n\t\t// (the position where a user is currently dragging the blocks to).\n\t\tif (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// If the block is being dragged and there is a valid drop target,\n\t\t\t// determine if the block being rendered should be displaced up or down.\n\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif (\n\t\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex < blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears after the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is before the drop target,\n\t\t\t\t\t// then the current block should be displaced up.\n\t\t\t\t\tdisplacement = 'up';\n\t\t\t\t} else if (\n\t\t\t\t\tthisBlockIndex < firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex >= blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears before the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is after the drop target,\n\t\t\t\t\t// then the current block should be displaced down.\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t}\n\t\t\t\tisNesting =\n\t\t\t\t\ttypeof blockDropTargetIndex === 'number' &&\n\t\t\t\t\tblockDropTargetIndex - 1 === thisBlockIndex &&\n\t\t\t\t\tblockDropPosition === 'inside';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex === null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// A `null` value for `blockDropTargetIndex` indicates that the\n\t\t\t// drop target is outside of the valid areas within the list view.\n\t\t\t// In this case, the drag is still active, but as there is no\n\t\t\t// valid drop target, we should remove the gap indicating where\n\t\t\t// the block would be inserted.\n\t\t\tif (\n\t\t\t\tthisBlockIndex !== undefined &&\n\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex\n\t\t\t) {\n\t\t\t\tdisplacement = 'up';\n\t\t\t} else {\n\t\t\t\tdisplacement = 'normal';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex === undefined\n\t\t) {\n\t\t\t// If the blockdrop target is defined, but there are no dragged blocks,\n\t\t\t// then the block should be displaced relative to the drop target.\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif ( thisBlockIndex < blockDropTargetIndex ) {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( blockDropTargetIndex === null ) {\n\t\t\tdisplacement = 'normal';\n\t\t}\n\t}\n\n\treturn {\n\t\tdisplacement,\n\t\tisNesting,\n\t\tisAfterDraggedBlocks,\n\t};\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIO,MAAME,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,KACzE,IAAAC,aAAO,GACN;AACA,IAAAC,QAAE,EAAE,iCAAkC,CAAC,EACvCJ,QAAQ,EACRC,YAAY,EACZC,KACD,CAAC;AAACG,OAAA,CAAAN,2BAAA,GAAAA,2BAAA;AAEI,MAAMO,6BAA6B,GAAGA,CAAEC,gBAAgB,EAAEC,QAAQ,KACxE,CACCD,gBAAgB,EAAEE,aAAa,GAC3B,GAAG,IAAAN,aAAO;AACX;AACA,IAAAC,QAAE,EAAE,cAAe,CAAC,EACpBG,gBAAgB,CAACE,aACjB,CAAG,GAAE,GACLC,SAAS,EACZF,QAAQ,GAAG,IAAAJ,QAAE,EAAE,uBAAwB,CAAC,GAAGM,SAAS,CACpD,CACCC,MAAM,CAAEC,OAAQ,CAAC,CACjBC,IAAI,CAAE,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AAQ;QACxB;QACAC,SAAS,GACR,OAAOL,oBAAoB,KAAK,QAAQ,IACxCA,oBAAoB,GAAG,CAAC,KAAKO,cAAc,IAC3CN,iBAAiB,KAAK,QAAQ;MAChC;IACD,CAAC,MAAM,IACND,oBAAoB,KAAK,IAAI,IAC7BE,sBAAsB,KAAKvC,SAAS,EACnC;MACD;MACA;MACA;MACA;MACA;MACA,IACC4C,cAAc,KAAK5C,SAAS,IAC5B4C,cAAc,IAAIL,sBAAsB,EACvC;QACDE,YAAY,GAAG,IAAI;MACpB,CAAC,MAAM;QACNA,YAAY,GAAG,QAAQ;MACxB;IACD,CAAC,MAAM,IACNJ,oBAAoB,KAAKrC,SAAS,IAClCqC,oBAAoB,KAAK,IAAI,IAC7BE,sBAAsB,KAAKvC,SAAS,EACnC;MACD;MACA;MACA,IAAK4C,cAAc,KAAK5C,SAAS,EAAG;QACnC,IAAK4C,cAAc,GAAGP,oBAAoB,EAAG;UAC5CI,YAAY,GAAG,QAAQ;QACxB,CAAC,MAAM;UACNA,YAAY,GAAG,MAAM;QACtB;MACD;IACD,CAAC,MAAM,IAAKJ,oBAAoB,KAAK,IAAI,EAAG;MAC3CI,YAAY,GAAG,QAAQ;IACxB;EACD;EAEA,OAAO;IACNA,YAAY;IACZC,SAAS;IACTC;EACD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_dom","getBlockPositionDescription","position","siblingCount","level","sprintf","__","exports","getBlockPropertiesDescription","blockInformation","isLocked","positionLabel","undefined","filter","Boolean","join","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end","focusListItem","focusClientId","treeGridElement","getFocusElement","row","querySelector","focus","focusable","find","focusElement","window","requestAnimationFrame","getDragDisplacementValues","blockIndexes","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","isDragged","displacement","isNesting","isAfterDraggedBlocks","thisBlockIndex"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d.' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\nexport const getBlockPropertiesDescription = ( blockInformation, isLocked ) =>\n\t[\n\t\tblockInformation?.positionLabel\n\t\t\t? `${ sprintf(\n\t\t\t\t\t// translators: %s: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t\t__( 'Position: %s' ),\n\t\t\t\t\tblockInformation.positionLabel\n\t\t\t ) }.`\n\t\t\t: undefined,\n\t\tisLocked ? __( 'This block is locked.' ) : undefined,\n\t]\n\t\t.filter( Boolean )\n\t\t.join( ' ' );\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Shift focus to the list view item associated with a particular clientId.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} focusClientId The client ID of the block to focus.\n * @param {?HTMLElement} treeGridElement The container element to search within.\n */\nexport function focusListItem( focusClientId, treeGridElement ) {\n\tconst getFocusElement = () => {\n\t\tconst row = treeGridElement?.querySelector(\n\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t);\n\t\tif ( ! row ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\treturn focus.focusable.find( row )[ 0 ];\n\t};\n\n\tlet focusElement = getFocusElement();\n\tif ( focusElement ) {\n\t\tfocusElement.focus();\n\t} else {\n\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t// This could happen when all blocks have been deleted and the default block\n\t\t// hasn't been added to the editor yet.\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tfocusElement = getFocusElement();\n\n\t\t\t// Ignore if the element still doesn't exist.\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t}\n\t\t} );\n\t}\n}\n\n/**\n * Get values for the block that flag whether the block should be displaced up or down,\n * whether the block is being nested, and whether the block appears after the dragged\n * blocks. These values are used to determine the class names to apply to the block.\n * The list view rows are displaced visually via CSS rules. Displacement rules:\n * - `normal`: no displacement — used to apply a translateY of `0` so that the block\n * appears in its original position, and moves to that position smoothly when dragging\n * outside of the list view area.\n * - `up`: the block should be displaced up, creating room beneath the block for the drop indicator.\n * - `down`: the block should be displaced down, creating room above the block for the drop indicator.\n *\n * @param {Object} props\n * @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId.\n * @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to.\n * @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to.\n * @param {string} props.clientId The client id for the current block.\n * @param {?number} props.firstDraggedBlockIndex The index of the first dragged block.\n * @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement.\n * @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values.\n */\nexport function getDragDisplacementValues( {\n\tblockIndexes,\n\tblockDropTargetIndex,\n\tblockDropPosition,\n\tclientId,\n\tfirstDraggedBlockIndex,\n\tisDragged,\n} ) {\n\tlet displacement;\n\tlet isNesting;\n\tlet isAfterDraggedBlocks;\n\n\tif ( ! isDragged ) {\n\t\tisNesting = false;\n\t\tconst thisBlockIndex = blockIndexes[ clientId ];\n\t\tisAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;\n\n\t\t// Determine where to displace the position of the current block, relative\n\t\t// to the blocks being dragged (in their original position) and the drop target\n\t\t// (the position where a user is currently dragging the blocks to).\n\t\tif (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// If the block is being dragged and there is a valid drop target,\n\t\t\t// determine if the block being rendered should be displaced up or down.\n\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif (\n\t\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex < blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears after the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is before the drop target,\n\t\t\t\t\t// then the current block should be displaced up.\n\t\t\t\t\tdisplacement = 'up';\n\t\t\t\t} else if (\n\t\t\t\t\tthisBlockIndex < firstDraggedBlockIndex &&\n\t\t\t\t\tthisBlockIndex >= blockDropTargetIndex\n\t\t\t\t) {\n\t\t\t\t\t// If the current block appears before the set of dragged blocks\n\t\t\t\t\t// (in their original position), but is after the drop target,\n\t\t\t\t\t// then the current block should be displaced down.\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t}\n\t\t\t\tisNesting =\n\t\t\t\t\ttypeof blockDropTargetIndex === 'number' &&\n\t\t\t\t\tblockDropTargetIndex - 1 === thisBlockIndex &&\n\t\t\t\t\tblockDropPosition === 'inside';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex === null &&\n\t\t\tfirstDraggedBlockIndex !== undefined\n\t\t) {\n\t\t\t// A `null` value for `blockDropTargetIndex` indicates that the\n\t\t\t// drop target is outside of the valid areas within the list view.\n\t\t\t// In this case, the drag is still active, but as there is no\n\t\t\t// valid drop target, we should remove the gap indicating where\n\t\t\t// the block would be inserted.\n\t\t\tif (\n\t\t\t\tthisBlockIndex !== undefined &&\n\t\t\t\tthisBlockIndex >= firstDraggedBlockIndex\n\t\t\t) {\n\t\t\t\tdisplacement = 'up';\n\t\t\t} else {\n\t\t\t\tdisplacement = 'normal';\n\t\t\t}\n\t\t} else if (\n\t\t\tblockDropTargetIndex !== undefined &&\n\t\t\tblockDropTargetIndex !== null &&\n\t\t\tfirstDraggedBlockIndex === undefined\n\t\t) {\n\t\t\t// If the blockdrop target is defined, but there are no dragged blocks,\n\t\t\t// then the block should be displaced relative to the drop target.\n\t\t\tif ( thisBlockIndex !== undefined ) {\n\t\t\t\tif ( thisBlockIndex < blockDropTargetIndex ) {\n\t\t\t\t\tdisplacement = 'normal';\n\t\t\t\t} else {\n\t\t\t\t\tdisplacement = 'down';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( blockDropTargetIndex === null ) {\n\t\t\tdisplacement = 'normal';\n\t\t}\n\t}\n\n\treturn {\n\t\tdisplacement,\n\t\tisNesting,\n\t\tisAfterDraggedBlocks,\n\t};\n}\n"],"mappings":";;;;;;;;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AY,GAAG,QAAQ;QACxB,CAAC,MAAM;UACNA,YAAY,GAAG,MAAM;QACtB;MACD;IACD,CAAC,MAAM,IAAKJ,oBAAoB,KAAK,IAAI,EAAG;MAC3CI,YAAY,GAAG,QAAQ;IACxB;EACD;EAEA,OAAO;IACNA,YAAY;IACZC,SAAS;IACTC;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -113,7 +113,7 @@ function MediaPlaceholder(props) {
|
|
|
113
113
|
const placeholderIcon = (0, _element.cloneElement)(icon, {
|
|
114
114
|
fill: iconStyles.fill
|
|
115
115
|
});
|
|
116
|
-
const accessibilityLabel = (0, _i18n.sprintf)(
|
|
116
|
+
const accessibilityLabel = (0, _i18n.sprintf)(/* translators: accessibility text for the media block empty state. %s: media type */
|
|
117
117
|
(0, _i18n.__)('%s block. Empty'), placeholderTitle);
|
|
118
118
|
const renderContent = open => {
|
|
119
119
|
if (isAppender === undefined || !isAppender) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_i18n","_compose","_element","_icons","_styles","_interopRequireDefault","_context","_mediaUpload","_constants","_jsxRuntime","isMediaEqual","media1","media2","id","url","dedupMedia","media","reduce","dedupedMedia","mediaItem","some","item","hitSlop","top","bottom","left","right","MediaPlaceholder","props","addToGallery","allowedTypes","className","labels","icon","onSelect","onFocus","__experimentalOnlyMediaLibrary","isAppender","disableMediaButtons","multiple","value","children","height","backgroundColor","hideContent","autoOpenMediaUpload","onSelectURL","mediaRef","useRef","current","blockEditContext","useBlockEditContext","onButtonPress","useCallback","open","event","setMedia","selected","isOneType","length","isImage","includes","MEDIA_TYPE_IMAGE","isVideo","MEDIA_TYPE_VIDEO","isAudio","MEDIA_TYPE_AUDIO","placeholderTitle","title","undefined","__","instructions","accessibilityHint","titleStyles","usePreferredColorSchemeStyle","styles","addMediaButtonStyle","addMediaButton","addMediaButtonDark","buttonStyles","emptyStateDescriptionStyles","emptyStateDescription","emptyStateDescriptionDark","iconStyles","placeholderIcon","cloneElement","fill","accessibilityLabel","sprintf","renderContent","jsxs","Fragment","View","style","jsx","Text","TouchableOpacity","activeOpacity","accessibilityRole","onPress","testID","Icon","plusCircleFilled","color","size","appenderStyle","appender","appenderDark","containerSelectedStyle","containerStyle","isSelected","flex","default","isReplacingMedia","autoOpen","render","getMediaOptions","_default","exports"],"sources":["@wordpress/block-editor/src/components/media-placeholder/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableOpacity } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { cloneElement, useCallback, useRef } from '@wordpress/element';\nimport { Icon, plusCircleFilled } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { useBlockEditContext } from '../block-edit/context';\nimport MediaUpload from '../media-upload';\nimport {\n\tMEDIA_TYPE_IMAGE,\n\tMEDIA_TYPE_VIDEO,\n\tMEDIA_TYPE_AUDIO,\n} from '../media-upload/constants';\n\nconst isMediaEqual = ( media1, media2 ) =>\n\tmedia1.id === media2.id || media1.url === media2.url;\n\n// Remove duplicates after gallery append.\nconst dedupMedia = ( media ) =>\n\tmedia.reduce(\n\t\t( dedupedMedia, mediaItem ) =>\n\t\t\tdedupedMedia.some( ( item ) => isMediaEqual( item, mediaItem ) )\n\t\t\t\t? dedupedMedia\n\t\t\t\t: [ ...dedupedMedia, mediaItem ],\n\t\t[]\n\t);\n\nconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\nfunction MediaPlaceholder( props ) {\n\tconst {\n\t\taddToGallery,\n\t\tallowedTypes = [],\n\t\tclassName = '',\n\t\tlabels = {},\n\t\ticon,\n\t\tonSelect,\n\t\tonFocus,\n\t\t__experimentalOnlyMediaLibrary,\n\t\tisAppender,\n\t\tdisableMediaButtons,\n\t\tmultiple,\n\t\tvalue = [],\n\t\tchildren,\n\t\theight,\n\t\tbackgroundColor,\n\t\thideContent,\n\t\tautoOpenMediaUpload,\n\t\tonSelectURL,\n\t} = props;\n\n\t// Use ref to keep media array current for callbacks during rerenders.\n\tconst mediaRef = useRef( value );\n\tmediaRef.current = value;\n\n\tconst blockEditContext = useBlockEditContext();\n\n\tconst onButtonPress = useCallback(\n\t\t( open ) => ( event ) => {\n\t\t\tonFocus?.( event );\n\t\t\topen();\n\t\t},\n\t\t[ onFocus ]\n\t);\n\n\t// Append and deduplicate media array for gallery use case.\n\tconst setMedia =\n\t\tmultiple && addToGallery\n\t\t\t? ( selected ) =>\n\t\t\t\t\tonSelect(\n\t\t\t\t\t\tdedupMedia( [ ...mediaRef.current, ...selected ] )\n\t\t\t\t\t)\n\t\t\t: onSelect;\n\n\tconst isOneType = allowedTypes.length === 1;\n\tconst isImage = isOneType && allowedTypes.includes( MEDIA_TYPE_IMAGE );\n\tconst isVideo = isOneType && allowedTypes.includes( MEDIA_TYPE_VIDEO );\n\tconst isAudio = isOneType && allowedTypes.includes( MEDIA_TYPE_AUDIO );\n\n\tlet placeholderTitle = labels.title;\n\tif ( placeholderTitle === undefined ) {\n\t\tplaceholderTitle = __( 'Media' );\n\t\tif ( isImage ) {\n\t\t\tplaceholderTitle = __( 'Image' );\n\t\t} else if ( isVideo ) {\n\t\t\tplaceholderTitle = __( 'Video' );\n\t\t} else if ( isAudio ) {\n\t\t\tplaceholderTitle = __( 'Audio' );\n\t\t}\n\t}\n\n\tlet instructions = labels.instructions;\n\tif ( instructions === undefined ) {\n\t\tif ( isImage ) {\n\t\t\tinstructions = __( 'Add image' );\n\t\t} else if ( isVideo ) {\n\t\t\tinstructions = __( 'Add video' );\n\t\t} else if ( isAudio ) {\n\t\t\tinstructions = __( 'Add audio' );\n\t\t} else {\n\t\t\tinstructions = __( 'Add image or video' );\n\t\t}\n\t}\n\n\tlet accessibilityHint = __( 'Double tap to select' );\n\tif ( isImage ) {\n\t\taccessibilityHint = __( 'Double tap to select an image' );\n\t} else if ( isVideo ) {\n\t\taccessibilityHint = __( 'Double tap to select a video' );\n\t} else if ( isAudio ) {\n\t\taccessibilityHint = __( 'Double tap to select an audio file' );\n\t}\n\n\tconst titleStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__header-title' ],\n\t\tstyles[ 'media-placeholder__header-title--dark' ]\n\t);\n\tconst addMediaButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.addMediaButton,\n\t\tstyles.addMediaButtonDark\n\t);\n\tconst buttonStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__button' ],\n\t\tstyles[ 'media-placeholder__button--dark' ]\n\t);\n\tconst emptyStateDescriptionStyles = usePreferredColorSchemeStyle(\n\t\tstyles.emptyStateDescription,\n\t\tstyles.emptyStateDescriptionDark\n\t);\n\tconst iconStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__header-icon' ],\n\t\tstyles[ 'media-placeholder__header-icon--dark' ]\n\t);\n\tconst placeholderIcon = cloneElement( icon, {\n\t\tfill: iconStyles.fill,\n\t} );\n\tconst accessibilityLabel = sprintf(\n\t\t/* translators: accessibility text for the media block empty state. %s: media type */\n\t\t__( '%s block. Empty' ),\n\t\tplaceholderTitle\n\t);\n\n\tconst renderContent = ( open ) => {\n\t\tif ( isAppender === undefined || ! isAppender ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<View style={ styles[ 'media-placeholder__header' ] }>\n\t\t\t\t\t\t<View style={ iconStyles }>{ placeholderIcon }</View>\n\t\t\t\t\t\t<Text style={ titleStyles }>{ placeholderTitle }</Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t{ children }\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t\t\tonPress={ onButtonPress( open ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text style={ emptyStateDescriptionStyles }>\n\t\t\t\t\t\t\t{ instructions }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t</>\n\t\t\t);\n\t\t} else if ( isAppender && ! disableMediaButtons ) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\tstyle={ styles[ 'media-placeholder__appender' ] }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t\tonPress={ onButtonPress( open ) }\n\t\t\t\t>\n\t\t\t\t\t<View testID=\"media-placeholder-appender-icon\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ plusCircleFilled }\n\t\t\t\t\t\t\tstyle={ addMediaButtonStyle }\n\t\t\t\t\t\t\tcolor={ addMediaButtonStyle.color }\n\t\t\t\t\t\t\tsize={ addMediaButtonStyle.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\t};\n\n\tconst appenderStyle = usePreferredColorSchemeStyle(\n\t\tstyles.appender,\n\t\tstyles.appenderDark\n\t);\n\tconst containerSelectedStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__container-selected' ],\n\t\tstyles[ 'media-placeholder__container-selected--dark' ]\n\t);\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'media-placeholder__container' ],\n\t\t\tstyles[ 'media-placeholder__container--dark' ]\n\t\t),\n\t\tblockEditContext?.isSelected &&\n\t\t\t! className.includes( 'no-block-outline' ) &&\n\t\t\tcontainerSelectedStyle,\n\t];\n\n\tif ( isAppender && disableMediaButtons ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ { flex: 1 } }>\n\t\t\t<MediaUpload\n\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\tonSelect={ setMedia }\n\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t__experimentalOnlyMediaLibrary={\n\t\t\t\t\t__experimentalOnlyMediaLibrary\n\t\t\t\t}\n\t\t\t\tmultiple={ multiple }\n\t\t\t\tisReplacingMedia={ false }\n\t\t\t\tautoOpen={ autoOpenMediaUpload }\n\t\t\t\trender={ ( { open, getMediaOptions } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\tcontainerStyle,\n\t\t\t\t\t\t\t\t\theight && { height },\n\t\t\t\t\t\t\t\t\tbackgroundColor && { backgroundColor },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tisAppender && appenderStyle,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ getMediaOptions() }\n\t\t\t\t\t\t\t{ ! hideContent && renderContent( open ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</View>\n\t);\n}\n\nexport default MediaPlaceholder;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAImC,IAAAU,WAAA,GAAAV,OAAA;AAvBnC;AACA;AACA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EkB,IAAI,EAAE;IAAE,CAAG;IAAAtE,QAAA,eAC1B,IAAAhC,WAAA,CAAAqF,GAAA,EAACvF,YAAA,CAAAyG,OAAW;MACXlF,YAAY,EAAGA,YAAc;MAC7BI,QAAQ,EAAGsB,QAAU;MACrBV,WAAW,EAAGA,WAAa;MAC3BV,8BAA8B,EAC7BA,8BACA;MACDG,QAAQ,EAAGA,QAAU;MACrB0E,gBAAgB,EAAG,KAAO;MAC1BC,QAAQ,EAAGrE,mBAAqB;MAChCsE,MAAM,EAAGA,CAAE;QAAE7D,IAAI;QAAE8D;MAAgB,CAAC,KAAM;QACzC,oBACC,IAAA3G,WAAA,CAAAiF,IAAA,EAAC5F,YAAA,CAAA8F,IAAI;UACJC,KAAK,EAAG,CACP,CACCgB,cAAc,EACdnE,MAAM,IAAI;YAAEA;UAAO,CAAC,EACpBC,eAAe,IAAI;YAAEA;UAAgB,CAAC,CACtC,EACDN,UAAU,IAAIoE,aAAa,CACzB;UAAAhE,QAAA,GAED2E,eAAe,CAAC,CAAC,EACjB,CAAExE,WAAW,IAAI6C,aAAa,CAAEnC,IAAK,CAAC;QAAA,CACnC,CAAC;MAET;IAAG,CACH;EAAC,CACG,CAAC;AAET;AAAC,IAAA+D,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcrF,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_i18n","_compose","_element","_icons","_styles","_interopRequireDefault","_context","_mediaUpload","_constants","_jsxRuntime","isMediaEqual","media1","media2","id","url","dedupMedia","media","reduce","dedupedMedia","mediaItem","some","item","hitSlop","top","bottom","left","right","MediaPlaceholder","props","addToGallery","allowedTypes","className","labels","icon","onSelect","onFocus","__experimentalOnlyMediaLibrary","isAppender","disableMediaButtons","multiple","value","children","height","backgroundColor","hideContent","autoOpenMediaUpload","onSelectURL","mediaRef","useRef","current","blockEditContext","useBlockEditContext","onButtonPress","useCallback","open","event","setMedia","selected","isOneType","length","isImage","includes","MEDIA_TYPE_IMAGE","isVideo","MEDIA_TYPE_VIDEO","isAudio","MEDIA_TYPE_AUDIO","placeholderTitle","title","undefined","__","instructions","accessibilityHint","titleStyles","usePreferredColorSchemeStyle","styles","addMediaButtonStyle","addMediaButton","addMediaButtonDark","buttonStyles","emptyStateDescriptionStyles","emptyStateDescription","emptyStateDescriptionDark","iconStyles","placeholderIcon","cloneElement","fill","accessibilityLabel","sprintf","renderContent","jsxs","Fragment","View","style","jsx","Text","TouchableOpacity","activeOpacity","accessibilityRole","onPress","testID","Icon","plusCircleFilled","color","size","appenderStyle","appender","appenderDark","containerSelectedStyle","containerStyle","isSelected","flex","default","isReplacingMedia","autoOpen","render","getMediaOptions","_default","exports"],"sources":["@wordpress/block-editor/src/components/media-placeholder/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableOpacity } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { cloneElement, useCallback, useRef } from '@wordpress/element';\nimport { Icon, plusCircleFilled } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { useBlockEditContext } from '../block-edit/context';\nimport MediaUpload from '../media-upload';\nimport {\n\tMEDIA_TYPE_IMAGE,\n\tMEDIA_TYPE_VIDEO,\n\tMEDIA_TYPE_AUDIO,\n} from '../media-upload/constants';\n\nconst isMediaEqual = ( media1, media2 ) =>\n\tmedia1.id === media2.id || media1.url === media2.url;\n\n// Remove duplicates after gallery append.\nconst dedupMedia = ( media ) =>\n\tmedia.reduce(\n\t\t( dedupedMedia, mediaItem ) =>\n\t\t\tdedupedMedia.some( ( item ) => isMediaEqual( item, mediaItem ) )\n\t\t\t\t? dedupedMedia\n\t\t\t\t: [ ...dedupedMedia, mediaItem ],\n\t\t[]\n\t);\n\nconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\nfunction MediaPlaceholder( props ) {\n\tconst {\n\t\taddToGallery,\n\t\tallowedTypes = [],\n\t\tclassName = '',\n\t\tlabels = {},\n\t\ticon,\n\t\tonSelect,\n\t\tonFocus,\n\t\t__experimentalOnlyMediaLibrary,\n\t\tisAppender,\n\t\tdisableMediaButtons,\n\t\tmultiple,\n\t\tvalue = [],\n\t\tchildren,\n\t\theight,\n\t\tbackgroundColor,\n\t\thideContent,\n\t\tautoOpenMediaUpload,\n\t\tonSelectURL,\n\t} = props;\n\n\t// Use ref to keep media array current for callbacks during rerenders.\n\tconst mediaRef = useRef( value );\n\tmediaRef.current = value;\n\n\tconst blockEditContext = useBlockEditContext();\n\n\tconst onButtonPress = useCallback(\n\t\t( open ) => ( event ) => {\n\t\t\tonFocus?.( event );\n\t\t\topen();\n\t\t},\n\t\t[ onFocus ]\n\t);\n\n\t// Append and deduplicate media array for gallery use case.\n\tconst setMedia =\n\t\tmultiple && addToGallery\n\t\t\t? ( selected ) =>\n\t\t\t\t\tonSelect(\n\t\t\t\t\t\tdedupMedia( [ ...mediaRef.current, ...selected ] )\n\t\t\t\t\t)\n\t\t\t: onSelect;\n\n\tconst isOneType = allowedTypes.length === 1;\n\tconst isImage = isOneType && allowedTypes.includes( MEDIA_TYPE_IMAGE );\n\tconst isVideo = isOneType && allowedTypes.includes( MEDIA_TYPE_VIDEO );\n\tconst isAudio = isOneType && allowedTypes.includes( MEDIA_TYPE_AUDIO );\n\n\tlet placeholderTitle = labels.title;\n\tif ( placeholderTitle === undefined ) {\n\t\tplaceholderTitle = __( 'Media' );\n\t\tif ( isImage ) {\n\t\t\tplaceholderTitle = __( 'Image' );\n\t\t} else if ( isVideo ) {\n\t\t\tplaceholderTitle = __( 'Video' );\n\t\t} else if ( isAudio ) {\n\t\t\tplaceholderTitle = __( 'Audio' );\n\t\t}\n\t}\n\n\tlet instructions = labels.instructions;\n\tif ( instructions === undefined ) {\n\t\tif ( isImage ) {\n\t\t\tinstructions = __( 'Add image' );\n\t\t} else if ( isVideo ) {\n\t\t\tinstructions = __( 'Add video' );\n\t\t} else if ( isAudio ) {\n\t\t\tinstructions = __( 'Add audio' );\n\t\t} else {\n\t\t\tinstructions = __( 'Add image or video' );\n\t\t}\n\t}\n\n\tlet accessibilityHint = __( 'Double tap to select' );\n\tif ( isImage ) {\n\t\taccessibilityHint = __( 'Double tap to select an image' );\n\t} else if ( isVideo ) {\n\t\taccessibilityHint = __( 'Double tap to select a video' );\n\t} else if ( isAudio ) {\n\t\taccessibilityHint = __( 'Double tap to select an audio file' );\n\t}\n\n\tconst titleStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__header-title' ],\n\t\tstyles[ 'media-placeholder__header-title--dark' ]\n\t);\n\tconst addMediaButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.addMediaButton,\n\t\tstyles.addMediaButtonDark\n\t);\n\tconst buttonStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__button' ],\n\t\tstyles[ 'media-placeholder__button--dark' ]\n\t);\n\tconst emptyStateDescriptionStyles = usePreferredColorSchemeStyle(\n\t\tstyles.emptyStateDescription,\n\t\tstyles.emptyStateDescriptionDark\n\t);\n\tconst iconStyles = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__header-icon' ],\n\t\tstyles[ 'media-placeholder__header-icon--dark' ]\n\t);\n\tconst placeholderIcon = cloneElement( icon, {\n\t\tfill: iconStyles.fill,\n\t} );\n\tconst accessibilityLabel = sprintf(\n\t\t/* translators: accessibility text for the media block empty state. %s: media type */\n\t\t__( '%s block. Empty' ),\n\t\tplaceholderTitle\n\t);\n\n\tconst renderContent = ( open ) => {\n\t\tif ( isAppender === undefined || ! isAppender ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<View style={ styles[ 'media-placeholder__header' ] }>\n\t\t\t\t\t\t<View style={ iconStyles }>{ placeholderIcon }</View>\n\t\t\t\t\t\t<Text style={ titleStyles }>{ placeholderTitle }</Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t{ children }\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t\t\tonPress={ onButtonPress( open ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text style={ emptyStateDescriptionStyles }>\n\t\t\t\t\t\t\t{ instructions }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t</>\n\t\t\t);\n\t\t} else if ( isAppender && ! disableMediaButtons ) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\tstyle={ styles[ 'media-placeholder__appender' ] }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t\tonPress={ onButtonPress( open ) }\n\t\t\t\t>\n\t\t\t\t\t<View testID=\"media-placeholder-appender-icon\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ plusCircleFilled }\n\t\t\t\t\t\t\tstyle={ addMediaButtonStyle }\n\t\t\t\t\t\t\tcolor={ addMediaButtonStyle.color }\n\t\t\t\t\t\t\tsize={ addMediaButtonStyle.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\t};\n\n\tconst appenderStyle = usePreferredColorSchemeStyle(\n\t\tstyles.appender,\n\t\tstyles.appenderDark\n\t);\n\tconst containerSelectedStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'media-placeholder__container-selected' ],\n\t\tstyles[ 'media-placeholder__container-selected--dark' ]\n\t);\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'media-placeholder__container' ],\n\t\t\tstyles[ 'media-placeholder__container--dark' ]\n\t\t),\n\t\tblockEditContext?.isSelected &&\n\t\t\t! className.includes( 'no-block-outline' ) &&\n\t\t\tcontainerSelectedStyle,\n\t];\n\n\tif ( isAppender && disableMediaButtons ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<View style={ { flex: 1 } }>\n\t\t\t<MediaUpload\n\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\tonSelect={ setMedia }\n\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t__experimentalOnlyMediaLibrary={\n\t\t\t\t\t__experimentalOnlyMediaLibrary\n\t\t\t\t}\n\t\t\t\tmultiple={ multiple }\n\t\t\t\tisReplacingMedia={ false }\n\t\t\t\tautoOpen={ autoOpenMediaUpload }\n\t\t\t\trender={ ( { open, getMediaOptions } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\tcontainerStyle,\n\t\t\t\t\t\t\t\t\theight && { height },\n\t\t\t\t\t\t\t\t\tbackgroundColor && { backgroundColor },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tisAppender && appenderStyle,\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ getMediaOptions() }\n\t\t\t\t\t\t\t{ ! hideContent && renderContent( open ) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</View>\n\t);\n}\n\nexport default MediaPlaceholder;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,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E/E,SAAS,CAAC8B,QAAQ,CAAE,kBAAmB,CAAC,IAC1C+C,sBAAsB,CACvB;EAED,IAAKvE,UAAU,IAAIC,mBAAmB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAA7B,WAAA,CAAAqF,GAAA,EAAChG,YAAA,CAAA8F,IAAI;IAACC,KAAK,EAAG;MAAEkB,IAAI,EAAE;IAAE,CAAG;IAAAtE,QAAA,eAC1B,IAAAhC,WAAA,CAAAqF,GAAA,EAACvF,YAAA,CAAAyG,OAAW;MACXlF,YAAY,EAAGA,YAAc;MAC7BI,QAAQ,EAAGsB,QAAU;MACrBV,WAAW,EAAGA,WAAa;MAC3BV,8BAA8B,EAC7BA,8BACA;MACDG,QAAQ,EAAGA,QAAU;MACrB0E,gBAAgB,EAAG,KAAO;MAC1BC,QAAQ,EAAGrE,mBAAqB;MAChCsE,MAAM,EAAGA,CAAE;QAAE7D,IAAI;QAAE8D;MAAgB,CAAC,KAAM;QACzC,oBACC,IAAA3G,WAAA,CAAAiF,IAAA,EAAC5F,YAAA,CAAA8F,IAAI;UACJC,KAAK,EAAG,CACP,CACCgB,cAAc,EACdnE,MAAM,IAAI;YAAEA;UAAO,CAAC,EACpBC,eAAe,IAAI;YAAEA;UAAgB,CAAC,CACtC,EACDN,UAAU,IAAIoE,aAAa,CACzB;UAAAhE,QAAA,GAED2E,eAAe,CAAC,CAAC,EACjB,CAAExE,WAAW,IAAI6C,aAAa,CAAEnC,IAAK,CAAC;QAAA,CACnC,CAAC;MAET;IAAG,CACH;EAAC,CACG,CAAC;AAET;AAAC,IAAA+D,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcrF,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_a11y","_components","_data","_keycodes","_icons","_compose","_dom","_notices","_mediaUpload","_check","_linkControl","_store","_jsxRuntime","noop","uniqueId","MediaReplaceFlow","mediaURL","mediaId","mediaIds","allowedTypes","accept","onError","onSelect","onSelectURL","onReset","onToggleFeaturedImage","useFeaturedImage","onFilesUpload","name","__","createNotice","removeNotice","children","multiple","addToGallery","handleUpload","popoverProps","mediaUpload","useSelect","select","blockEditorStore","getSettings","canUpload","editMediaButtonRef","useRef","errorNoticeID","onUploadError","message","safeMessage","stripHTML","setTimeout","speak","id","isDismissible","selectMedia","media","closeMenu","uploadFiles","event","files","target","filesList","onFileChange","openOnArrowDown","keyCode","DOWN","preventDefault","click","onlyAllowsImages","length","every","allowedType","startsWith","gallery","jsx","Dropdown","contentClassName","renderToggle","isOpen","onToggle","ToolbarButton","ref","onClick","onKeyDown","renderContent","onClose","jsxs","Fragment","NavigableMenu","className","default","value","render","open","MenuItem","icon","mediaIcon","FormFileUpload","onChange","openFileDialog","upload","postFeaturedImage","isPressed","clsx","url","settings","showSuggestions","current","focus","_default","exports","compose","withDispatch","dispatch","noticesStore","withFilters"],"sources":["@wordpress/block-editor/src/components/media-replace-flow/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport {\n\tFormFileUpload,\n\tNavigableMenu,\n\tMenuItem,\n\tToolbarButton,\n\tDropdown,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, withDispatch } from '@wordpress/data';\nimport { DOWN } from '@wordpress/keycodes';\nimport {\n\tpostFeaturedImage,\n\tupload,\n\tmedia as mediaIcon,\n} from '@wordpress/icons';\nimport { compose } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport MediaUpload from '../media-upload';\nimport MediaUploadCheck from '../media-upload/check';\nimport LinkControl from '../link-control';\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\nlet uniqueId = 0;\n\nconst MediaReplaceFlow = ( {\n\tmediaURL,\n\tmediaId,\n\tmediaIds,\n\tallowedTypes,\n\taccept,\n\tonError,\n\tonSelect,\n\tonSelectURL,\n\tonReset,\n\tonToggleFeaturedImage,\n\tuseFeaturedImage,\n\tonFilesUpload = noop,\n\tname = __( 'Replace' ),\n\tcreateNotice,\n\tremoveNotice,\n\tchildren,\n\tmultiple = false,\n\taddToGallery,\n\thandleUpload = true,\n\tpopoverProps,\n} ) => {\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).getSettings().mediaUpload;\n\t}, [] );\n\tconst canUpload = !! mediaUpload;\n\tconst editMediaButtonRef = useRef();\n\tconst errorNoticeID = `block-editor/media-replace-flow/error-notice/${ ++uniqueId }`;\n\n\tconst onUploadError = ( message ) => {\n\t\tconst safeMessage = stripHTML( message );\n\t\tif ( onError ) {\n\t\t\tonError( safeMessage );\n\t\t\treturn;\n\t\t}\n\t\t// We need to set a timeout for showing the notice\n\t\t// so that VoiceOver and possibly other screen readers\n\t\t// can announce the error after the toolbar button\n\t\t// regains focus once the upload dialog closes.\n\t\t// Otherwise VO simply skips over the notice and announces\n\t\t// the focused element and the open menu.\n\t\tsetTimeout( () => {\n\t\t\tcreateNotice( 'error', safeMessage, {\n\t\t\t\tspeak: true,\n\t\t\t\tid: errorNoticeID,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}, 1000 );\n\t};\n\n\tconst selectMedia = ( media, closeMenu ) => {\n\t\tif ( useFeaturedImage && onToggleFeaturedImage ) {\n\t\t\tonToggleFeaturedImage();\n\t\t}\n\t\tcloseMenu();\n\t\t// Calling `onSelect` after the state update since it might unmount the component.\n\t\tonSelect( media );\n\t\tspeak( __( 'The media file has been replaced' ) );\n\t\tremoveNotice( errorNoticeID );\n\t};\n\n\tconst uploadFiles = ( event, closeMenu ) => {\n\t\tconst files = event.target.files;\n\t\tif ( ! handleUpload ) {\n\t\t\tcloseMenu();\n\t\t\treturn onSelect( files );\n\t\t}\n\t\tonFilesUpload( files );\n\t\tmediaUpload( {\n\t\t\tallowedTypes,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\tselectMedia( media, closeMenu );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t} );\n\t};\n\n\tconst openOnArrowDown = ( event ) => {\n\t\tif ( event.keyCode === DOWN ) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.target.click();\n\t\t}\n\t};\n\n\tconst onlyAllowsImages = () => {\n\t\tif ( ! allowedTypes || allowedTypes.length === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn allowedTypes.every(\n\t\t\t( allowedType ) =>\n\t\t\t\tallowedType === 'image' || allowedType.startsWith( 'image/' )\n\t\t);\n\t};\n\n\tconst gallery = multiple && onlyAllowsImages();\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tcontentClassName=\"block-editor-media-replace-flow__options\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tref={ editMediaButtonRef }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t>\n\t\t\t\t\t{ name }\n\t\t\t\t</ToolbarButton>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<NavigableMenu className=\"block-editor-media-replace-flow__media-upload-menu\">\n\t\t\t\t\t\t<MediaUploadCheck>\n\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\tgallery={ gallery }\n\t\t\t\t\t\t\t\taddToGallery={ addToGallery }\n\t\t\t\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\t\t\t\tvalue={ multiple ? mediaIds : mediaId }\n\t\t\t\t\t\t\t\tonSelect={ ( media ) =>\n\t\t\t\t\t\t\t\t\tselectMedia( media, onClose )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={ mediaIcon }\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Open Media Library' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\t\t\t\t\tuploadFiles( event, onClose );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\topenFileDialog();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MediaUploadCheck>\n\t\t\t\t\t\t{ onToggleFeaturedImage && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ postFeaturedImage }\n\t\t\t\t\t\t\t\tonClick={ onToggleFeaturedImage }\n\t\t\t\t\t\t\t\tisPressed={ useFeaturedImage }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Use featured image' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ mediaURL && onReset && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t: children }\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t{ onSelectURL && (\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t\t\t\t\t<form\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-media-flow__url-input',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-siblings':\n\t\t\t\t\t\t\t\t\t\tcanUpload || onToggleFeaturedImage,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-media-replace-flow__image-url-label\">\n\t\t\t\t\t\t\t\t{ __( 'Current media URL:' ) }\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tvalue={ { url: mediaURL } }\n\t\t\t\t\t\t\t\tsettings={ [] }\n\t\t\t\t\t\t\t\tshowSuggestions={ false }\n\t\t\t\t\t\t\t\tonChange={ ( { url } ) => {\n\t\t\t\t\t\t\t\t\tonSelectURL( url );\n\t\t\t\t\t\t\t\t\teditMediaButtonRef.current.focus();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t/>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md\n */\nexport default compose( [\n\twithDispatch( ( dispatch ) => {\n\t\tconst { createNotice, removeNotice } = dispatch( noticesStore );\n\t\treturn {\n\t\t\tcreateNotice,\n\t\t\tremoveNotice,\n\t\t};\n\t} ),\n\twithFilters( 'editor.MediaReplaceFlow' ),\n] )( MediaReplaceFlow );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAQA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,YAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,MAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,YAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAAwD,IAAAe,WAAA,GAAAf,OAAA;AApCxD;AACA;AACA;;AAGA;AACA;AACA;;AAuBA;AACA;AACA;;AAMA,MAAMgB,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,IAAIC,QAAQ,GAAG,CAAC;AAEhB,MAAMC,gBAAgB,GAAGA,CAAE;EAC1BC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,YAAY;EACZC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACRC,WAAW;EACXC,OAAO;EACPC,qBAAqB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D,IAAAH,QAAE,EAAE,oBAAqB;QAAC,CACvB,CAAC,eAEP,IAAAjB,WAAA,CAAA8D,GAAA,EAAChE,YAAA,CAAAgF,OAAW;UACXC,KAAK,EAAG;YAAEa,GAAG,EAAExF;UAAS,CAAG;UAC3ByF,QAAQ,EAAG,EAAI;UACfC,eAAe,EAAG,KAAO;UACzBR,QAAQ,EAAGA,CAAE;YAAEM;UAAI,CAAC,KAAM;YACzBjF,WAAW,CAAEiF,GAAI,CAAC;YAClB7D,kBAAkB,CAACgE,OAAO,CAACC,KAAK,CAAC,CAAC;UACnC;QAAG,CACH,CAAC;MAAA,CACG,CACN;IAAA,CACA;EACA,CACH,CAAC;AAEJ,CAAC;;AAED;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAGe,IAAAqB,gBAAO,EAAE,CACvB,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEnF,YAAY;IAAEC;EAAa,CAAC,GAAGkF,QAAQ,CAAEC,cAAa,CAAC;EAC/D,OAAO;IACNpF,YAAY;IACZC;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAoF,uBAAW,EAAE,yBAA0B,CAAC,CACvC,CAAC,CAAEpG,gBAAiB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_a11y","_components","_data","_keycodes","_icons","_compose","_dom","_notices","_mediaUpload","_check","_linkControl","_store","_jsxRuntime","noop","uniqueId","MediaReplaceFlow","mediaURL","mediaId","mediaIds","allowedTypes","accept","onError","onSelect","onSelectURL","onReset","onToggleFeaturedImage","useFeaturedImage","onFilesUpload","name","__","createNotice","removeNotice","children","multiple","addToGallery","handleUpload","popoverProps","mediaUpload","useSelect","select","blockEditorStore","getSettings","canUpload","editMediaButtonRef","useRef","errorNoticeID","onUploadError","message","safeMessage","stripHTML","setTimeout","speak","id","isDismissible","selectMedia","media","closeMenu","uploadFiles","event","files","target","filesList","onFileChange","openOnArrowDown","keyCode","DOWN","preventDefault","click","onlyAllowsImages","length","every","allowedType","startsWith","gallery","jsx","Dropdown","contentClassName","renderToggle","isOpen","onToggle","ToolbarButton","ref","onClick","onKeyDown","renderContent","onClose","jsxs","Fragment","NavigableMenu","className","default","value","render","open","MenuItem","icon","mediaIcon","FormFileUpload","onChange","openFileDialog","upload","postFeaturedImage","isPressed","clsx","url","settings","showSuggestions","current","focus","_default","exports","compose","withDispatch","dispatch","noticesStore","withFilters"],"sources":["@wordpress/block-editor/src/components/media-replace-flow/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport {\n\tFormFileUpload,\n\tNavigableMenu,\n\tMenuItem,\n\tToolbarButton,\n\tDropdown,\n\twithFilters,\n} from '@wordpress/components';\nimport { useSelect, withDispatch } from '@wordpress/data';\nimport { DOWN } from '@wordpress/keycodes';\nimport {\n\tpostFeaturedImage,\n\tupload,\n\tmedia as mediaIcon,\n} from '@wordpress/icons';\nimport { compose } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport MediaUpload from '../media-upload';\nimport MediaUploadCheck from '../media-upload/check';\nimport LinkControl from '../link-control';\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\nlet uniqueId = 0;\n\nconst MediaReplaceFlow = ( {\n\tmediaURL,\n\tmediaId,\n\tmediaIds,\n\tallowedTypes,\n\taccept,\n\tonError,\n\tonSelect,\n\tonSelectURL,\n\tonReset,\n\tonToggleFeaturedImage,\n\tuseFeaturedImage,\n\tonFilesUpload = noop,\n\tname = __( 'Replace' ),\n\tcreateNotice,\n\tremoveNotice,\n\tchildren,\n\tmultiple = false,\n\taddToGallery,\n\thandleUpload = true,\n\tpopoverProps,\n} ) => {\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\treturn select( blockEditorStore ).getSettings().mediaUpload;\n\t}, [] );\n\tconst canUpload = !! mediaUpload;\n\tconst editMediaButtonRef = useRef();\n\tconst errorNoticeID = `block-editor/media-replace-flow/error-notice/${ ++uniqueId }`;\n\n\tconst onUploadError = ( message ) => {\n\t\tconst safeMessage = stripHTML( message );\n\t\tif ( onError ) {\n\t\t\tonError( safeMessage );\n\t\t\treturn;\n\t\t}\n\t\t// We need to set a timeout for showing the notice\n\t\t// so that VoiceOver and possibly other screen readers\n\t\t// can announce the error after the toolbar button\n\t\t// regains focus once the upload dialog closes.\n\t\t// Otherwise VO simply skips over the notice and announces\n\t\t// the focused element and the open menu.\n\t\tsetTimeout( () => {\n\t\t\tcreateNotice( 'error', safeMessage, {\n\t\t\t\tspeak: true,\n\t\t\t\tid: errorNoticeID,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}, 1000 );\n\t};\n\n\tconst selectMedia = ( media, closeMenu ) => {\n\t\tif ( useFeaturedImage && onToggleFeaturedImage ) {\n\t\t\tonToggleFeaturedImage();\n\t\t}\n\t\tcloseMenu();\n\t\t// Calling `onSelect` after the state update since it might unmount the component.\n\t\tonSelect( media );\n\t\tspeak( __( 'The media file has been replaced' ) );\n\t\tremoveNotice( errorNoticeID );\n\t};\n\n\tconst uploadFiles = ( event, closeMenu ) => {\n\t\tconst files = event.target.files;\n\t\tif ( ! handleUpload ) {\n\t\t\tcloseMenu();\n\t\t\treturn onSelect( files );\n\t\t}\n\t\tonFilesUpload( files );\n\t\tmediaUpload( {\n\t\t\tallowedTypes,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\tselectMedia( media, closeMenu );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t} );\n\t};\n\n\tconst openOnArrowDown = ( event ) => {\n\t\tif ( event.keyCode === DOWN ) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.target.click();\n\t\t}\n\t};\n\n\tconst onlyAllowsImages = () => {\n\t\tif ( ! allowedTypes || allowedTypes.length === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn allowedTypes.every(\n\t\t\t( allowedType ) =>\n\t\t\t\tallowedType === 'image' || allowedType.startsWith( 'image/' )\n\t\t);\n\t};\n\n\tconst gallery = multiple && onlyAllowsImages();\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tcontentClassName=\"block-editor-media-replace-flow__options\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tref={ editMediaButtonRef }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t>\n\t\t\t\t\t{ name }\n\t\t\t\t</ToolbarButton>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<NavigableMenu className=\"block-editor-media-replace-flow__media-upload-menu\">\n\t\t\t\t\t\t<MediaUploadCheck>\n\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\tgallery={ gallery }\n\t\t\t\t\t\t\t\taddToGallery={ addToGallery }\n\t\t\t\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\t\t\t\tvalue={ multiple ? mediaIds : mediaId }\n\t\t\t\t\t\t\t\tonSelect={ ( media ) =>\n\t\t\t\t\t\t\t\t\tselectMedia( media, onClose )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={ mediaIcon }\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Open Media Library' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\t\t\t\t\tuploadFiles( event, onClose );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\topenFileDialog();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MediaUploadCheck>\n\t\t\t\t\t\t{ onToggleFeaturedImage && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ postFeaturedImage }\n\t\t\t\t\t\t\t\tonClick={ onToggleFeaturedImage }\n\t\t\t\t\t\t\t\tisPressed={ useFeaturedImage }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Use featured image' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ mediaURL && onReset && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t: children }\n\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t{ onSelectURL && (\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t\t\t\t\t<form\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-media-flow__url-input',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-siblings':\n\t\t\t\t\t\t\t\t\t\tcanUpload || onToggleFeaturedImage,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-media-replace-flow__image-url-label\">\n\t\t\t\t\t\t\t\t{ __( 'Current media URL:' ) }\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tvalue={ { url: mediaURL } }\n\t\t\t\t\t\t\t\tsettings={ [] }\n\t\t\t\t\t\t\t\tshowSuggestions={ false }\n\t\t\t\t\t\t\t\tonChange={ ( { url } ) => {\n\t\t\t\t\t\t\t\t\tonSelectURL( url );\n\t\t\t\t\t\t\t\t\teditMediaButtonRef.current.focus();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t/>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md\n */\nexport default compose( [\n\twithDispatch( ( dispatch ) => {\n\t\tconst { createNotice, removeNotice } = dispatch( noticesStore );\n\t\treturn {\n\t\t\tcreateNotice,\n\t\t\tremoveNotice,\n\t\t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W,CAAEiF,GAAI,CAAC;YAClB7D,kBAAkB,CAACgE,OAAO,CAACC,KAAK,CAAC,CAAC;UACnC;QAAG,CACH,CAAC;MAAA,CACG,CACN;IAAA,CACA;EACA,CACH,CAAC;AAEJ,CAAC;;AAED;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAGe,IAAAqB,gBAAO,EAAE,CACvB,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEnF,YAAY;IAAEC;EAAa,CAAC,GAAGkF,QAAQ,CAAEC,cAAa,CAAC;EAC/D,OAAO;IACNpF,YAAY;IACZC;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAoF,uBAAW,EAAE,yBAA0B,CAAC,CACvC,CAAC,CAAEpG,gBAAiB,CAAC","ignoreList":[]}
|
|
@@ -42,11 +42,11 @@ function MultiSelectionInspector() {
|
|
|
42
42
|
className: "block-editor-multi-selection-inspector__card-content",
|
|
43
43
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
44
|
className: "block-editor-multi-selection-inspector__card-title",
|
|
45
|
-
children: (0, _i18n.sprintf)(
|
|
45
|
+
children: (0, _i18n.sprintf)(/* translators: %d: number of blocks */
|
|
46
46
|
(0, _i18n._n)('%d Block', '%d Blocks', blocks.length), blocks.length)
|
|
47
47
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
48
48
|
className: "block-editor-multi-selection-inspector__card-description",
|
|
49
|
-
children: (0, _i18n.sprintf)(
|
|
49
|
+
children: (0, _i18n.sprintf)(/* translators: %d: number of words */
|
|
50
50
|
(0, _i18n._n)('%d word selected.', '%d words selected.', words), words)
|
|
51
51
|
})]
|
|
52
52
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_blocks","_wordcount","_icons","_blockIcon","_interopRequireDefault","_store","_jsxRuntime","MultiSelectionInspector","blocks","useSelect","select","getMultiSelectedBlocks","blockEditorStore","words","wordCount","serialize","jsxs","className","children","jsx","default","icon","copy","showColors","sprintf","_n","length"],"sources":["@wordpress/block-editor/src/components/multi-selection-inspector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { serialize } from '@wordpress/blocks';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function MultiSelectionInspector() {\n\tconst { blocks } = useSelect( ( select ) => {\n\t\tconst { getMultiSelectedBlocks } = select( blockEditorStore );\n\t\treturn {\n\t\t\tblocks: getMultiSelectedBlocks(),\n\t\t};\n\t}, [] );\n\tconst words = wordCount( serialize( blocks ), 'words' );\n\n\treturn (\n\t\t<div className=\"block-editor-multi-selection-inspector__card\">\n\t\t\t<BlockIcon icon={ copy } showColors />\n\t\t\t<div className=\"block-editor-multi-selection-inspector__card-content\">\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-title\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks */\n\t\t\t\t\t\t_n( '%d Block', '%d Blocks', blocks.length ),\n\t\t\t\t\t\tblocks.length\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of words */\n\t\t\t\t\t\t_n( '%d word selected.', '%d words selected.', words ),\n\t\t\t\t\t\twords\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAwD,IAAAQ,WAAA,GAAAR,OAAA;AAbxD;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASS,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC3C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,YAAiB,CAAC;IAC7D,OAAO;MACNJ,MAAM,EAAEG,sBAAsB,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAME,KAAK,GAAG,IAAAC,gBAAS,EAAE,IAAAC,iBAAS,EAAEP,MAAO,CAAC,EAAE,OAAQ,CAAC;EAEvD,oBACC,IAAAF,WAAA,CAAAU,IAAA;IAAKC,SAAS,EAAC,8CAA8C;IAAAC,QAAA,gBAC5D,IAAAZ,WAAA,CAAAa,GAAA,EAAChB,UAAA,CAAAiB,OAAS;MAACC,IAAI,EAAGC,WAAM;MAACC,UAAU;IAAA,CAAE,CAAC,eACtC,IAAAjB,WAAA,CAAAU,IAAA;MAAKC,SAAS,EAAC,sDAAsD;MAAAC,QAAA,gBACpE,IAAAZ,WAAA,CAAAa,GAAA;QAAKF,SAAS,EAAC,oDAAoD;QAAAC,QAAA,EAChE,IAAAM,aAAO,
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_blocks","_wordcount","_icons","_blockIcon","_interopRequireDefault","_store","_jsxRuntime","MultiSelectionInspector","blocks","useSelect","select","getMultiSelectedBlocks","blockEditorStore","words","wordCount","serialize","jsxs","className","children","jsx","default","icon","copy","showColors","sprintf","_n","length"],"sources":["@wordpress/block-editor/src/components/multi-selection-inspector/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { serialize } from '@wordpress/blocks';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function MultiSelectionInspector() {\n\tconst { blocks } = useSelect( ( select ) => {\n\t\tconst { getMultiSelectedBlocks } = select( blockEditorStore );\n\t\treturn {\n\t\t\tblocks: getMultiSelectedBlocks(),\n\t\t};\n\t}, [] );\n\tconst words = wordCount( serialize( blocks ), 'words' );\n\n\treturn (\n\t\t<div className=\"block-editor-multi-selection-inspector__card\">\n\t\t\t<BlockIcon icon={ copy } showColors />\n\t\t\t<div className=\"block-editor-multi-selection-inspector__card-content\">\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-title\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks */\n\t\t\t\t\t\t_n( '%d Block', '%d Blocks', blocks.length ),\n\t\t\t\t\t\tblocks.length\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-multi-selection-inspector__card-description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of words */\n\t\t\t\t\t\t_n( '%d word selected.', '%d words selected.', words ),\n\t\t\t\t\t\twords\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAwD,IAAAQ,WAAA,GAAAR,OAAA;AAbxD;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASS,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC3C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,YAAiB,CAAC;IAC7D,OAAO;MACNJ,MAAM,EAAEG,sBAAsB,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAME,KAAK,GAAG,IAAAC,gBAAS,EAAE,IAAAC,iBAAS,EAAEP,MAAO,CAAC,EAAE,OAAQ,CAAC;EAEvD,oBACC,IAAAF,WAAA,CAAAU,IAAA;IAAKC,SAAS,EAAC,8CAA8C;IAAAC,QAAA,gBAC5D,IAAAZ,WAAA,CAAAa,GAAA,EAAChB,UAAA,CAAAiB,OAAS;MAACC,IAAI,EAAGC,WAAM;MAACC,UAAU;IAAA,CAAE,CAAC,eACtC,IAAAjB,WAAA,CAAAU,IAAA;MAAKC,SAAS,EAAC,sDAAsD;MAAAC,QAAA,gBACpE,IAAAZ,WAAA,CAAAa,GAAA;QAAKF,SAAS,EAAC,oDAAoD;QAAAC,QAAA,EAChE,IAAAM,aAAO,EACR;QACA,IAAAC,QAAE,EAAE,UAAU,EAAE,WAAW,EAAEjB,MAAM,CAACkB,MAAO,CAAC,EAC5ClB,MAAM,CAACkB,MACR;MAAC,CACG,CAAC,eACN,IAAApB,WAAA,CAAAa,GAAA;QAAKF,SAAS,EAAC,0DAA0D;QAAAC,QAAA,EACtE,IAAAM,aAAO,EACR;QACA,IAAAC,QAAE,EAAE,mBAAmB,EAAE,oBAAoB,EAAEZ,KAAM,CAAC,EACtDA,KACD;MAAC,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_dom","_keycodes","_store","_jsxRuntime","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","useSelect","select","blockEditorStore","stopTyping","useDispatch","useRefEffect","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","_isTyping","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","isTextField","stopTypingOnEscapeKey","ESCAPE","TAB","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","useMergeRefs","ObserveTyping","children","jsx","ref","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAcA,IAAAI,MAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AApBxD;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GACA,MAAMM,2BAA2B,GAAG,IAAIC,GAAG,CAAE,CAC5CC,YAAE,EACFC,eAAK,EACLC,cAAI,EACJC,cAAI,EACJC,eAAK,EACLC,mBAAS,CACR,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CAAEC,KAAK,EAAG;EACjD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGF,KAAK;EACnC,OAAO,CAAEE,QAAQ,IAAIX,2BAA2B,CAACY,GAAG,CAAEF,OAAQ,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACO,SAASG,uBAAuBA,CAAA,EAAG;EACzC,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACH,QAAQ,CAAC,CAAC,EACnD,EACD,CAAC;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,OAAA,GAGeN,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_dom","_keycodes","_store","_jsxRuntime","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","useSelect","select","blockEditorStore","stopTyping","useDispatch","useRefEffect","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","_isTyping","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","isTextField","stopTypingOnEscapeKey","ESCAPE","TAB","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","useMergeRefs","ObserveTyping","children","jsx","ref","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAcA,IAAAI,MAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AApBxD;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GACA,MAAMM,2BAA2B,GAAG,IAAIC,GAAG,CAAE,CAC5CC,YAAE,EACFC,eAAK,EACLC,cAAI,EACJC,cAAI,EACJC,eAAK,EACLC,mBAAS,CACR,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CAAEC,KAAK,EAAG;EACjD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGF,KAAK;EACnC,OAAO,CAAEE,QAAQ,IAAIX,2BAA2B,CAACY,GAAG,CAAEF,OAAQ,CAA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AG;EACtC,oBAAO,IAAAvD,WAAA,CAAAwD,GAAA;IAAKC,GAAG,EAAG1B,iBAAiB,CAAC,CAAG;IAAAwB,QAAA,EAAGA;EAAQ,CAAO,CAAC;AAC3D;;AAEA;AACA;AACA;AAFA,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGeN,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_deprecated","_interopRequireDefault","_context","_jsxRuntime","RenderedRefsContext","createContext","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","RecursionProvider","children","previouslyRenderedBlocks","useContext","name","useBlockEditContext","newRenderedBlocks","useMemo","jsx","Provider","value","useHasRecursion","Boolean","has","DeprecatedExperimentalRecursionProvider","props","deprecated","since","alternative","exports","DeprecatedExperimentalUseHasRecursion","args"],"sources":["@wordpress/block-editor/src/components/recursion-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React context provider for use with the `useHasRecursion` hook to prevent recursive\n * renders.\n *\n * Wrap block content with this provider and provide the same `uniqueId` prop as used\n * with `useHasRecursion`.\n *\n * @param {Object} props\n * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} props.blockName Optional block name.\n * @param {JSX.Element} props.children React children.\n *\n * @return {JSX.Element} A React element.\n */\nexport function RecursionProvider( { children, uniqueId, blockName = '' } ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\n\tblockName = blockName || name;\n\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\n\treturn (\n\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t{ children }\n\t\t</RenderedRefsContext.Provider>\n\t);\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * Use this with the `RecursionProvider` component, using the same `uniqueId` value\n * for both the hook and the provider.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {boolean} A boolean describing whether the provided id has already been rendered.\n */\nexport function useHasRecursion( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\treturn Boolean( previouslyRenderedBlocks[ blockName ]?.has( uniqueId ) );\n}\n\nexport const DeprecatedExperimentalRecursionProvider = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalRecursionProvider', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.RecursionProvider',\n\t} );\n\treturn <RecursionProvider { ...props } />;\n};\n\nexport const DeprecatedExperimentalUseHasRecursion = ( ...args ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalUseHasRecursion', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useHasRecursion',\n\t} );\n\treturn useHasRecursion( ...args );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_deprecated","_interopRequireDefault","_context","_jsxRuntime","RenderedRefsContext","createContext","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","RecursionProvider","children","previouslyRenderedBlocks","useContext","name","useBlockEditContext","newRenderedBlocks","useMemo","jsx","Provider","value","useHasRecursion","Boolean","has","DeprecatedExperimentalRecursionProvider","props","deprecated","since","alternative","exports","DeprecatedExperimentalUseHasRecursion","args"],"sources":["@wordpress/block-editor/src/components/recursion-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React context provider for use with the `useHasRecursion` hook to prevent recursive\n * renders.\n *\n * Wrap block content with this provider and provide the same `uniqueId` prop as used\n * with `useHasRecursion`.\n *\n * @param {Object} props\n * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} props.blockName Optional block name.\n * @param {JSX.Element} props.children React children.\n *\n * @return {JSX.Element} A React element.\n */\nexport function RecursionProvider( { children, uniqueId, blockName = '' } ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\n\tblockName = blockName || name;\n\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\n\treturn (\n\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t{ children }\n\t\t</RenderedRefsContext.Provider>\n\t);\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * Use this with the `RecursionProvider` component, using the same `uniqueId` value\n * for both the hook and the provider.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {boolean} A boolean describing whether the provided id has already been rendered.\n */\nexport function useHasRecursion( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\treturn Boolean( previouslyRenderedBlocks[ blockName ]?.has( uniqueId ) );\n}\n\nexport const DeprecatedExperimentalRecursionProvider = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalRecursionProvider', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.RecursionProvider',\n\t} );\n\treturn <RecursionProvider { ...props } />;\n};\n\nexport const DeprecatedExperimentalUseHasRecursion = ( ...args ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalUseHasRecursion', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useHasRecursion',\n\t} );\n\treturn useHasRecursion( ...args );\n};\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAA4D,IAAAI,WAAA,GAAAJ,OAAA;AAT5D;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMK,mBAAmB,GAAG,IAAAC,sBAAa,EAAE,CAAC,CAAE,CAAC;;AAE/C;AACA;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AAEa;EAAK,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EACtCV,SAAS,GAAGA,SAAS,IAAIS,IAAI;EAC7B,OAAOQ,OAAO,CAAEV,wBAAwB,CAAEP,SAAS,CAAE,EAAEkB,GAAG,CAAEjB,QAAS,CAAE,CAAC;AACzE;AAEO,MAAMkB,uCAAuC,GAAKC,KAAK,IAAM;EACnE,IAAAC,mBAAU,EAAE,gDAAgD,EAAE;IAC7DC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,oBAAO,IAAA5B,WAAA,CAAAkB,GAAA,EAACR,iBAAiB;IAAA,GAAMe;EAAK,CAAI,CAAC;AAC1C,CAAC;AAACI,OAAA,CAAAL,uCAAA,GAAAA,uCAAA;AAEK,MAAMM,qCAAqC,GAAGA,CAAE,GAAGC,IAAI,KAAM;EACnE,IAAAL,mBAAU,EAAE,8CAA8C,EAAE;IAC3DC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAOP,eAAe,CAAE,GAAGU,IAAK,CAAC;AAClC,CAAC;AAACF,OAAA,CAAAC,qCAAA,GAAAA,qCAAA","ignoreList":[]}
|
|
@@ -50,16 +50,16 @@ function ResponsiveBlockControl(props) {
|
|
|
50
50
|
if (!title || !property || !renderDefaultControl) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
const toggleControlLabel = toggleLabel || (0, _i18n.sprintf)(
|
|
53
|
+
const toggleControlLabel = toggleLabel || (0, _i18n.sprintf)(/* translators: %s: Property value for the control (eg: margin, padding, etc.). */
|
|
54
54
|
(0, _i18n.__)('Use the same %s on all screen sizes.'), property);
|
|
55
55
|
const toggleHelpText = (0, _i18n.__)('Toggle between using the same value for all screen sizes or using a unique value per screen size.');
|
|
56
|
-
const defaultControl = renderDefaultControl(
|
|
56
|
+
const defaultControl = renderDefaultControl(/*#__PURE__*/(0, _jsxRuntime.jsx)(_label.default, {
|
|
57
57
|
property: property,
|
|
58
58
|
viewport: defaultLabel
|
|
59
59
|
}), defaultLabel);
|
|
60
60
|
const defaultResponsiveControls = () => {
|
|
61
61
|
return viewports.map(viewport => /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.Fragment, {
|
|
62
|
-
children: renderDefaultControl(
|
|
62
|
+
children: renderDefaultControl(/*#__PURE__*/(0, _jsxRuntime.jsx)(_label.default, {
|
|
63
63
|
property: property,
|
|
64
64
|
viewport: viewport
|
|
65
65
|
}), viewport)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_components","_label","_jsxRuntime","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","_x","viewports","__","toggleControlLabel","sprintf","toggleHelpText","defaultControl","jsx","default","viewport","defaultResponsiveControls","map","Fragment","children","jsxs","className","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","clsx","_default","exports"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\tlabel: _x( 'All', 'screen sizes' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: %s: Property value for the control (eg: margin, padding, etc.). */\n\t\t\t__( 'Use the same %s on all screen sizes.' ),\n\t\t\tproperty\n\t\t);\n\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nexport default ResponsiveBlockControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAflD;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASM,sBAAsBA,CAAEC,KAAK,EAAG;EACxC,MAAM;IACLC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC,oBAAoB;IACpBC,oBAAoB;IACpBC,wBAAwB;IACxBC,YAAY,GAAG,KAAK;IACpBC,YAAY,GAAG;MACdC,EAAE,EAAE,KAAK;MACTC,KAAK,EAAE,IAAAC,QAAE,EAAE,KAAK,EAAE,cAAe;IAClC,CAAC;IACDC,SAAS,GAAG,CACX;MACCH,EAAE,EAAE,OAAO;MACXC,KAAK,EAAE,IAAAG,QAAE,EAAE,eAAgB;IAC5B,CAAC,EACD;MACCJ,EAAE,EAAE,QAAQ;MACZC,KAAK,EAAE,IAAAG,QAAE,EAAE,gBAAiB;IAC7B,CAAC,EACD;MACCJ,EAAE,EAAE,OAAO;MACXC,KAAK,EAAE,IAAAG,QAAE,EAAE,eAAgB;IAC5B,CAAC;EAEH,CAAC,GAAGb,KAAK;EAET,IAAK,CAAEC,KAAK,IAAI,CAAEC,QAAQ,IAAI,CAAEG,oBAAoB,EAAG;IACtD,OAAO,IAAI;EACZ;EAEA,MAAMS,kBAAkB,GACvBX,WAAW,IACX,IAAAY,aAAO,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_components","_label","_jsxRuntime","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","_x","viewports","__","toggleControlLabel","sprintf","toggleHelpText","defaultControl","jsx","default","viewport","defaultResponsiveControls","map","Fragment","children","jsxs","className","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","clsx","_default","exports"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\tlabel: _x( 'All', 'screen sizes' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: %s: Property value for the control (eg: margin, padding, etc.). */\n\t\t\t__( 'Use the same %s on all screen sizes.' ),\n\t\t\tproperty\n\t\t);\n\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nexport default ResponsiveBlockControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAflD;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASM,sBAAsBA,CAAEC,KAAK,EAAG;EACxC,MAAM;IACLC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC,oBAAoB;IACpBC,oBAAoB;IACpBC,wBAAwB;IACxBC,YAAY,GAAG,KAAK;IACpBC,YAAY,GAAG;MACdC,EAAE,EAAE,KAAK;MACTC,KAAK,EAAE,IAAAC,QAAE,EAAE,KAAK,EAAE,cAAe;IAClC,CAAC;IACDC,SAAS,GAAG,CACX;MACCH,EAAE,EAAE,OAAO;MACXC,KAAK,EAAE,IAAAG,QAAE,EAAE,eAAgB;IAC5B,CAAC,EACD;MACCJ,EAAE,EAAE,QAAQ;MACZC,KAAK,EAAE,IAAAG,QAAE,EAAE,gBAAiB;IAC7B,CAAC,EACD;MACCJ,EAAE,EAAE,OAAO;MACXC,KAAK,EAAE,IAAAG,QAAE,EAAE,eAAgB;IAC5B,CAAC;EAEH,CAAC,GAAGb,KAAK;EAET,IAAK,CAAEC,KAAK,IAAI,CAAEC,QAAQ,IAAI,CAAEG,oBAAoB,EAAG;IACtD,OAAO,IAAI;EACZ;EAEA,MAAMS,kBAAkB,GACvBX,WAAW,IACX,IAAAY,aAAO,EACN;EACA,IAAAF,QAAE,EAAE,s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8CAA8C,EAC9C;UACC,eAAe,EAAEzB;QAClB,CACD,CAAG;QAAAiB,QAAA,GAED,CAAEjB,YAAY,IAAIU,cAAc,EAChCV,YAAY,KACXD,wBAAwB,GACvBA,wBAAwB,CAAEM,SAAU,CAAC,GACrCS,yBAAyB,CAAC,CAAC,CAAE;MAAA,CAC7B,CAAC;IAAA,CACF,CAAC;EAAA,CACG,CAAC;AAEb;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcpB,sBAAsB","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ function ResponsiveBlockControlLabel({
|
|
|
18
18
|
desc
|
|
19
19
|
}) {
|
|
20
20
|
const instanceId = (0, _compose.useInstanceId)(ResponsiveBlockControlLabel);
|
|
21
|
-
const accessibleLabel = desc || (0, _i18n.sprintf)(
|
|
21
|
+
const accessibleLabel = desc || (0, _i18n.sprintf)(/* translators: 1: property name. 2: viewport name. */
|
|
22
22
|
(0, _i18n._x)('Controls the %1$s property for %2$s viewports.', 'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'), property, viewport.label);
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
24
24
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_components","_i18n","_jsxRuntime","ResponsiveBlockControlLabel","property","viewport","desc","instanceId","useInstanceId","accessibleLabel","sprintf","_x","label","jsxs","Fragment","children","jsx","VisuallyHidden","as","id"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { _x, sprintf } from '@wordpress/i18n';\n\nexport default function ResponsiveBlockControlLabel( {\n\tproperty,\n\tviewport,\n\tdesc,\n} ) {\n\tconst instanceId = useInstanceId( ResponsiveBlockControlLabel );\n\tconst accessibleLabel =\n\t\tdesc ||\n\t\tsprintf(\n\t\t\t/* translators: 1: property name. 2: viewport name. */\n\t\t\t_x(\n\t\t\t\t'Controls the %1$s property for %2$s viewports.',\n\t\t\t\t'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'\n\t\t\t),\n\t\t\tproperty,\n\t\t\tviewport.label\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t<span aria-describedby={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ viewport.label }\n\t\t\t</span>\n\t\t\t<VisuallyHidden as=\"span\" id={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ accessibleLabel }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA8C,IAAAG,WAAA,GAAAH,OAAA;AAL9C;AACA;AACA;;AAKe,SAASI,2BAA2BA,CAAE;EACpDC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEL,2BAA4B,CAAC;EAC/D,MAAMM,eAAe,GACpBH,IAAI,IACJ,IAAAI,aAAO,
|
|
1
|
+
{"version":3,"names":["_compose","require","_components","_i18n","_jsxRuntime","ResponsiveBlockControlLabel","property","viewport","desc","instanceId","useInstanceId","accessibleLabel","sprintf","_x","label","jsxs","Fragment","children","jsx","VisuallyHidden","as","id"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { _x, sprintf } from '@wordpress/i18n';\n\nexport default function ResponsiveBlockControlLabel( {\n\tproperty,\n\tviewport,\n\tdesc,\n} ) {\n\tconst instanceId = useInstanceId( ResponsiveBlockControlLabel );\n\tconst accessibleLabel =\n\t\tdesc ||\n\t\tsprintf(\n\t\t\t/* translators: 1: property name. 2: viewport name. */\n\t\t\t_x(\n\t\t\t\t'Controls the %1$s property for %2$s viewports.',\n\t\t\t\t'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'\n\t\t\t),\n\t\t\tproperty,\n\t\t\tviewport.label\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t<span aria-describedby={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ viewport.label }\n\t\t\t</span>\n\t\t\t<VisuallyHidden as=\"span\" id={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ accessibleLabel }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA8C,IAAAG,WAAA,GAAAH,OAAA;AAL9C;AACA;AACA;;AAKe,SAASI,2BAA2BA,CAAE;EACpDC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEL,2BAA4B,CAAC;EAC/D,MAAMM,eAAe,GACpBH,IAAI,IACJ,IAAAI,aAAO,EACN;EACA,IAAAC,QAAE,EACD,gDAAgD,EAChD,yGACD,CAAC,EACDP,QAAQ,EACRC,QAAQ,CAACO,KACV,CAAC;EACF,oBACC,IAAAV,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAAY,QAAA;IAAAC,QAAA,gBACC,IAAAb,WAAA,CAAAc,GAAA;MAAM,oBAAmB,YAAaT,UAAU,EAAK;MAAAQ,QAAA,EAClDV,QAAQ,CAACO;IAAK,CACX,CAAC,eACP,IAAAV,WAAA,CAAAc,GAAA,EAAChB,WAAA,CAAAiB,cAAc;MAACC,EAAE,EAAC,MAAM;MAACC,EAAE,EAAG,YAAaZ,UAAU,EAAK;MAAAQ,QAAA,EACxDN;IAAe,CACF,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blocks","_deprecated","_interopRequireDefault","_","_utils","_jsxRuntime","valueToHTMLString","value","multiline","RichText","isEmpty","multilineTag","getMultilineTag","Array","isArray","deprecated","since","version","alternative","link","childrenSource","toHTML","toHTMLString","Content","tagName","Tag","format","props","jsx","RawHTML","children"],"sources":["@wordpress/block-editor/src/components/rich-text/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML } from '@wordpress/element';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport RichText from './';\n\n/**\n * Internal dependencies\n */\nimport { getMultilineTag } from './utils';\n\nexport function valueToHTMLString( value, multiline ) {\n\tif ( RichText.isEmpty( value ) ) {\n\t\tconst multilineTag = getMultilineTag( multiline );\n\t\treturn multilineTag ? `<${ multilineTag }></${ multilineTag }>` : '';\n\t}\n\n\tif ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\t\treturn childrenSource.toHTML( value );\n\t}\n\n\t// To do: deprecate string type.\n\tif ( typeof value === 'string' ) {\n\t\treturn value;\n\t}\n\n\t// To do: create a toReactComponent method on RichTextData, which we\n\t// might in the future also use for the editable tree. See\n\t// https://github.com/WordPress/gutenberg/pull/41655.\n\treturn value.toHTMLString();\n}\n\nexport function Content( {\n\tvalue,\n\ttagName: Tag,\n\tmultiline,\n\tformat,\n\t...props\n} ) {\n\tvalue = <RawHTML>{ valueToHTMLString( value, multiline ) }</RawHTML>;\n\treturn Tag ? <Tag { ...props }>{ value }</Tag> : value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,CAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAf1C;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,SAASO,iBAAiBA,CAAEC,KAAK,EAAEC,SAAS,EAAG;EACrD,IAAKC,SAAQ,CAACC,OAAO,CAAEH,KAAM,CAAC,EAAG;IAChC,MAAMI,YAAY,GAAG,IAAAC,sBAAe,EAAEJ,SAAU,CAAC;IACjD,OAAOG,YAAY,
|
|
1
|
+
{"version":3,"names":["_element","require","_blocks","_deprecated","_interopRequireDefault","_","_utils","_jsxRuntime","valueToHTMLString","value","multiline","RichText","isEmpty","multilineTag","getMultilineTag","Array","isArray","deprecated","since","version","alternative","link","childrenSource","toHTML","toHTMLString","Content","tagName","Tag","format","props","jsx","RawHTML","children"],"sources":["@wordpress/block-editor/src/components/rich-text/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML } from '@wordpress/element';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport RichText from './';\n\n/**\n * Internal dependencies\n */\nimport { getMultilineTag } from './utils';\n\nexport function valueToHTMLString( value, multiline ) {\n\tif ( RichText.isEmpty( value ) ) {\n\t\tconst multilineTag = getMultilineTag( multiline );\n\t\treturn multilineTag ? `<${ multilineTag }></${ multilineTag }>` : '';\n\t}\n\n\tif ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\t\treturn childrenSource.toHTML( value );\n\t}\n\n\t// To do: deprecate string type.\n\tif ( typeof value === 'string' ) {\n\t\treturn value;\n\t}\n\n\t// To do: create a toReactComponent method on RichTextData, which we\n\t// might in the future also use for the editable tree. See\n\t// https://github.com/WordPress/gutenberg/pull/41655.\n\treturn value.toHTMLString();\n}\n\nexport function Content( {\n\tvalue,\n\ttagName: Tag,\n\tmultiline,\n\tformat,\n\t...props\n} ) {\n\tvalue = <RawHTML>{ valueToHTMLString( value, multiline ) }</RawHTML>;\n\treturn Tag ? <Tag { ...props }>{ value }</Tag> : value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,CAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAf1C;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,SAASO,iBAAiBA,CAAEC,KAAK,EAAEC,SAAS,EAAG;EACrD,IAAKC,SAAQ,CAACC,OAAO,CAAEH,KAAM,CAAC,EAAG;IAChC,MAAMI,YAAY,GAAG,IAAAC,sBAAe,EAAEJ,SAAU,CAAC;IACjD,OAAOG,YAAY,GAAG,IAAKA,YAAY,MAAQA,YAAY,GAAI,GAAG,EAAE;EACrE;EAEA,IAAKE,KAAK,CAACC,OAAO,CAAEP,KAAM,CAAC,EAAG;IAC7B,IAAAQ,mBAAU,EAAE,qDAAqD,EAAE;MAClEC,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE,sBAAsB;MACnCC,IAAI,EAAE;IACP,CAAE,CAAC;IACH,OAAOC,gBAAc,CAACC,MAAM,CAAEd,KAAM,CAAC;EACtC;;EAEA;EACA,IAAK,OAAOA,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAOA,KAAK;EACb;;EAEA;EACA;EACA;EACA,OAAOA,KAAK,CAACe,YAAY,CAAC,CAAC;AAC5B;AAEO,SAASC,OAAOA,CAAE;EACxBhB,KAAK;EACLiB,OAAO,EAAEC,GAAG;EACZjB,SAAS;EACTkB,MAAM;EACN,GAAGC;AACJ,CAAC,EAAG;EACHpB,KAAK,gBAAG,IAAAF,WAAA,CAAAuB,GAAA,EAAC9B,QAAA,CAAA+B,OAAO;IAAAC,QAAA,EAAGxB,iBAAiB,CAAEC,KAAK,EAAEC,SAAU;EAAC,CAAW,CAAC;EACpE,OAAOiB,GAAG,gBAAG,IAAApB,WAAA,CAAAuB,GAAA,EAACH,GAAG;IAAA,GAAME,KAAK;IAAAG,QAAA,EAAKvB;EAAK,CAAO,CAAC,GAAGA,KAAK;AACvD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["filePasteHandler","files","map","url","join"],"sources":["@wordpress/block-editor/src/components/rich-text/file-paste-handler.native.js"],"sourcesContent":["export function filePasteHandler( files ) {\n\treturn files.map( ( url ) => `<img src=\"${ url }\">` ).join( '' );\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,OAAOA,KAAK,CAACC,GAAG,CAAIC,GAAG,
|
|
1
|
+
{"version":3,"names":["filePasteHandler","files","map","url","join"],"sources":["@wordpress/block-editor/src/components/rich-text/file-paste-handler.native.js"],"sourcesContent":["export function filePasteHandler( files ) {\n\treturn files.map( ( url ) => `<img src=\"${ url }\">` ).join( '' );\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,OAAOA,KAAK,CAACC,GAAG,CAAIC,GAAG,IAAM,aAAcA,GAAG,IAAM,CAAC,CAACC,IAAI,CAAE,EAAG,CAAC;AACjE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_icons","_sorting","_jsxRuntime","POPOVER_PROPS","placement","FormatToolbar","jsxs","Fragment","children","map","format","jsx","Slot","name","fills","length","allProps","props","hasActive","some","isActive","ToolbarItem","toggleProps","DropdownMenu","icon","chevronDown","label","__","className","clsx","description","controls","orderBy","popoverProps","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/rich-text/format-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarItem, DropdownMenu, Slot } from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { orderBy } from '../../../utils/sorting';\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nconst FormatToolbar = () => {\n\treturn (\n\t\t<>\n\t\t\t{ [ 'bold', 'italic', 'link', 'unknown' ].map( ( format ) => (\n\t\t\t\t<Slot\n\t\t\t\t\tname={ `RichText.ToolbarControls.${ format }` }\n\t\t\t\t\tkey={ format }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<Slot name=\"RichText.ToolbarControls\">\n\t\t\t\t{ ( fills ) => {\n\t\t\t\t\tif ( ! fills.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst allProps = fills.map( ( [ { props } ] ) => props );\n\t\t\t\t\tconst hasActive = allProps.some(\n\t\t\t\t\t\t( { isActive } ) => isActive\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\t\t\ttoggleProps.className,\n\t\t\t\t\t\t\t\t\t\t\t{ 'is-pressed': hasActive }\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t\t\t\t\t'Displays more block tools'\n\t\t\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\tcontrols={ orderBy(\n\t\t\t\t\t\t\t\t\t\tfills.map( ( [ { props } ] ) => props ),\n\t\t\t\t\t\t\t\t\t\t'title'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToolbarItem>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Slot>\n\t\t</>\n\t);\n};\n\nexport default FormatToolbar;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AAAiD,IAAAK,WAAA,GAAAL,OAAA;AAfjD;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMM,aAAa,GAAG;EACrBC,SAAS,EAAE;AACZ,CAAC;AAED,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC3B,oBACC,IAAAH,WAAA,CAAAI,IAAA,EAAAJ,WAAA,CAAAK,QAAA;IAAAC,QAAA,GACG,CAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAE,CAACC,GAAG,CAAIC,MAAM,iBACtD,IAAAR,WAAA,CAAAS,GAAA,EAACZ,WAAA,CAAAa,IAAI;MACJC,IAAI,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_icons","_sorting","_jsxRuntime","POPOVER_PROPS","placement","FormatToolbar","jsxs","Fragment","children","map","format","jsx","Slot","name","fills","length","allProps","props","hasActive","some","isActive","ToolbarItem","toggleProps","DropdownMenu","icon","chevronDown","label","__","className","clsx","description","controls","orderBy","popoverProps","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/rich-text/format-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarItem, DropdownMenu, Slot } from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { orderBy } from '../../../utils/sorting';\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nconst FormatToolbar = () => {\n\treturn (\n\t\t<>\n\t\t\t{ [ 'bold', 'italic', 'link', 'unknown' ].map( ( format ) => (\n\t\t\t\t<Slot\n\t\t\t\t\tname={ `RichText.ToolbarControls.${ format }` }\n\t\t\t\t\tkey={ format }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<Slot name=\"RichText.ToolbarControls\">\n\t\t\t\t{ ( fills ) => {\n\t\t\t\t\tif ( ! fills.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst allProps = fills.map( ( [ { props } ] ) => props );\n\t\t\t\t\tconst hasActive = allProps.some(\n\t\t\t\t\t\t( { isActive } ) => isActive\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\t\t\ttoggleProps.className,\n\t\t\t\t\t\t\t\t\t\t\t{ 'is-pressed': hasActive }\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t\t\t\t\t'Displays more block tools'\n\t\t\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\tcontrols={ orderBy(\n\t\t\t\t\t\t\t\t\t\tfills.map( ( [ { props } ] ) => props ),\n\t\t\t\t\t\t\t\t\t\t'title'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToolbarItem>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Slot>\n\t\t</>\n\t);\n};\n\nexport default FormatToolbar;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AAAiD,IAAAK,WAAA,GAAAL,OAAA;AAfjD;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMM,aAAa,GAAG;EACrBC,SAAS,EAAE;AACZ,CAAC;AAED,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC3B,oBACC,IAAAH,WAAA,CAAAI,IAAA,EAAAJ,WAAA,CAAAK,QAAA;IAAAC,QAAA,GACG,CAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE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GAAAC,OAAA,CAAAC,OAAA,GAEa/B,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_jsxRuntime","FormatToolbar","jsxs","Fragment","children","map","format","jsx","Slot","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/rich-text/format-toolbar/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { Slot } from '@wordpress/components';\n\nconst FormatToolbar = () => {\n\treturn (\n\t\t<>\n\t\t\t{ [ 'bold', 'italic', 'link' ].map( ( format ) => (\n\t\t\t\t<Slot\n\t\t\t\t\tname={ `RichText.ToolbarControls.${ format }` }\n\t\t\t\t\tkey={ format }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<Slot name=\"RichText.ToolbarControls\" />\n\t\t</>\n\t);\n};\n\nexport default FormatToolbar;\n"],"mappings":";;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AAA6C,IAAAC,WAAA,GAAAD,OAAA;AAJ7C;AACA;AACA;;AAIA,MAAME,aAAa,GAAGA,CAAA,KAAM;EAC3B,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAAAF,WAAA,CAAAG,QAAA;IAAAC,QAAA,GACG,CAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAE,CAACC,GAAG,CAAIC,MAAM,iBAC3C,IAAAN,WAAA,CAAAO,GAAA,EAACT,WAAA,CAAAU,IAAI;MACJC,IAAI,
|
|
1
|
+
{"version":3,"names":["_components","require","_jsxRuntime","FormatToolbar","jsxs","Fragment","children","map","format","jsx","Slot","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/rich-text/format-toolbar/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { Slot } from '@wordpress/components';\n\nconst FormatToolbar = () => {\n\treturn (\n\t\t<>\n\t\t\t{ [ 'bold', 'italic', 'link' ].map( ( format ) => (\n\t\t\t\t<Slot\n\t\t\t\t\tname={ `RichText.ToolbarControls.${ format }` }\n\t\t\t\t\tkey={ format }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<Slot name=\"RichText.ToolbarControls\" />\n\t\t</>\n\t);\n};\n\nexport default FormatToolbar;\n"],"mappings":";;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AAA6C,IAAAC,WAAA,GAAAD,OAAA;AAJ7C;AACA;AACA;;AAIA,MAAME,aAAa,GAAGA,CAAA,KAAM;EAC3B,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAAAF,WAAA,CAAAG,QAAA;IAAAC,QAAA,GACG,CAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAE,CAACC,GAAG,CAAIC,MAAM,iBAC3C,IAAAN,WAAA,CAAAO,GAAA,EAACT,WAAA,CAAAU,IAAI;MACJC,IAAI,EAAG,4BAA6BH,MAAM;IAAK,GACzCA,MACN,CACA,CAAC,eACH,IAAAN,WAAA,CAAAO,GAAA,EAACT,WAAA,CAAAU,IAAI;MAACC,IAAI,EAAC;IAA0B,CAAE,CAAC;EAAA,CACvC,CAAC;AAEL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,aAAa","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -216,9 +217,9 @@ function RichTextWrapper({
|
|
|
216
217
|
context: blockBindingsContext
|
|
217
218
|
});
|
|
218
219
|
const bindingKey = (_fieldsList$relatedBi = fieldsList?.[relatedBinding?.args?.key]?.label) !== null && _fieldsList$relatedBi !== void 0 ? _fieldsList$relatedBi : blockBindingsSource?.label;
|
|
219
|
-
const _bindingsPlaceholder = _disableBoundBlock ? bindingKey : (0, _i18n.sprintf)(
|
|
220
|
+
const _bindingsPlaceholder = _disableBoundBlock ? bindingKey : (0, _i18n.sprintf)(/* translators: %s: connected field label or source label */
|
|
220
221
|
(0, _i18n.__)('Add %s'), bindingKey);
|
|
221
|
-
const _bindingsLabel = _disableBoundBlock ? relatedBinding?.args?.key || blockBindingsSource?.label : (0, _i18n.sprintf)(
|
|
222
|
+
const _bindingsLabel = _disableBoundBlock ? relatedBinding?.args?.key || blockBindingsSource?.label : (0, _i18n.sprintf)(/* translators: %s: source label or key */
|
|
222
223
|
(0, _i18n.__)('Empty %s; start writing to edit its value'), relatedBinding?.args?.key || blockBindingsSource?.label);
|
|
223
224
|
return {
|
|
224
225
|
disableBoundBlock: _disableBoundBlock,
|