@wordpress/block-editor 12.14.0 → 12.16.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 +4 -0
- package/README.md +10 -5
- package/build/components/block-canvas/index.js +22 -6
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +1 -1
- 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-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-info-slot-fill/index.js +3 -4
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-list/block.js +28 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +16 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +61 -18
- 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-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +37 -20
- 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/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +90 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- 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-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.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-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +89 -27
- 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 +86 -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.js +6 -2
- package/build/components/block-types-list/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/colors-gradients/control.js +28 -17
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.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/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +22 -20
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +9 -3
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +20 -31
- package/build/components/global-styles/typography-panel.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 +0 -5
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.native.js +8 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.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 +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +3 -4
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.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 +14 -7
- 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-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-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.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/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +2 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +6 -60
- package/build/components/preview-options/index.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 +2 -30
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -17
- 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 +41 -37
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +35 -2
- package/build/components/rich-text/use-input-rules.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/use-block-drop-zone/index.js +74 -9
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -1
- 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 +16 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/hooks/align.js +20 -68
- 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 +13 -29
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +28 -31
- 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 +38 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/border.js +58 -80
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +76 -89
- 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 +12 -29
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +64 -73
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/dimensions.js +21 -17
- 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 +16 -25
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -119
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +25 -15
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -3
- 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 +29 -108
- 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 +51 -88
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +34 -14
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +154 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +34 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +8 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +10 -58
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +66 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/object.js +21 -61
- 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/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-canvas/index.js +23 -7
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +1 -1
- 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-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-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-list/block.js +29 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +16 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +62 -19
- 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-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +37 -20
- 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/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +82 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- 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-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.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-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +88 -25
- 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 +76 -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.js +6 -2
- package/build-module/components/block-types-list/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/colors-gradients/control.js +29 -18
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.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/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +23 -21
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +10 -4
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +20 -31
- package/build-module/components/global-styles/typography-panel.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 +0 -5
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.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 +4 -4
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +2 -2
- 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 +3 -4
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.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 +14 -7
- 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-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-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.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/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +2 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +6 -60
- package/build-module/components/preview-options/index.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 +4 -32
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -19
- 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 +41 -37
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +36 -3
- package/build-module/components/rich-text/use-input-rules.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/use-block-drop-zone/index.js +73 -9
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -1
- 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 +15 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/hooks/align.js +19 -66
- 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 +11 -26
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +26 -28
- 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 +36 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/border.js +57 -78
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +74 -86
- 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 +11 -27
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +60 -74
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/dimensions.js +21 -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 +14 -23
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +49 -119
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +18 -15
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +5 -3
- 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 +26 -105
- 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 +51 -84
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +33 -12
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +149 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +33 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +8 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -51
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +56 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/object.js +21 -60
- 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/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +123 -298
- package/build-style/style.css +123 -298
- package/package.json +31 -31
- package/src/components/block-canvas/index.js +31 -17
- package/src/components/block-caption/README.md +2 -2
- package/src/components/block-card/index.js +5 -3
- 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-edit/context.js +3 -0
- package/src/components/block-edit/index.js +36 -10
- package/src/components/block-info-slot-fill/index.js +6 -3
- package/src/components/block-inspector/style.scss +0 -4
- package/src/components/block-list/block.js +39 -5
- package/src/components/block-list/block.native.js +20 -4
- package/src/components/block-list/use-block-props/index.js +74 -21
- 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-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +61 -35
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-removal-warning-modal/index.js +7 -14
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +121 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings/container.native.js +3 -5
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- 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/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/index.js +180 -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 +90 -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/index.js +5 -4
- package/src/components/block-types-list/index.native.js +2 -1
- package/src/components/block-variation-picker/index.native.js +1 -1
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/colors-gradients/control.js +49 -30
- package/src/components/colors-gradients/style.scss +0 -7
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/duotone-control/index.js +2 -5
- package/src/components/duotone-control/style.scss +1 -6
- package/src/components/editable-text/README.md +0 -36
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/global-styles/color-panel.js +34 -25
- package/src/components/global-styles/filters-panel.js +8 -4
- package/src/components/global-styles/typography-panel.js +23 -43
- 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 +0 -6
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/README.md +13 -2
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
- package/src/components/inserter/block-patterns-tab/utils.js +6 -4
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-panel.js +1 -1
- package/src/components/inserter/menu.js +16 -8
- package/src/components/inserter/preview-panel.js +2 -2
- package/src/components/inserter/style.scss +15 -17
- 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-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/inspector-controls/fill.js +6 -3
- package/src/components/inspector-controls/fill.native.js +6 -3
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/navigable-toolbar/README.md +2 -0
- package/src/components/navigable-toolbar/index.js +2 -2
- package/src/components/plain-text/README.md +0 -28
- package/src/components/preview-options/index.js +6 -84
- package/src/components/rich-text/README.md +0 -58
- 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 +5 -46
- package/src/components/rich-text/index.native.js +9 -26
- package/src/components/rich-text/native/get-format-colors.native.js +33 -40
- package/src/components/rich-text/native/index.native.js +52 -50
- package/src/components/rich-text/use-input-rules.js +36 -3
- 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/url-input/README.md +1 -74
- package/src/components/use-block-drop-zone/index.js +118 -15
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-on-block-drop/index.js +2 -1
- package/src/components/use-resize-canvas/README.md +3 -3
- package/src/components/use-resize-canvas/index.js +4 -1
- package/src/components/use-settings/index.js +17 -3
- package/src/components/use-settings/test/index.js +1 -1
- package/src/hooks/align.js +15 -76
- package/src/hooks/align.native.js +1 -0
- package/src/hooks/anchor.js +13 -33
- package/src/hooks/background.js +28 -23
- package/src/hooks/block-hooks.js +22 -51
- package/src/hooks/block-renaming.js +33 -0
- package/src/hooks/border.js +67 -118
- package/src/hooks/color.js +100 -132
- package/src/hooks/content-lock-ui.js +110 -122
- package/src/hooks/custom-class-name.js +8 -40
- package/src/hooks/custom-fields.js +70 -94
- package/src/hooks/dimensions.js +20 -16
- package/src/hooks/duotone.js +70 -127
- package/src/hooks/font-family.js +10 -29
- package/src/hooks/font-size.js +66 -162
- package/src/hooks/index.js +42 -15
- package/src/hooks/index.native.js +6 -3
- package/src/hooks/layout-child.js +53 -0
- package/src/hooks/layout.js +25 -110
- package/src/hooks/padding.js +2 -2
- package/src/hooks/position.js +50 -90
- package/src/hooks/style.js +117 -187
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +1 -178
- package/src/hooks/typography.js +20 -16
- package/src/hooks/utils.js +187 -6
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +8 -0
- package/src/store/private-selectors.js +45 -0
- package/src/store/reducer.js +8 -0
- package/src/store/selectors.js +5 -67
- package/src/store/utils.js +74 -0
- package/src/style.scss +1 -3
- package/src/utils/object.js +18 -69
- package/src/utils/selection.js +9 -2
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- 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/block-rename-ui.js +0 -167
- package/build/hooks/block-rename-ui.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/block-rename-ui.js +0 -159
- package/build-module/hooks/block-rename-ui.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/block-rename-ui.js +0 -228
- package/src/hooks/test/color.js +0 -112
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
|
@@ -47,40 +47,6 @@ _Optional._ Called when the block can be removed. `forward` is true when the sel
|
|
|
47
47
|
|
|
48
48
|
## Example
|
|
49
49
|
|
|
50
|
-
{% codetabs %}
|
|
51
|
-
{% ES5 %}
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
wp.blocks.registerBlockType( /* ... */, {
|
|
55
|
-
// ...
|
|
56
|
-
|
|
57
|
-
attributes: {
|
|
58
|
-
content: {
|
|
59
|
-
source: 'html',
|
|
60
|
-
selector: 'div',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
edit: function( props ) {
|
|
65
|
-
return React.createElement( wp.editor.EditableText, {
|
|
66
|
-
className: props.className,
|
|
67
|
-
value: props.attributes.content,
|
|
68
|
-
onChange: function( content ) {
|
|
69
|
-
props.setAttributes( { content: content } );
|
|
70
|
-
}
|
|
71
|
-
} );
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
save: function( props ) {
|
|
75
|
-
return React.createElement( wp.editor.EditableText.Content, {
|
|
76
|
-
value: props.attributes.content
|
|
77
|
-
} );
|
|
78
|
-
}
|
|
79
|
-
} );
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
{% ESNext %}
|
|
83
|
-
|
|
84
50
|
```js
|
|
85
51
|
const { registerBlockType } = wp.blocks;
|
|
86
52
|
const { EditableText } = wp.editor;
|
|
@@ -110,5 +76,3 @@ registerBlockType( /* ... */, {
|
|
|
110
76
|
}
|
|
111
77
|
} );
|
|
112
78
|
```
|
|
113
|
-
|
|
114
|
-
{% end %}
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
__experimentalHStack as HStack,
|
|
13
13
|
__experimentalZStack as ZStack,
|
|
14
14
|
__experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
15
|
-
TabPanel,
|
|
16
15
|
ColorIndicator,
|
|
17
16
|
Flex,
|
|
18
17
|
FlexItem,
|
|
19
18
|
Dropdown,
|
|
20
19
|
Button,
|
|
20
|
+
privateApis as componentsPrivateApis,
|
|
21
21
|
} from '@wordpress/components';
|
|
22
22
|
import { useCallback } from '@wordpress/element';
|
|
23
23
|
import { __, sprintf } from '@wordpress/i18n';
|
|
@@ -29,6 +29,7 @@ import ColorGradientControl from '../colors-gradients/control';
|
|
|
29
29
|
import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
|
|
30
30
|
import { getValueFromVariable } from './utils';
|
|
31
31
|
import { setImmutably } from '../../utils/object';
|
|
32
|
+
import { unlock } from '../../lock-unlock';
|
|
32
33
|
|
|
33
34
|
export function useHasColorPanel( settings ) {
|
|
34
35
|
const hasTextPanel = useHasTextPanel( settings );
|
|
@@ -203,12 +204,11 @@ function ColorPanelDropdown( {
|
|
|
203
204
|
colorGradientControlSettings,
|
|
204
205
|
panelId,
|
|
205
206
|
} ) {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
} );
|
|
207
|
+
const currentTab = tabs.find( ( tab ) => tab.userValue !== undefined );
|
|
208
|
+
// Unlocking `Tabs` too early causes the `unlock` method to receive an empty
|
|
209
|
+
// object, due to circular dependencies.
|
|
210
|
+
// See https://github.com/WordPress/gutenberg/issues/52692
|
|
211
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
212
212
|
|
|
213
213
|
return (
|
|
214
214
|
<ToolsPanelItem
|
|
@@ -258,26 +258,35 @@ function ColorPanelDropdown( {
|
|
|
258
258
|
/>
|
|
259
259
|
) }
|
|
260
260
|
{ tabs.length > 1 && (
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
261
|
+
<Tabs initialTabId={ currentTab?.key }>
|
|
262
|
+
<Tabs.TabList>
|
|
263
|
+
{ tabs.map( ( tab ) => (
|
|
264
|
+
<Tabs.Tab
|
|
265
|
+
key={ tab.key }
|
|
266
|
+
tabId={ tab.key }
|
|
267
|
+
>
|
|
268
|
+
{ tab.label }
|
|
269
|
+
</Tabs.Tab>
|
|
270
|
+
) ) }
|
|
271
|
+
</Tabs.TabList>
|
|
272
|
+
|
|
273
|
+
{ tabs.map( ( tab ) => {
|
|
271
274
|
return (
|
|
272
|
-
<
|
|
273
|
-
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
<Tabs.TabPanel
|
|
276
|
+
key={ tab.key }
|
|
277
|
+
tabId={ tab.key }
|
|
278
|
+
focusable={ false }
|
|
279
|
+
>
|
|
280
|
+
<ColorPanelTab
|
|
281
|
+
{ ...tab }
|
|
282
|
+
colorGradientControlSettings={
|
|
283
|
+
colorGradientControlSettings
|
|
284
|
+
}
|
|
285
|
+
/>
|
|
286
|
+
</Tabs.TabPanel>
|
|
278
287
|
);
|
|
279
|
-
} }
|
|
280
|
-
</
|
|
288
|
+
} ) }
|
|
289
|
+
</Tabs>
|
|
281
290
|
) }
|
|
282
291
|
</div>
|
|
283
292
|
</DropdownContentWrapper>
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
__experimentalItemGroup as ItemGroup,
|
|
13
13
|
__experimentalHStack as HStack,
|
|
14
14
|
__experimentalZStack as ZStack,
|
|
15
|
-
__experimentalVStack as VStack,
|
|
16
15
|
__experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
17
16
|
Button,
|
|
17
|
+
MenuGroup,
|
|
18
18
|
ColorIndicator,
|
|
19
19
|
DuotonePicker,
|
|
20
20
|
DuotoneSwatch,
|
|
@@ -82,6 +82,10 @@ function FiltersToolsPanel( {
|
|
|
82
82
|
label={ _x( 'Filters', 'Name for applying graphical effects' ) }
|
|
83
83
|
resetAll={ resetAll }
|
|
84
84
|
panelId={ panelId }
|
|
85
|
+
dropdownMenuProps={ {
|
|
86
|
+
placement: 'left-start',
|
|
87
|
+
offset: 258, // sidebar width (280px) - button width (24px) + border (2px)
|
|
88
|
+
} }
|
|
85
89
|
>
|
|
86
90
|
{ children }
|
|
87
91
|
</ToolsPanel>
|
|
@@ -197,8 +201,8 @@ export default function FiltersPanel( {
|
|
|
197
201
|
);
|
|
198
202
|
} }
|
|
199
203
|
renderContent={ () => (
|
|
200
|
-
<DropdownContentWrapper paddingSize="
|
|
201
|
-
<
|
|
204
|
+
<DropdownContentWrapper paddingSize="small">
|
|
205
|
+
<MenuGroup label={ __( 'Duotone' ) }>
|
|
202
206
|
<p>
|
|
203
207
|
{ __(
|
|
204
208
|
'Create a two-tone color effect without losing your original image.'
|
|
@@ -213,7 +217,7 @@ export default function FiltersPanel( {
|
|
|
213
217
|
value={ duotone }
|
|
214
218
|
onChange={ setDuotone }
|
|
215
219
|
/>
|
|
216
|
-
</
|
|
220
|
+
</MenuGroup>
|
|
217
221
|
</DropdownContentWrapper>
|
|
218
222
|
) }
|
|
219
223
|
/>
|
|
@@ -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';
|
|
@@ -51,25 +52,14 @@ export function useHasTypographyPanel( settings ) {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function useHasFontSizeControl( settings ) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.concat( fontSizesPerOrigin?.theme ?? [] )
|
|
59
|
-
.concat( fontSizesPerOrigin.default ?? [] );
|
|
60
|
-
return !! fontSizes?.length || ! disableCustomFontSizes;
|
|
55
|
+
return (
|
|
56
|
+
hasMergedOrigins( settings?.typography?.fontSizes ) ||
|
|
57
|
+
settings?.typography?.customFontSize
|
|
58
|
+
);
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
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;
|
|
62
|
+
return hasMergedOrigins( settings?.typography?.fontFamilies );
|
|
73
63
|
}
|
|
74
64
|
|
|
75
65
|
function useHasLineHeightControl( settings ) {
|
|
@@ -77,18 +67,14 @@ function useHasLineHeightControl( settings ) {
|
|
|
77
67
|
}
|
|
78
68
|
|
|
79
69
|
function useHasAppearanceControl( settings ) {
|
|
80
|
-
|
|
81
|
-
const hasFontWeights = settings?.typography?.fontWeight;
|
|
82
|
-
return hasFontStyles || hasFontWeights;
|
|
70
|
+
return settings?.typography?.fontStyle || settings?.typography?.fontWeight;
|
|
83
71
|
}
|
|
84
72
|
|
|
85
73
|
function useAppearanceControlLabel( settings ) {
|
|
86
|
-
|
|
87
|
-
const hasFontWeights = settings?.typography?.fontWeight;
|
|
88
|
-
if ( ! hasFontStyles ) {
|
|
74
|
+
if ( ! settings?.typography?.fontStyle ) {
|
|
89
75
|
return __( 'Font weight' );
|
|
90
76
|
}
|
|
91
|
-
if ( !
|
|
77
|
+
if ( ! settings?.typography?.fontWeight ) {
|
|
92
78
|
return __( 'Font style' );
|
|
93
79
|
}
|
|
94
80
|
return __( 'Appearance' );
|
|
@@ -115,18 +101,15 @@ function useHasTextColumnsControl( settings ) {
|
|
|
115
101
|
}
|
|
116
102
|
|
|
117
103
|
function getUniqueFontSizesBySlug( settings ) {
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.
|
|
123
|
-
|
|
124
|
-
return fontSizes.reduce( ( acc, currentSize ) => {
|
|
125
|
-
if ( ! acc.some( ( { slug } ) => slug === currentSize.slug ) ) {
|
|
126
|
-
acc.push( currentSize );
|
|
104
|
+
const fontSizes = settings?.typography?.fontSizes;
|
|
105
|
+
const mergedFontSizes = fontSizes ? mergeOrigins( fontSizes ) : [];
|
|
106
|
+
const uniqueSizes = [];
|
|
107
|
+
for ( const currentSize of mergedFontSizes ) {
|
|
108
|
+
if ( ! uniqueSizes.some( ( { slug } ) => slug === currentSize.slug ) ) {
|
|
109
|
+
uniqueSizes.push( currentSize );
|
|
127
110
|
}
|
|
128
|
-
|
|
129
|
-
|
|
111
|
+
}
|
|
112
|
+
return uniqueSizes;
|
|
130
113
|
}
|
|
131
114
|
|
|
132
115
|
function TypographyToolsPanel( {
|
|
@@ -178,14 +161,11 @@ export default function TypographyPanel( {
|
|
|
178
161
|
|
|
179
162
|
// Font Family
|
|
180
163
|
const hasFontFamilyEnabled = useHasFontFamilyControl( settings );
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
.concat( fontFamiliesPerOrigin?.custom ?? [] )
|
|
184
|
-
.concat( fontFamiliesPerOrigin?.theme ?? [] )
|
|
185
|
-
.concat( fontFamiliesPerOrigin?.default ?? [] );
|
|
164
|
+
const fontFamilies = settings?.typography?.fontFamilies;
|
|
165
|
+
const mergedFontFamilies = fontFamilies ? mergeOrigins( fontFamilies ) : [];
|
|
186
166
|
const fontFamily = decodeValue( inheritedValue?.typography?.fontFamily );
|
|
187
167
|
const setFontFamily = ( newValue ) => {
|
|
188
|
-
const slug =
|
|
168
|
+
const slug = mergedFontFamilies?.find(
|
|
189
169
|
( { fontFamily: f } ) => f === newValue
|
|
190
170
|
)?.slug;
|
|
191
171
|
onChange(
|
|
@@ -204,7 +184,7 @@ export default function TypographyPanel( {
|
|
|
204
184
|
// Font Size
|
|
205
185
|
const hasFontSizeEnabled = useHasFontSizeControl( settings );
|
|
206
186
|
const disableCustomFontSizes = ! settings?.typography?.customFontSize;
|
|
207
|
-
const
|
|
187
|
+
const mergedFontSizes = getUniqueFontSizesBySlug( settings );
|
|
208
188
|
|
|
209
189
|
const fontSize = decodeValue( inheritedValue?.typography?.fontSize );
|
|
210
190
|
const setFontSize = ( newValue, metadata ) => {
|
|
@@ -368,7 +348,7 @@ export default function TypographyPanel( {
|
|
|
368
348
|
panelId={ panelId }
|
|
369
349
|
>
|
|
370
350
|
<FontFamilyControl
|
|
371
|
-
fontFamilies={
|
|
351
|
+
fontFamilies={ mergedFontFamilies }
|
|
372
352
|
value={ fontFamily }
|
|
373
353
|
onChange={ setFontFamily }
|
|
374
354
|
size="__unstable-large"
|
|
@@ -387,7 +367,7 @@ export default function TypographyPanel( {
|
|
|
387
367
|
<FontSizePicker
|
|
388
368
|
value={ fontSize }
|
|
389
369
|
onChange={ setFontSize }
|
|
390
|
-
fontSizes={
|
|
370
|
+
fontSizes={ mergedFontSizes }
|
|
391
371
|
disableCustomFontSizes={ disableCustomFontSizes }
|
|
392
372
|
withReset={ false }
|
|
393
373
|
withSlider
|
|
@@ -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;
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
__experimentalNumberControl as NumberControl,
|
|
9
9
|
__experimentalHStack as HStack,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
|
-
import deprecated from '@wordpress/deprecated';
|
|
12
11
|
import { __ } from '@wordpress/i18n';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -31,11 +30,6 @@ export default function ImageSizeControl( {
|
|
|
31
30
|
onChange,
|
|
32
31
|
onChangeImage = noop,
|
|
33
32
|
} ) {
|
|
34
|
-
deprecated( 'wp.blockEditor.__experimentalImageSizeControl', {
|
|
35
|
-
since: '6.3',
|
|
36
|
-
alternative:
|
|
37
|
-
'wp.blockEditor.privateApis.DimensionsTool and wp.blockEditor.privateApis.ResolutionTool',
|
|
38
|
-
} );
|
|
39
33
|
const { currentHeight, currentWidth, updateDimension, updateDimensions } =
|
|
40
34
|
useDimensionHandler( height, width, imageHeight, imageWidth, onChange );
|
|
41
35
|
|
|
@@ -90,6 +90,7 @@ export { default as BlockStyles } from './block-styles';
|
|
|
90
90
|
export { default as DefaultBlockAppender } from './default-block-appender';
|
|
91
91
|
export { default as __unstableEditorStyles } from './editor-styles';
|
|
92
92
|
export { default as Inserter } from './inserter';
|
|
93
|
+
export { default as InserterButton } from './inserter-button';
|
|
93
94
|
export { useBlockProps } from './block-list/use-block-props';
|
|
94
95
|
export { default as FloatingToolbar } from './floating-toolbar';
|
|
95
96
|
|
|
@@ -188,8 +188,19 @@ For example, a button block, deeply nested in several levels of block `X` that u
|
|
|
188
188
|
|
|
189
189
|
### `defaultBlock`
|
|
190
190
|
|
|
191
|
-
- **Type:** `
|
|
192
|
-
- **Default:** - `undefined
|
|
191
|
+
- **Type:** `Object`
|
|
192
|
+
- **Default:** - `undefined`
|
|
193
|
+
|
|
194
|
+
Determines which block type should be inserted by default and any attributes that should be set by default when the block is inserted. Takes an object in the form of `{ name: blockname, attributes: {blockAttributes} }`.
|
|
195
|
+
|
|
196
|
+
```jsx
|
|
197
|
+
const DEFAULT_BLOCK = { name: 'core/paragraph', attributes: { content: 'Lorem ipsum...' } };
|
|
198
|
+
...
|
|
199
|
+
<InnerBlocks
|
|
200
|
+
defaultBlock={ DEFAULT_BLOCK }
|
|
201
|
+
directInsert={ true }
|
|
202
|
+
/>
|
|
203
|
+
```
|
|
193
204
|
|
|
194
205
|
### `directInsert`
|
|
195
206
|
|
|
@@ -169,8 +169,11 @@ const ForwardedInnerBlocks = forwardRef( ( props, ref ) => {
|
|
|
169
169
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
|
|
170
170
|
*/
|
|
171
171
|
export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
172
|
-
const {
|
|
173
|
-
|
|
172
|
+
const {
|
|
173
|
+
__unstableDisableLayoutClassNames,
|
|
174
|
+
__unstableDisableDropZone,
|
|
175
|
+
dropZoneElement,
|
|
176
|
+
} = options;
|
|
174
177
|
const {
|
|
175
178
|
clientId,
|
|
176
179
|
layout = null,
|
|
@@ -211,6 +214,7 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
|
|
|
211
214
|
);
|
|
212
215
|
|
|
213
216
|
const blockDropZoneRef = useBlockDropZone( {
|
|
217
|
+
dropZoneElement,
|
|
214
218
|
rootClientId: clientId,
|
|
215
219
|
} );
|
|
216
220
|
|