@wordpress/block-editor 14.9.0 → 14.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +40 -0
- package/build/components/audio-player/index.native.js +1 -1
- package/build/components/audio-player/index.native.js.map +1 -1
- package/build/components/background-image-control/index.js +4 -0
- package/build/components/background-image-control/index.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-card/index.js +45 -8
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-edit/edit.js +147 -10
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-list/index.js +1 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.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-settings-menu/block-settings-dropdown.js +5 -8
- package/build/components/block-settings-menu/block-settings-dropdown.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-tools/zoom-out-mode-inserters.js +19 -6
- package/build/components/block-tools/zoom-out-mode-inserters.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-gradients/dropdown.js +51 -11
- package/build/components/colors-gradients/dropdown.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/date-format-picker/index.js +7 -16
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +9 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +10 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/color-panel.js +3 -0
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +1 -1
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +9 -0
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/utils.js +12 -1
- package/build/components/grid/utils.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.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-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 +4 -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/category-tabs/index.js +1 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/index.js +6 -15
- package/build/components/inserter/index.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/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/media-placeholder/index.js +2 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +26 -26
- package/build/components/media-replace-flow/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-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 +1 -1
- package/build/components/responsive-block-control/index.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/index.js +2 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +2 -1
- package/build/components/use-block-drop-zone/index.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 +15 -14
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/border.js +3 -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/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 +0 -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/style.js +7 -7
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +12 -1
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/store/private-actions.js +1 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +11 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +93 -12
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +6 -8
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +95 -0
- package/build/utils/block-bindings.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/background-image-control/index.js +5 -1
- package/build-module/components/background-image-control/index.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-card/index.js +45 -8
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-edit/edit.js +148 -11
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -1
- package/build-module/components/block-list/use-block-props/index.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-settings-menu/block-settings-dropdown.js +5 -8
- package/build-module/components/block-settings-menu/block-settings-dropdown.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-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/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-gradients/dropdown.js +51 -11
- package/build-module/components/colors-gradients/dropdown.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/date-format-picker/index.js +7 -16
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +8 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +10 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -0
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +1 -1
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +9 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/utils.js +12 -1
- package/build-module/components/grid/utils.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/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-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 +4 -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/category-tabs/index.js +1 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/index.js +6 -15
- package/build-module/components/inserter/index.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/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/media-placeholder/index.js +3 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +28 -28
- package/build-module/components/media-replace-flow/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-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 +1 -1
- package/build-module/components/responsive-block-control/index.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/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +2 -1
- package/build-module/components/use-block-drop-zone/index.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 +13 -12
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/border.js +3 -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/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 +0 -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/style.js +7 -7
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +12 -2
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +1 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/store/private-actions.js +1 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +93 -12
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +6 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +90 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/style-rtl.css +27 -9
- package/build-style/style.css +27 -9
- package/package.json +33 -33
- 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-list/index.js +2 -7
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/zoom-out-separator.js +30 -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-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 +5 -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 +2 -1
- package/src/components/dimensions-tool/stories/index.story.js +2 -1
- package/src/components/dimensions-tool/stories/scale-tool.story.js +2 -1
- package/src/components/dimensions-tool/stories/width-height-tool.story.js +2 -1
- 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 +3 -0
- 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 +2 -2
- 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/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/category-tabs/index.js +3 -2
- package/src/components/inserter/index.js +1 -13
- package/src/components/inserter/quick-inserter.js +2 -25
- 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/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/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 +36 -8
- 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/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/stories/index.story.js +86 -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 +13 -7
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +2 -1
- package/src/hooks/typography.js +6 -6
- package/src/hooks/use-zoom-out.js +10 -2
- 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 +6 -8
- package/src/store/test/private-selectors.js +53 -9
- package/src/store/test/reducer.js +172 -166
- package/src/store/test/selectors.js +23 -0
- package/src/utils/block-bindings.js +95 -0
- package/tsconfig.json +2 -5
- package/build/hooks/use-bindings-attributes.js +0 -262
- package/build/hooks/use-bindings-attributes.js.map +0 -1
- package/build-module/hooks/use-bindings-attributes.js +0 -253
- package/build-module/hooks/use-bindings-attributes.js.map +0 -1
- package/src/hooks/use-bindings-attributes.js +0 -322
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useState } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import DateFormatPicker from '../';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'BlockEditor/DateFormatPicker',
|
|
13
|
+
component: DateFormatPicker,
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
canvas: { sourceState: 'shown' },
|
|
17
|
+
description: {
|
|
18
|
+
component:
|
|
19
|
+
'The `DateFormatPicker` component enables users to configure their preferred *date format*. This determines how dates are displayed.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
defaultFormat: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description:
|
|
27
|
+
'The date format that will be used if the user selects "Default".',
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: 'string' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
format: {
|
|
33
|
+
control: { type: null },
|
|
34
|
+
description:
|
|
35
|
+
'The selected date format. If `null`, _Default_ is selected.',
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: 'string | null' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
onChange: {
|
|
41
|
+
action: 'onChange',
|
|
42
|
+
control: { type: null },
|
|
43
|
+
description:
|
|
44
|
+
'Called when a selection is made. If `null`, _Default_ is selected.',
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: 'function' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Default = {
|
|
53
|
+
args: {
|
|
54
|
+
defaultFormat: 'M j, Y',
|
|
55
|
+
},
|
|
56
|
+
render: function Template( { onChange, ...args } ) {
|
|
57
|
+
const [ format, setFormat ] = useState();
|
|
58
|
+
return (
|
|
59
|
+
<DateFormatPicker
|
|
60
|
+
{ ...args }
|
|
61
|
+
onChange={ ( ...changeArgs ) => {
|
|
62
|
+
onChange( ...changeArgs );
|
|
63
|
+
setFormat( ...changeArgs );
|
|
64
|
+
} }
|
|
65
|
+
format={ format }
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import AspectRatioTool from '../aspect-ratio-tool';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title: 'BlockEditor
|
|
16
|
+
title: 'BlockEditor/DimensionsTool/AspectRatioTool',
|
|
17
17
|
component: AspectRatioTool,
|
|
18
|
+
tags: [ 'status-private' ],
|
|
18
19
|
argTypes: {
|
|
19
20
|
panelId: { control: false },
|
|
20
21
|
onChange: { action: 'changed' },
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import DimensionsTool from '..';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title: 'BlockEditor
|
|
16
|
+
title: 'BlockEditor/DimensionsTool/DimensionsTool',
|
|
17
17
|
component: DimensionsTool,
|
|
18
|
+
tags: [ 'status-private' ],
|
|
18
19
|
argTypes: {
|
|
19
20
|
panelId: { control: false },
|
|
20
21
|
onChange: { action: 'changed' },
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import ScaleTool from '../scale-tool';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title: 'BlockEditor
|
|
16
|
+
title: 'BlockEditor/DimensionsTool/ScaleTool',
|
|
17
17
|
component: ScaleTool,
|
|
18
|
+
tags: [ 'status-private' ],
|
|
18
19
|
argTypes: {
|
|
19
20
|
panelId: { control: false },
|
|
20
21
|
onChange: { action: 'changed' },
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
import WidthHeightTool from '../width-height-tool';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title: 'BlockEditor
|
|
16
|
+
title: 'BlockEditor/DimensionsTool/WidthHeightTool',
|
|
17
17
|
component: WidthHeightTool,
|
|
18
|
+
tags: [ 'status-private' ],
|
|
18
19
|
argTypes: {
|
|
19
20
|
panelId: { control: false },
|
|
20
21
|
onChange: { action: 'changed' },
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { CustomSelectControl } from '@wordpress/components';
|
|
5
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
6
|
import { useMemo } from '@wordpress/element';
|
|
6
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
7
8
|
|
|
@@ -147,6 +148,20 @@ export default function FontAppearanceControl( props ) {
|
|
|
147
148
|
);
|
|
148
149
|
};
|
|
149
150
|
|
|
151
|
+
if (
|
|
152
|
+
! __next40pxDefaultSize &&
|
|
153
|
+
( otherProps.size === undefined || otherProps.size === 'default' )
|
|
154
|
+
) {
|
|
155
|
+
deprecated(
|
|
156
|
+
`36px default size for wp.blockEditor.__experimentalFontAppearanceControl`,
|
|
157
|
+
{
|
|
158
|
+
since: '6.8',
|
|
159
|
+
version: '7.1',
|
|
160
|
+
hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
150
165
|
return (
|
|
151
166
|
hasStylesOrWeights && (
|
|
152
167
|
<CustomSelectControl
|
|
@@ -58,12 +58,28 @@ export default function FontFamilyControl( {
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
if (
|
|
62
|
+
! __next40pxDefaultSize &&
|
|
63
|
+
( props.size === undefined || props.size === 'default' )
|
|
64
|
+
) {
|
|
65
|
+
deprecated(
|
|
66
|
+
`36px default size for wp.blockEditor.__experimentalFontFamilyControl`,
|
|
67
|
+
{
|
|
68
|
+
since: '6.8',
|
|
69
|
+
version: '7.1',
|
|
70
|
+
hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const selectedValue =
|
|
76
|
+
options.find( ( option ) => option.key === value ) ?? '';
|
|
61
77
|
return (
|
|
62
78
|
<CustomSelectControl
|
|
63
79
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
64
80
|
__shouldNotWarnDeprecated36pxSize
|
|
65
81
|
label={ __( 'Font' ) }
|
|
66
|
-
value={
|
|
82
|
+
value={ selectedValue }
|
|
67
83
|
onChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }
|
|
68
84
|
options={ options }
|
|
69
85
|
className={ clsx( 'block-editor-font-family-control', className, {
|
|
@@ -855,7 +855,7 @@ describe( 'global styles renderer', () => {
|
|
|
855
855
|
|
|
856
856
|
it( 'should return block selectors data with old experimental selectors', () => {
|
|
857
857
|
const imageSupports = {
|
|
858
|
-
|
|
858
|
+
__experimentalBorder: {
|
|
859
859
|
radius: true,
|
|
860
860
|
__experimentalSelector: 'img, .crop-area',
|
|
861
861
|
},
|
|
@@ -45,7 +45,7 @@ import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights
|
|
|
45
45
|
* @param {Preset} preset
|
|
46
46
|
* @param {Object} settings
|
|
47
47
|
* @param {boolean|TypographySettings} settings.typography.fluid Whether fluid typography is enabled, and, optionally, fluid font size options.
|
|
48
|
-
* @param {Object
|
|
48
|
+
* @param {?Object} settings.typography.layout Layout options.
|
|
49
49
|
*
|
|
50
50
|
* @return {string|*} A font-size value or the value of preset.size.
|
|
51
51
|
*/
|
|
@@ -47,7 +47,7 @@ const ELEMENT_CLASS_NAMES = {
|
|
|
47
47
|
// List of block support features that can have their related styles
|
|
48
48
|
// generated under their own feature level selector rather than the block's.
|
|
49
49
|
const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {
|
|
50
|
-
|
|
50
|
+
__experimentalBorder: 'border',
|
|
51
51
|
color: 'color',
|
|
52
52
|
spacing: 'spacing',
|
|
53
53
|
typography: 'typography',
|
|
@@ -624,7 +624,7 @@ function pickStyleKeys( treeToPickFrom ) {
|
|
|
624
624
|
// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it
|
|
625
625
|
const clonedEntries = pickedEntries.map( ( [ key, style ] ) => [
|
|
626
626
|
key,
|
|
627
|
-
|
|
627
|
+
JSON.parse( JSON.stringify( style ) ),
|
|
628
628
|
] );
|
|
629
629
|
return Object.fromEntries( clonedEntries );
|
|
630
630
|
}
|
|
@@ -62,6 +62,17 @@ const GridVisualizerGrid = forwardRef(
|
|
|
62
62
|
observer.observe( element );
|
|
63
63
|
observers.push( observer );
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
const mutationObserver = new window.MutationObserver( () => {
|
|
67
|
+
setGridInfo( getGridInfo( gridElement ) );
|
|
68
|
+
} );
|
|
69
|
+
mutationObserver.observe( gridElement, {
|
|
70
|
+
attributeFilter: [ 'style', 'class' ],
|
|
71
|
+
childList: true,
|
|
72
|
+
subtree: true,
|
|
73
|
+
} );
|
|
74
|
+
observers.push( mutationObserver );
|
|
75
|
+
|
|
65
76
|
return () => {
|
|
66
77
|
for ( const observer of observers ) {
|
|
67
78
|
observer.disconnect();
|
|
@@ -160,6 +160,21 @@ export function getGridInfo( gridElement ) {
|
|
|
160
160
|
gridElement,
|
|
161
161
|
'grid-template-rows'
|
|
162
162
|
);
|
|
163
|
+
const borderTopWidth = getComputedCSS( gridElement, 'border-top-width' );
|
|
164
|
+
const borderRightWidth = getComputedCSS(
|
|
165
|
+
gridElement,
|
|
166
|
+
'border-right-width'
|
|
167
|
+
);
|
|
168
|
+
const borderBottomWidth = getComputedCSS(
|
|
169
|
+
gridElement,
|
|
170
|
+
'border-bottom-width'
|
|
171
|
+
);
|
|
172
|
+
const borderLeftWidth = getComputedCSS( gridElement, 'border-left-width' );
|
|
173
|
+
const paddingTop = getComputedCSS( gridElement, 'padding-top' );
|
|
174
|
+
const paddingRight = getComputedCSS( gridElement, 'padding-right' );
|
|
175
|
+
const paddingBottom = getComputedCSS( gridElement, 'padding-bottom' );
|
|
176
|
+
const paddingLeft = getComputedCSS( gridElement, 'padding-left' );
|
|
177
|
+
|
|
163
178
|
const numColumns = gridTemplateColumns.split( ' ' ).length;
|
|
164
179
|
const numRows = gridTemplateRows.split( ' ' ).length;
|
|
165
180
|
const numItems = numColumns * numRows;
|
|
@@ -172,7 +187,10 @@ export function getGridInfo( gridElement ) {
|
|
|
172
187
|
gridTemplateColumns,
|
|
173
188
|
gridTemplateRows,
|
|
174
189
|
gap: getComputedCSS( gridElement, 'gap' ),
|
|
175
|
-
|
|
190
|
+
paddingTop: `calc(${ paddingTop } + ${ borderTopWidth })`,
|
|
191
|
+
paddingRight: `calc(${ paddingRight } + ${ borderRightWidth })`,
|
|
192
|
+
paddingBottom: `calc(${ paddingBottom } + ${ borderBottomWidth })`,
|
|
193
|
+
paddingLeft: `calc(${ paddingLeft } + ${ borderLeftWidth })`,
|
|
176
194
|
},
|
|
177
195
|
};
|
|
178
196
|
}
|
|
@@ -192,7 +192,7 @@ function Iframe( {
|
|
|
192
192
|
// Appending a hash to the current URL will not reload the
|
|
193
193
|
// page. This is useful for e.g. footnotes.
|
|
194
194
|
const href = event.target.getAttribute( 'href' );
|
|
195
|
-
if ( href
|
|
195
|
+
if ( href?.startsWith( '#' ) ) {
|
|
196
196
|
iFrameDocument.defaultView.location.hash =
|
|
197
197
|
href.slice( 1 );
|
|
198
198
|
}
|
|
@@ -7,7 +7,7 @@ import fastDeepEqual from 'fast-deep-equal/es6';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useRef, useLayoutEffect } from '@wordpress/element';
|
|
10
|
-
import {
|
|
10
|
+
import { useRegistry } from '@wordpress/data';
|
|
11
11
|
import { synchronizeBlocksWithTemplate } from '@wordpress/blocks';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -42,14 +42,7 @@ export default function useInnerBlockTemplateSync(
|
|
|
42
42
|
) {
|
|
43
43
|
// Instead of adding a useSelect mapping here, please add to the useSelect
|
|
44
44
|
// mapping in InnerBlocks! Every subscription impacts performance.
|
|
45
|
-
|
|
46
|
-
const {
|
|
47
|
-
getBlocks,
|
|
48
|
-
getSelectedBlocksInitialCaretPosition,
|
|
49
|
-
isBlockSelected,
|
|
50
|
-
} = useSelect( blockEditorStore );
|
|
51
|
-
const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
52
|
-
useDispatch( blockEditorStore );
|
|
45
|
+
const registry = useRegistry();
|
|
53
46
|
|
|
54
47
|
// Maintain a reference to the previous value so we can do a deep equality check.
|
|
55
48
|
const existingTemplateRef = useRef( null );
|
|
@@ -57,6 +50,14 @@ export default function useInnerBlockTemplateSync(
|
|
|
57
50
|
useLayoutEffect( () => {
|
|
58
51
|
let isCancelled = false;
|
|
59
52
|
|
|
53
|
+
const {
|
|
54
|
+
getBlocks,
|
|
55
|
+
getSelectedBlocksInitialCaretPosition,
|
|
56
|
+
isBlockSelected,
|
|
57
|
+
} = registry.select( blockEditorStore );
|
|
58
|
+
const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
59
|
+
registry.dispatch( blockEditorStore );
|
|
60
|
+
|
|
60
61
|
// There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate
|
|
61
62
|
// The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),
|
|
62
63
|
// we need to schedule this one in a microtask as well.
|
|
@@ -110,5 +111,11 @@ export default function useInnerBlockTemplateSync(
|
|
|
110
111
|
return () => {
|
|
111
112
|
isCancelled = true;
|
|
112
113
|
};
|
|
113
|
-
}, [
|
|
114
|
+
}, [
|
|
115
|
+
template,
|
|
116
|
+
templateLock,
|
|
117
|
+
clientId,
|
|
118
|
+
registry,
|
|
119
|
+
templateInsertUpdatesSelection,
|
|
120
|
+
] );
|
|
114
121
|
}
|
|
@@ -14,9 +14,8 @@ import { usePatternCategories } from '../block-patterns-tab/use-pattern-categori
|
|
|
14
14
|
|
|
15
15
|
function PatternsExplorer( { initialCategory, rootClientId } ) {
|
|
16
16
|
const [ searchValue, setSearchValue ] = useState( '' );
|
|
17
|
-
const [ selectedCategory, setSelectedCategory ] =
|
|
18
|
-
initialCategory
|
|
19
|
-
);
|
|
17
|
+
const [ selectedCategory, setSelectedCategory ] =
|
|
18
|
+
useState( initialCategory );
|
|
20
19
|
|
|
21
20
|
const patternCategories = usePatternCategories( rootClientId );
|
|
22
21
|
|
|
@@ -70,7 +70,9 @@ function BlockPatternsTab( {
|
|
|
70
70
|
) }
|
|
71
71
|
{ showPatternsExplorer && (
|
|
72
72
|
<PatternsExplorerModal
|
|
73
|
-
initialCategory={
|
|
73
|
+
initialCategory={
|
|
74
|
+
selectedCategory?.name || categories[ 0 ]?.name
|
|
75
|
+
}
|
|
74
76
|
patternCategories={ categories }
|
|
75
77
|
onModalClose={ () => setShowPatternsExplorer( false ) }
|
|
76
78
|
rootClientId={ rootClientId }
|
|
@@ -69,19 +69,19 @@ export function PatternCategoryPreviews( {
|
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if ( category.name === allPatternsCategory
|
|
72
|
+
if ( category.name === allPatternsCategory?.name ) {
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
if (
|
|
77
|
-
category.name === myPatternsCategory
|
|
77
|
+
category.name === myPatternsCategory?.name &&
|
|
78
78
|
pattern.type === INSERTER_PATTERN_TYPES.user
|
|
79
79
|
) {
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (
|
|
84
|
-
category.name === starterPatternsCategory
|
|
84
|
+
category.name === starterPatternsCategory?.name &&
|
|
85
85
|
pattern.blockTypes?.includes( 'core/post-content' )
|
|
86
86
|
) {
|
|
87
87
|
return true;
|
|
@@ -149,7 +149,7 @@ export function PatternCategoryPreviews( {
|
|
|
149
149
|
level={ 4 }
|
|
150
150
|
as="div"
|
|
151
151
|
>
|
|
152
|
-
{ category
|
|
152
|
+
{ category?.label }
|
|
153
153
|
</Heading>
|
|
154
154
|
</FlexBlock>
|
|
155
155
|
<PatternsFilter
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
const getShouldDisableSyncFilter = ( sourceFilter ) =>
|
|
26
26
|
sourceFilter !== 'all' && sourceFilter !== 'user';
|
|
27
27
|
const getShouldHideSourcesFilter = ( category ) => {
|
|
28
|
-
return category
|
|
28
|
+
return category?.name === myPatternsCategory.name;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const PATTERN_SOURCE_MENU_OPTIONS = [
|
|
@@ -60,7 +60,7 @@ export function PatternsFilter( {
|
|
|
60
60
|
// the user may be confused when switching to another category if the haven't explicity set
|
|
61
61
|
// this filter themselves.
|
|
62
62
|
const currentPatternSourceFilter =
|
|
63
|
-
category
|
|
63
|
+
category?.name === myPatternsCategory.name
|
|
64
64
|
? INSERTER_PATTERN_TYPES.user
|
|
65
65
|
: patternSourceFilter;
|
|
66
66
|
|
|
@@ -64,9 +64,10 @@ function CategoryTabs( {
|
|
|
64
64
|
<Tabs.Tab
|
|
65
65
|
key={ category.name }
|
|
66
66
|
tabId={ category.name }
|
|
67
|
-
aria-label={ category.label }
|
|
68
67
|
aria-current={
|
|
69
|
-
category === selectedCategory
|
|
68
|
+
category.name === selectedCategory?.name
|
|
69
|
+
? 'true'
|
|
70
|
+
: undefined
|
|
70
71
|
}
|
|
71
72
|
>
|
|
72
73
|
{ category.label }
|
|
@@ -29,7 +29,6 @@ const defaultRenderToggle = ( {
|
|
|
29
29
|
blockTitle,
|
|
30
30
|
hasSingleBlockType,
|
|
31
31
|
toggleProps = {},
|
|
32
|
-
prioritizePatterns,
|
|
33
32
|
} ) => {
|
|
34
33
|
const {
|
|
35
34
|
as: Wrapper = Button,
|
|
@@ -45,8 +44,6 @@ const defaultRenderToggle = ( {
|
|
|
45
44
|
_x( 'Add %s', 'directly add the only allowed block' ),
|
|
46
45
|
blockTitle
|
|
47
46
|
);
|
|
48
|
-
} else if ( ! label && prioritizePatterns ) {
|
|
49
|
-
label = __( 'Add pattern' );
|
|
50
47
|
} else if ( ! label ) {
|
|
51
48
|
label = _x( 'Add block', 'Generic label for block inserter button' );
|
|
52
49
|
}
|
|
@@ -63,6 +60,7 @@ const defaultRenderToggle = ( {
|
|
|
63
60
|
|
|
64
61
|
return (
|
|
65
62
|
<Wrapper
|
|
63
|
+
__next40pxDefaultSize={ toggleProps.as ? undefined : true }
|
|
66
64
|
icon={ plus }
|
|
67
65
|
label={ label }
|
|
68
66
|
tooltipPosition="bottom"
|
|
@@ -113,7 +111,6 @@ class Inserter extends Component {
|
|
|
113
111
|
toggleProps,
|
|
114
112
|
hasItems,
|
|
115
113
|
renderToggle = defaultRenderToggle,
|
|
116
|
-
prioritizePatterns,
|
|
117
114
|
} = this.props;
|
|
118
115
|
|
|
119
116
|
return renderToggle( {
|
|
@@ -124,7 +121,6 @@ class Inserter extends Component {
|
|
|
124
121
|
hasSingleBlockType,
|
|
125
122
|
directInsertBlock,
|
|
126
123
|
toggleProps,
|
|
127
|
-
prioritizePatterns,
|
|
128
124
|
} );
|
|
129
125
|
}
|
|
130
126
|
|
|
@@ -147,7 +143,6 @@ class Inserter extends Component {
|
|
|
147
143
|
// This prop is experimental to give some time for the quick inserter to mature
|
|
148
144
|
// Feel free to make them stable after a few releases.
|
|
149
145
|
__experimentalIsQuick: isQuick,
|
|
150
|
-
prioritizePatterns,
|
|
151
146
|
onSelectOrClose,
|
|
152
147
|
selectBlockOnInsert,
|
|
153
148
|
} = this.props;
|
|
@@ -171,7 +166,6 @@ class Inserter extends Component {
|
|
|
171
166
|
rootClientId={ rootClientId }
|
|
172
167
|
clientId={ clientId }
|
|
173
168
|
isAppender={ isAppender }
|
|
174
|
-
prioritizePatterns={ prioritizePatterns }
|
|
175
169
|
selectBlockOnInsert={ selectBlockOnInsert }
|
|
176
170
|
/>
|
|
177
171
|
);
|
|
@@ -230,7 +224,6 @@ export default compose( [
|
|
|
230
224
|
hasInserterItems,
|
|
231
225
|
getAllowedBlocks,
|
|
232
226
|
getDirectInsertBlock,
|
|
233
|
-
getSettings,
|
|
234
227
|
} = select( blockEditorStore );
|
|
235
228
|
|
|
236
229
|
const { getBlockVariations } = select( blocksStore );
|
|
@@ -243,8 +236,6 @@ export default compose( [
|
|
|
243
236
|
const directInsertBlock =
|
|
244
237
|
shouldDirectInsert && getDirectInsertBlock( rootClientId );
|
|
245
238
|
|
|
246
|
-
const settings = getSettings();
|
|
247
|
-
|
|
248
239
|
const hasSingleBlockType =
|
|
249
240
|
allowedBlocks?.length === 1 &&
|
|
250
241
|
getBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )
|
|
@@ -262,9 +253,6 @@ export default compose( [
|
|
|
262
253
|
allowedBlockType,
|
|
263
254
|
directInsertBlock,
|
|
264
255
|
rootClientId,
|
|
265
|
-
prioritizePatterns:
|
|
266
|
-
settings.__experimentalPreferPatternsOnRoot &&
|
|
267
|
-
! rootClientId,
|
|
268
256
|
};
|
|
269
257
|
}
|
|
270
258
|
),
|
|
@@ -16,21 +16,17 @@ import { useSelect } from '@wordpress/data';
|
|
|
16
16
|
*/
|
|
17
17
|
import InserterSearchResults from './search-results';
|
|
18
18
|
import useInsertionPoint from './hooks/use-insertion-point';
|
|
19
|
-
import usePatternsState from './hooks/use-patterns-state';
|
|
20
19
|
import useBlockTypesState from './hooks/use-block-types-state';
|
|
21
20
|
import { store as blockEditorStore } from '../../store';
|
|
22
21
|
|
|
23
22
|
const SEARCH_THRESHOLD = 6;
|
|
24
23
|
const SHOWN_BLOCK_TYPES = 6;
|
|
25
|
-
const SHOWN_BLOCK_PATTERNS = 2;
|
|
26
|
-
const SHOWN_BLOCK_PATTERNS_WITH_PRIORITIZATION = 4;
|
|
27
24
|
|
|
28
25
|
export default function QuickInserter( {
|
|
29
26
|
onSelect,
|
|
30
27
|
rootClientId,
|
|
31
28
|
clientId,
|
|
32
29
|
isAppender,
|
|
33
|
-
prioritizePatterns,
|
|
34
30
|
selectBlockOnInsert,
|
|
35
31
|
hasSearch = true,
|
|
36
32
|
} ) {
|
|
@@ -47,12 +43,6 @@ export default function QuickInserter( {
|
|
|
47
43
|
onInsertBlocks,
|
|
48
44
|
true
|
|
49
45
|
);
|
|
50
|
-
const [ patterns ] = usePatternsState(
|
|
51
|
-
onInsertBlocks,
|
|
52
|
-
destinationRootClientId,
|
|
53
|
-
undefined,
|
|
54
|
-
true
|
|
55
|
-
);
|
|
56
46
|
|
|
57
47
|
const { setInserterIsOpened, insertionIndex } = useSelect(
|
|
58
48
|
( select ) => {
|
|
@@ -70,12 +60,7 @@ export default function QuickInserter( {
|
|
|
70
60
|
[ clientId ]
|
|
71
61
|
);
|
|
72
62
|
|
|
73
|
-
const
|
|
74
|
-
patterns.length && ( !! filterValue || prioritizePatterns );
|
|
75
|
-
const showSearch =
|
|
76
|
-
hasSearch &&
|
|
77
|
-
( ( showPatterns && patterns.length > SEARCH_THRESHOLD ) ||
|
|
78
|
-
blockTypes.length > SEARCH_THRESHOLD );
|
|
63
|
+
const showSearch = hasSearch && blockTypes.length > SEARCH_THRESHOLD;
|
|
79
64
|
|
|
80
65
|
useEffect( () => {
|
|
81
66
|
if ( setInserterIsOpened ) {
|
|
@@ -94,13 +79,6 @@ export default function QuickInserter( {
|
|
|
94
79
|
} );
|
|
95
80
|
};
|
|
96
81
|
|
|
97
|
-
let maxBlockPatterns = 0;
|
|
98
|
-
if ( showPatterns ) {
|
|
99
|
-
maxBlockPatterns = prioritizePatterns
|
|
100
|
-
? SHOWN_BLOCK_PATTERNS_WITH_PRIORITIZATION
|
|
101
|
-
: SHOWN_BLOCK_PATTERNS;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
82
|
return (
|
|
105
83
|
<div
|
|
106
84
|
className={ clsx( 'block-editor-inserter__quick-inserter', {
|
|
@@ -128,10 +106,9 @@ export default function QuickInserter( {
|
|
|
128
106
|
rootClientId={ rootClientId }
|
|
129
107
|
clientId={ clientId }
|
|
130
108
|
isAppender={ isAppender }
|
|
131
|
-
maxBlockPatterns={
|
|
109
|
+
maxBlockPatterns={ 0 }
|
|
132
110
|
maxBlockTypes={ SHOWN_BLOCK_TYPES }
|
|
133
111
|
isDraggable={ false }
|
|
134
|
-
prioritizePatterns={ prioritizePatterns }
|
|
135
112
|
selectBlockOnInsert={ selectBlockOnInsert }
|
|
136
113
|
isQuick
|
|
137
114
|
/>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { __experimentalNumberControl as NumberControl } from '@wordpress/components';
|
|
6
|
+
import deprecated from '@wordpress/deprecated';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -89,6 +90,17 @@ const LineHeightControl = ( {
|
|
|
89
90
|
onChange( `${ nextValue }` );
|
|
90
91
|
};
|
|
91
92
|
|
|
93
|
+
if (
|
|
94
|
+
! __next40pxDefaultSize &&
|
|
95
|
+
( otherProps.size === undefined || otherProps.size === 'default' )
|
|
96
|
+
) {
|
|
97
|
+
deprecated( `36px default size for wp.blockEditor.LineHeightControl`, {
|
|
98
|
+
since: '6.8',
|
|
99
|
+
version: '7.1',
|
|
100
|
+
hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',
|
|
101
|
+
} );
|
|
102
|
+
}
|
|
103
|
+
|
|
92
104
|
return (
|
|
93
105
|
<div className="block-editor-line-height-control">
|
|
94
106
|
<NumberControl
|