@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
|
@@ -8,7 +8,7 @@ import { get, isEmpty, kebabCase, set } from 'lodash';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { __EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY, __EXPERIMENTAL_ELEMENTS as ELEMENTS, getBlockTypes, store as blocksStore } from '@wordpress/blocks';
|
|
11
|
+
import { __EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY, __EXPERIMENTAL_ELEMENTS as ELEMENTS, getBlockSupport, getBlockTypes, store as blocksStore } from '@wordpress/blocks';
|
|
12
12
|
import { useSelect } from '@wordpress/data';
|
|
13
13
|
import { renderToString, useContext, useMemo } from '@wordpress/element';
|
|
14
14
|
import { getCSSRules } from '@wordpress/style-engine';
|
|
@@ -295,7 +295,7 @@ export function getStylesDeclarations() {
|
|
|
295
295
|
return declarations;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
if (
|
|
298
|
+
if (properties && typeof styleValue !== 'string') {
|
|
299
299
|
Object.entries(properties).forEach(entry => {
|
|
300
300
|
const [name, prop] = entry;
|
|
301
301
|
|
|
@@ -336,7 +336,7 @@ export function getStylesDeclarations() {
|
|
|
336
336
|
ruleValue = get(tree, refPath); // Presence of another ref indicates a reference to another dynamic value.
|
|
337
337
|
// Pointing to another dynamic value is not supported.
|
|
338
338
|
|
|
339
|
-
if (!ruleValue ||
|
|
339
|
+
if (!ruleValue || (_ruleValue2 = ruleValue) !== null && _ruleValue2 !== void 0 && _ruleValue2.ref) {
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
} // Calculate fluid typography rules where available.
|
|
@@ -429,7 +429,7 @@ export function getLayoutStyles(_ref8) {
|
|
|
429
429
|
// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.
|
|
430
430
|
combinedSelector = selector === 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) || ''})`;
|
|
431
431
|
} else {
|
|
432
|
-
combinedSelector = selector === ROOT_BLOCK_SELECTOR ?
|
|
432
|
+
combinedSelector = selector === 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) || ''}`;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`;
|
|
@@ -479,6 +479,26 @@ export function getLayoutStyles(_ref8) {
|
|
|
479
479
|
|
|
480
480
|
return ruleset;
|
|
481
481
|
}
|
|
482
|
+
const STYLE_KEYS = ['border', 'color', 'dimensions', 'spacing', 'typography', 'filter', 'outline', 'shadow'];
|
|
483
|
+
|
|
484
|
+
function pickStyleKeys(treeToPickFrom) {
|
|
485
|
+
if (!treeToPickFrom) {
|
|
486
|
+
return {};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const entries = Object.entries(treeToPickFrom);
|
|
490
|
+
const pickedEntries = entries.filter(_ref13 => {
|
|
491
|
+
let [key] = _ref13;
|
|
492
|
+
return STYLE_KEYS.includes(key);
|
|
493
|
+
}); // clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it
|
|
494
|
+
|
|
495
|
+
const clonedEntries = pickedEntries.map(_ref14 => {
|
|
496
|
+
let [key, style] = _ref14;
|
|
497
|
+
return [key, JSON.parse(JSON.stringify(style))];
|
|
498
|
+
});
|
|
499
|
+
return Object.fromEntries(clonedEntries);
|
|
500
|
+
}
|
|
501
|
+
|
|
482
502
|
export const getNodesWithStyles = (tree, blockSelectors) => {
|
|
483
503
|
var _tree$styles$blocks, _tree$styles3;
|
|
484
504
|
|
|
@@ -486,29 +506,24 @@ export const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
486
506
|
|
|
487
507
|
if (!(tree !== null && tree !== void 0 && tree.styles)) {
|
|
488
508
|
return nodes;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
const pickStyleKeys = treeToPickFrom => Object.fromEntries(Object.entries(treeToPickFrom !== null && treeToPickFrom !== void 0 ? treeToPickFrom : {}).filter(_ref13 => {
|
|
492
|
-
let [key] = _ref13;
|
|
493
|
-
return ['border', 'color', 'dimensions', 'spacing', 'typography', 'filter', 'outline', 'shadow'].includes(key);
|
|
494
|
-
})); // Top-level.
|
|
509
|
+
} // Top-level.
|
|
495
510
|
|
|
496
511
|
|
|
497
512
|
const styles = pickStyleKeys(tree.styles);
|
|
498
513
|
|
|
499
|
-
if (
|
|
514
|
+
if (styles) {
|
|
500
515
|
nodes.push({
|
|
501
516
|
styles,
|
|
502
517
|
selector: ROOT_BLOCK_SELECTOR
|
|
503
518
|
});
|
|
504
519
|
}
|
|
505
520
|
|
|
506
|
-
Object.entries(ELEMENTS).forEach(
|
|
521
|
+
Object.entries(ELEMENTS).forEach(_ref15 => {
|
|
507
522
|
var _tree$styles, _tree$styles$elements;
|
|
508
523
|
|
|
509
|
-
let [name, selector] =
|
|
524
|
+
let [name, selector] = _ref15;
|
|
510
525
|
|
|
511
|
-
if (
|
|
526
|
+
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]) {
|
|
512
527
|
var _tree$styles2, _tree$styles2$element;
|
|
513
528
|
|
|
514
529
|
nodes.push({
|
|
@@ -518,10 +533,10 @@ export const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
518
533
|
}
|
|
519
534
|
}); // Iterate over blocks: they can have styles & elements.
|
|
520
535
|
|
|
521
|
-
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(
|
|
536
|
+
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 => {
|
|
522
537
|
var _blockSelectors$block, _node$elements;
|
|
523
538
|
|
|
524
|
-
let [blockName, node] =
|
|
539
|
+
let [blockName, node] = _ref16;
|
|
525
540
|
const blockStyles = pickStyleKeys(node);
|
|
526
541
|
|
|
527
542
|
if (node !== null && node !== void 0 && node.variations) {
|
|
@@ -532,29 +547,27 @@ export const getNodesWithStyles = (tree, blockSelectors) => {
|
|
|
532
547
|
blockStyles.variations = variations;
|
|
533
548
|
}
|
|
534
549
|
|
|
535
|
-
if (
|
|
536
|
-
var _blockSelectors$block2;
|
|
537
|
-
|
|
550
|
+
if (blockStyles && blockSelectors !== null && blockSelectors !== void 0 && (_blockSelectors$block = blockSelectors[blockName]) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block.selector) {
|
|
538
551
|
nodes.push({
|
|
539
552
|
duotoneSelector: blockSelectors[blockName].duotoneSelector,
|
|
540
553
|
fallbackGapValue: blockSelectors[blockName].fallbackGapValue,
|
|
541
554
|
hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport,
|
|
542
|
-
selector:
|
|
555
|
+
selector: blockSelectors[blockName].selector,
|
|
543
556
|
styles: blockStyles,
|
|
544
557
|
featureSelectors: blockSelectors[blockName].featureSelectors,
|
|
545
558
|
styleVariationSelectors: blockSelectors[blockName].styleVariationSelectors
|
|
546
559
|
});
|
|
547
560
|
}
|
|
548
561
|
|
|
549
|
-
Object.entries((_node$elements = node === null || node === void 0 ? void 0 : node.elements) !== null && _node$elements !== void 0 ? _node$elements : {}).forEach(
|
|
550
|
-
let [elementName, value] =
|
|
562
|
+
Object.entries((_node$elements = node === null || node === void 0 ? void 0 : node.elements) !== null && _node$elements !== void 0 ? _node$elements : {}).forEach(_ref17 => {
|
|
563
|
+
let [elementName, value] = _ref17;
|
|
551
564
|
|
|
552
|
-
if (
|
|
553
|
-
var _blockSelectors$
|
|
565
|
+
if (value && blockSelectors !== null && blockSelectors !== void 0 && blockSelectors[blockName] && ELEMENTS[elementName]) {
|
|
566
|
+
var _blockSelectors$block2;
|
|
554
567
|
|
|
555
568
|
nodes.push({
|
|
556
569
|
styles: value,
|
|
557
|
-
selector: (_blockSelectors$
|
|
570
|
+
selector: (_blockSelectors$block2 = blockSelectors[blockName]) === null || _blockSelectors$block2 === void 0 ? void 0 : _blockSelectors$block2.selector.split(',').map(sel => {
|
|
558
571
|
const elementSelectors = ELEMENTS[elementName].split(',');
|
|
559
572
|
return elementSelectors.map(elementSelector => sel + ' ' + elementSelector);
|
|
560
573
|
}).join(',')
|
|
@@ -575,10 +588,10 @@ export const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
575
588
|
|
|
576
589
|
const pickPresets = treeToPickFrom => {
|
|
577
590
|
const presets = {};
|
|
578
|
-
PRESET_METADATA.forEach(
|
|
591
|
+
PRESET_METADATA.forEach(_ref18 => {
|
|
579
592
|
let {
|
|
580
593
|
path
|
|
581
|
-
} =
|
|
594
|
+
} = _ref18;
|
|
582
595
|
const value = get(treeToPickFrom, path, false);
|
|
583
596
|
|
|
584
597
|
if (value !== false) {
|
|
@@ -592,7 +605,7 @@ export const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
592
605
|
const presets = pickPresets(tree.settings);
|
|
593
606
|
const custom = (_tree$settings4 = tree.settings) === null || _tree$settings4 === void 0 ? void 0 : _tree$settings4.custom;
|
|
594
607
|
|
|
595
|
-
if (!isEmpty(presets) ||
|
|
608
|
+
if (!isEmpty(presets) || custom) {
|
|
596
609
|
nodes.push({
|
|
597
610
|
presets,
|
|
598
611
|
custom,
|
|
@@ -601,18 +614,18 @@ export const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
601
614
|
} // Blocks.
|
|
602
615
|
|
|
603
616
|
|
|
604
|
-
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(
|
|
605
|
-
let [blockName, node] =
|
|
617
|
+
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 => {
|
|
618
|
+
let [blockName, node] = _ref19;
|
|
606
619
|
const blockPresets = pickPresets(node);
|
|
607
620
|
const blockCustom = node.custom;
|
|
608
621
|
|
|
609
|
-
if (!isEmpty(blockPresets) ||
|
|
610
|
-
var _blockSelectors$
|
|
622
|
+
if (!isEmpty(blockPresets) || blockCustom) {
|
|
623
|
+
var _blockSelectors$block3;
|
|
611
624
|
|
|
612
625
|
nodes.push({
|
|
613
626
|
presets: blockPresets,
|
|
614
627
|
custom: blockCustom,
|
|
615
|
-
selector: (_blockSelectors$
|
|
628
|
+
selector: (_blockSelectors$block3 = blockSelectors[blockName]) === null || _blockSelectors$block3 === void 0 ? void 0 : _blockSelectors$block3.selector
|
|
616
629
|
});
|
|
617
630
|
}
|
|
618
631
|
});
|
|
@@ -621,12 +634,12 @@ export const getNodesWithSettings = (tree, blockSelectors) => {
|
|
|
621
634
|
export const toCustomProperties = (tree, blockSelectors) => {
|
|
622
635
|
const settings = getNodesWithSettings(tree, blockSelectors);
|
|
623
636
|
let ruleset = '';
|
|
624
|
-
settings.forEach(
|
|
637
|
+
settings.forEach(_ref20 => {
|
|
625
638
|
let {
|
|
626
639
|
presets,
|
|
627
640
|
custom,
|
|
628
641
|
selector
|
|
629
|
-
} =
|
|
642
|
+
} = _ref20;
|
|
630
643
|
const declarations = getPresetsDeclarations(presets, tree === null || tree === void 0 ? void 0 : tree.settings);
|
|
631
644
|
const customProps = flattenTree(custom, '--wp--custom--', '--');
|
|
632
645
|
|
|
@@ -635,7 +648,7 @@ export const toCustomProperties = (tree, blockSelectors) => {
|
|
|
635
648
|
}
|
|
636
649
|
|
|
637
650
|
if (declarations.length > 0) {
|
|
638
|
-
ruleset
|
|
651
|
+
ruleset += `${selector}{${declarations.join(';')};}`;
|
|
639
652
|
}
|
|
640
653
|
});
|
|
641
654
|
return ruleset;
|
|
@@ -685,7 +698,7 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
685
698
|
}
|
|
686
699
|
|
|
687
700
|
ruleset += '}';
|
|
688
|
-
nodesWithStyles.forEach(
|
|
701
|
+
nodesWithStyles.forEach(_ref21 => {
|
|
689
702
|
let {
|
|
690
703
|
selector,
|
|
691
704
|
duotoneSelector,
|
|
@@ -694,70 +707,67 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
694
707
|
hasLayoutSupport,
|
|
695
708
|
featureSelectors,
|
|
696
709
|
styleVariationSelectors
|
|
697
|
-
} =
|
|
710
|
+
} = _ref21;
|
|
698
711
|
|
|
699
712
|
// Process styles for block support features with custom feature level
|
|
700
713
|
// CSS selectors set.
|
|
701
714
|
if (featureSelectors) {
|
|
702
715
|
const featureDeclarations = getFeatureDeclarations(featureSelectors, styles);
|
|
703
|
-
Object.entries(featureDeclarations).forEach(
|
|
704
|
-
let [cssSelector, declarations] =
|
|
716
|
+
Object.entries(featureDeclarations).forEach(_ref22 => {
|
|
717
|
+
let [cssSelector, declarations] = _ref22;
|
|
705
718
|
|
|
706
|
-
if (
|
|
719
|
+
if (declarations.length) {
|
|
707
720
|
const rules = declarations.join(';');
|
|
708
|
-
ruleset
|
|
721
|
+
ruleset += `${cssSelector}{${rules};}`;
|
|
709
722
|
}
|
|
710
723
|
});
|
|
711
724
|
}
|
|
712
725
|
|
|
713
726
|
if (styleVariationSelectors) {
|
|
714
|
-
Object.entries(styleVariationSelectors).forEach(
|
|
727
|
+
Object.entries(styleVariationSelectors).forEach(_ref23 => {
|
|
715
728
|
var _styles$variations;
|
|
716
729
|
|
|
717
|
-
let [styleVariationName, styleVariationSelector] =
|
|
718
|
-
|
|
719
|
-
if (styles !== null && styles !== void 0 && (_styles$variations = styles.variations) !== null && _styles$variations !== void 0 && _styles$variations[styleVariationName]) {
|
|
720
|
-
var _styles$variations3;
|
|
730
|
+
let [styleVariationName, styleVariationSelector] = _ref23;
|
|
731
|
+
const styleVariations = styles === null || styles === void 0 ? void 0 : (_styles$variations = styles.variations) === null || _styles$variations === void 0 ? void 0 : _styles$variations[styleVariationName];
|
|
721
732
|
|
|
733
|
+
if (styleVariations) {
|
|
722
734
|
// If the block uses any custom selectors for block support, add those first.
|
|
723
735
|
if (featureSelectors) {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
Object.entries(featureDeclarations).forEach(_ref23 => {
|
|
728
|
-
let [baseSelector, declarations] = _ref23;
|
|
736
|
+
const featureDeclarations = getFeatureDeclarations(featureSelectors, styleVariations);
|
|
737
|
+
Object.entries(featureDeclarations).forEach(_ref24 => {
|
|
738
|
+
let [baseSelector, declarations] = _ref24;
|
|
729
739
|
|
|
730
|
-
if (
|
|
740
|
+
if (declarations.length) {
|
|
731
741
|
const cssSelector = concatFeatureVariationSelectorString(baseSelector, styleVariationSelector);
|
|
732
742
|
const rules = declarations.join(';');
|
|
733
|
-
ruleset
|
|
743
|
+
ruleset += `${cssSelector}{${rules};}`;
|
|
734
744
|
}
|
|
735
745
|
});
|
|
736
746
|
} // Otherwise add regular selectors.
|
|
737
747
|
|
|
738
748
|
|
|
739
|
-
const styleVariationDeclarations = getStylesDeclarations(
|
|
749
|
+
const styleVariationDeclarations = getStylesDeclarations(styleVariations, styleVariationSelector, useRootPaddingAlign, tree);
|
|
740
750
|
|
|
741
|
-
if (
|
|
742
|
-
ruleset
|
|
751
|
+
if (styleVariationDeclarations.length) {
|
|
752
|
+
ruleset += `${styleVariationSelector}{${styleVariationDeclarations.join(';')};}`;
|
|
743
753
|
}
|
|
744
754
|
}
|
|
745
755
|
});
|
|
746
|
-
}
|
|
756
|
+
} // Process duotone styles.
|
|
747
757
|
|
|
748
|
-
const duotoneStyles = {};
|
|
749
758
|
|
|
750
|
-
if (
|
|
751
|
-
duotoneStyles
|
|
752
|
-
delete styles.filter;
|
|
753
|
-
} // Process duotone styles (they use color.__experimentalDuotone selector).
|
|
759
|
+
if (duotoneSelector) {
|
|
760
|
+
const duotoneStyles = {};
|
|
754
761
|
|
|
762
|
+
if (styles !== null && styles !== void 0 && styles.filter) {
|
|
763
|
+
duotoneStyles.filter = styles.filter;
|
|
764
|
+
delete styles.filter;
|
|
765
|
+
}
|
|
755
766
|
|
|
756
|
-
if (duotoneSelector) {
|
|
757
767
|
const duotoneDeclarations = getStylesDeclarations(duotoneStyles);
|
|
758
768
|
|
|
759
|
-
if (duotoneDeclarations.length
|
|
760
|
-
ruleset
|
|
769
|
+
if (duotoneDeclarations.length) {
|
|
770
|
+
ruleset += `${duotoneSelector}{${duotoneDeclarations.join(';')};}`;
|
|
761
771
|
}
|
|
762
772
|
} // Process blockGap and layout styles.
|
|
763
773
|
|
|
@@ -777,18 +787,18 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
777
787
|
const declarations = getStylesDeclarations(styles, selector, useRootPaddingAlign, tree);
|
|
778
788
|
|
|
779
789
|
if (declarations !== null && declarations !== void 0 && declarations.length) {
|
|
780
|
-
ruleset
|
|
790
|
+
ruleset += `${selector}{${declarations.join(';')};}`;
|
|
781
791
|
} // Check for pseudo selector in `styles` and handle separately.
|
|
782
792
|
|
|
783
793
|
|
|
784
|
-
const pseudoSelectorStyles = Object.entries(styles).filter(
|
|
785
|
-
let [key] =
|
|
794
|
+
const pseudoSelectorStyles = Object.entries(styles).filter(_ref25 => {
|
|
795
|
+
let [key] = _ref25;
|
|
786
796
|
return key.startsWith(':');
|
|
787
797
|
});
|
|
788
798
|
|
|
789
799
|
if (pseudoSelectorStyles !== null && pseudoSelectorStyles !== void 0 && pseudoSelectorStyles.length) {
|
|
790
|
-
pseudoSelectorStyles.forEach(
|
|
791
|
-
let [pseudoKey, pseudoStyle] =
|
|
800
|
+
pseudoSelectorStyles.forEach(_ref26 => {
|
|
801
|
+
let [pseudoKey, pseudoStyle] = _ref26;
|
|
792
802
|
const pseudoDeclarations = getStylesDeclarations(pseudoStyle);
|
|
793
803
|
|
|
794
804
|
if (!(pseudoDeclarations !== null && pseudoDeclarations !== void 0 && pseudoDeclarations.length)) {
|
|
@@ -805,7 +815,7 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
805
815
|
const _selector = selector.split(',').map(sel => sel + pseudoKey).join(',');
|
|
806
816
|
|
|
807
817
|
const pseudoRule = `${_selector}{${pseudoDeclarations.join(';')};}`;
|
|
808
|
-
ruleset
|
|
818
|
+
ruleset += pseudoRule;
|
|
809
819
|
});
|
|
810
820
|
}
|
|
811
821
|
});
|
|
@@ -820,15 +830,16 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
820
830
|
|
|
821
831
|
// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.
|
|
822
832
|
const gapValue = 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';
|
|
823
|
-
ruleset = ruleset +
|
|
824
|
-
ruleset = ruleset +
|
|
833
|
+
ruleset = ruleset + `:where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`;
|
|
834
|
+
ruleset = ruleset + ':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';
|
|
835
|
+
ruleset = ruleset + ':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';
|
|
825
836
|
}
|
|
826
837
|
|
|
827
|
-
nodesWithSettings.forEach(
|
|
838
|
+
nodesWithSettings.forEach(_ref27 => {
|
|
828
839
|
let {
|
|
829
840
|
selector,
|
|
830
841
|
presets
|
|
831
|
-
} =
|
|
842
|
+
} = _ref27;
|
|
832
843
|
|
|
833
844
|
if (ROOT_BLOCK_SELECTOR === selector) {
|
|
834
845
|
// Do not add extra specificity for top-level classes.
|
|
@@ -838,17 +849,17 @@ export const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasF
|
|
|
838
849
|
const classes = getPresetsClasses(selector, presets);
|
|
839
850
|
|
|
840
851
|
if (!isEmpty(classes)) {
|
|
841
|
-
ruleset
|
|
852
|
+
ruleset += classes;
|
|
842
853
|
}
|
|
843
854
|
});
|
|
844
855
|
return ruleset;
|
|
845
856
|
};
|
|
846
857
|
export function toSvgFilters(tree, blockSelectors) {
|
|
847
858
|
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
|
|
848
|
-
return nodesWithSettings.flatMap(
|
|
859
|
+
return nodesWithSettings.flatMap(_ref28 => {
|
|
849
860
|
let {
|
|
850
861
|
presets
|
|
851
|
-
} =
|
|
862
|
+
} = _ref28;
|
|
852
863
|
return getPresetsSvgFilters(presets);
|
|
853
864
|
});
|
|
854
865
|
}
|
|
@@ -861,8 +872,8 @@ const getSelectorsConfig = (blockType, rootSelector) => {
|
|
|
861
872
|
const config = {
|
|
862
873
|
root: rootSelector
|
|
863
874
|
};
|
|
864
|
-
Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(
|
|
865
|
-
let [featureKey, featureName] =
|
|
875
|
+
Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(_ref29 => {
|
|
876
|
+
let [featureKey, featureName] = _ref29;
|
|
866
877
|
const featureSelector = getBlockCSSSelector(blockType, featureKey);
|
|
867
878
|
|
|
868
879
|
if (featureSelector) {
|
|
@@ -878,8 +889,15 @@ export const getBlockSelectors = (blockTypes, getBlockStyles) => {
|
|
|
878
889
|
var _blockType$supports, _blockType$supports2, _blockType$supports2$, _blockType$supports2$2;
|
|
879
890
|
|
|
880
891
|
const name = blockType.name;
|
|
881
|
-
const selector = getBlockCSSSelector(blockType
|
|
882
|
-
|
|
892
|
+
const selector = getBlockCSSSelector(blockType);
|
|
893
|
+
let duotoneSelector = getBlockCSSSelector(blockType, 'filter.duotone'); // Keep backwards compatibility for support.color.__experimentalDuotone.
|
|
894
|
+
|
|
895
|
+
if (!duotoneSelector) {
|
|
896
|
+
const rootSelector = getBlockCSSSelector(blockType);
|
|
897
|
+
const duotoneSupport = getBlockSupport(blockType, 'color.__experimentalDuotone', false);
|
|
898
|
+
duotoneSelector = duotoneSupport && scopeSelector(rootSelector, duotoneSupport);
|
|
899
|
+
}
|
|
900
|
+
|
|
883
901
|
const hasLayoutSupport = !!(blockType !== null && blockType !== void 0 && (_blockType$supports = blockType.supports) !== null && _blockType$supports !== void 0 && _blockType$supports.__experimentalLayout);
|
|
884
902
|
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;
|
|
885
903
|
const blockStyleVariations = getBlockStyles(name);
|