@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.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/build/components/block-controls/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +14 -28
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +4 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -4
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +7 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/block-tools/index.js +12 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +156 -23
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +33 -25
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/url-input/index.js +3 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +5 -6
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +3 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +12 -8
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +27 -22
- package/build/utils/dom.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +15 -27
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +4 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -4
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +7 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/block-tools/index.js +13 -10
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +157 -24
- package/build-module/components/iframe/index.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/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- 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 +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +33 -25
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/url-input/index.js +3 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +4 -4
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +3 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.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/selectors.js +12 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +25 -21
- package/build-module/utils/dom.js.map +1 -1
- package/build-style/content-rtl.css +30 -15
- package/build-style/content.css +30 -15
- package/build-style/style-rtl.css +92 -3
- package/build-style/style.css +92 -3
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/components/block-canvas/style.scss +1 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-inspector/style.scss +2 -1
- package/src/components/block-list/block.js +28 -48
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/index.story.js +2 -19
- package/src/components/block-popover/index.js +4 -4
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/change-design.js +1 -7
- package/src/components/block-toolbar/index.js +6 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/index.js +26 -10
- package/src/components/block-tools/style.scss +12 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -1
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +16 -3
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +204 -44
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +41 -37
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/components/rich-text/index.js +8 -1
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/url-input/index.js +3 -4
- package/src/components/use-block-commands/index.js +245 -234
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +6 -6
- package/src/hooks/utils.js +8 -3
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +6 -7
- package/src/store/selectors.js +60 -45
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/selectors.js +87 -58
- package/src/store/utils.js +12 -11
- package/src/style.scss +1 -0
- package/src/utils/dom.js +26 -21
- package/src/utils/test/dom.js +224 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -24,275 +24,286 @@ import {
|
|
|
24
24
|
import BlockIcon from '../block-icon';
|
|
25
25
|
import { store as blockEditorStore } from '../../store';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
blocks,
|
|
31
|
-
clientIds,
|
|
32
|
-
canRemove,
|
|
33
|
-
possibleBlockTransformations,
|
|
34
|
-
invalidSelection,
|
|
35
|
-
} = useSelect( ( select ) => {
|
|
27
|
+
const getTransformCommands = () =>
|
|
28
|
+
function useTransformCommands() {
|
|
29
|
+
const { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );
|
|
36
30
|
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} =
|
|
31
|
+
blocks,
|
|
32
|
+
clientIds,
|
|
33
|
+
canRemove,
|
|
34
|
+
possibleBlockTransformations,
|
|
35
|
+
invalidSelection,
|
|
36
|
+
} = useSelect( ( select ) => {
|
|
37
|
+
const {
|
|
38
|
+
getBlockRootClientId,
|
|
39
|
+
getBlockTransformItems,
|
|
40
|
+
getSelectedBlockClientIds,
|
|
41
|
+
getBlocksByClientId,
|
|
42
|
+
canRemoveBlocks,
|
|
43
|
+
} = select( blockEditorStore );
|
|
44
|
+
|
|
45
|
+
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
46
|
+
const selectedBlocks = getBlocksByClientId(
|
|
47
|
+
selectedBlockClientIds
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.
|
|
51
|
+
// These nulls will cause fatal errors down the line.
|
|
52
|
+
// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.
|
|
53
|
+
// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536
|
|
54
|
+
if ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {
|
|
55
|
+
return {
|
|
56
|
+
invalidSelection: true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
const rootClientId = getBlockRootClientId(
|
|
61
|
+
selectedBlockClientIds[ 0 ]
|
|
62
|
+
);
|
|
63
|
+
return {
|
|
64
|
+
blocks: selectedBlocks,
|
|
65
|
+
clientIds: selectedBlockClientIds,
|
|
66
|
+
possibleBlockTransformations: getBlockTransformItems(
|
|
67
|
+
selectedBlocks,
|
|
68
|
+
rootClientId
|
|
69
|
+
),
|
|
70
|
+
canRemove: canRemoveBlocks( selectedBlockClientIds ),
|
|
71
|
+
invalidSelection: false,
|
|
72
|
+
};
|
|
73
|
+
}, [] );
|
|
46
74
|
|
|
47
|
-
|
|
48
|
-
// These nulls will cause fatal errors down the line.
|
|
49
|
-
// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.
|
|
50
|
-
// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536
|
|
51
|
-
if ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {
|
|
75
|
+
if ( invalidSelection ) {
|
|
52
76
|
return {
|
|
53
|
-
|
|
77
|
+
isLoading: false,
|
|
78
|
+
commands: [],
|
|
54
79
|
};
|
|
55
80
|
}
|
|
81
|
+
const isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );
|
|
82
|
+
|
|
83
|
+
function selectForMultipleBlocks( insertedBlocks ) {
|
|
84
|
+
if ( insertedBlocks.length > 1 ) {
|
|
85
|
+
multiSelect(
|
|
86
|
+
insertedBlocks[ 0 ].clientId,
|
|
87
|
+
insertedBlocks[ insertedBlocks.length - 1 ].clientId
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
56
91
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
possibleBlockTransformations: getBlockTransformItems(
|
|
64
|
-
selectedBlocks,
|
|
65
|
-
rootClientId
|
|
66
|
-
),
|
|
67
|
-
canRemove: canRemoveBlocks( selectedBlockClientIds ),
|
|
68
|
-
invalidSelection: false,
|
|
69
|
-
};
|
|
70
|
-
}, [] );
|
|
92
|
+
// Simple block tranformation based on the `Block Transforms` API.
|
|
93
|
+
function onBlockTransform( name ) {
|
|
94
|
+
const newBlocks = switchToBlockType( blocks, name );
|
|
95
|
+
replaceBlocks( clientIds, newBlocks );
|
|
96
|
+
selectForMultipleBlocks( newBlocks );
|
|
97
|
+
}
|
|
71
98
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
/**
|
|
100
|
+
* The `isTemplate` check is a stopgap solution here.
|
|
101
|
+
* Ideally, the Transforms API should handle this
|
|
102
|
+
* by allowing to exclude blocks from wildcard transformations.
|
|
103
|
+
*/
|
|
104
|
+
const hasPossibleBlockTransformations =
|
|
105
|
+
!! possibleBlockTransformations.length && canRemove && ! isTemplate;
|
|
106
|
+
|
|
107
|
+
if (
|
|
108
|
+
! clientIds ||
|
|
109
|
+
clientIds.length < 1 ||
|
|
110
|
+
! hasPossibleBlockTransformations
|
|
111
|
+
) {
|
|
112
|
+
return { isLoading: false, commands: [] };
|
|
86
113
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
|
|
115
|
+
const commands = possibleBlockTransformations.map(
|
|
116
|
+
( transformation ) => {
|
|
117
|
+
const { name, title, icon } = transformation;
|
|
118
|
+
return {
|
|
119
|
+
name:
|
|
120
|
+
'core/block-editor/transform-to-' +
|
|
121
|
+
name.replace( '/', '-' ),
|
|
122
|
+
/* translators: %s: Block or block variation name. */
|
|
123
|
+
label: sprintf( __( 'Transform to %s' ), title ),
|
|
124
|
+
icon: <BlockIcon icon={ icon } />,
|
|
125
|
+
callback: ( { close } ) => {
|
|
126
|
+
onBlockTransform( name );
|
|
127
|
+
close();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
return { isLoading: false, commands };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const getQuickActionsCommands = () =>
|
|
137
|
+
function useQuickActionsCommands() {
|
|
138
|
+
const { clientIds, isUngroupable, isGroupable } = useSelect(
|
|
139
|
+
( select ) => {
|
|
140
|
+
const {
|
|
141
|
+
getSelectedBlockClientIds,
|
|
142
|
+
isUngroupable: _isUngroupable,
|
|
143
|
+
isGroupable: _isGroupable,
|
|
144
|
+
} = select( blockEditorStore );
|
|
145
|
+
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
clientIds: selectedBlockClientIds,
|
|
149
|
+
isUngroupable: _isUngroupable(),
|
|
150
|
+
isGroupable: _isGroupable(),
|
|
151
|
+
};
|
|
122
152
|
},
|
|
123
|
-
|
|
124
|
-
|
|
153
|
+
[]
|
|
154
|
+
);
|
|
155
|
+
const {
|
|
156
|
+
canInsertBlockType,
|
|
157
|
+
getBlockRootClientId,
|
|
158
|
+
getBlocksByClientId,
|
|
159
|
+
canRemoveBlocks,
|
|
160
|
+
} = useSelect( blockEditorStore );
|
|
161
|
+
const { getDefaultBlockName, getGroupingBlockName } =
|
|
162
|
+
useSelect( blocksStore );
|
|
125
163
|
|
|
126
|
-
|
|
127
|
-
};
|
|
164
|
+
const blocks = getBlocksByClientId( clientIds );
|
|
128
165
|
|
|
129
|
-
const useQuickActionsCommands = () => {
|
|
130
|
-
const { clientIds, isUngroupable, isGroupable } = useSelect( ( select ) => {
|
|
131
166
|
const {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
167
|
+
removeBlocks,
|
|
168
|
+
replaceBlocks,
|
|
169
|
+
duplicateBlocks,
|
|
170
|
+
insertAfterBlock,
|
|
171
|
+
insertBeforeBlock,
|
|
172
|
+
} = useDispatch( blockEditorStore );
|
|
173
|
+
|
|
174
|
+
const onGroup = () => {
|
|
175
|
+
if ( ! blocks.length ) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
137
178
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
179
|
+
const groupingBlockName = getGroupingBlockName();
|
|
180
|
+
|
|
181
|
+
// Activate the `transform` on `core/group` which does the conversion.
|
|
182
|
+
const newBlocks = switchToBlockType( blocks, groupingBlockName );
|
|
183
|
+
|
|
184
|
+
if ( ! newBlocks ) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
replaceBlocks( clientIds, newBlocks );
|
|
142
188
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
getBlocksByClientId,
|
|
148
|
-
canRemoveBlocks,
|
|
149
|
-
} = useSelect( blockEditorStore );
|
|
150
|
-
const { getDefaultBlockName, getGroupingBlockName } =
|
|
151
|
-
useSelect( blocksStore );
|
|
152
|
-
|
|
153
|
-
const blocks = getBlocksByClientId( clientIds );
|
|
154
|
-
|
|
155
|
-
const {
|
|
156
|
-
removeBlocks,
|
|
157
|
-
replaceBlocks,
|
|
158
|
-
duplicateBlocks,
|
|
159
|
-
insertAfterBlock,
|
|
160
|
-
insertBeforeBlock,
|
|
161
|
-
} = useDispatch( blockEditorStore );
|
|
162
|
-
|
|
163
|
-
const onGroup = () => {
|
|
164
|
-
if ( ! blocks.length ) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
189
|
+
const onUngroup = () => {
|
|
190
|
+
if ( ! blocks.length ) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
167
193
|
|
|
168
|
-
|
|
194
|
+
const innerBlocks = blocks[ 0 ].innerBlocks;
|
|
169
195
|
|
|
170
|
-
|
|
171
|
-
|
|
196
|
+
if ( ! innerBlocks.length ) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
172
199
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const onUngroup = () => {
|
|
179
|
-
if ( ! blocks.length ) {
|
|
180
|
-
return;
|
|
200
|
+
replaceBlocks( clientIds, innerBlocks );
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
if ( ! clientIds || clientIds.length < 1 ) {
|
|
204
|
+
return { isLoading: false, commands: [] };
|
|
181
205
|
}
|
|
182
206
|
|
|
183
|
-
const
|
|
207
|
+
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
|
|
208
|
+
const canInsertDefaultBlock = canInsertBlockType(
|
|
209
|
+
getDefaultBlockName(),
|
|
210
|
+
rootClientId
|
|
211
|
+
);
|
|
212
|
+
const canDuplicate = blocks.every( ( block ) => {
|
|
213
|
+
return (
|
|
214
|
+
!! block &&
|
|
215
|
+
hasBlockSupport( block.name, 'multiple', true ) &&
|
|
216
|
+
canInsertBlockType( block.name, rootClientId )
|
|
217
|
+
);
|
|
218
|
+
} );
|
|
219
|
+
const canRemove = canRemoveBlocks( clientIds );
|
|
184
220
|
|
|
185
|
-
|
|
186
|
-
|
|
221
|
+
const commands = [];
|
|
222
|
+
|
|
223
|
+
if ( canDuplicate ) {
|
|
224
|
+
commands.push( {
|
|
225
|
+
name: 'duplicate',
|
|
226
|
+
label: __( 'Duplicate' ),
|
|
227
|
+
callback: () => duplicateBlocks( clientIds, true ),
|
|
228
|
+
icon: copy,
|
|
229
|
+
} );
|
|
187
230
|
}
|
|
188
231
|
|
|
189
|
-
|
|
190
|
-
|
|
232
|
+
if ( canInsertDefaultBlock ) {
|
|
233
|
+
commands.push(
|
|
234
|
+
{
|
|
235
|
+
name: 'add-before',
|
|
236
|
+
label: __( 'Add before' ),
|
|
237
|
+
callback: () => {
|
|
238
|
+
const clientId = Array.isArray( clientIds )
|
|
239
|
+
? clientIds[ 0 ]
|
|
240
|
+
: clientId;
|
|
241
|
+
insertBeforeBlock( clientId );
|
|
242
|
+
},
|
|
243
|
+
icon: add,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'add-after',
|
|
247
|
+
label: __( 'Add after' ),
|
|
248
|
+
callback: () => {
|
|
249
|
+
const clientId = Array.isArray( clientIds )
|
|
250
|
+
? clientIds[ clientIds.length - 1 ]
|
|
251
|
+
: clientId;
|
|
252
|
+
insertAfterBlock( clientId );
|
|
253
|
+
},
|
|
254
|
+
icon: add,
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
191
258
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
);
|
|
201
|
-
const canDuplicate = blocks.every( ( block ) => {
|
|
202
|
-
return (
|
|
203
|
-
!! block &&
|
|
204
|
-
hasBlockSupport( block.name, 'multiple', true ) &&
|
|
205
|
-
canInsertBlockType( block.name, rootClientId )
|
|
206
|
-
);
|
|
207
|
-
} );
|
|
208
|
-
const canRemove = canRemoveBlocks( clientIds );
|
|
259
|
+
if ( isGroupable ) {
|
|
260
|
+
commands.push( {
|
|
261
|
+
name: 'Group',
|
|
262
|
+
label: __( 'Group' ),
|
|
263
|
+
callback: onGroup,
|
|
264
|
+
icon: group,
|
|
265
|
+
} );
|
|
266
|
+
}
|
|
209
267
|
|
|
210
|
-
|
|
268
|
+
if ( isUngroupable ) {
|
|
269
|
+
commands.push( {
|
|
270
|
+
name: 'ungroup',
|
|
271
|
+
label: __( 'Ungroup' ),
|
|
272
|
+
callback: onUngroup,
|
|
273
|
+
icon: ungroup,
|
|
274
|
+
} );
|
|
275
|
+
}
|
|
211
276
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
callback: () => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
: clientId;
|
|
230
|
-
insertBeforeBlock( clientId );
|
|
231
|
-
},
|
|
232
|
-
icon: add,
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: 'add-after',
|
|
236
|
-
label: __( 'Add after' ),
|
|
237
|
-
callback: () => {
|
|
238
|
-
const clientId = Array.isArray( clientIds )
|
|
239
|
-
? clientIds[ clientIds.length - 1 ]
|
|
240
|
-
: clientId;
|
|
241
|
-
insertAfterBlock( clientId );
|
|
277
|
+
if ( canRemove ) {
|
|
278
|
+
commands.push( {
|
|
279
|
+
name: 'remove',
|
|
280
|
+
label: __( 'Delete' ),
|
|
281
|
+
callback: () => removeBlocks( clientIds, true ),
|
|
282
|
+
icon: remove,
|
|
283
|
+
} );
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
isLoading: false,
|
|
288
|
+
commands: commands.map( ( command ) => ( {
|
|
289
|
+
...command,
|
|
290
|
+
name: 'core/block-editor/action-' + command.name,
|
|
291
|
+
callback: ( { close } ) => {
|
|
292
|
+
command.callback();
|
|
293
|
+
close();
|
|
242
294
|
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if ( isGroupable ) {
|
|
249
|
-
commands.push( {
|
|
250
|
-
name: 'Group',
|
|
251
|
-
label: __( 'Group' ),
|
|
252
|
-
callback: onGroup,
|
|
253
|
-
icon: group,
|
|
254
|
-
} );
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
if ( isUngroupable ) {
|
|
258
|
-
commands.push( {
|
|
259
|
-
name: 'ungroup',
|
|
260
|
-
label: __( 'Ungroup' ),
|
|
261
|
-
callback: onUngroup,
|
|
262
|
-
icon: ungroup,
|
|
263
|
-
} );
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if ( canRemove ) {
|
|
267
|
-
commands.push( {
|
|
268
|
-
name: 'remove',
|
|
269
|
-
label: __( 'Delete' ),
|
|
270
|
-
callback: () => removeBlocks( clientIds, true ),
|
|
271
|
-
icon: remove,
|
|
272
|
-
} );
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return {
|
|
276
|
-
isLoading: false,
|
|
277
|
-
commands: commands.map( ( command ) => ( {
|
|
278
|
-
...command,
|
|
279
|
-
name: 'core/block-editor/action-' + command.name,
|
|
280
|
-
callback: ( { close } ) => {
|
|
281
|
-
command.callback();
|
|
282
|
-
close();
|
|
283
|
-
},
|
|
284
|
-
} ) ),
|
|
295
|
+
} ) ),
|
|
296
|
+
};
|
|
285
297
|
};
|
|
286
|
-
};
|
|
287
298
|
|
|
288
299
|
export const useBlockCommands = () => {
|
|
289
300
|
useCommandLoader( {
|
|
290
301
|
name: 'core/block-editor/blockTransforms',
|
|
291
|
-
hook:
|
|
302
|
+
hook: getTransformCommands(),
|
|
292
303
|
} );
|
|
293
304
|
useCommandLoader( {
|
|
294
305
|
name: 'core/block-editor/blockQuickActions',
|
|
295
|
-
hook:
|
|
306
|
+
hook: getQuickActionsCommands(),
|
|
296
307
|
context: 'block-selection-edit',
|
|
297
308
|
} );
|
|
298
309
|
};
|
package/src/hooks/border.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import { store as blockEditorStore } from '../store';
|
|
32
32
|
import { __ } from '@wordpress/i18n';
|
|
33
33
|
|
|
34
|
-
export const BORDER_SUPPORT_KEY = '
|
|
34
|
+
export const BORDER_SUPPORT_KEY = 'border';
|
|
35
35
|
export const SHADOW_SUPPORT_KEY = 'shadow';
|
|
36
36
|
|
|
37
37
|
const getColorByProperty = ( colors, property, value ) => {
|
|
@@ -161,14 +161,8 @@ export function BorderPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
const defaultControls = {
|
|
164
|
-
...getBlockSupport( name, [
|
|
165
|
-
|
|
166
|
-
'__experimentalDefaultControls',
|
|
167
|
-
] ),
|
|
168
|
-
...getBlockSupport( name, [
|
|
169
|
-
SHADOW_SUPPORT_KEY,
|
|
170
|
-
'__experimentalDefaultControls',
|
|
171
|
-
] ),
|
|
164
|
+
...getBlockSupport( name, [ BORDER_SUPPORT_KEY, 'defaultControls' ] ),
|
|
165
|
+
...getBlockSupport( name, [ SHADOW_SUPPORT_KEY, 'defaultControls' ] ),
|
|
172
166
|
};
|
|
173
167
|
|
|
174
168
|
return (
|
package/src/hooks/color.js
CHANGED
|
@@ -290,7 +290,7 @@ export function ColorEdit( { clientId, name, setAttributes, settings } ) {
|
|
|
290
290
|
|
|
291
291
|
const defaultControls = getBlockSupport( name, [
|
|
292
292
|
COLOR_SUPPORT_KEY,
|
|
293
|
-
'
|
|
293
|
+
'defaultControls',
|
|
294
294
|
] );
|
|
295
295
|
|
|
296
296
|
const enableContrastChecking =
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -88,11 +88,11 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
|
|
|
88
88
|
|
|
89
89
|
const defaultDimensionsControls = getBlockSupport( name, [
|
|
90
90
|
DIMENSIONS_SUPPORT_KEY,
|
|
91
|
-
'
|
|
91
|
+
'defaultControls',
|
|
92
92
|
] );
|
|
93
93
|
const defaultSpacingControls = getBlockSupport( name, [
|
|
94
94
|
SPACING_SUPPORT_KEY,
|
|
95
|
-
'
|
|
95
|
+
'defaultControls',
|
|
96
96
|
] );
|
|
97
97
|
const defaultControls = {
|
|
98
98
|
...defaultDimensionsControls,
|
package/src/hooks/font-family.js
CHANGED
|
@@ -13,7 +13,7 @@ import { shouldSkipSerialization } from './utils';
|
|
|
13
13
|
import { TYPOGRAPHY_SUPPORT_KEY } from './typography';
|
|
14
14
|
import { unlock } from '../lock-unlock';
|
|
15
15
|
|
|
16
|
-
export const FONT_FAMILY_SUPPORT_KEY = 'typography.
|
|
16
|
+
export const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
|
|
17
17
|
const { kebabCase } = unlock( componentsPrivateApis );
|
|
18
18
|
|
|
19
19
|
/**
|
package/src/hooks/style.js
CHANGED
|
@@ -98,22 +98,16 @@ function addAttribute( settings ) {
|
|
|
98
98
|
* @type {Record<string, string[]>}
|
|
99
99
|
*/
|
|
100
100
|
const skipSerializationPathsEdit = {
|
|
101
|
-
[ `${ BORDER_SUPPORT_KEY }.
|
|
102
|
-
[ `${ COLOR_SUPPORT_KEY }.
|
|
103
|
-
|
|
104
|
-
],
|
|
105
|
-
[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
101
|
+
[ `${ BORDER_SUPPORT_KEY }.skipSerialization` ]: [ 'border' ],
|
|
102
|
+
[ `${ COLOR_SUPPORT_KEY }.skipSerialization` ]: [ COLOR_SUPPORT_KEY ],
|
|
103
|
+
[ `${ TYPOGRAPHY_SUPPORT_KEY }.skipSerialization` ]: [
|
|
106
104
|
TYPOGRAPHY_SUPPORT_KEY,
|
|
107
105
|
],
|
|
108
|
-
[ `${ DIMENSIONS_SUPPORT_KEY }.
|
|
106
|
+
[ `${ DIMENSIONS_SUPPORT_KEY }.skipSerialization` ]: [
|
|
109
107
|
DIMENSIONS_SUPPORT_KEY,
|
|
110
108
|
],
|
|
111
|
-
[ `${ SPACING_SUPPORT_KEY }.
|
|
112
|
-
|
|
113
|
-
],
|
|
114
|
-
[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
115
|
-
SHADOW_SUPPORT_KEY,
|
|
116
|
-
],
|
|
109
|
+
[ `${ SPACING_SUPPORT_KEY }.skipSerialization` ]: [ SPACING_SUPPORT_KEY ],
|
|
110
|
+
[ `${ SHADOW_SUPPORT_KEY }.skipSerialization` ]: [ SHADOW_SUPPORT_KEY ],
|
|
117
111
|
};
|
|
118
112
|
|
|
119
113
|
/**
|
package/src/hooks/supports.js
CHANGED
|
@@ -6,20 +6,20 @@ import { Platform } from '@wordpress/element';
|
|
|
6
6
|
|
|
7
7
|
const ALIGN_SUPPORT_KEY = 'align';
|
|
8
8
|
const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
|
|
9
|
-
const BORDER_SUPPORT_KEY = '
|
|
9
|
+
const BORDER_SUPPORT_KEY = 'border';
|
|
10
10
|
const COLOR_SUPPORT_KEY = 'color';
|
|
11
11
|
const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
|
|
12
|
-
const FONT_FAMILY_SUPPORT_KEY = 'typography.
|
|
12
|
+
const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
|
|
13
13
|
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
|
|
14
14
|
const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
|
|
15
15
|
/**
|
|
16
16
|
* Key within block settings' support array indicating support for font style.
|
|
17
17
|
*/
|
|
18
|
-
const FONT_STYLE_SUPPORT_KEY = 'typography.
|
|
18
|
+
const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
|
|
19
19
|
/**
|
|
20
20
|
* Key within block settings' support array indicating support for font weight.
|
|
21
21
|
*/
|
|
22
|
-
const FONT_WEIGHT_SUPPORT_KEY = 'typography.
|
|
22
|
+
const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
|
|
23
23
|
/**
|
|
24
24
|
* Key within block settings' supports array indicating support for text
|
|
25
25
|
* align e.g. settings found in `block.json`.
|
|
@@ -34,7 +34,7 @@ const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
|
|
|
34
34
|
* Key within block settings' supports array indicating support for text
|
|
35
35
|
* decorations e.g. settings found in `block.json`.
|
|
36
36
|
*/
|
|
37
|
-
const TEXT_DECORATION_SUPPORT_KEY = 'typography.
|
|
37
|
+
const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
|
|
38
38
|
/**
|
|
39
39
|
* Key within block settings' supports array indicating support for writing mode
|
|
40
40
|
* e.g. settings found in `block.json`.
|
|
@@ -44,13 +44,13 @@ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
|
|
|
44
44
|
* Key within block settings' supports array indicating support for text
|
|
45
45
|
* transforms e.g. settings found in `block.json`.
|
|
46
46
|
*/
|
|
47
|
-
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.
|
|
47
|
+
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Key within block settings' supports array indicating support for letter-spacing
|
|
51
51
|
* e.g. settings found in `block.json`.
|
|
52
52
|
*/
|
|
53
|
-
const LETTER_SPACING_SUPPORT_KEY = 'typography.
|
|
53
|
+
const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
|
|
54
54
|
const LAYOUT_SUPPORT_KEY = 'layout';
|
|
55
55
|
const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
56
56
|
LINE_HEIGHT_SUPPORT_KEY,
|
package/src/hooks/test/style.js
CHANGED
|
@@ -133,8 +133,7 @@ describe( 'addSaveProps', () => {
|
|
|
133
133
|
const applySkipSerialization = ( features ) => {
|
|
134
134
|
const updatedSettings = { ...blockSettings };
|
|
135
135
|
Object.keys( features ).forEach( ( key ) => {
|
|
136
|
-
updatedSettings.supports[ key ].
|
|
137
|
-
features[ key ];
|
|
136
|
+
updatedSettings.supports[ key ].skipSerialization = features[ key ];
|
|
138
137
|
} );
|
|
139
138
|
return updatedSettings;
|
|
140
139
|
};
|