@wordpress/block-editor 14.8.1-next.cd6172eb0.0 → 14.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +1 -1
- package/README.md +48 -0
- package/build/autocompleters/block.js +1 -0
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +1 -0
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/ui.js +1 -0
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/audio-player/index.native.js +1 -1
- package/build/components/audio-player/index.native.js.map +1 -1
- package/build/components/autocomplete/index.js +1 -0
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/background-image-control/index.js +5 -0
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-actions/index.js +1 -0
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -0
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -0
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +1 -0
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +32 -0
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +1 -0
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-card/index.js +45 -8
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/index.js +1 -0
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-controls/fill.js +1 -0
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-edit/edit.js +148 -10
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +1 -0
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +1 -0
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +1 -0
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -0
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +1 -0
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +1 -0
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block.js +1 -0
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +1 -0
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +1 -0
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +4 -5
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +61 -8
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -0
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +20 -3
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-lock/modal.js +5 -4
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +1 -0
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +1 -0
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +1 -0
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +1 -0
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/index.native.js +1 -0
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +1 -0
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-parent-selector/index.js +2 -15
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +1 -0
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js +1 -0
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +1 -0
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +1 -0
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/rename-control.js +1 -0
- package/build/components/block-rename/rename-control.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +6 -8
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +1 -0
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -0
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +1 -0
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -0
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +1 -0
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +1 -0
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +1 -0
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -0
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +1 -0
- 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/block-toolbar-menu.native.js +1 -0
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -0
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +2 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/use-selected-block-tool-props.js +1 -0
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +1 -0
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -0
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +1 -0
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +1 -0
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +1 -0
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/index.js +1 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +1 -0
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/utils.js +1 -0
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/button-block-appender/index.js +1 -5
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +6 -0
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/colors/utils.js +1 -0
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +1 -0
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +52 -11
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -0
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +1 -1
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +1 -0
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -16
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/duotone/utils.js +1 -0
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/editor-styles/index.js +1 -0
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +10 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +11 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +1 -0
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/border-panel.js +1 -0
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +28 -8
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +1 -0
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +1 -0
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +3 -2
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +1 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +1 -0
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +2 -1
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js +1 -0
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +10 -0
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +1 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/grid/utils.js +13 -1
- package/build/components/grid/utils.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +1 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/index.js +15 -8
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +1 -0
- package/build/components/inner-blocks/use-block-context.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +11 -11
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -1
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -4
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +2 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -0
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +2 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -0
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +7 -15
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -0
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +1 -0
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +1 -0
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +1 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +1 -0
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +1 -0
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -13
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +1 -0
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +1 -0
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -0
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +1 -0
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +1 -0
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +1 -0
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/slot.js +2 -13
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +1 -0
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -0
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +1 -0
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +1 -0
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/line-height-control/index.js +9 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/index.js +13 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +11 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +12 -1
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +13 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings.js +1 -0
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +1 -0
- package/build/components/link-control/use-internal-value.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +1 -0
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +1 -0
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +1 -0
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +1 -0
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +1 -0
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +1 -0
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +1 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +1 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +3 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +1 -0
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +27 -26
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -0
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +9 -25
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +1 -0
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +1 -0
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +34 -0
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/provider/index.js +61 -5
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -0
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/use-media-upload-settings.js +28 -0
- package/build/components/provider/use-media-upload-settings.js.map +1 -0
- package/build/components/resolution-tool/index.js +3 -1
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +2 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +1 -0
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/event-listeners/before-input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/delete.js +7 -1
- package/build/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build/components/rich-text/event-listeners/index.js +1 -0
- package/build/components/rich-text/event-listeners/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/paste-handler.js +1 -0
- package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.native.js +1 -0
- package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +1 -0
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -0
- package/build/components/rich-text/format-toolbar/index.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/index.native.js +1 -0
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +1 -0
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +1 -0
- package/build/components/rich-text/native/format-edit.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +1 -0
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +1 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
- package/build/components/rich-text/native/toolbar-button-with-options.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/use-format-types.js +1 -0
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
- 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/tabbed-sidebar/index.js +1 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/text-alignment-control/index.js +1 -0
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +1 -0
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +1 -0
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js +1 -0
- package/build/components/unsupported-block-details/index.native.js.map +1 -1
- package/build/components/url-input/index.js +1 -0
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +1 -0
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-commands/index.js +1 -0
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +3 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +1 -0
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-flash-editable-blocks/index.js +1 -0
- package/build/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -0
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js +1 -0
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-paste-styles/index.js +1 -0
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/components/warning/index.js +3 -3
- package/build/components/warning/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +1 -0
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +1 -0
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/use-input.js +1 -0
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +1 -0
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-flow/utils.js +1 -0
- package/build/components/writing-flow/utils.js.map +1 -1
- package/build/components/writing-mode-control/index.js +1 -0
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/align.js +1 -0
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +1 -0
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/background.js +2 -0
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +16 -14
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -0
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +1 -0
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/border.js +4 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +1 -0
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/gap.js +2 -2
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +7 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +1 -0
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -0
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +7 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +8 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/text-align.js +1 -0
- package/build/hooks/text-align.js.map +1 -1
- package/build/hooks/typography.js +7 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +58 -14
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +2 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +1 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +1 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +1 -0
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/index.js +1 -0
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +1 -0
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +1 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/get-block-settings.js +1 -0
- package/build/store/get-block-settings.js.map +1 -1
- package/build/store/private-actions.js +2 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +12 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +94 -12
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +19 -23
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +1 -0
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +96 -0
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/get-editor-region.js +1 -0
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +1 -0
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/math.js +1 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +1 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +1 -0
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +1 -0
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/autocompleters/block.js +1 -0
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +1 -0
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -0
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/audio-player/index.native.js +2 -2
- package/build-module/components/audio-player/index.native.js.map +1 -1
- package/build-module/components/autocomplete/index.js +1 -0
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/background-image-control/index.js +6 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +1 -0
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -0
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -0
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +1 -0
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +32 -0
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +1 -0
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-card/index.js +45 -8
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +1 -0
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +1 -0
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-edit/edit.js +149 -11
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +1 -0
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +1 -0
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +1 -0
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -0
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +1 -0
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +1 -0
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block.js +1 -0
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +1 -0
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +1 -0
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -4
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +60 -8
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -0
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +20 -3
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-lock/modal.js +5 -4
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -0
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -0
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +1 -0
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +1 -0
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +1 -0
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +1 -0
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +2 -15
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +1 -0
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/use-patterns-setup.js +1 -0
- package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -0
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +1 -0
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/rename-control.js +1 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -8
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -0
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +1 -0
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +1 -0
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -0
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +1 -0
- 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 -0
- 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 -0
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -0
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -0
- package/build-module/components/block-switcher/pattern-transformations-menu.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 -0
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -0
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +2 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/use-selected-block-tool-props.js +1 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-types-list/index.js +1 -0
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -0
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +1 -0
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +1 -0
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +1 -0
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +1 -0
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +1 -0
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -6
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +7 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/colors/utils.js +1 -0
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +1 -0
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +52 -11
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -0
- 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 -0
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +2 -2
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +1 -0
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -16
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/duotone/utils.js +1 -0
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/editor-styles/index.js +1 -0
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +9 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +11 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +1 -0
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -0
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +30 -10
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +1 -0
- package/build-module/components/global-styles/color-panel.native.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -0
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +4 -3
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +1 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +1 -0
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +2 -1
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js +1 -0
- 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 +2 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +10 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/grid/utils.js +13 -1
- package/build-module/components/grid/utils.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +1 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/index.js +4 -4
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +1 -0
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +12 -12
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +1 -1
- 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 +1 -0
- 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 +1 -0
- 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 -1
- 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 +5 -4
- 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 +2 -2
- 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 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +2 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -0
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +2 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +1 -0
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +7 -15
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +1 -0
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +1 -0
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +1 -0
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +1 -0
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +1 -0
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -0
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -13
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +1 -0
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +1 -0
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -0
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +1 -0
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -0
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +3 -14
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -0
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -0
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +1 -0
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +1 -0
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +2 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +8 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +11 -0
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +9 -0
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +9 -0
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +12 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings.js +1 -0
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +1 -0
- package/build-module/components/link-control/use-internal-value.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +1 -0
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +1 -0
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -0
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -0
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +1 -0
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +1 -0
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +1 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +1 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +4 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +1 -0
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +29 -28
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +1 -0
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +9 -25
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +1 -0
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +1 -0
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +34 -0
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/provider/index.js +62 -5
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -0
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/use-media-upload-settings.js +22 -0
- package/build-module/components/provider/use-media-upload-settings.js.map +1 -0
- package/build-module/components/resolution-tool/index.js +3 -1
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +2 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +1 -0
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js +1 -0
- 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 +7 -1
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/index.js +1 -0
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js +1 -0
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.native.js +1 -0
- package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +1 -0
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -0
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +1 -0
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +1 -0
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +1 -0
- package/build-module/components/rich-text/native/format-edit.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +1 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +1 -0
- 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 -0
- 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/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/hooks/use-spacing-sizes.js +1 -0
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -0
- 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 -0
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
- 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 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +1 -0
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +1 -0
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +1 -0
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/unsupported-block-details/index.native.js +1 -0
- package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -0
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +1 -0
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -0
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +3 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +1 -0
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-flash-editable-blocks/index.js +1 -0
- package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -0
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js +1 -0
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +1 -0
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/components/warning/index.js +3 -3
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +1 -0
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +1 -0
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +1 -0
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +1 -0
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +1 -0
- package/build-module/components/writing-flow/utils.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +1 -0
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/align.js +1 -0
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/background.js +2 -0
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +14 -12
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +1 -0
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +1 -0
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/border.js +4 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +1 -0
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/gap.js +2 -2
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +1 -0
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +1 -0
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +7 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +8 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/text-align.js +1 -0
- package/build-module/hooks/text-align.js.map +1 -1
- package/build-module/hooks/typography.js +7 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +58 -15
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +2 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +1 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +1 -0
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/index.js +1 -0
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +1 -0
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +1 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/get-block-settings.js +1 -0
- package/build-module/store/get-block-settings.js.map +1 -1
- package/build-module/store/private-actions.js +2 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +12 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +94 -12
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +19 -23
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +1 -0
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +91 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/get-editor-region.js +1 -0
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +1 -0
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/math.js +1 -0
- package/build-module/utils/math.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/selection.js +1 -0
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +1 -0
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +1 -1
- package/build-style/content.css +1 -1
- package/build-style/style-rtl.css +53 -57
- package/build-style/style.css +53 -57
- package/package.json +33 -33
- package/src/components/alignment-control/stories/aliginment-toolbar.story.js +2 -2
- package/src/components/alignment-control/stories/index.story.js +2 -2
- package/src/components/audio-player/index.native.js +2 -2
- package/src/components/background-image-control/index.js +4 -0
- package/src/components/background-image-control/style.scss +4 -2
- package/src/components/block-alignment-matrix-control/README.md +29 -6
- package/src/components/block-alignment-matrix-control/index.js +31 -0
- package/src/components/block-alignment-matrix-control/stories/index.story.js +78 -0
- package/src/components/block-card/README.md +7 -0
- package/src/components/block-card/index.js +41 -12
- package/src/components/block-card/stories/index.story.js +79 -0
- package/src/components/block-card/style.scss +9 -1
- package/src/components/block-edit/edit.js +218 -11
- package/src/components/block-heading-level-dropdown/stories/index.story.js +61 -0
- package/src/components/block-list/index.js +2 -7
- package/src/components/block-list/use-block-props/index.js +3 -5
- package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +64 -6
- package/src/components/block-list/zoom-out-separator.js +30 -0
- package/src/components/block-lock/modal.js +4 -6
- package/src/components/block-parent-selector/index.js +1 -19
- package/src/components/block-patterns-list/stories/fixtures.js +1 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +17 -20
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-title/stories/index.story.js +76 -0
- package/src/components/block-toolbar/index.js +1 -0
- package/src/components/block-tools/style.scss +1 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +21 -3
- package/src/components/border-radius-control/README.md +59 -0
- package/src/components/border-radius-control/stories/index.story.js +58 -0
- package/src/components/button-block-appender/index.js +2 -7
- package/src/components/child-layout-control/index.js +14 -0
- package/src/components/colors-gradients/dropdown.js +57 -8
- package/src/components/colors-gradients/style.scss +26 -0
- package/src/components/contrast-checker/index.native.js +2 -2
- package/src/components/contrast-checker/stories/index.story.js +117 -0
- package/src/components/date-format-picker/README.md +6 -13
- package/src/components/date-format-picker/index.js +10 -17
- package/src/components/date-format-picker/stories/index.story.js +69 -0
- package/src/components/date-format-picker/style.scss +3 -1
- package/src/components/default-block-appender/content.scss +1 -0
- package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +3 -2
- package/src/components/dimensions-tool/stories/index.story.js +3 -2
- package/src/components/dimensions-tool/stories/scale-tool.story.js +3 -2
- package/src/components/dimensions-tool/stories/width-height-tool.story.js +3 -2
- package/src/components/font-appearance-control/index.js +15 -0
- package/src/components/font-family/README.md +1 -0
- package/src/components/font-family/index.js +17 -1
- package/src/components/font-family/stories/index.story.js +1 -0
- package/src/components/global-styles/color-panel.js +29 -7
- package/src/components/global-styles/filters-panel.js +3 -6
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/typography-utils.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/grid/grid-visualizer.js +11 -0
- package/src/components/grid/utils.js +19 -1
- package/src/components/iframe/index.js +1 -1
- package/src/components/index.js +7 -4
- package/src/components/inner-blocks/use-inner-block-template-sync.js +17 -10
- package/src/components/inserter/block-patterns-explorer/index.js +2 -3
- package/src/components/inserter/block-patterns-tab/index.js +3 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/src/components/inserter/block-types-tab.js +1 -1
- package/src/components/inserter/category-tabs/index.js +3 -2
- package/src/components/inserter/index.js +1 -13
- package/src/components/inserter/menu.js +2 -0
- package/src/components/inserter/quick-inserter.js +2 -25
- package/src/components/inspector-controls/slot.js +3 -22
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/line-height-control/README.md +1 -0
- package/src/components/line-height-control/index.js +12 -0
- package/src/components/line-height-control/stories/index.story.js +1 -0
- package/src/components/line-height-control/test/index.js +7 -1
- package/src/components/link-control/index.js +10 -0
- package/src/components/link-control/search-input.js +9 -0
- package/src/components/link-control/search-item.js +9 -0
- package/src/components/link-control/search-results.js +12 -1
- package/src/components/list-view/style.scss +10 -5
- package/src/components/media-placeholder/index.js +3 -3
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +28 -36
- package/src/components/media-replace-flow/style.scss +6 -6
- package/src/components/multi-selection-inspector/index.js +17 -27
- package/src/components/multi-selection-inspector/style.scss +0 -12
- package/src/components/plain-text/README.md +2 -2
- package/src/components/plain-text/index.js +34 -0
- package/src/components/plain-text/stories/index.story.js +75 -0
- package/src/components/provider/index.js +81 -4
- package/src/components/provider/use-media-upload-settings.js +25 -0
- package/src/components/resolution-tool/index.js +2 -0
- package/src/components/resolution-tool/stories/index.story.js +37 -9
- package/src/components/responsive-block-control/index.js +1 -1
- package/src/components/rich-text/event-listeners/delete.js +6 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/style.scss +0 -29
- package/src/components/text-alignment-control/README.md +49 -0
- package/src/components/text-alignment-control/stories/index.story.js +56 -18
- package/src/components/text-decoration-control/README.md +0 -1
- package/src/components/text-decoration-control/stories/index.story.js +51 -16
- package/src/components/text-transform-control/README.md +3 -4
- package/src/components/text-transform-control/stories/index.story.js +53 -16
- package/src/components/use-block-drop-zone/index.js +8 -1
- package/src/components/warning/index.js +3 -4
- package/src/components/warning/stories/index.story.js +86 -0
- package/src/components/warning/test/index.js +3 -1
- package/src/components/writing-mode-control/stories/index.story.js +56 -0
- package/src/hooks/background.js +6 -0
- package/src/hooks/block-bindings.js +17 -18
- package/src/hooks/border.js +9 -3
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/gap.js +2 -2
- package/src/hooks/index.js +0 -1
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +12 -6
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/font-size.js +15 -12
- package/src/hooks/test/style.js +2 -1
- package/src/hooks/typography.js +6 -6
- package/src/hooks/use-zoom-out.js +56 -16
- package/src/hooks/utils.js +1 -1
- package/src/store/private-actions.js +1 -0
- package/src/store/private-selectors.js +15 -5
- package/src/store/reducer.js +112 -19
- package/src/store/selectors.js +32 -32
- package/src/store/test/private-selectors.js +53 -9
- package/src/store/test/reducer.js +172 -166
- package/src/store/test/selectors.js +24 -1
- package/src/utils/block-bindings.js +95 -0
- package/tsconfig.json +2 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/build/hooks/use-bindings-attributes.js +0 -261
- package/build/hooks/use-bindings-attributes.js.map +0 -1
- package/build-module/hooks/use-bindings-attributes.js +0 -252
- package/build-module/hooks/use-bindings-attributes.js.map +0 -1
- package/src/hooks/use-bindings-attributes.js +0 -322
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","useSelect","useDispatch","__","chevronRightSmall","Icon","useRef","BlockTitle","store","blockEditorStore","unlock","useBlockElementRef","getEditorRegion","jsx","_jsx","jsxs","_jsxs","BlockBreadcrumb","rootLabelText","selectBlock","clearSelectedBlock","clientId","parents","hasSelection","select","getSelectionStart","getSelectedBlockClientId","getEnabledBlockParents","selectedBlockClientId","rootLabel","blockRef","className","role","children","undefined","size","onClick","blockEditor","current","closest","focus","icon","map","parentClientId","maximumLength"],"sources":["@wordpress/block-editor/src/components/block-breadcrumb/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockTitle from '../block-title';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';\nimport getEditorRegion from '../../utils/get-editor-region';\n\n/**\n * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.\n *\n * @param {Object} props Component props.\n * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail.\n * @return {Element} Block Breadcrumb.\n */\nfunction BlockBreadcrumb( { rootLabelText } ) {\n\tconst { selectBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { clientId, parents, hasSelection } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetEnabledBlockParents,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tparents: getEnabledBlockParents( selectedBlockClientId ),\n\t\t\tclientId: selectedBlockClientId,\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t};\n\t}, [] );\n\tconst rootLabel = rootLabelText || __( 'Document' );\n\n\t// We don't care about this specific ref, but this is a way\n\t// to get a ref within the editor canvas so we can focus it later.\n\tconst blockRef = useRef();\n\tuseBlockElementRef( clientId, blockRef );\n\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"block-editor-block-breadcrumb\"\n\t\t\trole=\"list\"\n\t\t\taria-label={ __( 'Block breadcrumb' ) }\n\t\t>\n\t\t\t<li\n\t\t\t\tclassName={\n\t\t\t\t\t! hasSelection\n\t\t\t\t\t\t? 'block-editor-block-breadcrumb__current'\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\taria-current={ ! hasSelection ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ hasSelection && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Find the block editor wrapper for the selected block\n\t\t\t\t\t\t\tconst blockEditor = blockRef.current?.closest(\n\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tclearSelectedBlock();\n\n\t\t\t\t\t\t\tgetEditorRegion( blockEditor )?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ rootLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t{ ! hasSelection && rootLabel }\n\t\t\t\t{ !! clientId && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\n\t\t\t{ parents.map( ( parentClientId ) => (\n\t\t\t\t<li key={ parentClientId }>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\tclientId={ parentClientId }\n\t\t\t\t\t\t\tmaximumLength={ 35 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t\t{ !! clientId && (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__current\"\n\t\t\t\t\taria-current=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<BlockTitle clientId={ clientId } maximumLength={ 35 } />\n\t\t\t\t</li>\n\t\t\t) }\n\t\t</ul>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default BlockBreadcrumb;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,EAAEC,IAAI,QAAQ,kBAAkB;AAC1D,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,8CAA8C;AACjF,OAAOC,eAAe,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,EAAC,uCAAuC;QACjDK,OAAO,EAAGA,CAAA,KAAM;UACf;UACA,MAAMC,WAAW,GAAGP,QAAQ,CAACQ,OAAO,EAAEC,OAAO,CAC5C,wBACD,CAAC;UAEDnB,kBAAkB,CAAC,CAAC;UAEpBR,eAAe,CAAEyB,WAAY,CAAC,EAAEG,KAAK,CAAC,CAAC;QACxC,CAAG;QAAAP,QAAA,EAEDJ;MAAS,CACJ,CACR,EACC,CAAEN,YAAY,IAAIM,SAAS,EAC3B,CAAC,CAAER,QAAQ,iBACZP,IAAA,CAACT,IAAI;QACJoC,IAAI,EAAGrC,iBAAmB;QAC1B2B,SAAS,EAAC;MAA0C,CACpD,CACD;IAAA,CACE,CAAC,EAEHT,OAAO,CAACoB,GAAG,CAAIC,cAAc,iBAC9B3B,KAAA;MAAAiB,QAAA,gBACCnB,IAAA,CAACd,MAAM;QACNmC,IAAI,EAAC,OAAO;QACZJ,SAAS,EAAC,uCAAuC;QACjDK,OAAO,EAAGA,CAAA,KAAMjB,WAAW,CAAEwB,cAAe,CAAG;QAAAV,QAAA,eAE/CnB,IAAA,CAACP,UAAU;UACVc,QAAQ,EAAGsB,cAAgB;UAC3BC,aAAa,EAAG;QAAI,CACpB;MAAC,CACK,CAAC,eACT9B,IAAA,CAACT,IAAI;QACJoC,IAAI,EAAGrC,iBAAmB;QAC1B2B,SAAS,EAAC;MAA0C,CACpD,CAAC;IAAA,GAdOY,cAeN,CACH,CAAC,EACD,CAAC,CAAEtB,QAAQ,iBACZP,IAAA;MACCiB,SAAS,EAAC,wCAAwC;MAClD,gBAAa,MAAM;MAAAE,QAAA,eAEnBnB,IAAA,CAACP,UAAU;QAACc,QAAQ,EAAGA,QAAU;QAACuB,aAAa,EAAG;MAAI,CAAE;IAAC,CACtD,CACJ;EAAA,CACE;EACJ;AAEF;AAEA,eAAe3B,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Button","useSelect","useDispatch","__","chevronRightSmall","Icon","useRef","BlockTitle","store","blockEditorStore","unlock","useBlockElementRef","getEditorRegion","jsx","_jsx","jsxs","_jsxs","BlockBreadcrumb","rootLabelText","selectBlock","clearSelectedBlock","clientId","parents","hasSelection","select","getSelectionStart","getSelectedBlockClientId","getEnabledBlockParents","selectedBlockClientId","rootLabel","blockRef","className","role","children","undefined","size","onClick","blockEditor","current","closest","focus","icon","map","parentClientId","maximumLength"],"sources":["@wordpress/block-editor/src/components/block-breadcrumb/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockTitle from '../block-title';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';\nimport getEditorRegion from '../../utils/get-editor-region';\n\n/**\n * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.\n *\n * @param {Object} props Component props.\n * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail.\n * @return {Element} Block Breadcrumb.\n */\nfunction BlockBreadcrumb( { rootLabelText } ) {\n\tconst { selectBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { clientId, parents, hasSelection } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetEnabledBlockParents,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tparents: getEnabledBlockParents( selectedBlockClientId ),\n\t\t\tclientId: selectedBlockClientId,\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t};\n\t}, [] );\n\tconst rootLabel = rootLabelText || __( 'Document' );\n\n\t// We don't care about this specific ref, but this is a way\n\t// to get a ref within the editor canvas so we can focus it later.\n\tconst blockRef = useRef();\n\tuseBlockElementRef( clientId, blockRef );\n\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"block-editor-block-breadcrumb\"\n\t\t\trole=\"list\"\n\t\t\taria-label={ __( 'Block breadcrumb' ) }\n\t\t>\n\t\t\t<li\n\t\t\t\tclassName={\n\t\t\t\t\t! hasSelection\n\t\t\t\t\t\t? 'block-editor-block-breadcrumb__current'\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\taria-current={ ! hasSelection ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ hasSelection && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Find the block editor wrapper for the selected block\n\t\t\t\t\t\t\tconst blockEditor = blockRef.current?.closest(\n\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tclearSelectedBlock();\n\n\t\t\t\t\t\t\tgetEditorRegion( blockEditor )?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ rootLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t{ ! hasSelection && rootLabel }\n\t\t\t\t{ !! clientId && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\n\t\t\t{ parents.map( ( parentClientId ) => (\n\t\t\t\t<li key={ parentClientId }>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\tclientId={ parentClientId }\n\t\t\t\t\t\t\tmaximumLength={ 35 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t\t{ !! clientId && (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__current\"\n\t\t\t\t\taria-current=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<BlockTitle clientId={ clientId } maximumLength={ 35 } />\n\t\t\t\t</li>\n\t\t\t) }\n\t\t</ul>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default BlockBreadcrumb;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,EAAEC,IAAI,QAAQ,kBAAkB;AAC1D,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,8CAA8C;AACjF,OAAOC,eAAe,MAAM,+BAA+B;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOA,SAASC,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EAC7C,MAAM;IAAEC,WAAW;IAAEC;EAAmB,CA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AAK,CAAC,CAAC;QACxC,CAAG;QAAAP,QAAA,EAEDJ;MAAS,CACJ,CACR,EACC,CAAEN,YAAY,IAAIM,SAAS,EAC3B,CAAC,CAAER,QAAQ,iBACZP,IAAA,CAACT,IAAI;QACJoC,IAAI,EAAGrC,iBAAmB;QAC1B2B,SAAS,EAAC;MAA0C,CACpD,CACD;IAAA,CACE,CAAC,EAEHT,OAAO,CAACoB,GAAG,CAAIC,cAAc,iBAC9B3B,KAAA;MAAAiB,QAAA,gBACCnB,IAAA,CAACd,MAAM;QACNmC,IAAI,EAAC,OAAO;QACZJ,SAAS,EAAC,uCAAuC;QACjDK,OAAO,EAAGA,CAAA,KAAMjB,WAAW,CAAEwB,cAAe,CAAG;QAAAV,QAAA,eAE/CnB,IAAA,CAACP,UAAU;UACVc,QAAQ,EAAGsB,cAAgB;UAC3BC,aAAa,EAAG;QAAI,CACpB;MAAC,CACK,CAAC,eACT9B,IAAA,CAACT,IAAI;QACJoC,IAAI,EAAGrC,iBAAmB;QAC1B2B,SAAS,EAAC;MAA0C,CACpD,CAAC;IAAA,GAdOY,cAeN,CACH,CAAC,EACD,CAAC,CAAEtB,QAAQ,iBACZP,IAAA;MACCiB,SAAS,EAAC,wCAAwC;MAClD,gBAAa,MAAM;MAAAE,QAAA,eAEnBnB,IAAA,CAACP,UAAU;QAACc,QAAQ,EAAGA,QAAU;QAACuB,aAAa,EAAG;MAAI,CAAE;IAAC,CACtD,CACJ;EAAA,CACE;EACJ;AAEF;AAEA,eAAe3B,eAAe","ignoreList":[]}
|
|
@@ -6,18 +6,52 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
+
import { Button, __experimentalText as Text, __experimentalVStack as VStack, privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
10
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
9
11
|
import deprecated from '@wordpress/deprecated';
|
|
10
|
-
import {
|
|
12
|
+
import { __, isRTL } from '@wordpress/i18n';
|
|
11
13
|
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
12
|
-
import { __, _x, isRTL, sprintf } from '@wordpress/i18n';
|
|
13
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
|
-
import
|
|
18
|
+
import { unlock } from '../../lock-unlock';
|
|
19
19
|
import { store as blockEditorStore } from '../../store';
|
|
20
|
+
import BlockIcon from '../block-icon';
|
|
20
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
const {
|
|
23
|
+
Badge
|
|
24
|
+
} = unlock(componentsPrivateApis);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A card component that displays block information including title, icon, and description.
|
|
28
|
+
* Can be used to show block metadata and navigation controls for parent blocks.
|
|
29
|
+
*
|
|
30
|
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-card/README.md
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```jsx
|
|
34
|
+
* function Example() {
|
|
35
|
+
* return (
|
|
36
|
+
* <BlockCard
|
|
37
|
+
* title="My Block"
|
|
38
|
+
* icon="smiley"
|
|
39
|
+
* description="A simple block example"
|
|
40
|
+
* name="Custom Block"
|
|
41
|
+
* />
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} props Component props.
|
|
47
|
+
* @param {string} props.title The title of the block.
|
|
48
|
+
* @param {string|Object} props.icon The icon of the block. This can be any of [WordPress' Dashicons](https://developer.wordpress.org/resource/dashicons/), or a custom `svg` element.
|
|
49
|
+
* @param {string} props.description The description of the block.
|
|
50
|
+
* @param {Object} [props.blockType] Deprecated: Object containing block type data.
|
|
51
|
+
* @param {string} [props.className] Additional classes to apply to the card.
|
|
52
|
+
* @param {string} [props.name] Custom block name to display before the title.
|
|
53
|
+
* @return {Element} Block card component.
|
|
54
|
+
*/
|
|
21
55
|
function BlockCard({
|
|
22
56
|
title,
|
|
23
57
|
icon,
|
|
@@ -74,11 +108,14 @@ function BlockCard({
|
|
|
74
108
|
showColors: true
|
|
75
109
|
}), /*#__PURE__*/_jsxs(VStack, {
|
|
76
110
|
spacing: 1,
|
|
77
|
-
children: [/*#__PURE__*/
|
|
111
|
+
children: [/*#__PURE__*/_jsxs("h2", {
|
|
78
112
|
className: "block-editor-block-card__title",
|
|
79
|
-
children:
|
|
80
|
-
|
|
81
|
-
|
|
113
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
114
|
+
className: "block-editor-block-card__name",
|
|
115
|
+
children: !!name?.length ? name : title
|
|
116
|
+
}), !!name?.length && /*#__PURE__*/_jsx(Badge, {
|
|
117
|
+
children: title
|
|
118
|
+
})]
|
|
82
119
|
}), description && /*#__PURE__*/_jsx(Text, {
|
|
83
120
|
className: "block-editor-block-card__description",
|
|
84
121
|
children: description
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","
|
|
1
|
+
{"version":3,"names":["clsx","Button","__experimentalText","Text","__experimentalVStack","VStack","privateApis","componentsPrivateApis","useDispatch","useSelect","deprecated","__","isRTL","chevronLeft","chevronRight","unlock","store","blockEditorStore","BlockIcon","jsx","_jsx","jsxs","_jsxs","Badge","BlockCard","title","icon","description","blockType","className","name","since","alternative","parentNavBlockClientId","select","getSelectedBlockClientId","getBlockParentsByBlockName","_selectedBlockClientId","selectBlock","children","onClick","label","style","minWidth","padding","size","showColors","spacing","length"],"sources":["@wordpress/block-editor/src/components/block-card/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * A card component that displays block information including title, icon, and description.\n * Can be used to show block metadata and navigation controls for parent blocks.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-card/README.md\n *\n * @example\n * ```jsx\n * function Example() {\n * return (\n * <BlockCard\n * title=\"My Block\"\n * icon=\"smiley\"\n * description=\"A simple block example\"\n * name=\"Custom Block\"\n * />\n * );\n * }\n * ```\n *\n * @param {Object} props Component props.\n * @param {string} props.title The title of the block.\n * @param {string|Object} props.icon The icon of the block. This can be any of [WordPress' Dashicons](https://developer.wordpress.org/resource/dashicons/), or a custom `svg` element.\n * @param {string} props.description The description of the block.\n * @param {Object} [props.blockType] Deprecated: Object containing block type data.\n * @param {string} [props.className] Additional classes to apply to the card.\n * @param {string} [props.name] Custom block name to display before the title.\n * @return {Element} Block card component.\n */\nfunction BlockCard( { title, icon, description, blockType, className, name } ) {\n\tif ( blockType ) {\n\t\tdeprecated( '`blockType` property in `BlockCard component`', {\n\t\t\tsince: '5.7',\n\t\t\talternative: '`title, icon and description` properties',\n\t\t} );\n\t\t( { title, icon, description } = blockType );\n\t}\n\n\tconst { parentNavBlockClientId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlockClientId, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tparentNavBlockClientId: getBlockParentsByBlockName(\n\t\t\t\t_selectedBlockClientId,\n\t\t\t\t'core/navigation',\n\t\t\t\ttrue\n\t\t\t)[ 0 ],\n\t\t};\n\t}, [] );\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<div className={ clsx( 'block-editor-block-card', className ) }>\n\t\t\t{ parentNavBlockClientId && ( // This is only used by the Navigation block for now. It's not ideal having Navigation block specific code here.\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => selectBlock( parentNavBlockClientId ) }\n\t\t\t\t\tlabel={ __( 'Go to parent Navigation block' ) }\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t// TODO: This style override is also used in ToolsPanelHeader.\n\t\t\t\t\t\t// It should be supported out-of-the-box by Button.\n\t\t\t\t\t\t{ minWidth: 24, padding: 0 }\n\t\t\t\t\t}\n\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockIcon icon={ icon } showColors />\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t<h2 className=\"block-editor-block-card__title\">\n\t\t\t\t\t<span className=\"block-editor-block-card__name\">\n\t\t\t\t\t\t{ !! name?.length ? name : title }\n\t\t\t\t\t</span>\n\t\t\t\t\t{ !! name?.length && <Badge>{ title }</Badge> }\n\t\t\t\t</h2>\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text className=\"block-editor-block-card__description\">\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default BlockCard;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,EAAEC,YAAY,QAAQ,kBAAk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DN,sBAAsB;IAAA;IAAM;IAC7Bb,IAAA,CAACnB,MAAM;MACNuC,OAAO,EAAGA,CAAA,KAAMF,WAAW,CAAEL,sBAAuB,CAAG;MACvDQ,KAAK,EAAG9B,EAAE,CAAE,+BAAgC,CAAG;MAC/C+B,KAAK;MACJ;MACA;MACA;QAAEC,QAAQ,EAAE,EAAE;QAAEC,OAAO,EAAE;MAAE,CAC3B;MACDlB,IAAI,EAAGd,KAAK,CAAC,CAAC,GAAGE,YAAY,GAAGD,WAAa;MAC7CgC,IAAI,EAAC;IAAO,CACZ,CACD,eACDzB,IAAA,CAACF,SAAS;MAACQ,IAAI,EAAGA,IAAM;MAACoB,UAAU;IAAA,CAAE,CAAC,eACtCxB,KAAA,CAACjB,MAAM;MAAC0C,OAAO,EAAG,CAAG;MAAAR,QAAA,gBACpBjB,KAAA;QAAIO,SAAS,EAAC,gCAAgC;QAAAU,QAAA,gBAC7CnB,IAAA;UAAMS,SAAS,EAAC,+BAA+B;UAAAU,QAAA,EAC5C,CAAC,CAAET,IAAI,EAAEkB,MAAM,GAAGlB,IAAI,GAAGL;QAAK,CAC3B,CAAC,EACL,CAAC,CAAEK,IAAI,EAAEkB,MAAM,iBAAI5B,IAAA,CAACG,KAAK;UAAAgB,QAAA,EAAGd;QAAK,CAAS,CAAC;MAAA,CAC1C,CAAC,EACHE,WAAW,iBACZP,IAAA,CAACjB,IAAI;QAAC0B,SAAS,EAAC,sCAAsC;QAAAU,QAAA,EACnDZ;MAAW,CACR,CACN;IAAA,CACM,CAAC;EAAA,CACL,CAAC;AAER;AAEA,eAAeH,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","diffChars","__","getSaveContent","BlockView","jsx","_jsx","jsxs","_jsxs","BlockCompare","block","onKeep","onConvert","convertor","convertButtonText","getDifference","originalContent","newContent","difference","map","item","pos","classes","added","removed","className","children","value","getConvertedContent","convertedBlock","newBlocks","Array","isArray","name","attributes","innerBlocks","join","converted","title","action","actionText","rawContent","renderedContent"],"sources":["@wordpress/block-editor/src/components/block-compare/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n// diff doesn't tree-shake correctly, so we import from the individual\n// module here, to avoid including too much of the library\nimport { diffChars } from 'diff/lib/diff/character';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getSaveContent } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport BlockView from './block-view';\n\nfunction BlockCompare( {\n\tblock,\n\tonKeep,\n\tonConvert,\n\tconvertor,\n\tconvertButtonText,\n} ) {\n\tfunction getDifference( originalContent, newContent ) {\n\t\tconst difference = diffChars( originalContent, newContent );\n\n\t\treturn difference.map( ( item, pos ) => {\n\t\t\tconst classes = clsx( {\n\t\t\t\t'block-editor-block-compare__added': item.added,\n\t\t\t\t'block-editor-block-compare__removed': item.removed,\n\t\t\t} );\n\n\t\t\treturn (\n\t\t\t\t<span key={ pos } className={ classes }>\n\t\t\t\t\t{ item.value }\n\t\t\t\t</span>\n\t\t\t);\n\t\t} );\n\t}\n\n\tfunction getConvertedContent( convertedBlock ) {\n\t\t// The convertor may return an array of items or a single item.\n\t\tconst newBlocks = Array.isArray( convertedBlock )\n\t\t\t? convertedBlock\n\t\t\t: [ convertedBlock ];\n\n\t\t// Get converted block details.\n\t\tconst newContent = newBlocks.map( ( item ) =>\n\t\t\tgetSaveContent( item.name, item.attributes, item.innerBlocks )\n\t\t);\n\n\t\treturn newContent.join( '' );\n\t}\n\n\tconst converted = getConvertedContent( convertor( block ) );\n\tconst difference = getDifference( block.originalContent, converted );\n\n\treturn (\n\t\t<div className=\"block-editor-block-compare__wrapper\">\n\t\t\t<BlockView\n\t\t\t\ttitle={ __( 'Current' ) }\n\t\t\t\tclassName=\"block-editor-block-compare__current\"\n\t\t\t\taction={ onKeep }\n\t\t\t\tactionText={ __( 'Convert to HTML' ) }\n\t\t\t\trawContent={ block.originalContent }\n\t\t\t\trenderedContent={ block.originalContent }\n\t\t\t/>\n\n\t\t\t<BlockView\n\t\t\t\ttitle={ __( 'After Conversion' ) }\n\t\t\t\tclassName=\"block-editor-block-compare__converted\"\n\t\t\t\taction={ onConvert }\n\t\t\t\tactionText={ convertButtonText }\n\t\t\t\trawContent={ difference }\n\t\t\t\trenderedContent={ converted }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockCompare;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA,SAASC,SAAS,QAAQ,yBAAyB;;AAEnD;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,mBAAmB;;AAElD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErC,SAASC,YAAYA,CAAE;EACtBC,KAAK;EACLC,MAAM;EACNC,SAAS;EACTC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,SAASC,aAAaA,CAAEC,eAAe,EAAEC,UAAU,EAAG;IACrD,MAAMC,UAAU,GAAGjB,SAAS,CAAEe,eAAe,EAAEC,UAAW,CAAC;IAE3D,OAAOC,UAAU,CAACC,GAAG,CAAE,CAAEC,IAAI,EAAEC,GAAG,KAAM;MACvC,MAAMC,OAAO,GAAGtB,IAAI,CAAE;QACrB,mCAAmC,EAAEoB,IAAI,CAACG,KAAK;QAC/C,qCAAqC,EAAEH,IAAI,CAACI;MAC7C,CAAE,CAAC;MAEH,oBACClB,IAAA;QAAkBmB,SAAS,EAAGH,OAAS;QAAAI,QAAA,EACpCN,IAAI,CAACO;MAAK,GADDN,GAEN,CAAC;IAET,CAAE,CAAC;EACJ;EAEA,SAASO,mBAAmBA,CAAEC,cAAc,EAAG;IAC9C;IACA,MAAMC,SAAS,GAAGC,KAAK,CAACC,OAAO,CAAEH,cAAe,CAAC,GAC9CA,cAAc,GACd,CAAEA,cAAc,CAAE;;IAErB;IACA,MAAMZ,UAAU,GAAGa,SAAS,CAACX,GAAG,CAAIC,IAAI,IACvCjB,cAAc,CAAEiB,IAAI,CAACa,IAAI,EAAEb,IAAI,CAACc,UAAU,EAAEd,IAAI,CAACe,WAAY,CAC9D,CAAC;IAED,OAAOlB,UAAU,CAACmB,IAAI,CAAE,EAAG,CAAC;EAC7B;EAEA,MAAMC,SAAS,GAAGT,mBAAmB,CAAEf,SAAS,CAAEH,KAAM,CAAE,CAAC;EAC3D,MAAMQ,UAAU,GAAGH,aAAa,CAAEL,KAAK,CAACM,eAAe,EAAEqB,SAAU,CAAC;EAEpE,oBACC7B,KAAA;IAAKiB,SAAS,EAAC,qCAAqC;IAAAC,QAAA,gBACnDpB,IAAA,CAACF,SAAS;MACTkC,KAAK,EAAGpC,EAAE,CAAE,SAAU,CAAG;MACzBuB,SAAS,EAAC,qCAAqC;MAC/Cc,MAAM,EAAG5B,MAAQ;MACjB6B,UAAU,EAAGtC,EAAE,CAAE,iBAAkB,CAAG;MACtCuC,UAAU,EAAG/B,KAAK,CAACM,eAAiB;MACpC0B,eAAe,EAAGhC,KAAK,CAACM;IAAiB,CACzC,CAAC,eAEFV,IAAA,CAACF,SAAS;MACTkC,KAAK,EAAGpC,EAAE,CAAE,kBAAmB,CAAG;MAClCuB,SAAS,EAAC,uCAAuC;MACjDc,MAAM,EAAG3B,SAAW;MACpB4B,UAAU,EAAG1B,iBAAmB;MAChC2B,UAAU,EAAGvB,UAAY;MACzBwB,eAAe,EAAGL;IAAW,CAC7B,CAAC;EAAA,CACE,CAAC;AAER;AAEA,eAAe5B,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","diffChars","__","getSaveContent","BlockView","jsx","_jsx","jsxs","_jsxs","BlockCompare","block","onKeep","onConvert","convertor","convertButtonText","getDifference","originalContent","newContent","difference","map","item","pos","classes","added","removed","className","children","value","getConvertedContent","convertedBlock","newBlocks","Array","isArray","name","attributes","innerBlocks","join","converted","title","action","actionText","rawContent","renderedContent"],"sources":["@wordpress/block-editor/src/components/block-compare/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n// diff doesn't tree-shake correctly, so we import from the individual\n// module here, to avoid including too much of the library\nimport { diffChars } from 'diff/lib/diff/character';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getSaveContent } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport BlockView from './block-view';\n\nfunction BlockCompare( {\n\tblock,\n\tonKeep,\n\tonConvert,\n\tconvertor,\n\tconvertButtonText,\n} ) {\n\tfunction getDifference( originalContent, newContent ) {\n\t\tconst difference = diffChars( originalContent, newContent );\n\n\t\treturn difference.map( ( item, pos ) => {\n\t\t\tconst classes = clsx( {\n\t\t\t\t'block-editor-block-compare__added': item.added,\n\t\t\t\t'block-editor-block-compare__removed': item.removed,\n\t\t\t} );\n\n\t\t\treturn (\n\t\t\t\t<span key={ pos } className={ classes }>\n\t\t\t\t\t{ item.value }\n\t\t\t\t</span>\n\t\t\t);\n\t\t} );\n\t}\n\n\tfunction getConvertedContent( convertedBlock ) {\n\t\t// The convertor may return an array of items or a single item.\n\t\tconst newBlocks = Array.isArray( convertedBlock )\n\t\t\t? convertedBlock\n\t\t\t: [ convertedBlock ];\n\n\t\t// Get converted block details.\n\t\tconst newContent = newBlocks.map( ( item ) =>\n\t\t\tgetSaveContent( item.name, item.attributes, item.innerBlocks )\n\t\t);\n\n\t\treturn newContent.join( '' );\n\t}\n\n\tconst converted = getConvertedContent( convertor( block ) );\n\tconst difference = getDifference( block.originalContent, converted );\n\n\treturn (\n\t\t<div className=\"block-editor-block-compare__wrapper\">\n\t\t\t<BlockView\n\t\t\t\ttitle={ __( 'Current' ) }\n\t\t\t\tclassName=\"block-editor-block-compare__current\"\n\t\t\t\taction={ onKeep }\n\t\t\t\tactionText={ __( 'Convert to HTML' ) }\n\t\t\t\trawContent={ block.originalContent }\n\t\t\t\trenderedContent={ block.originalContent }\n\t\t\t/>\n\n\t\t\t<BlockView\n\t\t\t\ttitle={ __( 'After Conversion' ) }\n\t\t\t\tclassName=\"block-editor-block-compare__converted\"\n\t\t\t\taction={ onConvert }\n\t\t\t\tactionText={ convertButtonText }\n\t\t\t\trawContent={ difference }\n\t\t\t\trenderedContent={ converted }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockCompare;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA,SAASC,SAAS,QAAQ,yBAAyB;;AAEnD;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,mBAAmB;;AAElD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErC,SAASC,YAAYA,CAAE;EACtBC,KAAK;EACLC,MAAM;EACNC,SAAS;EACTC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,SAASC,aAAaA,CAAEC,eAAe,EAAEC,UAAU,EAAG;IACrD,MAAMC,UAAU,GAAGjB,SAAS,CAAEe,eAAe,EAAEC,UAAW,CAAC;IAE3D,OAAOC,UAAU,CAACC,GAAG,CAAE,CAAEC,IAAI,EAAEC,GAAG,KAAM;MACvC,MAAMC,OAAO,GAAGtB,IAAI,CAAE;QACrB,mCAAmC,EAAEoB,IAAI,CAACG,KAAK;QAC/C,qCAAqC,EAAEH,IAAI,CAACI;MAC7C,CAAE,CAAC;MAEH,oBACClB,IAAA;QAAkBmB,SAAS,EAAGH,OAAS;QAAAI,QAAA,EACpCN,IAAI,CAACO;MAAK,GADDN,GAEN,CAAC;IAET,CAAE,CAAC;EACJ;EAEA,SAASO,mBAAmBA,CAAEC,cAAc,EAAG;IAC9C;IACA,MAAMC,SAAS,GAAGC,KAAK,CAACC,OAAO,CAAEH,cAAe,CAAC,GAC9CA,cAAc,GACd,CAAEA,cAAc,CAAE;;IAErB;IACA,MAAMZ,UAAU,GAAGa,SAAS,CAACX,GAAG,CAAIC,IAAI,IACvCjB,cAAc,CAAEiB,IAAI,CAACa,IAAI,EAAEb,IAAI,CAACc,UAAU,EAAEd,IAAI,CAACe,WAAY,CAC9D,CAAC;IAED,OAAOlB,UAAU,CAACmB,IAAI,CAAE,EAAG,CAAC;EAC7B;EAEA,MAAMC,SAAS,GAAGT,mBAAmB,CAAEf,SAAS,CAAEH,KAAM,CAAE,CAAC;EAC3D,MAAMQ,UAAU,GAAGH,aAAa,CAAEL,KAAK,CAACM,eAAe,EAAEqB,SAAU,CAAC;EAEpE,oBACC7B,KAAA;IAAKiB,SAAS,EAAC,qCAAqC;IAAAC,QAAA,gBACnDpB,IAAA,CAACF,SAAS;MACTkC,KAAK,EAAGpC,EAAE,CAAE,SAAU,CAAG;MACzBuB,SAAS,EAAC,qCAAqC;MAC/Cc,MAAM,EAAG5B,MAAQ;MACjB6B,UAAU,EAAGtC,EAAE,CAAE,iBAAkB,CAAG;MACtCuC,UAAU,EAAG/B,KAAK,CAACM,eAAiB;MACpC0B,eAAe,EAAGhC,KAAK,CAACM;IAAiB,CACzC,CAAC,eAEFV,IAAA,CAACF,SAAS;MACTkC,KAAK,EAAGpC,EAAE,CAAE,kBAAmB,CAAG;MAClCuB,SAAS,EAAC,uCAAuC;MACjDc,MAAM,EAAG3B,SAAW;MACpB4B,UAAU,EAAG1B,iBAAmB;MAChC2B,UAAU,EAAGvB,UAAY;MACzBwB,eAAe,EAAGL;IAAW,CAC7B,CAAC;EAAA,CACE,CAAC;AAER;AAEA,eAAe5B,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalStyleProvider","StyleProvider","ToolbarGroup","useBlockControlsFill","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BlockControlsFill","group","controls","children","__experimentalShareWithChildBlocks","Fill","innerMarkup","document","fillProps","forwardedContext","reduce","inner","Provider","props"],"sources":["@wordpress/block-editor/src/components/block-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\tToolbarGroup,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useBlockControlsFill from './hook';\n\nexport default function BlockControlsFill( {\n\tgroup = 'default',\n\tcontrols,\n\tchildren,\n\t__experimentalShareWithChildBlocks = false,\n} ) {\n\tconst Fill = useBlockControlsFill(\n\t\tgroup,\n\t\t__experimentalShareWithChildBlocks\n\t);\n\tif ( ! Fill ) {\n\t\treturn null;\n\t}\n\n\tconst innerMarkup = (\n\t\t<>\n\t\t\t{ group === 'default' && <ToolbarGroup controls={ controls } /> }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\t// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,\n\t\t\t\t\t// that should wrap the fill markup.\n\t\t\t\t\tconst { forwardedContext = [] } = fillProps;\n\t\t\t\t\treturn forwardedContext.reduce(\n\t\t\t\t\t\t( inner, [ Provider, props ] ) => (\n\t\t\t\t\t\t\t<Provider { ...props }>{ inner }</Provider>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tinnerMarkup\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,2BAA2B,IAAIC,aAAa,EAC5CC,YAAY,QACN,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,KAAK,GAAG,SAAS;EACjBC,QAAQ;EACRC,QAAQ;EACRC,kCAAkC,GAAG;AACtC,CAAC,EAAG;EACH,MAAMC,IAAI,GAAGZ,oBAAoB,CAChCQ,KAAK,EACLG,kCACD,CAAC;EACD,IAAK,CAAEC,IAAI,EAAG;IACb,OAAO,IAAI;EACZ;EAEA,MAAMC,WAAW,gBAChBP,KAAA,CAAAF,SAAA;IAAAM,QAAA,GACGF,KAAK,KAAK,SAAS,iBAAIN,IAAA,CAACH,YAAY;MAACU,QAAQ,EAAGA;IAAU,CAAE,CAAC,EAC7DC,QAAQ;EAAA,CACT,CACF;EAED,oBACCR,IAAA,CAACJ,aAAa;IAACgB,QAAQ,EAAGA,QAAU;IAAAJ,QAAA,eACnCR,IAAA,CAACU,IAAI;MAAAF,QAAA,EACAK,SAAS,IAAM;QAClB;QACA;QACA,MAAM;UAAEC,gBAAgB,GAAG;QAAG,CAAC,GAAGD,SAAS;QAC3C,OAAOC,gBAAgB,CAACC,MAAM,CAC7B,CAAEC,KAAK,EAAE,CAAEC,QAAQ,EAAEC,KAAK,CAAE,kBAC3BlB,IAAA,CAACiB,QAAQ;UAAA,GAAMC,KAAK;UAAAV,QAAA,EAAKQ;QAAK,CAAY,CAC1C,EACDL,WACD,CAAC;MACF;IAAC,CACI;EAAC,CACO,CAAC;AAElB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__experimentalStyleProvider","StyleProvider","ToolbarGroup","useBlockControlsFill","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BlockControlsFill","group","controls","children","__experimentalShareWithChildBlocks","Fill","innerMarkup","document","fillProps","forwardedContext","reduce","inner","Provider","props"],"sources":["@wordpress/block-editor/src/components/block-controls/fill.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalStyleProvider as StyleProvider,\n\tToolbarGroup,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useBlockControlsFill from './hook';\n\nexport default function BlockControlsFill( {\n\tgroup = 'default',\n\tcontrols,\n\tchildren,\n\t__experimentalShareWithChildBlocks = false,\n} ) {\n\tconst Fill = useBlockControlsFill(\n\t\tgroup,\n\t\t__experimentalShareWithChildBlocks\n\t);\n\tif ( ! Fill ) {\n\t\treturn null;\n\t}\n\n\tconst innerMarkup = (\n\t\t<>\n\t\t\t{ group === 'default' && <ToolbarGroup controls={ controls } /> }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill>\n\t\t\t\t{ ( fillProps ) => {\n\t\t\t\t\t// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,\n\t\t\t\t\t// that should wrap the fill markup.\n\t\t\t\t\tconst { forwardedContext = [] } = fillProps;\n\t\t\t\t\treturn forwardedContext.reduce(\n\t\t\t\t\t\t( inner, [ Provider, props ] ) => (\n\t\t\t\t\t\t\t<Provider { ...props }>{ inner }</Provider>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tinnerMarkup\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t</Fill>\n\t\t</StyleProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,2BAA2B,IAAIC,aAAa,EAC5CC,YAAY,QACN,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,KAAK,GAAG,SAAS;EACjBC,QAAQ;EACRC,QAAQ;EACRC,kCAAkC,GAAG;AACtC,CAAC,EAAG;EACH,MAAMC,IAAI,GAAGZ,oBAAoB,CAChCQ,KAAK,EACLG,kCACD,CAAC;EACD,IAAK,CAAEC,IAAI,EAAG;IACb,OAAO,IAAI;EACZ;EAEA,MAAMC,WAAW,gBAChBP,KAAA,CAAAF,SAAA;IAAAM,QAAA,GACGF,KAAK,KAAK,SAAS,iBAAIN,IAAA,CAACH,YAAY;MAACU,QAAQ,EAAGA;IAAU,CAAE,CAAC,EAC7DC,QAAQ;EAAA,CACT,CACF;EAED,oBACCR,IAAA,CAACJ,aAAa;IAACgB,QAAQ,EAAGA,QAAU;IAAAJ,QAAA,eACnCR,IAAA,CAACU,IAAI;MAAAF,QAAA,EACAK,SAAS,IAAM;QAClB;QACA;QACA,MAAM;UAAEC,gBAAgB,GAAG;QAAG,CAAC,GAAGD,SAAS;QAC3C,OAAOC,gBAAgB,CAACC,MAAM,CAC7B,CAAEC,KAAK,EAAE,CAAEC,QAAQ,EAAEC,KAAK,CAAE,kBAC3BlB,IAAA,CAACiB,QAAQ;UAAA,GAAMC,KAAK;UAAAV,QAAA,EAAKQ;QAAK,CAAY,CAC1C,EACDL,WACD,CAAC;MACF;IAAC,CACI;EAAC,CACO,CAAC;AAElB","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
/**
|
|
2
3
|
* External dependencies
|
|
3
4
|
*/
|
|
@@ -6,14 +7,18 @@ import clsx from 'clsx';
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
10
|
+
import { getBlockDefaultClassName, getBlockType, hasBlockSupport, store as blocksStore } from '@wordpress/blocks';
|
|
9
11
|
import { withFilters } from '@wordpress/components';
|
|
10
|
-
import {
|
|
11
|
-
import { useContext, useMemo } from '@wordpress/element';
|
|
12
|
+
import { useRegistry, useSelect } from '@wordpress/data';
|
|
13
|
+
import { useCallback, useContext, useMemo } from '@wordpress/element';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Internal dependencies
|
|
15
17
|
*/
|
|
16
18
|
import BlockContext from '../block-context';
|
|
19
|
+
import isURLLike from '../link-control/is-url-like';
|
|
20
|
+
import { canBindAttribute, hasPatternOverridesDefaultBinding, replacePatternOverridesDefaultBinding } from '../../utils/block-bindings';
|
|
21
|
+
import { unlock } from '../../lock-unlock';
|
|
17
22
|
|
|
18
23
|
/**
|
|
19
24
|
* Default value used for blocks which do not define their own context needs,
|
|
@@ -45,33 +50,166 @@ const Edit = props => {
|
|
|
45
50
|
const EditWithFilters = withFilters('editor.BlockEdit')(Edit);
|
|
46
51
|
const EditWithGeneratedProps = props => {
|
|
47
52
|
const {
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
name,
|
|
54
|
+
clientId,
|
|
55
|
+
attributes,
|
|
56
|
+
setAttributes
|
|
50
57
|
} = props;
|
|
58
|
+
const registry = useRegistry();
|
|
51
59
|
const blockType = getBlockType(name);
|
|
52
60
|
const blockContext = useContext(BlockContext);
|
|
61
|
+
const registeredSources = useSelect(select => unlock(select(blocksStore)).getAllBlockBindingsSources(), []);
|
|
62
|
+
const {
|
|
63
|
+
blockBindings,
|
|
64
|
+
context,
|
|
65
|
+
hasPatternOverrides
|
|
66
|
+
} = useMemo(() => {
|
|
67
|
+
// Assign context values using the block type's declared context needs.
|
|
68
|
+
const computedContext = blockType?.usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => blockType.usesContext.includes(key))) : DEFAULT_BLOCK_CONTEXT;
|
|
69
|
+
// Add context requested by Block Bindings sources.
|
|
70
|
+
if (attributes?.metadata?.bindings) {
|
|
71
|
+
Object.values(attributes?.metadata?.bindings || {}).forEach(binding => {
|
|
72
|
+
registeredSources[binding?.source]?.usesContext?.forEach(key => {
|
|
73
|
+
computedContext[key] = blockContext[key];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
blockBindings: replacePatternOverridesDefaultBinding(name, attributes?.metadata?.bindings),
|
|
79
|
+
context: computedContext,
|
|
80
|
+
hasPatternOverrides: hasPatternOverridesDefaultBinding(attributes?.metadata?.bindings)
|
|
81
|
+
};
|
|
82
|
+
}, [name, blockType?.usesContext, blockContext, attributes?.metadata?.bindings, registeredSources]);
|
|
83
|
+
const computedAttributes = useSelect(select => {
|
|
84
|
+
if (!blockBindings) {
|
|
85
|
+
return attributes;
|
|
86
|
+
}
|
|
87
|
+
const attributesFromSources = {};
|
|
88
|
+
const blockBindingsBySource = new Map();
|
|
89
|
+
for (const [attributeName, binding] of Object.entries(blockBindings)) {
|
|
90
|
+
const {
|
|
91
|
+
source: sourceName,
|
|
92
|
+
args: sourceArgs
|
|
93
|
+
} = binding;
|
|
94
|
+
const source = registeredSources[sourceName];
|
|
95
|
+
if (!source || !canBindAttribute(name, attributeName)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
blockBindingsBySource.set(source, {
|
|
99
|
+
...blockBindingsBySource.get(source),
|
|
100
|
+
[attributeName]: {
|
|
101
|
+
args: sourceArgs
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (blockBindingsBySource.size) {
|
|
106
|
+
for (const [source, bindings] of blockBindingsBySource) {
|
|
107
|
+
// Get values in batch if the source supports it.
|
|
108
|
+
let values = {};
|
|
109
|
+
if (!source.getValues) {
|
|
110
|
+
Object.keys(bindings).forEach(attr => {
|
|
111
|
+
// Default to the the source label when `getValues` doesn't exist.
|
|
112
|
+
values[attr] = source.label;
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
values = source.getValues({
|
|
116
|
+
select,
|
|
117
|
+
context,
|
|
118
|
+
clientId,
|
|
119
|
+
bindings
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
for (const [attributeName, value] of Object.entries(values)) {
|
|
123
|
+
if (attributeName === 'url' && (!value || !isURLLike(value))) {
|
|
124
|
+
// Return null if value is not a valid URL.
|
|
125
|
+
attributesFromSources[attributeName] = null;
|
|
126
|
+
} else {
|
|
127
|
+
attributesFromSources[attributeName] = value;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
...attributes,
|
|
134
|
+
...attributesFromSources
|
|
135
|
+
};
|
|
136
|
+
}, [attributes, blockBindings, clientId, context, name, registeredSources]);
|
|
137
|
+
const setBoundAttributes = useCallback(nextAttributes => {
|
|
138
|
+
if (!blockBindings) {
|
|
139
|
+
setAttributes(nextAttributes);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
registry.batch(() => {
|
|
143
|
+
const keptAttributes = {
|
|
144
|
+
...nextAttributes
|
|
145
|
+
};
|
|
146
|
+
const blockBindingsBySource = new Map();
|
|
53
147
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
148
|
+
// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
|
|
149
|
+
for (const [attributeName, newValue] of Object.entries(keptAttributes)) {
|
|
150
|
+
if (!blockBindings[attributeName] || !canBindAttribute(name, attributeName)) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const binding = blockBindings[attributeName];
|
|
154
|
+
const source = registeredSources[binding?.source];
|
|
155
|
+
if (!source?.setValues) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
blockBindingsBySource.set(source, {
|
|
159
|
+
...blockBindingsBySource.get(source),
|
|
160
|
+
[attributeName]: {
|
|
161
|
+
args: binding.args,
|
|
162
|
+
newValue
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
delete keptAttributes[attributeName];
|
|
166
|
+
}
|
|
167
|
+
if (blockBindingsBySource.size) {
|
|
168
|
+
for (const [source, bindings] of blockBindingsBySource) {
|
|
169
|
+
source.setValues({
|
|
170
|
+
select: registry.select,
|
|
171
|
+
dispatch: registry.dispatch,
|
|
172
|
+
context,
|
|
173
|
+
clientId,
|
|
174
|
+
bindings
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const hasParentPattern = !!context['pattern/overrides'];
|
|
179
|
+
if (
|
|
180
|
+
// Don't update non-connected attributes if the block is using pattern overrides
|
|
181
|
+
// and the editing is happening while overriding the pattern (not editing the original).
|
|
182
|
+
!(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length) {
|
|
183
|
+
// Don't update caption and href until they are supported.
|
|
184
|
+
if (hasPatternOverrides) {
|
|
185
|
+
delete keptAttributes.caption;
|
|
186
|
+
delete keptAttributes.href;
|
|
187
|
+
}
|
|
188
|
+
setAttributes(keptAttributes);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}, [blockBindings, clientId, context, hasPatternOverrides, setAttributes, registeredSources, name, registry]);
|
|
58
192
|
if (!blockType) {
|
|
59
193
|
return null;
|
|
60
194
|
}
|
|
61
195
|
if (blockType.apiVersion > 1) {
|
|
62
196
|
return /*#__PURE__*/_jsx(EditWithFilters, {
|
|
63
197
|
...props,
|
|
64
|
-
|
|
198
|
+
attributes: computedAttributes,
|
|
199
|
+
context: context,
|
|
200
|
+
setAttributes: setBoundAttributes
|
|
65
201
|
});
|
|
66
202
|
}
|
|
67
203
|
|
|
68
204
|
// Generate a class name for the block's editable form.
|
|
69
205
|
const generatedClassName = hasBlockSupport(blockType, 'className', true) ? getBlockDefaultClassName(name) : null;
|
|
70
|
-
const className = clsx(generatedClassName, attributes
|
|
206
|
+
const className = clsx(generatedClassName, attributes?.className, props.className);
|
|
71
207
|
return /*#__PURE__*/_jsx(EditWithFilters, {
|
|
72
208
|
...props,
|
|
209
|
+
attributes: computedAttributes,
|
|
210
|
+
className: className,
|
|
73
211
|
context: context,
|
|
74
|
-
|
|
212
|
+
setAttributes: setBoundAttributes
|
|
75
213
|
});
|
|
76
214
|
};
|
|
77
215
|
export default EditWithGeneratedProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","withFilters","getBlockDefaultClassName","hasBlockSupport","getBlockType","useContext","useMemo","BlockContext","jsx","_jsx","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","Component","edit","save","EditWithFilters","EditWithGeneratedProps","attributes","blockContext","context","usesContext","Object","fromEntries","entries","filter","key","includes","apiVersion","generatedClassName","className"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport {\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { attributes = {}, name } = props;\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn <EditWithFilters { ...props } context={ context } />;\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = clsx(\n\t\tgeneratedClassName,\n\t\tattributes.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tcontext={ context }\n\t\t\tclassName={ className }\n\t\t/>\n\t);\n};\n\nexport default EditWithGeneratedProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SACCC,wBAAwB,EACxBC,eAAe,EACfC,YAAY,QACN,mBAAmB;AAC1B,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,kBAAkB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,MAAMC,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAMC,IAAI,GAAKC,KAAK,IAAM;EACzB,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,SAAS,GAAGV,YAAY,CAAES,IAAK,CAAC;EAEtC,IAAK,CAAEC,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;;EAEA;EACA;EACA;EACA,MAAMC,SAAS,GAAGD,SAAS,CAACE,IAAI,IAAIF,SAAS,CAACG,IAAI;EAElD,oBAAOR,IAAA,CAACM,SAAS;IAAA,GAAMH;EAAK,CAAI,CAAC;AAClC,CAAC;AAED,MAAMM,eAAe,GAAGjB,WAAW,CAAE,kBAAmB,CAAC,CAAEU,IAAK,CAAC;AAEjE,MAAMQ,sBAAsB,GAAKP,KAAK,IAAM;EAC3C,MAAM;IAAEQ,UAAU,GAAG,CAAC,CAAC;IAAEP;EAAK,CAAC,GAAGD,KAAK;EACvC,MAAME,SAAS,GAAGV,YAAY,CAAES,IAAK,CAAC;EACtC,MAAMQ,YAAY,GAAGhB,UAAU,CAAEE,YAAa,CAAC;;EAE/C;EACA,MAAMe,OAAO,GAAGhB,OAAO,CAAE,MAAM;IAC9B,OAAOQ,SAAS,IAAIA,SAAS,CAACS,WAAW,GACtCC,MAAM,CAACC,WAAW,CAClBD,MAAM,CAACE,OAAO,CAAEL,YAAa,CAAC,CAACM,MAAM,CAAE,CAAE,CAAEC,GAAG,CAAE,KAC/Cd,SAAS,CAACS,WAAW,CAACM,QAAQ,CAAED,GAAI,CACrC,CACA,CAAC,GACDlB,qBAAqB;EACzB,CAAC,EAAE,CAAEI,SAAS,EAAEO,YAAY,CAAG,CAAC;EAEhC,IAAK,CAAEP,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,IAAKA,SAAS,CAACgB,UAAU,GAAG,CAAC,EAAG;IAC/B,oBAAOrB,IAAA,CAACS,eAAe;MAAA,GAAMN,KAAK;MAAGU,OAAO,EAAGA;IAAS,CAAE,CAAC;EAC5D;;EAEA;EACA,MAAMS,kBAAkB,GAAG5B,eAAe,CAAEW,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,GACvEZ,wBAAwB,CAAEW,IAAK,CAAC,GAChC,IAAI;EACP,MAAMmB,SAAS,GAAGhC,IAAI,CACrB+B,kBAAkB,EAClBX,UAAU,CAACY,SAAS,EACpBpB,KAAK,CAACoB,SACP,CAAC;EAED,oBACCvB,IAAA,CAACS,eAAe;IAAA,GACVN,KAAK;IACVU,OAAO,EAAGA,OAAS;IACnBU,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ,CAAC;AAED,eAAeb,sBAAsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","getBlockDefaultClassName","getBlockType","hasBlockSupport","store","blocksStore","withFilters","useRegistry","useSelect","useCallback","useContext","useMemo","BlockContext","isURLLike","canBindAttribute","hasPatternOverridesDefaultBinding","replacePatternOverridesDefaultBinding","unlock","jsx","_jsx","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","Component","edit","save","EditWithFilters","EditWithGeneratedProps","clientId","attributes","setAttributes","registry","blockContext","registeredSources","select","getAllBlockBindingsSources","blockBindings","context","hasPatternOverrides","computedContext","usesContext","Object","fromEntries","entries","filter","key","includes","metadata","bindings","values","forEach","binding","source","computedAttributes","attributesFromSources","blockBindingsBySource","Map","attributeName","sourceName","args","sourceArgs","set","get","size","getValues","keys","attr","label","value","setBoundAttributes","nextAttributes","batch","keptAttributes","newValue","setValues","dispatch","hasParentPattern","length","caption","href","apiVersion","generatedClassName","className"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockDefaultClassName,\n\tgetBlockType,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\nimport isURLLike from '../link-control/is-url-like';\nimport {\n\tcanBindAttribute,\n\thasPatternOverridesDefaultBinding,\n\treplacePatternOverridesDefaultBinding,\n} from '../../utils/block-bindings';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nconst Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\t// `edit` and `save` are functions or components describing the markup\n\t// with which a block is displayed. If `blockType` is valid, assign\n\t// them preferentially as the render value for the block.\n\tconst Component = blockType.edit || blockType.save;\n\n\treturn <Component { ...props } />;\n};\n\nconst EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );\n\nconst EditWithGeneratedProps = ( props ) => {\n\tconst { name, clientId, attributes, setAttributes } = props;\n\tconst registry = useRegistry();\n\tconst blockType = getBlockType( name );\n\tconst blockContext = useContext( BlockContext );\n\tconst registeredSources = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources(),\n\t\t[]\n\t);\n\n\tconst { blockBindings, context, hasPatternOverrides } = useMemo( () => {\n\t\t// Assign context values using the block type's declared context needs.\n\t\tconst computedContext = blockType?.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t\t// Add context requested by Block Bindings sources.\n\t\tif ( attributes?.metadata?.bindings ) {\n\t\t\tObject.values( attributes?.metadata?.bindings || {} ).forEach(\n\t\t\t\t( binding ) => {\n\t\t\t\t\tregisteredSources[ binding?.source ]?.usesContext?.forEach(\n\t\t\t\t\t\t( key ) => {\n\t\t\t\t\t\t\tcomputedContext[ key ] = blockContext[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tblockBindings: replacePatternOverridesDefaultBinding(\n\t\t\t\tname,\n\t\t\t\tattributes?.metadata?.bindings\n\t\t\t),\n\t\t\tcontext: computedContext,\n\t\t\thasPatternOverrides: hasPatternOverridesDefaultBinding(\n\t\t\t\tattributes?.metadata?.bindings\n\t\t\t),\n\t\t};\n\t}, [\n\t\tname,\n\t\tblockType?.usesContext,\n\t\tblockContext,\n\t\tattributes?.metadata?.bindings,\n\t\tregisteredSources,\n\t] );\n\n\tconst computedAttributes = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! blockBindings ) {\n\t\t\t\treturn attributes;\n\t\t\t}\n\n\t\t\tconst attributesFromSources = {};\n\t\t\tconst blockBindingsBySource = new Map();\n\n\t\t\tfor ( const [ attributeName, binding ] of Object.entries(\n\t\t\t\tblockBindings\n\t\t\t) ) {\n\t\t\t\tconst { source: sourceName, args: sourceArgs } = binding;\n\t\t\t\tconst source = registeredSources[ sourceName ];\n\t\t\t\tif ( ! source || ! canBindAttribute( name, attributeName ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tblockBindingsBySource.set( source, {\n\t\t\t\t\t...blockBindingsBySource.get( source ),\n\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\targs: sourceArgs,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( blockBindingsBySource.size ) {\n\t\t\t\tfor ( const [ source, bindings ] of blockBindingsBySource ) {\n\t\t\t\t\t// Get values in batch if the source supports it.\n\t\t\t\t\tlet values = {};\n\t\t\t\t\tif ( ! source.getValues ) {\n\t\t\t\t\t\tObject.keys( bindings ).forEach( ( attr ) => {\n\t\t\t\t\t\t\t// Default to the the source label when `getValues` doesn't exist.\n\t\t\t\t\t\t\tvalues[ attr ] = source.label;\n\t\t\t\t\t\t} );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalues = source.getValues( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tbindings,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tfor ( const [ attributeName, value ] of Object.entries(\n\t\t\t\t\t\tvalues\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tattributeName === 'url' &&\n\t\t\t\t\t\t\t( ! value || ! isURLLike( value ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Return null if value is not a valid URL.\n\t\t\t\t\t\t\tattributesFromSources[ attributeName ] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattributesFromSources[ attributeName ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...attributesFromSources,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tattributes,\n\t\t\tblockBindings,\n\t\t\tclientId,\n\t\t\tcontext,\n\t\t\tname,\n\t\t\tregisteredSources,\n\t\t]\n\t);\n\n\tconst setBoundAttributes = useCallback(\n\t\t( nextAttributes ) => {\n\t\t\tif ( ! blockBindings ) {\n\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\t\t\t\tconst blockBindingsBySource = new Map();\n\n\t\t\t\t// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.\n\t\t\t\tfor ( const [ attributeName, newValue ] of Object.entries(\n\t\t\t\t\tkeptAttributes\n\t\t\t\t) ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! blockBindings[ attributeName ] ||\n\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst binding = blockBindings[ attributeName ];\n\t\t\t\t\tconst source = registeredSources[ binding?.source ];\n\t\t\t\t\tif ( ! source?.setValues ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tblockBindingsBySource.set( source, {\n\t\t\t\t\t\t...blockBindingsBySource.get( source ),\n\t\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\t\targs: binding.args,\n\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t}\n\n\t\t\t\tif ( blockBindingsBySource.size ) {\n\t\t\t\t\tfor ( const [\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tbindings,\n\t\t\t\t\t] of blockBindingsBySource ) {\n\t\t\t\t\t\tsource.setValues( {\n\t\t\t\t\t\t\tselect: registry.select,\n\t\t\t\t\t\t\tdispatch: registry.dispatch,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tbindings,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\n\t\t\t\tif (\n\t\t\t\t\t// Don't update non-connected attributes if the block is using pattern overrides\n\t\t\t\t\t// and the editing is happening while overriding the pattern (not editing the original).\n\t\t\t\t\t! ( hasPatternOverrides && hasParentPattern ) &&\n\t\t\t\t\tObject.keys( keptAttributes ).length\n\t\t\t\t) {\n\t\t\t\t\t// Don't update caption and href until they are supported.\n\t\t\t\t\tif ( hasPatternOverrides ) {\n\t\t\t\t\t\tdelete keptAttributes.caption;\n\t\t\t\t\t\tdelete keptAttributes.href;\n\t\t\t\t\t}\n\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tclientId,\n\t\t\tcontext,\n\t\t\thasPatternOverrides,\n\t\t\tsetAttributes,\n\t\t\tregisteredSources,\n\t\t\tname,\n\t\t\tregistry,\n\t\t]\n\t);\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tif ( blockType.apiVersion > 1 ) {\n\t\treturn (\n\t\t\t<EditWithFilters\n\t\t\t\t{ ...props }\n\t\t\t\tattributes={ computedAttributes }\n\t\t\t\tcontext={ context }\n\t\t\t\tsetAttributes={ setBoundAttributes }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Generate a class name for the block's editable form.\n\tconst generatedClassName = hasBlockSupport( blockType, 'className', true )\n\t\t? getBlockDefaultClassName( name )\n\t\t: null;\n\tconst className = clsx(\n\t\tgeneratedClassName,\n\t\tattributes?.className,\n\t\tprops.className\n\t);\n\n\treturn (\n\t\t<EditWithFilters\n\t\t\t{ ...props }\n\t\t\tattributes={ computedAttributes }\n\t\t\tclassName={ className }\n\t\t\tcontext={ context }\n\t\t\tsetAttributes={ setBoundAttribut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eAAe;MAAA,GACVN,KAAK;MACVS,UAAU,EAAGwB,kBAAoB;MACjChB,OAAO,EAAGA,OAAS;MACnBP,aAAa,EAAGuC;IAAoB,CACpC,CAAC;EAEJ;;EAEA;EACA,MAAMY,kBAAkB,GAAGhF,eAAe,CAAEqB,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,GACvEvB,wBAAwB,CAAEsB,IAAK,CAAC,GAChC,IAAI;EACP,MAAM6D,SAAS,GAAGpF,IAAI,CACrBmF,kBAAkB,EAClBpD,UAAU,EAAEqD,SAAS,EACrB9D,KAAK,CAAC8D,SACP,CAAC;EAED,oBACCjE,IAAA,CAACS,eAAe;IAAA,GACVN,KAAK;IACVS,UAAU,EAAGwB,kBAAoB;IACjC6B,SAAS,EAAGA,SAAW;IACvB7C,OAAO,EAAGA,OAAS;IACnBP,aAAa,EAAGuC;EAAoB,CACpC,CAAC;AAEJ,CAAC;AAED,eAAe1C,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withFilters","getBlockType","useContext","useMemo","BlockContext","jsx","_jsx","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","blockContext","context","usesContext","Object","fromEntries","entries","filter","key","includes","Component","edit"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nexport const Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tconst Component = blockType.edit;\n\n\treturn <Component { ...props } context={ context } />;\n};\n\nexport default withFilters( 'editor.BlockEdit' )( Edit );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,uBAAuB;AACnD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,kBAAkB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,MAAMC,qBAAqB,GAAG,CAAC,CAAC;AAEhC,OAAO,MAAMC,IAAI,GAAKC,KAAK,IAAM;EAChC,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,SAAS,GAAGV,YAAY,CAAES,IAAK,CAAC;EAEtC,MAAME,YAAY,GAAGV,UAAU,CAAEE,YAAa,CAAC;;EAE/C;EACA,MAAMS,OAAO,GAAGV,OAAO,CAAE,MAAM;IAC9B,OAAOQ,SAAS,IAAIA,SAAS,CAACG,WAAW,GACtCC,MAAM,CAACC,WAAW,CAClBD,MAAM,CAACE,OAAO,CAAEL,YAAa,CAAC,CAACM,MAAM,CAAE,CAAE,CAAEC,GAAG,CAAE,KAC/CR,SAAS,CAACG,WAAW,CAACM,QAAQ,CAAED,GAAI,CACrC,CACA,CAAC,GACDZ,qBAAqB;EACzB,CAAC,EAAE,CAAEI,SAAS,EAAEC,YAAY,CAAG,CAAC;EAEhC,IAAK,CAAED,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMU,SAAS,GAAGV,SAAS,CAACW,IAAI;EAEhC,oBAAOhB,IAAA,CAACe,SAAS;IAAA,GAAMZ,KAAK;IAAGI,OAAO,EAAGA;EAAS,CAAE,CAAC;AACtD,CAAC;AAED,eAAeb,WAAW,CAAE,kBAAmB,CAAC,CAAEQ,IAAK,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["withFilters","getBlockType","useContext","useMemo","BlockContext","jsx","_jsx","DEFAULT_BLOCK_CONTEXT","Edit","props","name","blockType","blockContext","context","usesContext","Object","fromEntries","entries","filter","key","includes","Component","edit"],"sources":["@wordpress/block-editor/src/components/block-edit/edit.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withFilters } from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockContext from '../block-context';\n\n/**\n * Default value used for blocks which do not define their own context needs,\n * used to guarantee that a block's `context` prop will always be an object. It\n * is assigned as a constant since it is always expected to be an empty object,\n * and in order to avoid unnecessary React reconciliations of a changing object.\n *\n * @type {{}}\n */\nconst DEFAULT_BLOCK_CONTEXT = {};\n\nexport const Edit = ( props ) => {\n\tconst { name } = props;\n\tconst blockType = getBlockType( name );\n\n\tconst blockContext = useContext( BlockContext );\n\n\t// Assign context values using the block type's declared context needs.\n\tconst context = useMemo( () => {\n\t\treturn blockType && blockType.usesContext\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries( blockContext ).filter( ( [ key ] ) =>\n\t\t\t\t\t\tblockType.usesContext.includes( key )\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: DEFAULT_BLOCK_CONTEXT;\n\t}, [ blockType, blockContext ] );\n\n\tif ( ! blockType ) {\n\t\treturn null;\n\t}\n\n\tconst Component = blockType.edit;\n\n\treturn <Component { ...props } context={ context } />;\n};\n\nexport default withFilters(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x","_jsx","HEADING_LEVELS","POPOVER_PROPS","className","HeadingLevelDropdown","options","value","onChange","validOptions","filter","option","includes","sort","a","b","popoverProps","icon","level","label","controls","map","targetLevel","isActive","title","onClick","role"],"sources":["@wordpress/block-editor/src/components/block-heading-level-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarDropdownMenu } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport HeadingLevelIcon from './heading-level-icon';\n\nconst HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-library-heading-level-dropdown',\n};\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * HeadingLevelDropdown props.\n *\n * @typedef WPHeadingLevelDropdownProps\n *\n * @property {number} value The chosen heading level.\n * @property {number[]} options An array of supported heading levels.\n * @property {()=>number} onChange Function called with\n * the selected value changes.\n */\n\n/**\n * Dropdown for selecting a heading level (1 through 6) or paragraph (0).\n *\n * @param {WPHeadingLevelDropdownProps} props Component props.\n *\n * @return {ComponentType} The toolbar.\n */\nexport default function HeadingLevelDropdown( {\n\toptions = HEADING_LEVELS,\n\tvalue,\n\tonChange,\n} ) {\n\tconst validOptions = options\n\t\t.filter(\n\t\t\t( option ) => option === 0 || HEADING_LEVELS.includes( option )\n\t\t)\n\t\t.sort( ( a, b ) => a - b ); // Sorts numerically in ascending order;\n\n\treturn (\n\t\t<ToolbarDropdownMenu\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\ticon={ <HeadingLevelIcon level={ value } /> }\n\t\t\tlabel={ __( 'Change level' ) }\n\t\t\tcontrols={ validOptions.map( ( targetLevel ) => {\n\t\t\t\tconst isActive = targetLevel === value;\n\t\t\t\treturn {\n\t\t\t\t\ticon: <HeadingLevelIcon level={ targetLevel } />,\n\t\t\t\t\ttitle:\n\t\t\t\t\t\ttargetLevel === 0\n\t\t\t\t\t\t\t? __( 'Paragraph' )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\t\t\t\t\ttargetLevel\n\t\t\t\t\t\t\t ),\n\t\t\t\t\tisActive,\n\t\t\t\t\tonClick() {\n\t\t\t\t\t\tonChange( targetLevel );\n\t\t\t\t\t},\n\t\t\t\t\trole: 'menuitemradio',\n\t\t\t\t};\n\t\t\t} ) }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAMC,cAAc,GAAG,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE;AAE3C,MAAMC,aAAa,GAAG;EACrBC,SAAS,EAAE;AACZ,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAE;EAC7CC,OAAO,GAAGJ,cAAc;EACxBK,KAAK;EACLC;AACD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGH,OAAO,CAC1BI,MAAM,CACJC,MAAM,IAAMA,MAAM,KAAK,CAAC,IAAIT,cAAc,CAACU,QAAQ,CAAED,MAAO,CAC/D,CAAC,CACAE,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAMD,CAAC,GAAGC,CAAE,CAAC,CAAC,CAAC;;EAE7B,oBACCd,IAAA,CAACL,mBAAmB;IACnBoB,YAAY,EAAGb,aAAe;IAC9Bc,IAAI,eAAGhB,IAAA,CAACF,gBAAgB;MAACmB,KAAK,EAAGX;IAAO,CAAE,CAAG;IAC7CY,KAAK,EAAGtB,EAAE,CAAE,cAAe,CAAG;IAC9BuB,QAAQ,EAAGX,YAAY,CAACY,GAAG,CAAIC,WAAW,IAAM;MAC/C,MAAMC,QAAQ,GAAGD,WAAW,KAAKf,KAAK;MACtC,OAAO;QACNU,IAAI,eAAEhB,IAAA,CAACF,gBAAgB;UAACmB,KAAK,EAAGI;QAAa,CAAE,CAAC;QAChDE,KAAK,EACJF,WAAW,KAAK,CAAC,GACdzB,EAAE,CAAE,WAAY,CAAC,GACjBC,OAAO;QACP;QACAD,EAAE,CAAE,YAAa,CAAC,EAClByB,WACA,CAAC;QACLC,QAAQ;QACRE,OAAOA,CAAA,EAAG;UACTjB,QAAQ,CAAEc,WAAY,CAAC;QACxB,CAAC;QACDI,IAAI,EAAE;MACP,CAAC;IACF,CAAE;EAAG,CACL,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ToolbarDropdownMenu","__","sprintf","HeadingLevelIcon","jsx","_jsx","HEADING_LEVELS","POPOVER_PROPS","className","HeadingLevelDropdown","options","value","onChange","validOptions","filter","option","includes","sort","a","b","popoverProps","icon","level","label","controls","map","targetLevel","isActive","title","onClick","role"],"sources":["@wordpress/block-editor/src/components/block-heading-level-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarDropdownMenu } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport HeadingLevelIcon from './heading-level-icon';\n\nconst HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-library-heading-level-dropdown',\n};\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * HeadingLevelDropdown props.\n *\n * @typedef WPHeadingLevelDropdownProps\n *\n * @property {number} value The chosen heading level.\n * @property {number[]} options An array of supported heading levels.\n * @property {()=>number} onChange Function called with\n * the selected value changes.\n */\n\n/**\n * Dropdown for selecting a heading level (1 through 6) or paragraph (0).\n *\n * @param {WPHeadingLevelDropdownProps} props Component props.\n *\n * @return {ComponentType} The toolbar.\n */\nexport default function HeadingLevelDropdown( {\n\toptions = HEADING_LEVELS,\n\tvalue,\n\tonChange,\n} ) {\n\tconst validOptions = options\n\t\t.filter(\n\t\t\t( option ) => option === 0 || HEADING_LEVELS.includes( option )\n\t\t)\n\t\t.sort( ( a, b ) => a - b ); // Sorts numerically in ascending order;\n\n\treturn (\n\t\t<ToolbarDropdownMenu\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\ticon={ <HeadingLevelIcon level={ value } /> }\n\t\t\tlabel={ __( 'Change level' ) }\n\t\t\tcontrols={ validOptions.map( ( targetLevel ) => {\n\t\t\t\tconst isActive = targetLevel === value;\n\t\t\t\treturn {\n\t\t\t\t\ticon: <HeadingLevelIcon level={ targetLevel } />,\n\t\t\t\t\ttitle:\n\t\t\t\t\t\ttargetLevel === 0\n\t\t\t\t\t\t\t? __( 'Paragraph' )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\t\t\t\t\ttargetLevel\n\t\t\t\t\t\t\t ),\n\t\t\t\t\tisActive,\n\t\t\t\t\tonClick() {\n\t\t\t\t\t\tonChange( targetLevel );\n\t\t\t\t\t},\n\t\t\t\t\trole: 'menuitemradio',\n\t\t\t\t};\n\t\t\t} ) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAMC,cAAc,GAAG,CAAE,CAAC,EAAE,CAAC,EAAE,CA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
1
|
-
{"version":3,"names":["__","sprintf","DropdownMenu","HeadingLevelIcon","jsx","_jsx","HEADING_LEVELS","HeadingLevelDropdown","options","value","onChange","createLevelControl","targetLevel","currentLevel","onChangeCallback","isActive","icon","level","isPressed","title","onClick","controls","map","index","label"],"sources":["@wordpress/block-editor/src/components/block-heading-level-dropdown/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { DropdownMenu } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport HeadingLevelIcon from './heading-level-icon';\n\nconst HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * HeadingLevelDropdown props.\n *\n * @typedef WPHeadingLevelDropdownProps\n *\n * @property {number} value The chosen heading level.\n * @property {number[]} options An array of supported heading levels.\n * @property {()=>number} onChange Function called with\n * the selected value changes.\n */\n\n/**\n * Dropdown for selecting a heading level (1 through 6).\n *\n * @param {WPHeadingLevelDropdownProps} props Component props.\n *\n * @return {ComponentType} The toolbar.\n */\nexport default function HeadingLevelDropdown( {\n\toptions = HEADING_LEVELS,\n\tvalue,\n\tonChange,\n} ) {\n\tconst createLevelControl = (\n\t\ttargetLevel,\n\t\tcurrentLevel,\n\t\tonChangeCallback\n\t) => {\n\t\tconst isActive = targetLevel === currentLevel;\n\t\treturn {\n\t\t\ticon: (\n\t\t\t\t<HeadingLevelIcon\n\t\t\t\t\tlevel={ targetLevel }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t/>\n\t\t\t),\n\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\ttitle: sprintf( __( 'Heading %d' ), targetLevel ),\n\t\t\tisActive,\n\t\t\tonClick: () => onChangeCallback( targetLevel ),\n\t\t};\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ <HeadingLevelIcon level={ value } /> }\n\t\t\tcontrols={ options.map( ( index ) =>\n\t\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AGxB,EAAE,CAAE,cAAe;EAAG,CAC9B,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","sprintf","DropdownMenu","HeadingLevelIcon","jsx","_jsx","HEADING_LEVELS","HeadingLevelDropdown","options","value","onChange","createLevelControl","targetLevel","currentLevel","onChangeCallback","isActive","icon","level","isPressed","title","onClick","controls","map","index","label"],"sources":["@wordpress/block-editor/src/components/block-heading-level-dropdown/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { DropdownMenu } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport HeadingLevelIcon from './heading-level-icon';\n\nconst HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * HeadingLevelDropdown props.\n *\n * @typedef WPHeadingLevelDropdownProps\n *\n * @property {number} value The chosen heading level.\n * @property {number[]} options An array of supported heading levels.\n * @property {()=>number} onChange Function called with\n * the selected value changes.\n */\n\n/**\n * Dropdown for selecting a heading level (1 through 6).\n *\n * @param {WPHeadingLevelDropdownProps} props Component props.\n *\n * @return {ComponentType} The toolbar.\n */\nexport default function HeadingLevelDropdown( {\n\toptions = HEADING_LEVELS,\n\tvalue,\n\tonChange,\n} ) {\n\tconst createLevelControl = (\n\t\ttargetLevel,\n\t\tcurrentLevel,\n\t\tonChangeCallback\n\t) => {\n\t\tconst isActive = targetLevel === currentLevel;\n\t\treturn {\n\t\t\ticon: (\n\t\t\t\t<HeadingLevelIcon\n\t\t\t\t\tlevel={ targetLevel }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t/>\n\t\t\t),\n\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\ttitle: sprintf( __( 'Heading %d' ), targetLevel ),\n\t\t\tisActive,\n\t\t\tonClick: () => onChangeCallback( targetLevel ),\n\t\t};\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ <HeadingLevelIcon level={ value } /> }\n\t\t\tcontrols={ options.map( ( index ) =>\n\t\t\t\tcreateLevelControl( index, value, onChange )\n\t\t\t) }\n\t\t\tlabel={ __( 'Change level' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAMC,cAAc,GAAG,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAE;EAC7CC,OAAO,GAAGF,cAAc;EACxBG,KAAK;EACLC;AACD,CAAC,EAAG;EACH,MAAMC,kBAAkB,GAAGA,CAC1BC,WAAW,EACXC,YAAY,EACZC,gBAAgB,KACZ;IACJ,MAAMC,QAAQ,GAAGH,WAAW,KAAKC,YAAY;IAC7C,OAAO;MACNG,IAAI,eACHX,IAAA,CAACF,gBAAgB;QAChBc,KAAK,EAAGL,WAAa;QACrBM,SAAS,EAAGH;MAAU,CACtB,CACD;MACD;MACAI,KAAK,EAAElB,OAAO,CAAED,EAAE,CAAE,YAAa,CAAC,EAAEY,WAAY,CAAC;MACjDG,QAAQ;MACRK,OAAO,EAAEA,CAAA,KAAMN,gBAAgB,CAAEF,WAAY;IAC9C,CAAC;EACF,CAAC;EAED,oBACCP,IAAA,CAACH,YAAY;IACZc,IAAI,eAAGX,IAAA,CAACF,gBAAgB;MAACc,KAAK,EAAGR;IAAO,CAAE,CAAG;IAC7CY,QAAQ,EAAGb,OAAO,CAACc,GAAG,CAAIC,KAAK,IAC9BZ,kBAAkB,C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