@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.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 +2 -0
- package/LICENSE.md +1 -1
- package/README.md +12 -10
- package/build/components/block-canvas/index.js +21 -7
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-controls/hook.js +3 -23
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +6 -1
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/index.js +76 -6
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +0 -6
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build/components/block-edit/context.js +5 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +18 -9
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +2 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +1 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block.js +257 -95
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +58 -23
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +3 -5
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/private-block-context.js +14 -0
- package/build/components/block-list/private-block-context.js.map +1 -0
- package/build/components/block-list/use-block-props/index.js +49 -69
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
- package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build/components/block-lock/toolbar.js +21 -27
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/index.js +2 -1
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -5
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -9
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js +3 -0
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings/container.native.js +6 -4
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-styles/index.js +1 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +3 -2
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -4
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +90 -29
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build/components/block-tools/block-toolbar-popover.js +84 -0
- package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build/components/block-tools/index.js +27 -24
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +4 -3
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +2 -1
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +29 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/colors/utils.js +10 -2
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +6 -2
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -4
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -2
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +4 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +2 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +6 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +192 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +7 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +7 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +43 -36
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +22 -8
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/height-control/index.js +6 -2
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/image-link-destinations/index.native.js +118 -0
- package/build/components/image-link-destinations/index.native.js.map +1 -0
- package/build/components/image-size-control/index.js +2 -2
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +14 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +61 -22
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +18 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +10 -14
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +1 -2
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/library.js +3 -7
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +2 -2
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -33
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +2 -2
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/tabs.js +21 -21
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter-button/index.native.js +98 -0
- package/build/components/inserter-button/index.native.js.map +1 -0
- package/build/components/inserter-button/sparkles.js +23 -0
- package/build/components/inserter-button/sparkles.js.map +1 -0
- package/build/components/inserter-draggable-blocks/index.js +8 -4
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +2 -4
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +3 -3
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +3 -3
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +34 -23
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +4 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +57 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/media-upload-progress/constants.js +19 -0
- package/build/components/media-upload-progress/constants.js.map +1 -0
- package/build/components/media-upload-progress/index.native.js +42 -17
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +11 -16
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +8 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +6 -62
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +7 -1
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/content.js +26 -23
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +2 -1
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/rich-text/index.js +19 -37
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +9 -16
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +22 -57
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +7 -3
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +1 -1
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/with-deprecations.js +50 -0
- package/build/components/rich-text/with-deprecations.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +9 -6
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +14 -18
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +108 -17
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +100 -92
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +9 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +4 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +14 -0
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +0 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +15 -4
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +73 -27
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -4
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +21 -69
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +11 -1
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +14 -30
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +9 -1
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/background.js +198 -36
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +24 -32
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +18 -22
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +53 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +79 -90
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +29 -29
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +13 -30
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-class-name.native.js +9 -1
- package/build/hooks/custom-class-name.native.js.map +1 -1
- package/build/hooks/dimensions.js +13 -14
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +31 -61
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +23 -28
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +52 -120
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +27 -16
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +15 -6
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout-child.js +68 -0
- package/build/hooks/layout-child.js.map +1 -0
- package/build/hooks/layout.js +25 -104
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/padding.js +2 -2
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +40 -62
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +52 -89
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +25 -10
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +43 -18
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-typography-props.js +10 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +200 -10
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -6
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +0 -2
- package/build/private-apis.native.js.map +1 -1
- package/build/store/actions.js +0 -16
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +54 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +46 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +18 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -73
- package/build/store/selectors.js.map +1 -1
- package/build/store/undo-ignore.js +12 -0
- package/build/store/undo-ignore.js.map +1 -0
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/get-px-from-css-unit.js +16 -0
- package/build/utils/get-px-from-css-unit.js.map +1 -0
- package/build/utils/index.js +2 -2
- package/build/utils/index.js.map +1 -1
- package/build/utils/object.js +38 -99
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +9 -1
- package/build/utils/selection.js.map +1 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
- package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-module/components/block-canvas/index.js +22 -8
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -24
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +6 -1
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/index.js +76 -6
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +1 -7
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
- package/build-module/components/block-edit/context.js +2 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +19 -10
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +3 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +3 -3
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block.js +261 -99
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +60 -25
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +3 -5
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +6 -0
- package/build-module/components/block-list/private-block-context.js.map +1 -0
- package/build-module/components/block-list/use-block-props/index.js +50 -70
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
- package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
- package/build-module/components/block-lock/toolbar.js +22 -28
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/index.js +2 -1
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +6 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -10
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +3 -0
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +4 -2
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +3 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -4
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +89 -27
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
- package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
- package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
- package/build-module/components/block-tools/index.js +27 -24
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +2 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +2 -1
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +30 -3
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -1
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -4
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +9 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +26 -23
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +3 -2
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +8 -5
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +7 -1
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +45 -38
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +15 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +7 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/height-control/index.js +6 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/image-link-destinations/index.native.js +109 -0
- package/build-module/components/image-link-destinations/index.native.js.map +1 -0
- package/build-module/components/image-size-control/index.js +2 -2
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +3 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +62 -23
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +18 -4
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +1 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/library.js +3 -7
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -33
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +2 -2
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/tabs.js +22 -22
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +89 -0
- package/build-module/components/inserter-button/index.native.js.map +1 -0
- package/build-module/components/inserter-button/sparkles.js +15 -0
- package/build-module/components/inserter-button/sparkles.js.map +1 -0
- package/build-module/components/inserter-draggable-blocks/index.js +9 -5
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +2 -4
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +3 -3
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +3 -3
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +35 -24
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +4 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +58 -4
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/media-upload-progress/constants.js +7 -0
- package/build-module/components/media-upload-progress/constants.js.map +1 -0
- package/build-module/components/media-upload-progress/index.native.js +37 -8
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +11 -16
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +6 -1
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -62
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +7 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/content.js +25 -21
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +2 -1
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/rich-text/index.js +21 -39
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +10 -18
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +22 -56
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +7 -3
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/with-deprecations.js +42 -0
- package/build-module/components/rich-text/with-deprecations.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +9 -6
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +14 -18
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +107 -18
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +102 -94
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +9 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +4 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +13 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +0 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +15 -4
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +73 -27
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -4
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +20 -67
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +12 -27
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +7 -1
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/background.js +197 -37
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +22 -30
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +17 -21
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +52 -79
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +78 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +27 -27
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +12 -28
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-class-name.native.js +7 -1
- package/build-module/hooks/custom-class-name.native.js.map +1 -1
- package/build-module/hooks/dimensions.js +15 -16
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +30 -61
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +20 -25
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +50 -120
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +20 -16
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +10 -6
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout-child.js +60 -0
- package/build-module/hooks/layout-child.js.map +1 -0
- package/build-module/hooks/layout.js +21 -100
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/padding.js +2 -2
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +38 -59
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +52 -85
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +26 -11
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +43 -17
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +9 -1
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +194 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +2 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +0 -2
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/actions.js +0 -15
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +52 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +44 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -65
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/undo-ignore.js +5 -0
- package/build-module/store/undo-ignore.js.map +1 -0
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/get-px-from-css-unit.js +9 -0
- package/build-module/utils/get-px-from-css-unit.js.map +1 -0
- package/build-module/utils/index.js +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/object.js +37 -97
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +9 -1
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
- package/build-style/content-rtl.css +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +164 -301
- package/build-style/style.css +164 -301
- package/package.json +31 -31
- package/src/components/alignment-control/README.md +0 -5
- package/src/components/block-alignment-control/README.md +0 -5
- package/src/components/block-alignment-matrix-control/README.md +0 -10
- package/src/components/block-breadcrumb/README.md +0 -5
- package/src/components/block-canvas/index.js +29 -17
- package/src/components/block-canvas/style.scss +6 -0
- package/src/components/block-caption/README.md +2 -7
- package/src/components/block-card/README.md +0 -5
- package/src/components/block-card/index.js +6 -4
- package/src/components/block-card/style.scss +7 -3
- package/src/components/block-controls/hook.js +8 -30
- package/src/components/block-controls/test/index.js +3 -3
- package/src/components/block-draggable/draggable-chip.js +11 -1
- package/src/components/block-draggable/index.js +116 -4
- package/src/components/block-draggable/index.native.js +0 -5
- package/src/components/block-draggable/style.scss +35 -0
- package/src/components/block-draggable/test/helpers.native.js +8 -7
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
- package/src/components/block-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-editing-mode/index.js +3 -3
- package/src/components/block-icon/README.md +0 -5
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/README.md +0 -5
- package/src/components/block-inspector/index.js +3 -1
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block-list-item-cell.native.js +5 -1
- package/src/components/block-list/block.js +309 -104
- package/src/components/block-list/block.native.js +69 -21
- package/src/components/block-list/content.scss +14 -10
- package/src/components/block-list/index.native.js +3 -5
- package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
- package/src/components/block-list/use-block-props/index.js +43 -86
- package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
- package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
- package/src/components/block-lock/toolbar.js +23 -34
- package/src/components/block-mover/README.md +0 -5
- package/src/components/block-mover/index.js +1 -1
- package/src/components/block-parent-selector/README.md +0 -5
- package/src/components/block-patterns-list/README.md +0 -5
- package/src/components/block-patterns-list/index.js +9 -6
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/modal.js +7 -1
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-styles/index.js +1 -1
- package/src/components/block-styles/index.native.js +4 -2
- package/src/components/block-styles/style.scss +0 -11
- package/src/components/block-switcher/index.js +49 -59
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/README.md +0 -5
- package/src/components/block-toolbar/index.js +179 -95
- package/src/components/block-toolbar/style.scss +50 -66
- package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
- package/src/components/block-tools/block-toolbar-popover.js +84 -0
- package/src/components/block-tools/index.js +42 -29
- package/src/components/block-tools/style.scss +60 -172
- package/src/components/block-types-list/README.md +0 -5
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/README.md +0 -5
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/block-variation-transforms/README.md +0 -5
- package/src/components/block-variation-transforms/index.js +49 -3
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/caption/README.md +0 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
- package/src/components/colors/utils.js +8 -1
- package/src/components/colors/with-colors.js +3 -1
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/contrast-checker/README.md +0 -4
- package/src/components/copy-handler/README.md +0 -10
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/font-sizes/utils.js +7 -1
- package/src/components/global-styles/border-panel.js +2 -1
- package/src/components/global-styles/color-panel.js +36 -26
- package/src/components/global-styles/dimensions-panel.js +4 -3
- package/src/components/global-styles/effects-panel.js +2 -1
- package/src/components/global-styles/filters-panel.js +6 -5
- package/src/components/global-styles/get-global-styles-changes.js +210 -0
- package/src/components/global-styles/hooks.js +5 -0
- package/src/components/global-styles/image-settings-panel.js +6 -0
- package/src/components/global-styles/index.js +1 -0
- package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
- package/src/components/global-styles/typography-panel.js +60 -47
- package/src/components/global-styles/use-global-styles-output.js +9 -5
- package/src/components/global-styles/utils.js +7 -0
- package/src/components/height-control/README.md +2 -7
- package/src/components/height-control/index.js +4 -0
- package/src/components/image-link-destinations/index.native.js +152 -0
- package/src/components/image-link-destinations/style.native.scss +16 -0
- package/src/components/image-size-control/index.js +5 -2
- package/src/components/index.native.js +3 -2
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +68 -29
- package/src/components/inner-blocks/index.native.js +19 -7
- package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
- package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
- package/src/components/inserter/block-patterns-tab/utils.js +11 -12
- package/src/components/inserter/hooks/use-block-types-state.js +9 -11
- package/src/components/inserter/hooks/use-patterns-state.js +2 -2
- package/src/components/inserter/index.js +0 -1
- package/src/components/inserter/library.js +2 -8
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +26 -36
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +21 -21
- package/src/components/inserter/tabs.js +34 -25
- package/src/components/inserter-button/README.md +62 -0
- package/src/components/inserter-button/index.native.js +116 -0
- package/src/components/inserter-button/sparkles.js +15 -0
- package/src/components/inserter-button/style.native.scss +72 -0
- package/src/components/inserter-draggable-blocks/index.js +18 -5
- package/src/components/inserter-list-item/index.js +6 -6
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/inspector-controls-tabs/index.js +39 -28
- package/src/components/inspector-controls-tabs/style.scss +3 -2
- package/src/components/letter-spacing-control/README.md +0 -5
- package/src/components/line-height-control/README.md +0 -5
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/README.md +0 -5
- package/src/components/list-view/block-select-button.js +4 -0
- package/src/components/list-view/block.js +73 -2
- package/src/components/list-view/style.scss +6 -0
- package/src/components/media-upload-progress/constants.js +6 -0
- package/src/components/media-upload-progress/index.native.js +66 -14
- package/src/components/media-upload-progress/test/index.native.js +2 -2
- package/src/components/multi-selection-inspector/README.md +0 -5
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +15 -13
- package/src/components/plain-text/index.native.js +6 -1
- package/src/components/preview-options/index.js +6 -86
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/test/use-block-sync.js +20 -17
- package/src/components/provider/use-block-sync.js +6 -0
- package/src/components/rich-text/content.js +27 -20
- package/src/components/rich-text/get-rich-text-values.js +6 -1
- package/src/components/rich-text/index.js +23 -52
- package/src/components/rich-text/index.native.js +8 -25
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +22 -71
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
- package/src/components/rich-text/native/test/index.native.js +72 -5
- package/src/components/rich-text/use-input-rules.js +8 -3
- package/src/components/rich-text/use-mark-persistent.js +1 -2
- package/src/components/rich-text/with-deprecations.js +51 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/text-decoration-control/README.md +40 -0
- package/src/components/text-transform-control/README.md +0 -4
- package/src/components/ungroup-button/README.md +0 -5
- package/src/components/unit-control/README.md +0 -4
- package/src/components/url-input/index.js +11 -11
- package/src/components/use-block-commands/index.js +18 -21
- package/src/components/use-block-drop-zone/index.js +181 -30
- package/src/components/use-moving-animation/index.js +107 -103
- package/src/components/use-on-block-drop/index.js +9 -24
- package/src/components/use-on-block-drop/test/index.js +12 -26
- package/src/components/use-resize-canvas/README.md +3 -7
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/README.md +0 -4
- package/src/components/use-settings/index.js +15 -1
- package/src/components/writing-flow/index.js +0 -1
- package/src/components/writing-flow/use-drag-selection.js +18 -4
- package/src/components/writing-flow/use-selection-observer.js +99 -37
- package/src/components/writing-flow/use-tab-nav.js +7 -7
- package/src/hooks/align.js +16 -81
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +14 -38
- package/src/hooks/aria-label.js +8 -5
- package/src/hooks/background.js +269 -32
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +23 -37
- package/src/hooks/border.js +62 -124
- package/src/hooks/color.js +111 -138
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +9 -45
- package/src/hooks/custom-class-name.native.js +8 -5
- package/src/hooks/dimensions.js +14 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +14 -36
- package/src/hooks/font-size.js +67 -168
- package/src/hooks/index.js +58 -16
- package/src/hooks/index.native.js +22 -6
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +17 -103
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +118 -193
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/test/anchor.js +4 -9
- package/src/hooks/test/custom-class-name.js +3 -8
- package/src/hooks/test/style.js +4 -14
- package/src/hooks/typography.js +14 -16
- package/src/hooks/typography.native.js +31 -33
- package/src/hooks/use-typography-props.js +7 -1
- package/src/hooks/utils.js +261 -10
- package/src/private-apis.js +2 -6
- package/src/private-apis.native.js +0 -2
- package/src/store/actions.js +0 -15
- package/src/store/private-actions.js +48 -0
- package/src/store/private-selectors.js +56 -0
- package/src/store/reducer.js +20 -1
- package/src/store/selectors.js +10 -82
- package/src/store/undo-ignore.js +4 -0
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -2
- package/src/utils/get-px-from-css-unit.js +8 -0
- package/src/utils/index.js +1 -1
- package/src/utils/object.js +34 -104
- package/src/utils/selection.js +9 -2
- package/src/utils/test/object.js +1 -96
- package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
- package/build/components/block-list/block-list-block-context.js +0 -14
- package/build/components/block-list/block-list-block-context.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build/components/block-tools/back-compat.js +0 -45
- package/build/components/block-tools/back-compat.js.map +0 -1
- package/build/components/block-tools/block-contextual-toolbar.js +0 -91
- package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build/components/block-tools/selected-block-tools.js +0 -113
- package/build/components/block-tools/selected-block-tools.js.map +0 -1
- package/build/components/inserter/hooks/use-debounced-input.js +0 -22
- package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build/components/use-display-block-controls/index.js +0 -39
- package/build/components/use-display-block-controls/index.js.map +0 -1
- package/build/components/use-display-block-controls/index.native.js +0 -39
- package/build/components/use-display-block-controls/index.native.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -120
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/parse-css-unit-to-px.js +0 -302
- package/build/utils/parse-css-unit-to-px.js.map +0 -1
- package/build/utils/use-should-contextual-toolbar-show.js +0 -63
- package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/build-module/components/block-list/block-list-block-context.js +0 -6
- package/build-module/components/block-list/block-list-block-context.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
- package/build-module/components/block-tools/back-compat.js +0 -35
- package/build-module/components/block-tools/back-compat.js.map +0 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
- package/build-module/components/block-tools/selected-block-tools.js +0 -105
- package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.js +0 -32
- package/build-module/components/use-display-block-controls/index.js.map +0 -1
- package/build-module/components/use-display-block-controls/index.native.js +0 -32
- package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -118
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/parse-css-unit-to-px.js +0 -294
- package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
- package/src/components/block-parent-selector/style.scss +0 -11
- package/src/components/block-tools/back-compat.js +0 -35
- package/src/components/block-tools/block-contextual-toolbar.js +0 -100
- package/src/components/block-tools/selected-block-tools.js +0 -127
- package/src/components/inserter/hooks/use-debounced-input.js +0 -18
- package/src/components/preview-options/README.md +0 -94
- package/src/components/preview-options/style.scss +0 -64
- package/src/components/use-display-block-controls/index.js +0 -36
- package/src/components/use-display-block-controls/index.native.js +0 -37
- package/src/hooks/custom-fields.js +0 -142
- package/src/hooks/test/color.js +0 -112
- package/src/utils/parse-css-unit-to-px.js +0 -329
- package/src/utils/test/parse-css-unit-to-px.js +0 -172
- package/src/utils/use-should-contextual-toolbar-show.js +0 -85
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import getGlobalStylesChanges from '../get-global-styles-changes';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
registerBlockType,
|
|
11
|
+
unregisterBlockType,
|
|
12
|
+
getBlockTypes,
|
|
13
|
+
} from '@wordpress/blocks';
|
|
14
|
+
|
|
15
|
+
describe( 'getGlobalStylesChanges', () => {
|
|
16
|
+
beforeEach( () => {
|
|
17
|
+
registerBlockType( 'core/test-fiori-di-zucca', {
|
|
18
|
+
save: () => {},
|
|
19
|
+
category: 'text',
|
|
20
|
+
title: 'Test pumpkin flowers',
|
|
21
|
+
edit: () => {},
|
|
22
|
+
} );
|
|
23
|
+
} );
|
|
24
|
+
|
|
25
|
+
afterEach( () => {
|
|
26
|
+
getBlockTypes().forEach( ( block ) => {
|
|
27
|
+
unregisterBlockType( block.name );
|
|
28
|
+
} );
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
const revision = {
|
|
32
|
+
id: 10,
|
|
33
|
+
styles: {
|
|
34
|
+
typography: {
|
|
35
|
+
fontSize: 'var(--wp--preset--font-size--potato)',
|
|
36
|
+
fontStyle: 'normal',
|
|
37
|
+
fontWeight: '600',
|
|
38
|
+
lineHeight: '1.85',
|
|
39
|
+
fontFamily: 'var(--wp--preset--font-family--asparagus)',
|
|
40
|
+
},
|
|
41
|
+
spacing: {
|
|
42
|
+
padding: {
|
|
43
|
+
top: '36px',
|
|
44
|
+
right: '89px',
|
|
45
|
+
bottom: '133px',
|
|
46
|
+
left: 'var(--wp--preset--spacing--20)',
|
|
47
|
+
},
|
|
48
|
+
blockGap: '114px',
|
|
49
|
+
},
|
|
50
|
+
elements: {
|
|
51
|
+
heading: {
|
|
52
|
+
typography: {
|
|
53
|
+
letterSpacing: '37px',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
h3: {
|
|
57
|
+
typography: {
|
|
58
|
+
lineHeight: '1.2',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
caption: {
|
|
62
|
+
color: {
|
|
63
|
+
text: 'var(--wp--preset--color--pineapple)',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
color: {
|
|
68
|
+
text: 'var(--wp--preset--color--tomato)',
|
|
69
|
+
},
|
|
70
|
+
blocks: {
|
|
71
|
+
'core/test-fiori-di-zucca': {
|
|
72
|
+
color: {
|
|
73
|
+
text: '#000000',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
settings: {
|
|
79
|
+
color: {
|
|
80
|
+
palette: {
|
|
81
|
+
theme: [
|
|
82
|
+
{
|
|
83
|
+
slug: 'one',
|
|
84
|
+
color: 'pink',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
const previousRevision = {
|
|
92
|
+
id: 9,
|
|
93
|
+
styles: {
|
|
94
|
+
typography: {
|
|
95
|
+
fontSize: 'var(--wp--preset--font-size--fungus)',
|
|
96
|
+
fontStyle: 'normal',
|
|
97
|
+
fontWeight: '600',
|
|
98
|
+
lineHeight: '1.85',
|
|
99
|
+
fontFamily: 'var(--wp--preset--font-family--grapes)',
|
|
100
|
+
},
|
|
101
|
+
spacing: {
|
|
102
|
+
padding: {
|
|
103
|
+
top: '36px',
|
|
104
|
+
right: '89px',
|
|
105
|
+
bottom: '133px',
|
|
106
|
+
left: 'var(--wp--preset--spacing--20)',
|
|
107
|
+
},
|
|
108
|
+
blockGap: '114px',
|
|
109
|
+
},
|
|
110
|
+
elements: {
|
|
111
|
+
heading: {
|
|
112
|
+
typography: {
|
|
113
|
+
letterSpacing: '37px',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
h3: {
|
|
117
|
+
typography: {
|
|
118
|
+
lineHeight: '2',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
h6: {
|
|
122
|
+
typography: {
|
|
123
|
+
lineHeight: '1.2',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
caption: {
|
|
127
|
+
typography: {
|
|
128
|
+
fontSize: '1.11rem',
|
|
129
|
+
fontStyle: 'normal',
|
|
130
|
+
fontWeight: '600',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
link: {
|
|
134
|
+
typography: {
|
|
135
|
+
lineHeight: 2,
|
|
136
|
+
textDecoration: 'line-through',
|
|
137
|
+
},
|
|
138
|
+
color: {
|
|
139
|
+
text: 'var(--wp--preset--color--egg)',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
color: {
|
|
144
|
+
text: 'var(--wp--preset--color--tomato)',
|
|
145
|
+
background: 'var(--wp--preset--color--pumpkin)',
|
|
146
|
+
},
|
|
147
|
+
blocks: {
|
|
148
|
+
'core/test-fiori-di-zucca': {
|
|
149
|
+
color: {
|
|
150
|
+
text: '#fff',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
settings: {
|
|
156
|
+
color: {
|
|
157
|
+
palette: {
|
|
158
|
+
theme: [
|
|
159
|
+
{
|
|
160
|
+
slug: 'one',
|
|
161
|
+
color: 'blue',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
it( 'returns a list of changes and caches them', () => {
|
|
170
|
+
const resultA = getGlobalStylesChanges( revision, previousRevision );
|
|
171
|
+
expect( resultA ).toEqual( [
|
|
172
|
+
'Colors',
|
|
173
|
+
'Typography',
|
|
174
|
+
'Test pumpkin flowers block',
|
|
175
|
+
'H3 element',
|
|
176
|
+
'Caption element',
|
|
177
|
+
'H6 element',
|
|
178
|
+
'Link element',
|
|
179
|
+
'Color settings',
|
|
180
|
+
] );
|
|
181
|
+
|
|
182
|
+
const resultB = getGlobalStylesChanges( revision, previousRevision );
|
|
183
|
+
|
|
184
|
+
expect( resultA ).toBe( resultB );
|
|
185
|
+
} );
|
|
186
|
+
|
|
187
|
+
it( 'returns a list of truncated changes', () => {
|
|
188
|
+
const resultA = getGlobalStylesChanges( revision, previousRevision, {
|
|
189
|
+
maxResults: 3,
|
|
190
|
+
} );
|
|
191
|
+
expect( resultA ).toEqual( [
|
|
192
|
+
'Colors',
|
|
193
|
+
'Typography',
|
|
194
|
+
'Test pumpkin flowers block',
|
|
195
|
+
'…and 5 more changes.',
|
|
196
|
+
] );
|
|
197
|
+
} );
|
|
198
|
+
|
|
199
|
+
it( 'skips unknown and unchanged keys', () => {
|
|
200
|
+
const result = getGlobalStylesChanges(
|
|
201
|
+
{
|
|
202
|
+
styles: {
|
|
203
|
+
frogs: {
|
|
204
|
+
legs: 'green',
|
|
205
|
+
},
|
|
206
|
+
typography: {
|
|
207
|
+
fontSize: '1rem',
|
|
208
|
+
},
|
|
209
|
+
settings: {
|
|
210
|
+
'': {
|
|
211
|
+
'': 'foo',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
styles: {
|
|
218
|
+
frogs: {
|
|
219
|
+
legs: 'yellow',
|
|
220
|
+
},
|
|
221
|
+
typography: {
|
|
222
|
+
fontSize: '1rem',
|
|
223
|
+
},
|
|
224
|
+
settings: {
|
|
225
|
+
'': {
|
|
226
|
+
'': 'bar',
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
expect( result ).toEqual( [] );
|
|
233
|
+
} );
|
|
234
|
+
} );
|
|
@@ -13,6 +13,7 @@ import { useCallback } from '@wordpress/element';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
+
import { mergeOrigins, hasMergedOrigins } from '../use-settings';
|
|
16
17
|
import FontFamilyControl from '../font-family';
|
|
17
18
|
import FontAppearanceControl from '../font-appearance-control';
|
|
18
19
|
import LineHeightControl from '../line-height-control';
|
|
@@ -20,8 +21,8 @@ import LetterSpacingControl from '../letter-spacing-control';
|
|
|
20
21
|
import TextTransformControl from '../text-transform-control';
|
|
21
22
|
import TextDecorationControl from '../text-decoration-control';
|
|
22
23
|
import WritingModeControl from '../writing-mode-control';
|
|
23
|
-
import { getValueFromVariable } from './utils';
|
|
24
|
-
import { setImmutably } from '../../utils/object';
|
|
24
|
+
import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
|
|
25
|
+
import { setImmutably, uniqByProperty } from '../../utils/object';
|
|
25
26
|
|
|
26
27
|
const MIN_TEXT_COLUMNS = 1;
|
|
27
28
|
const MAX_TEXT_COLUMNS = 6;
|
|
@@ -51,25 +52,17 @@ export function useHasTypographyPanel( settings ) {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function useHasFontSizeControl( settings ) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
return (
|
|
56
|
+
( settings?.typography?.defaultFontSizes !== false &&
|
|
57
|
+
settings?.typography?.fontSizes?.default?.length ) ||
|
|
58
|
+
settings?.typography?.fontSizes?.theme?.length ||
|
|
59
|
+
settings?.typography?.fontSizes?.custom?.length ||
|
|
60
|
+
settings?.typography?.customFontSize
|
|
61
|
+
);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
function useHasFontFamilyControl( settings ) {
|
|
64
|
-
|
|
65
|
-
const fontFamilies = []
|
|
66
|
-
.concat( fontFamiliesPerOrigin?.custom ?? [] )
|
|
67
|
-
.concat( fontFamiliesPerOrigin?.theme ?? [] )
|
|
68
|
-
.concat( fontFamiliesPerOrigin?.default ?? [] )
|
|
69
|
-
.sort( ( a, b ) =>
|
|
70
|
-
( a?.name || a?.slug )?.localeCompare( b?.name || a?.slug )
|
|
71
|
-
);
|
|
72
|
-
return !! fontFamilies?.length;
|
|
65
|
+
return hasMergedOrigins( settings?.typography?.fontFamilies );
|
|
73
66
|
}
|
|
74
67
|
|
|
75
68
|
function useHasLineHeightControl( settings ) {
|
|
@@ -77,18 +70,14 @@ function useHasLineHeightControl( settings ) {
|
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
function useHasAppearanceControl( settings ) {
|
|
80
|
-
|
|
81
|
-
const hasFontWeights = settings?.typography?.fontWeight;
|
|
82
|
-
return hasFontStyles || hasFontWeights;
|
|
73
|
+
return settings?.typography?.fontStyle || settings?.typography?.fontWeight;
|
|
83
74
|
}
|
|
84
75
|
|
|
85
76
|
function useAppearanceControlLabel( settings ) {
|
|
86
|
-
|
|
87
|
-
const hasFontWeights = settings?.typography?.fontWeight;
|
|
88
|
-
if ( ! hasFontStyles ) {
|
|
77
|
+
if ( ! settings?.typography?.fontStyle ) {
|
|
89
78
|
return __( 'Font weight' );
|
|
90
79
|
}
|
|
91
|
-
if ( !
|
|
80
|
+
if ( ! settings?.typography?.fontWeight ) {
|
|
92
81
|
return __( 'Font style' );
|
|
93
82
|
}
|
|
94
83
|
return __( 'Appearance' );
|
|
@@ -114,19 +103,45 @@ function useHasTextColumnsControl( settings ) {
|
|
|
114
103
|
return settings?.typography?.textColumns;
|
|
115
104
|
}
|
|
116
105
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
/**
|
|
107
|
+
* TODO: The reversing and filtering of default font sizes is a hack so the
|
|
108
|
+
* dropdown UI matches what is generated in the global styles CSS stylesheet.
|
|
109
|
+
*
|
|
110
|
+
* This is a temporary solution until #57733 is resolved. At which point,
|
|
111
|
+
* the mergedFontSizes would just need to be the concatenated array of all
|
|
112
|
+
* presets or a custom dropdown with sections for each.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link https://github.com/WordPress/gutenberg/issues/57733}
|
|
115
|
+
*
|
|
116
|
+
* @param {Object} settings The global styles settings.
|
|
117
|
+
*
|
|
118
|
+
* @return {Array} The merged font sizes.
|
|
119
|
+
*/
|
|
120
|
+
function getMergedFontSizes( settings ) {
|
|
121
|
+
// The font size presets are merged in reverse order so that the duplicates
|
|
122
|
+
// that may defined later in the array have higher priority to match the CSS.
|
|
123
|
+
const mergedFontSizesAll = uniqByProperty(
|
|
124
|
+
[
|
|
125
|
+
settings?.typography?.fontSizes?.custom,
|
|
126
|
+
settings?.typography?.fontSizes?.theme,
|
|
127
|
+
settings?.typography?.fontSizes?.default,
|
|
128
|
+
].flatMap( ( presets ) => presets?.toReversed() ?? [] ),
|
|
129
|
+
'slug'
|
|
130
|
+
).reverse();
|
|
131
|
+
|
|
132
|
+
// Default presets exist in the global styles CSS no matter the setting, so
|
|
133
|
+
// filtering them out in the UI has to be done after merging.
|
|
134
|
+
const mergedFontSizes =
|
|
135
|
+
settings?.typography?.defaultFontSizes === false
|
|
136
|
+
? mergedFontSizesAll.filter(
|
|
137
|
+
( { slug } ) =>
|
|
138
|
+
! [ 'small', 'medium', 'large', 'x-large' ].includes(
|
|
139
|
+
slug
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
: mergedFontSizesAll;
|
|
143
|
+
|
|
144
|
+
return mergedFontSizes;
|
|
130
145
|
}
|
|
131
146
|
|
|
132
147
|
function TypographyToolsPanel( {
|
|
@@ -146,6 +161,7 @@ function TypographyToolsPanel( {
|
|
|
146
161
|
label={ __( 'Typography' ) }
|
|
147
162
|
resetAll={ resetAll }
|
|
148
163
|
panelId={ panelId }
|
|
164
|
+
dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
|
|
149
165
|
>
|
|
150
166
|
{ children }
|
|
151
167
|
</ToolsPanel>
|
|
@@ -178,14 +194,11 @@ export default function TypographyPanel( {
|
|
|
178
194
|
|
|
179
195
|
// Font Family
|
|
180
196
|
const hasFontFamilyEnabled = useHasFontFamilyControl( settings );
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
.concat( fontFamiliesPerOrigin?.custom ?? [] )
|
|
184
|
-
.concat( fontFamiliesPerOrigin?.theme ?? [] )
|
|
185
|
-
.concat( fontFamiliesPerOrigin?.default ?? [] );
|
|
197
|
+
const fontFamilies = settings?.typography?.fontFamilies;
|
|
198
|
+
const mergedFontFamilies = fontFamilies ? mergeOrigins( fontFamilies ) : [];
|
|
186
199
|
const fontFamily = decodeValue( inheritedValue?.typography?.fontFamily );
|
|
187
200
|
const setFontFamily = ( newValue ) => {
|
|
188
|
-
const slug =
|
|
201
|
+
const slug = mergedFontFamilies?.find(
|
|
189
202
|
( { fontFamily: f } ) => f === newValue
|
|
190
203
|
)?.slug;
|
|
191
204
|
onChange(
|
|
@@ -204,7 +217,7 @@ export default function TypographyPanel( {
|
|
|
204
217
|
// Font Size
|
|
205
218
|
const hasFontSizeEnabled = useHasFontSizeControl( settings );
|
|
206
219
|
const disableCustomFontSizes = ! settings?.typography?.customFontSize;
|
|
207
|
-
const
|
|
220
|
+
const mergedFontSizes = getMergedFontSizes( settings );
|
|
208
221
|
|
|
209
222
|
const fontSize = decodeValue( inheritedValue?.typography?.fontSize );
|
|
210
223
|
const setFontSize = ( newValue, metadata ) => {
|
|
@@ -368,7 +381,7 @@ export default function TypographyPanel( {
|
|
|
368
381
|
panelId={ panelId }
|
|
369
382
|
>
|
|
370
383
|
<FontFamilyControl
|
|
371
|
-
fontFamilies={
|
|
384
|
+
fontFamilies={ mergedFontFamilies }
|
|
372
385
|
value={ fontFamily }
|
|
373
386
|
onChange={ setFontFamily }
|
|
374
387
|
size="__unstable-large"
|
|
@@ -387,7 +400,7 @@ export default function TypographyPanel( {
|
|
|
387
400
|
<FontSizePicker
|
|
388
401
|
value={ fontSize }
|
|
389
402
|
onChange={ setFontSize }
|
|
390
|
-
fontSizes={
|
|
403
|
+
fontSizes={ mergedFontSizes }
|
|
391
404
|
disableCustomFontSizes={ disableCustomFontSizes }
|
|
392
405
|
withReset={ false }
|
|
393
406
|
withSlider
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { useSelect } from '@wordpress/data';
|
|
12
12
|
import { useContext, useMemo } from '@wordpress/element';
|
|
13
13
|
import { getCSSRules } from '@wordpress/style-engine';
|
|
14
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
@@ -32,12 +33,9 @@ import { getDuotoneFilter } from '../duotone/utils';
|
|
|
32
33
|
import { getGapCSSValue } from '../../hooks/gap';
|
|
33
34
|
import { store as blockEditorStore } from '../../store';
|
|
34
35
|
import { LAYOUT_DEFINITIONS } from '../../layouts/definitions';
|
|
35
|
-
import {
|
|
36
|
-
getValueFromObjectPath,
|
|
37
|
-
kebabCase,
|
|
38
|
-
setImmutably,
|
|
39
|
-
} from '../../utils/object';
|
|
36
|
+
import { getValueFromObjectPath, setImmutably } from '../../utils/object';
|
|
40
37
|
import BlockContext from '../block-context';
|
|
38
|
+
import { unlock } from '../../lock-unlock';
|
|
41
39
|
|
|
42
40
|
// List of block support features that can have their related styles
|
|
43
41
|
// generated under their own feature level selector rather than the block's.
|
|
@@ -72,6 +70,8 @@ function compileStyleValue( uncompiledValue ) {
|
|
|
72
70
|
* @return {Array<Object>} An array of style declarations.
|
|
73
71
|
*/
|
|
74
72
|
function getPresetsDeclarations( blockPresets = {}, mergedSettings ) {
|
|
73
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
74
|
+
|
|
75
75
|
return PRESET_METADATA.reduce(
|
|
76
76
|
( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {
|
|
77
77
|
const presetByOrigin = getValueFromObjectPath(
|
|
@@ -116,6 +116,8 @@ function getPresetsDeclarations( blockPresets = {}, mergedSettings ) {
|
|
|
116
116
|
* @return {string} CSS declarations for the preset classes.
|
|
117
117
|
*/
|
|
118
118
|
function getPresetsClasses( blockSelector = '*', blockPresets = {} ) {
|
|
119
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
120
|
+
|
|
119
121
|
return PRESET_METADATA.reduce(
|
|
120
122
|
( declarations, { path, cssVarInfix, classes } ) => {
|
|
121
123
|
if ( ! classes ) {
|
|
@@ -180,6 +182,7 @@ function getPresetsSvgFilters( blockPresets = {} ) {
|
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
function flattenTree( input = {}, prefix, token ) {
|
|
185
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
183
186
|
let result = [];
|
|
184
187
|
Object.keys( input ).forEach( ( key ) => {
|
|
185
188
|
const newKey = prefix + kebabCase( key.replace( '/', '-' ) );
|
|
@@ -321,6 +324,7 @@ export function getStylesDeclarations(
|
|
|
321
324
|
tree = {},
|
|
322
325
|
isTemplate = true
|
|
323
326
|
) {
|
|
327
|
+
const { kebabCase } = unlock( componentsPrivateApis );
|
|
324
328
|
const isRoot = ROOT_BLOCK_SELECTOR === selector;
|
|
325
329
|
const output = Object.entries( STYLE_PROPERTY ).reduce(
|
|
326
330
|
(
|
|
@@ -159,6 +159,13 @@ export const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
|
159
159
|
'typography.fontFamily': 'fontFamily',
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
export const TOOLSPANEL_DROPDOWNMENU_PROPS = {
|
|
163
|
+
popoverProps: {
|
|
164
|
+
placement: 'left-start',
|
|
165
|
+
offset: 259, // Inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
162
169
|
function findInPresetsBy(
|
|
163
170
|
features,
|
|
164
171
|
blockName,
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `HeightControl` component adds a linked unit control and slider component for controlling the height of a block within the block editor. It supports passing a label, and is used for controlling the minimum height dimensions of Group blocks.
|
|
4
4
|
|
|
5
|
-
_Note:_ It is worth noting that the minimum height option is an opt-in feature. Themes need to declare support for it before it'll be available, and a convenient way to do that is via opting in to the [appearanceTools](/docs/how-to-guides/themes/
|
|
6
|
-
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
1. [Development guidelines](#development-guidelines)
|
|
10
|
-
2. [Related components](#related-components)
|
|
5
|
+
_Note:_ It is worth noting that the minimum height option is an opt-in feature. Themes need to declare support for it before it'll be available, and a convenient way to do that is via opting in to the [appearanceTools](/docs/how-to-guides/themes/global-settings-and-styles.md#opt-in-into-ui-controls) UI controls.
|
|
11
6
|
|
|
12
7
|
## Development guidelines
|
|
13
8
|
|
|
@@ -48,7 +43,7 @@ A callback function that handles the application of the height value.
|
|
|
48
43
|
- **Type:** `String`
|
|
49
44
|
- **Default:** `'Height'`
|
|
50
45
|
|
|
51
|
-
A label for the height control. This is useful when using the height control for a feature that is controlled in the same way as height, but requires a different label. For example, "
|
|
46
|
+
A label for the height control. This is useful when using the height control for a feature that is controlled in the same way as height, but requires a different label. For example, "Minimum height".
|
|
52
47
|
|
|
53
48
|
## Related components
|
|
54
49
|
|
|
@@ -157,6 +157,8 @@ export default function HeightControl( {
|
|
|
157
157
|
onUnitChange={ handleUnitChange }
|
|
158
158
|
min={ 0 }
|
|
159
159
|
size={ '__unstable-large' }
|
|
160
|
+
label={ label }
|
|
161
|
+
hideLabelFromVision
|
|
160
162
|
/>
|
|
161
163
|
</FlexItem>
|
|
162
164
|
<FlexItem isBlock>
|
|
@@ -175,6 +177,8 @@ export default function HeightControl( {
|
|
|
175
177
|
withInputField={ false }
|
|
176
178
|
onChange={ handleSliderChange }
|
|
177
179
|
__nextHasNoMarginBottom
|
|
180
|
+
label={ label }
|
|
181
|
+
hideLabelFromVision
|
|
178
182
|
/>
|
|
179
183
|
</Spacer>
|
|
180
184
|
</FlexItem>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
5
|
+
import { StyleSheet } from 'react-native';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { __ } from '@wordpress/i18n';
|
|
11
|
+
import { Icon, check, chevronRight } from '@wordpress/icons';
|
|
12
|
+
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
13
|
+
import { BottomSheet, PanelBody } from '@wordpress/components';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import styles from './style.native.scss';
|
|
19
|
+
import { blockSettingsScreens } from '../block-settings';
|
|
20
|
+
|
|
21
|
+
const LINK_DESTINATION_NONE = 'none';
|
|
22
|
+
const LINK_DESTINATION_MEDIA = 'media';
|
|
23
|
+
const LINK_DESTINATION_ATTACHMENT = 'attachment';
|
|
24
|
+
const LINK_DESTINATION_CUSTOM = 'custom';
|
|
25
|
+
|
|
26
|
+
function LinkDestination( {
|
|
27
|
+
children,
|
|
28
|
+
isSelected,
|
|
29
|
+
label,
|
|
30
|
+
onPress,
|
|
31
|
+
value,
|
|
32
|
+
valueStyle,
|
|
33
|
+
} ) {
|
|
34
|
+
const optionIcon = usePreferredColorSchemeStyle(
|
|
35
|
+
styles.optionIcon,
|
|
36
|
+
styles.optionIconDark
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<BottomSheet.Cell
|
|
41
|
+
icon={ check }
|
|
42
|
+
iconStyle={ StyleSheet.flatten( [
|
|
43
|
+
optionIcon,
|
|
44
|
+
! isSelected && styles.unselectedOptionIcon,
|
|
45
|
+
] ) }
|
|
46
|
+
label={ label }
|
|
47
|
+
leftAlign
|
|
48
|
+
onPress={ onPress }
|
|
49
|
+
value={ value }
|
|
50
|
+
valueStyle={ valueStyle }
|
|
51
|
+
separatorType="leftMargin"
|
|
52
|
+
>
|
|
53
|
+
{ children }
|
|
54
|
+
</BottomSheet.Cell>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function ImageLinkDestinationsScreen( props ) {
|
|
59
|
+
const navigation = useNavigation();
|
|
60
|
+
const route = useRoute();
|
|
61
|
+
const { url = '' } = props;
|
|
62
|
+
const {
|
|
63
|
+
inputValue = url,
|
|
64
|
+
imageUrl,
|
|
65
|
+
attachmentPageUrl,
|
|
66
|
+
linkDestination,
|
|
67
|
+
} = route.params || {};
|
|
68
|
+
|
|
69
|
+
function goToLinkPicker() {
|
|
70
|
+
navigation.navigate( blockSettingsScreens.linkPicker, {
|
|
71
|
+
inputValue:
|
|
72
|
+
linkDestination === LINK_DESTINATION_CUSTOM ? inputValue : '',
|
|
73
|
+
} );
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const setLinkDestination = ( newLinkDestination ) => () => {
|
|
77
|
+
let newUrl;
|
|
78
|
+
switch ( newLinkDestination ) {
|
|
79
|
+
case LINK_DESTINATION_MEDIA:
|
|
80
|
+
newUrl = imageUrl;
|
|
81
|
+
break;
|
|
82
|
+
case LINK_DESTINATION_ATTACHMENT:
|
|
83
|
+
newUrl = attachmentPageUrl;
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
newUrl = '';
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
navigation.navigate( blockSettingsScreens.settings, {
|
|
91
|
+
// The `inputValue` name is reused from LinkPicker, as it helps avoid
|
|
92
|
+
// bugs from stale values remaining in the React Navigation route
|
|
93
|
+
// parameters.
|
|
94
|
+
inputValue: newUrl,
|
|
95
|
+
// Clear link text value that may be set from LinkPicker.
|
|
96
|
+
text: '',
|
|
97
|
+
} );
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<BottomSheet.NavBar>
|
|
103
|
+
<BottomSheet.NavBar.BackButton onPress={ navigation.goBack } />
|
|
104
|
+
<BottomSheet.NavBar.Heading>
|
|
105
|
+
{ __( 'Link To' ) }
|
|
106
|
+
</BottomSheet.NavBar.Heading>
|
|
107
|
+
</BottomSheet.NavBar>
|
|
108
|
+
<PanelBody>
|
|
109
|
+
<LinkDestination
|
|
110
|
+
isSelected={ linkDestination === LINK_DESTINATION_NONE }
|
|
111
|
+
label={ __( 'None' ) }
|
|
112
|
+
onPress={ setLinkDestination( LINK_DESTINATION_NONE ) }
|
|
113
|
+
/>
|
|
114
|
+
<LinkDestination
|
|
115
|
+
isSelected={ linkDestination === LINK_DESTINATION_MEDIA }
|
|
116
|
+
label={ __( 'Media File' ) }
|
|
117
|
+
onPress={ setLinkDestination( LINK_DESTINATION_MEDIA ) }
|
|
118
|
+
/>
|
|
119
|
+
{ !! attachmentPageUrl && (
|
|
120
|
+
<LinkDestination
|
|
121
|
+
isSelected={
|
|
122
|
+
linkDestination === LINK_DESTINATION_ATTACHMENT
|
|
123
|
+
}
|
|
124
|
+
label={ __( 'Attachment Page' ) }
|
|
125
|
+
onPress={ setLinkDestination(
|
|
126
|
+
LINK_DESTINATION_ATTACHMENT
|
|
127
|
+
) }
|
|
128
|
+
/>
|
|
129
|
+
) }
|
|
130
|
+
<LinkDestination
|
|
131
|
+
isSelected={ linkDestination === LINK_DESTINATION_CUSTOM }
|
|
132
|
+
label={ __( 'Custom URL' ) }
|
|
133
|
+
onPress={ goToLinkPicker }
|
|
134
|
+
value={
|
|
135
|
+
linkDestination === LINK_DESTINATION_CUSTOM
|
|
136
|
+
? inputValue
|
|
137
|
+
: ''
|
|
138
|
+
}
|
|
139
|
+
valueStyle={
|
|
140
|
+
linkDestination === LINK_DESTINATION_CUSTOM
|
|
141
|
+
? undefined
|
|
142
|
+
: styles.placeholderTextColor
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
<Icon icon={ chevronRight }></Icon>
|
|
146
|
+
</LinkDestination>
|
|
147
|
+
</PanelBody>
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export default ImageLinkDestinationsScreen;
|