@wordpress/block-editor 17.1.0 → 17.2.1-next.v.202609171837.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 +32 -0
- package/README.md +214 -214
- package/build/autocompleters/block.cjs.map +2 -2
- package/build/components/alignment-control/ui.cjs.map +2 -2
- package/build/components/background-image-control/index.cjs +1 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-alignment-control/ui.cjs +21 -7
- package/build/components/block-alignment-control/ui.cjs.map +3 -3
- package/build/components/block-alignment-control/use-available-alignments.cjs +60 -13
- package/build/components/block-alignment-control/use-available-alignments.cjs.map +2 -2
- package/build/components/block-allowed-blocks/allowed-blocks-control.cjs.map +2 -2
- package/build/components/block-bindings/attribute-control.cjs +30 -30
- package/build/components/block-bindings/attribute-control.cjs.map +3 -3
- package/build/components/block-bindings/source-fields-list.cjs +27 -32
- package/build/components/block-bindings/source-fields-list.cjs.map +3 -3
- package/build/components/block-canvas/index.cjs.map +2 -2
- package/build/components/block-card/index.cjs +1 -2
- package/build/components/block-card/index.cjs.map +3 -3
- package/build/components/block-edit/edit.cjs.map +2 -2
- package/build/components/block-heading-level-dropdown/index.cjs.map +2 -2
- package/build/components/block-icon/index.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +27 -8
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-keyboard-shortcuts/index.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +1 -12
- package/build/components/block-list/block-html.cjs.map +3 -3
- package/build/components/block-list/block.cjs +2 -4
- package/build/components/block-list/block.cjs.map +2 -2
- package/build/components/block-list/layout.cjs +1 -1
- package/build/components/block-list/layout.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-lock/modal.cjs +1 -3
- package/build/components/block-lock/modal.cjs.map +2 -2
- package/build/components/block-parent-selector/index.cjs +8 -5
- package/build/components/block-parent-selector/index.cjs.map +2 -2
- package/build/components/block-popover/index.cjs.map +2 -2
- package/build/components/block-rename/modal.cjs.map +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
- package/build/components/block-styles/utils.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +6 -4
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-toolbar/switch-section-style.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +28 -18
- package/build/components/block-variation-transforms/index.cjs.map +3 -3
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
- package/build/components/border-radius-control/index.cjs.map +2 -2
- package/build/components/color-palette/with-color-context.cjs.map +2 -2
- package/build/components/colors/with-colors.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
- package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
- package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +1 -1
- package/build/components/global-styles/background-panel.cjs.map +2 -2
- package/build/components/global-styles/border-panel.cjs +1 -1
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +1 -1
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +2 -2
- package/build/components/global-styles/color-panel.cjs +1 -1
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +1 -1
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs +1 -1
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +1 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/inheritance/index.cjs +3 -3
- package/build/components/global-styles/inheritance/index.cjs.map +2 -2
- package/build/components/global-styles/inherited-value-context.cjs +0 -5
- package/build/components/global-styles/inherited-value-context.cjs.map +2 -2
- package/build/components/global-styles/state-control-badges.cjs +0 -1
- package/build/components/global-styles/state-control-badges.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +6 -4
- package/build/components/global-styles/state-control.cjs.map +2 -2
- package/build/components/global-styles/text-shadow-panel.cjs +254 -0
- package/build/components/global-styles/text-shadow-panel.cjs.map +7 -0
- package/build/components/global-styles/typography-panel.cjs +46 -5
- package/build/components/global-styles/typography-panel.cjs.map +2 -2
- package/build/components/global-styles/typography-utils.cjs.map +2 -2
- package/build/components/global-styles/utils.cjs.map +2 -2
- package/build/components/html-element-control/index.cjs.map +3 -3
- package/build/components/iframe/index.cjs.map +2 -2
- package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
- package/build/components/image-size-control/index.cjs.map +3 -3
- package/build/components/inner-blocks/index.cjs +6 -1
- package/build/components/inner-blocks/index.cjs.map +2 -2
- package/build/components/inner-content/index.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs +4 -23
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/utils.cjs +26 -0
- package/build/components/inserter/block-patterns-tab/utils.cjs.map +2 -2
- package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
- package/build/components/inserter/hooks/use-insertion-point.cjs.map +2 -2
- package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-panel.cjs.map +2 -2
- package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
- package/build/components/inserter-list-item/index.cjs.map +2 -2
- package/build/components/inspector-controls/list-view-content-popover.cjs.map +2 -2
- package/build/components/link-control/search-results.cjs.map +2 -2
- package/build/components/link-control/use-search-handler.cjs +3 -0
- package/build/components/link-control/use-search-handler.cjs.map +2 -2
- package/build/components/list-view/branch.cjs.map +2 -2
- package/build/components/list-view/drop-indicator.cjs.map +2 -2
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/list-view/use-list-view-drop-zone.cjs.map +2 -2
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/media-replace-flow/index.cjs +4 -1
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/plain-text/index.cjs +1 -2
- package/build/components/plain-text/index.cjs.map +3 -3
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +3 -1
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/publish-date-time-picker/index.cjs.map +2 -2
- package/build/components/resizable-box-popover/index.cjs +1 -1
- package/build/components/resizable-box-popover/index.cjs.map +1 -1
- package/build/components/resolution-tool/index.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/enter.cjs +8 -22
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/format-edit.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +20 -0
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/rich-text/multiline.cjs +10 -2
- package/build/components/rich-text/multiline.cjs.map +2 -2
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.cjs.map +2 -2
- package/build/components/typewriter/index.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +3 -0
- package/build/components/writing-flow/index.cjs.map +2 -2
- package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +5 -3
- package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
- package/build/hooks/align.cjs +3 -5
- package/build/hooks/align.cjs.map +2 -2
- package/build/hooks/background.cjs.map +2 -2
- package/build/hooks/block-bindings.cjs.map +2 -2
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/contrast-checker.cjs.map +2 -2
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/duotone.cjs.map +2 -2
- package/build/hooks/elements.cjs.map +2 -2
- package/build/hooks/fit-text.cjs.map +2 -2
- package/build/hooks/gap.cjs +2 -1
- package/build/hooks/gap.cjs.map +3 -3
- package/build/hooks/index.cjs +4 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +15 -14
- package/build/hooks/layout.cjs.map +3 -3
- package/build/hooks/position.cjs +3 -31
- package/build/hooks/position.cjs.map +2 -2
- package/build/hooks/states.cjs +3 -2
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/text-shadow.cjs +100 -0
- package/build/hooks/text-shadow.cjs.map +7 -0
- package/build/hooks/typography.cjs +30 -6
- package/build/hooks/typography.cjs.map +2 -2
- package/build/hooks/utils.cjs +24 -2
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/grid.cjs.map +2 -2
- package/build/layouts/utils.cjs +7 -2
- package/build/layouts/utils.cjs.map +2 -2
- package/build/private-apis.cjs +9 -6
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +26 -4
- package/build/store/actions.cjs.map +3 -3
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/get-font-styles-and-weights.cjs.map +2 -2
- package/build/utils/transform-styles/index.cjs.map +1 -1
- package/build-module/autocompleters/block.mjs.map +2 -2
- package/build-module/components/alignment-control/ui.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +2 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-alignment-control/ui.mjs +21 -7
- package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
- package/build-module/components/block-alignment-control/use-available-alignments.mjs +56 -13
- package/build-module/components/block-alignment-control/use-available-alignments.mjs.map +2 -2
- package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs.map +2 -2
- package/build-module/components/block-bindings/attribute-control.mjs +31 -32
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-bindings/source-fields-list.mjs +25 -30
- package/build-module/components/block-bindings/source-fields-list.mjs.map +2 -2
- package/build-module/components/block-canvas/index.mjs.map +2 -2
- package/build-module/components/block-card/index.mjs +3 -8
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs.map +2 -2
- package/build-module/components/block-heading-level-dropdown/index.mjs.map +2 -2
- package/build-module/components/block-icon/index.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +29 -10
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +1 -2
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +2 -4
- package/build-module/components/block-list/block.mjs.map +2 -2
- package/build-module/components/block-list/layout.mjs +1 -1
- package/build-module/components/block-list/layout.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-lock/modal.mjs +1 -3
- package/build-module/components/block-lock/modal.mjs.map +2 -2
- package/build-module/components/block-parent-selector/index.mjs +8 -5
- package/build-module/components/block-parent-selector/index.mjs.map +2 -2
- package/build-module/components/block-popover/index.mjs.map +2 -2
- package/build-module/components/block-rename/modal.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-styles/utils.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +6 -4
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +30 -21
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/border-radius-control/index.mjs.map +2 -2
- package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
- package/build-module/components/colors/with-colors.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +2 -2
- package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
- package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
- package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +2 -2
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +2 -2
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs +2 -2
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs +2 -2
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +1 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs +2 -2
- package/build-module/components/global-styles/inheritance/index.mjs.map +2 -2
- package/build-module/components/global-styles/inherited-value-context.mjs +0 -5
- package/build-module/components/global-styles/inherited-value-context.mjs.map +2 -2
- package/build-module/components/global-styles/state-control-badges.mjs +0 -1
- package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +6 -4
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/global-styles/text-shadow-panel.mjs +224 -0
- package/build-module/components/global-styles/text-shadow-panel.mjs.map +7 -0
- package/build-module/components/global-styles/typography-panel.mjs +47 -6
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/global-styles/typography-utils.mjs.map +2 -2
- package/build-module/components/global-styles/utils.mjs.map +2 -2
- package/build-module/components/html-element-control/index.mjs +2 -2
- package/build-module/components/html-element-control/index.mjs.map +2 -2
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
- package/build-module/components/image-size-control/index.mjs +2 -2
- package/build-module/components/image-size-control/index.mjs.map +2 -2
- package/build-module/components/inner-blocks/index.mjs +6 -1
- package/build-module/components/inner-blocks/index.mjs.map +2 -2
- package/build-module/components/inner-content/index.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs +6 -24
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/utils.mjs +25 -0
- package/build-module/components/inserter/block-patterns-tab/utils.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-insertion-point.mjs.map +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
- package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
- package/build-module/components/inserter-list-item/index.mjs.map +2 -2
- package/build-module/components/inspector-controls/list-view-content-popover.mjs.map +2 -2
- package/build-module/components/link-control/search-results.mjs.map +2 -2
- package/build-module/components/link-control/use-search-handler.mjs +3 -0
- package/build-module/components/link-control/use-search-handler.mjs.map +2 -2
- package/build-module/components/list-view/branch.mjs.map +2 -2
- package/build-module/components/list-view/drop-indicator.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/media-replace-flow/index.mjs +4 -1
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/plain-text/index.mjs +1 -2
- package/build-module/components/plain-text/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +3 -1
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/publish-date-time-picker/index.mjs.map +2 -2
- package/build-module/components/resizable-box-popover/index.mjs +1 -1
- package/build-module/components/resizable-box-popover/index.mjs.map +1 -1
- package/build-module/components/resolution-tool/index.mjs +2 -2
- package/build-module/components/resolution-tool/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +8 -22
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/format-edit.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +21 -0
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/rich-text/multiline.mjs +11 -3
- package/build-module/components/rich-text/multiline.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.mjs.map +2 -2
- package/build-module/components/typewriter/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +3 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +5 -3
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/hooks/align.mjs +6 -6
- package/build-module/hooks/align.mjs.map +2 -2
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/block-bindings.mjs.map +2 -2
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/duotone.mjs.map +2 -2
- package/build-module/hooks/elements.mjs.map +2 -2
- package/build-module/hooks/fit-text.mjs.map +2 -2
- package/build-module/hooks/gap.mjs +2 -1
- package/build-module/hooks/gap.mjs.map +2 -2
- package/build-module/hooks/index.mjs +4 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -5
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/position.mjs +5 -33
- package/build-module/hooks/position.mjs.map +2 -2
- package/build-module/hooks/states.mjs +3 -2
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/text-shadow.mjs +65 -0
- package/build-module/hooks/text-shadow.mjs.map +7 -0
- package/build-module/hooks/typography.mjs +30 -6
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +24 -2
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/layouts/utils.mjs +5 -1
- package/build-module/layouts/utils.mjs.map +2 -2
- package/build-module/private-apis.mjs +6 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +28 -5
- package/build-module/store/actions.mjs.map +3 -3
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/get-font-styles-and-weights.mjs.map +2 -2
- package/build-module/utils/transform-styles/index.mjs.map +1 -1
- package/build-style/content-rtl.css +7 -2
- package/build-style/content.css +7 -2
- package/build-style/style-rtl.css +90 -25
- package/build-style/style.css +92 -25
- package/package.json +42 -43
- package/src/autocompleters/block.jsx +4 -4
- package/src/components/alignment-control/ui.jsx +1 -1
- package/src/components/background-image-control/index.jsx +3 -3
- package/src/components/block-alignment-control/test/index.jsdom.test.jsx +267 -0
- package/src/components/block-alignment-control/ui.jsx +47 -9
- package/src/components/block-alignment-control/use-available-alignments.js +106 -20
- package/src/components/block-allowed-blocks/allowed-blocks-control.jsx +1 -1
- package/src/components/block-bindings/attribute-control.jsx +27 -29
- package/src/components/block-bindings/source-fields-list.jsx +22 -32
- package/src/components/block-bindings/test/attribute-control.jsdom.test.jsx +115 -0
- package/src/components/block-canvas/index.jsx +1 -1
- package/src/components/block-card/index.jsx +5 -11
- package/src/components/block-card/style.scss +1 -0
- package/src/components/block-edit/edit.jsx +1 -1
- package/src/components/block-heading-level-dropdown/index.jsx +1 -1
- package/src/components/block-icon/index.jsx +1 -1
- package/src/components/block-icon/test/index.browser.test.jsx +74 -0
- package/src/components/block-inspector/edit-contents.jsx +2 -2
- package/src/components/block-inspector/index.jsx +46 -15
- package/src/components/block-inspector/style.scss +16 -0
- package/src/components/block-keyboard-shortcuts/index.jsx +2 -2
- package/src/components/block-list/block-html.jsx +2 -3
- package/src/components/block-list/block.jsx +7 -5
- package/src/components/block-list/content.scss +3 -2
- package/src/components/block-list/layout.jsx +4 -1
- package/src/components/block-list/test/layout.jsdom.test.js +40 -0
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-lock/modal.jsx +2 -3
- package/src/components/block-lock/style.scss +1 -1
- package/src/components/block-mover/style.scss +0 -13
- package/src/components/block-parent-selector/index.jsx +12 -6
- package/src/components/block-patterns-list/style.scss +1 -1
- package/src/components/block-popover/index.jsx +1 -1
- package/src/components/block-rename/modal.jsx +3 -3
- package/src/components/block-settings-menu/block-settings-dropdown.jsx +1 -1
- package/src/components/block-styles/utils.js +1 -1
- package/src/components/block-switcher/index.jsx +3 -3
- package/src/components/block-toolbar/edit-section-button.jsx +2 -2
- package/src/components/block-toolbar/index.jsx +8 -4
- package/src/components/block-toolbar/switch-section-style.jsx +1 -1
- package/src/components/block-variation-transforms/index.jsx +24 -23
- package/src/components/block-variation-transforms/test/index.jsdom.test.jsx +93 -0
- package/src/components/block-visibility/modal.jsx +7 -7
- package/src/components/block-visibility/style.scss +1 -1
- package/src/components/block-visibility/viewport-visibility-info.jsx +5 -7
- package/src/components/border-radius-control/index.jsx +2 -2
- package/src/components/border-radius-control/test/index.jsdom.test.jsx +0 -22
- package/src/components/border-radius-control/test/select.browser.test.js +30 -0
- package/src/components/color-palette/with-color-context.jsx +1 -1
- package/src/components/colors/with-colors.jsx +1 -1
- package/src/components/colors-gradients/control.jsx +2 -2
- package/src/components/colors-gradients/test/{control.jsdom.test.jsx → control.browser.test.jsx} +6 -9
- package/src/components/contrast-checker/index.jsx +2 -2
- package/src/components/date-format-picker/index.jsx +2 -2
- package/src/components/dimensions-tool/aspect-ratio-tool.jsx +4 -4
- package/src/components/dimensions-tool/test/index.jsdom.test.jsx +17 -11
- package/src/components/dimensions-tool/width-height-tool.jsx +2 -2
- package/src/components/font-sizes/with-font-sizes.jsx +2 -3
- package/src/components/global-styles/background-panel.jsx +2 -2
- package/src/components/global-styles/border-panel.jsx +2 -2
- package/src/components/global-styles/color-gradient-dropdown-item.jsx +3 -3
- package/src/components/global-styles/color-panel.jsx +3 -3
- package/src/components/global-styles/dimensions-panel.jsx +6 -6
- package/src/components/global-styles/filters-panel.jsx +2 -2
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/inheritance/index.jsx +9 -6
- package/src/components/global-styles/inheritance/test/{index.jsdom.test.jsx → index.browser.test.jsx} +34 -28
- package/src/components/global-styles/inherited-value-context.js +1 -9
- package/src/components/global-styles/state-control-badges.jsx +0 -1
- package/src/components/global-styles/state-control.jsx +12 -3
- package/src/components/global-styles/style.scss +68 -0
- package/src/components/global-styles/test/{color-panel.jsdom.test.jsx → color-panel.browser.test.jsx} +53 -54
- package/src/components/global-styles/test/inherited-value-context-core.jsdom.test.js +17 -26
- package/src/components/global-styles/test/{typography-panel-core.jsdom.test.jsx → typography-panel-core.browser.test.jsx} +84 -39
- package/src/components/global-styles/test/{typography-panel.jsdom.test.jsx → typography-panel.browser.test.jsx} +80 -122
- package/src/components/global-styles/text-shadow-panel.tsx +257 -0
- package/src/components/global-styles/typography-panel.jsx +52 -13
- package/src/components/global-styles/typography-utils.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/html-element-control/index.jsx +2 -2
- package/src/components/iframe/index.jsx +1 -1
- package/src/components/iframe/use-scale-canvas.js +1 -1
- package/src/components/image-size-control/index.jsx +2 -2
- package/src/components/inner-blocks/index.jsx +9 -1
- package/src/components/inner-content/index.jsx +1 -1
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +7 -33
- package/src/components/inserter/block-patterns-tab/utils.js +44 -0
- package/src/components/inserter/hooks/use-block-types-state.js +2 -2
- package/src/components/inserter/hooks/use-insertion-point.js +1 -1
- package/src/components/inserter/hooks/use-patterns-state.js +1 -1
- package/src/components/inserter/media-tab/media-panel.jsx +9 -9
- package/src/components/inserter/media-tab/media-preview.jsx +1 -1
- package/src/components/inserter-list-item/index.jsx +1 -1
- package/src/components/inserter-list-item/style.scss +2 -2
- package/src/components/inspector-controls/list-view-content-popover.jsx +1 -1
- package/src/components/link-control/search-results.jsx +1 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.jsdom.test.jsx +38 -110
- package/src/components/link-control/test/keyboard-selection.browser.test.js +110 -0
- package/src/components/link-control/use-search-handler.js +8 -3
- package/src/components/list-view/branch.jsx +1 -1
- package/src/components/list-view/drop-indicator.jsx +3 -3
- package/src/components/list-view/index.jsx +1 -1
- package/src/components/list-view/style.scss +1 -9
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/list-view/utils.js +1 -1
- package/src/components/media-replace-flow/index.jsx +4 -1
- package/src/components/navigable-toolbar/test/index.browser.test.js +6 -7
- package/src/components/plain-text/README.md +3 -2
- package/src/components/plain-text/content.scss +0 -1
- package/src/components/plain-text/index.jsx +2 -3
- package/src/components/plain-text/style.scss +4 -0
- package/src/components/preset-input-control/index.jsx +2 -2
- package/src/components/preset-input-control/test/index.jsdom.test.jsx +0 -56
- package/src/components/preset-input-control/test/interaction.browser.test.js +63 -0
- package/src/components/provider/index.jsx +5 -3
- package/src/components/provider/use-block-sync.js +5 -5
- package/src/components/publish-date-time-picker/index.jsx +1 -1
- package/src/components/resizable-box-popover/index.jsx +1 -1
- package/src/components/resolution-tool/index.jsx +2 -2
- package/src/components/responsive-block-control/style.scss +1 -2
- package/src/components/responsive-block-control/test/index.jsdom.test.jsx +2 -2
- package/src/components/rich-text/event-listeners/enter.js +16 -23
- package/src/components/rich-text/format-edit.jsx +1 -1
- package/src/components/rich-text/index.jsx +39 -2
- package/src/components/rich-text/multiline.jsx +11 -3
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/src/components/spacing-sizes-control/test/index.jsdom.test.jsx +0 -21
- package/src/components/spacing-sizes-control/test/select.browser.test.js +58 -0
- package/src/components/typewriter/index.jsx +1 -1
- package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +1 -1
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-block-drop-zone/test/index.js +2 -2
- package/src/components/writing-flow/index.jsx +8 -0
- package/src/components/writing-flow/use-clipboard-handler.js +1 -1
- package/src/components/writing-flow/use-selection-observer.js +15 -6
- package/src/content.scss +1 -0
- package/src/hooks/align.jsx +22 -6
- package/src/hooks/background.jsx +1 -1
- package/src/hooks/block-bindings.jsx +1 -1
- package/src/hooks/block-hooks.scss +0 -6
- package/src/hooks/border.jsx +2 -2
- package/src/hooks/contrast-checker.js +1 -1
- package/src/hooks/dimensions.jsx +2 -2
- package/src/hooks/duotone.jsx +3 -3
- package/src/hooks/elements.jsx +3 -3
- package/src/hooks/fit-text.jsx +1 -1
- package/src/hooks/gap.js +2 -4
- package/src/hooks/index.js +3 -1
- package/src/hooks/layout-child.jsx +3 -4
- package/src/hooks/layout.jsx +17 -18
- package/src/hooks/position.jsx +5 -36
- package/src/hooks/states.jsx +6 -2
- package/src/hooks/test/layout.jsdom.test.js +44 -1
- package/src/hooks/text-shadow.ts +105 -0
- package/src/hooks/typography.jsx +58 -30
- package/src/hooks/utils.jsx +23 -1
- package/src/layouts/grid.jsx +2 -2
- package/src/layouts/test/flex.jsdom.test.jsx +4 -3
- package/src/layouts/test/utils.js +48 -1
- package/src/layouts/utils.js +19 -0
- package/src/private-apis.js +4 -0
- package/src/store/actions.js +50 -10
- package/src/store/private-selectors.js +5 -5
- package/src/store/reducer.js +6 -6
- package/src/store/selectors.js +3 -3
- package/src/store/test/actions.jsdom.test.js +60 -0
- package/src/style.scss +1 -0
- package/src/utils/get-font-styles-and-weights.ts +1 -1
- package/src/utils/transform-styles/index.ts +1 -1
- package/build/hooks/cross-origin-isolation.cjs +0 -56
- package/build/hooks/cross-origin-isolation.cjs.map +0 -7
- package/build-module/hooks/cross-origin-isolation.mjs +0 -54
- package/build-module/hooks/cross-origin-isolation.mjs.map +0 -7
- package/src/components/block-icon/test/__snapshots__/index.jsdom.test.jsx.snap +0 -27
- package/src/components/block-icon/test/index.jsdom.test.jsx +0 -67
- package/src/hooks/cross-origin-isolation.js +0 -73
- package/src/hooks/test/cross-origin-isolation.jsdom.test.js +0 -173
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/typography-panel.jsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tFontSizePicker,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tNotice,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport FontFamilyControl from '../font-family';\nimport FontAppearanceControl from '../font-appearance-control';\nimport LineHeightControl from '../line-height-control';\nimport LetterSpacingControl from '../letter-spacing-control';\nimport TextAlignmentControl from '../text-alignment-control';\nimport TextTransformControl from '../text-transform-control';\nimport TextDecorationControl from '../text-decoration-control';\nimport TextIndentControl from '../text-indent-control';\nimport WritingModeControl from '../writing-mode-control';\nimport ColorGradientDropdownItem from './color-gradient-dropdown-item';\nimport { useHasTextPanel } from './color-panel';\nimport { useColorGradientSettings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\textractPresetSlug,\n\tencodeColorValueWithPalette,\n} from '../../utils/color-values';\nimport {\n\tgetMergedFontFamiliesAndFontFamilyFaces,\n\tfindNearestStyleAndWeight,\n} from './typography-utils';\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst MIN_TEXT_COLUMNS = 1;\nconst MAX_TEXT_COLUMNS = 6;\n\n/**\n * Whether a link color should follow a text color change.\n *\n * A link color tracks the text color (e.g. a Button's) unless it was set\n * deliberately. Raw preset refs are compared rather than decoded hex, since\n * distinct slots can share a hex (`dark-background`/`dark-text` both `#000`).\n *\n * @param {Object} value Local block styles.\n * @param {Object} inheritedValue Styles inherited from Global Styles.\n * @return {boolean} Whether to sync the link color to the text color.\n */\nfunction shouldSyncLinkColor( value, inheritedValue ) {\n\tconst localLinkColor = value?.elements?.link?.color?.text;\n\t// A local link color keeps tracking only while it matches the text color;\n\t// once it differs it was set deliberately and is left alone.\n\tif ( localLinkColor !== undefined ) {\n\t\treturn localLinkColor === value?.color?.text;\n\t}\n\t// With none set, defer to the inherited values.\n\tconst inheritedLinkColor = inheritedValue?.elements?.link?.color?.text;\n\treturn (\n\t\tinheritedLinkColor === undefined ||\n\t\tinheritedValue?.color?.text === inheritedLinkColor\n\t);\n}\n\nexport function useHasTypographyPanel( settings ) {\n\tconst hasFontFamily = useHasFontFamilyControl( settings );\n\tconst hasLineHeight = useHasLineHeightControl( settings );\n\tconst hasFontAppearance = useHasAppearanceControl( settings );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( settings );\n\tconst hasTextAlign = useHasTextAlignmentControl( settings );\n\tconst hasTextTransform = useHasTextTransformControl( settings );\n\tconst hasTextDecoration = useHasTextDecorationControl( settings );\n\tconst hasTextIndent = useHasTextIndentControl( settings );\n\tconst hasWritingMode = useHasWritingModeControl( settings );\n\tconst hasTextColumns = useHasTextColumnsControl( settings );\n\tconst hasFontSize = useHasFontSizeControl( settings );\n\tconst hasTextColor = useHasTextPanel( settings );\n\n\treturn (\n\t\thasFontFamily ||\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\thasTextAlign ||\n\t\thasTextTransform ||\n\t\thasFontSize ||\n\t\thasTextDecoration ||\n\t\thasTextIndent ||\n\t\thasWritingMode ||\n\t\thasTextColumns ||\n\t\thasTextColor\n\t);\n}\n\nfunction useHasFontSizeControl( settings ) {\n\treturn (\n\t\t( settings?.typography?.defaultFontSizes !== false &&\n\t\t\tsettings?.typography?.fontSizes?.default?.length ) ||\n\t\tsettings?.typography?.fontSizes?.theme?.length ||\n\t\tsettings?.typography?.fontSizes?.custom?.length ||\n\t\tsettings?.typography?.customFontSize\n\t);\n}\n\nfunction useHasFontFamilyControl( settings ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => settings?.typography?.fontFamilies?.[ key ]?.length\n\t);\n}\n\nfunction useHasLineHeightControl( settings ) {\n\treturn settings?.typography?.lineHeight;\n}\n\nfunction useHasAppearanceControl( settings ) {\n\treturn settings?.typography?.fontStyle || settings?.typography?.fontWeight;\n}\n\nfunction useAppearanceControlLabel( settings ) {\n\tif ( ! settings?.typography?.fontStyle ) {\n\t\treturn __( 'Font weight' );\n\t}\n\tif ( ! settings?.typography?.fontWeight ) {\n\t\treturn __( 'Font style' );\n\t}\n\treturn __( 'Appearance' );\n}\n\nfunction useHasLetterSpacingControl( settings ) {\n\treturn settings?.typography?.letterSpacing;\n}\n\nfunction useHasTextTransformControl( settings ) {\n\treturn settings?.typography?.textTransform;\n}\n\nfunction useHasTextAlignmentControl( settings ) {\n\treturn settings?.typography?.textAlign;\n}\n\nfunction useHasTextDecorationControl( settings ) {\n\treturn settings?.typography?.textDecoration;\n}\n\nfunction useHasWritingModeControl( settings ) {\n\treturn settings?.typography?.writingMode;\n}\n\nfunction useHasTextColumnsControl( settings ) {\n\treturn settings?.typography?.textColumns;\n}\n\nfunction useHasTextIndentControl( settings ) {\n\treturn settings?.typography?.textIndent;\n}\n\n/**\n * Concatenate all the font sizes into a single list for the font size picker.\n *\n * @param {Object} settings The global styles settings.\n *\n * @return {Array} The merged font sizes.\n */\nfunction getMergedFontSizes( settings ) {\n\tconst fontSizes = settings?.typography?.fontSizes;\n\tconst defaultFontSizesEnabled = !! settings?.typography?.defaultFontSizes;\n\treturn [\n\t\t...( fontSizes?.custom ?? [] ),\n\t\t...( fontSizes?.theme ?? [] ),\n\t\t...( defaultFontSizesEnabled ? fontSizes?.default ?? [] : [] ),\n\t];\n}\n\nexport function TypographyToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Typography' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttextColor: true,\n\tfontFamily: true,\n\tfontSize: true,\n\tfontAppearance: true,\n\tlineHeight: true,\n\tletterSpacing: true,\n\ttextAlign: true,\n\ttextTransform: true,\n\ttextDecoration: true,\n\ttextIndent: true,\n\twritingMode: true,\n\ttextColumns: true,\n};\n\nconst EMPTY_VALUES = [ undefined, null, '' ];\n\nfunction hasValue( value ) {\n\treturn ! EMPTY_VALUES.includes( value );\n}\n\n/**\n * Extracts the numeric quantity from a raw CSS value so it can be used as a\n * unit-control placeholder. The control's unit selector already reflects the\n * inherited unit, so the placeholder must contain only the number (e.g.\n * `1.5em` -> `1.5`) rather than the full unit string.\n *\n * @param {string|number|undefined} rawValue Inherited value to parse.\n * @return {number|undefined} The numeric quantity, or `undefined` when absent.\n */\nfunction getNumericPlaceholder( rawValue ) {\n\tif ( ! hasValue( rawValue ) ) {\n\t\treturn undefined;\n\t}\n\tconst [ quantity ] = parseQuantityAndUnitFromRawValue( rawValue );\n\treturn quantity;\n}\n\nexport default function TypographyPanel( {\n\tas: Wrapper = TypographyToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tisGlobalStyles = false,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n\tcontrastWarning,\n} ) {\n\tconst { colors, allColors, areCustomSolidsEnabled, decodeValue } =\n\t\tuseColorGradientSettings( settings );\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\t// Text color. Writes to `color.text` (unchanged storage path). The\n\t// control is rendered here instead of the Color panel because text\n\t// color is a typographic concern.\n\tconst hasTextColorEnabled = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColorValue = () => !! value?.color?.text;\n\tconst setTextColor = ( newColor, newSlug ) => {\n\t\tconst encoded = encodeColorValueWithPalette(\n\t\t\tallColors,\n\t\t\tnewColor,\n\t\t\tnewSlug\n\t\t);\n\t\tlet changedObject = setImmutably( value, [ 'color', 'text' ], encoded );\n\t\t// With the experiment off, keep the pre-inheritance comparison on\n\t\t// `inheritedValue`.\n\t\tconst syncLinkColor = isGlobalStylesInheritanceEnabled()\n\t\t\t? shouldSyncLinkColor( value, inheritedValue )\n\t\t\t: inheritedValue?.color?.text ===\n\t\t\t inheritedValue?.elements?.link?.color?.text;\n\t\tif ( syncLinkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencoded\n\t\t\t);\n\t\t}\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Font Family\n\tconst hasFontFamilyEnabled = useHasFontFamilyControl( settings );\n\t// Render the local value when set, otherwise the inherited value\n\t// as the at-rest preselection. The placeholder boolean is computed\n\t// from `value` directly (not from the merged `fontFamily`) so a\n\t// locally-set value never trips the at-rest visual treatment, even\n\t// when it equals the inherited value.\n\tconst inheritedFontFamily = decodeValue(\n\t\tinheritedValue?.typography?.fontFamily\n\t);\n\tconst fontFamily =\n\t\tdecodeValue( value?.typography?.fontFamily ) ?? inheritedFontFamily;\n\tconst isFontFamilyPlaceholder =\n\t\t! hasValue( value?.typography?.fontFamily ) &&\n\t\thasValue( inheritedFontFamily );\n\tconst { fontFamilies, fontFamilyFaces } = useMemo( () => {\n\t\treturn getMergedFontFamiliesAndFontFamilyFaces( settings, fontFamily );\n\t}, [ settings, fontFamily ] );\n\n\tconst setFontFamily = ( newValue ) => {\n\t\tconst slug = fontFamilies?.find(\n\t\t\t( { fontFamily: f } ) => f === newValue\n\t\t)?.slug;\n\t\tconst nextFontFamily = slug\n\t\t\t? `var:preset|font-family|${ slug }`\n\t\t\t: newValue;\n\t\tlet updatedValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'typography', 'fontFamily' ],\n\t\t\thasValue( nextFontFamily ) ? nextFontFamily : undefined\n\t\t);\n\n\t\t// Check if current font style/weight are available in the new font family.\n\t\tconst newFontFamilyFaces =\n\t\t\tfontFamilies?.find( ( { fontFamily: f } ) => f === newValue )\n\t\t\t\t?.fontFace ?? [];\n\t\tconst { fontStyles, fontWeights } =\n\t\t\tgetFontStylesAndWeights( newFontFamilyFaces );\n\t\tconst hasFontStyle = fontStyles?.some(\n\t\t\t( { value: fs } ) => fs === fontStyle\n\t\t);\n\t\tconst hasFontWeight = fontWeights?.some(\n\t\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t\t);\n\n\t\t// Find the nearest available font style/weight if not available.\n\t\tif ( ! hasFontStyle || ! hasFontWeight ) {\n\t\t\tconst { nearestFontStyle, nearestFontWeight } =\n\t\t\t\tfindNearestStyleAndWeight(\n\t\t\t\t\tnewFontFamilyFaces,\n\t\t\t\t\tfontStyle,\n\t\t\t\t\tfontWeight\n\t\t\t\t);\n\t\t\tif ( nearestFontStyle || nearestFontWeight ) {\n\t\t\t\t// Update to the nearest available font style/weight in the new font family.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( nearestFontStyle )\n\t\t\t\t\t\t\t? nearestFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( nearestFontWeight )\n\t\t\t\t\t\t\t? nearestFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else if ( fontStyle || fontWeight ) {\n\t\t\t\t// Reset if no available styles/weights found.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: undefined,\n\t\t\t\t\t\tfontWeight: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tonChange( updatedValue );\n\t};\n\tconst hasFontFamily = () => hasValue( value?.typography?.fontFamily );\n\tconst resetFontFamily = () => setFontFamily( undefined );\n\n\t// Font Size\n\tconst hasFontSizeEnabled = useHasFontSizeControl( settings );\n\tconst disableCustomFontSizes = ! settings?.typography?.customFontSize;\n\tconst mergedFontSizes = getMergedFontSizes( settings );\n\n\t// Local-then-inherited resolution for the rendered value. The slug\n\t// extraction reads the same composite raw value so an inherited\n\t// preset preselects its chip at rest while a local literal value\n\t// renders as a literal in the custom-size input.\n\tconst rawLocalFontSize = value?.typography?.fontSize;\n\tconst rawInheritedFontSize = inheritedValue?.typography?.fontSize;\n\tconst rawFontSizeForDisplay = rawLocalFontSize ?? rawInheritedFontSize;\n\tconst fontSize = decodeValue( rawFontSizeForDisplay );\n\tconst inheritedFontSizeDecoded = decodeValue( rawInheritedFontSize );\n\tconst isFontSizePlaceholder =\n\t\t! hasValue( rawLocalFontSize ) && hasValue( rawInheritedFontSize );\n\n\t// Extract the slug from the CSS custom property if it exists.\n\tconst extractSlug = ( rawValue ) => {\n\t\tif ( ! rawValue || typeof rawValue !== 'string' ) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Block supports use `var:preset` format.\n\t\tif ( rawValue.startsWith( 'var:preset|font-size|' ) ) {\n\t\t\treturn rawValue.replace( 'var:preset|font-size|', '' );\n\t\t}\n\t\t// Global styles data uses `var(--wp--preset)` format.\n\t\tconst cssVarMatch = rawValue.match(\n\t\t\t/^var\\(--wp--preset--font-size--([^)]+)\\)$/\n\t\t);\n\t\tif ( cssVarMatch ) {\n\t\t\treturn cssVarMatch[ 1 ];\n\t\t}\n\t\treturn undefined;\n\t};\n\tconst currentFontSizeSlug = extractSlug( rawFontSizeForDisplay );\n\tconst inheritedFontSizeSlug = extractSlug( rawInheritedFontSize );\n\n\tconst setFontSize = ( newValue, metadata ) => {\n\t\tconst actualValue = !! metadata?.slug\n\t\t\t? `var:preset|font-size|${ metadata?.slug }`\n\t\t\t: newValue;\n\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'fontSize' ],\n\t\t\t\thasValue( actualValue ) ? actualValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: at-rest, the inner\n\t// `FontSizePickerToggleGroup` fires `onChange( undefined )` when the\n\t// user activates the already-preselected (inherited) chip. Treat\n\t// that as the user's \"accept this inherited value\" affordance and\n\t// commit the inherited value to local. Once committed (no longer\n\t// at-rest), the same `undefined` payload represents a normal\n\t// deselect, so we let it pass through unchanged. The custom-size\n\t// input does not emit `undefined` on focus or activation, so this\n\t// hook is correctly scoped to the ToggleGroup activation path.\n\tconst setFontSizeWithInheritedCommit = ( newValue, metadata ) => {\n\t\tif ( isFontSizePlaceholder && newValue === undefined && ! metadata ) {\n\t\t\tif ( inheritedFontSizeSlug ) {\n\t\t\t\tsetFontSize( undefined, { slug: inheritedFontSizeSlug } );\n\t\t\t} else {\n\t\t\t\tsetFontSize( inheritedFontSizeDecoded );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsetFontSize( newValue, metadata );\n\t};\n\tconst hasFontSize = () => hasValue( value?.typography?.fontSize );\n\tconst resetFontSize = () => setFontSize( undefined );\n\n\t// Appearance\n\tconst hasAppearanceControl = useHasAppearanceControl( settings );\n\tconst appearanceControlLabel = useAppearanceControlLabel( settings );\n\tconst hasFontStyles = settings?.typography?.fontStyle;\n\tconst hasFontWeights = settings?.typography?.fontWeight;\n\t// Render local-then-inherited; placeholder fires only when both\n\t// local leaves are unset and at least one inherited leaf exists.\n\tconst inheritedFontStyle = decodeValue(\n\t\tinheritedValue?.typography?.fontStyle\n\t);\n\tconst inheritedFontWeight = decodeValue(\n\t\tinheritedValue?.typography?.fontWeight\n\t);\n\tconst fontStyle =\n\t\tdecodeValue( value?.typography?.fontStyle ) ?? inheritedFontStyle;\n\tconst fontWeight =\n\t\tdecodeValue( value?.typography?.fontWeight ) ?? inheritedFontWeight;\n\tconst isFontAppearancePlaceholder =\n\t\t! hasValue( value?.typography?.fontStyle ) &&\n\t\t! hasValue( value?.typography?.fontWeight ) &&\n\t\t( hasValue( inheritedFontStyle ) || hasValue( inheritedFontWeight ) );\n\tconst setFontAppearance = useCallback(\n\t\t( { fontStyle: newFontStyle, fontWeight: newFontWeight } ) => {\n\t\t\t// Only update the font style and weight if they have changed.\n\t\t\tif ( newFontStyle !== fontStyle || newFontWeight !== fontWeight ) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( newFontStyle )\n\t\t\t\t\t\t\t? newFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( newFontWeight )\n\t\t\t\t\t\t\t? newFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ fontStyle, fontWeight, onChange, value ]\n\t);\n\t// Display-without-commit interceptor for FontAppearance: when the\n\t// control is at rest (no local override, displaying the inherited\n\t// font style/weight), activating the already-preselected option\n\t// would otherwise be swallowed by the equality short-circuit in\n\t// `setFontAppearance`. Treat that activation as the user's\n\t// \"accept this inherited value\" affordance and commit the\n\t// inherited values to local explicitly.\n\tconst setFontAppearanceWithInheritedCommit = useCallback(\n\t\t( next ) => {\n\t\t\tif (\n\t\t\t\tisFontAppearancePlaceholder &&\n\t\t\t\tnext.fontStyle === fontStyle &&\n\t\t\t\tnext.fontWeight === fontWeight\n\t\t\t) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( fontStyle )\n\t\t\t\t\t\t\t? fontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( fontWeight )\n\t\t\t\t\t\t\t? fontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetFontAppearance( next );\n\t\t},\n\t\t[\n\t\t\tisFontAppearancePlaceholder,\n\t\t\tfontStyle,\n\t\t\tfontWeight,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tsetFontAppearance,\n\t\t]\n\t);\n\tconst hasFontAppearance = () =>\n\t\thasValue( value?.typography?.fontStyle ) ||\n\t\thasValue( value?.typography?.fontWeight );\n\tconst resetFontAppearance = useCallback( () => {\n\t\tsetFontAppearance( {} );\n\t}, [ setFontAppearance ] );\n\n\t// Line Height\n\tconst hasLineHeightEnabled = useHasLineHeightControl( settings );\n\tconst localLineHeight = decodeValue( value?.typography?.lineHeight );\n\tconst inheritedLineHeight = decodeValue(\n\t\tinheritedValue?.typography?.lineHeight\n\t);\n\tconst isLineHeightPlaceholder =\n\t\t! hasValue( value?.typography?.lineHeight ) &&\n\t\thasValue( inheritedLineHeight );\n\tconst setLineHeight = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'lineHeight' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLineHeight = () => hasValue( value?.typography?.lineHeight );\n\tconst resetLineHeight = () => setLineHeight( undefined );\n\n\t// Letter Spacing\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( settings );\n\tconst localLetterSpacing = decodeValue( value?.typography?.letterSpacing );\n\tconst inheritedLetterSpacing = decodeValue(\n\t\tinheritedValue?.typography?.letterSpacing\n\t);\n\tconst isLetterSpacingPlaceholder =\n\t\t! hasValue( value?.typography?.letterSpacing ) &&\n\t\thasValue( inheritedLetterSpacing );\n\tconst setLetterSpacing = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'letterSpacing' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLetterSpacing = () => hasValue( value?.typography?.letterSpacing );\n\tconst resetLetterSpacing = () => setLetterSpacing( undefined );\n\n\t// Text Indent\n\tconst hasTextIndentControl = useHasTextIndentControl( settings );\n\tconst localTextIndent = decodeValue( value?.typography?.textIndent );\n\tconst inheritedTextIndent = decodeValue(\n\t\tinheritedValue?.typography?.textIndent\n\t);\n\tconst isTextIndentPlaceholder =\n\t\t! hasValue( value?.typography?.textIndent ) &&\n\t\thasValue( inheritedTextIndent );\n\n\t// Get the setting value - can be 'subsequent' (default), 'all', or false.\n\t// The setting determines which CSS selector is used for the text-indent style.\n\tconst textIndentSetting = settings?.typography?.textIndent ?? 'subsequent';\n\tconst isTextIndentAll = textIndentSetting === 'all';\n\n\tconst setTextIndentValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textIndent' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onToggleTextIndentAll = ( newValue ) => {\n\t\t// Toggle between 'all' and 'subsequent' for the setting.\n\t\t// Include the settings change so it can be handled atomically by the parent.\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tsettings: {\n\t\t\t\ttypography: {\n\t\t\t\t\ttextIndent: newValue ? 'all' : 'subsequent',\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst hasTextIndent = () => hasValue( value?.typography?.textIndent );\n\tconst resetTextIndent = () => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'typography', 'textIndent' ], undefined )\n\t\t);\n\t};\n\tconst textIndentHelp = isTextIndentAll\n\t\t? __( 'Indents the first line of all paragraphs.' )\n\t\t: __( 'Indents the first line of each paragraph after the first one.' );\n\n\t// Text Columns\n\tconst hasTextColumnsControl = useHasTextColumnsControl( settings );\n\tconst localTextColumns = decodeValue( value?.typography?.textColumns );\n\tconst inheritedTextColumns = decodeValue(\n\t\tinheritedValue?.typography?.textColumns\n\t);\n\tconst isTextColumnsPlaceholder =\n\t\t! hasValue( value?.typography?.textColumns ) &&\n\t\thasValue( inheritedTextColumns );\n\tconst setTextColumns = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textColumns' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextColumns = () => hasValue( value?.typography?.textColumns );\n\tconst resetTextColumns = () => setTextColumns( undefined );\n\n\t// Text Transform\n\tconst hasTextTransformControl = useHasTextTransformControl( settings );\n\tconst inheritedTextTransform = decodeValue(\n\t\tinheritedValue?.typography?.textTransform\n\t);\n\tconst textTransform =\n\t\tdecodeValue( value?.typography?.textTransform ) ??\n\t\tinheritedTextTransform;\n\tconst isTextTransformPlaceholder =\n\t\t! hasValue( value?.typography?.textTransform ) &&\n\t\thasValue( inheritedTextTransform );\n\tconst setTextTransform = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textTransform' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: when at-rest, the inner\n\t// `ToggleGroupControl` fires `onChange( undefined )` if the user\n\t// activates the already-preselected (inherited) option. We treat\n\t// that activation as the user's \"accept this inherited value\"\n\t// affordance and commit the inherited value to local. When\n\t// committed (no longer at-rest), the same `undefined` payload\n\t// represents a normal `isDeselectable` deselect, so we let it pass\n\t// through unchanged.\n\tconst setTextTransformWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextTransformPlaceholder && newValue === undefined ) {\n\t\t\tsetTextTransform( inheritedTextTransform );\n\t\t\treturn;\n\t\t}\n\t\tsetTextTransform( newValue );\n\t};\n\tconst hasTextTransform = () => hasValue( value?.typography?.textTransform );\n\tconst resetTextTransform = () => setTextTransform( undefined );\n\n\t// Text Decoration\n\tconst hasTextDecorationControl = useHasTextDecorationControl( settings );\n\tconst inheritedTextDecoration = decodeValue(\n\t\tinheritedValue?.typography?.textDecoration\n\t);\n\tconst textDecoration =\n\t\tdecodeValue( value?.typography?.textDecoration ) ??\n\t\tinheritedTextDecoration;\n\tconst isTextDecorationPlaceholder =\n\t\t! hasValue( value?.typography?.textDecoration ) &&\n\t\thasValue( inheritedTextDecoration );\n\tconst setTextDecoration = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textDecoration' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextDecorationWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextDecorationPlaceholder && newValue === undefined ) {\n\t\t\tsetTextDecoration( inheritedTextDecoration );\n\t\t\treturn;\n\t\t}\n\t\tsetTextDecoration( newValue );\n\t};\n\tconst hasTextDecoration = () =>\n\t\thasValue( value?.typography?.textDecoration );\n\tconst resetTextDecoration = () => setTextDecoration( undefined );\n\n\t// Text Orientation\n\tconst hasWritingModeControl = useHasWritingModeControl( settings );\n\tconst inheritedWritingMode = decodeValue(\n\t\tinheritedValue?.typography?.writingMode\n\t);\n\tconst writingMode =\n\t\tdecodeValue( value?.typography?.writingMode ) ?? inheritedWritingMode;\n\tconst isWritingModePlaceholder =\n\t\t! hasValue( value?.typography?.writingMode ) &&\n\t\thasValue( inheritedWritingMode );\n\tconst setWritingMode = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'writingMode' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setWritingModeWithInheritedCommit = ( newValue ) => {\n\t\tif ( isWritingModePlaceholder && newValue === undefined ) {\n\t\t\tsetWritingMode( inheritedWritingMode );\n\t\t\treturn;\n\t\t}\n\t\tsetWritingMode( newValue );\n\t};\n\tconst hasWritingMode = () => hasValue( value?.typography?.writingMode );\n\tconst resetWritingMode = () => setWritingMode( undefined );\n\n\t// Text Alignment\n\tconst hasTextAlignmentControl = useHasTextAlignmentControl( settings );\n\n\tconst inheritedTextAlign = decodeValue(\n\t\tinheritedValue?.typography?.textAlign\n\t);\n\tconst textAlign =\n\t\tdecodeValue( value?.typography?.textAlign ) ?? inheritedTextAlign;\n\tconst isTextAlignPlaceholder =\n\t\t! hasValue( value?.typography?.textAlign ) &&\n\t\thasValue( inheritedTextAlign );\n\tconst setTextAlign = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textAlign' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextAlignWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextAlignPlaceholder && newValue === undefined ) {\n\t\t\tsetTextAlign( inheritedTextAlign );\n\t\t\treturn;\n\t\t}\n\t\tsetTextAlign( newValue );\n\t};\n\tconst hasTextAlign = () => hasValue( value?.typography?.textAlign );\n\tconst resetTextAlign = () => setTextAlign( undefined );\n\n\tconst resetAllFilter = useCallback(\n\t\t( previousValue ) => {\n\t\t\tif ( ! hasTextColorEnabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t...previousValue,\n\t\t\t\t\ttypography: {},\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...previousValue,\n\t\t\t\ttypography: {},\n\t\t\t\tcolor: {\n\t\t\t\t\t...previousValue?.color,\n\t\t\t\t\ttext: undefined,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\t[ hasTextColorEnabled ]\n\t);\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ hasTextColorEnabled && (\n\t\t\t\t<ColorGradientDropdownItem\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\thasValue={ hasTextColorValue }\n\t\t\t\t\tresetValue={ resetTextColor }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColor }\n\t\t\t\t\tindicators={ [ userTextColor ?? textColor ] }\n\t\t\t\t\tcontrastWarning={ contrastWarning }\n\t\t\t\t\tshowInheritanceLabelIndicators={\n\t\t\t\t\t\tshowInheritanceLabelIndicators\n\t\t\t\t\t}\n\t\t\t\t\tisPlaceholder={\n\t\t\t\t\t\tuserTextColor === undefined && textColor !== undefined\n\t\t\t\t\t}\n\t\t\t\t\thasInheritedValue={ textColor !== undefined }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\t\t\tinheritedSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tinheritedValue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tuserSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tvalue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t\t\t\tisPlaceholder:\n\t\t\t\t\t\t\t\tuserTextColor === undefined &&\n\t\t\t\t\t\t\t\ttextColor !== undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFontFamilyEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontFamilyPlaceholder,\n\t\t\t\t\t\thasFontFamily() && inheritedFontFamily !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Font' ) }\n\t\t\t\t\thasValue={ hasFontFamily }\n\t\t\t\t\tonDeselect={ resetFontFamily }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontFamily }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontFamilyControl\n\t\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\t\tvalue={ fontFamily }\n\t\t\t\t\t\tonChange={ setFontFamily }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasFontSizeEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontSizePlaceholder,\n\t\t\t\t\t\thasFontSize() && rawInheritedFontSize !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\thasValue={ hasFontSize }\n\t\t\t\t\thasInlineEndToggle\n\t\t\t\t\tonDeselect={ resetFontSize }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontSize }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontSizePicker\n\t\t\t\t\t\tvalue={ currentFontSizeSlug || fontSize }\n\t\t\t\t\t\tvalueMode={ currentFontSizeSlug ? 'slug' : 'literal' }\n\t\t\t\t\t\tonChange={ setFontSizeWithInheritedCommit }\n\t\t\t\t\t\tfontSizes={ mergedFontSizes }\n\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\twithReset={ false }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontAppearancePlaceholder,\n\t\t\t\t\t\thasFontAppearance() &&\n\t\t\t\t\t\t\t( inheritedFontStyle !== undefined ||\n\t\t\t\t\t\t\t\tinheritedFontWeight !== undefined )\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ appearanceControlLabel }\n\t\t\t\t\thasValue={ hasFontAppearance }\n\t\t\t\t\tonDeselect={ resetFontAppearance }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontAppearance }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontAppearanceControl\n\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ setFontAppearanceWithInheritedCommit }\n\t\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t\t\tfontFamilyFaces={ fontFamilyFaces }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLineHeightPlaceholder,\n\t\t\t\t\t\thasLineHeight() && inheritedLineHeight !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\t\thasValue={ hasLineHeight }\n\t\t\t\t\tonDeselect={ resetLineHeight }\n\t\t\t\t\tisShownByDefault={ defaultControls.lineHeight }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LineHeightControl\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tvalue={ localLineHeight ?? inheritedLineHeight }\n\t\t\t\t\t\tonChange={ setLineHeight }\n\t\t\t\t\t\t// Only override the placeholder when there is an\n\t\t\t\t\t\t// inherited value to surface. Passing `undefined` would\n\t\t\t\t\t\t// clobber `LineHeightControl`'s own `BASE_DEFAULT_VALUE`\n\t\t\t\t\t\t// (1.5) placeholder.\n\t\t\t\t\t\t{ ...( isLineHeightPlaceholder\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tplaceholder:\n\t\t\t\t\t\t\t\t\t\tgetNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\t\tinheritedLineHeight\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {} ) }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLetterSpacingPlaceholder,\n\t\t\t\t\t\thasLetterSpacing() &&\n\t\t\t\t\t\t\tinheritedLetterSpacing !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter spacing' ) }\n\t\t\t\t\thasValue={ hasLetterSpacing }\n\t\t\t\t\tonDeselect={ resetLetterSpacing }\n\t\t\t\t\tisShownByDefault={ defaultControls.letterSpacing }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LetterSpacingControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the unit parses from\n\t\t\t\t\t\t// it (e.g. \"0.02em\" keeps the em unit rather than the\n\t\t\t\t\t\t// value string sitting behind a default px unit). It is\n\t\t\t\t\t\t// only written to local on user change. Matches the\n\t\t\t\t\t\t// ToggleGroup/FontSize controls rather than the\n\t\t\t\t\t\t// native-placeholder pattern.\n\t\t\t\t\t\tvalue={ localLetterSpacing ?? inheritedLetterSpacing }\n\t\t\t\t\t\tonChange={ setLetterSpacing }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisLetterSpacingPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedLetterSpacing\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextIndentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextIndentPlaceholder,\n\t\t\t\t\t\thasTextIndent() && inheritedTextIndent !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line indent' ) }\n\t\t\t\t\thasValue={ hasTextIndent }\n\t\t\t\t\tonDeselect={ resetTextIndent }\n\t\t\t\t\tisShownByDefault={ defaultControls.textIndent }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextIndentControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the UnitControl parses\n\t\t\t\t\t\t// and shows the inherited unit (e.g. `1.5em` selects the\n\t\t\t\t\t\t// `em` unit) instead of a raw string in the placeholder\n\t\t\t\t\t\t// while the unit stays at the default `px`. Written to\n\t\t\t\t\t\t// local only on user change.\n\t\t\t\t\t\tvalue={ localTextIndent ?? inheritedTextIndent }\n\t\t\t\t\t\tonChange={ setTextIndentValue }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\thasBottomMargin={ isGlobalStyles }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextIndentPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder( inheritedTextIndent )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ isGlobalStyles && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Indent all paragraphs' ) }\n\t\t\t\t\t\t\tchecked={ isTextIndentAll }\n\t\t\t\t\t\t\tonChange={ onToggleTextIndentAll }\n\t\t\t\t\t\t\thelp={ textIndentHelp }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextColumnsControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextColumnsPlaceholder,\n\t\t\t\t\t\thasTextColumns() && inheritedTextColumns !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\thasValue={ hasTextColumns }\n\t\t\t\t\tonDeselect={ resetTextColumns }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColumns }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tmax={ MAX_TEXT_COLUMNS }\n\t\t\t\t\t\tmin={ MIN_TEXT_COLUMNS }\n\t\t\t\t\t\tonChange={ setTextColumns }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextColumnsPlaceholder\n\t\t\t\t\t\t\t\t? inheritedTextColumns\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tvalue={ localTextColumns }\n\t\t\t\t\t\tinitialPosition={ 1 }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextDecorationControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextDecorationPlaceholder,\n\t\t\t\t\t\thasTextDecoration() &&\n\t\t\t\t\t\t\tinheritedTextDecoration !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Decoration' ) }\n\t\t\t\t\thasValue={ hasTextDecoration }\n\t\t\t\t\tonDeselect={ resetTextDecoration }\n\t\t\t\t\tisShownByDefault={ defaultControls.textDecoration }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextDecorationControl\n\t\t\t\t\t\tvalue={ textDecoration }\n\t\t\t\t\t\tonChange={ setTextDecorationWithInheritedCommit }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasWritingModeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWritingModePlaceholder,\n\t\t\t\t\t\thasWritingMode() && inheritedWritingMode !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\t\t\thasValue={ hasWritingMode }\n\t\t\t\t\tonDeselect={ resetWritingMode }\n\t\t\t\t\tisShownByDefault={ defaultControls.writingMode }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<WritingModeControl\n\t\t\t\t\t\tvalue={ writingMode }\n\t\t\t\t\t\tonChange={ setWritingModeWithInheritedCommit }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextTransformControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextTransformPlaceholder,\n\t\t\t\t\t\thasTextTransform() &&\n\t\t\t\t\t\t\tinheritedTextTransform !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter case' ) }\n\t\t\t\t\thasValue={ hasTextTransform }\n\t\t\t\t\tonDeselect={ resetTextTransform }\n\t\t\t\t\tisShownByDefault={ defaultControls.textTransform }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextTransformControl\n\t\t\t\t\t\tvalue={ textTransform }\n\t\t\t\t\t\tonChange={ setTextTransformWithInheritedCommit }\n\t\t\t\t\t\tshowNone\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextAlignmentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextAlignPlaceholder,\n\t\t\t\t\t\thasTextAlign() && inheritedTextAlign !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Text alignment' ) }\n\t\t\t\t\thasValue={ hasTextAlign }\n\t\t\t\t\tonDeselect={ resetTextAlign }\n\t\t\t\t\tisShownByDefault={ defaultControls.textAlign }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextAlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ setTextAlignWithInheritedCommit }\n\t\t\t\t\t\toptions={ [ 'left', 'center', 'right', 'justify' ] }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ textAlign === 'justify' && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Justified text can reduce readability. For better accessibility, use left-aligned text instead.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t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AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ;AAAA,gBACR,UAAW;AAAA;AAAA,YACZ;AAAA;AAAA,QACD;AAAA,QAEC,2BACD;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,cACJ;AAAA,cACA,iBAAiB,KAChB,2BAA2B;AAAA,YAC7B;AAAA,YACA,OAAQ,GAAI,aAAc;AAAA,YAC1B,UAAW;AAAA,YACX,YAAa;AAAA,YACb,kBAAmB,gBAAgB;AAAA,YACnC;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ;AAAA,gBACR,UAAW;AAAA,gBACX,UAAQ;AAAA,gBACR,SAAO;AAAA;AAAA,YACR;AAAA;AAAA,QACD;AAAA,QAEC,2BACD;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,cACJ;AAAA,cACA,aAAa,KAAK,uBAAuB;AAAA,YAC1C;AAAA,YACA,OAAQ,GAAI,gBAAiB;AAAA,YAC7B,UAAW;AAAA,YACX,YAAa;AAAA,YACb,kBAAmB,gBAAgB;AAAA,YACnC;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,OAAQ;AAAA,kBACR,UAAW;AAAA,kBACX,SAAU,CAAE,QAAQ,UAAU,SAAS,SAAU;AAAA;AAAA,cAClD;AAAA,cAEE,cAAc,aACf,oBAAC,SACA,8BAAC,UAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,gBACD;AAAA,cACD,GACD,GACD;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
4
|
+
"sourcesContent": ["import {\n\tFontSizePicker,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tNotice,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport FontFamilyControl from '../font-family';\nimport FontAppearanceControl from '../font-appearance-control';\nimport LineHeightControl from '../line-height-control';\nimport LetterSpacingControl from '../letter-spacing-control';\nimport TextAlignmentControl from '../text-alignment-control';\nimport TextTransformControl from '../text-transform-control';\nimport TextDecorationControl from '../text-decoration-control';\nimport TextIndentControl from '../text-indent-control';\nimport WritingModeControl from '../writing-mode-control';\nimport { TextShadowPopover } from './text-shadow-panel';\nimport ColorGradientDropdownItem from './color-gradient-dropdown-item';\nimport { useHasTextPanel } from './color-panel';\nimport { useColorGradientSettings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\textractPresetSlug,\n\tencodeColorValueWithPalette,\n} from '../../utils/color-values';\nimport {\n\tgetMergedFontFamiliesAndFontFamilyFaces,\n\tfindNearestStyleAndWeight,\n} from './typography-utils';\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tisGlobalStylesInheritanceIndicatorUIEnabled,\n} from './inheritance';\n\nconst MIN_TEXT_COLUMNS = 1;\nconst MAX_TEXT_COLUMNS = 6;\n\n/**\n * Whether a link color should follow a text color change.\n *\n * A link color tracks the text color (e.g. a Button's) unless it was set\n * deliberately. Raw preset refs are compared rather than decoded hex, since\n * distinct slots can share a hex (`dark-background`/`dark-text` both `#000`).\n *\n * @param {Object} value Local block styles.\n * @param {Object} inheritedValue Styles inherited from Global Styles.\n * @return {boolean} Whether to sync the link color to the text color.\n */\nfunction shouldSyncLinkColor( value, inheritedValue ) {\n\tconst localLinkColor = value?.elements?.link?.color?.text;\n\t// A local link color keeps tracking only while it matches the text color;\n\t// once it differs it was set deliberately and is left alone.\n\tif ( localLinkColor !== undefined ) {\n\t\treturn localLinkColor === value?.color?.text;\n\t}\n\t// With none set, defer to the inherited values.\n\tconst inheritedLinkColor = inheritedValue?.elements?.link?.color?.text;\n\treturn (\n\t\tinheritedLinkColor === undefined ||\n\t\tinheritedValue?.color?.text === inheritedLinkColor\n\t);\n}\n\nexport function useHasTypographyPanel( settings ) {\n\tconst hasFontFamily = useHasFontFamilyControl( settings );\n\tconst hasLineHeight = useHasLineHeightControl( settings );\n\tconst hasFontAppearance = useHasAppearanceControl( settings );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( settings );\n\tconst hasTextAlign = useHasTextAlignmentControl( settings );\n\tconst hasTextTransform = useHasTextTransformControl( settings );\n\tconst hasTextDecoration = useHasTextDecorationControl( settings );\n\tconst hasTextIndent = useHasTextIndentControl( settings );\n\tconst hasWritingMode = useHasWritingModeControl( settings );\n\tconst hasTextColumns = useHasTextColumnsControl( settings );\n\tconst hasFontSize = useHasFontSizeControl( settings );\n\tconst hasTextColor = useHasTextPanel( settings );\n\tconst hasTextShadow = useHasTextShadowControl( settings );\n\n\treturn (\n\t\thasFontFamily ||\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\thasTextAlign ||\n\t\thasTextTransform ||\n\t\thasFontSize ||\n\t\thasTextDecoration ||\n\t\thasTextIndent ||\n\t\thasWritingMode ||\n\t\thasTextColumns ||\n\t\thasTextColor ||\n\t\thasTextShadow\n\t);\n}\n\nfunction useHasFontSizeControl( settings ) {\n\treturn (\n\t\t( settings?.typography?.defaultFontSizes !== false &&\n\t\t\tsettings?.typography?.fontSizes?.default?.length ) ||\n\t\tsettings?.typography?.fontSizes?.theme?.length ||\n\t\tsettings?.typography?.fontSizes?.custom?.length ||\n\t\tsettings?.typography?.customFontSize\n\t);\n}\n\nfunction useHasFontFamilyControl( settings ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => settings?.typography?.fontFamilies?.[ key ]?.length\n\t);\n}\n\nfunction useHasLineHeightControl( settings ) {\n\treturn settings?.typography?.lineHeight;\n}\n\nfunction useHasAppearanceControl( settings ) {\n\treturn settings?.typography?.fontStyle || settings?.typography?.fontWeight;\n}\n\nfunction useAppearanceControlLabel( settings ) {\n\tif ( ! settings?.typography?.fontStyle ) {\n\t\treturn __( 'Font weight' );\n\t}\n\tif ( ! settings?.typography?.fontWeight ) {\n\t\treturn __( 'Font style' );\n\t}\n\treturn __( 'Appearance' );\n}\n\nfunction useHasLetterSpacingControl( settings ) {\n\treturn settings?.typography?.letterSpacing;\n}\n\nfunction useHasTextTransformControl( settings ) {\n\treturn settings?.typography?.textTransform;\n}\n\nfunction useHasTextAlignmentControl( settings ) {\n\treturn settings?.typography?.textAlign;\n}\n\nfunction useHasTextDecorationControl( settings ) {\n\treturn settings?.typography?.textDecoration;\n}\n\nfunction useHasWritingModeControl( settings ) {\n\treturn settings?.typography?.writingMode;\n}\n\nfunction useHasTextColumnsControl( settings ) {\n\treturn settings?.typography?.textColumns;\n}\n\nfunction useHasTextIndentControl( settings ) {\n\treturn settings?.typography?.textIndent;\n}\n\nfunction useHasTextShadowControl( settings ) {\n\treturn settings?.typography?.textShadow;\n}\n\n/**\n * Concatenate all the font sizes into a single list for the font size picker.\n *\n * @param {Object} settings The global styles settings.\n *\n * @return {Array} The merged font sizes.\n */\nfunction getMergedFontSizes( settings ) {\n\tconst fontSizes = settings?.typography?.fontSizes;\n\tconst defaultFontSizesEnabled = !! settings?.typography?.defaultFontSizes;\n\treturn [\n\t\t...( fontSizes?.custom ?? [] ),\n\t\t...( fontSizes?.theme ?? [] ),\n\t\t...( defaultFontSizesEnabled ? ( fontSizes?.default ?? [] ) : [] ),\n\t];\n}\n\nexport function TypographyToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Typography' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttextColor: true,\n\tfontFamily: true,\n\tfontSize: true,\n\tfontAppearance: true,\n\tlineHeight: true,\n\tletterSpacing: true,\n\ttextAlign: true,\n\ttextTransform: true,\n\ttextDecoration: true,\n\ttextIndent: true,\n\twritingMode: true,\n\ttextColumns: true,\n\ttextShadow: true,\n};\n\nconst EMPTY_VALUES = [ undefined, null, '' ];\n\nfunction hasValue( value ) {\n\treturn ! EMPTY_VALUES.includes( value );\n}\n\n/**\n * Extracts the numeric quantity from a raw CSS value so it can be used as a\n * unit-control placeholder. The control's unit selector already reflects the\n * inherited unit, so the placeholder must contain only the number (e.g.\n * `1.5em` -> `1.5`) rather than the full unit string.\n *\n * @param {string|number|undefined} rawValue Inherited value to parse.\n * @return {number|undefined} The numeric quantity, or `undefined` when absent.\n */\nfunction getNumericPlaceholder( rawValue ) {\n\tif ( ! hasValue( rawValue ) ) {\n\t\treturn undefined;\n\t}\n\tconst [ quantity ] = parseQuantityAndUnitFromRawValue( rawValue );\n\treturn quantity;\n}\n\nexport default function TypographyPanel( {\n\tas: Wrapper = TypographyToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tisGlobalStyles = false,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),\n\tcontrastWarning,\n} ) {\n\tconst { colors, allColors, areCustomSolidsEnabled, decodeValue } =\n\t\tuseColorGradientSettings( settings );\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\t// Text color. Writes to `color.text` (unchanged storage path). The\n\t// control is rendered here instead of the Color panel because text\n\t// color is a typographic concern.\n\tconst hasTextColorEnabled = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColorValue = () => !! value?.color?.text;\n\tconst setTextColor = ( newColor, newSlug ) => {\n\t\tconst encoded = encodeColorValueWithPalette(\n\t\t\tallColors,\n\t\t\tnewColor,\n\t\t\tnewSlug\n\t\t);\n\t\tlet changedObject = setImmutably( value, [ 'color', 'text' ], encoded );\n\t\tif ( shouldSyncLinkColor( value, inheritedValue ) ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencoded\n\t\t\t);\n\t\t}\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Font Family\n\tconst hasFontFamilyEnabled = useHasFontFamilyControl( settings );\n\t// Render the local value when set, otherwise the inherited value\n\t// as the at-rest preselection. The placeholder boolean is computed\n\t// from `value` directly (not from the merged `fontFamily`) so a\n\t// locally-set value never trips the at-rest visual treatment, even\n\t// when it equals the inherited value.\n\tconst inheritedFontFamily = decodeValue(\n\t\tinheritedValue?.typography?.fontFamily\n\t);\n\tconst fontFamily =\n\t\tdecodeValue( value?.typography?.fontFamily ) ?? inheritedFontFamily;\n\tconst isFontFamilyPlaceholder =\n\t\t! hasValue( value?.typography?.fontFamily ) &&\n\t\thasValue( inheritedFontFamily );\n\tconst { fontFamilies, fontFamilyFaces } = useMemo( () => {\n\t\treturn getMergedFontFamiliesAndFontFamilyFaces( settings, fontFamily );\n\t}, [ settings, fontFamily ] );\n\n\tconst setFontFamily = ( newValue ) => {\n\t\tconst slug = fontFamilies?.find(\n\t\t\t( { fontFamily: f } ) => f === newValue\n\t\t)?.slug;\n\t\tconst nextFontFamily = slug\n\t\t\t? `var:preset|font-family|${ slug }`\n\t\t\t: newValue;\n\t\tlet updatedValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'typography', 'fontFamily' ],\n\t\t\thasValue( nextFontFamily ) ? nextFontFamily : undefined\n\t\t);\n\n\t\t// Check if current font style/weight are available in the new font family.\n\t\tconst newFontFamilyFaces =\n\t\t\tfontFamilies?.find( ( { fontFamily: f } ) => f === newValue )\n\t\t\t\t?.fontFace ?? [];\n\t\tconst { fontStyles, fontWeights } =\n\t\t\tgetFontStylesAndWeights( newFontFamilyFaces );\n\t\tconst hasFontStyle = fontStyles?.some(\n\t\t\t( { value: fs } ) => fs === fontStyle\n\t\t);\n\t\tconst hasFontWeight = fontWeights?.some(\n\t\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t\t);\n\n\t\t// Find the nearest available font style/weight if not available.\n\t\tif ( ! hasFontStyle || ! hasFontWeight ) {\n\t\t\tconst { nearestFontStyle, nearestFontWeight } =\n\t\t\t\tfindNearestStyleAndWeight(\n\t\t\t\t\tnewFontFamilyFaces,\n\t\t\t\t\tfontStyle,\n\t\t\t\t\tfontWeight\n\t\t\t\t);\n\t\t\tif ( nearestFontStyle || nearestFontWeight ) {\n\t\t\t\t// Update to the nearest available font style/weight in the new font family.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( nearestFontStyle )\n\t\t\t\t\t\t\t? nearestFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( nearestFontWeight )\n\t\t\t\t\t\t\t? nearestFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else if ( fontStyle || fontWeight ) {\n\t\t\t\t// Reset if no available styles/weights found.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: undefined,\n\t\t\t\t\t\tfontWeight: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tonChange( updatedValue );\n\t};\n\tconst hasFontFamily = () => hasValue( value?.typography?.fontFamily );\n\tconst resetFontFamily = () => setFontFamily( undefined );\n\n\t// Font Size\n\tconst hasFontSizeEnabled = useHasFontSizeControl( settings );\n\tconst disableCustomFontSizes = ! settings?.typography?.customFontSize;\n\tconst mergedFontSizes = getMergedFontSizes( settings );\n\n\t// Local-then-inherited resolution for the rendered value. The slug\n\t// extraction reads the same composite raw value so an inherited\n\t// preset preselects its chip at rest while a local literal value\n\t// renders as a literal in the custom-size input.\n\tconst rawLocalFontSize = value?.typography?.fontSize;\n\tconst rawInheritedFontSize = inheritedValue?.typography?.fontSize;\n\tconst rawFontSizeForDisplay = rawLocalFontSize ?? rawInheritedFontSize;\n\tconst fontSize = decodeValue( rawFontSizeForDisplay );\n\tconst inheritedFontSizeDecoded = decodeValue( rawInheritedFontSize );\n\tconst isFontSizePlaceholder =\n\t\t! hasValue( rawLocalFontSize ) && hasValue( rawInheritedFontSize );\n\n\t// Extract the slug from the CSS custom property if it exists.\n\tconst extractSlug = ( rawValue ) => {\n\t\tif ( ! rawValue || typeof rawValue !== 'string' ) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Block supports use `var:preset` format.\n\t\tif ( rawValue.startsWith( 'var:preset|font-size|' ) ) {\n\t\t\treturn rawValue.replace( 'var:preset|font-size|', '' );\n\t\t}\n\t\t// Global styles data uses `var(--wp--preset)` format.\n\t\tconst cssVarMatch = rawValue.match(\n\t\t\t/^var\\(--wp--preset--font-size--([^)]+)\\)$/\n\t\t);\n\t\tif ( cssVarMatch ) {\n\t\t\treturn cssVarMatch[ 1 ];\n\t\t}\n\t\treturn undefined;\n\t};\n\tconst currentFontSizeSlug = extractSlug( rawFontSizeForDisplay );\n\tconst inheritedFontSizeSlug = extractSlug( rawInheritedFontSize );\n\n\tconst setFontSize = ( newValue, metadata ) => {\n\t\tconst actualValue = !! metadata?.slug\n\t\t\t? `var:preset|font-size|${ metadata?.slug }`\n\t\t\t: newValue;\n\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'fontSize' ],\n\t\t\t\thasValue( actualValue ) ? actualValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: at-rest, the inner\n\t// `FontSizePickerToggleGroup` fires `onChange( undefined )` when the\n\t// user activates the already-preselected (inherited) chip. Treat\n\t// that as the user's \"accept this inherited value\" affordance and\n\t// commit the inherited value to local. Once committed (no longer\n\t// at-rest), the same `undefined` payload represents a normal\n\t// deselect, so we let it pass through unchanged. The custom-size\n\t// input does not emit `undefined` on focus or activation, so this\n\t// hook is correctly scoped to the ToggleGroup activation path.\n\tconst setFontSizeWithInheritedCommit = ( newValue, metadata ) => {\n\t\tif ( isFontSizePlaceholder && newValue === undefined && ! metadata ) {\n\t\t\tif ( inheritedFontSizeSlug ) {\n\t\t\t\tsetFontSize( undefined, { slug: inheritedFontSizeSlug } );\n\t\t\t} else {\n\t\t\t\tsetFontSize( inheritedFontSizeDecoded );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsetFontSize( newValue, metadata );\n\t};\n\tconst hasFontSize = () => hasValue( value?.typography?.fontSize );\n\tconst resetFontSize = () => setFontSize( undefined );\n\n\t// Appearance\n\tconst hasAppearanceControl = useHasAppearanceControl( settings );\n\tconst appearanceControlLabel = useAppearanceControlLabel( settings );\n\tconst hasFontStyles = settings?.typography?.fontStyle;\n\tconst hasFontWeights = settings?.typography?.fontWeight;\n\t// Render local-then-inherited; placeholder fires only when both\n\t// local leaves are unset and at least one inherited leaf exists.\n\tconst inheritedFontStyle = decodeValue(\n\t\tinheritedValue?.typography?.fontStyle\n\t);\n\tconst inheritedFontWeight = decodeValue(\n\t\tinheritedValue?.typography?.fontWeight\n\t);\n\tconst fontStyle =\n\t\tdecodeValue( value?.typography?.fontStyle ) ?? inheritedFontStyle;\n\tconst fontWeight =\n\t\tdecodeValue( value?.typography?.fontWeight ) ?? inheritedFontWeight;\n\tconst isFontAppearancePlaceholder =\n\t\t! hasValue( value?.typography?.fontStyle ) &&\n\t\t! hasValue( value?.typography?.fontWeight ) &&\n\t\t( hasValue( inheritedFontStyle ) || hasValue( inheritedFontWeight ) );\n\tconst setFontAppearance = useCallback(\n\t\t( { fontStyle: newFontStyle, fontWeight: newFontWeight } ) => {\n\t\t\t// Only update the font style and weight if they have changed.\n\t\t\tif ( newFontStyle !== fontStyle || newFontWeight !== fontWeight ) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( newFontStyle )\n\t\t\t\t\t\t\t? newFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( newFontWeight )\n\t\t\t\t\t\t\t? newFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ fontStyle, fontWeight, onChange, value ]\n\t);\n\t// Display-without-commit interceptor for FontAppearance: when the\n\t// control is at rest (no local override, displaying the inherited\n\t// font style/weight), activating the already-preselected option\n\t// would otherwise be swallowed by the equality short-circuit in\n\t// `setFontAppearance`. Treat that activation as the user's\n\t// \"accept this inherited value\" affordance and commit the\n\t// inherited values to local explicitly.\n\tconst setFontAppearanceWithInheritedCommit = useCallback(\n\t\t( next ) => {\n\t\t\tif (\n\t\t\t\tisFontAppearancePlaceholder &&\n\t\t\t\tnext.fontStyle === fontStyle &&\n\t\t\t\tnext.fontWeight === fontWeight\n\t\t\t) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( fontStyle )\n\t\t\t\t\t\t\t? fontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( fontWeight )\n\t\t\t\t\t\t\t? fontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetFontAppearance( next );\n\t\t},\n\t\t[\n\t\t\tisFontAppearancePlaceholder,\n\t\t\tfontStyle,\n\t\t\tfontWeight,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tsetFontAppearance,\n\t\t]\n\t);\n\tconst hasFontAppearance = () =>\n\t\thasValue( value?.typography?.fontStyle ) ||\n\t\thasValue( value?.typography?.fontWeight );\n\tconst resetFontAppearance = useCallback( () => {\n\t\tsetFontAppearance( {} );\n\t}, [ setFontAppearance ] );\n\n\t// Line Height\n\tconst hasLineHeightEnabled = useHasLineHeightControl( settings );\n\tconst localLineHeight = decodeValue( value?.typography?.lineHeight );\n\tconst inheritedLineHeight = decodeValue(\n\t\tinheritedValue?.typography?.lineHeight\n\t);\n\tconst isLineHeightPlaceholder =\n\t\t! hasValue( value?.typography?.lineHeight ) &&\n\t\thasValue( inheritedLineHeight );\n\tconst setLineHeight = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'lineHeight' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLineHeight = () => hasValue( value?.typography?.lineHeight );\n\tconst resetLineHeight = () => setLineHeight( undefined );\n\n\t// Letter Spacing\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( settings );\n\tconst localLetterSpacing = decodeValue( value?.typography?.letterSpacing );\n\tconst inheritedLetterSpacing = decodeValue(\n\t\tinheritedValue?.typography?.letterSpacing\n\t);\n\tconst isLetterSpacingPlaceholder =\n\t\t! hasValue( value?.typography?.letterSpacing ) &&\n\t\thasValue( inheritedLetterSpacing );\n\tconst setLetterSpacing = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'letterSpacing' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLetterSpacing = () => hasValue( value?.typography?.letterSpacing );\n\tconst resetLetterSpacing = () => setLetterSpacing( undefined );\n\n\t// Text Indent\n\tconst hasTextIndentControl = useHasTextIndentControl( settings );\n\tconst localTextIndent = decodeValue( value?.typography?.textIndent );\n\tconst inheritedTextIndent = decodeValue(\n\t\tinheritedValue?.typography?.textIndent\n\t);\n\tconst isTextIndentPlaceholder =\n\t\t! hasValue( value?.typography?.textIndent ) &&\n\t\thasValue( inheritedTextIndent );\n\n\t// Get the setting value - can be 'subsequent' (default), 'all', or false.\n\t// The setting determines which CSS selector is used for the text-indent style.\n\tconst textIndentSetting = settings?.typography?.textIndent ?? 'subsequent';\n\tconst isTextIndentAll = textIndentSetting === 'all';\n\n\tconst setTextIndentValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textIndent' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onToggleTextIndentAll = ( newValue ) => {\n\t\t// Toggle between 'all' and 'subsequent' for the setting.\n\t\t// Include the settings change so it can be handled atomically by the parent.\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tsettings: {\n\t\t\t\ttypography: {\n\t\t\t\t\ttextIndent: newValue ? 'all' : 'subsequent',\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst hasTextIndent = () => hasValue( value?.typography?.textIndent );\n\tconst resetTextIndent = () => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'typography', 'textIndent' ], undefined )\n\t\t);\n\t};\n\tconst textIndentHelp = isTextIndentAll\n\t\t? __( 'Indents the first line of all paragraphs.' )\n\t\t: __( 'Indents the first line of each paragraph after the first one.' );\n\n\t// Text Columns\n\tconst hasTextColumnsControl = useHasTextColumnsControl( settings );\n\tconst localTextColumns = decodeValue( value?.typography?.textColumns );\n\tconst inheritedTextColumns = decodeValue(\n\t\tinheritedValue?.typography?.textColumns\n\t);\n\tconst isTextColumnsPlaceholder =\n\t\t! hasValue( value?.typography?.textColumns ) &&\n\t\thasValue( inheritedTextColumns );\n\tconst setTextColumns = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textColumns' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextColumns = () => hasValue( value?.typography?.textColumns );\n\tconst resetTextColumns = () => setTextColumns( undefined );\n\n\t// Text Transform\n\tconst hasTextTransformControl = useHasTextTransformControl( settings );\n\tconst inheritedTextTransform = decodeValue(\n\t\tinheritedValue?.typography?.textTransform\n\t);\n\tconst textTransform =\n\t\tdecodeValue( value?.typography?.textTransform ) ??\n\t\tinheritedTextTransform;\n\tconst isTextTransformPlaceholder =\n\t\t! hasValue( value?.typography?.textTransform ) &&\n\t\thasValue( inheritedTextTransform );\n\tconst setTextTransform = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textTransform' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: when at-rest, the inner\n\t// `ToggleGroupControl` fires `onChange( undefined )` if the user\n\t// activates the already-preselected (inherited) option. We treat\n\t// that activation as the user's \"accept this inherited value\"\n\t// affordance and commit the inherited value to local. When\n\t// committed (no longer at-rest), the same `undefined` payload\n\t// represents a normal `isDeselectable` deselect, so we let it pass\n\t// through unchanged.\n\tconst setTextTransformWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextTransformPlaceholder && newValue === undefined ) {\n\t\t\tsetTextTransform( inheritedTextTransform );\n\t\t\treturn;\n\t\t}\n\t\tsetTextTransform( newValue );\n\t};\n\tconst hasTextTransform = () => hasValue( value?.typography?.textTransform );\n\tconst resetTextTransform = () => setTextTransform( undefined );\n\n\t// Text Decoration\n\tconst hasTextDecorationControl = useHasTextDecorationControl( settings );\n\tconst inheritedTextDecoration = decodeValue(\n\t\tinheritedValue?.typography?.textDecoration\n\t);\n\tconst textDecoration =\n\t\tdecodeValue( value?.typography?.textDecoration ) ??\n\t\tinheritedTextDecoration;\n\tconst isTextDecorationPlaceholder =\n\t\t! hasValue( value?.typography?.textDecoration ) &&\n\t\thasValue( inheritedTextDecoration );\n\tconst setTextDecoration = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textDecoration' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextDecorationWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextDecorationPlaceholder && newValue === undefined ) {\n\t\t\tsetTextDecoration( inheritedTextDecoration );\n\t\t\treturn;\n\t\t}\n\t\tsetTextDecoration( newValue );\n\t};\n\tconst hasTextDecoration = () =>\n\t\thasValue( value?.typography?.textDecoration );\n\tconst resetTextDecoration = () => setTextDecoration( undefined );\n\n\t// Text Orientation\n\tconst hasWritingModeControl = useHasWritingModeControl( settings );\n\tconst inheritedWritingMode = decodeValue(\n\t\tinheritedValue?.typography?.writingMode\n\t);\n\tconst writingMode =\n\t\tdecodeValue( value?.typography?.writingMode ) ?? inheritedWritingMode;\n\tconst isWritingModePlaceholder =\n\t\t! hasValue( value?.typography?.writingMode ) &&\n\t\thasValue( inheritedWritingMode );\n\tconst setWritingMode = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'writingMode' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setWritingModeWithInheritedCommit = ( newValue ) => {\n\t\tif ( isWritingModePlaceholder && newValue === undefined ) {\n\t\t\tsetWritingMode( inheritedWritingMode );\n\t\t\treturn;\n\t\t}\n\t\tsetWritingMode( newValue );\n\t};\n\tconst hasWritingMode = () => hasValue( value?.typography?.writingMode );\n\tconst resetWritingMode = () => setWritingMode( undefined );\n\n\t// Text Alignment\n\tconst hasTextAlignmentControl = useHasTextAlignmentControl( settings );\n\n\tconst inheritedTextAlign = decodeValue(\n\t\tinheritedValue?.typography?.textAlign\n\t);\n\tconst textAlign =\n\t\tdecodeValue( value?.typography?.textAlign ) ?? inheritedTextAlign;\n\tconst isTextAlignPlaceholder =\n\t\t! hasValue( value?.typography?.textAlign ) &&\n\t\thasValue( inheritedTextAlign );\n\tconst setTextAlign = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textAlign' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextAlignWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextAlignPlaceholder && newValue === undefined ) {\n\t\t\tsetTextAlign( inheritedTextAlign );\n\t\t\treturn;\n\t\t}\n\t\tsetTextAlign( newValue );\n\t};\n\tconst hasTextAlign = () => hasValue( value?.typography?.textAlign );\n\tconst resetTextAlign = () => setTextAlign( undefined );\n\n\t// Text Shadow\n\tconst hasTextShadowControl = useHasTextShadowControl( settings );\n\tconst inheritedTextShadow = inheritedValue?.typography?.textShadow;\n\tconst textShadow = value?.typography?.textShadow ?? inheritedTextShadow;\n\tconst isTextShadowPlaceholder =\n\t\t! hasValue( value?.typography?.textShadow ) &&\n\t\thasValue( inheritedTextShadow );\n\tconst setTextShadow = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textShadow' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextShadow = () => hasValue( value?.typography?.textShadow );\n\tconst resetTextShadow = () => setTextShadow( undefined );\n\n\tconst resetAllFilter = useCallback(\n\t\t( previousValue ) => {\n\t\t\tif ( ! hasTextColorEnabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t...previousValue,\n\t\t\t\t\ttypography: {},\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...previousValue,\n\t\t\t\ttypography: {},\n\t\t\t\tcolor: {\n\t\t\t\t\t...previousValue?.color,\n\t\t\t\t\ttext: undefined,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\t[ hasTextColorEnabled ]\n\t);\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ hasTextColorEnabled && (\n\t\t\t\t<ColorGradientDropdownItem\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\thasValue={ hasTextColorValue }\n\t\t\t\t\tresetValue={ resetTextColor }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColor }\n\t\t\t\t\tindicators={ [ userTextColor ?? textColor ] }\n\t\t\t\t\tcontrastWarning={ contrastWarning }\n\t\t\t\t\tshowInheritanceLabelIndicators={\n\t\t\t\t\t\tshowInheritanceLabelIndicators\n\t\t\t\t\t}\n\t\t\t\t\tisPlaceholder={\n\t\t\t\t\t\tuserTextColor === undefined && textColor !== undefined\n\t\t\t\t\t}\n\t\t\t\t\thasInheritedValue={ textColor !== undefined }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\t\t\tinheritedSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tinheritedValue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tuserSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tvalue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t\t\t\tisPlaceholder:\n\t\t\t\t\t\t\t\tuserTextColor === undefined &&\n\t\t\t\t\t\t\t\ttextColor !== undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFontFamilyEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontFamilyPlaceholder,\n\t\t\t\t\t\thasFontFamily() && inheritedFontFamily !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Font' ) }\n\t\t\t\t\thasValue={ hasFontFamily }\n\t\t\t\t\tonDeselect={ resetFontFamily }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontFamily }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontFamilyControl\n\t\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\t\tvalue={ fontFamily }\n\t\t\t\t\t\tonChange={ setFontFamily }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasFontSizeEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontSizePlaceholder,\n\t\t\t\t\t\thasFontSize() && rawInheritedFontSize !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\thasValue={ hasFontSize }\n\t\t\t\t\thasInlineEndToggle\n\t\t\t\t\tonDeselect={ resetFontSize }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontSize }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontSizePicker\n\t\t\t\t\t\tvalue={ currentFontSizeSlug || fontSize }\n\t\t\t\t\t\tvalueMode={ currentFontSizeSlug ? 'slug' : 'literal' }\n\t\t\t\t\t\tonChange={ setFontSizeWithInheritedCommit }\n\t\t\t\t\t\tfontSizes={ mergedFontSizes }\n\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\twithReset={ false }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontAppearancePlaceholder,\n\t\t\t\t\t\thasFontAppearance() &&\n\t\t\t\t\t\t\t( inheritedFontStyle !== undefined ||\n\t\t\t\t\t\t\t\tinheritedFontWeight !== undefined )\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ appearanceControlLabel }\n\t\t\t\t\thasValue={ hasFontAppearance }\n\t\t\t\t\tonDeselect={ resetFontAppearance }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontAppearance }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontAppearanceControl\n\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ setFontAppearanceWithInheritedCommit }\n\t\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t\t\tfontFamilyFaces={ fontFamilyFaces }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLineHeightPlaceholder,\n\t\t\t\t\t\thasLineHeight() && inheritedLineHeight !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\t\thasValue={ hasLineHeight }\n\t\t\t\t\tonDeselect={ resetLineHeight }\n\t\t\t\t\tisShownByDefault={ defaultControls.lineHeight }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LineHeightControl\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tvalue={ localLineHeight ?? inheritedLineHeight }\n\t\t\t\t\t\tonChange={ setLineHeight }\n\t\t\t\t\t\t// Only override the placeholder when there is an\n\t\t\t\t\t\t// inherited value to surface. Passing `undefined` would\n\t\t\t\t\t\t// clobber `LineHeightControl`'s own `BASE_DEFAULT_VALUE`\n\t\t\t\t\t\t// (1.5) placeholder.\n\t\t\t\t\t\t{ ...( isLineHeightPlaceholder\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tplaceholder:\n\t\t\t\t\t\t\t\t\t\tgetNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\t\tinheritedLineHeight\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {} ) }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLetterSpacingPlaceholder,\n\t\t\t\t\t\thasLetterSpacing() &&\n\t\t\t\t\t\t\tinheritedLetterSpacing !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter spacing' ) }\n\t\t\t\t\thasValue={ hasLetterSpacing }\n\t\t\t\t\tonDeselect={ resetLetterSpacing }\n\t\t\t\t\tisShownByDefault={ defaultControls.letterSpacing }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LetterSpacingControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the unit parses from\n\t\t\t\t\t\t// it (e.g. \"0.02em\" keeps the em unit rather than the\n\t\t\t\t\t\t// value string sitting behind a default px unit). It is\n\t\t\t\t\t\t// only written to local on user change. Matches the\n\t\t\t\t\t\t// ToggleGroup/FontSize controls rather than the\n\t\t\t\t\t\t// native-placeholder pattern.\n\t\t\t\t\t\tvalue={ localLetterSpacing ?? inheritedLetterSpacing }\n\t\t\t\t\t\tonChange={ setLetterSpacing }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisLetterSpacingPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedLetterSpacing\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextIndentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextIndentPlaceholder,\n\t\t\t\t\t\thasTextIndent() && inheritedTextIndent !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line indent' ) }\n\t\t\t\t\thasValue={ hasTextIndent }\n\t\t\t\t\tonDeselect={ resetTextIndent }\n\t\t\t\t\tisShownByDefault={ defaultControls.textIndent }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextIndentControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the UnitControl parses\n\t\t\t\t\t\t// and shows the inherited unit (e.g. `1.5em` selects the\n\t\t\t\t\t\t// `em` unit) instead of a raw string in the placeholder\n\t\t\t\t\t\t// while the unit stays at the default `px`. Written to\n\t\t\t\t\t\t// local only on user change.\n\t\t\t\t\t\tvalue={ localTextIndent ?? inheritedTextIndent }\n\t\t\t\t\t\tonChange={ setTextIndentValue }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\thasBottomMargin={ isGlobalStyles }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextIndentPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder( inheritedTextIndent )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ isGlobalStyles && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Indent all paragraphs' ) }\n\t\t\t\t\t\t\tchecked={ isTextIndentAll }\n\t\t\t\t\t\t\tonChange={ onToggleTextIndentAll }\n\t\t\t\t\t\t\thelp={ textIndentHelp }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextColumnsControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextColumnsPlaceholder,\n\t\t\t\t\t\thasTextColumns() && inheritedTextColumns !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\thasValue={ hasTextColumns }\n\t\t\t\t\tonDeselect={ resetTextColumns }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColumns }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tmax={ MAX_TEXT_COLUMNS }\n\t\t\t\t\t\tmin={ MIN_TEXT_COLUMNS }\n\t\t\t\t\t\tonChange={ setTextColumns }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextColumnsPlaceholder\n\t\t\t\t\t\t\t\t? inheritedTextColumns\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tvalue={ localTextColumns }\n\t\t\t\t\t\tinitialPosition={ 1 }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextDecorationControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextDecorationPlaceholder,\n\t\t\t\t\t\thasTextDecoration() &&\n\t\t\t\t\t\t\tinheritedTextDecoration !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Decoration' ) }\n\t\t\t\t\thasValue={ hasTextDecoration }\n\t\t\t\t\tonDeselect={ resetTextDecoration }\n\t\t\t\t\tisShownByDefault={ defaultControls.textDecoration }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextDecorationControl\n\t\t\t\t\t\tvalue={ textDecoration }\n\t\t\t\t\t\tonChange={ setTextDecorationWithInheritedCommit }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasWritingModeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWritingModePlaceholder,\n\t\t\t\t\t\thasWritingMode() && inheritedWritingMode !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\t\t\thasValue={ hasWritingMode }\n\t\t\t\t\tonDeselect={ resetWritingMode }\n\t\t\t\t\tisShownByDefault={ defaultControls.writingMode }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<WritingModeControl\n\t\t\t\t\t\tvalue={ writingMode }\n\t\t\t\t\t\tonChange={ setWritingModeWithInheritedCommit }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextTransformControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextTransformPlaceholder,\n\t\t\t\t\t\thasTextTransform() &&\n\t\t\t\t\t\t\tinheritedTextTransform !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter case' ) }\n\t\t\t\t\thasValue={ hasTextTransform }\n\t\t\t\t\tonDeselect={ resetTextTransform }\n\t\t\t\t\tisShownByDefault={ defaultControls.textTransform }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextTransformControl\n\t\t\t\t\t\tvalue={ textTransform }\n\t\t\t\t\t\tonChange={ setTextTransformWithInheritedCommit }\n\t\t\t\t\t\tshowNone\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextShadowControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextShadowPlaceholder,\n\t\t\t\t\t\thasTextShadow() && inheritedTextShadow !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Text shadow' ) }\n\t\t\t\t\thasValue={ hasTextShadow }\n\t\t\t\t\tonDeselect={ resetTextShadow }\n\t\t\t\t\tisShownByDefault={ defaultControls.textShadow }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextShadowPopover\n\t\t\t\t\t\ttextShadow={ textShadow }\n\t\t\t\t\t\tonChange={ setTextShadow }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextAlignmentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextAlignPlaceholder,\n\t\t\t\t\t\thasTextAlign() && inheritedTextAlign !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Text alignment' ) }\n\t\t\t\t\thasValue={ hasTextAlign }\n\t\t\t\t\tonDeselect={ resetTextAlign }\n\t\t\t\t\tisShownByDefault={ defaultControls.textAlign }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextAlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ setTextAlignWithInheritedCommit }\n\t\t\t\t\t\toptions={ [ 'left', 'center', 'right', 'justify' ] }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ textAlign === 'justify' && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Justified text can reduce readability. For better accessibility, use left-aligned text instead.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EACC;AAAA,EACA,+BAA+B;AAAA,EAC/B,4BAA4B;AAAA,EAC5B,kDAAkD;AAAA,EA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AAA,gBAAC;AAAA;AAAA,kBACA,OAAQ;AAAA,kBACR,UAAW;AAAA,kBACX,SAAU,CAAE,QAAQ,UAAU,SAAS,SAAU;AAAA;AAAA,cAClD;AAAA,cAEE,cAAc,aACf,oBAAC,SACA,8BAAC,UAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,gBACD;AAAA,cACD,GACD,GACD;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/typography-utils.js"],
|
|
4
|
-
"sourcesContent": ["import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\n\n/**\n * Returns an object of merged font families and the font faces from the selected font family\n * based on the theme.json settings object and the currently selected font family.\n *\n * @param {Object} settings Theme.json settings.\n * @param {string} selectedFontFamily Decoded font family string.\n * @return {Object} Merged font families and font faces from the selected font family.\n */\nexport function getMergedFontFamiliesAndFontFamilyFaces(\n\tsettings,\n\tselectedFontFamily\n) {\n\tconst fontFamiliesFromSettings = settings?.typography?.fontFamilies;\n\n\tconst fontFamilies = [ 'default', 'theme', 'custom' ].flatMap(\n\t\t( key ) => fontFamiliesFromSettings?.[ key ] ?? []\n\t);\n\n\tconst fontFamilyFaces =\n\t\tfontFamilies.find(\n\t\t\t( family ) => family.fontFamily === selectedFontFamily\n\t\t)?.fontFace ?? [];\n\n\treturn { fontFamilies, fontFamilyFaces };\n}\n\n/**\n * Returns the nearest font weight value from the available font weight list based on the new font weight.\n * The nearest font weight is the one with the smallest difference from the new font weight.\n *\n * @param {Array} availableFontWeights Array of available font weights.\n * @param {string} newFontWeightValue New font weight value.\n * @return {string} Nearest font weight.\n */\nexport function findNearestFontWeight(\n\tavailableFontWeights,\n\tnewFontWeightValue\n) {\n\tnewFontWeightValue =\n\t\t'number' === typeof newFontWeightValue\n\t\t\t? newFontWeightValue.toString()\n\t\t\t: newFontWeightValue;\n\tif ( ! newFontWeightValue || typeof newFontWeightValue !== 'string' ) {\n\t\treturn '';\n\t}\n\n\tif ( ! availableFontWeights || availableFontWeights.length === 0 ) {\n\t\treturn newFontWeightValue;\n\t}\n\n\tconst nearestFontWeight = availableFontWeights?.reduce(\n\t\t( nearest, { value: fw } ) => {\n\t\t\tconst currentDiff = Math.abs(\n\t\t\t\tparseInt( fw ) - parseInt( newFontWeightValue )\n\t\t\t);\n\t\t\tconst nearestDiff = Math.abs(\n\t\t\t\tparseInt( nearest ) - parseInt( newFontWeightValue )\n\t\t\t);\n\t\t\treturn currentDiff < nearestDiff ? fw : nearest;\n\t\t},\n\t\tavailableFontWeights[ 0 ]?.value\n\t);\n\n\treturn nearestFontWeight;\n}\n\n/**\n * Returns the nearest font style based on the new font style.\n * Defaults to an empty string if the new font style is not valid or available.\n *\n * @param {Array} availableFontStyles Array of available font weights.\n * @param {string} newFontStyleValue New font style value.\n * @return {string} Nearest font style or an empty string.\n */\nexport function findNearestFontStyle( availableFontStyles, newFontStyleValue ) {\n\tif ( typeof newFontStyleValue !== 'string' || ! newFontStyleValue ) {\n\t\treturn '';\n\t}\n\n\tconst validStyles = [ 'normal', 'italic', 'oblique' ];\n\tif ( ! validStyles.includes( newFontStyleValue ) ) {\n\t\treturn '';\n\t}\n\n\tif (\n\t\t! availableFontStyles ||\n\t\tavailableFontStyles.length === 0 ||\n\t\tavailableFontStyles.find(\n\t\t\t( style ) => style.value === newFontStyleValue\n\t\t)\n\t) {\n\t\treturn newFontStyleValue;\n\t}\n\n\tif (\n\t\tnewFontStyleValue === 'oblique' &&\n\t\t! availableFontStyles.find( ( style ) => style.value === 'oblique' )\n\t) {\n\t\treturn 'italic';\n\t}\n\n\treturn '';\n}\n\n/**\n * Returns the nearest font style and weight based on the available font family faces and the new font style and weight.\n *\n * @param {Array} fontFamilyFaces Array of available font family faces.\n * @param {string} fontStyle New font style. Defaults to previous value.\n * @param {string} fontWeight New font weight. Defaults to previous value.\n * @return {Object} Nearest font style and font weight.\n */\nexport function findNearestStyleAndWeight(\n\tfontFamilyFaces,\n\tfontStyle,\n\tfontWeight\n) {\n\tlet nearestFontStyle = fontStyle;\n\tlet nearestFontWeight = fontWeight;\n\n\tconst { fontStyles, fontWeights, combinedStyleAndWeightOptions } =\n\t\tgetFontStylesAndWeights( fontFamilyFaces );\n\n\t// Check if the new font style and weight are available in the font family faces.\n\tconst hasFontStyle = fontStyles?.some(\n\t\t( { value: fs } ) => fs === fontStyle\n\t);\n\tconst hasFontWeight = fontWeights?.some(\n\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t);\n\n\tif ( ! hasFontStyle ) {\n\t\t/*\n\t\t * Default to italic if oblique is not available.\n\t\t * Or find the nearest font style based on the nearest font weight.\n\t\t */\n\t\tnearestFontStyle = fontStyle\n\t\t\t? findNearestFontStyle( fontStyles, fontStyle )\n\t\t\t: combinedStyleAndWeightOptions?.find(\n\t\t\t\t\t( option ) =>\n\t\t\t\t\t\toption.style.fontWeight ===\n\t\t\t\t\t\tfindNearestFontWeight( fontWeights, fontWeight )\n\t\t\t
|
|
5
|
-
"mappings": ";AAAA,SAAS,+BAA+B;AAUjC,SAAS,wCACf,UACA,oBACC;AACD,QAAM,2BAA2B,UAAU,YAAY;AAEvD,QAAM,eAAe,CAAE,WAAW,SAAS,QAAS,EAAE;AAAA,IACrD,CAAE,QAAS,2BAA4B,GAAI,KAAK,CAAC;AAAA,EAClD;AAEA,QAAM,kBACL,aAAa;AAAA,IACZ,CAAE,WAAY,OAAO,eAAe;AAAA,EACrC,GAAG,YAAY,CAAC;AAEjB,SAAO,EAAE,cAAc,gBAAgB;AACxC;AAUO,SAAS,sBACf,sBACA,oBACC;AACD,uBACC,aAAa,OAAO,qBACjB,mBAAmB,SAAS,IAC5B;AACJ,MAAK,CAAE,sBAAsB,OAAO,uBAAuB,UAAW;AACrE,WAAO;AAAA,EACR;AAEA,MAAK,CAAE,wBAAw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B,qBAAsB,YAAY,SAAU,IAC5C,+BAA+B;AAAA,MAC/B,CAAE,WACD,OAAO,MAAM,eACb,sBAAuB,aAAa,UAAW;AAAA,
|
|
4
|
+
"sourcesContent": ["import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\n\n/**\n * Returns an object of merged font families and the font faces from the selected font family\n * based on the theme.json settings object and the currently selected font family.\n *\n * @param {Object} settings Theme.json settings.\n * @param {string} selectedFontFamily Decoded font family string.\n * @return {Object} Merged font families and font faces from the selected font family.\n */\nexport function getMergedFontFamiliesAndFontFamilyFaces(\n\tsettings,\n\tselectedFontFamily\n) {\n\tconst fontFamiliesFromSettings = settings?.typography?.fontFamilies;\n\n\tconst fontFamilies = [ 'default', 'theme', 'custom' ].flatMap(\n\t\t( key ) => fontFamiliesFromSettings?.[ key ] ?? []\n\t);\n\n\tconst fontFamilyFaces =\n\t\tfontFamilies.find(\n\t\t\t( family ) => family.fontFamily === selectedFontFamily\n\t\t)?.fontFace ?? [];\n\n\treturn { fontFamilies, fontFamilyFaces };\n}\n\n/**\n * Returns the nearest font weight value from the available font weight list based on the new font weight.\n * The nearest font weight is the one with the smallest difference from the new font weight.\n *\n * @param {Array} availableFontWeights Array of available font weights.\n * @param {string} newFontWeightValue New font weight value.\n * @return {string} Nearest font weight.\n */\nexport function findNearestFontWeight(\n\tavailableFontWeights,\n\tnewFontWeightValue\n) {\n\tnewFontWeightValue =\n\t\t'number' === typeof newFontWeightValue\n\t\t\t? newFontWeightValue.toString()\n\t\t\t: newFontWeightValue;\n\tif ( ! newFontWeightValue || typeof newFontWeightValue !== 'string' ) {\n\t\treturn '';\n\t}\n\n\tif ( ! availableFontWeights || availableFontWeights.length === 0 ) {\n\t\treturn newFontWeightValue;\n\t}\n\n\tconst nearestFontWeight = availableFontWeights?.reduce(\n\t\t( nearest, { value: fw } ) => {\n\t\t\tconst currentDiff = Math.abs(\n\t\t\t\tparseInt( fw ) - parseInt( newFontWeightValue )\n\t\t\t);\n\t\t\tconst nearestDiff = Math.abs(\n\t\t\t\tparseInt( nearest ) - parseInt( newFontWeightValue )\n\t\t\t);\n\t\t\treturn currentDiff < nearestDiff ? fw : nearest;\n\t\t},\n\t\tavailableFontWeights[ 0 ]?.value\n\t);\n\n\treturn nearestFontWeight;\n}\n\n/**\n * Returns the nearest font style based on the new font style.\n * Defaults to an empty string if the new font style is not valid or available.\n *\n * @param {Array} availableFontStyles Array of available font weights.\n * @param {string} newFontStyleValue New font style value.\n * @return {string} Nearest font style or an empty string.\n */\nexport function findNearestFontStyle( availableFontStyles, newFontStyleValue ) {\n\tif ( typeof newFontStyleValue !== 'string' || ! newFontStyleValue ) {\n\t\treturn '';\n\t}\n\n\tconst validStyles = [ 'normal', 'italic', 'oblique' ];\n\tif ( ! validStyles.includes( newFontStyleValue ) ) {\n\t\treturn '';\n\t}\n\n\tif (\n\t\t! availableFontStyles ||\n\t\tavailableFontStyles.length === 0 ||\n\t\tavailableFontStyles.find(\n\t\t\t( style ) => style.value === newFontStyleValue\n\t\t)\n\t) {\n\t\treturn newFontStyleValue;\n\t}\n\n\tif (\n\t\tnewFontStyleValue === 'oblique' &&\n\t\t! availableFontStyles.find( ( style ) => style.value === 'oblique' )\n\t) {\n\t\treturn 'italic';\n\t}\n\n\treturn '';\n}\n\n/**\n * Returns the nearest font style and weight based on the available font family faces and the new font style and weight.\n *\n * @param {Array} fontFamilyFaces Array of available font family faces.\n * @param {string} fontStyle New font style. Defaults to previous value.\n * @param {string} fontWeight New font weight. Defaults to previous value.\n * @return {Object} Nearest font style and font weight.\n */\nexport function findNearestStyleAndWeight(\n\tfontFamilyFaces,\n\tfontStyle,\n\tfontWeight\n) {\n\tlet nearestFontStyle = fontStyle;\n\tlet nearestFontWeight = fontWeight;\n\n\tconst { fontStyles, fontWeights, combinedStyleAndWeightOptions } =\n\t\tgetFontStylesAndWeights( fontFamilyFaces );\n\n\t// Check if the new font style and weight are available in the font family faces.\n\tconst hasFontStyle = fontStyles?.some(\n\t\t( { value: fs } ) => fs === fontStyle\n\t);\n\tconst hasFontWeight = fontWeights?.some(\n\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t);\n\n\tif ( ! hasFontStyle ) {\n\t\t/*\n\t\t * Default to italic if oblique is not available.\n\t\t * Or find the nearest font style based on the nearest font weight.\n\t\t */\n\t\tnearestFontStyle = fontStyle\n\t\t\t? findNearestFontStyle( fontStyles, fontStyle )\n\t\t\t: combinedStyleAndWeightOptions?.find(\n\t\t\t\t\t( option ) =>\n\t\t\t\t\t\toption.style.fontWeight ===\n\t\t\t\t\t\tfindNearestFontWeight( fontWeights, fontWeight )\n\t\t\t\t)?.style?.fontStyle;\n\t}\n\n\tif ( ! hasFontWeight ) {\n\t\t/*\n\t\t * Find the nearest font weight based on available weights.\n\t\t * Or find the nearest font weight based on the nearest font style.\n\t\t */\n\t\tnearestFontWeight = fontWeight\n\t\t\t? findNearestFontWeight( fontWeights, fontWeight )\n\t\t\t: combinedStyleAndWeightOptions?.find(\n\t\t\t\t\t( option ) =>\n\t\t\t\t\t\toption.style.fontStyle ===\n\t\t\t\t\t\t( nearestFontStyle || fontStyle )\n\t\t\t\t)?.style?.fontWeight;\n\t}\n\n\treturn { nearestFontStyle, nearestFontWeight };\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,+BAA+B;AAUjC,SAAS,wCACf,UACA,oBACC;AACD,QAAM,2BAA2B,UAAU,YAAY;AAEvD,QAAM,eAAe,CAAE,WAAW,SAAS,QAAS,EAAE;AAAA,IACrD,CAAE,QAAS,2BAA4B,GAAI,KAAK,CAAC;AAAA,EAClD;AAEA,QAAM,kBACL,aAAa;AAAA,IACZ,CAAE,WAAY,OAAO,eAAe;AAAA,EACrC,GAAG,YAAY,CAAC;AAEjB,SAAO,EAAE,cAAc,gBAAgB;AACxC;AAUO,SAAS,sBACf,sBACA,oBACC;AACD,uBACC,aAAa,OAAO,qBACjB,mBAAmB,SAAS,IAC5B;AACJ,MAAK,CAAE,sBAAsB,OAAO,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AAS;AAAA,EAC9D;AAEA,MAAK,CAAE,cAAe;AAKrB,uBAAmB,YAChB,qBAAsB,YAAY,SAAU,IAC5C,+BAA+B;AAAA,MAC/B,CAAE,WACD,OAAO,MAAM,eACb,sBAAuB,aAAa,UAAW;AAAA,IACjD,GAAG,OAAO;AAAA,EACb;AAEA,MAAK,CAAE,eAAgB;AAKtB,wBAAoB,aACjB,sBAAuB,aAAa,UAAW,IAC/C,+BAA+B;AAAA,MAC/B,CAAE,WACD,OAAO,MAAM,eACX,oBAAoB;AAAA,IACxB,GAAG,OAAO;AAAA,EACb;AAEA,SAAO,EAAE,kBAAkB,kBAAkB;AAC9C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/global-styles/utils.js"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t
|
|
5
|
-
"mappings": ";AAAA,SAAS,wBAAwB;AAE1B,SAAS,iCAAiC;AAChD,QAAM,WAAW,iBAAkB,UAAU,GAAI;AACjD,SAAO,CAAE,WACN;AAAA,IACA,cAAc;AAAA,MACb,WAAW;AAAA;AAAA,MAEX,QAAQ;AAAA,IACT;AAAA,
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t\t}\n\t\t: {};\n}\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param {string} scope Selector to scope to.\n * @param {string} selector Original selector.\n *\n * @return {string} Scoped selector.\n */\nexport function scopeSelector( scope, selector ) {\n\tif ( ! scope || ! selector ) {\n\t\treturn selector;\n\t}\n\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Reads the preset slug out of a duotone style value.\n *\n * Two presets can hold the same pair of colors, so the slug is the only thing\n * that identifies which one is applied. The colors alone do not.\n *\n * Lives here rather than beside its siblings in `hooks/duotone` because that\n * module imports the filters panel, so the panel cannot import back from it.\n *\n * @param {string|string[]|undefined} duotone A duotone style value.\n *\n * @return {string|undefined} The preset slug, if the value references one.\n */\nexport function getDuotoneSlugFromPreset( duotone ) {\n\tif ( typeof duotone !== 'string' ) {\n\t\treturn undefined;\n\t}\n\n\tconst [ , slug ] = duotone.match( /^var:preset\\|duotone\\|(.+)$/ ) ?? [];\n\n\treturn slug;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,wBAAwB;AAE1B,SAAS,iCAAiC;AAChD,QAAM,WAAW,iBAAkB,UAAU,GAAI;AACjD,SAAO,CAAE,WACN;AAAA,IACA,cAAc;AAAA,MACb,WAAW;AAAA;AAAA,MAEX,QAAQ;AAAA,IACT;AAAA,EACD,IACC,CAAC;AACL;AAmBO,SAAS,cAAe,OAAO,UAAW;AAChD,MAAK,CAAE,SAAS,CAAE,UAAW;AAC5B,WAAO;AAAA,EACR;AAEA,QAAM,SAAS,MAAM,MAAO,GAAI;AAChC,QAAM,YAAY,SAAS,MAAO,GAAI;AAEtC,QAAM,kBAAkB,CAAC;AACzB,SAAO,QAAS,CAAE,UAAW;AAC5B,cAAU,QAAS,CAAE,UAAW;AAC/B,sBAAgB,KAAM,GAAI,MAAM,KAAK,CAAE,IAAK,MAAM,KAAK,CAAE,EAAG;AAAA,IAC7D,CAAE;AAAA,EACH,CAAE;AAEF,SAAO,gBAAgB,KAAM,IAAK;AACnC;AAeO,SAAS,yBAA0B,SAAU;AACnD,MAAK,OAAO,YAAY,UAAW;AAClC,WAAO;AAAA,EACR;AAEA,QAAM,CAAE,EAAE,IAAK,IAAI,QAAQ,MAAO,6BAA8B,KAAK,CAAC;AAEtE,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// packages/block-editor/src/components/html-element-control/index.jsx
|
|
2
2
|
import { __, sprintf } from "@wordpress/i18n";
|
|
3
3
|
import {
|
|
4
|
-
SelectControl,
|
|
4
|
+
SelectControl as WCSelectControl,
|
|
5
5
|
Notice,
|
|
6
6
|
__experimentalVStack as VStack
|
|
7
7
|
} from "@wordpress/components";
|
|
@@ -55,7 +55,7 @@ function HTMLElementControl({
|
|
|
55
55
|
});
|
|
56
56
|
return /* @__PURE__ */ jsxs(VStack, { spacing: 2, className: "block-editor-html-element-control", children: [
|
|
57
57
|
/* @__PURE__ */ jsx(
|
|
58
|
-
|
|
58
|
+
WCSelectControl,
|
|
59
59
|
{
|
|
60
60
|
label: __("HTML element"),
|
|
61
61
|
options: modifiedOptions,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/html-element-control/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<
|
|
5
|
-
"mappings": ";AAAA,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,
|
|
4
|
+
"sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl as WCSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<WCSelectControl\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ modifiedOptions }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\n\t\t\t{ tagName === 'main' && hasMainElementElsewhere && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.'\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC,iBAAiB;AAAA,EACjB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,SACC,qBAAC,UAAO,SAAU,GAAI,WAAU,qCAC/B;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,cAAe;AAAA,QAC3B,SAAU;AAAA,QACV,OAAQ;AAAA,QACR;AAAA,QACA,MAAO,oBAAqB,OAAQ;AAAA;AAAA,IACrC;AAAA,IAEE,YAAY,UAAU,2BACvB,oBAAC,UAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,MACD;AAAA,IACD,GACD;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/iframe/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { version as reactVersion } from 'react';\nimport { useState, createPortal, forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect, useDisabled } from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { useScaleCanvas } from './use-scale-canvas';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nconst iframeSrcCache = new WeakMap();\nconst iframeSrcCleanup = globalThis.FinalizationRegistry\n\t? new globalThis.FinalizationRegistry( ( url ) =>\n\t\t\tURL.revokeObjectURL( url )\n\t )\n\t: undefined;\n\nfunction getIframeSrc( resolvedAssets ) {\n\tlet src = iframeSrcCache.get( resolvedAssets );\n\tif ( src ) {\n\t\treturn src;\n\t}\n\n\tlet body = '';\n\tif ( reactVersion.split( '.' )[ 0 ] === '18' ) {\n\t\tbody =\n\t\t\t'<body><script>document.currentScript.parentElement.remove()</script></body>';\n\t}\n\n\t// Correct doctype is required to enable rendering in standards mode.\n\t// Also preload the styles to avoid a flash of unstyled content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.href }\">\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ resolvedAssets.styles ?? '' }\n\t\t${ resolvedAssets.scripts ?? '' }\n\t</head>\n\t${ body }\n</html>`;\n\n\tsrc = URL.createObjectURL( new Blob( [ html ], { type: 'text/html' } ) );\n\tiframeSrcCache.set( resolvedAssets, src );\n\tiframeSrcCleanup?.register( resolvedAssets, src );\n\treturn src;\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\t/** @type {[Document, React.Dispatch<Document>]} */\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// Prevent clicks on link fragments from navigating away. Note that links\n\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t// this is for links in blocks outside of `contenteditable`.\n\t\tfunction interceptLinkClicks( event ) {\n\t\t\tif (\n\t\t\t\tevent.target.tagName === 'A' &&\n\t\t\t\tevent.target.getAttribute( 'href' )?.startsWith( '#' )\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Manually handle link fragment navigation within the iframe. The iframe's\n\t\t\t\t// location is a blob URL, which can't be used to resolve relative links like\n\t\t\t\t// `#hash`. The relative link would be resolved against the iframe's base URL\n\t\t\t\t// or the parent frame's URL, causing the iframe to navigate to a completely\n\t\t\t\t// different page. Setting the `location.hash` works because it really sets the\n\t\t\t\t// blob URL's hash.\n\t\t\t\t//\n\t\t\t\t// Links with fragments are used for example with footnotes. Clicking on these\n\t\t\t\t// links will scroll smoothly to the anchors in the editor canvas.\n\t\t\t\tiFrameDocument.defaultView.location.hash = event.target\n\t\t\t\t\t.getAttribute( 'href' )\n\t\t\t\t\t.slice( 1 );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\n\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t// the server in the future (which will run the PHP filters).\n\t\tsetBodyClasses(\n\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t( name ) =>\n\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t)\n\t\t);\n\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\t\t\tsetIframeDocument( contentDocument );\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener( 'click', interceptLinkClicks );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tsetIframeDocument( undefined );\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener( 'click', interceptLinkClicks );\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\tcontentRef: scaleContentRef,\n\t\tcontainerRef,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t} = useScaleCanvas( {\n\t\tscale,\n\t\tframeSize: parseInt( frameSize ),\n\t\tiframeDocument,\n\t} );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\n\tconst unguardedBodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\tscaleContentRef,\n\t] );\n\n\t// Attach the body ref only when the iframe document and window are available.\n\t// When an iframe element is moved in the DOM, like when reordering a list,\n\t// its `window` object is destroyed and recreated, and the `defaultView` field is\n\t// briefly `null`. We need to guard for such calls of the ref callbacks.\n\tconst bodyRef = useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( node.ownerDocument.defaultView ) {\n\t\t\t\tunguardedBodyRef( node );\n\t\t\t\treturn () => unguardedBodyRef( null );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t},\n\t\t[ unguardedBodyRef ]\n\t);\n\n\tconst src = getIframeSrc( resolvedAssets );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ containerRef }>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialized.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,WAAW,oBAAoB;AACxC,SAAS,UAAU,cAAc,kBAAkB;AACnD,SAAS,UAAU;AACnB,SAAS,cAAc,cAAc,mBAAmB;AACxD,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,SAAS,wBAAwB;AAkSxC,mBAuDK,KAvDL;AAhSF,SAAS,YAAa,OAAO,aAAa,OAAQ;AACjD,QAAM,OAAO,CAAC;AAEd,aAAY,OAAO,OAAQ;AAC1B,SAAM,GAAI,IAAI,MAAO,GAAI;AAAA,EAC1B;AASA,MAAK,iBAAiB,MAAM,gBAAgB,YAAY,YAAa;AACpE,UAAM,OAAO,MAAM,sBAAsB;AACzC,SAAK,WAAW,KAAK;AACrB,SAAK,WAAW,KAAK;AAAA,EACtB;AAEA,QAAM,WAAW,IAAI,YAAa,MAAM,MAAM,IAAK;AACnD,MAAK,KAAK,kBAAmB;AAC5B,aAAS,eAAe;AAAA,EACzB;AACA,QAAM,YAAY,CAAE,MAAM,cAAe,QAAS;AAElD,MAAK,WAAY;AAChB,UAAM,eAAe;AAAA,EACtB;AACD;AAYA,SAAS,gBAAiB,gBAAiB;AAC1C,SAAO,aAAc,MAAM;AAC1B,UAAM,EAAE,YAAY,IAAI;AACxB,QAAK,CAAE,aAAc;AACpB;AAAA,IACD;AACA,UAAM,EAAE,aAAa,IAAI;AACzB,UAAM,OAAO,eAAe;AAC5B,UAAM,aAAa,CAAE,YAAY,WAAY;AAC7C,UAAM,WAAW,CAAC;AAClB,eAAY,QAAQ,YAAa;AAChC,eAAU,IAAK,IAAI,CAAE,UAAW;AAC/B,cAAM,YAAY,OAAO,eAAgB,KAAM;AAC/C,cAAM,kBAAkB,UAAU,YAAY;AAC9C,cAAM,cAAc,OAAQ,eAAgB;AAC5C,oBAAa,OAAO,aAAa,YAAa;AAAA,MAC/C;AACA,WAAK,iBAAkB,MAAM,SAAU,IAAK,CAAE;AAAA,IAC/C;AAEA,WAAO,MAAM;AACZ,iBAAY,QAAQ,YAAa;AAChC,aAAK,oBAAqB,MAAM,SAAU,IAAK,CAAE;AAAA,MAClD;AAAA,IACD;AAAA,EACD,CAAE;AACH;AAEA,IAAM,iBAAiB,oBAAI,QAAQ;AACnC,IAAM,mBAAmB,WAAW,uBACjC,IAAI,WAAW;AAAA,EAAsB,CAAE,QACvC,IAAI,gBAAiB,GAAI;
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { version as reactVersion } from 'react';\nimport { useState, createPortal, forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect, useDisabled } from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { useScaleCanvas } from './use-scale-canvas';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nconst iframeSrcCache = new WeakMap();\nconst iframeSrcCleanup = globalThis.FinalizationRegistry\n\t? new globalThis.FinalizationRegistry( ( url ) =>\n\t\t\tURL.revokeObjectURL( url )\n\t\t)\n\t: undefined;\n\nfunction getIframeSrc( resolvedAssets ) {\n\tlet src = iframeSrcCache.get( resolvedAssets );\n\tif ( src ) {\n\t\treturn src;\n\t}\n\n\tlet body = '';\n\tif ( reactVersion.split( '.' )[ 0 ] === '18' ) {\n\t\tbody =\n\t\t\t'<body><script>document.currentScript.parentElement.remove()</script></body>';\n\t}\n\n\t// Correct doctype is required to enable rendering in standards mode.\n\t// Also preload the styles to avoid a flash of unstyled content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.href }\">\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ resolvedAssets.styles ?? '' }\n\t\t${ resolvedAssets.scripts ?? '' }\n\t</head>\n\t${ body }\n</html>`;\n\n\tsrc = URL.createObjectURL( new Blob( [ html ], { type: 'text/html' } ) );\n\tiframeSrcCache.set( resolvedAssets, src );\n\tiframeSrcCleanup?.register( resolvedAssets, src );\n\treturn src;\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\t/** @type {[Document, React.Dispatch<Document>]} */\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// Prevent clicks on link fragments from navigating away. Note that links\n\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t// this is for links in blocks outside of `contenteditable`.\n\t\tfunction interceptLinkClicks( event ) {\n\t\t\tif (\n\t\t\t\tevent.target.tagName === 'A' &&\n\t\t\t\tevent.target.getAttribute( 'href' )?.startsWith( '#' )\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Manually handle link fragment navigation within the iframe. The iframe's\n\t\t\t\t// location is a blob URL, which can't be used to resolve relative links like\n\t\t\t\t// `#hash`. The relative link would be resolved against the iframe's base URL\n\t\t\t\t// or the parent frame's URL, causing the iframe to navigate to a completely\n\t\t\t\t// different page. Setting the `location.hash` works because it really sets the\n\t\t\t\t// blob URL's hash.\n\t\t\t\t//\n\t\t\t\t// Links with fragments are used for example with footnotes. Clicking on these\n\t\t\t\t// links will scroll smoothly to the anchors in the editor canvas.\n\t\t\t\tiFrameDocument.defaultView.location.hash = event.target\n\t\t\t\t\t.getAttribute( 'href' )\n\t\t\t\t\t.slice( 1 );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\n\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t// the server in the future (which will run the PHP filters).\n\t\tsetBodyClasses(\n\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t( name ) =>\n\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t)\n\t\t);\n\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\t\t\tsetIframeDocument( contentDocument );\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener( 'click', interceptLinkClicks );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tsetIframeDocument( undefined );\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener( 'click', interceptLinkClicks );\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\tcontentRef: scaleContentRef,\n\t\tcontainerRef,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t} = useScaleCanvas( {\n\t\tscale,\n\t\tframeSize: parseInt( frameSize ),\n\t\tiframeDocument,\n\t} );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\n\tconst unguardedBodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\tscaleContentRef,\n\t] );\n\n\t// Attach the body ref only when the iframe document and window are available.\n\t// When an iframe element is moved in the DOM, like when reordering a list,\n\t// its `window` object is destroyed and recreated, and the `defaultView` field is\n\t// briefly `null`. We need to guard for such calls of the ref callbacks.\n\tconst bodyRef = useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( node.ownerDocument.defaultView ) {\n\t\t\t\tunguardedBodyRef( node );\n\t\t\t\treturn () => unguardedBodyRef( null );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t},\n\t\t[ unguardedBodyRef ]\n\t);\n\n\tconst src = getIframeSrc( resolvedAssets );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ containerRef }>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialized.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,WAAW,oBAAoB;AACxC,SAAS,UAAU,cAAc,kBAAkB;AACnD,SAAS,UAAU;AACnB,SAAS,cAAc,cAAc,mBAAmB;AACxD,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,8BAA8B;AACvC,SAAS,s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