@wordpress/block-editor 15.21.1 → 15.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/build/components/block-card/index.cjs +4 -5
- package/build/components/block-card/index.cjs.map +2 -2
- package/build/components/block-editing-mode/index.cjs +13 -7
- package/build/components/block-editing-mode/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +35 -20
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-mover/mover-description.cjs +6 -6
- package/build/components/block-mover/mover-description.cjs.map +1 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs +4 -4
- package/build/components/block-patterns-paging/index.cjs.map +2 -2
- package/build/components/block-popover/use-popover-scroll.cjs.map +1 -1
- package/build/components/block-quick-navigation/index.cjs +7 -5
- package/build/components/block-quick-navigation/index.cjs.map +2 -2
- package/build/components/block-rename/modal.cjs +0 -1
- package/build/components/block-rename/modal.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +14 -6
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs +10 -4
- package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +51 -19
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +25 -14
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +4 -1
- package/build/components/colors-gradients/dropdown.cjs.map +3 -3
- package/build/components/contrast-checker/index.cjs +22 -4
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/index.cjs +4 -5
- package/build/components/dimensions-tool/index.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +1 -1
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +153 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +227 -0
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
- package/build/components/global-styles/color-panel.cjs +98 -375
- package/build/components/global-styles/color-panel.cjs.map +3 -3
- package/build/components/global-styles/dimensions-panel.cjs +1 -4
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +34 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +82 -10
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/grid/grid-item-resizer.cjs.map +1 -1
- package/build/components/grid/grid-visualizer.cjs.map +1 -1
- package/build/components/iframe/index.cjs +6 -3
- package/build/components/iframe/index.cjs.map +3 -3
- package/build/components/image-editor/use-transform-image.cjs.map +1 -1
- package/build/components/inserter/get-appender-label.cjs.map +1 -1
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter/search-items.cjs.map +1 -1
- package/build/components/inspector-controls/fill.cjs +1 -3
- package/build/components/inspector-controls/fill.cjs.map +2 -2
- package/build/components/inspector-controls/groups.cjs +2 -0
- package/build/components/inspector-controls/groups.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +76 -32
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
- package/build/components/line-height-control/index.cjs.map +1 -1
- package/build/components/link-control/index.cjs +2 -3
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/link-control/normalize-url.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +1 -10
- package/build/components/list-view/block-select-button.cjs.map +3 -3
- package/build/components/list-view/utils.cjs.map +1 -1
- package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
- package/build/components/provider/index.cjs.map +1 -1
- package/build/components/provider/use-block-sync.cjs +3 -1
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +1 -1
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +1 -1
- package/build/components/rich-text/prevent-event-discovery.cjs +1 -1
- package/build/components/rich-text/prevent-event-discovery.cjs.map +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs +0 -2
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -3
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
- package/build/hooks/anchor.cjs +1 -2
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs +124 -75
- package/build/hooks/background.cjs.map +3 -3
- package/build/hooks/block-fields/index.cjs +13 -2
- package/build/hooks/block-fields/index.cjs.map +2 -2
- package/build/hooks/color.cjs +0 -162
- package/build/hooks/color.cjs.map +3 -3
- package/build/hooks/contrast-checker.cjs +31 -28
- package/build/hooks/contrast-checker.cjs.map +3 -3
- package/build/hooks/custom-class-name.cjs +0 -1
- package/build/hooks/custom-class-name.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +13 -2
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/elements.cjs +142 -0
- package/build/hooks/elements.cjs.map +7 -0
- package/build/hooks/grid-visualizer.cjs +21 -11
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +65 -10
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +6 -3
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/list-view.cjs +10 -7
- package/build/hooks/list-view.cjs.map +2 -2
- package/build/hooks/spacing-visualizer.cjs.map +1 -1
- package/build/hooks/state-utils.cjs.map +1 -1
- package/build/hooks/states.cjs +2 -2
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/style.cjs +50 -6
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/typography.cjs +62 -10
- package/build/hooks/typography.cjs.map +3 -3
- package/build/layouts/flex.cjs +99 -6
- package/build/layouts/flex.cjs.map +2 -2
- package/build/private-apis.cjs +4 -0
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs.map +1 -1
- package/build/store/private-selectors.cjs +19 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs.map +1 -1
- package/build/store/selectors.cjs.map +1 -1
- package/build/utils/block-bindings.cjs +9 -9
- package/build/utils/block-bindings.cjs.map +3 -3
- package/build/utils/color-values.cjs +10 -1
- package/build/utils/color-values.cjs.map +3 -3
- package/build/utils/dom.cjs +2 -5
- package/build/utils/dom.cjs.map +3 -3
- package/build/utils/fit-text-frontend.cjs +6 -2
- package/build/utils/fit-text-frontend.cjs.map +3 -3
- package/build/utils/fit-text-utils.cjs +1 -1
- package/build/utils/fit-text-utils.cjs.map +3 -3
- package/build/utils/format-font-style.cjs +1 -1
- package/build/utils/format-font-style.cjs.map +3 -3
- package/build/utils/format-font-weight.cjs +1 -1
- package/build/utils/format-font-weight.cjs.map +3 -3
- package/build/utils/get-editor-region.cjs +4 -2
- package/build/utils/get-editor-region.cjs.map +3 -3
- package/build/utils/get-font-styles-and-weights.cjs +8 -12
- package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
- package/build/utils/get-px-from-css-unit.cjs +1 -1
- package/build/utils/get-px-from-css-unit.cjs.map +1 -1
- package/build/utils/index.cjs +1 -1
- package/build/utils/index.cjs.map +1 -1
- package/build/utils/math.cjs +1 -1
- package/build/utils/math.cjs.map +3 -3
- package/build/utils/object.cjs +8 -8
- package/build/utils/object.cjs.map +3 -3
- package/build/utils/order-inserter-block-items.cjs +1 -1
- package/build/utils/order-inserter-block-items.cjs.map +3 -3
- package/build/utils/pasting.cjs +4 -2
- package/build/utils/pasting.cjs.map +3 -3
- package/build/utils/selection.cjs +3 -2
- package/build/utils/selection.cjs.map +3 -3
- package/build/utils/sorting.cjs +9 -3
- package/build/utils/sorting.cjs.map +3 -3
- package/build/utils/transform-styles/index.cjs +3 -2
- package/build/utils/transform-styles/index.cjs.map +3 -3
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
- package/build/utils/transform-styles/types.cjs +19 -0
- package/build/utils/transform-styles/types.cjs.map +7 -0
- package/build/utils/types.cjs +19 -0
- package/build/utils/types.cjs.map +7 -0
- package/build-module/components/block-card/index.mjs +5 -6
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-editing-mode/index.mjs +14 -8
- package/build-module/components/block-editing-mode/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +35 -21
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-mover/mover-description.mjs +6 -6
- package/build-module/components/block-mover/mover-description.mjs.map +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +4 -4
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-popover/use-popover-scroll.mjs.map +1 -1
- package/build-module/components/block-quick-navigation/index.mjs +8 -6
- package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
- package/build-module/components/block-rename/modal.mjs +0 -1
- package/build-module/components/block-rename/modal.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +14 -6
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs +10 -4
- package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +51 -19
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +27 -15
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +4 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs +18 -4
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/index.mjs +4 -5
- package/build-module/components/dimensions-tool/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +155 -27
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +207 -0
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
- package/build-module/components/global-styles/color-panel.mjs +106 -387
- package/build-module/components/global-styles/color-panel.mjs.map +3 -3
- package/build-module/components/global-styles/dimensions-panel.mjs +1 -5
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +33 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +84 -10
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
- package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
- package/build-module/components/iframe/index.mjs +6 -3
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/image-editor/use-transform-image.mjs.map +1 -1
- package/build-module/components/inserter/get-appender-label.mjs.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter/search-items.mjs.map +1 -1
- package/build-module/components/inspector-controls/fill.mjs +1 -3
- package/build-module/components/inspector-controls/fill.mjs.map +2 -2
- package/build-module/components/inspector-controls/groups.mjs +2 -0
- package/build-module/components/inspector-controls/groups.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +76 -32
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -1
- package/build-module/components/line-height-control/index.mjs.map +1 -1
- package/build-module/components/link-control/index.mjs +2 -3
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/link-control/normalize-url.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +2 -17
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs.map +1 -1
- package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
- package/build-module/components/provider/index.mjs.map +1 -1
- package/build-module/components/provider/use-block-sync.mjs +3 -1
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.mjs +1 -1
- package/build-module/components/rich-text/prevent-event-discovery.mjs.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.mjs +0 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +10 -3
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-tab-nav.mjs.map +1 -1
- package/build-module/hooks/anchor.mjs +1 -2
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs +123 -75
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-fields/index.mjs +13 -2
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -175
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs +32 -19
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/custom-class-name.mjs +0 -1
- package/build-module/hooks/custom-class-name.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +12 -2
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +115 -0
- package/build-module/hooks/elements.mjs.map +7 -0
- package/build-module/hooks/grid-visualizer.mjs +21 -11
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +68 -10
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -3
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/list-view.mjs +10 -7
- package/build-module/hooks/list-view.mjs.map +2 -2
- package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
- package/build-module/hooks/state-utils.mjs.map +1 -1
- package/build-module/hooks/states.mjs +2 -2
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +53 -8
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +62 -10
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +105 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/private-apis.mjs +8 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs.map +1 -1
- package/build-module/store/private-selectors.mjs +18 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +1 -1
- package/build-module/store/selectors.mjs.map +1 -1
- package/build-module/utils/block-bindings.mjs +9 -9
- package/build-module/utils/block-bindings.mjs.map +3 -3
- package/build-module/utils/color-values.mjs +9 -1
- package/build-module/utils/color-values.mjs.map +3 -3
- package/build-module/utils/dom.mjs +2 -5
- package/build-module/utils/dom.mjs.map +3 -3
- package/build-module/utils/fit-text-frontend.mjs +6 -2
- package/build-module/utils/fit-text-frontend.mjs.map +3 -3
- package/build-module/utils/fit-text-utils.mjs +1 -1
- package/build-module/utils/fit-text-utils.mjs.map +3 -3
- package/build-module/utils/format-font-style.mjs +1 -1
- package/build-module/utils/format-font-style.mjs.map +3 -3
- package/build-module/utils/format-font-weight.mjs +1 -1
- package/build-module/utils/format-font-weight.mjs.map +3 -3
- package/build-module/utils/get-editor-region.mjs +4 -2
- package/build-module/utils/get-editor-region.mjs.map +3 -3
- package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
- package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
- package/build-module/utils/get-px-from-css-unit.mjs +1 -1
- package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
- package/build-module/utils/index.mjs +1 -1
- package/build-module/utils/index.mjs.map +1 -1
- package/build-module/utils/math.mjs +1 -1
- package/build-module/utils/math.mjs.map +3 -3
- package/build-module/utils/object.mjs +8 -8
- package/build-module/utils/object.mjs.map +3 -3
- package/build-module/utils/order-inserter-block-items.mjs +1 -1
- package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
- package/build-module/utils/pasting.mjs +4 -2
- package/build-module/utils/pasting.mjs.map +3 -3
- package/build-module/utils/selection.mjs +3 -2
- package/build-module/utils/selection.mjs.map +3 -3
- package/build-module/utils/sorting.mjs +9 -3
- package/build-module/utils/sorting.mjs.map +3 -3
- package/build-module/utils/transform-styles/index.mjs +3 -2
- package/build-module/utils/transform-styles/index.mjs.map +3 -3
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
- package/build-module/utils/transform-styles/types.mjs +1 -0
- package/build-module/utils/transform-styles/types.mjs.map +7 -0
- package/build-module/utils/types.mjs +1 -0
- package/build-module/utils/types.mjs.map +7 -0
- package/build-style/content-rtl.css +2 -0
- package/build-style/content.css +2 -0
- package/build-style/style-rtl.css +34 -41
- package/build-style/style.css +34 -41
- package/build-types/utils/block-bindings.d.ts +27 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -0
- package/build-types/utils/color-values.d.ts +40 -0
- package/build-types/utils/color-values.d.ts.map +1 -0
- package/build-types/utils/dom.d.ts +19 -19
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/fit-text-frontend.d.ts +7 -0
- package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
- package/build-types/utils/fit-text-utils.d.ts +15 -0
- package/build-types/utils/fit-text-utils.d.ts.map +1 -0
- package/build-types/utils/format-font-style.d.ts +12 -0
- package/build-types/utils/format-font-style.d.ts.map +1 -0
- package/build-types/utils/format-font-weight.d.ts +12 -0
- package/build-types/utils/format-font-weight.d.ts.map +1 -0
- package/build-types/utils/get-editor-region.d.ts +9 -0
- package/build-types/utils/get-editor-region.d.ts.map +1 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
- package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +3 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/math.d.ts +61 -0
- package/build-types/utils/math.d.ts.map +1 -0
- package/build-types/utils/object.d.ts +39 -0
- package/build-types/utils/object.d.ts.map +1 -0
- package/build-types/utils/order-inserter-block-items.d.ts +13 -0
- package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
- package/build-types/utils/pasting.d.ts +28 -0
- package/build-types/utils/pasting.d.ts.map +1 -0
- package/build-types/utils/selection.d.ts +21 -0
- package/build-types/utils/selection.d.ts.map +1 -0
- package/build-types/utils/sorting.d.ts +17 -0
- package/build-types/utils/sorting.d.ts.map +1 -0
- package/build-types/utils/transform-styles/index.d.ts +15 -0
- package/build-types/utils/transform-styles/index.d.ts.map +1 -0
- package/build-types/utils/transform-styles/types.d.ts +13 -0
- package/build-types/utils/transform-styles/types.d.ts.map +1 -0
- package/build-types/utils/types.d.ts +28 -0
- package/build-types/utils/types.d.ts.map +1 -0
- package/package.json +46 -40
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
- package/src/components/block-card/index.js +7 -13
- package/src/components/block-editing-mode/index.js +17 -9
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
- package/src/components/block-inspector/index.js +22 -20
- package/src/components/block-patterns-list/index.js +0 -1
- package/src/components/block-quick-navigation/index.js +7 -7
- package/src/components/block-rename/modal.js +0 -1
- package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
- package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +10 -4
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
- package/src/components/child-layout-control/index.js +65 -20
- package/src/components/child-layout-control/test/index.js +64 -0
- package/src/components/colors-gradients/control.js +29 -12
- package/src/components/colors-gradients/dropdown.js +4 -1
- package/src/components/colors-gradients/style.scss +39 -2
- package/src/components/contrast-checker/README.md +9 -0
- package/src/components/contrast-checker/index.js +42 -3
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/default-block-appender/content.scss +3 -0
- package/src/components/dimensions-tool/index.js +4 -9
- package/src/components/dimensions-tool/scale-tool.js +1 -2
- package/src/components/dimensions-tool/test/index.js +89 -11
- package/src/components/global-styles/background-panel.js +201 -34
- package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
- package/src/components/global-styles/color-panel.js +125 -487
- package/src/components/global-styles/dimensions-panel.js +1 -5
- package/src/components/global-styles/hooks.js +45 -0
- package/src/components/global-styles/shadow-panel-components.js +0 -1
- package/src/components/global-styles/test/background-panel.js +56 -0
- package/src/components/global-styles/test/color-panel.js +172 -118
- package/src/components/global-styles/test/typography-panel.js +167 -0
- package/src/components/global-styles/typography-panel.js +100 -11
- package/src/components/iframe/index.js +8 -3
- package/src/components/inserter/media-tab/media-preview.js +0 -1
- package/src/components/inspector-controls/README.md +0 -2
- package/src/components/inspector-controls/fill.js +6 -8
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/index.js +0 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +78 -28
- package/src/components/link-control/index.js +0 -1
- package/src/components/link-control/test/index.js +2 -3
- package/src/components/list-view/block-select-button.js +2 -18
- package/src/components/preset-input-control/custom-value-controls.js +0 -1
- package/src/components/provider/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +2 -0
- package/src/components/url-popover/image-url-input-ui.js +0 -2
- package/src/components/use-block-display-information/index.js +15 -2
- package/src/components/use-block-display-information/test/index.js +140 -0
- package/src/hooks/anchor.js +0 -1
- package/src/hooks/background.js +210 -133
- package/src/hooks/background.scss +0 -35
- package/src/hooks/block-fields/index.js +27 -2
- package/src/hooks/color.js +2 -205
- package/src/hooks/color.scss +3 -9
- package/src/hooks/contrast-checker.js +60 -17
- package/src/hooks/custom-class-name.js +0 -1
- package/src/hooks/dimensions.js +14 -3
- package/src/hooks/elements.js +140 -0
- package/src/hooks/elements.scss +8 -0
- package/src/hooks/grid-visualizer.js +59 -45
- package/src/hooks/layout-child.js +92 -14
- package/src/hooks/layout.js +6 -3
- package/src/hooks/list-view.js +10 -11
- package/src/hooks/states.js +2 -2
- package/src/hooks/style.js +91 -9
- package/src/hooks/test/background.js +59 -0
- package/src/hooks/test/block-style-state.js +14 -14
- package/src/hooks/test/dimensions.js +71 -0
- package/src/hooks/test/layout-child.js +165 -0
- package/src/hooks/test/layout.js +6 -6
- package/src/hooks/test/style.js +133 -11
- package/src/hooks/typography.js +70 -6
- package/src/layouts/flex.js +118 -15
- package/src/private-apis.js +8 -0
- package/src/store/private-selectors.js +47 -0
- package/src/store/test/private-selectors.js +166 -7
- package/src/store/test/reducer.js +61 -10
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.ts +51 -0
- package/src/utils/color-values.ts +63 -0
- package/src/utils/{dom.js → dom.ts} +27 -27
- package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
- package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
- package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
- package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
- package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
- package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
- package/src/utils/{math.js → math.ts} +37 -30
- package/src/utils/object.ts +89 -0
- package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
- package/src/utils/{pasting.js → pasting.ts} +18 -11
- package/src/utils/{selection.js → selection.ts} +11 -4
- package/src/utils/sorting.ts +81 -0
- package/src/utils/test/color-values.js +44 -1
- package/src/utils/transform-styles/{index.js → index.ts} +25 -25
- package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
- package/src/utils/transform-styles/types.ts +13 -0
- package/src/utils/types.ts +29 -0
- package/src/utils/block-bindings.js +0 -46
- package/src/utils/color-values.js +0 -28
- package/src/utils/object.js +0 -67
- package/src/utils/sorting.js +0 -54
- /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/block-editor/src/components/global-styles/color-panel.js
|
|
31
31
|
var color_panel_exports = {};
|
|
32
32
|
__export(color_panel_exports, {
|
|
33
|
-
ColorPanelDropdown: () => ColorPanelDropdown,
|
|
34
33
|
ColorToolsPanel: () => ColorToolsPanel,
|
|
35
34
|
default: () => ColorPanel,
|
|
36
35
|
useHasBackgroundColorPanel: () => useHasBackgroundColorPanel,
|
|
@@ -42,27 +41,21 @@ __export(color_panel_exports, {
|
|
|
42
41
|
useHasTextPanel: () => useHasTextPanel
|
|
43
42
|
});
|
|
44
43
|
module.exports = __toCommonJS(color_panel_exports);
|
|
45
|
-
var import_clsx = __toESM(require("clsx"));
|
|
46
44
|
var import_components = require("@wordpress/components");
|
|
47
45
|
var import_element = require("@wordpress/element");
|
|
48
46
|
var import_i18n = require("@wordpress/i18n");
|
|
49
|
-
var
|
|
50
|
-
var import_icons = require("@wordpress/icons");
|
|
51
|
-
var import_control = __toESM(require("../colors-gradients/control.cjs"));
|
|
47
|
+
var import_color_gradient_dropdown_item = __toESM(require("./color-gradient-dropdown-item.cjs"));
|
|
52
48
|
var import_hooks = require("./hooks.cjs");
|
|
53
49
|
var import_utils = require("./utils.cjs");
|
|
54
50
|
var import_object = require("../../utils/object.cjs");
|
|
55
51
|
var import_color_values = require("../../utils/color-values.cjs");
|
|
56
|
-
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
57
52
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
53
|
function useHasColorPanel(settings) {
|
|
59
|
-
const hasTextPanel = useHasTextPanel(settings);
|
|
60
|
-
const hasBackgroundPanel = useHasBackgroundColorPanel(settings);
|
|
61
54
|
const hasLinkPanel = useHasLinkPanel(settings);
|
|
62
55
|
const hasHeadingPanel = useHasHeadingPanel(settings);
|
|
63
56
|
const hasButtonPanel = useHasButtonPanel(settings);
|
|
64
57
|
const hasCaptionPanel = useHasCaptionPanel(settings);
|
|
65
|
-
return
|
|
58
|
+
return hasLinkPanel || hasHeadingPanel || hasButtonPanel || hasCaptionPanel;
|
|
66
59
|
}
|
|
67
60
|
function useHasTextPanel(settings) {
|
|
68
61
|
const colors = (0, import_hooks.useColorsPerOrigin)(settings);
|
|
@@ -120,165 +113,12 @@ function ColorToolsPanel({
|
|
|
120
113
|
}
|
|
121
114
|
);
|
|
122
115
|
}
|
|
123
|
-
function encodeColorValueWithPalette(allColors, colorValue, slug) {
|
|
124
|
-
if (slug) {
|
|
125
|
-
return "var:preset|color|" + slug;
|
|
126
|
-
}
|
|
127
|
-
const colorObject = allColors.find(({ color }) => color === colorValue);
|
|
128
|
-
return colorObject ? "var:preset|color|" + colorObject.slug : colorValue;
|
|
129
|
-
}
|
|
130
116
|
var DEFAULT_CONTROLS = {
|
|
131
|
-
text: true,
|
|
132
|
-
background: true,
|
|
133
117
|
link: true,
|
|
134
118
|
heading: true,
|
|
135
119
|
button: true,
|
|
136
120
|
caption: true
|
|
137
121
|
};
|
|
138
|
-
var popoverProps = {
|
|
139
|
-
placement: "left-start",
|
|
140
|
-
offset: 36,
|
|
141
|
-
shift: true
|
|
142
|
-
};
|
|
143
|
-
var { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
144
|
-
var LabeledColorIndicators = ({ indicators, label }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "flex-start", children: [
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalZStack, { isLayered: false, offset: -8, children: indicators.map((indicator, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Flex, { expanded: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ColorIndicator, { colorValue: indicator }) }, index)) }),
|
|
146
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { className: "block-editor-panel-color-gradient-settings__color-name", children: label })
|
|
147
|
-
] });
|
|
148
|
-
function ColorPanelTab({
|
|
149
|
-
isGradient,
|
|
150
|
-
inheritedValue,
|
|
151
|
-
inheritedSlug,
|
|
152
|
-
userValue,
|
|
153
|
-
setValue,
|
|
154
|
-
colorGradientControlSettings
|
|
155
|
-
}) {
|
|
156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
-
import_control.default,
|
|
158
|
-
{
|
|
159
|
-
...colorGradientControlSettings,
|
|
160
|
-
showTitle: false,
|
|
161
|
-
enableAlpha: true,
|
|
162
|
-
__experimentalIsRenderedInSidebar: true,
|
|
163
|
-
colorValue: isGradient ? void 0 : inheritedValue,
|
|
164
|
-
colorSlug: isGradient ? void 0 : inheritedSlug,
|
|
165
|
-
gradientValue: isGradient ? inheritedValue : void 0,
|
|
166
|
-
onColorChange: isGradient ? void 0 : setValue,
|
|
167
|
-
onGradientChange: isGradient ? setValue : void 0,
|
|
168
|
-
clearable: inheritedValue === userValue,
|
|
169
|
-
headingLevel: 3
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
function ColorPanelDropdown({
|
|
174
|
-
label,
|
|
175
|
-
hasValue,
|
|
176
|
-
resetValue,
|
|
177
|
-
isShownByDefault,
|
|
178
|
-
indicators,
|
|
179
|
-
tabs,
|
|
180
|
-
colorGradientControlSettings,
|
|
181
|
-
panelId,
|
|
182
|
-
className = "block-editor-tools-panel-color-gradient-settings__item"
|
|
183
|
-
}) {
|
|
184
|
-
const currentTab = tabs.find((tab) => tab.userValue !== void 0);
|
|
185
|
-
const { key: firstTabKey, ...firstTab } = tabs[0] ?? {};
|
|
186
|
-
const colorGradientDropdownButtonRef = (0, import_element.useRef)(void 0);
|
|
187
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
|
-
import_components.__experimentalToolsPanelItem,
|
|
189
|
-
{
|
|
190
|
-
className,
|
|
191
|
-
hasValue,
|
|
192
|
-
label,
|
|
193
|
-
onDeselect: resetValue,
|
|
194
|
-
isShownByDefault,
|
|
195
|
-
panelId,
|
|
196
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
197
|
-
import_components.Dropdown,
|
|
198
|
-
{
|
|
199
|
-
popoverProps,
|
|
200
|
-
className: "block-editor-tools-panel-color-gradient-settings__dropdown",
|
|
201
|
-
renderToggle: ({ onToggle, isOpen }) => {
|
|
202
|
-
const toggleProps = {
|
|
203
|
-
onClick: onToggle,
|
|
204
|
-
className: (0, import_clsx.default)(
|
|
205
|
-
"block-editor-panel-color-gradient-settings__dropdown",
|
|
206
|
-
{ "is-open": isOpen }
|
|
207
|
-
),
|
|
208
|
-
"aria-expanded": isOpen,
|
|
209
|
-
ref: colorGradientDropdownButtonRef
|
|
210
|
-
};
|
|
211
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
212
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { ...toggleProps, __next40pxDefaultSize: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
213
|
-
LabeledColorIndicators,
|
|
214
|
-
{
|
|
215
|
-
indicators,
|
|
216
|
-
label
|
|
217
|
-
}
|
|
218
|
-
) }),
|
|
219
|
-
hasValue() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
-
import_components.Button,
|
|
221
|
-
{
|
|
222
|
-
__next40pxDefaultSize: true,
|
|
223
|
-
label: (0, import_i18n.__)("Reset"),
|
|
224
|
-
className: "block-editor-panel-color-gradient-settings__reset",
|
|
225
|
-
size: "small",
|
|
226
|
-
icon: import_icons.reset,
|
|
227
|
-
onClick: () => {
|
|
228
|
-
resetValue();
|
|
229
|
-
if (isOpen) {
|
|
230
|
-
onToggle();
|
|
231
|
-
}
|
|
232
|
-
colorGradientDropdownButtonRef.current?.focus();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
|
-
] });
|
|
237
|
-
},
|
|
238
|
-
renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "block-editor-panel-color-gradient-settings__dropdown-content", children: [
|
|
239
|
-
tabs.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
-
ColorPanelTab,
|
|
241
|
-
{
|
|
242
|
-
...firstTab,
|
|
243
|
-
colorGradientControlSettings
|
|
244
|
-
},
|
|
245
|
-
firstTabKey
|
|
246
|
-
),
|
|
247
|
-
tabs.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tabs, { defaultTabId: currentTab?.key, children: [
|
|
248
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.TabList, { children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
249
|
-
Tabs.Tab,
|
|
250
|
-
{
|
|
251
|
-
tabId: tab.key,
|
|
252
|
-
children: tab.label
|
|
253
|
-
},
|
|
254
|
-
tab.key
|
|
255
|
-
)) }),
|
|
256
|
-
tabs.map((tab) => {
|
|
257
|
-
const { key: tabKey, ...restTabProps } = tab;
|
|
258
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
259
|
-
Tabs.TabPanel,
|
|
260
|
-
{
|
|
261
|
-
tabId: tabKey,
|
|
262
|
-
focusable: false,
|
|
263
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
264
|
-
ColorPanelTab,
|
|
265
|
-
{
|
|
266
|
-
...restTabProps,
|
|
267
|
-
colorGradientControlSettings
|
|
268
|
-
},
|
|
269
|
-
tabKey
|
|
270
|
-
)
|
|
271
|
-
},
|
|
272
|
-
tabKey
|
|
273
|
-
);
|
|
274
|
-
})
|
|
275
|
-
] })
|
|
276
|
-
] }) })
|
|
277
|
-
}
|
|
278
|
-
)
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
122
|
function ColorPanel({
|
|
283
123
|
as: Wrapper = ColorToolsPanel,
|
|
284
124
|
value,
|
|
@@ -288,67 +128,20 @@ function ColorPanel({
|
|
|
288
128
|
panelId,
|
|
289
129
|
defaultControls = DEFAULT_CONTROLS,
|
|
290
130
|
label,
|
|
291
|
-
children
|
|
131
|
+
children,
|
|
132
|
+
contrastWarning
|
|
292
133
|
}) {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
[colors]
|
|
305
|
-
);
|
|
306
|
-
const encodeGradientValue = (gradientValue) => {
|
|
307
|
-
const allGradients = gradients.flatMap(
|
|
308
|
-
({ gradients: originGradients }) => originGradients
|
|
309
|
-
);
|
|
310
|
-
const gradientObject = allGradients.find(
|
|
311
|
-
({ gradient: gradient2 }) => gradient2 === gradientValue
|
|
312
|
-
);
|
|
313
|
-
return gradientObject ? "var:preset|gradient|" + gradientObject.slug : gradientValue;
|
|
314
|
-
};
|
|
315
|
-
const showBackgroundPanel = useHasBackgroundColorPanel(settings);
|
|
316
|
-
const backgroundColor = decodeValue(inheritedValue?.color?.background);
|
|
317
|
-
const userBackgroundColor = decodeValue(value?.color?.background);
|
|
318
|
-
const gradient = decodeValue(inheritedValue?.color?.gradient);
|
|
319
|
-
const userGradient = decodeValue(value?.color?.gradient);
|
|
320
|
-
const hasBackground = () => !!userBackgroundColor || !hasBackgroundGradientSupport && !!userGradient;
|
|
321
|
-
const setBackgroundColor = (newColor, newSlug) => {
|
|
322
|
-
const newValue = (0, import_object.setImmutably)(
|
|
323
|
-
value,
|
|
324
|
-
["color", "background"],
|
|
325
|
-
encodeColorValueWithPalette(allColors, newColor, newSlug)
|
|
326
|
-
);
|
|
327
|
-
if (!hasBackgroundGradientSupport) {
|
|
328
|
-
newValue.color.gradient = void 0;
|
|
329
|
-
}
|
|
330
|
-
onChange(newValue);
|
|
331
|
-
};
|
|
332
|
-
const setGradient = (newGradient) => {
|
|
333
|
-
const newValue = (0, import_object.setImmutably)(
|
|
334
|
-
value,
|
|
335
|
-
["color", "gradient"],
|
|
336
|
-
encodeGradientValue(newGradient)
|
|
337
|
-
);
|
|
338
|
-
newValue.color.background = void 0;
|
|
339
|
-
onChange(newValue);
|
|
340
|
-
};
|
|
341
|
-
const resetBackground = () => {
|
|
342
|
-
const newValue = (0, import_object.setImmutably)(
|
|
343
|
-
value,
|
|
344
|
-
["color", "background"],
|
|
345
|
-
void 0
|
|
346
|
-
);
|
|
347
|
-
if (!hasBackgroundGradientSupport) {
|
|
348
|
-
newValue.color.gradient = void 0;
|
|
349
|
-
}
|
|
350
|
-
onChange(newValue);
|
|
351
|
-
};
|
|
134
|
+
const {
|
|
135
|
+
colors,
|
|
136
|
+
gradients,
|
|
137
|
+
areCustomSolidsEnabled,
|
|
138
|
+
areCustomGradientsEnabled,
|
|
139
|
+
hasSolidColors,
|
|
140
|
+
hasGradientColors,
|
|
141
|
+
allColors,
|
|
142
|
+
decodeValue,
|
|
143
|
+
encodeGradientValue
|
|
144
|
+
} = (0, import_hooks.useColorGradientSettings)(settings);
|
|
352
145
|
const showLinkPanel = useHasLinkPanel(settings);
|
|
353
146
|
const linkColor = decodeValue(
|
|
354
147
|
inheritedValue?.elements?.link?.color?.text
|
|
@@ -359,7 +152,7 @@ function ColorPanel({
|
|
|
359
152
|
(0, import_object.setImmutably)(
|
|
360
153
|
value,
|
|
361
154
|
["elements", "link", "color", "text"],
|
|
362
|
-
encodeColorValueWithPalette(allColors, newColor, newSlug)
|
|
155
|
+
(0, import_color_values.encodeColorValueWithPalette)(allColors, newColor, newSlug)
|
|
363
156
|
)
|
|
364
157
|
);
|
|
365
158
|
};
|
|
@@ -374,7 +167,7 @@ function ColorPanel({
|
|
|
374
167
|
(0, import_object.setImmutably)(
|
|
375
168
|
value,
|
|
376
169
|
["elements", "link", ":hover", "color", "text"],
|
|
377
|
-
encodeColorValueWithPalette(allColors, newColor, newSlug)
|
|
170
|
+
(0, import_color_values.encodeColorValueWithPalette)(allColors, newColor, newSlug)
|
|
378
171
|
)
|
|
379
172
|
);
|
|
380
173
|
};
|
|
@@ -392,154 +185,87 @@ function ColorPanel({
|
|
|
392
185
|
);
|
|
393
186
|
onChange(newValue);
|
|
394
187
|
};
|
|
395
|
-
const showTextPanel = useHasTextPanel(settings);
|
|
396
188
|
const showCaptionPanel = useHasCaptionPanel(settings);
|
|
397
189
|
const showButtonPanel = useHasButtonPanel(settings);
|
|
398
190
|
const showHeadingPanel = useHasHeadingPanel(settings);
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
{
|
|
460
|
-
name: "h6",
|
|
461
|
-
label: (0, import_i18n.__)("H6"),
|
|
462
|
-
showPanel: showHeadingPanel
|
|
463
|
-
}
|
|
464
|
-
];
|
|
465
|
-
const resetAllFilter = (previousValue) => {
|
|
466
|
-
return {
|
|
467
|
-
...previousValue,
|
|
468
|
-
color: void 0,
|
|
469
|
-
elements: {
|
|
470
|
-
...previousValue?.elements,
|
|
471
|
-
link: {
|
|
472
|
-
...previousValue?.elements?.link,
|
|
473
|
-
color: void 0,
|
|
474
|
-
":hover": {
|
|
475
|
-
color: void 0
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
...elements.reduce((acc, element) => {
|
|
479
|
-
return {
|
|
480
|
-
...acc,
|
|
481
|
-
[element.name]: {
|
|
482
|
-
...previousValue?.elements?.[element.name],
|
|
191
|
+
const elements = (0, import_element.useMemo)(
|
|
192
|
+
() => [
|
|
193
|
+
{
|
|
194
|
+
name: "caption",
|
|
195
|
+
label: (0, import_i18n.__)("Captions"),
|
|
196
|
+
showPanel: showCaptionPanel
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "button",
|
|
200
|
+
label: (0, import_i18n.__)("Button"),
|
|
201
|
+
showPanel: showButtonPanel
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "heading",
|
|
205
|
+
label: (0, import_i18n.__)("Heading"),
|
|
206
|
+
showPanel: showHeadingPanel
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "h1",
|
|
210
|
+
label: (0, import_i18n.__)("H1"),
|
|
211
|
+
showPanel: showHeadingPanel
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: "h2",
|
|
215
|
+
label: (0, import_i18n.__)("H2"),
|
|
216
|
+
showPanel: showHeadingPanel
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "h3",
|
|
220
|
+
label: (0, import_i18n.__)("H3"),
|
|
221
|
+
showPanel: showHeadingPanel
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "h4",
|
|
225
|
+
label: (0, import_i18n.__)("H4"),
|
|
226
|
+
showPanel: showHeadingPanel
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "h5",
|
|
230
|
+
label: (0, import_i18n.__)("H5"),
|
|
231
|
+
showPanel: showHeadingPanel
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "h6",
|
|
235
|
+
label: (0, import_i18n.__)("H6"),
|
|
236
|
+
showPanel: showHeadingPanel
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
[showCaptionPanel, showButtonPanel, showHeadingPanel]
|
|
240
|
+
);
|
|
241
|
+
const resetAllFilter = (0, import_element.useCallback)(
|
|
242
|
+
(previousValue) => {
|
|
243
|
+
return {
|
|
244
|
+
...previousValue,
|
|
245
|
+
elements: {
|
|
246
|
+
...previousValue?.elements,
|
|
247
|
+
link: {
|
|
248
|
+
...previousValue?.elements?.link,
|
|
249
|
+
color: void 0,
|
|
250
|
+
":hover": {
|
|
483
251
|
color: void 0
|
|
484
252
|
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
resetValue: resetTextColor,
|
|
496
|
-
isShownByDefault: defaultControls.text,
|
|
497
|
-
indicators: [textColor],
|
|
498
|
-
tabs: [
|
|
499
|
-
{
|
|
500
|
-
key: "text",
|
|
501
|
-
label: (0, import_i18n.__)("Text"),
|
|
502
|
-
inheritedValue: textColor,
|
|
503
|
-
inheritedSlug: (0, import_color_values.extractPresetSlug)(
|
|
504
|
-
inheritedValue?.color?.text,
|
|
505
|
-
"color"
|
|
506
|
-
),
|
|
507
|
-
setValue: setTextColor,
|
|
508
|
-
userValue: userTextColor
|
|
509
|
-
}
|
|
510
|
-
]
|
|
511
|
-
},
|
|
512
|
-
showBackgroundPanel && {
|
|
513
|
-
key: "background",
|
|
514
|
-
label: (0, import_i18n.__)("Background"),
|
|
515
|
-
hasValue: hasBackground,
|
|
516
|
-
resetValue: resetBackground,
|
|
517
|
-
isShownByDefault: defaultControls.background,
|
|
518
|
-
indicators: [
|
|
519
|
-
(showGradientColors ? gradient : void 0) ?? backgroundColor
|
|
520
|
-
],
|
|
521
|
-
tabs: [
|
|
522
|
-
hasSolidColors && {
|
|
523
|
-
key: "background",
|
|
524
|
-
label: (0, import_i18n.__)("Color"),
|
|
525
|
-
inheritedValue: backgroundColor,
|
|
526
|
-
inheritedSlug: (0, import_color_values.extractPresetSlug)(
|
|
527
|
-
inheritedValue?.color?.background,
|
|
528
|
-
"color"
|
|
529
|
-
),
|
|
530
|
-
setValue: setBackgroundColor,
|
|
531
|
-
userValue: userBackgroundColor
|
|
532
|
-
},
|
|
533
|
-
showGradientColors && {
|
|
534
|
-
key: "gradient",
|
|
535
|
-
label: (0, import_i18n.__)("Gradient"),
|
|
536
|
-
inheritedValue: gradient,
|
|
537
|
-
setValue: setGradient,
|
|
538
|
-
userValue: userGradient,
|
|
539
|
-
isGradient: true
|
|
253
|
+
},
|
|
254
|
+
...elements.reduce((acc, element) => {
|
|
255
|
+
return {
|
|
256
|
+
...acc,
|
|
257
|
+
[element.name]: {
|
|
258
|
+
...previousValue?.elements?.[element.name],
|
|
259
|
+
color: void 0
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}, {})
|
|
540
263
|
}
|
|
541
|
-
|
|
264
|
+
};
|
|
542
265
|
},
|
|
266
|
+
[elements]
|
|
267
|
+
);
|
|
268
|
+
const items = [
|
|
543
269
|
showLinkPanel && {
|
|
544
270
|
key: "link",
|
|
545
271
|
label: (0, import_i18n.__)("Link"),
|
|
@@ -547,6 +273,7 @@ function ColorPanel({
|
|
|
547
273
|
resetValue: resetLink,
|
|
548
274
|
isShownByDefault: defaultControls.link,
|
|
549
275
|
indicators: [linkColor, hoverLinkColor],
|
|
276
|
+
contrastWarning,
|
|
550
277
|
tabs: [
|
|
551
278
|
{
|
|
552
279
|
key: "link",
|
|
@@ -611,7 +338,7 @@ function ColorPanel({
|
|
|
611
338
|
(0, import_object.setImmutably)(
|
|
612
339
|
value,
|
|
613
340
|
["elements", name, "color", "text"],
|
|
614
|
-
encodeColorValueWithPalette(
|
|
341
|
+
(0, import_color_values.encodeColorValueWithPalette)(
|
|
615
342
|
allColors,
|
|
616
343
|
newTextColor,
|
|
617
344
|
newSlug
|
|
@@ -623,7 +350,7 @@ function ColorPanel({
|
|
|
623
350
|
const newValue = (0, import_object.setImmutably)(
|
|
624
351
|
value,
|
|
625
352
|
["elements", name, "color", "background"],
|
|
626
|
-
encodeColorValueWithPalette(
|
|
353
|
+
(0, import_color_values.encodeColorValueWithPalette)(
|
|
627
354
|
allColors,
|
|
628
355
|
newBackgroundColor,
|
|
629
356
|
newSlug
|
|
@@ -641,7 +368,6 @@ function ColorPanel({
|
|
|
641
368
|
newValue.elements[name].color.background = void 0;
|
|
642
369
|
onChange(newValue);
|
|
643
370
|
};
|
|
644
|
-
const supportsTextColor = true;
|
|
645
371
|
const supportsBackground = name !== "caption";
|
|
646
372
|
items.push({
|
|
647
373
|
key: name,
|
|
@@ -649,14 +375,12 @@ function ColorPanel({
|
|
|
649
375
|
hasValue: hasElement,
|
|
650
376
|
resetValue: resetElement,
|
|
651
377
|
isShownByDefault: defaultControls[name],
|
|
652
|
-
indicators:
|
|
378
|
+
indicators: supportsBackground ? [
|
|
653
379
|
elementTextColor,
|
|
654
380
|
elementGradient ?? elementBackgroundColor
|
|
655
|
-
] : [
|
|
656
|
-
supportsTextColor ? elementTextColor : elementGradient ?? elementBackgroundColor
|
|
657
|
-
],
|
|
381
|
+
] : [elementTextColor],
|
|
658
382
|
tabs: [
|
|
659
|
-
hasSolidColors &&
|
|
383
|
+
hasSolidColors && {
|
|
660
384
|
key: "text",
|
|
661
385
|
label: (0, import_i18n.__)("Text"),
|
|
662
386
|
inheritedValue: elementTextColor,
|
|
@@ -701,7 +425,7 @@ function ColorPanel({
|
|
|
701
425
|
items.map((item) => {
|
|
702
426
|
const { key, ...restItem } = item;
|
|
703
427
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
704
|
-
|
|
428
|
+
import_color_gradient_dropdown_item.default,
|
|
705
429
|
{
|
|
706
430
|
...restItem,
|
|
707
431
|
colorGradientControlSettings: {
|
|
@@ -722,7 +446,6 @@ function ColorPanel({
|
|
|
722
446
|
}
|
|
723
447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
724
448
|
0 && (module.exports = {
|
|
725
|
-
ColorPanelDropdown,
|
|
726
449
|
ColorToolsPanel,
|
|
727
450
|
useHasBackgroundColorPanel,
|
|
728
451
|
useHasButtonPanel,
|