@wordpress/block-editor 16.0.1-next.v.202607070741.0 → 16.1.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 +27 -1
- package/README.md +8 -0
- package/build/components/alignment-control/ui.cjs +2 -4
- package/build/components/alignment-control/ui.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +40 -10
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-alignment-control/ui.cjs +5 -3
- package/build/components/block-alignment-control/ui.cjs.map +2 -2
- package/build/components/block-canvas/index.cjs +6 -1
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-controls/groups.cjs +3 -1
- package/build/components/block-controls/groups.cjs.map +2 -2
- package/build/components/block-edit/edit.cjs +10 -18
- package/build/components/block-edit/edit.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +73 -46
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +4 -1
- package/build/components/block-list/block-html.cjs.map +2 -2
- package/build/components/block-list/block.cjs +9 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +1 -3
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +7 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
- package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-focus-handler.cjs +11 -4
- package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
- package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
- package/build/components/block-parent-selector/index.cjs +2 -2
- package/build/components/block-parent-selector/index.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +43 -24
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-toolbar/switch-section-style.cjs +4 -2
- package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
- package/build/components/block-tools/empty-block-inserter.cjs +2 -7
- package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +7 -2
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
- package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +20 -6
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +16 -6
- package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
- package/build/components/block-visibility/utils.cjs +15 -2
- package/build/components/block-visibility/utils.cjs.map +3 -3
- package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
- package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
- package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
- package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
- package/build/components/border-radius-control/utils.cjs +8 -58
- package/build/components/border-radius-control/utils.cjs.map +2 -2
- package/build/components/child-layout-control/index.cjs +0 -4
- package/build/components/child-layout-control/index.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +5 -3
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/dimension-control/index.cjs +30 -20
- package/build/components/dimension-control/index.cjs.map +3 -3
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
- package/build/components/editor-styles/index.cjs +9 -1
- package/build/components/editor-styles/index.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +66 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/border-panel.cjs +153 -55
- package/build/components/global-styles/border-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
- package/build/components/global-styles/color-panel.cjs +63 -17
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +242 -64
- package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
- package/build/components/global-styles/filters-panel.cjs +59 -20
- package/build/components/global-styles/filters-panel.cjs.map +3 -3
- package/build/components/global-styles/hooks.cjs +4 -1
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +142 -0
- package/build/components/global-styles/inheritance/index.cjs.map +7 -0
- package/build/components/global-styles/inherited-value-context.cjs +173 -0
- package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
- package/build/components/global-styles/shadow-panel-components.cjs +38 -20
- package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
- package/build/components/global-styles/state-control-badges.cjs +39 -3
- package/build/components/global-styles/state-control-badges.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +1 -1
- package/build/components/global-styles/state-control.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +271 -79
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/image-size-control/index.cjs +2 -4
- package/build/components/image-size-control/index.cjs.map +2 -2
- package/build/components/inserter/media-tab/hooks.cjs +33 -6
- package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs +78 -16
- package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/keyboard-shortcuts/index.cjs +19 -11
- package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/line-height-control/index.cjs +1 -2
- package/build/components/line-height-control/index.cjs.map +2 -2
- package/build/components/link-control/index.cjs +3 -1
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/list-view/block.cjs +13 -4
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/media-placeholder/index.cjs +0 -1
- package/build/components/media-placeholder/index.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +2 -1
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/block-refs-provider.cjs +8 -2
- package/build/components/provider/block-refs-provider.cjs.map +2 -2
- package/build/components/provider/index.cjs +1 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs +18 -6
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/provider/use-media-upload-settings.cjs +3 -1
- package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/before-input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/delete.cjs +2 -3
- package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +3 -2
- package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
- package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
- package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
- package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
- package/build/components/rich-text/index.cjs +76 -17
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/spacing-sizes-control/utils.cjs +6 -19
- package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +8 -2
- package/build/components/text-indent-control/index.cjs.map +2 -2
- package/build/components/typewriter/index.cjs +129 -136
- package/build/components/typewriter/index.cjs.map +3 -3
- package/build/components/url-input/index.cjs +303 -344
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/use-block-commands/index.cjs +21 -17
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/use-on-block-drop/index.cjs +1 -1
- package/build/components/use-on-block-drop/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +14 -1
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-click-selection.cjs +29 -3
- package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +3 -8
- package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
- package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
- package/build/components/writing-flow/use-editable-root.cjs +75 -0
- package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
- package/build/components/writing-flow/use-home-end.cjs +64 -0
- package/build/components/writing-flow/use-home-end.cjs.map +7 -0
- package/build/components/writing-flow/use-input.cjs +15 -5
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs +2 -2
- package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-select-all.cjs +14 -2
- package/build/components/writing-flow/use-select-all.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +132 -22
- package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
- package/build/components/writing-flow/utils.cjs +28 -2
- package/build/components/writing-flow/utils.cjs.map +2 -2
- package/build/hooks/background.cjs +14 -10
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-fields/rich-text/index.cjs +2 -3
- package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
- package/build/hooks/block-style-variation.cjs +4 -45
- package/build/hooks/block-style-variation.cjs.map +3 -3
- package/build/hooks/border.cjs +19 -4
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +6 -2
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/hooks/dimensions.cjs +15 -4
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs +26 -14
- package/build/hooks/duotone.cjs.map +3 -3
- package/build/hooks/elements.cjs +15 -5
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +5 -3
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +22 -12
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/hooks/layout.cjs +28 -13
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/line-height.cjs +1 -2
- package/build/hooks/line-height.cjs.map +2 -2
- package/build/hooks/states.cjs +27 -7
- package/build/hooks/states.cjs.map +3 -3
- package/build/hooks/style.cjs +31 -9
- package/build/hooks/style.cjs.map +3 -3
- package/build/hooks/text-align.cjs +36 -6
- package/build/hooks/text-align.cjs.map +3 -3
- package/build/hooks/typography.cjs +14 -5
- package/build/hooks/typography.cjs.map +2 -2
- package/build/layouts/constrained.cjs +14 -6
- package/build/layouts/constrained.cjs.map +2 -2
- package/build/layouts/flex.cjs +27 -19
- package/build/layouts/flex.cjs.map +2 -2
- package/build/layouts/grid.cjs +0 -2
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +9 -5
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +11 -6
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +41 -3
- package/build/store/private-selectors.cjs.map +3 -3
- package/build/store/reducer.cjs +6 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +23 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/block-bindings.cjs +29 -0
- package/build/utils/block-bindings.cjs.map +2 -2
- package/build/utils/dom.cjs +14 -0
- package/build/utils/dom.cjs.map +2 -2
- package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
- package/build/utils/native-undo.cjs.map +7 -0
- package/build-module/components/alignment-control/ui.mjs +2 -4
- package/build-module/components/alignment-control/ui.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +43 -10
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-alignment-control/ui.mjs +5 -3
- package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-canvas/index.mjs +7 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-controls/groups.mjs +3 -1
- package/build-module/components/block-controls/groups.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs +11 -18
- package/build-module/components/block-edit/edit.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +74 -46
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +4 -1
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +9 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +1 -3
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +7 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +9 -4
- package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +11 -4
- package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
- package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
- package/build-module/components/block-parent-selector/index.mjs +2 -2
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +43 -24
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
- package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
- package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +7 -2
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
- package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +22 -10
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/utils.mjs +18 -3
- package/build-module/components/block-visibility/utils.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/border-radius-control/utils.mjs +11 -53
- package/build-module/components/border-radius-control/utils.mjs.map +2 -2
- package/build-module/components/child-layout-control/index.mjs +0 -4
- package/build-module/components/child-layout-control/index.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +5 -3
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/dimension-control/index.mjs +30 -20
- package/build-module/components/dimension-control/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/editor-styles/index.mjs +9 -1
- package/build-module/components/editor-styles/index.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +71 -29
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +157 -56
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +63 -17
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +64 -21
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +4 -1
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +108 -0
- package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
- package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
- package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
- package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
- package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
- package/build-module/components/global-styles/state-control-badges.mjs +41 -5
- package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +1 -1
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +276 -80
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +2 -4
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
- package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/keyboard-shortcuts/index.mjs +19 -11
- package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/line-height-control/index.mjs +1 -2
- package/build-module/components/line-height-control/index.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +4 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +13 -4
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/media-placeholder/index.mjs +0 -1
- package/build-module/components/media-placeholder/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +2 -1
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/block-refs-provider.mjs +8 -2
- package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +1 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +18 -6
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
- package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
- package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +79 -14
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
- package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +8 -2
- package/build-module/components/text-indent-control/index.mjs.map +2 -2
- package/build-module/components/typewriter/index.mjs +129 -136
- package/build-module/components/typewriter/index.mjs.map +2 -2
- package/build-module/components/url-input/index.mjs +306 -353
- package/build-module/components/url-input/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +21 -17
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/use-on-block-drop/index.mjs +2 -2
- package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +14 -1
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
- package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
- package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
- package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
- package/build-module/components/writing-flow/use-editable-root.mjs +54 -0
- package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
- package/build-module/components/writing-flow/use-home-end.mjs +43 -0
- package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
- package/build-module/components/writing-flow/use-input.mjs +15 -5
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
- package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-select-all.mjs +19 -3
- package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +26 -1
- package/build-module/components/writing-flow/utils.mjs.map +2 -2
- package/build-module/hooks/background.mjs +14 -10
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
- package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
- package/build-module/hooks/block-style-variation.mjs +8 -44
- package/build-module/hooks/block-style-variation.mjs.map +2 -2
- package/build-module/hooks/border.mjs +19 -4
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +7 -3
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +15 -4
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs +20 -9
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +15 -5
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +5 -3
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +22 -12
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +28 -13
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/line-height.mjs +1 -2
- package/build-module/hooks/line-height.mjs.map +2 -2
- package/build-module/hooks/states.mjs +27 -7
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +40 -11
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/text-align.mjs +39 -10
- package/build-module/hooks/text-align.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +14 -5
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/constrained.mjs +14 -6
- package/build-module/layouts/constrained.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +27 -19
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +0 -2
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -3
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +12 -7
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -3
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +6 -6
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +23 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/block-bindings.mjs +28 -0
- package/build-module/utils/block-bindings.mjs.map +2 -2
- package/build-module/utils/dom.mjs +13 -0
- package/build-module/utils/dom.mjs.map +2 -2
- package/build-module/utils/native-undo.mjs +29 -0
- package/build-module/utils/native-undo.mjs.map +7 -0
- package/build-style/content-rtl.css +14 -27
- package/build-style/content.css +14 -27
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +191 -61
- package/build-style/style.css +191 -61
- package/build-types/components/block-context/index.d.ts +7 -0
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/block-bindings.d.ts +19 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts +11 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
- package/build-types/utils/pasting.d.ts +1 -1
- package/build-types/utils/pasting.d.ts.map +1 -1
- package/package.json +43 -44
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
- package/src/components/alignment-control/ui.js +2 -4
- package/src/components/background-image-control/index.js +74 -37
- package/src/components/background-image-control/style.scss +13 -4
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-alignment-control/test/index.js +1 -1
- package/src/components/block-alignment-control/ui.js +4 -2
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-canvas/index.js +9 -2
- package/src/components/block-card/style.scss +1 -1
- package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-edit/edit.js +13 -31
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-inspector/index.js +60 -31
- package/src/components/block-list/block-html.js +5 -0
- package/src/components/block-list/block.js +6 -0
- package/src/components/block-list/content.scss +1 -11
- package/src/components/block-list/index.js +0 -2
- package/src/components/block-list/use-block-props/index.js +7 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
- package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
- package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-manager/style.scss +1 -1
- package/src/components/block-navigation/style.scss +1 -1
- package/src/components/block-parent-selector/index.js +5 -2
- package/src/components/block-quick-navigation/style.scss +1 -3
- package/src/components/block-styles/style.scss +2 -2
- package/src/components/block-toolbar/index.js +41 -18
- package/src/components/block-toolbar/switch-section-style.js +5 -2
- package/src/components/block-tools/empty-block-inserter.js +3 -7
- package/src/components/block-tools/index.js +7 -0
- package/src/components/block-types-list/style.scss +0 -1
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/block-vertical-alignment-control/test/index.js +18 -2
- package/src/components/block-vertical-alignment-control/ui.js +3 -5
- package/src/components/block-visibility/modal.js +24 -10
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/test/use-block-visibility.js +128 -35
- package/src/components/block-visibility/test/utils.js +11 -0
- package/src/components/block-visibility/use-block-visibility.js +33 -11
- package/src/components/block-visibility/utils.js +31 -6
- package/src/components/block-visibility/viewport-menu-item.js +10 -1
- package/src/components/block-visibility/viewport-toolbar.js +6 -0
- package/src/components/block-visibility/viewport-visibility-info.js +5 -1
- package/src/components/border-radius-control/test/utils.js +0 -41
- package/src/components/border-radius-control/utils.js +16 -107
- package/src/components/button-block-appender/content.scss +7 -9
- package/src/components/child-layout-control/index.js +0 -4
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
- package/src/components/colors-gradients/control.js +6 -3
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
- package/src/components/dimension-control/index.js +13 -1
- package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
- package/src/components/editor-styles/index.js +16 -1
- package/src/components/font-family/stories/index.story.jsx +1 -1
- package/src/components/global-styles/background-panel.js +107 -34
- package/src/components/global-styles/border-panel.js +219 -48
- package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
- package/src/components/global-styles/color-panel.js +92 -11
- package/src/components/global-styles/dimensions-panel.js +422 -71
- package/src/components/global-styles/filters-panel.js +88 -28
- package/src/components/global-styles/hooks.js +8 -1
- package/src/components/global-styles/inheritance/index.js +204 -0
- package/src/components/global-styles/inheritance/style.scss +184 -0
- package/src/components/global-styles/inheritance/test/index.js +281 -0
- package/src/components/global-styles/inherited-value-context.js +271 -0
- package/src/components/global-styles/shadow-panel-components.js +48 -26
- package/src/components/global-styles/state-control-badges.js +45 -6
- package/src/components/global-styles/state-control.js +2 -2
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/global-styles/test/background-panel.js +338 -1
- package/src/components/global-styles/test/border-panel.js +441 -0
- package/src/components/global-styles/test/color-panel.js +182 -2
- package/src/components/global-styles/test/dimensions-panel.js +753 -0
- package/src/components/global-styles/test/filters-panel.js +194 -0
- package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
- package/src/components/global-styles/test/inherited-value-context.js +454 -0
- package/src/components/global-styles/test/state-control-badges.js +65 -0
- package/src/components/global-styles/test/typography-panel-core.js +185 -0
- package/src/components/global-styles/test/typography-panel.js +849 -12
- package/src/components/global-styles/typography-panel.js +449 -101
- package/src/components/image-editor/style.scss +33 -0
- package/src/components/image-size-control/index.js +0 -2
- package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
- package/src/components/inserter/media-tab/hooks.js +55 -7
- package/src/components/inserter/media-tab/media-panel.js +117 -21
- package/src/components/inserter/media-tab/test/hooks.js +63 -0
- package/src/components/inserter/media-tab/test/media-panel.js +127 -0
- package/src/components/inserter/style.scss +19 -16
- package/src/components/inserter-list-item/style.scss +0 -15
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
- package/src/components/keyboard-shortcuts/index.js +28 -11
- package/src/components/line-height-control/index.js +1 -2
- package/src/components/link-control/index.js +7 -2
- package/src/components/link-control/style.scss +2 -2
- package/src/components/link-control/test/index.js +6 -6
- package/src/components/link-picker/style.scss +1 -2
- package/src/components/list-view/block.js +13 -4
- package/src/components/list-view/style.scss +4 -5
- package/src/components/media-placeholder/index.js +0 -1
- package/src/components/multi-selection-inspector/style.scss +1 -1
- package/src/components/preset-input-control/index.js +4 -1
- package/src/components/provider/block-refs-provider.js +12 -2
- package/src/components/provider/index.js +2 -2
- package/src/components/provider/use-block-sync.js +18 -6
- package/src/components/provider/use-media-upload-settings.js +2 -0
- package/src/components/responsive-block-control/style.scss +1 -1
- package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/delete.js +7 -4
- package/src/components/rich-text/event-listeners/enter.js +10 -4
- package/src/components/rich-text/event-listeners/input-events.js +4 -3
- package/src/components/rich-text/event-listeners/input-rules.js +8 -5
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
- package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
- package/src/components/rich-text/index.js +116 -26
- package/src/components/skip-to-selected-block/style.scss +1 -1
- package/src/components/spacing-sizes-control/test/utils.js +16 -5
- package/src/components/spacing-sizes-control/utils.js +11 -28
- package/src/components/text-indent-control/index.js +8 -0
- package/src/components/typewriter/index.js +228 -224
- package/src/components/url-input/index.js +363 -431
- package/src/components/url-input/test/index.js +592 -0
- package/src/components/use-block-commands/index.js +27 -17
- package/src/components/use-on-block-drop/index.js +2 -2
- package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
- package/src/components/writing-flow/index.js +17 -1
- package/src/components/writing-flow/use-arrow-nav.js +90 -13
- package/src/components/writing-flow/use-click-selection.js +55 -5
- package/src/components/writing-flow/use-clipboard-handler.js +5 -2
- package/src/components/writing-flow/use-drag-selection.js +1 -14
- package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
- package/src/components/writing-flow/use-editable-root.js +112 -0
- package/src/components/writing-flow/use-home-end.js +71 -0
- package/src/components/writing-flow/use-input.js +25 -8
- package/src/components/writing-flow/use-multi-selection.js +2 -3
- package/src/components/writing-flow/use-select-all.js +33 -3
- package/src/components/writing-flow/use-selection-observer.js +218 -42
- package/src/components/writing-flow/utils.js +62 -0
- package/src/hooks/background.js +27 -24
- package/src/hooks/block-fields/link/styles.scss +1 -6
- package/src/hooks/block-fields/media/styles.scss +1 -6
- package/src/hooks/block-fields/rich-text/index.js +6 -9
- package/src/hooks/block-fields/rich-text/styles.scss +1 -1
- package/src/hooks/block-style-variation.js +8 -74
- package/src/hooks/border.js +19 -4
- package/src/hooks/custom-css.js +15 -6
- package/src/hooks/dimensions.js +17 -4
- package/src/hooks/duotone.js +26 -8
- package/src/hooks/elements.js +14 -4
- package/src/hooks/grid-visualizer.js +40 -36
- package/src/hooks/layout-child.js +19 -9
- package/src/hooks/layout.js +48 -31
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/states.js +38 -9
- package/src/hooks/style.js +67 -17
- package/src/hooks/test/inherited-value-wiring.js +411 -0
- package/src/hooks/test/preset-round-trip.js +456 -0
- package/src/hooks/test/style.js +29 -0
- package/src/hooks/test/text-align.js +34 -1
- package/src/hooks/text-align.js +41 -10
- package/src/hooks/typography.js +35 -24
- package/src/layouts/constrained.js +5 -1
- package/src/layouts/flex.js +5 -1
- package/src/layouts/grid.js +0 -2
- package/src/private-apis.js +11 -2
- package/src/store/actions.js +53 -19
- package/src/store/private-selectors.js +82 -6
- package/src/store/reducer.js +9 -9
- package/src/store/selectors.js +56 -8
- package/src/store/test/actions.js +1 -1
- package/src/store/test/private-selectors.js +271 -1
- package/src/style.scss +2 -0
- package/src/utils/block-bindings.ts +50 -0
- package/src/utils/dom.ts +33 -0
- package/src/utils/native-undo.js +56 -0
- package/src/utils/test/block-bindings.js +181 -0
- package/build/components/duotone/utils.cjs +0 -87
- package/build/components/duotone/utils.cjs.map +0 -7
- package/build/components/rich-text/input-event.cjs.map +0 -7
- package/build/components/rich-text/shortcut.cjs +0 -51
- package/build/components/rich-text/shortcut.cjs.map +0 -7
- package/build-module/components/duotone/utils.mjs +0 -59
- package/build-module/components/duotone/utils.mjs.map +0 -7
- package/build-module/components/rich-text/input-event.mjs +0 -25
- package/build-module/components/rich-text/input-event.mjs.map +0 -7
- package/build-module/components/rich-text/shortcut.mjs +0 -26
- package/build-module/components/rich-text/shortcut.mjs.map +0 -7
- package/src/components/duotone/utils.js +0 -90
- package/src/components/rich-text/input-event.js +0 -31
- package/src/components/rich-text/shortcut.js +0 -32
- package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
FontSizePicker,
|
|
4
4
|
__experimentalNumberControl as NumberControl,
|
|
5
5
|
__experimentalToolsPanel as ToolsPanel,
|
|
6
|
-
|
|
6
|
+
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
7
7
|
Notice,
|
|
8
8
|
ToggleControl
|
|
9
9
|
} from "@wordpress/components";
|
|
@@ -32,9 +32,22 @@ import {
|
|
|
32
32
|
findNearestStyleAndWeight
|
|
33
33
|
} from "./typography-utils.mjs";
|
|
34
34
|
import { getFontStylesAndWeights } from "../../utils/get-font-styles-and-weights.mjs";
|
|
35
|
+
import {
|
|
36
|
+
getInheritanceProps,
|
|
37
|
+
InheritanceToolsPanelItem,
|
|
38
|
+
isGlobalStylesInheritanceEnabled
|
|
39
|
+
} from "./inheritance/index.mjs";
|
|
35
40
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
41
|
var MIN_TEXT_COLUMNS = 1;
|
|
37
42
|
var MAX_TEXT_COLUMNS = 6;
|
|
43
|
+
function shouldSyncLinkColor(value, inheritedValue) {
|
|
44
|
+
const localLinkColor = value?.elements?.link?.color?.text;
|
|
45
|
+
if (localLinkColor !== void 0) {
|
|
46
|
+
return localLinkColor === value?.color?.text;
|
|
47
|
+
}
|
|
48
|
+
const inheritedLinkColor = inheritedValue?.elements?.link?.color?.text;
|
|
49
|
+
return inheritedLinkColor === void 0 || inheritedValue?.color?.text === inheritedLinkColor;
|
|
50
|
+
}
|
|
38
51
|
function useHasTypographyPanel(settings) {
|
|
39
52
|
const hasFontFamily = useHasFontFamilyControl(settings);
|
|
40
53
|
const hasLineHeight = useHasLineHeightControl(settings);
|
|
@@ -141,6 +154,17 @@ var DEFAULT_CONTROLS = {
|
|
|
141
154
|
writingMode: true,
|
|
142
155
|
textColumns: true
|
|
143
156
|
};
|
|
157
|
+
var EMPTY_VALUES = [void 0, null, ""];
|
|
158
|
+
function hasValue(value) {
|
|
159
|
+
return !EMPTY_VALUES.includes(value);
|
|
160
|
+
}
|
|
161
|
+
function getNumericPlaceholder(rawValue) {
|
|
162
|
+
if (!hasValue(rawValue)) {
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
const [quantity] = parseQuantityAndUnitFromRawValue(rawValue);
|
|
166
|
+
return quantity;
|
|
167
|
+
}
|
|
144
168
|
function TypographyPanel({
|
|
145
169
|
as: Wrapper = TypographyToolsPanel,
|
|
146
170
|
value,
|
|
@@ -150,9 +174,15 @@ function TypographyPanel({
|
|
|
150
174
|
panelId,
|
|
151
175
|
defaultControls = DEFAULT_CONTROLS,
|
|
152
176
|
isGlobalStyles = false,
|
|
177
|
+
showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
|
|
153
178
|
contrastWarning
|
|
154
179
|
}) {
|
|
155
180
|
const { colors, allColors, areCustomSolidsEnabled, decodeValue } = useColorGradientSettings(settings);
|
|
181
|
+
const inheritanceProps = (isInherited, hasLocalOverride, className) => getInheritanceProps(
|
|
182
|
+
showInheritanceLabelIndicators && isInherited,
|
|
183
|
+
showInheritanceLabelIndicators && hasLocalOverride,
|
|
184
|
+
className
|
|
185
|
+
);
|
|
156
186
|
const hasTextColorEnabled = useHasTextPanel(settings);
|
|
157
187
|
const textColor = decodeValue(inheritedValue?.color?.text);
|
|
158
188
|
const userTextColor = decodeValue(value?.color?.text);
|
|
@@ -164,7 +194,8 @@ function TypographyPanel({
|
|
|
164
194
|
newSlug
|
|
165
195
|
);
|
|
166
196
|
let changedObject = setImmutably(value, ["color", "text"], encoded);
|
|
167
|
-
|
|
197
|
+
const syncLinkColor = isGlobalStylesInheritanceEnabled() ? shouldSyncLinkColor(value, inheritedValue) : inheritedValue?.color?.text === inheritedValue?.elements?.link?.color?.text;
|
|
198
|
+
if (syncLinkColor) {
|
|
168
199
|
changedObject = setImmutably(
|
|
169
200
|
changedObject,
|
|
170
201
|
["elements", "link", "color", "text"],
|
|
@@ -175,7 +206,11 @@ function TypographyPanel({
|
|
|
175
206
|
};
|
|
176
207
|
const resetTextColor = () => setTextColor(void 0);
|
|
177
208
|
const hasFontFamilyEnabled = useHasFontFamilyControl(settings);
|
|
178
|
-
const
|
|
209
|
+
const inheritedFontFamily = decodeValue(
|
|
210
|
+
inheritedValue?.typography?.fontFamily
|
|
211
|
+
);
|
|
212
|
+
const fontFamily = decodeValue(value?.typography?.fontFamily) ?? inheritedFontFamily;
|
|
213
|
+
const isFontFamilyPlaceholder = !hasValue(value?.typography?.fontFamily) && hasValue(inheritedFontFamily);
|
|
179
214
|
const { fontFamilies, fontFamilyFaces } = useMemo(() => {
|
|
180
215
|
return getMergedFontFamiliesAndFontFamilyFaces(settings, fontFamily);
|
|
181
216
|
}, [settings, fontFamily]);
|
|
@@ -183,10 +218,11 @@ function TypographyPanel({
|
|
|
183
218
|
const slug = fontFamilies?.find(
|
|
184
219
|
({ fontFamily: f }) => f === newValue
|
|
185
220
|
)?.slug;
|
|
221
|
+
const nextFontFamily = slug ? `var:preset|font-family|${slug}` : newValue;
|
|
186
222
|
let updatedValue = setImmutably(
|
|
187
223
|
value,
|
|
188
224
|
["typography", "fontFamily"],
|
|
189
|
-
|
|
225
|
+
hasValue(nextFontFamily) ? nextFontFamily : void 0
|
|
190
226
|
);
|
|
191
227
|
const newFontFamilyFaces = fontFamilies?.find(({ fontFamily: f }) => f === newValue)?.fontFace ?? [];
|
|
192
228
|
const { fontStyles, fontWeights } = getFontStylesAndWeights(newFontFamilyFaces);
|
|
@@ -207,8 +243,8 @@ function TypographyPanel({
|
|
|
207
243
|
...updatedValue,
|
|
208
244
|
typography: {
|
|
209
245
|
...updatedValue?.typography,
|
|
210
|
-
fontStyle: nearestFontStyle
|
|
211
|
-
fontWeight: nearestFontWeight
|
|
246
|
+
fontStyle: hasValue(nearestFontStyle) ? nearestFontStyle : void 0,
|
|
247
|
+
fontWeight: hasValue(nearestFontWeight) ? nearestFontWeight : void 0
|
|
212
248
|
}
|
|
213
249
|
};
|
|
214
250
|
} else if (fontStyle || fontWeight) {
|
|
@@ -224,14 +260,18 @@ function TypographyPanel({
|
|
|
224
260
|
}
|
|
225
261
|
onChange(updatedValue);
|
|
226
262
|
};
|
|
227
|
-
const hasFontFamily = () =>
|
|
263
|
+
const hasFontFamily = () => hasValue(value?.typography?.fontFamily);
|
|
228
264
|
const resetFontFamily = () => setFontFamily(void 0);
|
|
229
265
|
const hasFontSizeEnabled = useHasFontSizeControl(settings);
|
|
230
266
|
const disableCustomFontSizes = !settings?.typography?.customFontSize;
|
|
231
267
|
const mergedFontSizes = getMergedFontSizes(settings);
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
|
|
268
|
+
const rawLocalFontSize = value?.typography?.fontSize;
|
|
269
|
+
const rawInheritedFontSize = inheritedValue?.typography?.fontSize;
|
|
270
|
+
const rawFontSizeForDisplay = rawLocalFontSize ?? rawInheritedFontSize;
|
|
271
|
+
const fontSize = decodeValue(rawFontSizeForDisplay);
|
|
272
|
+
const inheritedFontSizeDecoded = decodeValue(rawInheritedFontSize);
|
|
273
|
+
const isFontSizePlaceholder = !hasValue(rawLocalFontSize) && hasValue(rawInheritedFontSize);
|
|
274
|
+
const extractSlug = (rawValue) => {
|
|
235
275
|
if (!rawValue || typeof rawValue !== "string") {
|
|
236
276
|
return void 0;
|
|
237
277
|
}
|
|
@@ -245,25 +285,45 @@ function TypographyPanel({
|
|
|
245
285
|
return cssVarMatch[1];
|
|
246
286
|
}
|
|
247
287
|
return void 0;
|
|
248
|
-
}
|
|
288
|
+
};
|
|
289
|
+
const currentFontSizeSlug = extractSlug(rawFontSizeForDisplay);
|
|
290
|
+
const inheritedFontSizeSlug = extractSlug(rawInheritedFontSize);
|
|
249
291
|
const setFontSize = (newValue, metadata) => {
|
|
250
292
|
const actualValue = !!metadata?.slug ? `var:preset|font-size|${metadata?.slug}` : newValue;
|
|
251
293
|
onChange(
|
|
252
294
|
setImmutably(
|
|
253
295
|
value,
|
|
254
296
|
["typography", "fontSize"],
|
|
255
|
-
actualValue
|
|
297
|
+
hasValue(actualValue) ? actualValue : void 0
|
|
256
298
|
)
|
|
257
299
|
);
|
|
258
300
|
};
|
|
259
|
-
const
|
|
301
|
+
const setFontSizeWithInheritedCommit = (newValue, metadata) => {
|
|
302
|
+
if (isFontSizePlaceholder && newValue === void 0 && !metadata) {
|
|
303
|
+
if (inheritedFontSizeSlug) {
|
|
304
|
+
setFontSize(void 0, { slug: inheritedFontSizeSlug });
|
|
305
|
+
} else {
|
|
306
|
+
setFontSize(inheritedFontSizeDecoded);
|
|
307
|
+
}
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
setFontSize(newValue, metadata);
|
|
311
|
+
};
|
|
312
|
+
const hasFontSize = () => hasValue(value?.typography?.fontSize);
|
|
260
313
|
const resetFontSize = () => setFontSize(void 0);
|
|
261
314
|
const hasAppearanceControl = useHasAppearanceControl(settings);
|
|
262
315
|
const appearanceControlLabel = useAppearanceControlLabel(settings);
|
|
263
316
|
const hasFontStyles = settings?.typography?.fontStyle;
|
|
264
317
|
const hasFontWeights = settings?.typography?.fontWeight;
|
|
265
|
-
const
|
|
266
|
-
|
|
318
|
+
const inheritedFontStyle = decodeValue(
|
|
319
|
+
inheritedValue?.typography?.fontStyle
|
|
320
|
+
);
|
|
321
|
+
const inheritedFontWeight = decodeValue(
|
|
322
|
+
inheritedValue?.typography?.fontWeight
|
|
323
|
+
);
|
|
324
|
+
const fontStyle = decodeValue(value?.typography?.fontStyle) ?? inheritedFontStyle;
|
|
325
|
+
const fontWeight = decodeValue(value?.typography?.fontWeight) ?? inheritedFontWeight;
|
|
326
|
+
const isFontAppearancePlaceholder = !hasValue(value?.typography?.fontStyle) && !hasValue(value?.typography?.fontWeight) && (hasValue(inheritedFontStyle) || hasValue(inheritedFontWeight));
|
|
267
327
|
const setFontAppearance = useCallback(
|
|
268
328
|
({ fontStyle: newFontStyle, fontWeight: newFontWeight }) => {
|
|
269
329
|
if (newFontStyle !== fontStyle || newFontWeight !== fontWeight) {
|
|
@@ -271,48 +331,82 @@ function TypographyPanel({
|
|
|
271
331
|
...value,
|
|
272
332
|
typography: {
|
|
273
333
|
...value?.typography,
|
|
274
|
-
fontStyle: newFontStyle
|
|
275
|
-
fontWeight: newFontWeight
|
|
334
|
+
fontStyle: hasValue(newFontStyle) ? newFontStyle : void 0,
|
|
335
|
+
fontWeight: hasValue(newFontWeight) ? newFontWeight : void 0
|
|
276
336
|
}
|
|
277
337
|
});
|
|
278
338
|
}
|
|
279
339
|
},
|
|
280
340
|
[fontStyle, fontWeight, onChange, value]
|
|
281
341
|
);
|
|
282
|
-
const
|
|
342
|
+
const setFontAppearanceWithInheritedCommit = useCallback(
|
|
343
|
+
(next) => {
|
|
344
|
+
if (isFontAppearancePlaceholder && next.fontStyle === fontStyle && next.fontWeight === fontWeight) {
|
|
345
|
+
onChange({
|
|
346
|
+
...value,
|
|
347
|
+
typography: {
|
|
348
|
+
...value?.typography,
|
|
349
|
+
fontStyle: hasValue(fontStyle) ? fontStyle : void 0,
|
|
350
|
+
fontWeight: hasValue(fontWeight) ? fontWeight : void 0
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
setFontAppearance(next);
|
|
356
|
+
},
|
|
357
|
+
[
|
|
358
|
+
isFontAppearancePlaceholder,
|
|
359
|
+
fontStyle,
|
|
360
|
+
fontWeight,
|
|
361
|
+
onChange,
|
|
362
|
+
value,
|
|
363
|
+
setFontAppearance
|
|
364
|
+
]
|
|
365
|
+
);
|
|
366
|
+
const hasFontAppearance = () => hasValue(value?.typography?.fontStyle) || hasValue(value?.typography?.fontWeight);
|
|
283
367
|
const resetFontAppearance = useCallback(() => {
|
|
284
368
|
setFontAppearance({});
|
|
285
369
|
}, [setFontAppearance]);
|
|
286
370
|
const hasLineHeightEnabled = useHasLineHeightControl(settings);
|
|
287
|
-
const
|
|
371
|
+
const localLineHeight = decodeValue(value?.typography?.lineHeight);
|
|
372
|
+
const inheritedLineHeight = decodeValue(
|
|
373
|
+
inheritedValue?.typography?.lineHeight
|
|
374
|
+
);
|
|
375
|
+
const isLineHeightPlaceholder = !hasValue(value?.typography?.lineHeight) && hasValue(inheritedLineHeight);
|
|
288
376
|
const setLineHeight = (newValue) => {
|
|
289
377
|
onChange(
|
|
290
378
|
setImmutably(
|
|
291
379
|
value,
|
|
292
380
|
["typography", "lineHeight"],
|
|
293
|
-
newValue
|
|
381
|
+
hasValue(newValue) ? newValue : void 0
|
|
294
382
|
)
|
|
295
383
|
);
|
|
296
384
|
};
|
|
297
|
-
const hasLineHeight = () => value?.typography?.lineHeight
|
|
385
|
+
const hasLineHeight = () => hasValue(value?.typography?.lineHeight);
|
|
298
386
|
const resetLineHeight = () => setLineHeight(void 0);
|
|
299
387
|
const hasLetterSpacingControl = useHasLetterSpacingControl(settings);
|
|
300
|
-
const
|
|
388
|
+
const localLetterSpacing = decodeValue(value?.typography?.letterSpacing);
|
|
389
|
+
const inheritedLetterSpacing = decodeValue(
|
|
301
390
|
inheritedValue?.typography?.letterSpacing
|
|
302
391
|
);
|
|
392
|
+
const isLetterSpacingPlaceholder = !hasValue(value?.typography?.letterSpacing) && hasValue(inheritedLetterSpacing);
|
|
303
393
|
const setLetterSpacing = (newValue) => {
|
|
304
394
|
onChange(
|
|
305
395
|
setImmutably(
|
|
306
396
|
value,
|
|
307
397
|
["typography", "letterSpacing"],
|
|
308
|
-
newValue
|
|
398
|
+
hasValue(newValue) ? newValue : void 0
|
|
309
399
|
)
|
|
310
400
|
);
|
|
311
401
|
};
|
|
312
|
-
const hasLetterSpacing = () =>
|
|
402
|
+
const hasLetterSpacing = () => hasValue(value?.typography?.letterSpacing);
|
|
313
403
|
const resetLetterSpacing = () => setLetterSpacing(void 0);
|
|
314
404
|
const hasTextIndentControl = useHasTextIndentControl(settings);
|
|
315
|
-
const
|
|
405
|
+
const localTextIndent = decodeValue(value?.typography?.textIndent);
|
|
406
|
+
const inheritedTextIndent = decodeValue(
|
|
407
|
+
inheritedValue?.typography?.textIndent
|
|
408
|
+
);
|
|
409
|
+
const isTextIndentPlaceholder = !hasValue(value?.typography?.textIndent) && hasValue(inheritedTextIndent);
|
|
316
410
|
const textIndentSetting = settings?.typography?.textIndent ?? "subsequent";
|
|
317
411
|
const isTextIndentAll = textIndentSetting === "all";
|
|
318
412
|
const setTextIndentValue = (newValue) => {
|
|
@@ -320,7 +414,7 @@ function TypographyPanel({
|
|
|
320
414
|
setImmutably(
|
|
321
415
|
value,
|
|
322
416
|
["typography", "textIndent"],
|
|
323
|
-
newValue
|
|
417
|
+
hasValue(newValue) ? newValue : void 0
|
|
324
418
|
)
|
|
325
419
|
);
|
|
326
420
|
};
|
|
@@ -334,7 +428,7 @@ function TypographyPanel({
|
|
|
334
428
|
}
|
|
335
429
|
});
|
|
336
430
|
};
|
|
337
|
-
const hasTextIndent = () =>
|
|
431
|
+
const hasTextIndent = () => hasValue(value?.typography?.textIndent);
|
|
338
432
|
const resetTextIndent = () => {
|
|
339
433
|
onChange(
|
|
340
434
|
setImmutably(value, ["typography", "textIndent"], void 0)
|
|
@@ -342,73 +436,117 @@ function TypographyPanel({
|
|
|
342
436
|
};
|
|
343
437
|
const textIndentHelp = isTextIndentAll ? __("Indents the first line of all paragraphs.") : __("Indents the first line of each paragraph after the first one.");
|
|
344
438
|
const hasTextColumnsControl = useHasTextColumnsControl(settings);
|
|
345
|
-
const
|
|
439
|
+
const localTextColumns = decodeValue(value?.typography?.textColumns);
|
|
440
|
+
const inheritedTextColumns = decodeValue(
|
|
441
|
+
inheritedValue?.typography?.textColumns
|
|
442
|
+
);
|
|
443
|
+
const isTextColumnsPlaceholder = !hasValue(value?.typography?.textColumns) && hasValue(inheritedTextColumns);
|
|
346
444
|
const setTextColumns = (newValue) => {
|
|
347
445
|
onChange(
|
|
348
446
|
setImmutably(
|
|
349
447
|
value,
|
|
350
448
|
["typography", "textColumns"],
|
|
351
|
-
newValue
|
|
449
|
+
hasValue(newValue) ? newValue : void 0
|
|
352
450
|
)
|
|
353
451
|
);
|
|
354
452
|
};
|
|
355
|
-
const hasTextColumns = () =>
|
|
453
|
+
const hasTextColumns = () => hasValue(value?.typography?.textColumns);
|
|
356
454
|
const resetTextColumns = () => setTextColumns(void 0);
|
|
357
455
|
const hasTextTransformControl = useHasTextTransformControl(settings);
|
|
358
|
-
const
|
|
456
|
+
const inheritedTextTransform = decodeValue(
|
|
359
457
|
inheritedValue?.typography?.textTransform
|
|
360
458
|
);
|
|
459
|
+
const textTransform = decodeValue(value?.typography?.textTransform) ?? inheritedTextTransform;
|
|
460
|
+
const isTextTransformPlaceholder = !hasValue(value?.typography?.textTransform) && hasValue(inheritedTextTransform);
|
|
361
461
|
const setTextTransform = (newValue) => {
|
|
362
462
|
onChange(
|
|
363
463
|
setImmutably(
|
|
364
464
|
value,
|
|
365
465
|
["typography", "textTransform"],
|
|
366
|
-
newValue
|
|
466
|
+
hasValue(newValue) ? newValue : void 0
|
|
367
467
|
)
|
|
368
468
|
);
|
|
369
469
|
};
|
|
370
|
-
const
|
|
470
|
+
const setTextTransformWithInheritedCommit = (newValue) => {
|
|
471
|
+
if (isTextTransformPlaceholder && newValue === void 0) {
|
|
472
|
+
setTextTransform(inheritedTextTransform);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
setTextTransform(newValue);
|
|
476
|
+
};
|
|
477
|
+
const hasTextTransform = () => hasValue(value?.typography?.textTransform);
|
|
371
478
|
const resetTextTransform = () => setTextTransform(void 0);
|
|
372
479
|
const hasTextDecorationControl = useHasTextDecorationControl(settings);
|
|
373
|
-
const
|
|
480
|
+
const inheritedTextDecoration = decodeValue(
|
|
374
481
|
inheritedValue?.typography?.textDecoration
|
|
375
482
|
);
|
|
483
|
+
const textDecoration = decodeValue(value?.typography?.textDecoration) ?? inheritedTextDecoration;
|
|
484
|
+
const isTextDecorationPlaceholder = !hasValue(value?.typography?.textDecoration) && hasValue(inheritedTextDecoration);
|
|
376
485
|
const setTextDecoration = (newValue) => {
|
|
377
486
|
onChange(
|
|
378
487
|
setImmutably(
|
|
379
488
|
value,
|
|
380
489
|
["typography", "textDecoration"],
|
|
381
|
-
newValue
|
|
490
|
+
hasValue(newValue) ? newValue : void 0
|
|
382
491
|
)
|
|
383
492
|
);
|
|
384
493
|
};
|
|
385
|
-
const
|
|
494
|
+
const setTextDecorationWithInheritedCommit = (newValue) => {
|
|
495
|
+
if (isTextDecorationPlaceholder && newValue === void 0) {
|
|
496
|
+
setTextDecoration(inheritedTextDecoration);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
setTextDecoration(newValue);
|
|
500
|
+
};
|
|
501
|
+
const hasTextDecoration = () => hasValue(value?.typography?.textDecoration);
|
|
386
502
|
const resetTextDecoration = () => setTextDecoration(void 0);
|
|
387
503
|
const hasWritingModeControl = useHasWritingModeControl(settings);
|
|
388
|
-
const
|
|
504
|
+
const inheritedWritingMode = decodeValue(
|
|
505
|
+
inheritedValue?.typography?.writingMode
|
|
506
|
+
);
|
|
507
|
+
const writingMode = decodeValue(value?.typography?.writingMode) ?? inheritedWritingMode;
|
|
508
|
+
const isWritingModePlaceholder = !hasValue(value?.typography?.writingMode) && hasValue(inheritedWritingMode);
|
|
389
509
|
const setWritingMode = (newValue) => {
|
|
390
510
|
onChange(
|
|
391
511
|
setImmutably(
|
|
392
512
|
value,
|
|
393
513
|
["typography", "writingMode"],
|
|
394
|
-
newValue
|
|
514
|
+
hasValue(newValue) ? newValue : void 0
|
|
395
515
|
)
|
|
396
516
|
);
|
|
397
517
|
};
|
|
398
|
-
const
|
|
518
|
+
const setWritingModeWithInheritedCommit = (newValue) => {
|
|
519
|
+
if (isWritingModePlaceholder && newValue === void 0) {
|
|
520
|
+
setWritingMode(inheritedWritingMode);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
setWritingMode(newValue);
|
|
524
|
+
};
|
|
525
|
+
const hasWritingMode = () => hasValue(value?.typography?.writingMode);
|
|
399
526
|
const resetWritingMode = () => setWritingMode(void 0);
|
|
400
527
|
const hasTextAlignmentControl = useHasTextAlignmentControl(settings);
|
|
401
|
-
const
|
|
528
|
+
const inheritedTextAlign = decodeValue(
|
|
529
|
+
inheritedValue?.typography?.textAlign
|
|
530
|
+
);
|
|
531
|
+
const textAlign = decodeValue(value?.typography?.textAlign) ?? inheritedTextAlign;
|
|
532
|
+
const isTextAlignPlaceholder = !hasValue(value?.typography?.textAlign) && hasValue(inheritedTextAlign);
|
|
402
533
|
const setTextAlign = (newValue) => {
|
|
403
534
|
onChange(
|
|
404
535
|
setImmutably(
|
|
405
536
|
value,
|
|
406
537
|
["typography", "textAlign"],
|
|
407
|
-
newValue
|
|
538
|
+
hasValue(newValue) ? newValue : void 0
|
|
408
539
|
)
|
|
409
540
|
);
|
|
410
541
|
};
|
|
411
|
-
const
|
|
542
|
+
const setTextAlignWithInheritedCommit = (newValue) => {
|
|
543
|
+
if (isTextAlignPlaceholder && newValue === void 0) {
|
|
544
|
+
setTextAlign(inheritedTextAlign);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
setTextAlign(newValue);
|
|
548
|
+
};
|
|
549
|
+
const hasTextAlign = () => hasValue(value?.typography?.textAlign);
|
|
412
550
|
const resetTextAlign = () => setTextAlign(void 0);
|
|
413
551
|
const resetAllFilter = useCallback(
|
|
414
552
|
(previousValue) => {
|
|
@@ -444,8 +582,11 @@ function TypographyPanel({
|
|
|
444
582
|
hasValue: hasTextColorValue,
|
|
445
583
|
resetValue: resetTextColor,
|
|
446
584
|
isShownByDefault: defaultControls.textColor,
|
|
447
|
-
indicators: [textColor],
|
|
585
|
+
indicators: [userTextColor ?? textColor],
|
|
448
586
|
contrastWarning,
|
|
587
|
+
showInheritanceLabelIndicators,
|
|
588
|
+
isPlaceholder: userTextColor === void 0 && textColor !== void 0,
|
|
589
|
+
hasInheritedValue: textColor !== void 0,
|
|
449
590
|
tabs: [
|
|
450
591
|
{
|
|
451
592
|
key: "text",
|
|
@@ -455,8 +596,13 @@ function TypographyPanel({
|
|
|
455
596
|
inheritedValue?.color?.text,
|
|
456
597
|
"color"
|
|
457
598
|
),
|
|
599
|
+
userSlug: extractPresetSlug(
|
|
600
|
+
value?.color?.text,
|
|
601
|
+
"color"
|
|
602
|
+
),
|
|
458
603
|
setValue: setTextColor,
|
|
459
|
-
userValue: userTextColor
|
|
604
|
+
userValue: userTextColor,
|
|
605
|
+
isPlaceholder: userTextColor === void 0 && textColor !== void 0
|
|
460
606
|
}
|
|
461
607
|
],
|
|
462
608
|
colorGradientControlSettings: {
|
|
@@ -467,8 +613,12 @@ function TypographyPanel({
|
|
|
467
613
|
}
|
|
468
614
|
),
|
|
469
615
|
hasFontFamilyEnabled && /* @__PURE__ */ jsx(
|
|
470
|
-
|
|
616
|
+
InheritanceToolsPanelItem,
|
|
471
617
|
{
|
|
618
|
+
...inheritanceProps(
|
|
619
|
+
isFontFamilyPlaceholder,
|
|
620
|
+
hasFontFamily() && inheritedFontFamily !== void 0
|
|
621
|
+
),
|
|
472
622
|
label: __("Font"),
|
|
473
623
|
hasValue: hasFontFamily,
|
|
474
624
|
onDeselect: resetFontFamily,
|
|
@@ -485,10 +635,15 @@ function TypographyPanel({
|
|
|
485
635
|
}
|
|
486
636
|
),
|
|
487
637
|
hasFontSizeEnabled && /* @__PURE__ */ jsx(
|
|
488
|
-
|
|
638
|
+
InheritanceToolsPanelItem,
|
|
489
639
|
{
|
|
640
|
+
...inheritanceProps(
|
|
641
|
+
isFontSizePlaceholder,
|
|
642
|
+
hasFontSize() && rawInheritedFontSize !== void 0
|
|
643
|
+
),
|
|
490
644
|
label: __("Size"),
|
|
491
645
|
hasValue: hasFontSize,
|
|
646
|
+
hasInlineEndToggle: true,
|
|
492
647
|
onDeselect: resetFontSize,
|
|
493
648
|
isShownByDefault: defaultControls.fontSize,
|
|
494
649
|
panelId,
|
|
@@ -497,7 +652,7 @@ function TypographyPanel({
|
|
|
497
652
|
{
|
|
498
653
|
value: currentFontSizeSlug || fontSize,
|
|
499
654
|
valueMode: currentFontSizeSlug ? "slug" : "literal",
|
|
500
|
-
onChange:
|
|
655
|
+
onChange: setFontSizeWithInheritedCommit,
|
|
501
656
|
fontSizes: mergedFontSizes,
|
|
502
657
|
disableCustomFontSizes,
|
|
503
658
|
withReset: false,
|
|
@@ -507,8 +662,12 @@ function TypographyPanel({
|
|
|
507
662
|
}
|
|
508
663
|
),
|
|
509
664
|
hasAppearanceControl && /* @__PURE__ */ jsx(
|
|
510
|
-
|
|
665
|
+
InheritanceToolsPanelItem,
|
|
511
666
|
{
|
|
667
|
+
...inheritanceProps(
|
|
668
|
+
isFontAppearancePlaceholder,
|
|
669
|
+
hasFontAppearance() && (inheritedFontStyle !== void 0 || inheritedFontWeight !== void 0)
|
|
670
|
+
),
|
|
512
671
|
label: appearanceControlLabel,
|
|
513
672
|
hasValue: hasFontAppearance,
|
|
514
673
|
onDeselect: resetFontAppearance,
|
|
@@ -521,7 +680,7 @@ function TypographyPanel({
|
|
|
521
680
|
fontStyle,
|
|
522
681
|
fontWeight
|
|
523
682
|
},
|
|
524
|
-
onChange:
|
|
683
|
+
onChange: setFontAppearanceWithInheritedCommit,
|
|
525
684
|
hasFontStyles,
|
|
526
685
|
hasFontWeights,
|
|
527
686
|
fontFamilyFaces
|
|
@@ -530,9 +689,13 @@ function TypographyPanel({
|
|
|
530
689
|
}
|
|
531
690
|
),
|
|
532
691
|
hasLineHeightEnabled && /* @__PURE__ */ jsx(
|
|
533
|
-
|
|
692
|
+
InheritanceToolsPanelItem,
|
|
534
693
|
{
|
|
535
|
-
|
|
694
|
+
...inheritanceProps(
|
|
695
|
+
isLineHeightPlaceholder,
|
|
696
|
+
hasLineHeight() && inheritedLineHeight !== void 0,
|
|
697
|
+
"single-column"
|
|
698
|
+
),
|
|
536
699
|
label: __("Line height"),
|
|
537
700
|
hasValue: hasLineHeight,
|
|
538
701
|
onDeselect: resetLineHeight,
|
|
@@ -542,16 +705,25 @@ function TypographyPanel({
|
|
|
542
705
|
LineHeightControl,
|
|
543
706
|
{
|
|
544
707
|
__unstableInputWidth: "auto",
|
|
545
|
-
value:
|
|
546
|
-
onChange: setLineHeight
|
|
708
|
+
value: localLineHeight ?? inheritedLineHeight,
|
|
709
|
+
onChange: setLineHeight,
|
|
710
|
+
...isLineHeightPlaceholder ? {
|
|
711
|
+
placeholder: getNumericPlaceholder(
|
|
712
|
+
inheritedLineHeight
|
|
713
|
+
)
|
|
714
|
+
} : {}
|
|
547
715
|
}
|
|
548
716
|
)
|
|
549
717
|
}
|
|
550
718
|
),
|
|
551
719
|
hasLetterSpacingControl && /* @__PURE__ */ jsx(
|
|
552
|
-
|
|
720
|
+
InheritanceToolsPanelItem,
|
|
553
721
|
{
|
|
554
|
-
|
|
722
|
+
...inheritanceProps(
|
|
723
|
+
isLetterSpacingPlaceholder,
|
|
724
|
+
hasLetterSpacing() && inheritedLetterSpacing !== void 0,
|
|
725
|
+
"single-column"
|
|
726
|
+
),
|
|
555
727
|
label: __("Letter spacing"),
|
|
556
728
|
hasValue: hasLetterSpacing,
|
|
557
729
|
onDeselect: resetLetterSpacing,
|
|
@@ -560,16 +732,23 @@ function TypographyPanel({
|
|
|
560
732
|
children: /* @__PURE__ */ jsx(
|
|
561
733
|
LetterSpacingControl,
|
|
562
734
|
{
|
|
563
|
-
value:
|
|
735
|
+
value: localLetterSpacing ?? inheritedLetterSpacing,
|
|
564
736
|
onChange: setLetterSpacing,
|
|
565
|
-
__unstableInputWidth: "auto"
|
|
737
|
+
__unstableInputWidth: "auto",
|
|
738
|
+
placeholder: isLetterSpacingPlaceholder ? getNumericPlaceholder(
|
|
739
|
+
inheritedLetterSpacing
|
|
740
|
+
) : void 0
|
|
566
741
|
}
|
|
567
742
|
)
|
|
568
743
|
}
|
|
569
744
|
),
|
|
570
745
|
hasTextIndentControl && /* @__PURE__ */ jsxs(
|
|
571
|
-
|
|
746
|
+
InheritanceToolsPanelItem,
|
|
572
747
|
{
|
|
748
|
+
...inheritanceProps(
|
|
749
|
+
isTextIndentPlaceholder,
|
|
750
|
+
hasTextIndent() && inheritedTextIndent !== void 0
|
|
751
|
+
),
|
|
573
752
|
label: __("Line indent"),
|
|
574
753
|
hasValue: hasTextIndent,
|
|
575
754
|
onDeselect: resetTextIndent,
|
|
@@ -579,11 +758,12 @@ function TypographyPanel({
|
|
|
579
758
|
/* @__PURE__ */ jsx(
|
|
580
759
|
TextIndentControl,
|
|
581
760
|
{
|
|
582
|
-
value:
|
|
761
|
+
value: localTextIndent ?? inheritedTextIndent,
|
|
583
762
|
onChange: setTextIndentValue,
|
|
584
763
|
__unstableInputWidth: "auto",
|
|
585
764
|
withSlider: true,
|
|
586
|
-
hasBottomMargin: isGlobalStyles
|
|
765
|
+
hasBottomMargin: isGlobalStyles,
|
|
766
|
+
placeholder: isTextIndentPlaceholder ? getNumericPlaceholder(inheritedTextIndent) : void 0
|
|
587
767
|
}
|
|
588
768
|
),
|
|
589
769
|
isGlobalStyles && /* @__PURE__ */ jsx(
|
|
@@ -599,9 +779,13 @@ function TypographyPanel({
|
|
|
599
779
|
}
|
|
600
780
|
),
|
|
601
781
|
hasTextColumnsControl && /* @__PURE__ */ jsx(
|
|
602
|
-
|
|
782
|
+
InheritanceToolsPanelItem,
|
|
603
783
|
{
|
|
604
|
-
|
|
784
|
+
...inheritanceProps(
|
|
785
|
+
isTextColumnsPlaceholder,
|
|
786
|
+
hasTextColumns() && inheritedTextColumns !== void 0,
|
|
787
|
+
"single-column"
|
|
788
|
+
),
|
|
605
789
|
label: __("Columns"),
|
|
606
790
|
hasValue: hasTextColumns,
|
|
607
791
|
onDeselect: resetTextColumns,
|
|
@@ -614,18 +798,22 @@ function TypographyPanel({
|
|
|
614
798
|
max: MAX_TEXT_COLUMNS,
|
|
615
799
|
min: MIN_TEXT_COLUMNS,
|
|
616
800
|
onChange: setTextColumns,
|
|
617
|
-
|
|
801
|
+
placeholder: isTextColumnsPlaceholder ? inheritedTextColumns : void 0,
|
|
618
802
|
spinControls: "custom",
|
|
619
|
-
value:
|
|
803
|
+
value: localTextColumns,
|
|
620
804
|
initialPosition: 1
|
|
621
805
|
}
|
|
622
806
|
)
|
|
623
807
|
}
|
|
624
808
|
),
|
|
625
809
|
hasTextDecorationControl && /* @__PURE__ */ jsx(
|
|
626
|
-
|
|
810
|
+
InheritanceToolsPanelItem,
|
|
627
811
|
{
|
|
628
|
-
|
|
812
|
+
...inheritanceProps(
|
|
813
|
+
isTextDecorationPlaceholder,
|
|
814
|
+
hasTextDecoration() && inheritedTextDecoration !== void 0,
|
|
815
|
+
"single-column"
|
|
816
|
+
),
|
|
629
817
|
label: __("Decoration"),
|
|
630
818
|
hasValue: hasTextDecoration,
|
|
631
819
|
onDeselect: resetTextDecoration,
|
|
@@ -635,17 +823,20 @@ function TypographyPanel({
|
|
|
635
823
|
TextDecorationControl,
|
|
636
824
|
{
|
|
637
825
|
value: textDecoration,
|
|
638
|
-
onChange:
|
|
639
|
-
size: "__unstable-large",
|
|
826
|
+
onChange: setTextDecorationWithInheritedCommit,
|
|
640
827
|
__unstableInputWidth: "auto"
|
|
641
828
|
}
|
|
642
829
|
)
|
|
643
830
|
}
|
|
644
831
|
),
|
|
645
832
|
hasWritingModeControl && /* @__PURE__ */ jsx(
|
|
646
|
-
|
|
833
|
+
InheritanceToolsPanelItem,
|
|
647
834
|
{
|
|
648
|
-
|
|
835
|
+
...inheritanceProps(
|
|
836
|
+
isWritingModePlaceholder,
|
|
837
|
+
hasWritingMode() && inheritedWritingMode !== void 0,
|
|
838
|
+
"single-column"
|
|
839
|
+
),
|
|
649
840
|
label: __("Orientation"),
|
|
650
841
|
hasValue: hasWritingMode,
|
|
651
842
|
onDeselect: resetWritingMode,
|
|
@@ -655,15 +846,18 @@ function TypographyPanel({
|
|
|
655
846
|
WritingModeControl,
|
|
656
847
|
{
|
|
657
848
|
value: writingMode,
|
|
658
|
-
onChange:
|
|
659
|
-
size: "__unstable-large"
|
|
849
|
+
onChange: setWritingModeWithInheritedCommit
|
|
660
850
|
}
|
|
661
851
|
)
|
|
662
852
|
}
|
|
663
853
|
),
|
|
664
854
|
hasTextTransformControl && /* @__PURE__ */ jsx(
|
|
665
|
-
|
|
855
|
+
InheritanceToolsPanelItem,
|
|
666
856
|
{
|
|
857
|
+
...inheritanceProps(
|
|
858
|
+
isTextTransformPlaceholder,
|
|
859
|
+
hasTextTransform() && inheritedTextTransform !== void 0
|
|
860
|
+
),
|
|
667
861
|
label: __("Letter case"),
|
|
668
862
|
hasValue: hasTextTransform,
|
|
669
863
|
onDeselect: resetTextTransform,
|
|
@@ -673,17 +867,20 @@ function TypographyPanel({
|
|
|
673
867
|
TextTransformControl,
|
|
674
868
|
{
|
|
675
869
|
value: textTransform,
|
|
676
|
-
onChange:
|
|
870
|
+
onChange: setTextTransformWithInheritedCommit,
|
|
677
871
|
showNone: true,
|
|
678
|
-
isBlock: true
|
|
679
|
-
size: "__unstable-large"
|
|
872
|
+
isBlock: true
|
|
680
873
|
}
|
|
681
874
|
)
|
|
682
875
|
}
|
|
683
876
|
),
|
|
684
877
|
hasTextAlignmentControl && /* @__PURE__ */ jsxs(
|
|
685
|
-
|
|
878
|
+
InheritanceToolsPanelItem,
|
|
686
879
|
{
|
|
880
|
+
...inheritanceProps(
|
|
881
|
+
isTextAlignPlaceholder,
|
|
882
|
+
hasTextAlign() && inheritedTextAlign !== void 0
|
|
883
|
+
),
|
|
687
884
|
label: __("Text alignment"),
|
|
688
885
|
hasValue: hasTextAlign,
|
|
689
886
|
onDeselect: resetTextAlign,
|
|
@@ -694,9 +891,8 @@ function TypographyPanel({
|
|
|
694
891
|
TextAlignmentControl,
|
|
695
892
|
{
|
|
696
893
|
value: textAlign,
|
|
697
|
-
onChange:
|
|
698
|
-
options: ["left", "center", "right", "justify"]
|
|
699
|
-
size: "__unstable-large"
|
|
894
|
+
onChange: setTextAlignWithInheritedCommit,
|
|
895
|
+
options: ["left", "center", "right", "justify"]
|
|
700
896
|
}
|
|
701
897
|
),
|
|
702
898
|
textAlign === "justify" && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Notice, { status: "warning", isDismissible: false, children: __(
|