@wordpress/block-editor 12.12.2-next.f8d8eceb.0 → 12.14.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 +3 -1
- package/build/components/block-heading-level-dropdown/index.js +1 -1
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-list/index.js +2 -9
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +16 -3
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +6 -4
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-styles/index.js +0 -8
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +18 -14
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +11 -81
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +56 -0
- package/build/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build/components/block-tools/index.js +48 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/selected-block-tools.js +113 -0
- package/build/components/block-tools/selected-block-tools.js.map +1 -0
- package/build/components/block-tools/use-selected-block-tool-props.js +56 -0
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build/components/editable-text/index.js +1 -2
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/iframe/index.js +4 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/{explorer.js → index.js} +7 -7
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +4 -4
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/index.js +75 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +108 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +18 -34
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +55 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/utils.js +70 -0
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build/components/inserter/media-tab/media-list.js +9 -5
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +15 -12
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +3 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/link-control/index.js +6 -5
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +39 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +16 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +3 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +69 -18
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -14
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +1 -1
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +3 -1
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +45 -0
- package/build/components/rich-text/native/format-edit.js.map +1 -0
- package/build/components/rich-text/native/get-format-colors.native.js +41 -0
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build/components/rich-text/native/index.js +9 -0
- package/build/components/rich-text/native/index.js.map +1 -0
- package/build/components/rich-text/native/index.native.js +1158 -0
- package/build/components/rich-text/native/index.native.js.map +1 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +58 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build/components/rich-text/native/use-format-types.js +111 -0
- package/build/components/rich-text/native/use-format-types.js.map +1 -0
- package/build/components/rich-text/use-paste-handler.js +2 -5
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +10 -10
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +2 -2
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +7 -6
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +16 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +7 -8
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-rename-ui.js +7 -5
- package/build/hooks/block-rename-ui.js.map +1 -1
- package/build/hooks/content-lock-ui.js +5 -5
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +8 -7
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +4 -4
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/duotone.js +14 -22
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/layout.js +90 -86
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +10 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +10 -13
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +30 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +3 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -37
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +18 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +16 -13
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -10
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +16 -3
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +7 -5
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +0 -8
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +17 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +11 -80
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +48 -0
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build-module/components/block-tools/index.js +48 -9
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/selected-block-tools.js +105 -0
- package/build-module/components/block-tools/selected-block-tools.js.map +1 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js +50 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build-module/components/editable-text/index.js +1 -2
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/{explorer.js → index.js} +5 -5
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/index.js +66 -0
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +42 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +100 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build-module/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +7 -20
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +47 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js +58 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build-module/components/inserter/media-tab/media-list.js +9 -5
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +15 -12
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +4 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/link-control/index.js +7 -6
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +39 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +16 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +3 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +69 -17
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -14
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +1 -1
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +3 -1
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +38 -0
- package/build-module/components/rich-text/native/format-edit.js.map +1 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js +34 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build-module/components/rich-text/native/index.js +2 -0
- package/build-module/components/rich-text/native/index.js.map +1 -0
- package/build-module/components/rich-text/native/index.native.js +1148 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +51 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build-module/components/rich-text/native/use-format-types.js +104 -0
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -0
- package/build-module/components/rich-text/use-paste-handler.js +2 -5
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +8 -8
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +2 -2
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +5 -4
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +17 -5
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -6
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-rename-ui.js +5 -3
- package/build-module/hooks/block-rename-ui.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +3 -3
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +6 -5
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +4 -4
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/duotone.js +15 -23
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/layout.js +90 -86
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +11 -10
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +10 -13
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +30 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +4 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +29 -37
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +17 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +15 -13
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +16 -15
- package/build-style/style.css +16 -15
- package/package.json +31 -31
- package/src/components/block-heading-level-dropdown/index.js +1 -1
- package/src/components/block-list/index.js +4 -18
- package/src/components/block-list-appender/index.js +20 -4
- package/src/components/block-quick-navigation/index.js +11 -5
- package/src/components/block-styles/index.js +0 -10
- package/src/components/block-switcher/pattern-transformations-menu.js +20 -14
- package/src/components/block-toolbar/style.scss +8 -0
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-contextual-toolbar.js +11 -134
- package/src/components/block-tools/empty-block-inserter.js +56 -0
- package/src/components/block-tools/index.js +72 -16
- package/src/components/block-tools/selected-block-tools.js +127 -0
- package/src/components/block-tools/style.scss +0 -10
- package/src/components/block-tools/use-selected-block-tool-props.js +66 -0
- package/src/components/editable-text/index.js +1 -8
- package/src/components/iframe/index.js +4 -3
- package/src/components/inserter/block-patterns-explorer/{explorer.js → index.js} +4 -4
- package/src/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +4 -1
- package/src/components/inserter/block-patterns-tab/index.js +118 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +175 -0
- package/src/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +15 -21
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +96 -0
- package/src/components/inserter/block-patterns-tab/utils.js +76 -0
- package/src/components/inserter/media-tab/media-list.js +7 -7
- package/src/components/inserter/media-tab/media-preview.js +27 -22
- package/src/components/inserter/menu.js +4 -5
- package/src/components/link-control/README.md +2 -2
- package/src/components/link-control/index.js +15 -6
- package/src/components/link-control/style.scss +8 -5
- package/src/components/list-view/block-select-button.js +44 -1
- package/src/components/list-view/block.js +11 -11
- package/src/components/list-view/index.js +2 -0
- package/src/components/media-replace-flow/style.scss +2 -2
- package/src/components/navigable-toolbar/index.js +71 -25
- package/src/components/plain-text/README.md +3 -3
- package/src/components/provider/use-block-sync.js +2 -21
- package/src/components/resizable-box-popover/index.js +1 -1
- package/src/components/rich-text/README.md +9 -8
- package/src/components/rich-text/index.js +0 -1
- package/src/components/rich-text/index.native.js +3 -1
- package/src/components/rich-text/native/format-edit.js +44 -0
- package/src/components/rich-text/native/get-format-colors.native.js +54 -0
- package/src/components/rich-text/native/index.js +1 -0
- package/src/components/rich-text/native/index.native.js +1363 -0
- package/src/components/rich-text/native/style.native.scss +28 -0
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +79 -0
- package/src/components/rich-text/native/test/index.native.js +278 -0
- package/src/components/rich-text/native/test/performance/rich-text.native.js +44 -0
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +61 -0
- package/src/components/rich-text/native/use-format-types.js +146 -0
- package/src/components/rich-text/use-paste-handler.js +1 -6
- package/src/components/url-popover/image-url-input-ui.js +1 -0
- package/src/components/writing-flow/use-tab-nav.js +8 -3
- package/src/hooks/align.js +8 -8
- package/src/hooks/align.native.js +2 -2
- package/src/hooks/anchor.js +21 -23
- package/src/hooks/background.js +28 -6
- package/src/hooks/block-hooks.js +20 -16
- package/src/hooks/block-rename-ui.js +6 -4
- package/src/hooks/content-lock-ui.js +3 -3
- package/src/hooks/custom-class-name.js +7 -6
- package/src/hooks/custom-fields.js +5 -5
- package/src/hooks/duotone.js +29 -38
- package/src/hooks/layout.js +114 -105
- package/src/hooks/position.js +8 -21
- package/src/hooks/style.js +17 -31
- package/src/hooks/test/align.js +4 -4
- package/src/hooks/utils.js +33 -1
- package/src/private-apis.js +4 -1
- package/src/store/actions.js +26 -72
- package/src/store/reducer.js +19 -0
- package/src/store/selectors.js +13 -19
- package/build/components/block-tools/selected-block-popover.js +0 -221
- package/build/components/block-tools/selected-block-popover.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build/components/inserter/block-patterns-filter.js.map +0 -1
- package/build/components/inserter/block-patterns-tab.js +0 -270
- package/build/components/inserter/block-patterns-tab.js.map +0 -1
- package/build/store/utils.js +0 -22
- package/build/store/utils.js.map +0 -1
- package/build-module/components/block-tools/selected-block-popover.js +0 -213
- package/build-module/components/block-tools/selected-block-popover.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build-module/components/inserter/block-patterns-filter.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab.js +0 -254
- package/build-module/components/inserter/block-patterns-tab.js.map +0 -1
- package/build-module/store/utils.js +0 -16
- package/build-module/store/utils.js.map +0 -1
- package/src/components/block-tools/selected-block-popover.js +0 -265
- package/src/components/inserter/block-patterns-tab.js +0 -448
- package/src/store/utils.js +0 -12
- /package/src/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 12.
|
|
5
|
+
## 12.14.0 (2023-11-16)
|
|
6
|
+
|
|
7
|
+
## 12.13.0 (2023-11-02)
|
|
6
8
|
|
|
7
9
|
- Deprecated the `useSetting` function in favor of new `useSettings` one that can retrieve multiple settings at once ([#55337](https://github.com/WordPress/gutenberg/pull/55337)).
|
|
8
10
|
|
|
@@ -61,7 +61,7 @@ function HeadingLevelDropdown({
|
|
|
61
61
|
level: targetLevel,
|
|
62
62
|
isPressed: isActive
|
|
63
63
|
}),
|
|
64
|
-
|
|
64
|
+
title: targetLevel === 0 ? (0, _i18n.__)('Paragraph') : (0, _i18n.sprintf)(
|
|
65
65
|
// translators: %s: heading level e.g: "1", "2", "3"
|
|
66
66
|
(0, _i18n.__)('Heading %d'), targetLevel),
|
|
67
67
|
isActive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_headingLevelIcon","_interopRequireDefault","HEADING_LEVELS","POPOVER_PROPS","className","HeadingLevelDropdown","options","value","onChange","_react","createElement","ToolbarDropdownMenu","popoverProps","icon","default","level","label","__","controls","map","targetLevel","isActive","isPressed","sprintf","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 {(newValue:number)=>any} onChange Callback to run when\n * toolbar value is changed.\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\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={ options.map( ( targetLevel ) => {\n\t\t\t\t{\n\t\t\t\t\tconst isActive = targetLevel === value;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ticon: (\n\t\t\t\t\t\t\t<HeadingLevelIcon\n\t\t\t\t\t\t\t\tlevel={ targetLevel }\n\t\t\t\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_headingLevelIcon","_interopRequireDefault","HEADING_LEVELS","POPOVER_PROPS","className","HeadingLevelDropdown","options","value","onChange","_react","createElement","ToolbarDropdownMenu","popoverProps","icon","default","level","label","__","controls","map","targetLevel","isActive","isPressed","title","sprintf","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 {(newValue:number)=>any} onChange Callback to run when\n * toolbar value is changed.\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\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={ options.map( ( targetLevel ) => {\n\t\t\t\t{\n\t\t\t\t\tconst isActive = targetLevel === value;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ticon: (\n\t\t\t\t\t\t\t<HeadingLevelIcon\n\t\t\t\t\t\t\t\tlevel={ targetLevel }\n\t\t\t\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\ttargetLevel === 0\n\t\t\t\t\t\t\t\t? __( 'Paragraph' )\n\t\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\t\t\t\t\t\ttargetLevel\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\tisActive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ACd,IAAAH,QAAE,EAAE,WAAY,CAAC,GACjB,IAAAO,aAAO;UACP;UACA,IAAAP,QAAE,EAAE,YAAa,CAAC,EAClBG,WACA,CAAC;UACLC,QAAQ;UACRI,OAAOA,CAAA,EAAG;YACTjB,QAAQ,CAAEY,WAAY,CAAC;UACxB,CAAC;UACDM,IAAI,EAAE;QACP,CAAC;MACF;IACD,CAAE;EAAG,CACL,CAAC;AAEJ"}
|
|
@@ -33,7 +33,6 @@ var _observeTyping = require("../observe-typing");
|
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
const elementContext = (0, _element.createContext)();
|
|
37
36
|
const IntersectionObserver = (0, _element.createContext)();
|
|
38
37
|
exports.IntersectionObserver = IntersectionObserver;
|
|
39
38
|
const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
|
|
@@ -41,7 +40,6 @@ function Root({
|
|
|
41
40
|
className,
|
|
42
41
|
...settings
|
|
43
42
|
}) {
|
|
44
|
-
const [element, setElement] = (0, _element.useState)();
|
|
45
43
|
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
46
44
|
const {
|
|
47
45
|
isOutlineMode,
|
|
@@ -101,15 +99,11 @@ function Root({
|
|
|
101
99
|
'is-navigate-mode': editorMode === 'navigation'
|
|
102
100
|
})
|
|
103
101
|
}, settings);
|
|
104
|
-
return (0, _react.createElement)(
|
|
105
|
-
value: element
|
|
106
|
-
}, (0, _react.createElement)(IntersectionObserver.Provider, {
|
|
102
|
+
return (0, _react.createElement)(IntersectionObserver.Provider, {
|
|
107
103
|
value: intersectionObserver
|
|
108
104
|
}, (0, _react.createElement)("div", {
|
|
109
105
|
...innerBlocksProps
|
|
110
|
-
})
|
|
111
|
-
ref: setElement
|
|
112
|
-
})));
|
|
106
|
+
}));
|
|
113
107
|
}
|
|
114
108
|
function BlockList(settings) {
|
|
115
109
|
return (0, _react.createElement)(_context.BlockEditContextProvider, {
|
|
@@ -118,7 +112,6 @@ function BlockList(settings) {
|
|
|
118
112
|
...settings
|
|
119
113
|
}));
|
|
120
114
|
}
|
|
121
|
-
BlockList.__unstableElementContext = elementContext;
|
|
122
115
|
function Items({
|
|
123
116
|
placeholder,
|
|
124
117
|
rootClientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_compose","_element","_block","_blockListAppender","_useInBetweenInserter","_store","_layout","_blockSelectionClearer","_innerBlocks","_context","_observeTyping","elementContext","createContext","IntersectionObserver","exports","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","element","setElement","useState","isLargeViewport","useViewportMatch","isOutlineMode","isFocusMode","editorMode","useSelect","select","getSettings","__unstableGetEditorMode","blockEditorStore","outlineMode","focusMode","registry","useRegistry","setBlockVisibility","useDispatch","delayedBlockVisibilityUpdates","useDebounce","useCallback","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","useMemo","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","useInnerBlocksProps","ref","useMergeRefs","useBlockSelectionClearer","useInBetweenInserter","useTypingObserver","classnames","_react","createElement","Provider","value","BlockList","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","__unstableElementContext","Items","placeholder","rootClientId","renderAppender","__experimentalAppenderTagName","layout","defaultLayout","order","selectedBlocks","visibleBlocks","getBlockOrder","getSelectedBlockClientIds","__unstableGetVisibleBlocks","LayoutProvider","map","AsyncModeProvider","key","has","includes","default","length","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\tuseDebounce,\n} from '@wordpress/compose';\nimport {\n\tcreateContext,\n\tuseState,\n\tuseMemo,\n\tuseCallback,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\n\nconst elementContext = createContext();\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst [ element, setElement ] = useState();\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isOutlineMode, isFocusMode, editorMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode,\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: classnames( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode && isLargeViewport,\n\t\t\t\t'is-navigate-mode': editorMode === 'navigation',\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<elementContext.Provider value={ element }>\n\t\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t{ /* Ensure element and layout styles are always at the end of the document */ }\n\t\t\t\t<div ref={ setElement } />\n\t\t\t</IntersectionObserver.Provider>\n\t\t</elementContext.Provider>\n\t);\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nBlockList.__unstableElementContext = elementContext;\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\tconst { order, selectedBlocks, visibleBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\torder: getBlockOrder( rootClientId ),\n\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t<BlockListAppender\n\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t/>\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<AsyncModeProvider value={ false }>\n\t\t\t<Items { ...props } />\n\t\t</AsyncModeProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAKA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require","_data","_compose","_element","_block","_blockListAppender","_useInBetweenInserter","_store","_layout","_blockSelectionClearer","_innerBlocks","_context","_observeTyping","IntersectionObserver","createContext","exports","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","useViewportMatch","isOutlineMode","isFocusMode","editorMode","useSelect","select","getSettings","__unstableGetEditorMode","blockEditorStore","outlineMode","focusMode","registry","useRegistry","setBlockVisibility","useDispatch","delayedBlockVisibilityUpdates","useDebounce","useCallback","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","useMemo","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","useInnerBlocksProps","ref","useMergeRefs","useBlockSelectionClearer","useInBetweenInserter","useTypingObserver","classnames","_react","createElement","Provider","value","BlockList","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","Items","placeholder","rootClientId","renderAppender","__experimentalAppenderTagName","layout","defaultLayout","order","selectedBlocks","visibleBlocks","getBlockOrder","getSelectedBlockClientIds","__unstableGetVisibleBlocks","LayoutProvider","map","AsyncModeProvider","key","has","includes","default","length","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\tuseDebounce,\n} from '@wordpress/compose';\nimport { createContext, useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isOutlineMode, isFocusMode, editorMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode,\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: classnames( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode && isLargeViewport,\n\t\t\t\t'is-navigate-mode': editorMode === 'navigation',\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</IntersectionObserver.Provider>\n\t);\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\tconst { order, selectedBlocks, visibleBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\torder: getBlockOrder( rootClientId ),\n\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t<BlockListAppender\n\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t/>\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<AsyncModeProvider value={ false }>\n\t\t\t<Items { ...props } />\n\t\t</AsyncModeProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAIA,IAAAY,cAAA,GAAAZ,OAAA;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAcO,MAAMa,oBAAoB,GAAG,IAAAC,sBAAa,EAAC,CAAC;AAACC,OAAA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A,EAAC7D,kBAAA,CAAAsF,OAAiB;IACjBE,OAAO,EAAGjB,6BAA+B;IACzCF,YAAY,EAAGA,YAAc;IAC7BC,cAAc,EAAGA;EAAgB,CACjC,CACc,CAAC;AAEnB;AAEO,SAASmB,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,OACC,IAAA9B,MAAA,CAAAC,aAAA,EAACjE,KAAA,CAAAsF,iBAAiB;IAACnB,KAAK,EAAG;EAAO,GACjC,IAAAH,MAAA,CAAAC,aAAA,EAACM,KAAK;IAAA,GAAMuB;EAAK,CAAI,CACH,CAAC;AAEtB"}
|
|
@@ -50,9 +50,6 @@ function useAppender(rootClientId, CustomAppender) {
|
|
|
50
50
|
__unstableGetEditorMode,
|
|
51
51
|
getBlockEditingMode
|
|
52
52
|
} = select(_store.store);
|
|
53
|
-
if (CustomAppender === false) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
53
|
if (!CustomAppender) {
|
|
57
54
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
58
55
|
const isParentSelected = rootClientId === selectedBlockClientId || !rootClientId && !selectedBlockClientId;
|
|
@@ -77,6 +74,22 @@ function BlockListAppender({
|
|
|
77
74
|
renderAppender,
|
|
78
75
|
className,
|
|
79
76
|
tagName: TagName = 'div'
|
|
77
|
+
}) {
|
|
78
|
+
if (renderAppender === false) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return (0, _react.createElement)(BlockListAppenderInner, {
|
|
82
|
+
rootClientId: rootClientId,
|
|
83
|
+
renderAppender: renderAppender,
|
|
84
|
+
className: className,
|
|
85
|
+
tagName: TagName
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function BlockListAppenderInner({
|
|
89
|
+
rootClientId,
|
|
90
|
+
renderAppender,
|
|
91
|
+
className,
|
|
92
|
+
tagName: TagName
|
|
80
93
|
}) {
|
|
81
94
|
const appender = useAppender(rootClientId, renderAppender);
|
|
82
95
|
const isDragOver = (0, _data.useSelect)(select => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_blocks","_defaultBlockAppender","_buttonBlockAppender","_store","DefaultAppender","rootClientId","canInsertDefaultBlock","useSelect","select","blockEditorStore","canInsertBlockType","getDefaultBlockName","_react","createElement","default","className","useAppender","CustomAppender","isVisible","getTemplateLock","getSelectedBlockClientId","__unstableGetEditorMode","getBlockEditingMode","selectedBlockClientId","isParentSelected","BlockListAppender","renderAppender","tagName","TagName","appender","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","classnames","contentEditable","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nfunction useAppender( rootClientId, CustomAppender ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif (
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_blocks","_defaultBlockAppender","_buttonBlockAppender","_store","DefaultAppender","rootClientId","canInsertDefaultBlock","useSelect","select","blockEditorStore","canInsertBlockType","getDefaultBlockName","_react","createElement","default","className","useAppender","CustomAppender","isVisible","getTemplateLock","getSelectedBlockClientId","__unstableGetEditorMode","getBlockEditingMode","selectedBlockClientId","isParentSelected","BlockListAppender","renderAppender","tagName","TagName","BlockListAppenderInner","appender","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","classnames","contentEditable","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nfunction useAppender( rootClientId, CustomAppender ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! CustomAppender ) {\n\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\t\tconst isParentSelected =\n\t\t\t\t\trootClientId === selectedBlockClientId ||\n\t\t\t\t\t( ! rootClientId && ! selectedBlockClientId );\n\t\t\t\tif ( ! isParentSelected ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t__unstableGetEditorMode() === 'zoom-out'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[ rootClientId, CustomAppender ]\n\t);\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn CustomAppender ? (\n\t\t<CustomAppender />\n\t) : (\n\t\t<DefaultAppender rootClientId={ rootClientId } />\n\t);\n}\n\nfunction BlockListAppender( {\n\trootClientId,\n\trenderAppender,\n\tclassName,\n\ttagName: TagName = 'div',\n} ) {\n\tif ( renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockListAppenderInner\n\t\t\trootClientId={ rootClientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\tclassName={ className }\n\t\t\ttagName={ TagName }\n\t\t/>\n\t);\n}\n\nfunction BlockListAppenderInner( {\n\trootClientId,\n\trenderAppender,\n\tclassName,\n\ttagName: TagName,\n} ) {\n\tconst appender = useAppender( rootClientId, renderAppender );\n\tconst isDragOver = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\t// Ideally we should also check for `isDragging` but currently it\n\t\t\t// requires a lot more setup. We can revisit this once we refactor\n\t\t\t// the DnD utility hooks.\n\t\t\treturn (\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\trootClientId === insertionPoint?.rootClientId &&\n\t\t\t\tgetBlockCount( rootClientId ) === 0\n\t\t\t);\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tif ( ! appender ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TagName\n\t\t\t// A `tabIndex` is used on the wrapping `div` element in order to\n\t\t\t// force a focus event to occur when an appender `button` element\n\t\t\t// is clicked. In some browsers (Firefox, Safari), button clicks do\n\t\t\t// not emit a focus event, which could cause this event to propagate\n\t\t\t// unexpectedly. The `tabIndex` ensures that the interaction is\n\t\t\t// captured as a focus, without also adding an extra tab stop.\n\t\t\t//\n\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName={ classnames( 'block-list-appender wp-block', className, {\n\t\t\t\t'is-drag-over': isDragOver,\n\t\t\t} ) }\n\t\t\t// Needed in case the whole editor is content editable (for multi\n\t\t\t// selection). It fixes an edge case where ArrowDown and ArrowRight\n\t\t\t// should collapse the selection to the end of that selection and\n\t\t\t// not into the appender.\n\t\t\tcontentEditable={ false }\n\t\t\t// The appender exists to let you add the first Paragraph before\n\t\t\t// any is inserted. To that end, this appender should visually be\n\t\t\t// presented as a block. That means theme CSS should style it as if\n\t\t\t// it were an empty paragraph block. That means a `wp-block` class to\n\t\t\t// ensure the width is correct, and a [data-block] attribute to ensure\n\t\t\t// the correct margin is applied, especially for classic themes which\n\t\t\t// have commonly targeted that attribute for margins.\n\t\t\tdata-block\n\t\t>\n\t\t\t{ appender }\n\t\t</TagName>\n\t);\n}\n\nexport default BlockListAppender;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,K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AY,IAC7C6B,aAAa,CAAE7B,YAAa,CAAC,KAAK,CAAC;EAErC,CAAC,EACD,CAAEA,YAAY,CACf,CAAC;EAED,IAAK,CAAEyB,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAlB,MAAA,CAAAC,aAAA,EAACe;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;IACAQ,QAAQ,EAAG,CAAC,CAAG;IACfrB,SAAS,EAAG,IAAAsB,mBAAU,EAAE,8BAA8B,EAAEtB,SAAS,EAAE;MAClE,cAAc,EAAEgB;IACjB,CAAE;IACF;IACA;IACA;IACA;IAAA;IACAO,eAAe,EAAG;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACA;EAAU,GAERR,QACM,CAAC;AAEZ;AAAC,IAAAS,QAAA,GAEcd,iBAAiB;AAAAe,OAAA,CAAA1B,OAAA,GAAAyB,QAAA"}
|
|
@@ -63,10 +63,12 @@ function BlockQuickNavigationItem({
|
|
|
63
63
|
return (0, _react.createElement)(_components.Button, {
|
|
64
64
|
isPressed: isSelected,
|
|
65
65
|
onClick: () => selectBlock(clientId)
|
|
66
|
-
}, (0, _react.createElement)(_components.
|
|
67
|
-
justify: "flex-start"
|
|
68
|
-
}, (0, _react.createElement)(_blockIcon.default, {
|
|
66
|
+
}, (0, _react.createElement)(_components.Flex, null, (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_blockIcon.default, {
|
|
69
67
|
icon: icon
|
|
70
|
-
}), (0, _react.createElement)(_components.
|
|
68
|
+
})), (0, _react.createElement)(_components.FlexBlock, {
|
|
69
|
+
style: {
|
|
70
|
+
textAlign: 'left'
|
|
71
|
+
}
|
|
72
|
+
}, (0, _react.createElement)(_components.__experimentalTruncate, null, name))));
|
|
71
73
|
}
|
|
72
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_blocks","_store","_blockIcon","_interopRequireDefault","BlockQuickNavigation","clientIds","length","_react","createElement","__experimentalVStack","spacing","map","clientId","BlockQuickNavigationItem","key","name","icon","isSelected","useSelect","select","getBlockName","getBlockAttributes","isBlockSelected","hasSelectedInnerBlock","blockEditorStore","getBlockType","blocksStore","blockType","attributes","__experimentalGetBlockLabel","selectBlock","useDispatch","Button","isPressed","onClick","
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_blocks","_store","_blockIcon","_interopRequireDefault","BlockQuickNavigation","clientIds","length","_react","createElement","__experimentalVStack","spacing","map","clientId","BlockQuickNavigationItem","key","name","icon","isSelected","useSelect","select","getBlockName","getBlockAttributes","isBlockSelected","hasSelectedInnerBlock","blockEditorStore","getBlockType","blocksStore","blockType","attributes","__experimentalGetBlockLabel","selectBlock","useDispatch","Button","isPressed","onClick","Flex","FlexItem","default","FlexBlock","style","textAlign","__experimentalTruncate"],"sources":["@wordpress/block-editor/src/components/block-quick-navigation/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalVStack as VStack,\n\t__experimentalTruncate as Truncate,\n\tFlex,\n\tFlexBlock,\n\tFlexItem,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetBlockLabel,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\n\nexport default function BlockQuickNavigation( { clientIds } ) {\n\tif ( ! clientIds.length ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<VStack spacing={ 1 }>\n\t\t\t{ clientIds.map( ( clientId ) => (\n\t\t\t\t<BlockQuickNavigationItem\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</VStack>\n\t);\n}\n\nfunction BlockQuickNavigationItem( { clientId } ) {\n\tconst { name, icon, isSelected } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType } = select( blocksStore );\n\n\t\t\tconst blockType = getBlockType( getBlockName( clientId ) );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\n\t\t\treturn {\n\t\t\t\tname:\n\t\t\t\t\tblockType &&\n\t\t\t\t\t__experimentalGetBlockLabel(\n\t\t\t\t\t\tblockType,\n\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t'list-view'\n\t\t\t\t\t),\n\t\t\t\ticon: blockType?.icon,\n\t\t\t\tisSelected:\n\t\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( clientId, /* deep: */ true ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tisPressed={ isSelected }\n\t\t\tonClick={ () => selectBlock( clientId ) }\n\t\t>\n\t\t\t<Flex>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexBlock style={ { textAlign: 'left' } }>\n\t\t\t\t\t<Truncate>{ name }</Truncate>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AArBA;AACA;AACA;;AAeA;AACA;AACA;;AAIe,SAASM,oBAAoBA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC7D,IAAK,CAAEA,SAAS,CAACC,MAAM,EAAG;IACzB,OAAO,IAAI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MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoC,IAAI,QACJ,IAAA5B,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAqC,QAAQ,QACR,IAAA7B,MAAA,CAAAC,aAAA,EAACN,UAAA,CAAAmC,OAAS;IAACrB,IAAI,EAAGA;EAAM,CAAE,CACjB,CAAC,EACX,IAAAT,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAuC,SAAS;IAACC,KAAK,EAAG;MAAEC,SAAS,EAAE;IAAO;EAAG,GACzC,IAAAjC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA0C,sBAAQ,QAAG1B,IAAgB,CAClB,CACN,CACC,CAAC;AAEX"}
|
|
@@ -10,7 +10,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
12
|
var _components = require("@wordpress/components");
|
|
13
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
14
13
|
var _previewPanel = _interopRequireDefault(require("./preview-panel"));
|
|
15
14
|
var _useStylesForBlock = _interopRequireDefault(require("./use-styles-for-block"));
|
|
16
15
|
/**
|
|
@@ -104,11 +103,4 @@ function BlockStyles({
|
|
|
104
103
|
}
|
|
105
104
|
var _default = BlockStyles;
|
|
106
105
|
exports.default = _default;
|
|
107
|
-
BlockStyles.Slot = () => {
|
|
108
|
-
(0, _deprecated.default)('BlockStyles.Slot', {
|
|
109
|
-
version: '6.4',
|
|
110
|
-
since: '6.2'
|
|
111
|
-
});
|
|
112
|
-
return null;
|
|
113
|
-
};
|
|
114
106
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_compose","_components","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_compose","_components","_previewPanel","_useStylesForBlock","noop","BlockStyles","clientId","onSwitch","onHoverClassName","onSelect","stylesToRender","activeStyle","genericPreviewBlock","className","previewClassName","useStylesForBlocks","hoveredStyle","setHoveredStyle","useState","isMobileViewport","useViewportMatch","length","debouncedSetHoveredStyle","debounce","onSelectStylePreview","style","cancel","styleItemHandler","item","_item$name","name","_react","createElement","map","buttonText","label","Button","__next40pxDefaultSize","classnames","key","variant","onMouseEnter","onFocus","onMouseLeave","onBlur","onClick","__experimentalTruncate","numberOfLines","Popover","placement","offset","focusOnMount","default","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { debounce, useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__experimentalTruncate as Truncate,\n\tPopover,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockStylesPreviewPanel from './preview-panel';\nimport useStylesForBlocks from './use-styles-for-block';\n\nconst noop = () => {};\n\n// Block Styles component for the Settings Sidebar.\nfunction BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {\n\tconst {\n\t\tonSelect,\n\t\tstylesToRender,\n\t\tactiveStyle,\n\t\tgenericPreviewBlock,\n\t\tclassName: previewClassName,\n\t} = useStylesForBlocks( {\n\t\tclientId,\n\t\tonSwitch,\n\t} );\n\tconst [ hoveredStyle, setHoveredStyle ] = useState( null );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tif ( ! stylesToRender || stylesToRender.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst debouncedSetHoveredStyle = debounce( setHoveredStyle, 250 );\n\n\tconst onSelectStylePreview = ( style ) => {\n\t\tonSelect( style );\n\t\tonHoverClassName( null );\n\t\tsetHoveredStyle( null );\n\t\tdebouncedSetHoveredStyle.cancel();\n\t};\n\n\tconst styleItemHandler = ( item ) => {\n\t\tif ( hoveredStyle === item ) {\n\t\t\tdebouncedSetHoveredStyle.cancel();\n\t\t\treturn;\n\t\t}\n\t\tdebouncedSetHoveredStyle( item );\n\t\tonHoverClassName( item?.name ?? null );\n\t};\n\n\treturn (\n\t\t<div className=\"block-editor-block-styles\">\n\t\t\t<div className=\"block-editor-block-styles__variants\">\n\t\t\t\t{ stylesToRender.map( ( style ) => {\n\t\t\t\t\tconst buttonText = style.label || style.name;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-block-styles__item',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-active':\n\t\t\t\t\t\t\t\t\t\tactiveStyle.name === style.name,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tkey={ style.name }\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tlabel={ buttonText }\n\t\t\t\t\t\t\tonMouseEnter={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonFocus={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonBlur={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonClick={ () => onSelectStylePreview( style ) }\n\t\t\t\t\t\t\taria-current={ activeStyle.name === style.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-styles__item-text\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ buttonText }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t\t{ hoveredStyle && ! isMobileViewport && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"left-start\"\n\t\t\t\t\toffset={ 20 }\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"block-editor-block-styles__preview-panel\"\n\t\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockStylesPreviewPanel\n\t\t\t\t\t\t\tactiveStyle={ activeStyle }\n\t\t\t\t\t\t\tclassName={ previewClassName }\n\t\t\t\t\t\t\tgenericPreviewBlock={ genericPreviewBlock }\n\t\t\t\t\t\t\tstyle={ hoveredStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default BlockStyles;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAIA,MAAMM,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA,SAASC,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ,GAAGH,IAAI;EAAEI,gBAAgB,GAAGJ;AAAK,CAAC,EAAG;EAC9E,MAAM;IACLK,QAAQ;IACRC,cAAc;IACdC,WAAW;IACXC,mBAAmB;IACnBC,SAAS,EAAEC;EACZ,CAAC,GAAG,IAAAC,0BAAkB,EAAE;IACvBT,QAAQ;IACRC;EACD,CAAE,CAAC;EACH,MAAM,CAAES,YAAY,EAAEC,eAAe,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC1D,MAAMC,gBAAgB,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;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AMd,gBAAgB,CAAEF,KAAM,CAAG;MAChDiB,OAAO,EAAGA,CAAA,KAAMf,gBAAgB,CAAEF,KAAM,CAAG;MAC3CkB,YAAY,EAAGA,CAAA,KAAMhB,gBAAgB,CAAE,IAAK,CAAG;MAC/CiB,MAAM,EAAGA,CAAA,KAAMjB,gBAAgB,CAAE,IAAK,CAAG;MACzCkB,OAAO,EAAGA,CAAA,KAAMrB,oBAAoB,CAAEC,KAAM,CAAG;MAC/C,gBAAed,WAAW,CAACmB,IAAI,KAAKL,KAAK,CAACK;IAAM,GAEhD,IAAAC,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAA6C,sBAAQ;MACRC,aAAa,EAAG,CAAG;MACnBlC,SAAS,EAAC;IAAsC,GAE9CqB,UACO,CACH,CAAC;EAEX,CAAE,CACE,CAAC,EACJlB,YAAY,IAAI,CAAEG,gBAAgB,IACnC,IAAAY,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAA+C,OAAO;IACPC,SAAS,EAAC,YAAY;IACtBC,MAAM,EAAG,EAAI;IACbC,YAAY,EAAG;EAAO,GAEtB,IAAApB,MAAA,CAAAC,aAAA;IACCnB,SAAS,EAAC,0CAA0C;IACpD8B,YAAY,EAAGA,CAAA,KAAMhB,gBAAgB,CAAE,IAAK;EAAG,GAE/C,IAAAI,MAAA,CAAAC,aAAA,EAAC9B,aAAA,CAAAkD,OAAuB;IACvBzC,WAAW,EAAGA,WAAa;IAC3BE,SAAS,EAAGC,gBAAkB;IAC9BF,mBAAmB,EAAGA,mBAAqB;IAC3Ca,KAAK,EAAGT;EAAc,CACtB,CACG,CACG,CAEN,CAAC;AAER;AAAC,IAAAqC,QAAA,GAEchD,WAAW;AAAAiD,OAAA,CAAAF,OAAA,GAAAC,QAAA"}
|
|
@@ -13,6 +13,7 @@ var _icons = require("@wordpress/icons");
|
|
|
13
13
|
var _components = require("@wordpress/components");
|
|
14
14
|
var _blockPreview = _interopRequireDefault(require("../block-preview"));
|
|
15
15
|
var _useTransformedPatterns = _interopRequireDefault(require("./use-transformed-patterns"));
|
|
16
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
16
17
|
/**
|
|
17
18
|
* WordPress dependencies
|
|
18
19
|
*/
|
|
@@ -21,6 +22,11 @@ var _useTransformedPatterns = _interopRequireDefault(require("./use-transformed-
|
|
|
21
22
|
* Internal dependencies
|
|
22
23
|
*/
|
|
23
24
|
|
|
25
|
+
const {
|
|
26
|
+
CompositeV2: Composite,
|
|
27
|
+
CompositeItemV2: CompositeItem,
|
|
28
|
+
useCompositeStoreV2: useCompositeStore
|
|
29
|
+
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
24
30
|
function PatternTransformationsMenu({
|
|
25
31
|
blocks,
|
|
26
32
|
patterns: statePatterns,
|
|
@@ -64,36 +70,34 @@ function BlockPatternsList({
|
|
|
64
70
|
patterns,
|
|
65
71
|
onSelect
|
|
66
72
|
}) {
|
|
67
|
-
const composite = (
|
|
68
|
-
return (0, _react.createElement)(
|
|
69
|
-
|
|
73
|
+
const composite = useCompositeStore();
|
|
74
|
+
return (0, _react.createElement)(Composite, {
|
|
75
|
+
store: composite,
|
|
70
76
|
role: "listbox",
|
|
71
77
|
className: "block-editor-block-switcher__preview-patterns-container",
|
|
72
78
|
"aria-label": (0, _i18n.__)('Patterns list')
|
|
73
79
|
}, patterns.map(pattern => (0, _react.createElement)(BlockPattern, {
|
|
74
80
|
key: pattern.name,
|
|
75
81
|
pattern: pattern,
|
|
76
|
-
onSelect: onSelect
|
|
77
|
-
composite: composite
|
|
82
|
+
onSelect: onSelect
|
|
78
83
|
})));
|
|
79
84
|
}
|
|
80
85
|
function BlockPattern({
|
|
81
86
|
pattern,
|
|
82
|
-
onSelect
|
|
83
|
-
composite
|
|
87
|
+
onSelect
|
|
84
88
|
}) {
|
|
85
89
|
// TODO check pattern/preview width...
|
|
86
90
|
const baseClassName = 'block-editor-block-switcher__preview-patterns-container';
|
|
87
91
|
const descriptionId = (0, _compose.useInstanceId)(BlockPattern, `${baseClassName}-list__item-description`);
|
|
88
92
|
return (0, _react.createElement)("div", {
|
|
89
93
|
className: `${baseClassName}-list__list-item`
|
|
90
|
-
}, (0, _react.createElement)(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
}, (0, _react.createElement)(CompositeItem, {
|
|
95
|
+
render: (0, _react.createElement)("div", {
|
|
96
|
+
role: "option",
|
|
97
|
+
"aria-label": pattern.title,
|
|
98
|
+
"aria-describedby": pattern.description ? descriptionId : undefined,
|
|
99
|
+
className: `${baseClassName}-list__item`
|
|
100
|
+
}),
|
|
97
101
|
onClick: () => onSelect(pattern.transformedBlocks)
|
|
98
102
|
}, (0, _react.createElement)(_blockPreview.default, {
|
|
99
103
|
blocks: pattern.transformedBlocks,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_compose","_icons","_components","_blockPreview","_interopRequireDefault","_useTransformedPatterns","PatternTransformationsMenu","blocks","patterns","statePatterns","onSelect","showTransforms","setShowTransforms","useState","useTransformedPatterns","length","_react","createElement","MenuGroup","className","PreviewPatternsPopover","MenuItem","onClick","event","preventDefault","icon","chevronRight","__","Popover","position","BlockPatternsList","composite","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_element","_compose","_icons","_components","_blockPreview","_interopRequireDefault","_useTransformedPatterns","_lockUnlock","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","unlock","componentsPrivateApis","PatternTransformationsMenu","blocks","patterns","statePatterns","onSelect","showTransforms","setShowTransforms","useState","useTransformedPatterns","length","_react","createElement","MenuGroup","className","PreviewPatternsPopover","MenuItem","onClick","event","preventDefault","icon","chevronRight","__","Popover","position","BlockPatternsList","composite","store","role","map","pattern","BlockPattern","key","name","baseClassName","descriptionId","useInstanceId","render","title","description","undefined","transformedBlocks","default","viewportWidth","VisuallyHidden","id","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-switcher/pattern-transformations-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { chevronRight } from '@wordpress/icons';\n\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPopover,\n\tVisuallyHidden,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport useTransformedPatterns from './use-transformed-patterns';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nfunction PatternTransformationsMenu( {\n\tblocks,\n\tpatterns: statePatterns,\n\tonSelect,\n} ) {\n\tconst [ showTransforms, setShowTransforms ] = useState( false );\n\tconst patterns = useTransformedPatterns( statePatterns, blocks );\n\tif ( ! patterns.length ) return null;\n\n\treturn (\n\t\t<MenuGroup className=\"block-editor-block-switcher__pattern__transforms__menugroup\">\n\t\t\t{ showTransforms && (\n\t\t\t\t<PreviewPatternsPopover\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<MenuItem\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetShowTransforms( ! showTransforms );\n\t\t\t\t} }\n\t\t\t\ticon={ chevronRight }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</MenuItem>\n\t\t</MenuGroup>\n\t);\n}\n\nfunction PreviewPatternsPopover( { patterns, onSelect } ) {\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__popover__preview__parent\">\n\t\t\t<div className=\"block-editor-block-switcher__popover__preview__container\">\n\t\t\t\t<Popover\n\t\t\t\t\tclassName=\"block-editor-block-switcher__preview__popover\"\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"block-editor-block-switcher__preview is-pattern-list-preview\">\n\t\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternsList( { patterns, onSelect } ) {\n\tconst composite = useCompositeStore();\n\treturn (\n\t\t<Composite\n\t\t\tstore={ composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-switcher__preview-patterns-container\"\n\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t>\n\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t<BlockPattern\n\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nfunction BlockPattern( { pattern, onSelect } ) {\n\t// TODO check pattern/preview width...\n\tconst baseClassName =\n\t\t'block-editor-block-switcher__preview-patterns-container';\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }-list__item-description`\n\t);\n\treturn (\n\t\t<div className={ `${ baseClassName }-list__list-item` }>\n\t\t\t<CompositeItem\n\t\t\t\trender={\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={ `${ baseClassName }-list__item` }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonClick={ () => onSelect( pattern.transformedBlocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ pattern.transformedBlocks }\n\t\t\t\t\tviewportWidth={ pattern.viewportWidth || 500 }\n\t\t\t\t/>\n\t\t\t\t<div className={ `${ baseClassName }-list__item-title` }>\n\t\t\t\t\t{ pattern.title }\n\t\t\t\t</div>\n\t\t\t</CompositeItem>\n\t\t\t{ !! pattern.description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ pattern.description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternTransformationsMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAWA,IAAAK,aAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AArBA;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAM;EACLS,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAEC,aAAa;EAC9BC,mBAAmB,EAAEC;AACtB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAEnC,SAASC,0BAA0BA,CAAE;EACpCC,MAAM;EACNC,QAAQ,EAAEC,aAAa;EACvBC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC/D,MAAML,QAAQ,GAAG,IAAAM,+BAAsB,EAAEL,aAAa,EAAEF,MAAO,CAAC;EAChE,IAAK,CAAEC,QAAQ,CAACO,MAAM,EAAG,OAAO,IAAI;EAEpC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAAyB,SAAS;IAACC,SAAS,EAAC;EAA6D,GAC/ER,cAAc,IACf,IAAAK,MAAA,CAAAC,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AAL,OAAA,GAAAI,QAAA"}
|
|
@@ -10,7 +10,7 @@ var _element = require("@wordpress/element");
|
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
12
12
|
var _insertionPoint = _interopRequireWildcard(require("./insertion-point"));
|
|
13
|
-
var
|
|
13
|
+
var _selectedBlockTools = _interopRequireDefault(require("./selected-block-tools"));
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
/**
|
|
@@ -38,7 +38,7 @@ function BlockToolsBackCompat({
|
|
|
38
38
|
});
|
|
39
39
|
return (0, _react.createElement)(_insertionPoint.default, {
|
|
40
40
|
__unstablePopoverSlot: "block-toolbar"
|
|
41
|
-
}, (0, _react.createElement)(
|
|
41
|
+
}, (0, _react.createElement)(_selectedBlockTools.default, {
|
|
42
42
|
__unstablePopoverSlot: "block-toolbar"
|
|
43
43
|
}), children);
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_deprecated","_interopRequireDefault","_insertionPoint","_interopRequireWildcard","
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_deprecated","_interopRequireDefault","_insertionPoint","_interopRequireWildcard","_selectedBlockTools","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BlockToolsBackCompat","children","openRef","useContext","InsertionPointOpenRef","isDisabled","Disabled","Context","deprecated","alternative","since","version","_react","createElement","__unstablePopoverSlot"],"sources":["@wordpress/block-editor/src/components/block-tools/back-compat.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InsertionPoint, { InsertionPointOpenRef } from './insertion-point';\nimport BlockPopover from './selected-block-tools';\n\nexport default function BlockToolsBackCompat( { children } ) {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isDisabled = useContext( Disabled.Context );\n\n\t// If context is set, `BlockTools` is a parent component.\n\tif ( openRef || isDisabled ) {\n\t\treturn children;\n\t}\n\n\tdeprecated( 'wp.components.Popover.Slot name=\"block-toolbar\"', {\n\t\talternative: 'wp.blockEditor.BlockTools',\n\t\tsince: '5.8',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<InsertionPoint __unstablePopoverSlot=\"block-toolbar\">\n\t\t\t<BlockPopover __unstablePopoverSlot=\"block-toolbar\" />\n\t\t\t{ children }\n\t\t</InsertionPoint>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,mB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