@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
|
@@ -55,9 +55,18 @@ var import_object = require("../../utils/object.cjs");
|
|
|
55
55
|
var import_color_values = require("../../utils/color-values.cjs");
|
|
56
56
|
var import_typography_utils = require("./typography-utils.cjs");
|
|
57
57
|
var import_get_font_styles_and_weights = require("../../utils/get-font-styles-and-weights.cjs");
|
|
58
|
+
var import_inheritance = require("./inheritance/index.cjs");
|
|
58
59
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
60
|
var MIN_TEXT_COLUMNS = 1;
|
|
60
61
|
var MAX_TEXT_COLUMNS = 6;
|
|
62
|
+
function shouldSyncLinkColor(value, inheritedValue) {
|
|
63
|
+
const localLinkColor = value?.elements?.link?.color?.text;
|
|
64
|
+
if (localLinkColor !== void 0) {
|
|
65
|
+
return localLinkColor === value?.color?.text;
|
|
66
|
+
}
|
|
67
|
+
const inheritedLinkColor = inheritedValue?.elements?.link?.color?.text;
|
|
68
|
+
return inheritedLinkColor === void 0 || inheritedValue?.color?.text === inheritedLinkColor;
|
|
69
|
+
}
|
|
61
70
|
function useHasTypographyPanel(settings) {
|
|
62
71
|
const hasFontFamily = useHasFontFamilyControl(settings);
|
|
63
72
|
const hasLineHeight = useHasLineHeightControl(settings);
|
|
@@ -164,6 +173,17 @@ var DEFAULT_CONTROLS = {
|
|
|
164
173
|
writingMode: true,
|
|
165
174
|
textColumns: true
|
|
166
175
|
};
|
|
176
|
+
var EMPTY_VALUES = [void 0, null, ""];
|
|
177
|
+
function hasValue(value) {
|
|
178
|
+
return !EMPTY_VALUES.includes(value);
|
|
179
|
+
}
|
|
180
|
+
function getNumericPlaceholder(rawValue) {
|
|
181
|
+
if (!hasValue(rawValue)) {
|
|
182
|
+
return void 0;
|
|
183
|
+
}
|
|
184
|
+
const [quantity] = (0, import_components.__experimentalParseQuantityAndUnitFromRawValue)(rawValue);
|
|
185
|
+
return quantity;
|
|
186
|
+
}
|
|
167
187
|
function TypographyPanel({
|
|
168
188
|
as: Wrapper = TypographyToolsPanel,
|
|
169
189
|
value,
|
|
@@ -173,9 +193,15 @@ function TypographyPanel({
|
|
|
173
193
|
panelId,
|
|
174
194
|
defaultControls = DEFAULT_CONTROLS,
|
|
175
195
|
isGlobalStyles = false,
|
|
196
|
+
showInheritanceLabelIndicators = (0, import_inheritance.isGlobalStylesInheritanceEnabled)(),
|
|
176
197
|
contrastWarning
|
|
177
198
|
}) {
|
|
178
199
|
const { colors, allColors, areCustomSolidsEnabled, decodeValue } = (0, import_hooks.useColorGradientSettings)(settings);
|
|
200
|
+
const inheritanceProps = (isInherited, hasLocalOverride, className) => (0, import_inheritance.getInheritanceProps)(
|
|
201
|
+
showInheritanceLabelIndicators && isInherited,
|
|
202
|
+
showInheritanceLabelIndicators && hasLocalOverride,
|
|
203
|
+
className
|
|
204
|
+
);
|
|
179
205
|
const hasTextColorEnabled = (0, import_color_panel.useHasTextPanel)(settings);
|
|
180
206
|
const textColor = decodeValue(inheritedValue?.color?.text);
|
|
181
207
|
const userTextColor = decodeValue(value?.color?.text);
|
|
@@ -187,7 +213,8 @@ function TypographyPanel({
|
|
|
187
213
|
newSlug
|
|
188
214
|
);
|
|
189
215
|
let changedObject = (0, import_object.setImmutably)(value, ["color", "text"], encoded);
|
|
190
|
-
|
|
216
|
+
const syncLinkColor = (0, import_inheritance.isGlobalStylesInheritanceEnabled)() ? shouldSyncLinkColor(value, inheritedValue) : inheritedValue?.color?.text === inheritedValue?.elements?.link?.color?.text;
|
|
217
|
+
if (syncLinkColor) {
|
|
191
218
|
changedObject = (0, import_object.setImmutably)(
|
|
192
219
|
changedObject,
|
|
193
220
|
["elements", "link", "color", "text"],
|
|
@@ -198,7 +225,11 @@ function TypographyPanel({
|
|
|
198
225
|
};
|
|
199
226
|
const resetTextColor = () => setTextColor(void 0);
|
|
200
227
|
const hasFontFamilyEnabled = useHasFontFamilyControl(settings);
|
|
201
|
-
const
|
|
228
|
+
const inheritedFontFamily = decodeValue(
|
|
229
|
+
inheritedValue?.typography?.fontFamily
|
|
230
|
+
);
|
|
231
|
+
const fontFamily = decodeValue(value?.typography?.fontFamily) ?? inheritedFontFamily;
|
|
232
|
+
const isFontFamilyPlaceholder = !hasValue(value?.typography?.fontFamily) && hasValue(inheritedFontFamily);
|
|
202
233
|
const { fontFamilies, fontFamilyFaces } = (0, import_element.useMemo)(() => {
|
|
203
234
|
return (0, import_typography_utils.getMergedFontFamiliesAndFontFamilyFaces)(settings, fontFamily);
|
|
204
235
|
}, [settings, fontFamily]);
|
|
@@ -206,10 +237,11 @@ function TypographyPanel({
|
|
|
206
237
|
const slug = fontFamilies?.find(
|
|
207
238
|
({ fontFamily: f }) => f === newValue
|
|
208
239
|
)?.slug;
|
|
240
|
+
const nextFontFamily = slug ? `var:preset|font-family|${slug}` : newValue;
|
|
209
241
|
let updatedValue = (0, import_object.setImmutably)(
|
|
210
242
|
value,
|
|
211
243
|
["typography", "fontFamily"],
|
|
212
|
-
|
|
244
|
+
hasValue(nextFontFamily) ? nextFontFamily : void 0
|
|
213
245
|
);
|
|
214
246
|
const newFontFamilyFaces = fontFamilies?.find(({ fontFamily: f }) => f === newValue)?.fontFace ?? [];
|
|
215
247
|
const { fontStyles, fontWeights } = (0, import_get_font_styles_and_weights.getFontStylesAndWeights)(newFontFamilyFaces);
|
|
@@ -230,8 +262,8 @@ function TypographyPanel({
|
|
|
230
262
|
...updatedValue,
|
|
231
263
|
typography: {
|
|
232
264
|
...updatedValue?.typography,
|
|
233
|
-
fontStyle: nearestFontStyle
|
|
234
|
-
fontWeight: nearestFontWeight
|
|
265
|
+
fontStyle: hasValue(nearestFontStyle) ? nearestFontStyle : void 0,
|
|
266
|
+
fontWeight: hasValue(nearestFontWeight) ? nearestFontWeight : void 0
|
|
235
267
|
}
|
|
236
268
|
};
|
|
237
269
|
} else if (fontStyle || fontWeight) {
|
|
@@ -247,14 +279,18 @@ function TypographyPanel({
|
|
|
247
279
|
}
|
|
248
280
|
onChange(updatedValue);
|
|
249
281
|
};
|
|
250
|
-
const hasFontFamily = () =>
|
|
282
|
+
const hasFontFamily = () => hasValue(value?.typography?.fontFamily);
|
|
251
283
|
const resetFontFamily = () => setFontFamily(void 0);
|
|
252
284
|
const hasFontSizeEnabled = useHasFontSizeControl(settings);
|
|
253
285
|
const disableCustomFontSizes = !settings?.typography?.customFontSize;
|
|
254
286
|
const mergedFontSizes = getMergedFontSizes(settings);
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
|
|
287
|
+
const rawLocalFontSize = value?.typography?.fontSize;
|
|
288
|
+
const rawInheritedFontSize = inheritedValue?.typography?.fontSize;
|
|
289
|
+
const rawFontSizeForDisplay = rawLocalFontSize ?? rawInheritedFontSize;
|
|
290
|
+
const fontSize = decodeValue(rawFontSizeForDisplay);
|
|
291
|
+
const inheritedFontSizeDecoded = decodeValue(rawInheritedFontSize);
|
|
292
|
+
const isFontSizePlaceholder = !hasValue(rawLocalFontSize) && hasValue(rawInheritedFontSize);
|
|
293
|
+
const extractSlug = (rawValue) => {
|
|
258
294
|
if (!rawValue || typeof rawValue !== "string") {
|
|
259
295
|
return void 0;
|
|
260
296
|
}
|
|
@@ -268,25 +304,45 @@ function TypographyPanel({
|
|
|
268
304
|
return cssVarMatch[1];
|
|
269
305
|
}
|
|
270
306
|
return void 0;
|
|
271
|
-
}
|
|
307
|
+
};
|
|
308
|
+
const currentFontSizeSlug = extractSlug(rawFontSizeForDisplay);
|
|
309
|
+
const inheritedFontSizeSlug = extractSlug(rawInheritedFontSize);
|
|
272
310
|
const setFontSize = (newValue, metadata) => {
|
|
273
311
|
const actualValue = !!metadata?.slug ? `var:preset|font-size|${metadata?.slug}` : newValue;
|
|
274
312
|
onChange(
|
|
275
313
|
(0, import_object.setImmutably)(
|
|
276
314
|
value,
|
|
277
315
|
["typography", "fontSize"],
|
|
278
|
-
actualValue
|
|
316
|
+
hasValue(actualValue) ? actualValue : void 0
|
|
279
317
|
)
|
|
280
318
|
);
|
|
281
319
|
};
|
|
282
|
-
const
|
|
320
|
+
const setFontSizeWithInheritedCommit = (newValue, metadata) => {
|
|
321
|
+
if (isFontSizePlaceholder && newValue === void 0 && !metadata) {
|
|
322
|
+
if (inheritedFontSizeSlug) {
|
|
323
|
+
setFontSize(void 0, { slug: inheritedFontSizeSlug });
|
|
324
|
+
} else {
|
|
325
|
+
setFontSize(inheritedFontSizeDecoded);
|
|
326
|
+
}
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
setFontSize(newValue, metadata);
|
|
330
|
+
};
|
|
331
|
+
const hasFontSize = () => hasValue(value?.typography?.fontSize);
|
|
283
332
|
const resetFontSize = () => setFontSize(void 0);
|
|
284
333
|
const hasAppearanceControl = useHasAppearanceControl(settings);
|
|
285
334
|
const appearanceControlLabel = useAppearanceControlLabel(settings);
|
|
286
335
|
const hasFontStyles = settings?.typography?.fontStyle;
|
|
287
336
|
const hasFontWeights = settings?.typography?.fontWeight;
|
|
288
|
-
const
|
|
289
|
-
|
|
337
|
+
const inheritedFontStyle = decodeValue(
|
|
338
|
+
inheritedValue?.typography?.fontStyle
|
|
339
|
+
);
|
|
340
|
+
const inheritedFontWeight = decodeValue(
|
|
341
|
+
inheritedValue?.typography?.fontWeight
|
|
342
|
+
);
|
|
343
|
+
const fontStyle = decodeValue(value?.typography?.fontStyle) ?? inheritedFontStyle;
|
|
344
|
+
const fontWeight = decodeValue(value?.typography?.fontWeight) ?? inheritedFontWeight;
|
|
345
|
+
const isFontAppearancePlaceholder = !hasValue(value?.typography?.fontStyle) && !hasValue(value?.typography?.fontWeight) && (hasValue(inheritedFontStyle) || hasValue(inheritedFontWeight));
|
|
290
346
|
const setFontAppearance = (0, import_element.useCallback)(
|
|
291
347
|
({ fontStyle: newFontStyle, fontWeight: newFontWeight }) => {
|
|
292
348
|
if (newFontStyle !== fontStyle || newFontWeight !== fontWeight) {
|
|
@@ -294,48 +350,82 @@ function TypographyPanel({
|
|
|
294
350
|
...value,
|
|
295
351
|
typography: {
|
|
296
352
|
...value?.typography,
|
|
297
|
-
fontStyle: newFontStyle
|
|
298
|
-
fontWeight: newFontWeight
|
|
353
|
+
fontStyle: hasValue(newFontStyle) ? newFontStyle : void 0,
|
|
354
|
+
fontWeight: hasValue(newFontWeight) ? newFontWeight : void 0
|
|
299
355
|
}
|
|
300
356
|
});
|
|
301
357
|
}
|
|
302
358
|
},
|
|
303
359
|
[fontStyle, fontWeight, onChange, value]
|
|
304
360
|
);
|
|
305
|
-
const
|
|
361
|
+
const setFontAppearanceWithInheritedCommit = (0, import_element.useCallback)(
|
|
362
|
+
(next) => {
|
|
363
|
+
if (isFontAppearancePlaceholder && next.fontStyle === fontStyle && next.fontWeight === fontWeight) {
|
|
364
|
+
onChange({
|
|
365
|
+
...value,
|
|
366
|
+
typography: {
|
|
367
|
+
...value?.typography,
|
|
368
|
+
fontStyle: hasValue(fontStyle) ? fontStyle : void 0,
|
|
369
|
+
fontWeight: hasValue(fontWeight) ? fontWeight : void 0
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
setFontAppearance(next);
|
|
375
|
+
},
|
|
376
|
+
[
|
|
377
|
+
isFontAppearancePlaceholder,
|
|
378
|
+
fontStyle,
|
|
379
|
+
fontWeight,
|
|
380
|
+
onChange,
|
|
381
|
+
value,
|
|
382
|
+
setFontAppearance
|
|
383
|
+
]
|
|
384
|
+
);
|
|
385
|
+
const hasFontAppearance = () => hasValue(value?.typography?.fontStyle) || hasValue(value?.typography?.fontWeight);
|
|
306
386
|
const resetFontAppearance = (0, import_element.useCallback)(() => {
|
|
307
387
|
setFontAppearance({});
|
|
308
388
|
}, [setFontAppearance]);
|
|
309
389
|
const hasLineHeightEnabled = useHasLineHeightControl(settings);
|
|
310
|
-
const
|
|
390
|
+
const localLineHeight = decodeValue(value?.typography?.lineHeight);
|
|
391
|
+
const inheritedLineHeight = decodeValue(
|
|
392
|
+
inheritedValue?.typography?.lineHeight
|
|
393
|
+
);
|
|
394
|
+
const isLineHeightPlaceholder = !hasValue(value?.typography?.lineHeight) && hasValue(inheritedLineHeight);
|
|
311
395
|
const setLineHeight = (newValue) => {
|
|
312
396
|
onChange(
|
|
313
397
|
(0, import_object.setImmutably)(
|
|
314
398
|
value,
|
|
315
399
|
["typography", "lineHeight"],
|
|
316
|
-
newValue
|
|
400
|
+
hasValue(newValue) ? newValue : void 0
|
|
317
401
|
)
|
|
318
402
|
);
|
|
319
403
|
};
|
|
320
|
-
const hasLineHeight = () => value?.typography?.lineHeight
|
|
404
|
+
const hasLineHeight = () => hasValue(value?.typography?.lineHeight);
|
|
321
405
|
const resetLineHeight = () => setLineHeight(void 0);
|
|
322
406
|
const hasLetterSpacingControl = useHasLetterSpacingControl(settings);
|
|
323
|
-
const
|
|
407
|
+
const localLetterSpacing = decodeValue(value?.typography?.letterSpacing);
|
|
408
|
+
const inheritedLetterSpacing = decodeValue(
|
|
324
409
|
inheritedValue?.typography?.letterSpacing
|
|
325
410
|
);
|
|
411
|
+
const isLetterSpacingPlaceholder = !hasValue(value?.typography?.letterSpacing) && hasValue(inheritedLetterSpacing);
|
|
326
412
|
const setLetterSpacing = (newValue) => {
|
|
327
413
|
onChange(
|
|
328
414
|
(0, import_object.setImmutably)(
|
|
329
415
|
value,
|
|
330
416
|
["typography", "letterSpacing"],
|
|
331
|
-
newValue
|
|
417
|
+
hasValue(newValue) ? newValue : void 0
|
|
332
418
|
)
|
|
333
419
|
);
|
|
334
420
|
};
|
|
335
|
-
const hasLetterSpacing = () =>
|
|
421
|
+
const hasLetterSpacing = () => hasValue(value?.typography?.letterSpacing);
|
|
336
422
|
const resetLetterSpacing = () => setLetterSpacing(void 0);
|
|
337
423
|
const hasTextIndentControl = useHasTextIndentControl(settings);
|
|
338
|
-
const
|
|
424
|
+
const localTextIndent = decodeValue(value?.typography?.textIndent);
|
|
425
|
+
const inheritedTextIndent = decodeValue(
|
|
426
|
+
inheritedValue?.typography?.textIndent
|
|
427
|
+
);
|
|
428
|
+
const isTextIndentPlaceholder = !hasValue(value?.typography?.textIndent) && hasValue(inheritedTextIndent);
|
|
339
429
|
const textIndentSetting = settings?.typography?.textIndent ?? "subsequent";
|
|
340
430
|
const isTextIndentAll = textIndentSetting === "all";
|
|
341
431
|
const setTextIndentValue = (newValue) => {
|
|
@@ -343,7 +433,7 @@ function TypographyPanel({
|
|
|
343
433
|
(0, import_object.setImmutably)(
|
|
344
434
|
value,
|
|
345
435
|
["typography", "textIndent"],
|
|
346
|
-
newValue
|
|
436
|
+
hasValue(newValue) ? newValue : void 0
|
|
347
437
|
)
|
|
348
438
|
);
|
|
349
439
|
};
|
|
@@ -357,7 +447,7 @@ function TypographyPanel({
|
|
|
357
447
|
}
|
|
358
448
|
});
|
|
359
449
|
};
|
|
360
|
-
const hasTextIndent = () =>
|
|
450
|
+
const hasTextIndent = () => hasValue(value?.typography?.textIndent);
|
|
361
451
|
const resetTextIndent = () => {
|
|
362
452
|
onChange(
|
|
363
453
|
(0, import_object.setImmutably)(value, ["typography", "textIndent"], void 0)
|
|
@@ -365,73 +455,117 @@ function TypographyPanel({
|
|
|
365
455
|
};
|
|
366
456
|
const textIndentHelp = isTextIndentAll ? (0, import_i18n.__)("Indents the first line of all paragraphs.") : (0, import_i18n.__)("Indents the first line of each paragraph after the first one.");
|
|
367
457
|
const hasTextColumnsControl = useHasTextColumnsControl(settings);
|
|
368
|
-
const
|
|
458
|
+
const localTextColumns = decodeValue(value?.typography?.textColumns);
|
|
459
|
+
const inheritedTextColumns = decodeValue(
|
|
460
|
+
inheritedValue?.typography?.textColumns
|
|
461
|
+
);
|
|
462
|
+
const isTextColumnsPlaceholder = !hasValue(value?.typography?.textColumns) && hasValue(inheritedTextColumns);
|
|
369
463
|
const setTextColumns = (newValue) => {
|
|
370
464
|
onChange(
|
|
371
465
|
(0, import_object.setImmutably)(
|
|
372
466
|
value,
|
|
373
467
|
["typography", "textColumns"],
|
|
374
|
-
newValue
|
|
468
|
+
hasValue(newValue) ? newValue : void 0
|
|
375
469
|
)
|
|
376
470
|
);
|
|
377
471
|
};
|
|
378
|
-
const hasTextColumns = () =>
|
|
472
|
+
const hasTextColumns = () => hasValue(value?.typography?.textColumns);
|
|
379
473
|
const resetTextColumns = () => setTextColumns(void 0);
|
|
380
474
|
const hasTextTransformControl = useHasTextTransformControl(settings);
|
|
381
|
-
const
|
|
475
|
+
const inheritedTextTransform = decodeValue(
|
|
382
476
|
inheritedValue?.typography?.textTransform
|
|
383
477
|
);
|
|
478
|
+
const textTransform = decodeValue(value?.typography?.textTransform) ?? inheritedTextTransform;
|
|
479
|
+
const isTextTransformPlaceholder = !hasValue(value?.typography?.textTransform) && hasValue(inheritedTextTransform);
|
|
384
480
|
const setTextTransform = (newValue) => {
|
|
385
481
|
onChange(
|
|
386
482
|
(0, import_object.setImmutably)(
|
|
387
483
|
value,
|
|
388
484
|
["typography", "textTransform"],
|
|
389
|
-
newValue
|
|
485
|
+
hasValue(newValue) ? newValue : void 0
|
|
390
486
|
)
|
|
391
487
|
);
|
|
392
488
|
};
|
|
393
|
-
const
|
|
489
|
+
const setTextTransformWithInheritedCommit = (newValue) => {
|
|
490
|
+
if (isTextTransformPlaceholder && newValue === void 0) {
|
|
491
|
+
setTextTransform(inheritedTextTransform);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
setTextTransform(newValue);
|
|
495
|
+
};
|
|
496
|
+
const hasTextTransform = () => hasValue(value?.typography?.textTransform);
|
|
394
497
|
const resetTextTransform = () => setTextTransform(void 0);
|
|
395
498
|
const hasTextDecorationControl = useHasTextDecorationControl(settings);
|
|
396
|
-
const
|
|
499
|
+
const inheritedTextDecoration = decodeValue(
|
|
397
500
|
inheritedValue?.typography?.textDecoration
|
|
398
501
|
);
|
|
502
|
+
const textDecoration = decodeValue(value?.typography?.textDecoration) ?? inheritedTextDecoration;
|
|
503
|
+
const isTextDecorationPlaceholder = !hasValue(value?.typography?.textDecoration) && hasValue(inheritedTextDecoration);
|
|
399
504
|
const setTextDecoration = (newValue) => {
|
|
400
505
|
onChange(
|
|
401
506
|
(0, import_object.setImmutably)(
|
|
402
507
|
value,
|
|
403
508
|
["typography", "textDecoration"],
|
|
404
|
-
newValue
|
|
509
|
+
hasValue(newValue) ? newValue : void 0
|
|
405
510
|
)
|
|
406
511
|
);
|
|
407
512
|
};
|
|
408
|
-
const
|
|
513
|
+
const setTextDecorationWithInheritedCommit = (newValue) => {
|
|
514
|
+
if (isTextDecorationPlaceholder && newValue === void 0) {
|
|
515
|
+
setTextDecoration(inheritedTextDecoration);
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
setTextDecoration(newValue);
|
|
519
|
+
};
|
|
520
|
+
const hasTextDecoration = () => hasValue(value?.typography?.textDecoration);
|
|
409
521
|
const resetTextDecoration = () => setTextDecoration(void 0);
|
|
410
522
|
const hasWritingModeControl = useHasWritingModeControl(settings);
|
|
411
|
-
const
|
|
523
|
+
const inheritedWritingMode = decodeValue(
|
|
524
|
+
inheritedValue?.typography?.writingMode
|
|
525
|
+
);
|
|
526
|
+
const writingMode = decodeValue(value?.typography?.writingMode) ?? inheritedWritingMode;
|
|
527
|
+
const isWritingModePlaceholder = !hasValue(value?.typography?.writingMode) && hasValue(inheritedWritingMode);
|
|
412
528
|
const setWritingMode = (newValue) => {
|
|
413
529
|
onChange(
|
|
414
530
|
(0, import_object.setImmutably)(
|
|
415
531
|
value,
|
|
416
532
|
["typography", "writingMode"],
|
|
417
|
-
newValue
|
|
533
|
+
hasValue(newValue) ? newValue : void 0
|
|
418
534
|
)
|
|
419
535
|
);
|
|
420
536
|
};
|
|
421
|
-
const
|
|
537
|
+
const setWritingModeWithInheritedCommit = (newValue) => {
|
|
538
|
+
if (isWritingModePlaceholder && newValue === void 0) {
|
|
539
|
+
setWritingMode(inheritedWritingMode);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
setWritingMode(newValue);
|
|
543
|
+
};
|
|
544
|
+
const hasWritingMode = () => hasValue(value?.typography?.writingMode);
|
|
422
545
|
const resetWritingMode = () => setWritingMode(void 0);
|
|
423
546
|
const hasTextAlignmentControl = useHasTextAlignmentControl(settings);
|
|
424
|
-
const
|
|
547
|
+
const inheritedTextAlign = decodeValue(
|
|
548
|
+
inheritedValue?.typography?.textAlign
|
|
549
|
+
);
|
|
550
|
+
const textAlign = decodeValue(value?.typography?.textAlign) ?? inheritedTextAlign;
|
|
551
|
+
const isTextAlignPlaceholder = !hasValue(value?.typography?.textAlign) && hasValue(inheritedTextAlign);
|
|
425
552
|
const setTextAlign = (newValue) => {
|
|
426
553
|
onChange(
|
|
427
554
|
(0, import_object.setImmutably)(
|
|
428
555
|
value,
|
|
429
556
|
["typography", "textAlign"],
|
|
430
|
-
newValue
|
|
557
|
+
hasValue(newValue) ? newValue : void 0
|
|
431
558
|
)
|
|
432
559
|
);
|
|
433
560
|
};
|
|
434
|
-
const
|
|
561
|
+
const setTextAlignWithInheritedCommit = (newValue) => {
|
|
562
|
+
if (isTextAlignPlaceholder && newValue === void 0) {
|
|
563
|
+
setTextAlign(inheritedTextAlign);
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
setTextAlign(newValue);
|
|
567
|
+
};
|
|
568
|
+
const hasTextAlign = () => hasValue(value?.typography?.textAlign);
|
|
435
569
|
const resetTextAlign = () => setTextAlign(void 0);
|
|
436
570
|
const resetAllFilter = (0, import_element.useCallback)(
|
|
437
571
|
(previousValue) => {
|
|
@@ -467,8 +601,11 @@ function TypographyPanel({
|
|
|
467
601
|
hasValue: hasTextColorValue,
|
|
468
602
|
resetValue: resetTextColor,
|
|
469
603
|
isShownByDefault: defaultControls.textColor,
|
|
470
|
-
indicators: [textColor],
|
|
604
|
+
indicators: [userTextColor ?? textColor],
|
|
471
605
|
contrastWarning,
|
|
606
|
+
showInheritanceLabelIndicators,
|
|
607
|
+
isPlaceholder: userTextColor === void 0 && textColor !== void 0,
|
|
608
|
+
hasInheritedValue: textColor !== void 0,
|
|
472
609
|
tabs: [
|
|
473
610
|
{
|
|
474
611
|
key: "text",
|
|
@@ -478,8 +615,13 @@ function TypographyPanel({
|
|
|
478
615
|
inheritedValue?.color?.text,
|
|
479
616
|
"color"
|
|
480
617
|
),
|
|
618
|
+
userSlug: (0, import_color_values.extractPresetSlug)(
|
|
619
|
+
value?.color?.text,
|
|
620
|
+
"color"
|
|
621
|
+
),
|
|
481
622
|
setValue: setTextColor,
|
|
482
|
-
userValue: userTextColor
|
|
623
|
+
userValue: userTextColor,
|
|
624
|
+
isPlaceholder: userTextColor === void 0 && textColor !== void 0
|
|
483
625
|
}
|
|
484
626
|
],
|
|
485
627
|
colorGradientControlSettings: {
|
|
@@ -490,8 +632,12 @@ function TypographyPanel({
|
|
|
490
632
|
}
|
|
491
633
|
),
|
|
492
634
|
hasFontFamilyEnabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
493
|
-
|
|
635
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
494
636
|
{
|
|
637
|
+
...inheritanceProps(
|
|
638
|
+
isFontFamilyPlaceholder,
|
|
639
|
+
hasFontFamily() && inheritedFontFamily !== void 0
|
|
640
|
+
),
|
|
495
641
|
label: (0, import_i18n.__)("Font"),
|
|
496
642
|
hasValue: hasFontFamily,
|
|
497
643
|
onDeselect: resetFontFamily,
|
|
@@ -508,10 +654,15 @@ function TypographyPanel({
|
|
|
508
654
|
}
|
|
509
655
|
),
|
|
510
656
|
hasFontSizeEnabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
511
|
-
|
|
657
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
512
658
|
{
|
|
659
|
+
...inheritanceProps(
|
|
660
|
+
isFontSizePlaceholder,
|
|
661
|
+
hasFontSize() && rawInheritedFontSize !== void 0
|
|
662
|
+
),
|
|
513
663
|
label: (0, import_i18n.__)("Size"),
|
|
514
664
|
hasValue: hasFontSize,
|
|
665
|
+
hasInlineEndToggle: true,
|
|
515
666
|
onDeselect: resetFontSize,
|
|
516
667
|
isShownByDefault: defaultControls.fontSize,
|
|
517
668
|
panelId,
|
|
@@ -520,7 +671,7 @@ function TypographyPanel({
|
|
|
520
671
|
{
|
|
521
672
|
value: currentFontSizeSlug || fontSize,
|
|
522
673
|
valueMode: currentFontSizeSlug ? "slug" : "literal",
|
|
523
|
-
onChange:
|
|
674
|
+
onChange: setFontSizeWithInheritedCommit,
|
|
524
675
|
fontSizes: mergedFontSizes,
|
|
525
676
|
disableCustomFontSizes,
|
|
526
677
|
withReset: false,
|
|
@@ -530,8 +681,12 @@ function TypographyPanel({
|
|
|
530
681
|
}
|
|
531
682
|
),
|
|
532
683
|
hasAppearanceControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
533
|
-
|
|
684
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
534
685
|
{
|
|
686
|
+
...inheritanceProps(
|
|
687
|
+
isFontAppearancePlaceholder,
|
|
688
|
+
hasFontAppearance() && (inheritedFontStyle !== void 0 || inheritedFontWeight !== void 0)
|
|
689
|
+
),
|
|
535
690
|
label: appearanceControlLabel,
|
|
536
691
|
hasValue: hasFontAppearance,
|
|
537
692
|
onDeselect: resetFontAppearance,
|
|
@@ -544,7 +699,7 @@ function TypographyPanel({
|
|
|
544
699
|
fontStyle,
|
|
545
700
|
fontWeight
|
|
546
701
|
},
|
|
547
|
-
onChange:
|
|
702
|
+
onChange: setFontAppearanceWithInheritedCommit,
|
|
548
703
|
hasFontStyles,
|
|
549
704
|
hasFontWeights,
|
|
550
705
|
fontFamilyFaces
|
|
@@ -553,9 +708,13 @@ function TypographyPanel({
|
|
|
553
708
|
}
|
|
554
709
|
),
|
|
555
710
|
hasLineHeightEnabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
556
|
-
|
|
711
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
557
712
|
{
|
|
558
|
-
|
|
713
|
+
...inheritanceProps(
|
|
714
|
+
isLineHeightPlaceholder,
|
|
715
|
+
hasLineHeight() && inheritedLineHeight !== void 0,
|
|
716
|
+
"single-column"
|
|
717
|
+
),
|
|
559
718
|
label: (0, import_i18n.__)("Line height"),
|
|
560
719
|
hasValue: hasLineHeight,
|
|
561
720
|
onDeselect: resetLineHeight,
|
|
@@ -565,16 +724,25 @@ function TypographyPanel({
|
|
|
565
724
|
import_line_height_control.default,
|
|
566
725
|
{
|
|
567
726
|
__unstableInputWidth: "auto",
|
|
568
|
-
value:
|
|
569
|
-
onChange: setLineHeight
|
|
727
|
+
value: localLineHeight ?? inheritedLineHeight,
|
|
728
|
+
onChange: setLineHeight,
|
|
729
|
+
...isLineHeightPlaceholder ? {
|
|
730
|
+
placeholder: getNumericPlaceholder(
|
|
731
|
+
inheritedLineHeight
|
|
732
|
+
)
|
|
733
|
+
} : {}
|
|
570
734
|
}
|
|
571
735
|
)
|
|
572
736
|
}
|
|
573
737
|
),
|
|
574
738
|
hasLetterSpacingControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
575
|
-
|
|
739
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
576
740
|
{
|
|
577
|
-
|
|
741
|
+
...inheritanceProps(
|
|
742
|
+
isLetterSpacingPlaceholder,
|
|
743
|
+
hasLetterSpacing() && inheritedLetterSpacing !== void 0,
|
|
744
|
+
"single-column"
|
|
745
|
+
),
|
|
578
746
|
label: (0, import_i18n.__)("Letter spacing"),
|
|
579
747
|
hasValue: hasLetterSpacing,
|
|
580
748
|
onDeselect: resetLetterSpacing,
|
|
@@ -583,16 +751,23 @@ function TypographyPanel({
|
|
|
583
751
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
584
752
|
import_letter_spacing_control.default,
|
|
585
753
|
{
|
|
586
|
-
value:
|
|
754
|
+
value: localLetterSpacing ?? inheritedLetterSpacing,
|
|
587
755
|
onChange: setLetterSpacing,
|
|
588
|
-
__unstableInputWidth: "auto"
|
|
756
|
+
__unstableInputWidth: "auto",
|
|
757
|
+
placeholder: isLetterSpacingPlaceholder ? getNumericPlaceholder(
|
|
758
|
+
inheritedLetterSpacing
|
|
759
|
+
) : void 0
|
|
589
760
|
}
|
|
590
761
|
)
|
|
591
762
|
}
|
|
592
763
|
),
|
|
593
764
|
hasTextIndentControl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
594
|
-
|
|
765
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
595
766
|
{
|
|
767
|
+
...inheritanceProps(
|
|
768
|
+
isTextIndentPlaceholder,
|
|
769
|
+
hasTextIndent() && inheritedTextIndent !== void 0
|
|
770
|
+
),
|
|
596
771
|
label: (0, import_i18n.__)("Line indent"),
|
|
597
772
|
hasValue: hasTextIndent,
|
|
598
773
|
onDeselect: resetTextIndent,
|
|
@@ -602,11 +777,12 @@ function TypographyPanel({
|
|
|
602
777
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
603
778
|
import_text_indent_control.default,
|
|
604
779
|
{
|
|
605
|
-
value:
|
|
780
|
+
value: localTextIndent ?? inheritedTextIndent,
|
|
606
781
|
onChange: setTextIndentValue,
|
|
607
782
|
__unstableInputWidth: "auto",
|
|
608
783
|
withSlider: true,
|
|
609
|
-
hasBottomMargin: isGlobalStyles
|
|
784
|
+
hasBottomMargin: isGlobalStyles,
|
|
785
|
+
placeholder: isTextIndentPlaceholder ? getNumericPlaceholder(inheritedTextIndent) : void 0
|
|
610
786
|
}
|
|
611
787
|
),
|
|
612
788
|
isGlobalStyles && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -622,9 +798,13 @@ function TypographyPanel({
|
|
|
622
798
|
}
|
|
623
799
|
),
|
|
624
800
|
hasTextColumnsControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
625
|
-
|
|
801
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
626
802
|
{
|
|
627
|
-
|
|
803
|
+
...inheritanceProps(
|
|
804
|
+
isTextColumnsPlaceholder,
|
|
805
|
+
hasTextColumns() && inheritedTextColumns !== void 0,
|
|
806
|
+
"single-column"
|
|
807
|
+
),
|
|
628
808
|
label: (0, import_i18n.__)("Columns"),
|
|
629
809
|
hasValue: hasTextColumns,
|
|
630
810
|
onDeselect: resetTextColumns,
|
|
@@ -637,18 +817,22 @@ function TypographyPanel({
|
|
|
637
817
|
max: MAX_TEXT_COLUMNS,
|
|
638
818
|
min: MIN_TEXT_COLUMNS,
|
|
639
819
|
onChange: setTextColumns,
|
|
640
|
-
|
|
820
|
+
placeholder: isTextColumnsPlaceholder ? inheritedTextColumns : void 0,
|
|
641
821
|
spinControls: "custom",
|
|
642
|
-
value:
|
|
822
|
+
value: localTextColumns,
|
|
643
823
|
initialPosition: 1
|
|
644
824
|
}
|
|
645
825
|
)
|
|
646
826
|
}
|
|
647
827
|
),
|
|
648
828
|
hasTextDecorationControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
649
|
-
|
|
829
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
650
830
|
{
|
|
651
|
-
|
|
831
|
+
...inheritanceProps(
|
|
832
|
+
isTextDecorationPlaceholder,
|
|
833
|
+
hasTextDecoration() && inheritedTextDecoration !== void 0,
|
|
834
|
+
"single-column"
|
|
835
|
+
),
|
|
652
836
|
label: (0, import_i18n.__)("Decoration"),
|
|
653
837
|
hasValue: hasTextDecoration,
|
|
654
838
|
onDeselect: resetTextDecoration,
|
|
@@ -658,17 +842,20 @@ function TypographyPanel({
|
|
|
658
842
|
import_text_decoration_control.default,
|
|
659
843
|
{
|
|
660
844
|
value: textDecoration,
|
|
661
|
-
onChange:
|
|
662
|
-
size: "__unstable-large",
|
|
845
|
+
onChange: setTextDecorationWithInheritedCommit,
|
|
663
846
|
__unstableInputWidth: "auto"
|
|
664
847
|
}
|
|
665
848
|
)
|
|
666
849
|
}
|
|
667
850
|
),
|
|
668
851
|
hasWritingModeControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
669
|
-
|
|
852
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
670
853
|
{
|
|
671
|
-
|
|
854
|
+
...inheritanceProps(
|
|
855
|
+
isWritingModePlaceholder,
|
|
856
|
+
hasWritingMode() && inheritedWritingMode !== void 0,
|
|
857
|
+
"single-column"
|
|
858
|
+
),
|
|
672
859
|
label: (0, import_i18n.__)("Orientation"),
|
|
673
860
|
hasValue: hasWritingMode,
|
|
674
861
|
onDeselect: resetWritingMode,
|
|
@@ -678,15 +865,18 @@ function TypographyPanel({
|
|
|
678
865
|
import_writing_mode_control.default,
|
|
679
866
|
{
|
|
680
867
|
value: writingMode,
|
|
681
|
-
onChange:
|
|
682
|
-
size: "__unstable-large"
|
|
868
|
+
onChange: setWritingModeWithInheritedCommit
|
|
683
869
|
}
|
|
684
870
|
)
|
|
685
871
|
}
|
|
686
872
|
),
|
|
687
873
|
hasTextTransformControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
688
|
-
|
|
874
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
689
875
|
{
|
|
876
|
+
...inheritanceProps(
|
|
877
|
+
isTextTransformPlaceholder,
|
|
878
|
+
hasTextTransform() && inheritedTextTransform !== void 0
|
|
879
|
+
),
|
|
690
880
|
label: (0, import_i18n.__)("Letter case"),
|
|
691
881
|
hasValue: hasTextTransform,
|
|
692
882
|
onDeselect: resetTextTransform,
|
|
@@ -696,17 +886,20 @@ function TypographyPanel({
|
|
|
696
886
|
import_text_transform_control.default,
|
|
697
887
|
{
|
|
698
888
|
value: textTransform,
|
|
699
|
-
onChange:
|
|
889
|
+
onChange: setTextTransformWithInheritedCommit,
|
|
700
890
|
showNone: true,
|
|
701
|
-
isBlock: true
|
|
702
|
-
size: "__unstable-large"
|
|
891
|
+
isBlock: true
|
|
703
892
|
}
|
|
704
893
|
)
|
|
705
894
|
}
|
|
706
895
|
),
|
|
707
896
|
hasTextAlignmentControl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
708
|
-
|
|
897
|
+
import_inheritance.InheritanceToolsPanelItem,
|
|
709
898
|
{
|
|
899
|
+
...inheritanceProps(
|
|
900
|
+
isTextAlignPlaceholder,
|
|
901
|
+
hasTextAlign() && inheritedTextAlign !== void 0
|
|
902
|
+
),
|
|
710
903
|
label: (0, import_i18n.__)("Text alignment"),
|
|
711
904
|
hasValue: hasTextAlign,
|
|
712
905
|
onDeselect: resetTextAlign,
|
|
@@ -717,9 +910,8 @@ function TypographyPanel({
|
|
|
717
910
|
import_text_alignment_control.default,
|
|
718
911
|
{
|
|
719
912
|
value: textAlign,
|
|
720
|
-
onChange:
|
|
721
|
-
options: ["left", "center", "right", "justify"]
|
|
722
|
-
size: "__unstable-large"
|
|
913
|
+
onChange: setTextAlignWithInheritedCommit,
|
|
914
|
+
options: ["left", "center", "right", "justify"]
|
|
723
915
|
}
|
|
724
916
|
),
|
|
725
917
|
textAlign === "justify" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n.__)(
|