@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
|
@@ -10,7 +10,12 @@ import {
|
|
|
10
10
|
getBlockOrder,
|
|
11
11
|
getBlockParents,
|
|
12
12
|
getBlockEditingMode,
|
|
13
|
+
getSettings,
|
|
14
|
+
__experimentalGetParsedPattern,
|
|
15
|
+
canInsertBlockType,
|
|
16
|
+
__experimentalGetAllowedPatterns,
|
|
13
17
|
} from './selectors';
|
|
18
|
+
import { getUserPatterns, checkAllowListRecursive } from './utils';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Returns true if the block interface is hidden, or false otherwise.
|
|
@@ -236,3 +241,54 @@ export const getInserterMediaCategories = createSelector(
|
|
|
236
241
|
state.registeredInserterMediaCategories,
|
|
237
242
|
]
|
|
238
243
|
);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Returns whether there is at least one allowed pattern for inner blocks children.
|
|
247
|
+
* This is useful for deferring the parsing of all patterns until needed.
|
|
248
|
+
*
|
|
249
|
+
* @param {Object} state Editor state.
|
|
250
|
+
* @param {string} [rootClientId=null] Target root client ID.
|
|
251
|
+
*
|
|
252
|
+
* @return {boolean} If there is at least one allowed pattern.
|
|
253
|
+
*/
|
|
254
|
+
export const hasAllowedPatterns = createSelector(
|
|
255
|
+
( state, rootClientId = null ) => {
|
|
256
|
+
const patterns = state.settings.__experimentalBlockPatterns;
|
|
257
|
+
const userPatterns = getUserPatterns( state );
|
|
258
|
+
const { allowedBlockTypes } = getSettings( state );
|
|
259
|
+
return [ ...userPatterns, ...patterns ].some(
|
|
260
|
+
( { name, inserter = true } ) => {
|
|
261
|
+
if ( ! inserter ) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
const { blocks } = __experimentalGetParsedPattern(
|
|
265
|
+
state,
|
|
266
|
+
name
|
|
267
|
+
);
|
|
268
|
+
return (
|
|
269
|
+
checkAllowListRecursive( blocks, allowedBlockTypes ) &&
|
|
270
|
+
blocks.every( ( { name: blockName } ) =>
|
|
271
|
+
canInsertBlockType( state, blockName, rootClientId )
|
|
272
|
+
)
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
( state, rootClientId ) => [
|
|
278
|
+
...__experimentalGetAllowedPatterns.getDependants(
|
|
279
|
+
state,
|
|
280
|
+
rootClientId
|
|
281
|
+
),
|
|
282
|
+
]
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Returns the element of the last element that had focus when focus left the editor canvas.
|
|
287
|
+
*
|
|
288
|
+
* @param {Object} state Block editor state.
|
|
289
|
+
*
|
|
290
|
+
* @return {Object} Element.
|
|
291
|
+
*/
|
|
292
|
+
export function getLastFocus( state ) {
|
|
293
|
+
return state.lastFocus;
|
|
294
|
+
}
|
package/src/store/reducer.js
CHANGED
|
@@ -283,6 +283,7 @@ const withBlockTree =
|
|
|
283
283
|
false
|
|
284
284
|
);
|
|
285
285
|
break;
|
|
286
|
+
case 'SYNC_DERIVED_BLOCK_ATTRIBUTES':
|
|
286
287
|
case 'UPDATE_BLOCK_ATTRIBUTES': {
|
|
287
288
|
newState.tree = new Map( newState.tree );
|
|
288
289
|
action.clientIds.forEach( ( clientId ) => {
|
|
@@ -452,10 +453,27 @@ const withBlockTree =
|
|
|
452
453
|
function withPersistentBlockChange( reducer ) {
|
|
453
454
|
let lastAction;
|
|
454
455
|
let markNextChangeAsNotPersistent = false;
|
|
456
|
+
let explicitPersistent;
|
|
455
457
|
|
|
456
458
|
return ( state, action ) => {
|
|
457
459
|
let nextState = reducer( state, action );
|
|
458
460
|
|
|
461
|
+
let nextIsPersistentChange;
|
|
462
|
+
if ( action.type === 'SET_EXPLICIT_PERSISTENT' ) {
|
|
463
|
+
explicitPersistent = action.isPersistentChange;
|
|
464
|
+
nextIsPersistentChange = state.isPersistentChange ?? true;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
if ( explicitPersistent !== undefined ) {
|
|
468
|
+
nextIsPersistentChange = explicitPersistent;
|
|
469
|
+
return nextIsPersistentChange === nextState.isPersistentChange
|
|
470
|
+
? nextState
|
|
471
|
+
: {
|
|
472
|
+
...nextState,
|
|
473
|
+
isPersistentChange: nextIsPersistentChange,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
459
477
|
const isExplicitPersistentChange =
|
|
460
478
|
action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' ||
|
|
461
479
|
markNextChangeAsNotPersistent;
|
|
@@ -466,7 +484,7 @@ function withPersistentBlockChange( reducer ) {
|
|
|
466
484
|
markNextChangeAsNotPersistent =
|
|
467
485
|
action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT';
|
|
468
486
|
|
|
469
|
-
|
|
487
|
+
nextIsPersistentChange = state?.isPersistentChange ?? true;
|
|
470
488
|
if ( state.isPersistentChange === nextIsPersistentChange ) {
|
|
471
489
|
return state;
|
|
472
490
|
}
|
|
@@ -860,6 +878,7 @@ export const blocks = pipe(
|
|
|
860
878
|
return newState;
|
|
861
879
|
}
|
|
862
880
|
|
|
881
|
+
case 'SYNC_DERIVED_BLOCK_ATTRIBUTES':
|
|
863
882
|
case 'UPDATE_BLOCK_ATTRIBUTES': {
|
|
864
883
|
// Avoid a state change if none of the block IDs are known.
|
|
865
884
|
if ( action.clientIds.every( ( id ) => ! state.get( id ) ) ) {
|
package/src/store/selectors.js
CHANGED
|
@@ -26,8 +26,12 @@ import { createRegistrySelector } from '@wordpress/data';
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
+
import {
|
|
30
|
+
getUserPatterns,
|
|
31
|
+
checkAllowListRecursive,
|
|
32
|
+
checkAllowList,
|
|
33
|
+
} from './utils';
|
|
29
34
|
import { orderBy } from '../utils/sorting';
|
|
30
|
-
import { PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';
|
|
31
35
|
|
|
32
36
|
/**
|
|
33
37
|
* A block selection object.
|
|
@@ -1481,22 +1485,6 @@ export function getTemplateLock( state, rootClientId ) {
|
|
|
1481
1485
|
return getBlockListSettings( state, rootClientId )?.templateLock ?? false;
|
|
1482
1486
|
}
|
|
1483
1487
|
|
|
1484
|
-
const checkAllowList = ( list, item, defaultResult = null ) => {
|
|
1485
|
-
if ( typeof list === 'boolean' ) {
|
|
1486
|
-
return list;
|
|
1487
|
-
}
|
|
1488
|
-
if ( Array.isArray( list ) ) {
|
|
1489
|
-
// TODO: when there is a canonical way to detect that we are editing a post
|
|
1490
|
-
// the following check should be changed to something like:
|
|
1491
|
-
// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )
|
|
1492
|
-
if ( list.includes( 'core/post-content' ) && item === null ) {
|
|
1493
|
-
return true;
|
|
1494
|
-
}
|
|
1495
|
-
return list.includes( item );
|
|
1496
|
-
}
|
|
1497
|
-
return defaultResult;
|
|
1498
|
-
};
|
|
1499
|
-
|
|
1500
1488
|
/**
|
|
1501
1489
|
* Determines if the given block type is allowed to be inserted into the block list.
|
|
1502
1490
|
* This function is not exported and not memoized because using a memoized selector
|
|
@@ -2249,58 +2237,6 @@ export const __experimentalGetDirectInsertBlock = createSelector(
|
|
|
2249
2237
|
]
|
|
2250
2238
|
);
|
|
2251
2239
|
|
|
2252
|
-
const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {
|
|
2253
|
-
if ( typeof allowedBlockTypes === 'boolean' ) {
|
|
2254
|
-
return allowedBlockTypes;
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
const blocksQueue = [ ...blocks ];
|
|
2258
|
-
while ( blocksQueue.length > 0 ) {
|
|
2259
|
-
const block = blocksQueue.shift();
|
|
2260
|
-
|
|
2261
|
-
const isAllowed = checkAllowList(
|
|
2262
|
-
allowedBlockTypes,
|
|
2263
|
-
block.name || block.blockName,
|
|
2264
|
-
true
|
|
2265
|
-
);
|
|
2266
|
-
if ( ! isAllowed ) {
|
|
2267
|
-
return false;
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
block.innerBlocks?.forEach( ( innerBlock ) => {
|
|
2271
|
-
blocksQueue.push( innerBlock );
|
|
2272
|
-
} );
|
|
2273
|
-
}
|
|
2274
|
-
|
|
2275
|
-
return true;
|
|
2276
|
-
};
|
|
2277
|
-
|
|
2278
|
-
function getUserPatterns( state ) {
|
|
2279
|
-
const userPatterns =
|
|
2280
|
-
state?.settings?.__experimentalReusableBlocks ?? EMPTY_ARRAY;
|
|
2281
|
-
const userPatternCategories =
|
|
2282
|
-
state?.settings?.__experimentalUserPatternCategories ?? [];
|
|
2283
|
-
const categories = new Map();
|
|
2284
|
-
userPatternCategories.forEach( ( userCategory ) =>
|
|
2285
|
-
categories.set( userCategory.id, userCategory )
|
|
2286
|
-
);
|
|
2287
|
-
return userPatterns.map( ( userPattern ) => {
|
|
2288
|
-
return {
|
|
2289
|
-
name: `core/block/${ userPattern.id }`,
|
|
2290
|
-
id: userPattern.id,
|
|
2291
|
-
type: PATTERN_TYPES.user,
|
|
2292
|
-
title: userPattern.title.raw,
|
|
2293
|
-
categories: userPattern.wp_pattern_category.map( ( catId ) =>
|
|
2294
|
-
categories && categories.get( catId )
|
|
2295
|
-
? categories.get( catId ).slug
|
|
2296
|
-
: catId
|
|
2297
|
-
),
|
|
2298
|
-
content: userPattern.content.raw,
|
|
2299
|
-
syncStatus: userPattern.wp_pattern_sync_status,
|
|
2300
|
-
};
|
|
2301
|
-
} );
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
2240
|
export const __experimentalUserPatternCategories = createSelector(
|
|
2305
2241
|
( state ) => {
|
|
2306
2242
|
return state?.settings?.__experimentalUserPatternCategories;
|
|
@@ -2806,8 +2742,11 @@ export const __unstableGetContentLockingParent = createSelector(
|
|
|
2806
2742
|
while ( state.blocks.parents.has( current ) ) {
|
|
2807
2743
|
current = state.blocks.parents.get( current );
|
|
2808
2744
|
if (
|
|
2809
|
-
current &&
|
|
2810
|
-
|
|
2745
|
+
( current &&
|
|
2746
|
+
getBlockName( state, current ) === 'core/block' &&
|
|
2747
|
+
window.__experimentalPatternPartialSyncing ) ||
|
|
2748
|
+
( current &&
|
|
2749
|
+
getTemplateLock( state, current ) === 'contentOnly' )
|
|
2811
2750
|
) {
|
|
2812
2751
|
result = current;
|
|
2813
2752
|
}
|
|
@@ -3007,14 +2946,3 @@ export const isGroupable = createRegistrySelector(
|
|
|
3007
2946
|
);
|
|
3008
2947
|
}
|
|
3009
2948
|
);
|
|
3010
|
-
|
|
3011
|
-
/**
|
|
3012
|
-
* Returns the element of the last element that had focus when focus left the editor canvas.
|
|
3013
|
-
*
|
|
3014
|
-
* @param {Object} state Block editor state.
|
|
3015
|
-
*
|
|
3016
|
-
* @return {Object} Element.
|
|
3017
|
-
*/
|
|
3018
|
-
export function getLastFocus( state ) {
|
|
3019
|
-
return state.lastFocus;
|
|
3020
|
-
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';
|
|
5
|
+
|
|
6
|
+
const EMPTY_ARRAY = [];
|
|
7
|
+
|
|
8
|
+
export function getUserPatterns( state ) {
|
|
9
|
+
const userPatterns =
|
|
10
|
+
state?.settings?.__experimentalReusableBlocks ?? EMPTY_ARRAY;
|
|
11
|
+
const userPatternCategories =
|
|
12
|
+
state?.settings?.__experimentalUserPatternCategories ?? [];
|
|
13
|
+
const categories = new Map();
|
|
14
|
+
userPatternCategories.forEach( ( userCategory ) =>
|
|
15
|
+
categories.set( userCategory.id, userCategory )
|
|
16
|
+
);
|
|
17
|
+
return userPatterns.map( ( userPattern ) => {
|
|
18
|
+
return {
|
|
19
|
+
name: `core/block/${ userPattern.id }`,
|
|
20
|
+
id: userPattern.id,
|
|
21
|
+
type: INSERTER_PATTERN_TYPES.user,
|
|
22
|
+
title: userPattern.title.raw,
|
|
23
|
+
categories: userPattern.wp_pattern_category.map( ( catId ) =>
|
|
24
|
+
categories && categories.get( catId )
|
|
25
|
+
? categories.get( catId ).slug
|
|
26
|
+
: catId
|
|
27
|
+
),
|
|
28
|
+
content: userPattern.content.raw,
|
|
29
|
+
syncStatus: userPattern.wp_pattern_sync_status,
|
|
30
|
+
};
|
|
31
|
+
} );
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const checkAllowList = ( list, item, defaultResult = null ) => {
|
|
35
|
+
if ( typeof list === 'boolean' ) {
|
|
36
|
+
return list;
|
|
37
|
+
}
|
|
38
|
+
if ( Array.isArray( list ) ) {
|
|
39
|
+
// TODO: when there is a canonical way to detect that we are editing a post
|
|
40
|
+
// the following check should be changed to something like:
|
|
41
|
+
// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )
|
|
42
|
+
if ( list.includes( 'core/post-content' ) && item === null ) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return list.includes( item );
|
|
46
|
+
}
|
|
47
|
+
return defaultResult;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {
|
|
51
|
+
if ( typeof allowedBlockTypes === 'boolean' ) {
|
|
52
|
+
return allowedBlockTypes;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const blocksQueue = [ ...blocks ];
|
|
56
|
+
while ( blocksQueue.length > 0 ) {
|
|
57
|
+
const block = blocksQueue.shift();
|
|
58
|
+
|
|
59
|
+
const isAllowed = checkAllowList(
|
|
60
|
+
allowedBlockTypes,
|
|
61
|
+
block.name || block.blockName,
|
|
62
|
+
true
|
|
63
|
+
);
|
|
64
|
+
if ( ! isAllowed ) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
block.innerBlocks?.forEach( ( innerBlock ) => {
|
|
69
|
+
blocksQueue.push( innerBlock );
|
|
70
|
+
} );
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return true;
|
|
74
|
+
};
|
package/src/style.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import "./autocompleters/style.scss";
|
|
2
2
|
@import "./components/block-alignment-control/style.scss";
|
|
3
|
+
@import "./components/block-canvas/style.scss";
|
|
3
4
|
@import "./components/block-icon/style.scss";
|
|
4
5
|
@import "./components/block-inspector/style.scss";
|
|
5
6
|
@import "./components/block-tools/style.scss";
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
@import "./components/block-draggable/style.scss";
|
|
11
12
|
@import "./components/block-mover/style.scss";
|
|
12
13
|
@import "./components/block-navigation/style.scss";
|
|
13
|
-
@import "./components/block-parent-selector/style.scss";
|
|
14
14
|
@import "./components/block-patterns-list/style.scss";
|
|
15
15
|
@import "./components/block-patterns-paging/style.scss";
|
|
16
16
|
@import "./components/block-popover/style.scss";
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
|
|
61
61
|
@import "./components/block-toolbar/style.scss";
|
|
62
62
|
@import "./components/inserter/style.scss";
|
|
63
|
-
@import "./components/preview-options/style.scss";
|
|
64
63
|
@import "./components/spacing-sizes-control/style.scss";
|
|
65
64
|
|
|
66
65
|
@include wordpress-admin-schemes();
|
package/src/utils/index.js
CHANGED
package/src/utils/object.js
CHANGED
|
@@ -1,87 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { paramCase } from 'change-case';
|
|
5
|
-
import memoize from 'memize';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Converts a path to an array of its fragments.
|
|
9
|
-
* Supports strings, numbers and arrays:
|
|
10
|
-
*
|
|
11
|
-
* 'foo' => [ 'foo' ]
|
|
12
|
-
* 2 => [ '2' ]
|
|
13
|
-
* [ 'foo', 'bar' ] => [ 'foo', 'bar' ]
|
|
14
|
-
*
|
|
15
|
-
* @param {string|number|Array} path Path
|
|
16
|
-
* @return {Array} Normalized path.
|
|
17
|
-
*/
|
|
18
|
-
function normalizePath( path ) {
|
|
19
|
-
if ( Array.isArray( path ) ) {
|
|
20
|
-
return path;
|
|
21
|
-
} else if ( typeof path === 'number' ) {
|
|
22
|
-
return [ path.toString() ];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return [ path ];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Converts any string to kebab case.
|
|
30
|
-
* Backwards compatible with Lodash's `_.kebabCase()`.
|
|
31
|
-
* Backwards compatible with `_wp_to_kebab_case()`.
|
|
32
|
-
*
|
|
33
|
-
* @see https://lodash.com/docs/4.17.15#kebabCase
|
|
34
|
-
* @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/
|
|
35
|
-
*
|
|
36
|
-
* @param {string} str String to convert.
|
|
37
|
-
* @return {string} Kebab-cased string
|
|
38
|
-
*/
|
|
39
|
-
export function kebabCase( str ) {
|
|
40
|
-
let input = str;
|
|
41
|
-
if ( typeof str !== 'string' ) {
|
|
42
|
-
input = str?.toString?.() ?? '';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// See https://github.com/lodash/lodash/blob/b185fcee26b2133bd071f4aaca14b455c2ed1008/lodash.js#L4970
|
|
46
|
-
input = input.replace( /['\u2019]/, '' );
|
|
47
|
-
|
|
48
|
-
return paramCase( input, {
|
|
49
|
-
splitRegexp: [
|
|
50
|
-
/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar
|
|
51
|
-
/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, // 3bar => 3-bar
|
|
52
|
-
/([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3
|
|
53
|
-
/([A-Z])([A-Z][a-z])/g, // FOOBar => foo-bar
|
|
54
|
-
],
|
|
55
|
-
} );
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Clones an object.
|
|
60
|
-
* Arrays are also cloned as arrays.
|
|
61
|
-
* Non-object values are returned unchanged.
|
|
62
|
-
*
|
|
63
|
-
* @param {*} object Object to clone.
|
|
64
|
-
* @return {*} Cloned object, or original literal non-object value.
|
|
65
|
-
*/
|
|
66
|
-
function cloneObject( object ) {
|
|
67
|
-
if ( Array.isArray( object ) ) {
|
|
68
|
-
return object.map( cloneObject );
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if ( object && typeof object === 'object' ) {
|
|
72
|
-
return {
|
|
73
|
-
...Object.fromEntries(
|
|
74
|
-
Object.entries( object ).map( ( [ key, value ] ) => [
|
|
75
|
-
key,
|
|
76
|
-
cloneObject( value ),
|
|
77
|
-
] )
|
|
78
|
-
),
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return object;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
1
|
/**
|
|
86
2
|
* Immutably sets a value inside an object. Like `lodash#set`, but returning a
|
|
87
3
|
* new object. Treats nullish initial values as empty objects. Clones any
|
|
@@ -93,27 +9,25 @@ function cloneObject( object ) {
|
|
|
93
9
|
* @return {Object} Cloned object with the new value set.
|
|
94
10
|
*/
|
|
95
11
|
export function setImmutably( object, path, value ) {
|
|
96
|
-
|
|
97
|
-
|
|
12
|
+
// Normalize path
|
|
13
|
+
path = Array.isArray( path ) ? [ ...path ] : [ path ];
|
|
98
14
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if ( Number.isInteger( path[ i + 1 ] ) ) {
|
|
102
|
-
acc[ key ] = [];
|
|
103
|
-
} else {
|
|
104
|
-
acc[ key ] = {};
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if ( i === normalizedPath.length - 1 ) {
|
|
108
|
-
acc[ key ] = value;
|
|
109
|
-
}
|
|
110
|
-
return acc[ key ];
|
|
111
|
-
}, newObject );
|
|
15
|
+
// Shallowly clone the base of the object
|
|
16
|
+
object = Array.isArray( object ) ? [ ...object ] : { ...object };
|
|
112
17
|
|
|
113
|
-
|
|
114
|
-
|
|
18
|
+
const leaf = path.pop();
|
|
19
|
+
|
|
20
|
+
// Traverse object from root to leaf, shallowly cloning at each level
|
|
21
|
+
let prev = object;
|
|
22
|
+
for ( const key of path ) {
|
|
23
|
+
const lvl = prev[ key ];
|
|
24
|
+
prev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
prev[ leaf ] = value;
|
|
115
28
|
|
|
116
|
-
|
|
29
|
+
return object;
|
|
30
|
+
}
|
|
117
31
|
|
|
118
32
|
/**
|
|
119
33
|
* Helper util to return a value from a certain path of the object.
|
|
@@ -128,10 +42,26 @@ const stringToPath = memoize( ( path ) => path.split( '.' ) );
|
|
|
128
42
|
* @return {*} Value of the object property at the specified path.
|
|
129
43
|
*/
|
|
130
44
|
export const getValueFromObjectPath = ( object, path, defaultValue ) => {
|
|
131
|
-
const
|
|
45
|
+
const arrayPath = Array.isArray( path ) ? path : path.split( '.' );
|
|
132
46
|
let value = object;
|
|
133
|
-
|
|
47
|
+
arrayPath.forEach( ( fieldName ) => {
|
|
134
48
|
value = value?.[ fieldName ];
|
|
135
49
|
} );
|
|
136
50
|
return value ?? defaultValue;
|
|
137
51
|
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Helper util to filter out objects with duplicate values for a given property.
|
|
55
|
+
*
|
|
56
|
+
* @param {Object[]} array Array of objects to filter.
|
|
57
|
+
* @param {string} property Property to filter unique values by.
|
|
58
|
+
*
|
|
59
|
+
* @return {Object[]} Array of objects with unique values for the specified property.
|
|
60
|
+
*/
|
|
61
|
+
export function uniqByProperty( array, property ) {
|
|
62
|
+
const seen = new Set();
|
|
63
|
+
return array.filter( ( item ) => {
|
|
64
|
+
const value = item[ property ];
|
|
65
|
+
return seen.has( value ) ? false : seen.add( value );
|
|
66
|
+
} );
|
|
67
|
+
}
|
package/src/utils/selection.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { RichTextData } from '@wordpress/rich-text';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* A robust way to retain selection position through various
|
|
3
8
|
* transforms is to insert a special character at the position and
|
|
@@ -19,8 +24,10 @@ export function retrieveSelectedAttribute( blockAttributes ) {
|
|
|
19
24
|
return Object.keys( blockAttributes ).find( ( name ) => {
|
|
20
25
|
const value = blockAttributes[ name ];
|
|
21
26
|
return (
|
|
22
|
-
typeof value === 'string' &&
|
|
23
|
-
|
|
27
|
+
( typeof value === 'string' || value instanceof RichTextData ) &&
|
|
28
|
+
// To do: refactor this to use rich text's selection instead, so we
|
|
29
|
+
// no longer have to use on this hack inserting a special character.
|
|
30
|
+
value.toString().indexOf( START_OF_SELECTED_AREA ) !== -1
|
|
24
31
|
);
|
|
25
32
|
} );
|
|
26
33
|
}
|
package/src/utils/test/object.js
CHANGED
|
@@ -1,102 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
describe( 'kebabCase', () => {
|
|
7
|
-
it( 'separates lowercase letters, followed by uppercase letters', () => {
|
|
8
|
-
expect( kebabCase( 'fooBar' ) ).toEqual( 'foo-bar' );
|
|
9
|
-
} );
|
|
10
|
-
|
|
11
|
-
it( 'separates numbers, followed by uppercase letters', () => {
|
|
12
|
-
expect( kebabCase( '123FOO' ) ).toEqual( '123-foo' );
|
|
13
|
-
} );
|
|
14
|
-
|
|
15
|
-
it( 'separates numbers, followed by lowercase characters', () => {
|
|
16
|
-
expect( kebabCase( '123bar' ) ).toEqual( '123-bar' );
|
|
17
|
-
} );
|
|
18
|
-
|
|
19
|
-
it( 'separates uppercase letters, followed by numbers', () => {
|
|
20
|
-
expect( kebabCase( 'FOO123' ) ).toEqual( 'foo-123' );
|
|
21
|
-
} );
|
|
22
|
-
|
|
23
|
-
it( 'separates lowercase letters, followed by numbers', () => {
|
|
24
|
-
expect( kebabCase( 'foo123' ) ).toEqual( 'foo-123' );
|
|
25
|
-
} );
|
|
26
|
-
|
|
27
|
-
it( 'separates uppercase groups from capitalized groups', () => {
|
|
28
|
-
expect( kebabCase( 'FOOBar' ) ).toEqual( 'foo-bar' );
|
|
29
|
-
} );
|
|
30
|
-
|
|
31
|
-
it( 'removes any non-dash special characters', () => {
|
|
32
|
-
expect(
|
|
33
|
-
kebabCase( 'foo±§!@#$%^&*()-_=+/?.>,<\\|{}[]`~\'";:bar' )
|
|
34
|
-
).toEqual( 'foo-bar' );
|
|
35
|
-
} );
|
|
36
|
-
|
|
37
|
-
it( 'removes any spacing characters', () => {
|
|
38
|
-
expect( kebabCase( ' foo \t \n \r \f \v bar ' ) ).toEqual( 'foo-bar' );
|
|
39
|
-
} );
|
|
40
|
-
|
|
41
|
-
it( 'groups multiple dashes into a single one', () => {
|
|
42
|
-
expect( kebabCase( 'foo---bar' ) ).toEqual( 'foo-bar' );
|
|
43
|
-
} );
|
|
44
|
-
|
|
45
|
-
it( 'returns an empty string unchanged', () => {
|
|
46
|
-
expect( kebabCase( '' ) ).toEqual( '' );
|
|
47
|
-
} );
|
|
48
|
-
|
|
49
|
-
it( 'returns an existing kebab case string unchanged', () => {
|
|
50
|
-
expect( kebabCase( 'foo-123-bar' ) ).toEqual( 'foo-123-bar' );
|
|
51
|
-
} );
|
|
52
|
-
|
|
53
|
-
it( 'returns an empty string if any nullish type is passed', () => {
|
|
54
|
-
expect( kebabCase( undefined ) ).toEqual( '' );
|
|
55
|
-
expect( kebabCase( null ) ).toEqual( '' );
|
|
56
|
-
} );
|
|
57
|
-
|
|
58
|
-
it( 'converts any unexpected non-nullish type to a string', () => {
|
|
59
|
-
expect( kebabCase( 12345 ) ).toEqual( '12345' );
|
|
60
|
-
expect( kebabCase( [] ) ).toEqual( '' );
|
|
61
|
-
expect( kebabCase( {} ) ).toEqual( 'object-object' );
|
|
62
|
-
} );
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Should cover all test cases of `_wp_to_kebab_case()`.
|
|
66
|
-
*
|
|
67
|
-
* @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/
|
|
68
|
-
* @see https://github.com/WordPress/wordpress-develop/blob/76376fdbc3dc0b3261de377dffc350677345e7ba/tests/phpunit/tests/functions/wpToKebabCase.php#L35-L62
|
|
69
|
-
*/
|
|
70
|
-
it.each( [
|
|
71
|
-
[ 'white', 'white' ],
|
|
72
|
-
[ 'white+black', 'white-black' ],
|
|
73
|
-
[ 'white:black', 'white-black' ],
|
|
74
|
-
[ 'white*black', 'white-black' ],
|
|
75
|
-
[ 'white.black', 'white-black' ],
|
|
76
|
-
[ 'white black', 'white-black' ],
|
|
77
|
-
[ 'white black', 'white-black' ],
|
|
78
|
-
[ 'white-to-black', 'white-to-black' ],
|
|
79
|
-
[ 'white2white', 'white-2-white' ],
|
|
80
|
-
[ 'white2nd', 'white-2nd' ],
|
|
81
|
-
[ 'white2ndcolor', 'white-2-ndcolor' ],
|
|
82
|
-
[ 'white2ndColor', 'white-2nd-color' ],
|
|
83
|
-
[ 'white2nd_color', 'white-2nd-color' ],
|
|
84
|
-
[ 'white23color', 'white-23-color' ],
|
|
85
|
-
[ 'white23', 'white-23' ],
|
|
86
|
-
[ '23color', '23-color' ],
|
|
87
|
-
[ 'white4th', 'white-4th' ],
|
|
88
|
-
[ 'font2xl', 'font-2-xl' ],
|
|
89
|
-
[ 'whiteToWhite', 'white-to-white' ],
|
|
90
|
-
[ 'whiteTOwhite', 'white-t-owhite' ],
|
|
91
|
-
[ 'WHITEtoWHITE', 'whit-eto-white' ],
|
|
92
|
-
[ 42, '42' ],
|
|
93
|
-
[ "i've done", 'ive-done' ],
|
|
94
|
-
[ '#ffffff', 'ffffff' ],
|
|
95
|
-
[ '$ffffff', 'ffffff' ],
|
|
96
|
-
] )( 'converts %s properly to %s', ( input, expected ) => {
|
|
97
|
-
expect( kebabCase( input ) ).toEqual( expected );
|
|
98
|
-
} );
|
|
99
|
-
} );
|
|
4
|
+
import { setImmutably } from '../object';
|
|
100
5
|
|
|
101
6
|
describe( 'setImmutably', () => {
|
|
102
7
|
describe( 'handling falsy values properly', () => {
|