@wordpress/block-editor 12.5.0 → 12.7.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 +2 -6
- package/build/autocompleters/block.js +6 -2
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-draggable/index.js +6 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +2 -2
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +25 -13
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-editing-mode/index.js +1 -1
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +14 -18
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block.js +4 -2
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +21 -42
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-parent-selector/index.js +6 -21
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-preview/auto.js +6 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +1 -4
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +2 -2
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +3 -17
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +7 -5
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
- package/build/components/block-toolbar/index.js +4 -33
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +62 -3
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-toolbar/utils.js +56 -51
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +4 -2
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +10 -20
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/colors-gradients/control.js +4 -2
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/editor-styles/index.js +2 -2
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +11 -11
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/behaviors-panel.js +66 -0
- package/build/components/global-styles/behaviors-panel.js.map +1 -0
- package/build/components/global-styles/color-panel.js +21 -15
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +13 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/get-block-css-selector.js +4 -8
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +131 -27
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +20 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +18 -3
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +4 -4
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +12 -18
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +7 -7
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +36 -48
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +5 -0
- package/build/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build/components/index.js +1 -10
- package/build/components/index.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/index.native.js +3 -1
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +33 -7
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +6 -2
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +5 -7
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +3 -2
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +2 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +21 -32
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/reusable-block-rename-hint.js +23 -3
- package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +3 -2
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter-list-item/index.js +1 -1
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/link-control/index.js +51 -7
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +3 -3
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-item.js +1 -1
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +2 -2
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +6 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +65 -31
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +15 -3
- package/build/components/media-replace-flow/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +2 -2
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/rich-text/content.js +0 -36
- package/build/components/rich-text/content.js.map +1 -1
- package/build/components/rich-text/format-edit.js +57 -28
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +111 -0
- package/build/components/rich-text/get-rich-text-values.js.map +1 -0
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +6 -2
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +2 -2
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/use-block-display-information/index.js +7 -3
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +49 -8
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-setting/index.js +5 -9
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/behaviors.js +5 -12
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/border.js +2 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/margin.js +1 -1
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +1 -1
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +11 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +1 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +10 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +3 -4
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +5 -6
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +23 -79
- package/build/store/selectors.js.map +1 -1
- package/build/utils/object.js +38 -2
- package/build/utils/object.js.map +1 -1
- package/build-module/autocompleters/block.js +7 -3
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-draggable/index.js +6 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +2 -2
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/edit.js +27 -10
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +1 -1
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +14 -18
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block.js +4 -2
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +24 -43
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +3 -3
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +7 -22
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +6 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +1 -4
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings/button.native.js +3 -3
- package/build-module/components/block-settings/button.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -18
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +9 -7
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
- package/build-module/components/block-toolbar/index.js +6 -35
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +60 -4
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +54 -49
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +4 -2
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +13 -23
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +3 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/editor-styles/index.js +2 -2
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +11 -11
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/behaviors-panel.js +57 -0
- package/build-module/components/global-styles/behaviors-panel.js.map +1 -0
- package/build-module/components/global-styles/color-panel.js +21 -15
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +13 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/get-block-css-selector.js +4 -8
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +127 -27
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +18 -3
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +4 -4
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +13 -18
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +6 -6
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +37 -49
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +5 -0
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build-module/components/index.js +0 -5
- package/build-module/components/index.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/index.native.js +3 -1
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +30 -7
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +7 -3
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +5 -7
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +3 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +2 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +22 -33
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +22 -3
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -2
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +1 -1
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/link-control/index.js +49 -7
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +3 -3
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-item.js +1 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +6 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +66 -33
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.native.js +15 -3
- package/build-module/components/media-replace-flow/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +2 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/rich-text/content.js +1 -36
- package/build-module/components/rich-text/content.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +51 -26
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +100 -0
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +7 -3
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +2 -2
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +7 -3
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +50 -8
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-setting/index.js +5 -9
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/behaviors.js +5 -12
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/border.js +2 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/margin.js +1 -1
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +1 -1
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +11 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +2 -7
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +7 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +4 -5
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +20 -75
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/object.js +34 -2
- package/build-module/utils/object.js.map +1 -1
- package/build-style/content-rtl.css +2 -1
- package/build-style/content.css +2 -1
- package/build-style/style-rtl.css +25 -6
- package/build-style/style.css +25 -6
- package/package.json +32 -32
- package/src/autocompleters/block.js +21 -6
- package/src/components/block-controls/README.md +89 -0
- package/src/components/block-draggable/index.js +13 -4
- package/src/components/block-draggable/index.native.js +7 -3
- package/src/components/block-draggable/test/index.native.js +2 -57
- package/src/components/block-edit/edit.js +26 -9
- package/src/components/block-edit/test/edit.js +1 -1
- package/src/components/block-editing-mode/index.js +1 -1
- package/src/components/block-list/block-outline.native.js +26 -25
- package/src/components/block-list/block.js +6 -1
- package/src/components/block-list/block.native.js +24 -38
- package/src/components/block-list/block.native.scss +18 -40
- package/src/components/block-list/index.js +3 -6
- package/src/components/block-list/style.native.scss +3 -3
- package/src/components/block-list/test/block-invalid-warning.native.js +8 -1
- package/src/components/block-mover/index.native.js +3 -3
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +40 -6
- package/src/components/block-parent-selector/index.js +30 -42
- package/src/components/block-preview/auto.js +8 -1
- package/src/components/block-preview/style.scss +2 -1
- package/src/components/block-removal-warning-modal/index.js +0 -3
- package/src/components/block-settings/button.native.js +12 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -13
- package/src/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +15 -10
- package/src/components/block-toolbar/index.js +36 -64
- package/src/components/block-toolbar/index.native.js +86 -6
- package/src/components/{block-mobile-toolbar/test/block-actions-menu.native.js → block-toolbar/test/block-toolbar-menu.native.js} +20 -54
- package/src/components/block-toolbar/test/index.native.js +42 -0
- package/src/components/block-toolbar/utils.js +57 -45
- package/src/components/block-tools/block-contextual-toolbar.js +43 -35
- package/src/components/block-tools/style.scss +17 -5
- package/src/components/block-variation-picker/index.native.js +52 -72
- package/src/components/button-block-appender/styles.native.scss +2 -2
- package/src/components/caption/README.md +49 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/colors-gradients/control.js +3 -2
- package/src/components/editor-styles/index.js +2 -2
- package/src/components/font-sizes/fluid-utils.js +17 -17
- package/src/components/font-sizes/test/fluid-utils.js +6 -6
- package/src/components/global-styles/behaviors-panel.js +71 -0
- package/src/components/global-styles/color-panel.js +23 -16
- package/src/components/global-styles/dimensions-panel.js +8 -2
- package/src/components/global-styles/get-block-css-selector.js +5 -9
- package/src/components/global-styles/hooks.js +134 -31
- package/src/components/global-styles/index.js +3 -0
- package/src/components/global-styles/test/typography-utils.js +6 -6
- package/src/components/global-styles/typography-panel.js +17 -5
- package/src/components/global-styles/typography-utils.js +4 -4
- package/src/components/global-styles/use-global-styles-output.js +36 -18
- package/src/components/global-styles/utils.js +17 -7
- package/src/components/iframe/index.js +30 -56
- package/src/components/iframe/use-compatibility-styles.js +5 -0
- package/src/components/index.js +0 -5
- package/src/components/inner-blocks/README.md +10 -0
- package/src/components/inner-blocks/index.js +4 -0
- package/src/components/inner-blocks/index.native.js +4 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +32 -5
- package/src/components/inserter/hooks/use-block-types-state.js +15 -6
- package/src/components/inserter/hooks/use-debounced-input.js +8 -7
- package/src/components/inserter/hooks/use-patterns-state.js +2 -1
- package/src/components/inserter/index.js +2 -3
- package/src/components/inserter/index.native.js +17 -36
- package/src/components/inserter/reusable-block-rename-hint.js +18 -1
- package/src/components/inserter/reusable-blocks-tab.js +4 -1
- package/src/components/inserter/style.native.scss +10 -15
- package/src/components/inserter-list-item/index.js +3 -1
- package/src/components/link-control/README.md +12 -3
- package/src/components/link-control/index.js +47 -7
- package/src/components/link-control/link-preview.js +6 -4
- package/src/components/link-control/search-item.js +1 -1
- package/src/components/link-control/style.scss +11 -3
- package/src/components/link-control/test/index.js +28 -1
- package/src/components/list-view/use-list-view-client-ids.js +2 -2
- package/src/components/list-view/use-list-view-drop-zone.js +5 -1
- package/src/components/media-placeholder/index.native.js +108 -59
- package/src/components/media-placeholder/styles.native.scss +59 -24
- package/src/components/media-replace-flow/index.native.js +12 -3
- package/src/components/media-upload/test/index.native.js +1 -0
- package/src/components/preview-options/README.md +18 -17
- package/src/components/preview-options/index.js +2 -2
- package/src/components/rich-text/content.js +1 -46
- package/src/components/rich-text/format-edit.js +62 -38
- package/src/components/rich-text/get-rich-text-values.js +99 -0
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
- package/src/components/spacing-sizes-control/input-controls/axial.js +17 -2
- package/src/components/spacing-sizes-control/input-controls/separated.js +17 -2
- package/src/components/spacing-sizes-control/input-controls/single.js +12 -2
- package/src/components/spacing-sizes-control/test/utils.js +9 -1
- package/src/components/spacing-sizes-control/utils.js +2 -2
- package/src/components/text-transform-control/README.md +44 -0
- package/src/components/use-block-display-information/index.js +12 -5
- package/src/components/use-block-drop-zone/index.native.js +65 -28
- package/src/components/use-setting/index.js +8 -8
- package/src/hooks/behaviors.js +10 -16
- package/src/hooks/border.js +2 -1
- package/src/hooks/margin.js +4 -1
- package/src/hooks/padding.js +4 -1
- package/src/hooks/style.js +7 -3
- package/src/hooks/utils.js +5 -7
- package/src/private-apis.js +9 -1
- package/src/store/actions.js +23 -30
- package/src/store/private-selectors.js +3 -6
- package/src/store/reducer.js +0 -1
- package/src/store/selectors.js +36 -85
- package/src/store/test/actions.js +3 -0
- package/src/store/test/private-selectors.js +5 -5
- package/src/store/test/reducer.js +14 -7
- package/src/store/test/selectors.js +8 -7
- package/src/utils/object.js +32 -2
- package/src/utils/test/object.js +36 -0
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
- package/build/components/block-mobile-toolbar/index.native.js +0 -135
- package/build/components/block-mobile-toolbar/index.native.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +0 -116
- package/build-module/components/block-mobile-toolbar/index.native.js.map +0 -1
- package/src/components/block-mobile-toolbar/index.native.js +0 -127
- package/src/components/block-mobile-toolbar/style.native.scss +0 -16
- /package/src/components/{block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap → block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap} +0 -0
|
@@ -12,12 +12,9 @@ import {
|
|
|
12
12
|
/**
|
|
13
13
|
* WordPress dependencies
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
createBlocksFromInnerBlocksTemplate,
|
|
19
|
-
store as blocksStore,
|
|
20
|
-
} from '@wordpress/blocks';
|
|
15
|
+
import { useDispatch } from '@wordpress/data';
|
|
16
|
+
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
17
|
+
import { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';
|
|
21
18
|
import { __ } from '@wordpress/i18n';
|
|
22
19
|
import {
|
|
23
20
|
PanelBody,
|
|
@@ -26,7 +23,6 @@ import {
|
|
|
26
23
|
InserterButton,
|
|
27
24
|
} from '@wordpress/components';
|
|
28
25
|
import { Icon, close } from '@wordpress/icons';
|
|
29
|
-
import { useMemo } from '@wordpress/element';
|
|
30
26
|
|
|
31
27
|
/**
|
|
32
28
|
* Internal dependencies
|
|
@@ -45,28 +41,25 @@ function BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {
|
|
|
45
41
|
styles.cancelButtonDark
|
|
46
42
|
);
|
|
47
43
|
|
|
48
|
-
const leftButton =
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</TouchableWithoutFeedback>
|
|
68
|
-
),
|
|
69
|
-
[ onClose, cancelButtonStyle ]
|
|
44
|
+
const leftButton = (
|
|
45
|
+
<TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>
|
|
46
|
+
<View>
|
|
47
|
+
{ isIOS ? (
|
|
48
|
+
<Text
|
|
49
|
+
style={ cancelButtonStyle }
|
|
50
|
+
maxFontSizeMultiplier={ 2 }
|
|
51
|
+
>
|
|
52
|
+
{ __( 'Cancel' ) }
|
|
53
|
+
</Text>
|
|
54
|
+
) : (
|
|
55
|
+
<Icon
|
|
56
|
+
icon={ close }
|
|
57
|
+
size={ 24 }
|
|
58
|
+
style={ styles.closeIcon }
|
|
59
|
+
/>
|
|
60
|
+
) }
|
|
61
|
+
</View>
|
|
62
|
+
</TouchableWithoutFeedback>
|
|
70
63
|
);
|
|
71
64
|
|
|
72
65
|
const onVariationSelect = ( variation ) => {
|
|
@@ -77,51 +70,38 @@ function BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {
|
|
|
77
70
|
onClose();
|
|
78
71
|
};
|
|
79
72
|
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
return (
|
|
74
|
+
<BottomSheet
|
|
75
|
+
isVisible={ isVisible }
|
|
76
|
+
onClose={ onClose }
|
|
77
|
+
title={ __( 'Select a layout' ) }
|
|
78
|
+
contentStyle={ styles.contentStyle }
|
|
79
|
+
leftButton={ leftButton }
|
|
80
|
+
testID="block-variation-modal"
|
|
81
|
+
>
|
|
82
|
+
<ScrollView
|
|
83
|
+
horizontal
|
|
84
|
+
showsHorizontalScrollIndicator={ false }
|
|
85
|
+
contentContainerStyle={ styles.contentContainerStyle }
|
|
86
|
+
style={ styles.containerStyle }
|
|
89
87
|
>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
>
|
|
96
|
-
{ variations.map( ( v ) => {
|
|
97
|
-
return (
|
|
98
|
-
<InserterButton
|
|
99
|
-
item={ v }
|
|
100
|
-
key={ v.name }
|
|
101
|
-
onSelect={ () => onVariationSelect( v ) }
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
} ) }
|
|
105
|
-
</ScrollView>
|
|
106
|
-
<PanelBody>
|
|
107
|
-
<FooterMessageControl
|
|
108
|
-
label={ __(
|
|
109
|
-
'Note: Column layout may vary between themes and screen sizes'
|
|
110
|
-
) }
|
|
88
|
+
{ variations.map( ( v ) => (
|
|
89
|
+
<InserterButton
|
|
90
|
+
item={ v }
|
|
91
|
+
key={ v.name }
|
|
92
|
+
onSelect={ () => onVariationSelect( v ) }
|
|
111
93
|
/>
|
|
112
|
-
|
|
113
|
-
</
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
) ) }
|
|
95
|
+
</ScrollView>
|
|
96
|
+
<PanelBody>
|
|
97
|
+
<FooterMessageControl
|
|
98
|
+
label={ __(
|
|
99
|
+
'Note: Column layout may vary between themes and screen sizes'
|
|
100
|
+
) }
|
|
101
|
+
/>
|
|
102
|
+
</PanelBody>
|
|
103
|
+
</BottomSheet>
|
|
116
104
|
);
|
|
117
105
|
}
|
|
118
106
|
|
|
119
|
-
export default
|
|
120
|
-
withSelect( ( select, {} ) => {
|
|
121
|
-
const { getBlockVariations } = select( blocksStore );
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
date: getBlockVariations( 'core/columns', 'block' ),
|
|
125
|
-
};
|
|
126
|
-
} )
|
|
127
|
-
)( BlockVariationPicker );
|
|
107
|
+
export default BlockVariationPicker;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
## Caption
|
|
2
|
+
|
|
3
|
+
The `Caption` component renders the [caption part](https://wordpress.org/documentation/article/gallery-block/#caption) of some blocks (image, gallery...).
|
|
4
|
+
|
|
5
|
+
This component encapsulates the "caption" behaviour and styles over a `<RichText>` so it can be used in other components such as the `BlockCaption` component.
|
|
6
|
+
|
|
7
|
+
## Table of contents
|
|
8
|
+
|
|
9
|
+
1. [Development guidelines](#development-guidelines)
|
|
10
|
+
2. [Related components](#related-components)
|
|
11
|
+
|
|
12
|
+
## Development guidelines
|
|
13
|
+
|
|
14
|
+
### Usage
|
|
15
|
+
|
|
16
|
+
Renders a Caption area:
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import { Caption } from '@wordpress/block-editor';
|
|
20
|
+
const BlockCaption = ( {
|
|
21
|
+
onBlur,
|
|
22
|
+
onChange,
|
|
23
|
+
onFocus,
|
|
24
|
+
isSelected,
|
|
25
|
+
shouldDisplay,
|
|
26
|
+
text,
|
|
27
|
+
insertBlocksAfter,
|
|
28
|
+
} ) => (
|
|
29
|
+
<View >
|
|
30
|
+
<Caption
|
|
31
|
+
isSelected={ isSelected }
|
|
32
|
+
onBlur={ onBlur }
|
|
33
|
+
onChange={ onChange }
|
|
34
|
+
onFocus={ onFocus }
|
|
35
|
+
shouldDisplay={ shouldDisplay }
|
|
36
|
+
value={ text }
|
|
37
|
+
insertBlocksAfter={ insertBlocksAfter }
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Props
|
|
44
|
+
|
|
45
|
+
The properties `isSelected`, `onBlur`, `onChange`, `onFocus`, `shouldDisplay`, `value`, `insertBlocksAfter` of this component are passed directly to their related props of its inner `<RichText>` component ([see detailed info about the RichText component's props](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md)).
|
|
46
|
+
|
|
47
|
+
## Related components
|
|
48
|
+
|
|
49
|
+
Caption components is mostly used by the [`BlockCaption`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-caption) component.
|
|
@@ -172,7 +172,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
172
172
|
<button
|
|
173
173
|
aria-expanded="false"
|
|
174
174
|
aria-haspopup="true"
|
|
175
|
-
aria-label="Custom color picker. The currently selected color is called "red" and has a value of "
|
|
175
|
+
aria-label="Custom color picker. The currently selected color is called "red" and has a value of "#f00"."
|
|
176
176
|
class="components-color-palette__custom-color-button"
|
|
177
177
|
style="background: rgb(255, 0, 0);"
|
|
178
178
|
/>
|
|
@@ -6,6 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
9
10
|
import {
|
|
10
11
|
BaseControl,
|
|
11
12
|
__experimentalVStack as VStack,
|
|
@@ -28,12 +29,12 @@ const colorsAndGradientKeys = [
|
|
|
28
29
|
|
|
29
30
|
const TAB_COLOR = {
|
|
30
31
|
name: 'color',
|
|
31
|
-
title: 'Solid',
|
|
32
|
+
title: __( 'Solid' ),
|
|
32
33
|
value: 'color',
|
|
33
34
|
};
|
|
34
35
|
const TAB_GRADIENT = {
|
|
35
36
|
name: 'gradient',
|
|
36
|
-
title: 'Gradient',
|
|
37
|
+
title: __( 'Gradient' ),
|
|
37
38
|
value: 'gradient',
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -43,13 +43,13 @@ function useDarkThemeBodyClassName( styles ) {
|
|
|
43
43
|
body.appendChild( tempCanvas );
|
|
44
44
|
|
|
45
45
|
backgroundColor = defaultView
|
|
46
|
-
|
|
46
|
+
?.getComputedStyle( tempCanvas, null )
|
|
47
47
|
.getPropertyValue( 'background-color' );
|
|
48
48
|
|
|
49
49
|
body.removeChild( tempCanvas );
|
|
50
50
|
} else {
|
|
51
51
|
backgroundColor = defaultView
|
|
52
|
-
|
|
52
|
+
?.getComputedStyle( canvas, null )
|
|
53
53
|
.getPropertyValue( 'background-color' );
|
|
54
54
|
}
|
|
55
55
|
const colordBackgroundColor = colord( backgroundColor );
|
|
@@ -32,8 +32,8 @@ const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
|
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* @param {Object} args
|
|
35
|
-
* @param {?string} args.
|
|
36
|
-
* @param {?string} args.
|
|
35
|
+
* @param {?string} args.minimumViewportWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.
|
|
36
|
+
* @param {?string} args.maximumViewportWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.
|
|
37
37
|
* @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified.
|
|
38
38
|
* @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional.
|
|
39
39
|
* @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
|
|
@@ -46,8 +46,8 @@ export function getComputedFluidTypographyValue( {
|
|
|
46
46
|
minimumFontSize,
|
|
47
47
|
maximumFontSize,
|
|
48
48
|
fontSize,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
|
|
50
|
+
maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
|
|
51
51
|
scaleFactor = DEFAULT_SCALE_FACTOR,
|
|
52
52
|
minimumFontSizeLimit,
|
|
53
53
|
} ) {
|
|
@@ -163,19 +163,19 @@ export function getComputedFluidTypographyValue( {
|
|
|
163
163
|
} );
|
|
164
164
|
|
|
165
165
|
// Viewport widths defined for fluid typography. Normalize units
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const maximumViewportWidthParsed = getTypographyValueAndUnit(
|
|
167
|
+
maximumViewportWidth,
|
|
168
168
|
{ coerceTo: fontSizeUnit }
|
|
169
169
|
);
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const minimumViewportWidthParsed = getTypographyValueAndUnit(
|
|
171
|
+
minimumViewportWidth,
|
|
172
172
|
{ coerceTo: fontSizeUnit }
|
|
173
173
|
);
|
|
174
174
|
|
|
175
175
|
// Protect against unsupported units.
|
|
176
176
|
if (
|
|
177
|
-
!
|
|
178
|
-
!
|
|
177
|
+
! maximumViewportWidthParsed ||
|
|
178
|
+
! minimumViewportWidthParsed ||
|
|
179
179
|
! minimumFontSizeRem
|
|
180
180
|
) {
|
|
181
181
|
return null;
|
|
@@ -183,23 +183,23 @@ export function getComputedFluidTypographyValue( {
|
|
|
183
183
|
|
|
184
184
|
// Build CSS rule.
|
|
185
185
|
// Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.
|
|
186
|
-
const
|
|
187
|
-
|
|
186
|
+
const minViewportWidthOffsetValue = roundToPrecision(
|
|
187
|
+
minimumViewportWidthParsed.value / 100,
|
|
188
188
|
3
|
|
189
189
|
);
|
|
190
190
|
|
|
191
|
-
const
|
|
192
|
-
roundToPrecision(
|
|
191
|
+
const viewportWidthOffset =
|
|
192
|
+
roundToPrecision( minViewportWidthOffsetValue, 3 ) + fontSizeUnit;
|
|
193
193
|
const linearFactor =
|
|
194
194
|
100 *
|
|
195
195
|
( ( maximumFontSizeParsed.value - minimumFontSizeParsed.value ) /
|
|
196
|
-
(
|
|
197
|
-
|
|
196
|
+
( maximumViewportWidthParsed.value -
|
|
197
|
+
minimumViewportWidthParsed.value ) );
|
|
198
198
|
const linearFactorScaled = roundToPrecision(
|
|
199
199
|
( linearFactor || 1 ) * scaleFactor,
|
|
200
200
|
3
|
|
201
201
|
);
|
|
202
|
-
const fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${
|
|
202
|
+
const fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${ viewportWidthOffset }) * ${ linearFactorScaled })`;
|
|
203
203
|
|
|
204
204
|
return `clamp(${ minimumFontSize }, ${ fluidTargetFontSize }, ${ maximumFontSize })`;
|
|
205
205
|
}
|
|
@@ -56,8 +56,8 @@ describe( 'getComputedFluidTypographyValue()', () => {
|
|
|
56
56
|
it( 'should return a fluid font size when given a min and max viewport width', () => {
|
|
57
57
|
const fluidTypographyValues = getComputedFluidTypographyValue( {
|
|
58
58
|
fontSize: '30px',
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
minimumViewportWidth: '500px',
|
|
60
|
+
maximumViewportWidth: '1000px',
|
|
61
61
|
} );
|
|
62
62
|
expect( fluidTypographyValues ).toBe(
|
|
63
63
|
'clamp(18.959px, 1.185rem + ((1vw - 5px) * 2.208), 30px)'
|
|
@@ -74,18 +74,18 @@ describe( 'getComputedFluidTypographyValue()', () => {
|
|
|
74
74
|
);
|
|
75
75
|
} );
|
|
76
76
|
|
|
77
|
-
it( 'should return null when
|
|
77
|
+
it( 'should return null when maximumViewportWidth is not a supported value or unit', () => {
|
|
78
78
|
const fluidTypographyValues = getComputedFluidTypographyValue( {
|
|
79
79
|
fontSize: '30px',
|
|
80
|
-
|
|
80
|
+
maximumViewportWidth: 'min(calc(100% - 60px), 1200px)',
|
|
81
81
|
} );
|
|
82
82
|
expect( fluidTypographyValues ).toBeNull();
|
|
83
83
|
} );
|
|
84
84
|
|
|
85
|
-
it( 'should return `null` font size when
|
|
85
|
+
it( 'should return `null` font size when minimumViewportWidth is not a supported value or unit', () => {
|
|
86
86
|
const fluidTypographyValues = getComputedFluidTypographyValue( {
|
|
87
87
|
fontSize: '33px',
|
|
88
|
-
|
|
88
|
+
minimumViewportWidth: 'calc(100% - 60px)',
|
|
89
89
|
} );
|
|
90
90
|
expect( fluidTypographyValues ).toBeNull();
|
|
91
91
|
} );
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { SelectControl } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
export default function ( { onChange, value, behaviors } ) {
|
|
8
|
+
const defaultBehaviors = {
|
|
9
|
+
default: {
|
|
10
|
+
value: 'default',
|
|
11
|
+
label: __( 'Default' ),
|
|
12
|
+
},
|
|
13
|
+
noBehaviors: {
|
|
14
|
+
value: '',
|
|
15
|
+
label: __( 'No behaviors' ),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const behaviorsOptions = Object.entries( behaviors ).map(
|
|
20
|
+
( [ behaviorName ] ) => ( {
|
|
21
|
+
value: behaviorName,
|
|
22
|
+
// Capitalize the first letter of the behavior name.
|
|
23
|
+
label: `${ behaviorName.charAt( 0 ).toUpperCase() }${ behaviorName
|
|
24
|
+
.slice( 1 )
|
|
25
|
+
.toLowerCase() }`,
|
|
26
|
+
} )
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const options = [
|
|
30
|
+
...Object.values( defaultBehaviors ),
|
|
31
|
+
...behaviorsOptions,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const animations = [
|
|
35
|
+
{
|
|
36
|
+
value: 'zoom',
|
|
37
|
+
label: __( 'Zoom' ),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'fade',
|
|
41
|
+
label: __( 'Fade' ),
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
return (
|
|
45
|
+
<div style={ { marginTop: '2rem' } }>
|
|
46
|
+
<SelectControl
|
|
47
|
+
label={ __( 'Behaviors' ) }
|
|
48
|
+
// At the moment we are only supporting one behavior (Lightbox)
|
|
49
|
+
value={ value }
|
|
50
|
+
options={ options }
|
|
51
|
+
onChange={ onChange }
|
|
52
|
+
hideCancelButton={ true }
|
|
53
|
+
size="__unstable-large"
|
|
54
|
+
/>
|
|
55
|
+
{ value === 'lightbox' && (
|
|
56
|
+
<SelectControl
|
|
57
|
+
label={ __( 'Animation' ) }
|
|
58
|
+
value={
|
|
59
|
+
behaviors?.lightbox.animation
|
|
60
|
+
? behaviors?.lightbox.animation
|
|
61
|
+
: ''
|
|
62
|
+
}
|
|
63
|
+
options={ animations }
|
|
64
|
+
onChange={ onChange }
|
|
65
|
+
hideCancelButton={ false }
|
|
66
|
+
size="__unstable-large"
|
|
67
|
+
/>
|
|
68
|
+
) }
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -328,22 +328,6 @@ export default function ColorPanel( {
|
|
|
328
328
|
: gradientValue;
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
-
// Text Color
|
|
332
|
-
const showTextPanel = useHasTextPanel( settings );
|
|
333
|
-
const textColor = decodeValue( inheritedValue?.color?.text );
|
|
334
|
-
const userTextColor = decodeValue( value?.color?.text );
|
|
335
|
-
const hasTextColor = () => !! userTextColor;
|
|
336
|
-
const setTextColor = ( newColor ) => {
|
|
337
|
-
onChange(
|
|
338
|
-
setImmutably(
|
|
339
|
-
value,
|
|
340
|
-
[ 'color', 'text' ],
|
|
341
|
-
encodeColorValue( newColor )
|
|
342
|
-
)
|
|
343
|
-
);
|
|
344
|
-
};
|
|
345
|
-
const resetTextColor = () => setTextColor( undefined );
|
|
346
|
-
|
|
347
331
|
// BackgroundColor
|
|
348
332
|
const showBackgroundPanel = useHasBackgroundPanel( settings );
|
|
349
333
|
const backgroundColor = decodeValue( inheritedValue?.color?.background );
|
|
@@ -424,6 +408,29 @@ export default function ColorPanel( {
|
|
|
424
408
|
onChange( newValue );
|
|
425
409
|
};
|
|
426
410
|
|
|
411
|
+
// Text Color
|
|
412
|
+
const showTextPanel = useHasTextPanel( settings );
|
|
413
|
+
const textColor = decodeValue( inheritedValue?.color?.text );
|
|
414
|
+
const userTextColor = decodeValue( value?.color?.text );
|
|
415
|
+
const hasTextColor = () => !! userTextColor;
|
|
416
|
+
const setTextColor = ( newColor ) => {
|
|
417
|
+
let changedObject = setImmutably(
|
|
418
|
+
value,
|
|
419
|
+
[ 'color', 'text' ],
|
|
420
|
+
encodeColorValue( newColor )
|
|
421
|
+
);
|
|
422
|
+
if ( textColor === linkColor ) {
|
|
423
|
+
changedObject = setImmutably(
|
|
424
|
+
changedObject,
|
|
425
|
+
[ 'elements', 'link', 'color', 'text' ],
|
|
426
|
+
encodeColorValue( newColor )
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
onChange( changedObject );
|
|
431
|
+
};
|
|
432
|
+
const resetTextColor = () => setTextColor( undefined );
|
|
433
|
+
|
|
427
434
|
// Elements
|
|
428
435
|
const elements = [
|
|
429
436
|
{
|
|
@@ -207,18 +207,24 @@ export default function DimensionsPanel( {
|
|
|
207
207
|
// in global styles but not in block inspector.
|
|
208
208
|
includeLayoutControls = false,
|
|
209
209
|
} ) {
|
|
210
|
+
const { dimensions, spacing } = settings;
|
|
211
|
+
|
|
210
212
|
const decodeValue = ( rawValue ) => {
|
|
211
213
|
if ( rawValue && typeof rawValue === 'object' ) {
|
|
212
214
|
return Object.keys( rawValue ).reduce( ( acc, key ) => {
|
|
213
215
|
acc[ key ] = getValueFromVariable(
|
|
214
|
-
{ settings },
|
|
216
|
+
{ settings: { dimensions, spacing } },
|
|
215
217
|
'',
|
|
216
218
|
rawValue[ key ]
|
|
217
219
|
);
|
|
218
220
|
return acc;
|
|
219
221
|
}, {} );
|
|
220
222
|
}
|
|
221
|
-
return getValueFromVariable(
|
|
223
|
+
return getValueFromVariable(
|
|
224
|
+
{ settings: { dimensions, spacing } },
|
|
225
|
+
'',
|
|
226
|
+
rawValue
|
|
227
|
+
);
|
|
222
228
|
};
|
|
223
229
|
|
|
224
230
|
const showSpacingPresetsControl = useHasSpacingPresets( settings );
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
4
|
import { scopeSelector } from './utils';
|
|
5
|
+
import { getValueFromObjectPath } from '../../utils/object';
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Determine the CSS selector for the block type and target provided, returning
|
|
@@ -69,15 +65,15 @@ export function getBlockCSSSelector(
|
|
|
69
65
|
if ( hasSelectors ) {
|
|
70
66
|
// Get selector from either `feature.root` or shorthand path.
|
|
71
67
|
const featureSelector =
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
getValueFromObjectPath( selectors, `${ path }.root`, null ) ||
|
|
69
|
+
getValueFromObjectPath( selectors, path, null );
|
|
74
70
|
|
|
75
71
|
// Return feature selector if found or any available fallback.
|
|
76
72
|
return featureSelector || fallbackSelector;
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
// Try getting old experimental supports selector value.
|
|
80
|
-
const featureSelector =
|
|
76
|
+
const featureSelector = getValueFromObjectPath(
|
|
81
77
|
supports,
|
|
82
78
|
`${ path }.__experimentalSelector`,
|
|
83
79
|
null
|
|
@@ -98,7 +94,7 @@ export function getBlockCSSSelector(
|
|
|
98
94
|
|
|
99
95
|
// Use selectors API if available.
|
|
100
96
|
if ( hasSelectors ) {
|
|
101
|
-
subfeatureSelector =
|
|
97
|
+
subfeatureSelector = getValueFromObjectPath( selectors, path, null );
|
|
102
98
|
}
|
|
103
99
|
|
|
104
100
|
// Only return if we have a subfeature selector.
|