@wordpress/block-editor 11.7.0 → 12.0.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 +8 -0
- package/README.md +56 -57
- package/build/components/block-info-slot-fill/index.js +47 -0
- package/build/components/block-info-slot-fill/index.js.map +1 -0
- package/build/components/block-inspector/index.js +4 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/index.native.js +11 -21
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -9
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +1 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-toolbar/index.js +2 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +83 -9
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +11 -28
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/caption/index.native.js +0 -1
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/editor-styles/index.js +4 -3
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +21 -14
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +15 -59
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +12 -12
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +174 -0
- package/build/components/global-styles/color-panel.native.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +21 -20
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +244 -0
- package/build/components/global-styles/effects-panel.js.map +1 -0
- package/build/components/global-styles/filters-panel.js +215 -0
- package/build/components/global-styles/filters-panel.js.map +1 -0
- package/build/components/global-styles/get-block-css-selector.js +1 -12
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +7 -0
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +28 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +9 -9
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +100 -82
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/use-dimension-handler.js +5 -3
- package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build/components/index.js +23 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +4 -2
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +12 -7
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/index.js +2 -1
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +2 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +5 -3
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/list-view/block-select-button.js +7 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +13 -21
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +37 -10
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +31 -7
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -1
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +1 -1
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +7 -3
- 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 +8 -2
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-replace-flow/index.js +5 -5
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +12 -4
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +2 -7
- package/build/components/off-canvas-editor/appender.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +6 -1
- package/build/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +17 -14
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +38 -0
- package/build/components/resizable-box-popover/index.js.map +1 -0
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +7 -11
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +8 -0
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/hooks/anchor.js +1 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +1 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/duotone.js +121 -70
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/margin.js +27 -17
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +19 -9
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/utils.js +22 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/utils.js +3 -2
- package/build/layouts/utils.js.map +1 -1
- package/build/private-apis.js +13 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +8 -1
- package/build/store/actions.js.map +1 -1
- package/build/utils/object.js +6 -6
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +2 -2
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/use-should-contextual-toolbar-show.js +68 -0
- package/build/utils/use-should-contextual-toolbar-show.js.map +1 -0
- package/build-module/components/block-info-slot-fill/index.js +34 -0
- package/build-module/components/block-info-slot-fill/index.js.map +1 -0
- package/build-module/components/block-inspector/index.js +3 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +11 -19
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +2 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +2 -9
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -9
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +2 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +79 -9
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +10 -27
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/caption/index.native.js +0 -1
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +4 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +21 -14
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +15 -59
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +13 -13
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +150 -0
- package/build-module/components/global-styles/color-panel.native.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +22 -21
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +228 -0
- package/build-module/components/global-styles/effects-panel.js.map +1 -0
- package/build-module/components/global-styles/filters-panel.js +201 -0
- package/build-module/components/global-styles/filters-panel.js.map +1 -0
- package/build-module/components/global-styles/get-block-css-selector.js +1 -12
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +7 -0
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +10 -10
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +101 -83
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/use-dimension-handler.js +5 -3
- package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +5 -2
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +12 -6
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/index.js +2 -1
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +4 -3
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +7 -2
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +15 -22
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +36 -10
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +31 -8
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -1
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +1 -1
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +7 -3
- 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 +8 -4
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +5 -5
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +12 -4
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +1 -5
- package/build-module/components/off-canvas-editor/appender.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +5 -1
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +17 -14
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +26 -0
- package/build-module/components/resizable-box-popover/index.js.map +1 -0
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +7 -10
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +7 -0
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/hooks/anchor.js +1 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/duotone.js +118 -71
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/margin.js +29 -18
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +21 -10
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/utils.js +24 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/utils.js +3 -2
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/private-apis.js +9 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +8 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/object.js +5 -5
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +2 -2
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/use-should-contextual-toolbar-show.js +56 -0
- package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -0
- package/build-style/content-rtl.css +9 -6
- package/build-style/content.css +9 -6
- package/build-style/style-rtl.css +272 -54
- package/build-style/style.css +272 -54
- package/package.json +32 -32
- package/src/components/block-info-slot-fill/index.js +24 -0
- package/src/components/block-inspector/index.js +3 -0
- package/src/components/block-inspector/style.scss +6 -4
- package/src/components/block-list/content.scss +16 -15
- package/src/components/block-list/index.native.js +19 -38
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +9 -9
- package/src/components/block-mover/style.scss +10 -4
- package/src/components/block-mover/test/index.native.js +4 -4
- package/src/components/block-popover/inbetween.js +2 -13
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -12
- package/src/components/block-toolbar/index.js +4 -3
- package/src/components/block-toolbar/style.scss +56 -33
- package/src/components/block-tools/block-contextual-toolbar.js +94 -11
- package/src/components/block-tools/selected-block-popover.js +11 -44
- package/src/components/block-tools/style.scss +157 -3
- package/src/components/caption/index.native.js +0 -1
- package/src/components/date-format-picker/index.js +1 -1
- package/src/components/editor-styles/index.js +9 -5
- package/src/components/font-sizes/fluid-utils.js +31 -14
- package/src/components/font-sizes/test/fluid-utils.js +5 -16
- package/src/components/global-styles/README.md +129 -16
- package/src/components/global-styles/border-panel.js +13 -61
- package/src/components/global-styles/color-panel.js +13 -13
- package/src/components/global-styles/color-panel.native.js +207 -0
- package/src/components/global-styles/dimensions-panel.js +47 -20
- package/src/components/global-styles/effects-panel.js +228 -0
- package/src/components/global-styles/filters-panel.js +230 -0
- package/src/components/global-styles/get-block-css-selector.js +0 -11
- package/src/components/global-styles/hooks.js +10 -0
- package/src/components/global-styles/index.js +2 -0
- package/src/components/global-styles/style.scss +43 -0
- package/src/components/global-styles/test/typography-utils.js +63 -22
- package/src/components/global-styles/test/use-global-styles-output.js +130 -8
- package/src/components/global-styles/typography-panel.js +37 -11
- package/src/components/global-styles/use-global-styles-output.js +88 -72
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-size-control/use-dimension-handler.js +4 -3
- package/src/components/index.js +5 -1
- package/src/components/inserter/block-patterns-tab.js +3 -1
- package/src/components/inserter/block-types-tab.js +9 -6
- package/src/components/inserter/index.js +1 -1
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
- package/src/components/inspector-controls-tabs/utils.js +4 -3
- package/src/components/list-view/README.md +2 -0
- package/src/components/list-view/block-select-button.js +6 -1
- package/src/components/list-view/block.js +24 -31
- package/src/components/list-view/drop-indicator.js +67 -22
- package/src/components/list-view/index.js +26 -3
- package/src/components/list-view/leaf.js +1 -0
- package/src/components/list-view/style.scss +18 -4
- package/src/components/list-view/test/use-list-view-drop-zone.js +188 -0
- package/src/components/list-view/use-block-selection.js +1 -1
- package/src/components/list-view/use-list-view-client-ids.js +5 -3
- package/src/components/list-view/use-list-view-drop-zone.js +9 -3
- package/src/components/media-replace-flow/README.md +3 -2
- package/src/components/media-replace-flow/index.js +4 -5
- package/src/components/navigable-toolbar/index.js +12 -3
- package/src/components/off-canvas-editor/appender.js +1 -4
- package/src/components/off-canvas-editor/block-contents.js +4 -0
- package/src/components/off-canvas-editor/index.js +15 -11
- package/src/components/resizable-box-popover/index.js +27 -0
- package/src/components/rich-text/index.js +0 -1
- package/src/components/rich-text/index.native.js +2 -5
- package/src/components/spacing-sizes-control/spacing-input-control.js +10 -0
- package/src/components/spacing-sizes-control/style.scss +7 -7
- package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +1 -1
- package/src/hooks/duotone.js +162 -99
- package/src/hooks/margin.js +31 -26
- package/src/hooks/padding.js +24 -18
- package/src/hooks/test/anchor.js +113 -0
- package/src/hooks/test/color.js +0 -9
- package/src/hooks/test/use-typography-props.js +2 -2
- package/src/hooks/test/utils.js +20 -101
- package/src/hooks/utils.js +23 -6
- package/src/layouts/utils.js +2 -2
- package/src/private-apis.js +8 -0
- package/src/store/actions.js +8 -1
- package/src/style.scss +1 -0
- package/src/utils/object.js +5 -5
- package/src/utils/test/object.js +53 -15
- package/src/utils/transform-styles/index.js +2 -2
- package/src/utils/use-should-contextual-toolbar-show.js +75 -0
- package/tsconfig.json +1 -0
- package/build/components/rich-text/use-native-props.js +0 -11
- package/build/components/rich-text/use-native-props.js.map +0 -1
- package/build/components/rich-text/use-native-props.native.js +0 -24
- package/build/components/rich-text/use-native-props.native.js.map +0 -1
- package/build/hooks/color-panel.native.js +0 -77
- package/build/hooks/color-panel.native.js.map +0 -1
- package/build-module/components/rich-text/use-native-props.js +0 -4
- package/build-module/components/rich-text/use-native-props.js.map +0 -1
- package/build-module/components/rich-text/use-native-props.native.js +0 -15
- package/build-module/components/rich-text/use-native-props.native.js.map +0 -1
- package/build-module/hooks/color-panel.native.js +0 -62
- package/build-module/hooks/color-panel.native.js.map +0 -1
- package/src/components/rich-text/use-native-props.js +0 -3
- package/src/components/rich-text/use-native-props.native.js +0 -17
- package/src/hooks/color-panel.native.js +0 -63
|
@@ -319,7 +319,7 @@ function getStylesDeclarations() {
|
|
|
319
319
|
return declarations;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
if (
|
|
322
|
+
if (properties && typeof styleValue !== 'string') {
|
|
323
323
|
Object.entries(properties).forEach(entry => {
|
|
324
324
|
const [name, prop] = entry;
|
|
325
325
|
|
|
@@ -360,7 +360,7 @@ function getStylesDeclarations() {
|
|
|
360
360
|
ruleValue = (0, _lodash.get)(tree, refPath); // Presence of another ref indicates a reference to another dynamic value.
|
|
361
361
|
// Pointing to another dynamic value is not supported.
|
|
362
362
|
|
|
363
|
-
if (!ruleValue ||
|
|
363
|
+
if (!ruleValue || (_ruleValue2 = ruleValue) !== null && _ruleValue2 !== void 0 && _ruleValue2.ref) {
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
366
|
} // Calculate fluid typography rules where available.
|
|
@@ -454,7 +454,7 @@ function getLayoutStyles(_ref8) {
|
|
|
454
454
|
// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.
|
|
455
455
|
combinedSelector = selector === _utils.ROOT_BLOCK_SELECTOR ? `:where(.${className}${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''})` : `:where(${selector}.${className}${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''})`;
|
|
456
456
|
} else {
|
|
457
|
-
combinedSelector = selector === _utils.ROOT_BLOCK_SELECTOR ?
|
|
457
|
+
combinedSelector = selector === _utils.ROOT_BLOCK_SELECTOR ? `:where(${selector} .${className})${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''}` : `${selector}-${className}${(spacingStyle === null || spacingStyle === void 0 ? void 0 : spacingStyle.selector) || ''}`;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`;
|
|
@@ -505,6 +505,26 @@ function getLayoutStyles(_ref8) {
|
|
|
505
505
|
return ruleset;
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
+
const STYLE_KEYS = ['border', 'color', 'dimensions', 'spacing', 'typography', 'filter', 'outline', 'shadow'];
|
|
509
|
+
|
|
510
|
+
function pickStyleKeys(treeToPickFrom) {
|
|
511
|
+
if (!treeToPickFrom) {
|
|
512
|
+
return {};
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const entries = Object.entries(treeToPickFrom);
|
|
516
|
+
const pickedEntries = entries.filter(_ref13 => {
|
|
517
|
+
let [key] = _ref13;
|
|
518
|
+
return STYLE_KEYS.includes(key);
|
|
519
|
+
}); // clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it
|
|
520
|
+
|
|
521
|
+
const clonedEntries = pickedEntries.map(_ref14 => {
|
|
522
|
+
let [key, style] = _ref14;
|
|
523
|
+
return [key, JSON.parse(JSON.stringify(style))];
|
|
524
|
+
});
|
|
525
|
+
return Object.fromEntries(clonedEntries);
|
|
526
|
+
}
|
|
527
|
+
|
|
508
528
|
const getNodesWithStyles = (tree, blockSelectors) => {
|
|
509
529
|
var _tree$styles$blocks, _tree$styles3;
|
|
510
530
|
|
|
@@ -512,29 +532,24 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
512
532
|
|
|
513
533
|
if (!(tree !== null && tree !== void 0 && tree.styles)) {
|
|
514
534
|
return nodes;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
const pickStyleKeys = treeToPickFrom => Object.fromEntries(Object.entries(treeToPickFrom !== null && treeToPickFrom !== void 0 ? treeToPickFrom : {}).filter(_ref13 => {
|
|
518
|
-
let [key] = _ref13;
|
|
519
|
-
return ['border', 'color', 'dimensions', 'spacing', 'typography', 'filter', 'outline', 'shadow'].includes(key);
|
|
520
|
-
})); // Top-level.
|
|
535
|
+
} // Top-level.
|
|
521
536
|
|
|
522
537
|
|
|
523
538
|
const styles = pickStyleKeys(tree.styles);
|
|
524
539
|
|
|
525
|
-
if (
|
|
540
|
+
if (styles) {
|
|
526
541
|
nodes.push({
|
|
527
542
|
styles,
|
|
528
543
|
selector: _utils.ROOT_BLOCK_SELECTOR
|
|
529
544
|
});
|
|
530
545
|
}
|
|
531
546
|
|
|
532
|
-
Object.entries(_blocks.__EXPERIMENTAL_ELEMENTS).forEach(
|
|
547
|
+
Object.entries(_blocks.__EXPERIMENTAL_ELEMENTS).forEach(_ref15 => {
|
|
533
548
|
var _tree$styles, _tree$styles$elements;
|
|
534
549
|
|
|
535
|
-
let [name, selector] =
|
|
550
|
+
let [name, selector] = _ref15;
|
|
536
551
|
|
|
537
|
-
if (
|
|
552
|
+
if ((_tree$styles = tree.styles) !== null && _tree$styles !== void 0 && (_tree$styles$elements = _tree$styles.elements) !== null && _tree$styles$elements !== void 0 && _tree$styles$elements[name]) {
|
|
538
553
|
var _tree$styles2, _tree$styles2$element;
|
|
539
554
|
|
|
540
555
|
nodes.push({
|
|
@@ -544,10 +559,10 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
544
559
|
}
|
|
545
560
|
}); // Iterate over blocks: they can have styles & elements.
|
|
546
561
|
|
|
547
|
-
Object.entries((_tree$styles$blocks = (_tree$styles3 = tree.styles) === null || _tree$styles3 === void 0 ? void 0 : _tree$styles3.blocks) !== null && _tree$styles$blocks !== void 0 ? _tree$styles$blocks : {}).forEach(
|
|
562
|
+
Object.entries((_tree$styles$blocks = (_tree$styles3 = tree.styles) === null || _tree$styles3 === void 0 ? void 0 : _tree$styles3.blocks) !== null && _tree$styles$blocks !== void 0 ? _tree$styles$blocks : {}).forEach(_ref16 => {
|
|
548
563
|
var _blockSelectors$block, _node$elements;
|
|
549
564
|
|
|
550
|
-
let [blockName, node] =
|
|
565
|
+
let [blockName, node] = _ref16;
|
|
551
566
|
const blockStyles = pickStyleKeys(node);
|
|
552
567
|
|
|
553
568
|
if (node !== null && node !== void 0 && node.variations) {
|
|
@@ -558,29 +573,27 @@ const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
558
573
|
blockStyles.variations = variations;
|
|
559
574
|
}
|
|
560
575
|
|
|
561
|
-
if (
|
|
562
|
-
var _blockSelectors$block2;
|
|
563
|
-
|
|
576
|
+
if (blockStyles && blockSelectors !== null && blockSelectors !== void 0 && (_blockSelectors$block = blockSelectors[blockName]) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block.selector) {
|
|
564
577
|
nodes.push({
|
|
565
578
|
duotoneSelector: blockSelectors[blockName].duotoneSelector,
|
|
566
579
|
fallbackGapValue: blockSelectors[blockName].fallbackGapValue,
|
|
567
580
|
hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport,
|
|
568
|
-
selector:
|
|
581
|
+
selector: blockSelectors[blockName].selector,
|
|
569
582
|
styles: blockStyles,
|
|
570
583
|
featureSelectors: blockSelectors[blockName].featureSelectors,
|
|
571
584
|
styleVariationSelectors: blockSelectors[blockName].styleVariationSelectors
|
|
572
585
|
});
|
|
573
586
|
}
|
|
574
587
|
|
|
575
|
-
Object.entries((_node$elements = node === null || node === void 0 ? void 0 : node.elements) !== null && _node$elements !== void 0 ? _node$elements : {}).forEach(
|
|
576
|
-
let [elementName, value] =
|
|
588
|
+
Object.entries((_node$elements = node === null || node === void 0 ? void 0 : node.elements) !== null && _node$elements !== void 0 ? _node$elements : {}).forEach(_ref17 => {
|
|
589
|
+
let [elementName, value] = _ref17;
|
|
577
590
|
|
|
578
|
-
if (
|
|
579
|
-
var _blockSelectors$
|
|
591
|
+
if (value && blockSelectors !== null && blockSelectors !== void 0 && blockSelectors[blockName] && _blocks.__EXPERIMENTAL_ELEMENTS[elementName]) {
|
|
592
|
+
var _blockSelectors$block2;
|
|
580
593
|
|
|
581
594
|
nodes.push({
|
|
582
595
|
styles: value,
|
|
583
|
-
selector: (_blockSelectors$
|
|
596
|
+
selector: (_blockSelectors$block2 = blockSelectors[blockName]) === null || _blockSelectors$block2 === void 0 ? void 0 : _blockSelectors$block2.selector.split(',').map(sel => {
|
|
584
597
|
const elementSelectors = _blocks.__EXPERIMENTAL_ELEMENTS[elementName].split(',');
|
|
585
598
|
|
|
586
599
|
return elementSelectors.map(elementSelector => sel + ' ' + elementSelector);
|
|
@@ -606,10 +619,10 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
606
619
|
const pickPresets = treeToPickFrom => {
|
|
607
620
|
const presets = {};
|
|
608
621
|
|
|
609
|
-
_utils.PRESET_METADATA.forEach(
|
|
622
|
+
_utils.PRESET_METADATA.forEach(_ref18 => {
|
|
610
623
|
let {
|
|
611
624
|
path
|
|
612
|
-
} =
|
|
625
|
+
} = _ref18;
|
|
613
626
|
const value = (0, _lodash.get)(treeToPickFrom, path, false);
|
|
614
627
|
|
|
615
628
|
if (value !== false) {
|
|
@@ -624,7 +637,7 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
624
637
|
const presets = pickPresets(tree.settings);
|
|
625
638
|
const custom = (_tree$settings4 = tree.settings) === null || _tree$settings4 === void 0 ? void 0 : _tree$settings4.custom;
|
|
626
639
|
|
|
627
|
-
if (!(0, _lodash.isEmpty)(presets) ||
|
|
640
|
+
if (!(0, _lodash.isEmpty)(presets) || custom) {
|
|
628
641
|
nodes.push({
|
|
629
642
|
presets,
|
|
630
643
|
custom,
|
|
@@ -633,18 +646,18 @@ const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
633
646
|
} // Blocks.
|
|
634
647
|
|
|
635
648
|
|
|
636
|
-
Object.entries((_tree$settings$blocks = (_tree$settings5 = tree.settings) === null || _tree$settings5 === void 0 ? void 0 : _tree$settings5.blocks) !== null && _tree$settings$blocks !== void 0 ? _tree$settings$blocks : {}).forEach(
|
|
637
|
-
let [blockName, node] =
|
|
649
|
+
Object.entries((_tree$settings$blocks = (_tree$settings5 = tree.settings) === null || _tree$settings5 === void 0 ? void 0 : _tree$settings5.blocks) !== null && _tree$settings$blocks !== void 0 ? _tree$settings$blocks : {}).forEach(_ref19 => {
|
|
650
|
+
let [blockName, node] = _ref19;
|
|
638
651
|
const blockPresets = pickPresets(node);
|
|
639
652
|
const blockCustom = node.custom;
|
|
640
653
|
|
|
641
|
-
if (!(0, _lodash.isEmpty)(blockPresets) ||
|
|
642
|
-
var _blockSelectors$
|
|
654
|
+
if (!(0, _lodash.isEmpty)(blockPresets) || blockCustom) {
|
|
655
|
+
var _blockSelectors$block3;
|
|
643
656
|
|
|
644
657
|
nodes.push({
|
|
645
658
|
presets: blockPresets,
|
|
646
659
|
custom: blockCustom,
|
|
647
|
-
selector: (_blockSelectors$
|
|
660
|
+
selector: (_blockSelectors$block3 = blockSelectors[blockName]) === null || _blockSelectors$block3 === void 0 ? void 0 : _blockSelectors$block3.selector
|
|
648
661
|
});
|
|
649
662
|
}
|
|
650
663
|
});
|
|
@@ -656,12 +669,12 @@ exports.getNodesWithSettings = getNodesWithSettings;
|
|
|
656
669
|
const toCustomProperties = (tree, blockSelectors) => {
|
|
657
670
|
const settings = getNodesWithSettings(tree, blockSelectors);
|
|
658
671
|
let ruleset = '';
|
|
659
|
-
settings.forEach(
|
|
672
|
+
settings.forEach(_ref20 => {
|
|
660
673
|
let {
|
|
661
674
|
presets,
|
|
662
675
|
custom,
|
|
663
676
|
selector
|
|
664
|
-
} =
|
|
677
|
+
} = _ref20;
|
|
665
678
|
const declarations = getPresetsDeclarations(presets, tree === null || tree === void 0 ? void 0 : tree.settings);
|
|
666
679
|
const customProps = flattenTree(custom, '--wp--custom--', '--');
|
|
667
680
|
|
|
@@ -670,7 +683,7 @@ const toCustomProperties = (tree, blockSelectors) => {
|
|
|
670
683
|
}
|
|
671
684
|
|
|
672
685
|
if (declarations.length > 0) {
|
|
673
|
-
ruleset
|
|
686
|
+
ruleset += `${selector}{${declarations.join(';')};}`;
|
|
674
687
|
}
|
|
675
688
|
});
|
|
676
689
|
return ruleset;
|
|
@@ -723,7 +736,7 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
723
736
|
}
|
|
724
737
|
|
|
725
738
|
ruleset += '}';
|
|
726
|
-
nodesWithStyles.forEach(
|
|
739
|
+
nodesWithStyles.forEach(_ref21 => {
|
|
727
740
|
let {
|
|
728
741
|
selector,
|
|
729
742
|
duotoneSelector,
|
|
@@ -732,70 +745,67 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
732
745
|
hasLayoutSupport,
|
|
733
746
|
featureSelectors,
|
|
734
747
|
styleVariationSelectors
|
|
735
|
-
} =
|
|
748
|
+
} = _ref21;
|
|
736
749
|
|
|
737
750
|
// Process styles for block support features with custom feature level
|
|
738
751
|
// CSS selectors set.
|
|
739
752
|
if (featureSelectors) {
|
|
740
753
|
const featureDeclarations = getFeatureDeclarations(featureSelectors, styles);
|
|
741
|
-
Object.entries(featureDeclarations).forEach(
|
|
742
|
-
let [cssSelector, declarations] =
|
|
754
|
+
Object.entries(featureDeclarations).forEach(_ref22 => {
|
|
755
|
+
let [cssSelector, declarations] = _ref22;
|
|
743
756
|
|
|
744
|
-
if (
|
|
757
|
+
if (declarations.length) {
|
|
745
758
|
const rules = declarations.join(';');
|
|
746
|
-
ruleset
|
|
759
|
+
ruleset += `${cssSelector}{${rules};}`;
|
|
747
760
|
}
|
|
748
761
|
});
|
|
749
762
|
}
|
|
750
763
|
|
|
751
764
|
if (styleVariationSelectors) {
|
|
752
|
-
Object.entries(styleVariationSelectors).forEach(
|
|
765
|
+
Object.entries(styleVariationSelectors).forEach(_ref23 => {
|
|
753
766
|
var _styles$variations;
|
|
754
767
|
|
|
755
|
-
let [styleVariationName, styleVariationSelector] =
|
|
756
|
-
|
|
757
|
-
if (styles !== null && styles !== void 0 && (_styles$variations = styles.variations) !== null && _styles$variations !== void 0 && _styles$variations[styleVariationName]) {
|
|
758
|
-
var _styles$variations3;
|
|
768
|
+
let [styleVariationName, styleVariationSelector] = _ref23;
|
|
769
|
+
const styleVariations = styles === null || styles === void 0 ? void 0 : (_styles$variations = styles.variations) === null || _styles$variations === void 0 ? void 0 : _styles$variations[styleVariationName];
|
|
759
770
|
|
|
771
|
+
if (styleVariations) {
|
|
760
772
|
// If the block uses any custom selectors for block support, add those first.
|
|
761
773
|
if (featureSelectors) {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
Object.entries(featureDeclarations).forEach(_ref23 => {
|
|
766
|
-
let [baseSelector, declarations] = _ref23;
|
|
774
|
+
const featureDeclarations = getFeatureDeclarations(featureSelectors, styleVariations);
|
|
775
|
+
Object.entries(featureDeclarations).forEach(_ref24 => {
|
|
776
|
+
let [baseSelector, declarations] = _ref24;
|
|
767
777
|
|
|
768
|
-
if (
|
|
778
|
+
if (declarations.length) {
|
|
769
779
|
const cssSelector = concatFeatureVariationSelectorString(baseSelector, styleVariationSelector);
|
|
770
780
|
const rules = declarations.join(';');
|
|
771
|
-
ruleset
|
|
781
|
+
ruleset += `${cssSelector}{${rules};}`;
|
|
772
782
|
}
|
|
773
783
|
});
|
|
774
784
|
} // Otherwise add regular selectors.
|
|
775
785
|
|
|
776
786
|
|
|
777
|
-
const styleVariationDeclarations = getStylesDeclarations(
|
|
787
|
+
const styleVariationDeclarations = getStylesDeclarations(styleVariations, styleVariationSelector, useRootPaddingAlign, tree);
|
|
778
788
|
|
|
779
|
-
if (
|
|
780
|
-
ruleset
|
|
789
|
+
if (styleVariationDeclarations.length) {
|
|
790
|
+
ruleset += `${styleVariationSelector}{${styleVariationDeclarations.join(';')};}`;
|
|
781
791
|
}
|
|
782
792
|
}
|
|
783
793
|
});
|
|
784
|
-
}
|
|
794
|
+
} // Process duotone styles.
|
|
785
795
|
|
|
786
|
-
const duotoneStyles = {};
|
|
787
796
|
|
|
788
|
-
if (
|
|
789
|
-
duotoneStyles
|
|
790
|
-
delete styles.filter;
|
|
791
|
-
} // Process duotone styles (they use color.__experimentalDuotone selector).
|
|
797
|
+
if (duotoneSelector) {
|
|
798
|
+
const duotoneStyles = {};
|
|
792
799
|
|
|
800
|
+
if (styles !== null && styles !== void 0 && styles.filter) {
|
|
801
|
+
duotoneStyles.filter = styles.filter;
|
|
802
|
+
delete styles.filter;
|
|
803
|
+
}
|
|
793
804
|
|
|
794
|
-
if (duotoneSelector) {
|
|
795
805
|
const duotoneDeclarations = getStylesDeclarations(duotoneStyles);
|
|
796
806
|
|
|
797
|
-
if (duotoneDeclarations.length
|
|
798
|
-
ruleset
|
|
807
|
+
if (duotoneDeclarations.length) {
|
|
808
|
+
ruleset += `${duotoneSelector}{${duotoneDeclarations.join(';')};}`;
|
|
799
809
|
}
|
|
800
810
|
} // Process blockGap and layout styles.
|
|
801
811
|
|
|
@@ -815,18 +825,18 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
815
825
|
const declarations = getStylesDeclarations(styles, selector, useRootPaddingAlign, tree);
|
|
816
826
|
|
|
817
827
|
if (declarations !== null && declarations !== void 0 && declarations.length) {
|
|
818
|
-
ruleset
|
|
828
|
+
ruleset += `${selector}{${declarations.join(';')};}`;
|
|
819
829
|
} // Check for pseudo selector in `styles` and handle separately.
|
|
820
830
|
|
|
821
831
|
|
|
822
|
-
const pseudoSelectorStyles = Object.entries(styles).filter(
|
|
823
|
-
let [key] =
|
|
832
|
+
const pseudoSelectorStyles = Object.entries(styles).filter(_ref25 => {
|
|
833
|
+
let [key] = _ref25;
|
|
824
834
|
return key.startsWith(':');
|
|
825
835
|
});
|
|
826
836
|
|
|
827
837
|
if (pseudoSelectorStyles !== null && pseudoSelectorStyles !== void 0 && pseudoSelectorStyles.length) {
|
|
828
|
-
pseudoSelectorStyles.forEach(
|
|
829
|
-
let [pseudoKey, pseudoStyle] =
|
|
838
|
+
pseudoSelectorStyles.forEach(_ref26 => {
|
|
839
|
+
let [pseudoKey, pseudoStyle] = _ref26;
|
|
830
840
|
const pseudoDeclarations = getStylesDeclarations(pseudoStyle);
|
|
831
841
|
|
|
832
842
|
if (!(pseudoDeclarations !== null && pseudoDeclarations !== void 0 && pseudoDeclarations.length)) {
|
|
@@ -843,7 +853,7 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
843
853
|
const _selector = selector.split(',').map(sel => sel + pseudoKey).join(',');
|
|
844
854
|
|
|
845
855
|
const pseudoRule = `${_selector}{${pseudoDeclarations.join(';')};}`;
|
|
846
|
-
ruleset
|
|
856
|
+
ruleset += pseudoRule;
|
|
847
857
|
});
|
|
848
858
|
}
|
|
849
859
|
});
|
|
@@ -858,15 +868,16 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
858
868
|
|
|
859
869
|
// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.
|
|
860
870
|
const gapValue = (0, _gap.getGapCSSValue)(tree === null || tree === void 0 ? void 0 : (_tree$styles4 = tree.styles) === null || _tree$styles4 === void 0 ? void 0 : (_tree$styles4$spacing = _tree$styles4.spacing) === null || _tree$styles4$spacing === void 0 ? void 0 : _tree$styles4$spacing.blockGap) || '0.5em';
|
|
861
|
-
ruleset = ruleset +
|
|
862
|
-
ruleset = ruleset +
|
|
871
|
+
ruleset = ruleset + `:where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`;
|
|
872
|
+
ruleset = ruleset + ':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';
|
|
873
|
+
ruleset = ruleset + ':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';
|
|
863
874
|
}
|
|
864
875
|
|
|
865
|
-
nodesWithSettings.forEach(
|
|
876
|
+
nodesWithSettings.forEach(_ref27 => {
|
|
866
877
|
let {
|
|
867
878
|
selector,
|
|
868
879
|
presets
|
|
869
|
-
} =
|
|
880
|
+
} = _ref27;
|
|
870
881
|
|
|
871
882
|
if (_utils.ROOT_BLOCK_SELECTOR === selector) {
|
|
872
883
|
// Do not add extra specificity for top-level classes.
|
|
@@ -876,7 +887,7 @@ const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallback
|
|
|
876
887
|
const classes = getPresetsClasses(selector, presets);
|
|
877
888
|
|
|
878
889
|
if (!(0, _lodash.isEmpty)(classes)) {
|
|
879
|
-
ruleset
|
|
890
|
+
ruleset += classes;
|
|
880
891
|
}
|
|
881
892
|
});
|
|
882
893
|
return ruleset;
|
|
@@ -886,10 +897,10 @@ exports.toStyles = toStyles;
|
|
|
886
897
|
|
|
887
898
|
function toSvgFilters(tree, blockSelectors) {
|
|
888
899
|
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
|
|
889
|
-
return nodesWithSettings.flatMap(
|
|
900
|
+
return nodesWithSettings.flatMap(_ref28 => {
|
|
890
901
|
let {
|
|
891
902
|
presets
|
|
892
|
-
} =
|
|
903
|
+
} = _ref28;
|
|
893
904
|
return getPresetsSvgFilters(presets);
|
|
894
905
|
});
|
|
895
906
|
}
|
|
@@ -902,8 +913,8 @@ const getSelectorsConfig = (blockType, rootSelector) => {
|
|
|
902
913
|
const config = {
|
|
903
914
|
root: rootSelector
|
|
904
915
|
};
|
|
905
|
-
Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(
|
|
906
|
-
let [featureKey, featureName] =
|
|
916
|
+
Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(_ref29 => {
|
|
917
|
+
let [featureKey, featureName] = _ref29;
|
|
907
918
|
const featureSelector = (0, _getBlockCssSelector.getBlockCSSSelector)(blockType, featureKey);
|
|
908
919
|
|
|
909
920
|
if (featureSelector) {
|
|
@@ -919,8 +930,15 @@ const getBlockSelectors = (blockTypes, getBlockStyles) => {
|
|
|
919
930
|
var _blockType$supports, _blockType$supports2, _blockType$supports2$, _blockType$supports2$2;
|
|
920
931
|
|
|
921
932
|
const name = blockType.name;
|
|
922
|
-
const selector = (0, _getBlockCssSelector.getBlockCSSSelector)(blockType
|
|
923
|
-
|
|
933
|
+
const selector = (0, _getBlockCssSelector.getBlockCSSSelector)(blockType);
|
|
934
|
+
let duotoneSelector = (0, _getBlockCssSelector.getBlockCSSSelector)(blockType, 'filter.duotone'); // Keep backwards compatibility for support.color.__experimentalDuotone.
|
|
935
|
+
|
|
936
|
+
if (!duotoneSelector) {
|
|
937
|
+
const rootSelector = (0, _getBlockCssSelector.getBlockCSSSelector)(blockType);
|
|
938
|
+
const duotoneSupport = (0, _blocks.getBlockSupport)(blockType, 'color.__experimentalDuotone', false);
|
|
939
|
+
duotoneSelector = duotoneSupport && (0, _utils.scopeSelector)(rootSelector, duotoneSupport);
|
|
940
|
+
}
|
|
941
|
+
|
|
924
942
|
const hasLayoutSupport = !!(blockType !== null && blockType !== void 0 && (_blockType$supports = blockType.supports) !== null && _blockType$supports !== void 0 && _blockType$supports.__experimentalLayout);
|
|
925
943
|
const fallbackGapValue = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports2 = blockType.supports) === null || _blockType$supports2 === void 0 ? void 0 : (_blockType$supports2$ = _blockType$supports2.spacing) === null || _blockType$supports2$ === void 0 ? void 0 : (_blockType$supports2$2 = _blockType$supports2$.blockGap) === null || _blockType$supports2$2 === void 0 ? void 0 : _blockType$supports2$2.__experimentalDefault;
|
|
926
944
|
const blockStyleVariations = getBlockStyles(name);
|