@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_control","_jsxRuntime","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","jsx","__experimentalToolsPanelItem","hasValue","label","onDeselect","isShownByDefault","undefined","className","resetAllFilter","LabeledColorIndicator","jsxs","__experimentalHStack","justify","ColorIndicator","FlexItem","title","renderToggle","settings","onToggle","isOpen","toggleProps","onClick","clsx","Button","__next40pxDefaultSize","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","Fragment","map","index","_setting$gradientValu","controlProps","clearable","showTitle","toggleSettings","Dropdown","renderContent","__experimentalDropdownContentWrapper","paddingSize","default"],"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst { colorValue, label } = settings;\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\tcolorValue={ colorValue }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t);\n\t};\n\n// Renders a collection of color controls as dropdowns. Depending upon the\n// context in which these dropdowns are being rendered, they may be wrapped\n// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,\n// the may be individually wrapped in a `ToolsPanelItem` with the toggle as\n// a regular `Button`.\n//\n// For more context see: https://github.com/WordPress/gutenberg/pull/40084\nexport default function ColorGradientSettingsDropdown( {\n\tcolors,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tenableAlpha,\n\tgradients,\n\tsettings,\n\t__experimentalIsRenderedInSidebar,\n\t...props\n} ) {\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tpopoverProps = {\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t};\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ settings.map( ( setting, index ) => {\n\t\t\t\tconst controlProps = {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tcolors,\n\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\tenableAlpha,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tgradients,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t__experimentalIsRenderedInSidebar,\n\t\t\t\t\t...setting,\n\t\t\t\t};\n\t\t\t\tconst toggleSettings = {\n\t\t\t\t\tcolorValue: setting.gradientValue ?? setting.colorValue,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\tsetting && (\n\t\t\t\t\t\t// If not in an `ItemGroup` wrap the dropdown in a\n\t\t\t\t\t\t// `ToolsPanelItem`\n\t\t\t\t\t\t<WithToolsPanelItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tsetting={ setting }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\t\t\t\t\trenderToggle={ renderToggle( toggleSettings ) }\n\t\t\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\t\t\t\t\t\t\t{ ...controlProps }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</WithToolsPanelItem>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AArB7C;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA,MAAMI,kBAAkB,GAAGA,CAAE;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC1E,MAAMC,UAAU,GAAGA,CAAA,KAAM;IACxB,IAAKJ,OAAO,CAACK,UAAU,EAAG;MACzBL,OAAO,CAACM,aAAa,CAAC,CAAC;IACxB,CAAC,MAAM,IAAKN,OAAO,CAACO,aAAa,EAAG;MACnCP,OAAO,CAACQ,gBAAgB,CAAC,CAAC;IAC3B;EACD,CAAC;EACD,oBACC,IAAAV,WAAA,CAAAW,GA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;QACtB/C,UAAU,GAAA2C,qBAAA,GAAEhD,OAAO,CAACO,aAAa,cAAAyC,qBAAA,cAAAA,qBAAA,GAAIhD,OAAO,CAACK,UAAU;QACvDO,KAAK,EAAEZ,OAAO,CAACY;MAChB,CAAC;MAED,OACCZ,OAAO;MAAA;MACN;MACA;MACA,IAAAF,WAAA,CAAAW,GAAA,EAACV,kBAAkB;QAElBC,OAAO,EAAGA,OAAS;QAAA,GACdG,KAAK;QAAAF,QAAA,eAEV,IAAAH,WAAA,CAAAW,GAAA,EAACb,WAAA,CAAAyD,QAAQ;UACRZ,YAAY,EAAGA,YAAc;UAC7BzB,SAAS,EAAC,4DAA4D;UACtES,YAAY,EAAGA,YAAY,CAAE2B,cAAe,CAAG;UAC/CE,aAAa,EAAGA,CAAA,kBACf,IAAAxD,WAAA,CAAAW,GAAA,EAACb,WAAA,CAAA2D,oCAAsB;YAACC,WAAW,EAAC,MAAM;YAAAvD,QAAA,eACzC,IAAAH,WAAA,CAAAW,GAAA;cAAKO,SAAS,EAAC,8DAA8D;cAAAf,QAAA,eAC5E,IAAAH,WAAA,CAAAW,GAAA,EAACZ,QAAA,CAAA4D,OAAoB;gBAAA,GACfR;cAAY,CACjB;YAAC,CACE;UAAC,CACiB;QACtB,CACH;MAAC,GAjBIF,KAkBa,CACpB;IAEH,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_i18n","_icons","_control","_jsxRuntime","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","jsx","__experimentalToolsPanelItem","hasValue","label","onDeselect","isShownByDefault","undefined","className","resetAllFilter","LabeledColorIndicator","jsxs","__experimentalHStack","justify","ColorIndicator","FlexItem","title","renderToggle","settings","onToggle","isOpen","clearable","colorButtonRef","useRef","toggleProps","onClick","clsx","ref","value","Fragment","Button","__next40pxDefaultSize","__","size","icon","resetIcon","current","focus","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","map","index","controlProps","showTitle","toggleSettings","Dropdown","renderContent","__experimentalDropdownContentWrapper","paddingSize","default"],"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { reset as resetIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst {\n\t\t\tclearable,\n\t\t\tcolorValue,\n\t\t\tgradientValue,\n\t\t\tonColorChange,\n\t\t\tonGradientChange,\n\t\t\tlabel,\n\t\t} = settings;\n\t\tconst colorButtonRef = useRef( undefined );\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t\tref: colorButtonRef,\n\t\t};\n\n\t\tconst clearValue = () => {\n\t\t\tif ( colorValue ) {\n\t\t\t\tonColorChange();\n\t\t\t} else if ( gradientValue ) {\n\t\t\t\tonGradientChange();\n\t\t\t}\n\t\t};\n\n\t\tconst value = colorValue ?? gradientValue;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\t\tcolorValue={ value }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t</Button>\n\t\t\t\t{ clearable && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\tclassName=\"block-editor-panel-color-gradient-settings__reset\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tclearValue();\n\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Return focus to parent button\n\t\t\t\t\t\t\tcolorButtonRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n// Renders a collection of color controls as dropdowns. Depending upon the\n// context in which these dropdowns are being rendered, they may be wrapped\n// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,\n// the may be individually wrapped in a `ToolsPanelItem` with the toggle as\n// a regular `Button`.\n//\n// For more context see: https://github.com/WordPress/gutenberg/pull/40084\nexport default function ColorGradientSettingsDropdown( {\n\tcolors,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tenableAlpha,\n\tgradients,\n\tsettings,\n\t__experimentalIsRenderedInSidebar,\n\t...props\n} ) {\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tpopoverProps = {\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t};\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ settings.map( ( setting, index ) => {\n\t\t\t\tconst controlProps = {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tcolors,\n\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\tenableAlpha,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tgradients,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t__experimentalIsRenderedInSidebar,\n\t\t\t\t\t...setting,\n\t\t\t\t};\n\t\t\t\tconst toggleSettings = {\n\t\t\t\t\tclearable: setting.clearable,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\tsetting && (\n\t\t\t\t\t\t// If not in an `ItemGroup` wrap the dropdown in a\n\t\t\t\t\t\t// `ToolsPanelItem`\n\t\t\t\t\t\t<WithToolsPanelItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tsetting={ setting }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\t\t\t\t\trenderToggle={ renderToggle( toggleSettings ) }\n\t\t\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\t\t\t\t\t\t\t{ ...controlProps }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</WithToolsPanelItem>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],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C,CACiB;QACtB,CACH;MAAC,GAjBID,KAkBa,CACpB;IAEH,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
|
|
@@ -50,7 +50,7 @@ function ContrastCheckerMessage({
|
|
|
50
50
|
style: _style.default['block-editor-contrast-checker'],
|
|
51
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
52
52
|
style: iconStyle,
|
|
53
|
-
icon: _icons.
|
|
53
|
+
icon: _icons.cautionFilled
|
|
54
54
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
55
55
|
style: msgStyle,
|
|
56
56
|
children: msg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_colord","_names","_interopRequireDefault","_a11y","_a11y2","_i18n","_element","_compose","_icons","_style","_jsxRuntime","extend","namesPlugin","a11yPlugin","ContrastCheckerMessage","colordBackgroundColor","colordTextColor","backgroundColor","textColor","msgStyle","msg","brightness","__","useEffect","speak","iconStyle","usePreferredColorSchemeStyle","styles","jsxs","View","style","children","jsx","Icon","icon","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_colord","_names","_interopRequireDefault","_a11y","_a11y2","_i18n","_element","_compose","_icons","_style","_jsxRuntime","extend","namesPlugin","a11yPlugin","ContrastCheckerMessage","colordBackgroundColor","colordTextColor","backgroundColor","textColor","msgStyle","msg","brightness","__","useEffect","speak","iconStyle","usePreferredColorSchemeStyle","styles","jsxs","View","style","children","jsx","Icon","icon","cautionFilled","Text","ContrastChecker","fallbackBackgroundColor","fallbackTextColor","fontSize","isLargeText","colord","hasTransparency","alpha","isReadable","level","size","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/contrast-checker/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, cautionFilled } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nfunction ContrastCheckerMessage( {\n\tcolordBackgroundColor,\n\tcolordTextColor,\n\tbackgroundColor,\n\ttextColor,\n\tmsgStyle,\n} ) {\n\tconst msg =\n\t\tcolordBackgroundColor.brightness() < colordTextColor.brightness()\n\t\t\t? __(\n\t\t\t\t\t'This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.'\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.'\n\t\t\t );\n\n\t// Note: The `Notice` component can speak messages via its `spokenMessage`\n\t// prop, but the contrast checker requires granular control over when the\n\t// announcements are made. Notably, the message will be re-announced if a\n\t// new color combination is selected and the contrast is still insufficient.\n\tuseEffect( () => {\n\t\tspeak( __( 'This color combination may be hard for people to read.' ) );\n\t}, [ backgroundColor, textColor ] );\n\n\tconst iconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'block-editor-contrast-checker__icon' ],\n\t\tstyles[ 'block-editor-contrast-checker__icon-dark' ]\n\t);\n\n\treturn (\n\t\t<View style={ styles[ 'block-editor-contrast-checker' ] }>\n\t\t\t<Icon style={ iconStyle } icon={ cautionFilled } />\n\t\t\t<Text style={ msgStyle }>{ msg }</Text>\n\t\t</View>\n\t);\n}\n\nfunction ContrastChecker( {\n\tbackgroundColor,\n\tfallbackBackgroundColor,\n\tfallbackTextColor,\n\tfontSize, // font size value in pixels\n\tisLargeText,\n\ttextColor,\n} ) {\n\tconst msgStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'block-editor-contrast-checker__notice' ],\n\t\tstyles[ 'block-editor-contrast-checker__notice-dark' ]\n\t);\n\n\tif (\n\t\t! ( backgroundColor || fallbackBackgroundColor ) ||\n\t\t! ( textColor || fallbackTextColor )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst colordBackgroundColor = colord(\n\t\tbackgroundColor || fallbackBackgroundColor\n\t);\n\tconst colordTextColor = colord( textColor || fallbackTextColor );\n\n\tconst hasTransparency =\n\t\tcolordBackgroundColor.alpha() !== 1 || colordTextColor.alpha() !== 1;\n\n\tif (\n\t\thasTransparency ||\n\t\tcolordTextColor.isReadable( colordBackgroundColor, {\n\t\t\tlevel: 'AA',\n\t\t\tsize:\n\t\t\t\tisLargeText || ( isLargeText !== false && fontSize >= 24 )\n\t\t\t\t\t? 'large'\n\t\t\t\t\t: 'small',\n\t\t} )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ContrastCheckerMessage\n\t\t\tbackgroundColor={ backgroundColor }\n\t\t\ttextColor={ textColor }\n\t\t\tcolordBackgroundColor={ colordBackgroundColor }\n\t\t\tcolordTextColor={ colordTextColor }\n\t\t\tmsgStyle={ msgStyle }\n\t\t/>\n\t);\n}\n\nexport default ContrastChecker;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAIA,IAAAU,MAAA,GAAAP,sBAAA,CAAAH,OAAA;AAAkC,IAAAW,WAAA,GAAAX,OAAA;AAnBlC;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,IAAAY,cAAM,EAAE,CAAEC,cAAW,EAAEC,aAAU,CAAG,CAAC;AAErC,SAASC,sBAAsBA,CAAE;E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EAAIpB,SAAS,IAAIqB,iBAAiB,CAAE,EACnC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMxB,qBAAqB,GAAG,IAAA2B,cAAM,EACnCzB,eAAe,IAAIqB,uBACpB,CAAC;EACD,MAAMtB,eAAe,GAAG,IAAA0B,cAAM,EAAExB,SAAS,IAAIqB,iBAAkB,CAAC;EAEhE,MAAMI,eAAe,GACpB5B,qBAAqB,CAAC6B,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI5B,eAAe,CAAC4B,KAAK,CAAC,CAAC,KAAK,CAAC;EAErE,IACCD,eAAe,IACf3B,eAAe,CAAC6B,UAAU,CAAE9B,qBAAqB,EAAE;IAClD+B,KAAK,EAAE,IAAI;IACXC,IAAI,EACHN,WAAW,IAAMA,WAAW,KAAK,KAAK,IAAID,QAAQ,IAAI,EAAI,GACvD,OAAO,GACP;EACL,CAAE,CAAC,EACF;IACD,OAAO,IAAI;EACZ;EAEA,oBACC,IAAA9B,WAAA,CAAAsB,GAAA,EAAClB,sBAAsB;IACtBG,eAAe,EAAGA,eAAiB;IACnCC,SAAS,EAAGA,SAAW;IACvBH,qBAAqB,EAAGA,qBAAuB;IAC/CC,eAAe,EAAGA,eAAiB;IACnCG,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAAC,IAAA6B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcb,eAAe","ignoreList":[]}
|
|
@@ -30,28 +30,19 @@ if (exampleDate.getMonth() === 4) {
|
|
|
30
30
|
*
|
|
31
31
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md
|
|
32
32
|
*
|
|
33
|
-
* @param {Object}
|
|
34
|
-
* @param {string|null}
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* _Default_ is
|
|
38
|
-
* selected.
|
|
39
|
-
* @param {string} props.defaultFormat The date format that
|
|
40
|
-
* will be used if the
|
|
41
|
-
* user selects
|
|
42
|
-
* 'Default'.
|
|
43
|
-
* @param {( format: string|null ) => void} props.onChange Called when a
|
|
44
|
-
* selection is
|
|
45
|
-
* made. If `null`,
|
|
46
|
-
* _Default_ is
|
|
47
|
-
* selected.
|
|
33
|
+
* @param {Object} props
|
|
34
|
+
* @param {string|null} props.format The selected date format. If `null`, _Default_ is selected.
|
|
35
|
+
* @param {string} props.defaultFormat The date format that will be used if the user selects 'Default'.
|
|
36
|
+
* @param {Function} props.onChange Called when a selection is made. If `null`, _Default_ is selected.
|
|
48
37
|
*/
|
|
49
38
|
function DateFormatPicker({
|
|
50
39
|
format,
|
|
51
40
|
defaultFormat,
|
|
52
41
|
onChange
|
|
53
42
|
}) {
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
44
|
+
as: "fieldset",
|
|
45
|
+
spacing: 4,
|
|
55
46
|
className: "block-editor-date-format-picker",
|
|
56
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.VisuallyHidden, {
|
|
57
48
|
as: "legend",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_date","_element","_components","_jsxRuntime","exampleDate","Date","setDate","setMonth","getMonth","DateFormatPicker","format","defaultFormat","onChange","jsxs","className","children","jsx","VisuallyHidden","as","__","ToggleControl","__nextHasNoMarginBottom","label","help","dateI18n","checked","NonDefaultControls","_suggestedOptions$fin","suggestedFormats","Set","_x","suggestedOptions","map","suggestedFormat","index","key","name","humanTimeDiff","customOption","hint","isCustom","setIsCustom","useState","some","option","__experimentalVStack","CustomSelectControl","__next40pxDefaultSize","options","value","find","selectedItem","TextControl","hideLabelFromVision","createInterpolateElement","Link","ExternalLink","href"],"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n, humanTimeDiff } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n\tCustomSelectControl,\n} from '@wordpress/components';\n\n// So that we illustrate the different formats in the dropdown properly, show a date that is\n// somwhat recent, has a day greater than 12, and a month with more than three letters.\nconst exampleDate = new Date();\nexampleDate.setDate( 20 );\nexampleDate.setMonth( exampleDate.getMonth() - 3 );\nif ( exampleDate.getMonth() === 4 ) {\n\t// May has three letters, so use March.\n\texampleDate.setMonth( 3 );\n}\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date\n * format. If\n * `null`,\n * _Default_ is\n * selected.\n * @param {string} props.defaultFormat The date format that\n * will be used if the\n * user selects\n * 'Default'.\n * @param {( format: string|null ) => void} props.onChange Called when a\n * selection is\n * made. If `null`,\n * _Default_ is\n * selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<fieldset className=\"block-editor-date-format-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Default format' ) }\n\t\t\t\thelp={ `${ __( 'Example:' ) } ${ dateI18n(\n\t\t\t\t\tdefaultFormat,\n\t\t\t\t\texampleDate\n\t\t\t\t) }` }\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t'Y-m-d',\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = [\n\t\t...suggestedFormats.map( ( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, exampleDate ),\n\t\t\tformat: suggestedFormat,\n\t\t} ) ),\n\t\t{\n\t\t\tkey: 'human-diff',\n\t\t\tname: humanTimeDiff( exampleDate ),\n\t\t\tformat: 'human-diff',\n\t\t},\n\t];\n\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\thint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() =>\n\t\t\t!! format &&\n\t\t\t! suggestedOptions.some( ( option ) => option.format === format )\n\t);\n\n\treturn (\n\t\t<VStack>\n\t\t\t<CustomSelectControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\tvalue={\n\t\t\t\t\tisCustom\n\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t}\n\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/customize-date-and-time-format/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ format }\n\t\t\t\t\tonChange={ ( value ) => onChange( value ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"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CAAC,EACD;QACCoC,IAAI,eACH,IAAApD,WAAA,CAAAa,GAAA,EAACd,WAAA,CAAAsD,YAAY;UACZC,IAAI,EAAG,IAAAtC,QAAE,EACR,6EACD;QAAG,CACH;MAEH,CACD,CAAG;MACH8B,KAAK,EAAGvC,MAAQ;MAChBE,QAAQ,EAAKqC,KAAK,IAAMrC,QAAQ,CAAEqC,KAAM;IAAG,CAC3C,CACD;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_date","_element","_components","_jsxRuntime","exampleDate","Date","setDate","setMonth","getMonth","DateFormatPicker","format","defaultFormat","onChange","jsxs","__experimentalVStack","as","spacing","className","children","jsx","VisuallyHidden","__","ToggleControl","__nextHasNoMarginBottom","label","help","dateI18n","checked","NonDefaultControls","_suggestedOptions$fin","suggestedFormats","Set","_x","suggestedOptions","map","suggestedFormat","index","key","name","humanTimeDiff","customOption","hint","isCustom","setIsCustom","useState","some","option","CustomSelectControl","__next40pxDefaultSize","options","value","find","selectedItem","TextControl","hideLabelFromVision","createInterpolateElement","Link","ExternalLink","href"],"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n, humanTimeDiff } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n\tCustomSelectControl,\n} from '@wordpress/components';\n\n// So that we illustrate the different formats in the dropdown properly, show a date that is\n// somwhat recent, has a day greater than 12, and a month with more than three letters.\nconst exampleDate = new Date();\nexampleDate.setDate( 20 );\nexampleDate.setMonth( exampleDate.getMonth() - 3 );\nif ( exampleDate.getMonth() === 4 ) {\n\t// May has three letters, so use March.\n\texampleDate.setMonth( 3 );\n}\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date format. If `null`, _Default_ is selected.\n * @param {string} props.defaultFormat The date format that will be used if the user selects 'Default'.\n * @param {Function} props.onChange Called when a selection is made. If `null`, _Default_ is selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<VStack\n\t\t\tas=\"fieldset\"\n\t\t\tspacing={ 4 }\n\t\t\tclassName=\"block-editor-date-format-picker\"\n\t\t>\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Default format' ) }\n\t\t\t\thelp={ `${ __( 'Example:' ) } ${ dateI18n(\n\t\t\t\t\tdefaultFormat,\n\t\t\t\t\texampleDate\n\t\t\t\t) }` }\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t'Y-m-d',\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = [\n\t\t...suggestedFormats.map( ( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, exampleDate ),\n\t\t\tformat: suggestedFormat,\n\t\t} ) ),\n\t\t{\n\t\t\tkey: 'human-diff',\n\t\t\tname: humanTimeDiff( exampleDate ),\n\t\t\tformat: 'human-diff',\n\t\t},\n\t];\n\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\thint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() =>\n\t\t\t!! format &&\n\t\t\t! suggestedOptions.some( ( option ) => option.format === format )\n\t);\n\n\treturn (\n\t\t<VStack>\n\t\t\t<CustomSelectControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\tvalue={\n\t\t\t\t\tisCustom\n\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t}\n\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/customize-date-and-time-format/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ format }\n\t\t\t\t\tonChange={ ( value ) => onChange( value ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAO+B,IAAAI,WAAA,GAAAJ,OAAA;AAb/B;AACA;AACA;;AAaA;AACA;AACA,MAAMK,WAAW,GAAG,IAAIC,IAAI,CAAC,CAAC;AAC9BD,WAAW,CAACE,OAAO,CAAE,EAAG,CAAC;AACzBF,WAAW,CAACG,QAAQ,CAAEH,WAAW,CAACI,QAAQ,CAAC,CAAC,GAAG,CAAE,CAAC;AAClD,IAAKJ,WAAW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
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = FontAppearanceControl;
|
|
8
9
|
var _components = require("@wordpress/components");
|
|
10
|
+
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
9
11
|
var _element = require("@wordpress/element");
|
|
10
12
|
var _i18n = require("@wordpress/i18n");
|
|
11
13
|
var _getFontStylesAndWeights = require("../../utils/get-font-styles-and-weights");
|
|
@@ -153,6 +155,13 @@ function FontAppearanceControl(props) {
|
|
|
153
155
|
// translators: %s: Currently selected font appearance.
|
|
154
156
|
(0, _i18n.__)('Currently selected font appearance: %s'), currentSelection.name);
|
|
155
157
|
};
|
|
158
|
+
if (!__next40pxDefaultSize && (otherProps.size === undefined || otherProps.size === 'default')) {
|
|
159
|
+
(0, _deprecated.default)(`36px default size for wp.blockEditor.__experimentalFontAppearanceControl`, {
|
|
160
|
+
since: '6.8',
|
|
161
|
+
version: '7.1',
|
|
162
|
+
hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.'
|
|
163
|
+
});
|
|
164
|
+
}
|
|
156
165
|
return hasStylesOrWeights && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CustomSelectControl, {
|
|
157
166
|
...otherProps,
|
|
158
167
|
className: "components-font-appearance-control",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","_i18n","_getFontStylesAndWeights","_jsxRuntime","getFontAppearanceLabel","hasFontStyles","hasFontWeights","__","FontAppearanceControl","props","__next40pxDefaultSize","onChange","fontFamilyFaces","value","fontStyle","fontWeight","otherProps","hasStylesOrWeights","label","defaultOption","key","name","style","undefined","fontStyles","fontWeights","combinedStyleAndWeightOptions","getFontStylesAndWeights","combineOptions","combinedOptions","push","styleOptions","forEach","weightOptions","selectOptions","useMemo","options","currentSelection","find","option","getDescribedBy","sprintf","jsx","CustomSelectControl","className","__shouldNotWarnDeprecated36pxSize","describedBy","selectedItem"],"sources":["@wordpress/block-editor/src/components/font-appearance-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CustomSelectControl } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\n\n/**\n * Adjusts font appearance field label in case either font styles or weights\n * are disabled.\n *\n * @param {boolean} hasFontStyles Whether font styles are enabled and present.\n * @param {boolean} hasFontWeights Whether font weights are enabled and present.\n * @return {string} A label representing what font appearance is being edited.\n */\nconst getFontAppearanceLabel = ( hasFontStyles, hasFontWeights ) => {\n\tif ( ! hasFontStyles ) {\n\t\treturn __( 'Font weight' );\n\t}\n\n\tif ( ! hasFontWeights ) {\n\t\treturn __( 'Font style' );\n\t}\n\n\treturn __( 'Appearance' );\n};\n\n/**\n * Control to display font style and weight options of the active font.\n *\n * @param {Object} props Component props.\n *\n * @return {Element} Font appearance control.\n */\nexport default function FontAppearanceControl( props ) {\n\tconst {\n\t\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t\t__next40pxDefaultSize = false,\n\t\tonChange,\n\t\thasFontStyles = true,\n\t\thasFontWeights = true,\n\t\tfontFamilyFaces,\n\t\tvalue: { fontStyle, fontWeight },\n\t\t...otherProps\n\t} = props;\n\tconst hasStylesOrWeights = hasFontStyles || hasFontWeights;\n\tconst label = getFontAppearanceLabel( hasFontStyles, hasFontWeights );\n\tconst defaultOption = {\n\t\tkey: 'default',\n\t\tname: __( 'Default' ),\n\t\tstyle: { fontStyle: undefined, fontWeight: undefined },\n\t};\n\tconst { fontStyles, fontWeights, combinedStyleAndWeightOptions } =\n\t\tgetFontStylesAndWeights( fontFamilyFaces );\n\n\t// Generates select options for combined font styles and weights.\n\tconst combineOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tif ( combinedStyleAndWeightOptions ) {\n\t\t\tcombinedOptions.push( ...combinedStyleAndWeightOptions );\n\t\t}\n\t\treturn combinedOptions;\n\t};\n\n\t// Generates select options for font styles only.\n\tconst styleOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tfontStyles.forEach( ( { name, value } ) => {\n\t\t\tcombinedOptions.push( {\n\t\t\t\tkey: value,\n\t\t\t\tname,\n\t\t\t\tstyle: { fontStyle: value, fontWeight: undefined },\n\t\t\t} );\n\t\t} );\n\t\treturn combinedOptions;\n\t};\n\n\t// Generates select options for font weights only.\n\tconst weightOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tfontWeights.forEach( ( { name, value } ) => {\n\t\t\tcombinedOptions.push( {\n\t\t\t\tkey: value,\n\t\t\t\tname,\n\t\t\t\tstyle: { fontStyle: undefined, fontWeight: value },\n\t\t\t} );\n\t\t} );\n\t\treturn combinedOptions;\n\t};\n\n\t// Map font styles and weights to select options.\n\tconst selectOptions = useMemo( () => {\n\t\t// Display combined available font style and weight options.\n\t\tif ( hasFontStyles && hasFontWeights ) {\n\t\t\treturn combineOptions();\n\t\t}\n\n\t\t// Display only font style options or font weight options.\n\t\treturn hasFontStyles ? styleOptions() : weightOptions();\n\t}, [\n\t\tprops.options,\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t] );\n\n\t// Find current selection by comparing font style & weight against options,\n\t// and fall back to the Default option if there is no matching option.\n\tconst currentSelection =\n\t\tselectOptions.find(\n\t\t\t( option ) =>\n\t\t\t\toption.style.fontStyle === fontStyle &&\n\t\t\t\toption.style.fontWeight === fontWeight\n\t\t) || selectOptions[ 0 ];\n\n\t// Adjusts screen reader description based on styles or weights.\n\tconst getDescribedBy = () => {\n\t\tif ( ! currentSelection ) {\n\t\t\treturn __( 'No selected font appearance' );\n\t\t}\n\n\t\tif ( ! hasFontStyles ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: Currently selected font weight.\n\t\t\t\t__( 'Currently selected font weight: %s' ),\n\t\t\t\tcurrentSelection.name\n\t\t\t);\n\t\t}\n\n\t\tif ( ! hasFontWeights ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: Currently selected font style.\n\t\t\t\t__( 'Currently selected font style: %s' ),\n\t\t\t\tcurrentSelection.name\n\t\t\t);\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t// translators: %s: Currently selected font appearance.\n\t\t\t__( 'Currently selected font appearance: %s' ),\n\t\t\tcurrentSelection.name\n\t\t);\n\t};\n\n\treturn (\n\t\thasStylesOrWeights && (\n\t\t\t<CustomSelectControl\n\t\t\t\t{ ...otherProps }\n\t\t\t\tclassName=\"components-font-appearance-control\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\tlabel={ label }\n\t\t\t\tdescribedBy={ getDescribedBy() }\n\t\t\t\toptions={ selectOptions }\n\t\t\t\tvalue={ currentSelection }\n\t\t\t\tonChange={ ( { selectedItem } ) =>\n\t\t\t\t\tonChange( selectedItem.style )\n\t\t\t\t}\n\t\t\t/>\n\t\t)\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_components","require","_deprecated","_interopRequireDefault","_element","_i18n","_getFontStylesAndWeights","_jsxRuntime","getFontAppearanceLabel","hasFontStyles","hasFontWeights","__","FontAppearanceControl","props","__next40pxDefaultSize","onChange","fontFamilyFaces","value","fontStyle","fontWeight","otherProps","hasStylesOrWeights","label","defaultOption","key","name","style","undefined","fontStyles","fontWeights","combinedStyleAndWeightOptions","getFontStylesAndWeights","combineOptions","combinedOptions","push","styleOptions","forEach","weightOptions","selectOptions","useMemo","options","currentSelection","find","option","getDescribedBy","sprintf","size","deprecated","since","version","hint","jsx","CustomSelectControl","className","__shouldNotWarnDeprecated36pxSize","describedBy","selectedItem"],"sources":["@wordpress/block-editor/src/components/font-appearance-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CustomSelectControl } from '@wordpress/components';\nimport deprecated from '@wordpress/deprecated';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\n\n/**\n * Adjusts font appearance field label in case either font styles or weights\n * are disabled.\n *\n * @param {boolean} hasFontStyles Whether font styles are enabled and present.\n * @param {boolean} hasFontWeights Whether font weights are enabled and present.\n * @return {string} A label representing what font appearance is being edited.\n */\nconst getFontAppearanceLabel = ( hasFontStyles, hasFontWeights ) => {\n\tif ( ! hasFontStyles ) {\n\t\treturn __( 'Font weight' );\n\t}\n\n\tif ( ! hasFontWeights ) {\n\t\treturn __( 'Font style' );\n\t}\n\n\treturn __( 'Appearance' );\n};\n\n/**\n * Control to display font style and weight options of the active font.\n *\n * @param {Object} props Component props.\n *\n * @return {Element} Font appearance control.\n */\nexport default function FontAppearanceControl( props ) {\n\tconst {\n\t\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t\t__next40pxDefaultSize = false,\n\t\tonChange,\n\t\thasFontStyles = true,\n\t\thasFontWeights = true,\n\t\tfontFamilyFaces,\n\t\tvalue: { fontStyle, fontWeight },\n\t\t...otherProps\n\t} = props;\n\tconst hasStylesOrWeights = hasFontStyles || hasFontWeights;\n\tconst label = getFontAppearanceLabel( hasFontStyles, hasFontWeights );\n\tconst defaultOption = {\n\t\tkey: 'default',\n\t\tname: __( 'Default' ),\n\t\tstyle: { fontStyle: undefined, fontWeight: undefined },\n\t};\n\tconst { fontStyles, fontWeights, combinedStyleAndWeightOptions } =\n\t\tgetFontStylesAndWeights( fontFamilyFaces );\n\n\t// Generates select options for combined font styles and weights.\n\tconst combineOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tif ( combinedStyleAndWeightOptions ) {\n\t\t\tcombinedOptions.push( ...combinedStyleAndWeightOptions );\n\t\t}\n\t\treturn combinedOptions;\n\t};\n\n\t// Generates select options for font styles only.\n\tconst styleOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tfontStyles.forEach( ( { name, value } ) => {\n\t\t\tcombinedOptions.push( {\n\t\t\t\tkey: value,\n\t\t\t\tname,\n\t\t\t\tstyle: { fontStyle: value, fontWeight: undefined },\n\t\t\t} );\n\t\t} );\n\t\treturn combinedOptions;\n\t};\n\n\t// Generates select options for font weights only.\n\tconst weightOptions = () => {\n\t\tconst combinedOptions = [ defaultOption ];\n\t\tfontWeights.forEach( ( { name, value } ) => {\n\t\t\tcombinedOptions.push( {\n\t\t\t\tkey: value,\n\t\t\t\tname,\n\t\t\t\tstyle: { fontStyle: undefined, fontWeight: value },\n\t\t\t} );\n\t\t} );\n\t\treturn combinedOptions;\n\t};\n\n\t// Map font styles and weights to select options.\n\tconst selectOptions = useMemo( () => {\n\t\t// Display combined available font style and weight options.\n\t\tif ( hasFontStyles && hasFontWeights ) {\n\t\t\treturn combineOptions();\n\t\t}\n\n\t\t// Display only font style options or font weight options.\n\t\treturn hasFontStyles ? styleOptions() : weightOptions();\n\t}, [\n\t\tprops.options,\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t] );\n\n\t// Find current selection by comparing font style & weight against options,\n\t// and fall back to the Default option if there is no matching option.\n\tconst currentSelection =\n\t\tselectOptions.find(\n\t\t\t( option ) =>\n\t\t\t\toption.style.fontStyle === fontStyle &&\n\t\t\t\toption.style.fontWeight === fontWeight\n\t\t) || selectOptions[ 0 ];\n\n\t// Adjusts screen reader description based on styles or weights.\n\tconst getDescribedBy = () => {\n\t\tif ( ! currentSelection ) {\n\t\t\treturn __( 'No selected font appearance' );\n\t\t}\n\n\t\tif ( ! hasFontStyles ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: Currently selected font weight.\n\t\t\t\t__( 'Currently selected font weight: %s' ),\n\t\t\t\tcurrentSelection.name\n\t\t\t);\n\t\t}\n\n\t\tif ( ! hasFontWeights ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: Currently selected font style.\n\t\t\t\t__( 'Currently selected font style: %s' ),\n\t\t\t\tcurrentSelection.name\n\t\t\t);\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t// translators: %s: Currently selected font appearance.\n\t\t\t__( 'Currently selected font appearance: %s' ),\n\t\t\tcurrentSelection.name\n\t\t);\n\t};\n\n\tif (\n\t\t! __next40pxDefaultSize &&\n\t\t( otherProps.size === undefined || otherProps.size === 'default' )\n\t) {\n\t\tdeprecated(\n\t\t\t`36px default size for wp.blockEditor.__experimentalFontAppearanceControl`,\n\t\t\t{\n\t\t\t\tsince: '6.8',\n\t\t\t\tversion: '7.1',\n\t\t\t\thint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\thasStylesOrWeights && (\n\t\t\t<CustomSelectControl\n\t\t\t\t{ ...otherProps }\n\t\t\t\tclassName=\"components-font-appearance-control\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\tlabel={ label }\n\t\t\t\tdescribedBy={ getDescribedBy() }\n\t\t\t\toptions={ selectOptions }\n\t\t\t\tvalue={ currentSelection }\n\t\t\t\tonChange={ ( { selectedItem } ) =>\n\t\t\t\t\tonChange( selectedItem.style )\n\t\t\t\t}\n\t\t\t/>\n\t\t)\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAL,OAAA;AAAkF,IAAAM,WAAA,GAAAN,OAAA;AAXlF;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;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,7 @@ function FontFamilyControl({
|
|
|
35
35
|
className,
|
|
36
36
|
...props
|
|
37
37
|
}) {
|
|
38
|
+
var _options$find;
|
|
38
39
|
const [blockLevelFontFamilies] = (0, _useSettings.useSettings)('typography.fontFamilies');
|
|
39
40
|
if (!fontFamilies) {
|
|
40
41
|
fontFamilies = blockLevelFontFamilies;
|
|
@@ -62,11 +63,19 @@ function FontFamilyControl({
|
|
|
62
63
|
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version'
|
|
63
64
|
});
|
|
64
65
|
}
|
|
66
|
+
if (!__next40pxDefaultSize && (props.size === undefined || props.size === 'default')) {
|
|
67
|
+
(0, _deprecated.default)(`36px default size for wp.blockEditor.__experimentalFontFamilyControl`, {
|
|
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
|
+
const selectedValue = (_options$find = options.find(option => option.key === value)) !== null && _options$find !== void 0 ? _options$find : '';
|
|
65
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CustomSelectControl, {
|
|
66
75
|
__next40pxDefaultSize: __next40pxDefaultSize,
|
|
67
76
|
__shouldNotWarnDeprecated36pxSize: true,
|
|
68
77
|
label: (0, _i18n.__)('Font'),
|
|
69
|
-
value:
|
|
78
|
+
value: selectedValue,
|
|
70
79
|
onChange: ({
|
|
71
80
|
selectedItem
|
|
72
81
|
}) => onChange(selectedItem.key),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_deprecated","_i18n","_useSettings","_jsxRuntime","FontFamilyControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","fontFamilies","className","props","blockLevelFontFamilies","useSettings","length","options","key","name","__","map","fontFamily","style","deprecated","since","version","hint","jsx","CustomSelectControl","__shouldNotWarnDeprecated36pxSize","label","selectedItem","clsx"],"sources":["@wordpress/block-editor/src/components/font-family/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { CustomSelectControl } from '@wordpress/components';\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../use-settings';\n\nexport default function FontFamilyControl( {\n\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t__next40pxDefaultSize = false,\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMarginBottom = false,\n\tvalue = '',\n\tonChange,\n\tfontFamilies,\n\tclassName,\n\t...props\n} ) {\n\tconst [ blockLevelFontFamilies ] = useSettings( 'typography.fontFamilies' );\n\tif ( ! fontFamilies ) {\n\t\tfontFamilies = blockLevelFontFamilies;\n\t}\n\n\tif ( ! fontFamilies || fontFamilies.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst options = [\n\t\t{\n\t\t\tkey: '',\n\t\t\tname: __( 'Default' ),\n\t\t},\n\t\t...fontFamilies.map( ( { fontFamily, name } ) => ( {\n\t\t\tkey: fontFamily,\n\t\t\tname: name || fontFamily,\n\t\t\tstyle: { fontFamily },\n\t\t} ) ),\n\t];\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated(\n\t\t\t'Bottom margin styles for wp.blockEditor.FontFamilyControl',\n\t\t\t{\n\t\t\t\tsince: '6.7',\n\t\t\t\tversion: '7.0',\n\t\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t\t}\n\t\t);\n\t}\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tlabel={ __( 'Font' ) }\n\t\t\tvalue={
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_deprecated","_i18n","_useSettings","_jsxRuntime","FontFamilyControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","fontFamilies","className","props","_options$find","blockLevelFontFamilies","useSettings","length","options","key","name","__","map","fontFamily","style","deprecated","since","version","hint","size","undefined","selectedValue","find","option","jsx","CustomSelectControl","__shouldNotWarnDeprecated36pxSize","label","selectedItem","clsx"],"sources":["@wordpress/block-editor/src/components/font-family/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { CustomSelectControl } from '@wordpress/components';\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../use-settings';\n\nexport default function FontFamilyControl( {\n\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t__next40pxDefaultSize = false,\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMarginBottom = false,\n\tvalue = '',\n\tonChange,\n\tfontFamilies,\n\tclassName,\n\t...props\n} ) {\n\tconst [ blockLevelFontFamilies ] = useSettings( 'typography.fontFamilies' );\n\tif ( ! fontFamilies ) {\n\t\tfontFamilies = blockLevelFontFamilies;\n\t}\n\n\tif ( ! fontFamilies || fontFamilies.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst options = [\n\t\t{\n\t\t\tkey: '',\n\t\t\tname: __( 'Default' ),\n\t\t},\n\t\t...fontFamilies.map( ( { fontFamily, name } ) => ( {\n\t\t\tkey: fontFamily,\n\t\t\tname: name || fontFamily,\n\t\t\tstyle: { fontFamily },\n\t\t} ) ),\n\t];\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated(\n\t\t\t'Bottom margin styles for wp.blockEditor.FontFamilyControl',\n\t\t\t{\n\t\t\t\tsince: '6.7',\n\t\t\t\tversion: '7.0',\n\t\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t\t}\n\t\t);\n\t}\n\n\tif (\n\t\t! __next40pxDefaultSize &&\n\t\t( props.size === undefined || props.size === 'default' )\n\t) {\n\t\tdeprecated(\n\t\t\t`36px default size for wp.blockEditor.__experimentalFontFamilyControl`,\n\t\t\t{\n\t\t\t\tsince: '6.8',\n\t\t\t\tversion: '7.1',\n\t\t\t\thint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst selectedValue =\n\t\toptions.find( ( option ) => option.key === value ) ?? '';\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tlabel={ __( 'Font' ) }\n\t\t\tvalue={ selectedValue }\n\t\t\tonChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }\n\t\t\toptions={ options }\n\t\t\tclassName={ clsx( 'block-editor-font-family-control', className, {\n\t\t\t\t'is-next-has-no-margin-bottom': __nextHasNoMarginBottom,\n\t\t\t} ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAf9C;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASM,iBAAiBA,CAAE;EAC1C;EACAC,qBAAqB,GAAG,KAAK;EAC7B;EACAC,uBAAuB,GAAG,KAAK;EAC/BC,KAAK,GAAG,EAAE;EACVC,QAAQ;EACRC,YAAY;EACZC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EAAA,IAAAC,aAAA;EACH,MAAM,CAAEC,sBAAsB,CAAE,GAAG,I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MAAO,CAAG;IACtBZ,KAAK,EAAGsB,aAAe;IACvBrB,QAAQ,EAAGA,CAAE;MAAE4B;IAAa,CAAC,KAAM5B,QAAQ,CAAE4B,YAAY,CAACnB,GAAI,CAAG;IACjED,OAAO,EAAGA,OAAS;IACnBN,SAAS,EAAG,IAAA2B,aAAI,EAAE,kCAAkC,EAAE3B,SAAS,EAAE;MAChE,8BAA8B,EAAEJ;IACjC,CAAE,CAAG;IAAA,GACAK;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_i18n","_control","_hooks","_utils","_object","_lockUnlock","_icons","_jsxRuntime","useHasColorPanel","settings","hasTextPanel","useHasTextPanel","hasBackgroundPanel","useHasBackgroundColorPanel","hasLinkPanel","useHasLinkPanel","hasHeadingPanel","useHasHeadingPanel","hasButtonPanel","useHasButtonPanel","hasCaptionPanel","useHasCaptionPanel","colors","useColorsPerOrigin","color","text","length","custom","link","caption","gradients","useGradientsPerOrigin","heading","customGradient","button","background","ColorToolsPanel","resetAllFilter","onChange","value","panelId","children","dropdownMenuProps","useToolsPanelDropdownMenuProps","resetAll","updatedValue","jsx","__experimentalToolsPanel","label","__","hasInnerWrapper","headingLevel","className","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","DEFAULT_CONTROLS","popoverProps","placement","offset","shift","Tabs","unlock","componentsPrivateApis","LabeledColorIndicators","indicators","jsxs","__experimentalHStack","justify","__experimentalZStack","isLayered","map","indicator","index","Flex","expanded","ColorIndicator","colorValue","FlexItem","ColorPanelTab","isGradient","inheritedValue","userValue","setValue","colorGradientControlSettings","default","showTitle","enableAlpha","__experimentalIsRenderedInSidebar","undefined","gradientValue","onColorChange","onGradientChange","clearable","ColorPanelDropdown","hasValue","resetValue","isShownByDefault","tabs","_tabs$","currentTab","find","tab","key","firstTabKey","firstTab","colorGradientDropdownButtonRef","useRef","__experimentalToolsPanelItem","onDeselect","Dropdown","renderToggle","onToggle","isOpen","toggleProps","onClick","clsx","ref","Fragment","Button","__next40pxDefaultSize","size","icon","resetIcon","current","focus","renderContent","__experimentalDropdownContentWrapper","paddingSize","defaultTabId","TabList","Tab","tabId","tabKey","restTabProps","TabPanel","focusable","ColorPanel","as","Wrapper","defaultControls","areCustomSolidsEnabled","areCustomGradientsEnabled","hasSolidColors","hasGradientColors","decodeValue","rawValue","getValueFromVariable","encodeColorValue","allColors","flatMap","originColors","colorObject","slug","encodeGradientValue","allGradients","originGradients","gradientObject","gradient","showBackgroundPanel","backgroundColor","userBackgroundColor","userGradient","hasBackground","setBackgroundColor","newColor","newValue","setImmutably","setGradient","newGradient","resetBackground","showLinkPanel","linkColor","elements","userLinkColor","setLinkColor","hoverLinkColor","userHoverLinkColor","setHoverLinkColor","hasLink","resetLink","showTextPanel","textColor","userTextColor","hasTextColor","setTextColor","changedObject","resetTextColor","name","showPanel","useCallback","previousValue","reduce","acc","element","items","filter","Boolean","forEach","elementBackgroundColor","elementGradient","elementTextColor","elementBackgroundUserColor","elementGradientUserColor","elementTextUserColor","hasElement","resetElement","setElementTextColor","newTextColor","setElementBackgroundColor","newBackgroundColor","setElementGradient","supportsTextColor","supportsBackground","push","item","restItem","disableCustomColors","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/color-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tColorIndicator,\n\tFlex,\n\tFlexItem,\n\tDropdown,\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\nimport { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';\nimport { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport { unlock } from '../../lock-unlock';\nimport { reset as resetIcon } from '@wordpress/icons';\n\nexport function useHasColorPanel( settings ) {\n\tconst hasTextPanel = useHasTextPanel( settings );\n\tconst hasBackgroundPanel = useHasBackgroundColorPanel( settings );\n\tconst hasLinkPanel = useHasLinkPanel( settings );\n\tconst hasHeadingPanel = useHasHeadingPanel( settings );\n\tconst hasButtonPanel = useHasButtonPanel( settings );\n\tconst hasCaptionPanel = useHasCaptionPanel( settings );\n\n\treturn (\n\t\thasTextPanel ||\n\t\thasBackgroundPanel ||\n\t\thasLinkPanel ||\n\t\thasHeadingPanel ||\n\t\thasButtonPanel ||\n\t\thasCaptionPanel\n\t);\n}\n\nexport function useHasTextPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.text &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasLinkPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.link &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasCaptionPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.caption &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasHeadingPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.heading &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasButtonPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.button &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasBackgroundColorPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.background &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nfunction ColorToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Elements' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper\n\t\t\theadingLevel={ 3 }\n\t\t\tclassName=\"color-block-support-panel\"\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<div className=\"color-block-support-panel__inner-wrapper\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttext: true,\n\tbackground: true,\n\tlink: true,\n\theading: true,\n\tbutton: true,\n\tcaption: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n};\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst LabeledColorIndicators = ( { indicators, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t{ indicators.map( ( indicator, index ) => (\n\t\t\t\t<Flex key={ index } expanded={ false }>\n\t\t\t\t\t<ColorIndicator colorValue={ indicator } />\n\t\t\t\t</Flex>\n\t\t\t) ) }\n\t\t</ZStack>\n\t\t<FlexItem className=\"block-editor-panel-color-gradient-settings__color-name\">\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nfunction ColorPanelTab( {\n\tisGradient,\n\tinheritedValue,\n\tuserValue,\n\tsetValue,\n\tcolorGradientControlSettings,\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...colorGradientControlSettings }\n\t\t\tshowTitle={ false }\n\t\t\tenableAlpha\n\t\t\t__experimentalIsRenderedInSidebar\n\t\t\tcolorValue={ isGradient ? undefined : inheritedValue }\n\t\t\tgradientValue={ isGradient ? inheritedValue : undefined }\n\t\t\tonColorChange={ isGradient ? undefined : setValue }\n\t\t\tonGradientChange={ isGradient ? setValue : undefined }\n\t\t\tclearable={ inheritedValue === userValue }\n\t\t\theadingLevel={ 3 }\n\t\t/>\n\t);\n}\n\nfunction ColorPanelDropdown( {\n\tlabel,\n\thasValue,\n\tresetValue,\n\tisShownByDefault,\n\tindicators,\n\ttabs,\n\tcolorGradientControlSettings,\n\tpanelId,\n} ) {\n\tconst currentTab = tabs.find( ( tab ) => tab.userValue !== undefined );\n\tconst { key: firstTabKey, ...firstTab } = tabs[ 0 ] ?? {};\n\tconst colorGradientDropdownButtonRef = useRef( undefined );\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\thasValue={ hasValue }\n\t\t\tlabel={ label }\n\t\t\tonDeselect={ resetValue }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\t\tconst toggleProps = {\n\t\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t\tref: colorGradientDropdownButtonRef,\n\t\t\t\t\t};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Button { ...toggleProps } __next40pxDefaultSize>\n\t\t\t\t\t\t\t\t<LabeledColorIndicators\n\t\t\t\t\t\t\t\t\tindicators={ indicators }\n\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t{ hasValue() && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-panel-color-gradient-settings__reset\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tresetValue();\n\t\t\t\t\t\t\t\t\t\t// Return focus to parent button\n\t\t\t\t\t\t\t\t\t\tcolorGradientDropdownButtonRef.current?.focus();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t{ tabs.length === 1 && (\n\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\tkey={ firstTabKey }\n\t\t\t\t\t\t\t\t\t{ ...firstTab }\n\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ tabs.length > 1 && (\n\t\t\t\t\t\t\t\t<Tabs defaultTabId={ currentTab?.key }>\n\t\t\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ tab.label }\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t\t</Tabs.TabList>\n\n\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\t\tconst { key: tabKey, ...restTabProps } =\n\t\t\t\t\t\t\t\t\t\t\ttab;\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ ...restTabProps }\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nexport default function ColorPanel( {\n\tas: Wrapper = ColorToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tchildren,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\tconst areCustomSolidsEnabled = settings?.color?.custom;\n\tconst areCustomGradientsEnabled = settings?.color?.customGradient;\n\tconst hasSolidColors = colors.length > 0 || areCustomSolidsEnabled;\n\tconst hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst encodeGradientValue = ( gradientValue ) => {\n\t\tconst allGradients = gradients.flatMap(\n\t\t\t( { gradients: originGradients } ) => originGradients\n\t\t);\n\t\tconst gradientObject = allGradients.find(\n\t\t\t( { gradient } ) => gradient === gradientValue\n\t\t);\n\t\treturn gradientObject\n\t\t\t? 'var:preset|gradient|' + gradientObject.slug\n\t\t\t: gradientValue;\n\t};\n\n\t// BackgroundColor\n\tconst showBackgroundPanel = useHasBackgroundColorPanel( settings );\n\tconst backgroundColor = decodeValue( inheritedValue?.color?.background );\n\tconst userBackgroundColor = decodeValue( value?.color?.background );\n\tconst gradient = decodeValue( inheritedValue?.color?.gradient );\n\tconst userGradient = decodeValue( value?.color?.gradient );\n\tconst hasBackground = () => !! userBackgroundColor || !! userGradient;\n\tconst setBackgroundColor = ( newColor ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst setGradient = ( newGradient ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'gradient' ],\n\t\t\tencodeGradientValue( newGradient )\n\t\t);\n\t\tnewValue.color.background = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst resetBackground = () => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\n\t// Links\n\tconst showLinkPanel = useHasLinkPanel( settings );\n\tconst linkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.color?.text\n\t);\n\tconst userLinkColor = decodeValue( value?.elements?.link?.color?.text );\n\tconst setLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hoverLinkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst userHoverLinkColor = decodeValue(\n\t\tvalue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst setHoverLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLink = () => !! userLinkColor || !! userHoverLinkColor;\n\tconst resetLink = () => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue = setImmutably(\n\t\t\tnewValue,\n\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tonChange( newValue );\n\t};\n\n\t// Text Color\n\tconst showTextPanel = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColor = () => !! userTextColor;\n\tconst setTextColor = ( newColor ) => {\n\t\tlet changedObject = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'text' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tif ( textColor === linkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t);\n\t\t}\n\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Elements\n\tconst elements = [\n\t\t{\n\t\t\tname: 'caption',\n\t\t\tlabel: __( 'Captions' ),\n\t\t\tshowPanel: useHasCaptionPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'button',\n\t\t\tlabel: __( 'Button' ),\n\t\t\tshowPanel: useHasButtonPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'heading',\n\t\t\tlabel: __( 'Heading' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h1',\n\t\t\tlabel: __( 'H1' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h2',\n\t\t\tlabel: __( 'H2' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h3',\n\t\t\tlabel: __( 'H3' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h4',\n\t\t\tlabel: __( 'H4' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h5',\n\t\t\tlabel: __( 'H5' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h6',\n\t\t\tlabel: __( 'H6' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t];\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tcolor: undefined,\n\t\t\telements: {\n\t\t\t\t...previousValue?.elements,\n\t\t\t\tlink: {\n\t\t\t\t\t...previousValue?.elements?.link,\n\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t':hover': {\n\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...elements.reduce( ( acc, element ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t[ element.name ]: {\n\t\t\t\t\t\t\t...previousValue?.elements?.[ element.name ],\n\t\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}, {} ),\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst items = [\n\t\tshowTextPanel && {\n\t\t\tkey: 'text',\n\t\t\tlabel: __( 'Text' ),\n\t\t\thasValue: hasTextColor,\n\t\t\tresetValue: resetTextColor,\n\t\t\tisShownByDefault: defaultControls.text,\n\t\t\tindicators: [ textColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'text',\n\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tshowBackgroundPanel && {\n\t\t\tkey: 'background',\n\t\t\tlabel: __( 'Background' ),\n\t\t\thasValue: hasBackground,\n\t\t\tresetValue: resetBackground,\n\t\t\tisShownByDefault: defaultControls.background,\n\t\t\tindicators: [ gradient ?? backgroundColor ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors && {\n\t\t\t\t\tkey: 'background',\n\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\tinheritedValue: backgroundColor,\n\t\t\t\t\tsetValue: setBackgroundColor,\n\t\t\t\t\tuserValue: userBackgroundColor,\n\t\t\t\t},\n\t\t\t\thasGradientColors && {\n\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\tinheritedValue: gradient,\n\t\t\t\t\tsetValue: setGradient,\n\t\t\t\t\tuserValue: userGradient,\n\t\t\t\t\tisGradient: true,\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t},\n\t\tshowLinkPanel && {\n\t\t\tkey: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\thasValue: hasLink,\n\t\t\tresetValue: resetLink,\n\t\t\tisShownByDefault: defaultControls.link,\n\t\t\tindicators: [ linkColor, hoverLinkColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'link',\n\t\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\t\tinheritedValue: linkColor,\n\t\t\t\t\tsetValue: setLinkColor,\n\t\t\t\t\tuserValue: userLinkColor,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tkey: 'hover',\n\t\t\t\t\tlabel: __( 'Hover' ),\n\t\t\t\t\tinheritedValue: hoverLinkColor,\n\t\t\t\t\tsetValue: setHoverLinkColor,\n\t\t\t\t\tuserValue: userHoverLinkColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t].filter( Boolean );\n\n\telements.forEach( ( { name, label, showPanel } ) => {\n\t\tif ( ! showPanel ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementBackgroundColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradient = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst elementBackgroundUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradientUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst hasElement = () =>\n\t\t\t!! (\n\t\t\t\telementTextUserColor ||\n\t\t\t\telementBackgroundUserColor ||\n\t\t\t\telementGradientUserColor\n\t\t\t);\n\t\tconst resetElement = () => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tundefined\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tnewValue.elements[ name ].color.text = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\n\t\tconst setElementTextColor = ( newTextColor ) => {\n\t\t\tonChange(\n\t\t\t\tsetImmutably(\n\t\t\t\t\tvalue,\n\t\t\t\t\t[ 'elements', name, 'color', 'text' ],\n\t\t\t\t\tencodeColorValue( newTextColor )\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tconst setElementBackgroundColor = ( newBackgroundColor ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tencodeColorValue( newBackgroundColor )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst setElementGradient = ( newGradient ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'gradient' ],\n\t\t\t\tencodeGradientValue( newGradient )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.background = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst supportsTextColor = true;\n\t\t// Background color is not supported for `caption`\n\t\t// as there isn't yet a way to set padding for the element.\n\t\tconst supportsBackground = name !== 'caption';\n\n\t\titems.push( {\n\t\t\tkey: name,\n\t\t\tlabel,\n\t\t\thasValue: hasElement,\n\t\t\tresetValue: resetElement,\n\t\t\tisShownByDefault: defaultControls[ name ],\n\t\t\tindicators:\n\t\t\t\tsupportsTextColor && supportsBackground\n\t\t\t\t\t? [\n\t\t\t\t\t\t\telementTextColor,\n\t\t\t\t\t\t\telementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tsupportsTextColor\n\t\t\t\t\t\t\t\t? elementTextColor\n\t\t\t\t\t\t\t\t: elementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsTextColor && {\n\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\t\tinheritedValue: elementTextColor,\n\t\t\t\t\t\tsetValue: setElementTextColor,\n\t\t\t\t\t\tuserValue: elementTextUserColor,\n\t\t\t\t\t},\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'background',\n\t\t\t\t\t\tlabel: __( 'Background' ),\n\t\t\t\t\t\tinheritedValue: elementBackgroundColor,\n\t\t\t\t\t\tsetValue: setElementBackgroundColor,\n\t\t\t\t\t\tuserValue: elementBackgroundUserColor,\n\t\t\t\t\t},\n\t\t\t\thasGradientColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\t\tinheritedValue: elementGradient,\n\t\t\t\t\t\tsetValue: setElementGradient,\n\t\t\t\t\t\tuserValue: elementGradientUserColor,\n\t\t\t\t\t\tisGradient: true,\n\t\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\tconst { key, ...restItem } = item;\n\t\t\t\treturn (\n\t\t\t\t\t<ColorPanelDropdown\n\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t{ ...restItem }\n\t\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t\t\tgradients,\n\t\t\t\t\t\t\tdisableCustomGradients: ! areCustomGradientsEnabled,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ children }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA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ASN,CAAC;IAEJ,CAAE,CAAC,EACD7D,QAAQ;EAAA,CACF,CAAC;AAEZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_i18n","_control","_hooks","_utils","_object","_lockUnlock","_icons","_jsxRuntime","useHasColorPanel","settings","hasTextPanel","useHasTextPanel","hasBackgroundPanel","useHasBackgroundColorPanel","hasLinkPanel","useHasLinkPanel","hasHeadingPanel","useHasHeadingPanel","hasButtonPanel","useHasButtonPanel","hasCaptionPanel","useHasCaptionPanel","colors","useColorsPerOrigin","color","text","length","custom","link","caption","gradients","useGradientsPerOrigin","heading","customGradient","button","background","ColorToolsPanel","resetAllFilter","onChange","value","panelId","children","dropdownMenuProps","useToolsPanelDropdownMenuProps","resetAll","updatedValue","jsx","__experimentalToolsPanel","label","__","hasInnerWrapper","headingLevel","className","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","DEFAULT_CONTROLS","popoverProps","placement","offset","shift","Tabs","unlock","componentsPrivateApis","LabeledColorIndicators","indicators","jsxs","__experimentalHStack","justify","__experimentalZStack","isLayered","map","indicator","index","Flex","expanded","ColorIndicator","colorValue","FlexItem","ColorPanelTab","isGradient","inheritedValue","userValue","setValue","colorGradientControlSettings","default","showTitle","enableAlpha","__experimentalIsRenderedInSidebar","undefined","gradientValue","onColorChange","onGradientChange","clearable","ColorPanelDropdown","hasValue","resetValue","isShownByDefault","tabs","_tabs$","currentTab","find","tab","key","firstTabKey","firstTab","colorGradientDropdownButtonRef","useRef","__experimentalToolsPanelItem","onDeselect","Dropdown","renderToggle","onToggle","isOpen","toggleProps","onClick","clsx","ref","Fragment","Button","__next40pxDefaultSize","size","icon","resetIcon","current","focus","renderContent","__experimentalDropdownContentWrapper","paddingSize","defaultTabId","TabList","Tab","tabId","tabKey","restTabProps","TabPanel","focusable","ColorPanel","as","Wrapper","defaultControls","areCustomSolidsEnabled","areCustomGradientsEnabled","hasSolidColors","hasGradientColors","decodeValue","rawValue","getValueFromVariable","encodeColorValue","allColors","flatMap","originColors","colorObject","slug","encodeGradientValue","allGradients","originGradients","gradientObject","gradient","showBackgroundPanel","backgroundColor","userBackgroundColor","userGradient","hasBackground","setBackgroundColor","newColor","newValue","setImmutably","setGradient","newGradient","resetBackground","showLinkPanel","linkColor","elements","userLinkColor","setLinkColor","hoverLinkColor","userHoverLinkColor","setHoverLinkColor","hasLink","resetLink","showTextPanel","textColor","userTextColor","hasTextColor","setTextColor","changedObject","resetTextColor","name","showPanel","useCallback","previousValue","reduce","acc","element","items","filter","Boolean","forEach","elementBackgroundColor","elementGradient","elementTextColor","elementBackgroundUserColor","elementGradientUserColor","elementTextUserColor","hasElement","resetElement","setElementTextColor","newTextColor","setElementBackgroundColor","newBackgroundColor","setElementGradient","supportsTextColor","supportsBackground","push","item","restItem","disableCustomColors","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/color-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tColorIndicator,\n\tFlex,\n\tFlexItem,\n\tDropdown,\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\nimport { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';\nimport { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport { unlock } from '../../lock-unlock';\nimport { reset as resetIcon } from '@wordpress/icons';\n\nexport function useHasColorPanel( settings ) {\n\tconst hasTextPanel = useHasTextPanel( settings );\n\tconst hasBackgroundPanel = useHasBackgroundColorPanel( settings );\n\tconst hasLinkPanel = useHasLinkPanel( settings );\n\tconst hasHeadingPanel = useHasHeadingPanel( settings );\n\tconst hasButtonPanel = useHasButtonPanel( settings );\n\tconst hasCaptionPanel = useHasCaptionPanel( settings );\n\n\treturn (\n\t\thasTextPanel ||\n\t\thasBackgroundPanel ||\n\t\thasLinkPanel ||\n\t\thasHeadingPanel ||\n\t\thasButtonPanel ||\n\t\thasCaptionPanel\n\t);\n}\n\nexport function useHasTextPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.text &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasLinkPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.link &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasCaptionPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.caption &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasHeadingPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.heading &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasButtonPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.button &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasBackgroundColorPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.background &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nfunction ColorToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Elements' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper\n\t\t\theadingLevel={ 3 }\n\t\t\tclassName=\"color-block-support-panel\"\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<div className=\"color-block-support-panel__inner-wrapper\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttext: true,\n\tbackground: true,\n\tlink: true,\n\theading: true,\n\tbutton: true,\n\tcaption: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n};\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst LabeledColorIndicators = ( { indicators, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t{ indicators.map( ( indicator, index ) => (\n\t\t\t\t<Flex key={ index } expanded={ false }>\n\t\t\t\t\t<ColorIndicator colorValue={ indicator } />\n\t\t\t\t</Flex>\n\t\t\t) ) }\n\t\t</ZStack>\n\t\t<FlexItem className=\"block-editor-panel-color-gradient-settings__color-name\">\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nfunction ColorPanelTab( {\n\tisGradient,\n\tinheritedValue,\n\tuserValue,\n\tsetValue,\n\tcolorGradientControlSettings,\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...colorGradientControlSettings }\n\t\t\tshowTitle={ false }\n\t\t\tenableAlpha\n\t\t\t__experimentalIsRenderedInSidebar\n\t\t\tcolorValue={ isGradient ? undefined : inheritedValue }\n\t\t\tgradientValue={ isGradient ? inheritedValue : undefined }\n\t\t\tonColorChange={ isGradient ? undefined : setValue }\n\t\t\tonGradientChange={ isGradient ? setValue : undefined }\n\t\t\tclearable={ inheritedValue === userValue }\n\t\t\theadingLevel={ 3 }\n\t\t/>\n\t);\n}\n\nfunction ColorPanelDropdown( {\n\tlabel,\n\thasValue,\n\tresetValue,\n\tisShownByDefault,\n\tindicators,\n\ttabs,\n\tcolorGradientControlSettings,\n\tpanelId,\n} ) {\n\tconst currentTab = tabs.find( ( tab ) => tab.userValue !== undefined );\n\tconst { key: firstTabKey, ...firstTab } = tabs[ 0 ] ?? {};\n\tconst colorGradientDropdownButtonRef = useRef( undefined );\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\thasValue={ hasValue }\n\t\t\tlabel={ label }\n\t\t\tonDeselect={ resetValue }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\t\tconst toggleProps = {\n\t\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t\tref: colorGradientDropdownButtonRef,\n\t\t\t\t\t};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Button { ...toggleProps } __next40pxDefaultSize>\n\t\t\t\t\t\t\t\t<LabeledColorIndicators\n\t\t\t\t\t\t\t\t\tindicators={ indicators }\n\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t{ hasValue() && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-panel-color-gradient-settings__reset\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tresetValue();\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Return focus to parent button\n\t\t\t\t\t\t\t\t\t\tcolorGradientDropdownButtonRef.current?.focus();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t{ tabs.length === 1 && (\n\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\tkey={ firstTabKey }\n\t\t\t\t\t\t\t\t\t{ ...firstTab }\n\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ tabs.length > 1 && (\n\t\t\t\t\t\t\t\t<Tabs defaultTabId={ currentTab?.key }>\n\t\t\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ tab.label }\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t\t</Tabs.TabList>\n\n\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\t\tconst { key: tabKey, ...restTabProps } =\n\t\t\t\t\t\t\t\t\t\t\ttab;\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ tabKey }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ ...restTabProps }\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nexport default function ColorPanel( {\n\tas: Wrapper = ColorToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tchildren,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\tconst areCustomSolidsEnabled = settings?.color?.custom;\n\tconst areCustomGradientsEnabled = settings?.color?.customGradient;\n\tconst hasSolidColors = colors.length > 0 || areCustomSolidsEnabled;\n\tconst hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst encodeGradientValue = ( gradientValue ) => {\n\t\tconst allGradients = gradients.flatMap(\n\t\t\t( { gradients: originGradients } ) => originGradients\n\t\t);\n\t\tconst gradientObject = allGradients.find(\n\t\t\t( { gradient } ) => gradient === gradientValue\n\t\t);\n\t\treturn gradientObject\n\t\t\t? 'var:preset|gradient|' + gradientObject.slug\n\t\t\t: gradientValue;\n\t};\n\n\t// BackgroundColor\n\tconst showBackgroundPanel = useHasBackgroundColorPanel( settings );\n\tconst backgroundColor = decodeValue( inheritedValue?.color?.background );\n\tconst userBackgroundColor = decodeValue( value?.color?.background );\n\tconst gradient = decodeValue( inheritedValue?.color?.gradient );\n\tconst userGradient = decodeValue( value?.color?.gradient );\n\tconst hasBackground = () => !! userBackgroundColor || !! userGradient;\n\tconst setBackgroundColor = ( newColor ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst setGradient = ( newGradient ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'gradient' ],\n\t\t\tencodeGradientValue( newGradient )\n\t\t);\n\t\tnewValue.color.background = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst resetBackground = () => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\n\t// Links\n\tconst showLinkPanel = useHasLinkPanel( settings );\n\tconst linkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.color?.text\n\t);\n\tconst userLinkColor = decodeValue( value?.elements?.link?.color?.text );\n\tconst setLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hoverLinkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst userHoverLinkColor = decodeValue(\n\t\tvalue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst setHoverLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLink = () => !! userLinkColor || !! userHoverLinkColor;\n\tconst resetLink = () => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue = setImmutably(\n\t\t\tnewValue,\n\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tonChange( newValue );\n\t};\n\n\t// Text Color\n\tconst showTextPanel = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColor = () => !! userTextColor;\n\tconst setTextColor = ( newColor ) => {\n\t\tlet changedObject = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'text' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tif ( textColor === linkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t);\n\t\t}\n\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Elements\n\tconst elements = [\n\t\t{\n\t\t\tname: 'caption',\n\t\t\tlabel: __( 'Captions' ),\n\t\t\tshowPanel: useHasCaptionPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'button',\n\t\t\tlabel: __( 'Button' ),\n\t\t\tshowPanel: useHasButtonPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'heading',\n\t\t\tlabel: __( 'Heading' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h1',\n\t\t\tlabel: __( 'H1' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h2',\n\t\t\tlabel: __( 'H2' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h3',\n\t\t\tlabel: __( 'H3' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h4',\n\t\t\tlabel: __( 'H4' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h5',\n\t\t\tlabel: __( 'H5' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h6',\n\t\t\tlabel: __( 'H6' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t];\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tcolor: undefined,\n\t\t\telements: {\n\t\t\t\t...previousValue?.elements,\n\t\t\t\tlink: {\n\t\t\t\t\t...previousValue?.elements?.link,\n\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t':hover': {\n\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...elements.reduce( ( acc, element ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t[ element.name ]: {\n\t\t\t\t\t\t\t...previousValue?.elements?.[ element.name ],\n\t\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}, {} ),\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst items = [\n\t\tshowTextPanel && {\n\t\t\tkey: 'text',\n\t\t\tlabel: __( 'Text' ),\n\t\t\thasValue: hasTextColor,\n\t\t\tresetValue: resetTextColor,\n\t\t\tisShownByDefault: defaultControls.text,\n\t\t\tindicators: [ textColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'text',\n\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tshowBackgroundPanel && {\n\t\t\tkey: 'background',\n\t\t\tlabel: __( 'Background' ),\n\t\t\thasValue: hasBackground,\n\t\t\tresetValue: resetBackground,\n\t\t\tisShownByDefault: defaultControls.background,\n\t\t\tindicators: [ gradient ?? backgroundColor ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors && {\n\t\t\t\t\tkey: 'background',\n\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\tinheritedValue: backgroundColor,\n\t\t\t\t\tsetValue: setBackgroundColor,\n\t\t\t\t\tuserValue: userBackgroundColor,\n\t\t\t\t},\n\t\t\t\thasGradientColors && {\n\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\tinheritedValue: gradient,\n\t\t\t\t\tsetValue: setGradient,\n\t\t\t\t\tuserValue: userGradient,\n\t\t\t\t\tisGradient: true,\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t},\n\t\tshowLinkPanel && {\n\t\t\tkey: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\thasValue: hasLink,\n\t\t\tresetValue: resetLink,\n\t\t\tisShownByDefault: defaultControls.link,\n\t\t\tindicators: [ linkColor, hoverLinkColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'link',\n\t\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\t\tinheritedValue: linkColor,\n\t\t\t\t\tsetValue: setLinkColor,\n\t\t\t\t\tuserValue: userLinkColor,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tkey: 'hover',\n\t\t\t\t\tlabel: __( 'Hover' ),\n\t\t\t\t\tinheritedValue: hoverLinkColor,\n\t\t\t\t\tsetValue: setHoverLinkColor,\n\t\t\t\t\tuserValue: userHoverLinkColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t].filter( Boolean );\n\n\telements.forEach( ( { name, label, showPanel } ) => {\n\t\tif ( ! showPanel ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementBackgroundColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradient = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst elementBackgroundUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradientUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst hasElement = () =>\n\t\t\t!! (\n\t\t\t\telementTextUserColor ||\n\t\t\t\telementBackgroundUserColor ||\n\t\t\t\telementGradientUserColor\n\t\t\t);\n\t\tconst resetElement = () => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tundefined\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tnewValue.elements[ name ].color.text = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\n\t\tconst setElementTextColor = ( newTextColor ) => {\n\t\t\tonChange(\n\t\t\t\tsetImmutably(\n\t\t\t\t\tvalue,\n\t\t\t\t\t[ 'elements', name, 'color', 'text' ],\n\t\t\t\t\tencodeColorValue( newTextColor )\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tconst setElementBackgroundColor = ( newBackgroundColor ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tencodeColorValue( newBackgroundColor )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst setElementGradient = ( newGradient ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'gradient' ],\n\t\t\t\tencodeGradientValue( newGradient )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.background = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst supportsTextColor = true;\n\t\t// Background color is not supported for `caption`\n\t\t// as there isn't yet a way to set padding for the element.\n\t\tconst supportsBackground = name !== 'caption';\n\n\t\titems.push( {\n\t\t\tkey: name,\n\t\t\tlabel,\n\t\t\thasValue: hasElement,\n\t\t\tresetValue: resetElement,\n\t\t\tisShownByDefault: defaultControls[ name ],\n\t\t\tindicators:\n\t\t\t\tsupportsTextColor && supportsBackground\n\t\t\t\t\t? [\n\t\t\t\t\t\t\telementTextColor,\n\t\t\t\t\t\t\telementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tsupportsTextColor\n\t\t\t\t\t\t\t\t? elementTextColor\n\t\t\t\t\t\t\t\t: elementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsTextColor && {\n\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\t\tinheritedValue: elementTextColor,\n\t\t\t\t\t\tsetValue: setElementTextColor,\n\t\t\t\t\t\tuserValue: elementTextUserColor,\n\t\t\t\t\t},\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'background',\n\t\t\t\t\t\tlabel: __( 'Background' ),\n\t\t\t\t\t\tinheritedValue: elementBackgroundColor,\n\t\t\t\t\t\tsetValue: setElementBackgroundColor,\n\t\t\t\t\t\tuserValue: elementBackgroundUserColor,\n\t\t\t\t\t},\n\t\t\t\thasGradientColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\t\tinheritedValue: elementGradient,\n\t\t\t\t\t\tsetValue: setElementGradient,\n\t\t\t\t\t\tuserValue: elementGradientUserColor,\n\t\t\t\t\t\tisGradient: true,\n\t\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\tconst { key, ...restItem } = item;\n\t\t\t\treturn (\n\t\t\t\t\t<ColorPanelDropdown\n\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t{ ...restItem }\n\t\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t\t\tgradients,\n\t\t\t\t\t\t\tdisableCustomGradients: ! areCustomGradientsEnabled,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ children }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAsD,IAAAU,WAAA,GAAAV,OAAA;AAhCtD;AACA;AACA;;AAGA;AACA;AACA;;AA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FontStylesAndWeights = require("../../utils/get-font-styles-and-weights"
|
|
|
54
54
|
* @param {Preset} preset
|
|
55
55
|
* @param {Object} settings
|
|
56
56
|
* @param {boolean|TypographySettings} settings.typography.fluid Whether fluid typography is enabled, and, optionally, fluid font size options.
|
|
57
|
-
* @param {Object
|
|
57
|
+
* @param {?Object} settings.typography.layout Layout options.
|
|
58
58
|
*
|
|
59
59
|
* @return {string|*} A font-size value or the value of preset.size.
|
|
60
60
|
*/
|