@wordpress/block-editor 12.17.0 → 12.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +32 -0
- package/build/components/block-draggable/index.js +11 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/context.js +3 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +6 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +9 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +30 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/private-block-context.js +1 -1
- package/build/components/block-list/private-block-context.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/toolbar.js +8 -2
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +15 -3
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-preview/auto.js +1 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +3 -2
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +12 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +119 -90
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +10 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +7 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -14
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +7 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +31 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +99 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build/components/iframe/index.js +2 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +16 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +16 -2
- package/build/components/index.native.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 +3 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/link-control/link-preview.js +30 -26
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -9
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +3 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +10 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +29 -8
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +100 -32
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +52 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +30 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js +56 -5
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +92 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +21 -0
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +30 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +9 -9
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +30 -7
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +50 -8
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/hooks/block-hooks.js +5 -14
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/content-lock-ui.js +17 -42
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/effects.js +66 -0
- package/build/hooks/effects.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +13 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +6 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +2 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.native.js +2 -2
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +115 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -0
- package/build/hooks/use-shadow-props.js +46 -0
- package/build/hooks/use-shadow-props.js.map +1 -0
- package/build/hooks/utils.js +11 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +10 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +2 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +37 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +60 -9
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +44 -3
- package/build/store/reducer.js.map +1 -1
- package/build/store/resolvers.js +27 -0
- package/build/store/resolvers.js.map +1 -0
- package/build/store/selectors.js +94 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -26
- package/build/store/utils.js.map +1 -1
- package/build/utils/index.js +0 -16
- package/build/utils/index.js.map +1 -1
- package/build/utils/math.js +13 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +17 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +37 -27
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +11 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +5 -3
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +7 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +5 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +6 -5
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +11 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +31 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +1 -1
- package/build-module/components/block-list/private-block-context.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +8 -2
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +15 -3
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-preview/auto.js +3 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +116 -86
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +10 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +7 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -14
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +7 -1
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +32 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +93 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build-module/components/iframe/index.js +2 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.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 +3 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +32 -28
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -8
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +3 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +10 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +30 -9
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +99 -32
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +54 -6
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +91 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +17 -0
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +30 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +9 -9
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +31 -8
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +51 -9
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -14
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +19 -43
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/effects.js +51 -0
- package/build-module/hooks/effects.js.map +1 -0
- package/build-module/hooks/index.js +3 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +6 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +2 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -2
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +112 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -0
- package/build-module/hooks/use-shadow-props.js +39 -0
- package/build-module/hooks/use-shadow-props.js.map +1 -0
- package/build-module/hooks/utils.js +13 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +10 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +2 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +35 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +53 -8
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +43 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/resolvers.js +20 -0
- package/build-module/store/resolvers.js.map +1 -0
- package/build-module/store/selectors.js +89 -52
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -23
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/index.js +0 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +16 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +36 -27
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +33 -16
- package/build-style/content.css +33 -16
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +169 -114
- package/build-style/style.css +169 -114
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +8 -1
- package/src/components/block-draggable/index.js +16 -5
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +4 -0
- package/src/components/block-editing-mode/index.js +12 -7
- package/src/components/block-inspector/index.js +5 -2
- package/src/components/block-list/block.js +5 -4
- package/src/components/block-list/block.native.js +13 -3
- package/src/components/block-list/content.scss +34 -5
- package/src/components/block-list/index.js +52 -16
- package/src/components/block-list/private-block-context.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +1 -2
- package/src/components/block-lock/toolbar.js +10 -2
- package/src/components/block-popover/inbetween.js +22 -2
- package/src/components/block-preview/auto.js +3 -3
- package/src/components/block-removal-warning-modal/index.js +3 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
- package/src/components/block-switcher/block-transformations-menu.js +18 -1
- package/src/components/block-switcher/index.js +133 -111
- package/src/components/block-switcher/style.scss +6 -4
- package/src/components/block-switcher/test/index.js +113 -230
- package/src/components/block-toolbar/style.scss +22 -18
- package/src/components/block-tools/insertion-point.js +15 -2
- package/src/components/block-tools/style.scss +8 -7
- package/src/components/font-sizes/fluid-utils.js +8 -2
- package/src/components/font-sizes/test/fluid-utils.js +9 -0
- package/src/components/global-styles/border-panel.js +7 -17
- package/src/components/global-styles/effects-panel.js +16 -1
- package/src/components/global-styles/hooks.js +2 -0
- package/src/components/global-styles/typography-panel.js +45 -13
- package/src/components/iframe/get-compatibility-styles.js +120 -0
- package/src/components/iframe/index.js +2 -3
- package/src/components/index.js +4 -2
- package/src/components/index.native.js +4 -2
- 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/use-inspector-controls-tabs.js +2 -0
- package/src/components/link-control/link-preview.js +31 -55
- package/src/components/link-control/search-input.js +1 -9
- package/src/components/link-control/style.scss +31 -85
- package/src/components/link-control/test/index.js +2 -1
- package/src/components/list-view/block-contents.js +5 -1
- package/src/components/list-view/block.js +9 -0
- package/src/components/list-view/branch.js +30 -10
- package/src/components/list-view/drop-indicator.js +139 -46
- package/src/components/list-view/index.js +74 -3
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/style.scss +102 -13
- package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
- package/src/components/list-view/test/utils.js +218 -1
- package/src/components/list-view/use-list-view-block-indexes.js +29 -0
- package/src/components/list-view/use-list-view-drop-zone.js +78 -6
- package/src/components/list-view/utils.js +116 -0
- package/src/components/provider/index.js +3 -1
- package/src/components/recursion-provider/README.md +2 -2
- package/src/components/recursion-provider/index.js +17 -0
- package/src/components/rich-text/index.js +48 -10
- package/src/components/rich-text/native/index.native.js +10 -10
- package/src/components/use-block-drop-zone/index.js +60 -19
- package/src/components/use-block-drop-zone/test/index.js +32 -61
- package/src/components/use-on-block-drop/index.js +92 -11
- package/src/hooks/block-hooks.js +5 -17
- package/src/hooks/content-lock-ui.js +15 -55
- package/src/hooks/effects.js +57 -0
- package/src/hooks/index.js +2 -2
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +8 -0
- package/src/hooks/supports.js +2 -0
- package/src/hooks/test/effects.js +39 -0
- package/src/hooks/typography.native.js +2 -2
- package/src/hooks/use-bindings-attributes.js +148 -0
- package/src/hooks/use-shadow-props.js +37 -0
- package/src/hooks/utils.js +26 -10
- package/src/index.js +2 -0
- package/src/store/actions.js +9 -4
- package/src/store/index.js +2 -0
- package/src/store/private-actions.js +32 -0
- package/src/store/private-selectors.js +78 -21
- package/src/store/reducer.js +49 -2
- package/src/store/resolvers.js +17 -0
- package/src/store/selectors.js +169 -161
- package/src/store/test/registry-selectors.js +431 -0
- package/src/store/test/selectors.js +14 -400
- package/src/store/utils.js +10 -33
- package/src/style.scss +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/math.js +12 -0
- package/src/utils/object.js +16 -0
- package/src/utils/transform-styles/index.js +52 -37
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/iframe/use-compatibility-styles.js +0 -100
- package/build/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -106
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/block-variation-transforms.js +0 -42
- package/build/utils/block-variation-transforms.js.map +0 -1
- package/build-module/components/iframe/use-compatibility-styles.js +0 -94
- package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -99
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/block-variation-transforms.js +0 -35
- package/build-module/utils/block-variation-transforms.js.map +0 -1
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
- package/src/components/contrast-checker/style.scss +0 -3
- package/src/components/iframe/use-compatibility-styles.js +0 -122
- package/src/hooks/custom-fields.js +0 -115
- package/src/utils/block-variation-transforms.js +0 -38
- package/src/utils/test/block-variation-transforms.js +0 -94
|
@@ -22,7 +22,7 @@ import TextTransformControl from '../text-transform-control';
|
|
|
22
22
|
import TextDecorationControl from '../text-decoration-control';
|
|
23
23
|
import WritingModeControl from '../writing-mode-control';
|
|
24
24
|
import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
|
|
25
|
-
import { setImmutably } from '../../utils/object';
|
|
25
|
+
import { setImmutably, uniqByProperty } from '../../utils/object';
|
|
26
26
|
|
|
27
27
|
const MIN_TEXT_COLUMNS = 1;
|
|
28
28
|
const MAX_TEXT_COLUMNS = 6;
|
|
@@ -53,7 +53,10 @@ export function useHasTypographyPanel( settings ) {
|
|
|
53
53
|
|
|
54
54
|
function useHasFontSizeControl( settings ) {
|
|
55
55
|
return (
|
|
56
|
-
|
|
56
|
+
( settings?.typography?.defaultFontSizes !== false &&
|
|
57
|
+
settings?.typography?.fontSizes?.default?.length ) ||
|
|
58
|
+
settings?.typography?.fontSizes?.theme?.length ||
|
|
59
|
+
settings?.typography?.fontSizes?.custom?.length ||
|
|
57
60
|
settings?.typography?.customFontSize
|
|
58
61
|
);
|
|
59
62
|
}
|
|
@@ -100,16 +103,45 @@ function useHasTextColumnsControl( settings ) {
|
|
|
100
103
|
return settings?.typography?.textColumns;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
/**
|
|
107
|
+
* TODO: The reversing and filtering of default font sizes is a hack so the
|
|
108
|
+
* dropdown UI matches what is generated in the global styles CSS stylesheet.
|
|
109
|
+
*
|
|
110
|
+
* This is a temporary solution until #57733 is resolved. At which point,
|
|
111
|
+
* the mergedFontSizes would just need to be the concatenated array of all
|
|
112
|
+
* presets or a custom dropdown with sections for each.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link https://github.com/WordPress/gutenberg/issues/57733}
|
|
115
|
+
*
|
|
116
|
+
* @param {Object} settings The global styles settings.
|
|
117
|
+
*
|
|
118
|
+
* @return {Array} The merged font sizes.
|
|
119
|
+
*/
|
|
120
|
+
function getMergedFontSizes( settings ) {
|
|
121
|
+
// The font size presets are merged in reverse order so that the duplicates
|
|
122
|
+
// that may defined later in the array have higher priority to match the CSS.
|
|
123
|
+
const mergedFontSizesAll = uniqByProperty(
|
|
124
|
+
[
|
|
125
|
+
settings?.typography?.fontSizes?.custom,
|
|
126
|
+
settings?.typography?.fontSizes?.theme,
|
|
127
|
+
settings?.typography?.fontSizes?.default,
|
|
128
|
+
].flatMap( ( presets ) => presets?.toReversed() ?? [] ),
|
|
129
|
+
'slug'
|
|
130
|
+
).reverse();
|
|
131
|
+
|
|
132
|
+
// Default presets exist in the global styles CSS no matter the setting, so
|
|
133
|
+
// filtering them out in the UI has to be done after merging.
|
|
134
|
+
const mergedFontSizes =
|
|
135
|
+
settings?.typography?.defaultFontSizes === false
|
|
136
|
+
? mergedFontSizesAll.filter(
|
|
137
|
+
( { slug } ) =>
|
|
138
|
+
! [ 'small', 'medium', 'large', 'x-large' ].includes(
|
|
139
|
+
slug
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
: mergedFontSizesAll;
|
|
143
|
+
|
|
144
|
+
return mergedFontSizes;
|
|
113
145
|
}
|
|
114
146
|
|
|
115
147
|
function TypographyToolsPanel( {
|
|
@@ -185,7 +217,7 @@ export default function TypographyPanel( {
|
|
|
185
217
|
// Font Size
|
|
186
218
|
const hasFontSizeEnabled = useHasFontSizeControl( settings );
|
|
187
219
|
const disableCustomFontSizes = ! settings?.typography?.customFontSize;
|
|
188
|
-
const mergedFontSizes =
|
|
220
|
+
const mergedFontSizes = getMergedFontSizes( settings );
|
|
189
221
|
|
|
190
222
|
const fontSize = decodeValue( inheritedValue?.typography?.fontSize );
|
|
191
223
|
const setFontSize = ( newValue, metadata ) => {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
let compatibilityStyles = null;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns a list of stylesheets that target the editor canvas. A stylesheet is
|
|
5
|
+
* considered targetting the editor a canvas if it contains the
|
|
6
|
+
* `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.
|
|
7
|
+
*
|
|
8
|
+
* Ideally, this hook should be removed in the future and styles should be added
|
|
9
|
+
* explicitly as editor styles.
|
|
10
|
+
*/
|
|
11
|
+
export function getCompatibilityStyles() {
|
|
12
|
+
if ( compatibilityStyles ) {
|
|
13
|
+
return compatibilityStyles;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Only memoize the result once on load, since these stylesheets should not
|
|
17
|
+
// change.
|
|
18
|
+
compatibilityStyles = Array.from( document.styleSheets ).reduce(
|
|
19
|
+
( accumulator, styleSheet ) => {
|
|
20
|
+
try {
|
|
21
|
+
// May fail for external styles.
|
|
22
|
+
// eslint-disable-next-line no-unused-expressions
|
|
23
|
+
styleSheet.cssRules;
|
|
24
|
+
} catch ( e ) {
|
|
25
|
+
return accumulator;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { ownerNode, cssRules } = styleSheet;
|
|
29
|
+
|
|
30
|
+
// Stylesheet is added by another stylesheet. See
|
|
31
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.
|
|
32
|
+
if ( ownerNode === null ) {
|
|
33
|
+
return accumulator;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ( ! cssRules ) {
|
|
37
|
+
return accumulator;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Don't try to add the reset styles, which were removed as a dependency
|
|
41
|
+
// from `edit-blocks` for the iframe since we don't need to reset admin
|
|
42
|
+
// styles.
|
|
43
|
+
if ( ownerNode.id === 'wp-reset-editor-styles-css' ) {
|
|
44
|
+
return accumulator;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.
|
|
48
|
+
if ( ! ownerNode.id ) {
|
|
49
|
+
return accumulator;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function matchFromRules( _cssRules ) {
|
|
53
|
+
return Array.from( _cssRules ).find(
|
|
54
|
+
( {
|
|
55
|
+
selectorText,
|
|
56
|
+
conditionText,
|
|
57
|
+
cssRules: __cssRules,
|
|
58
|
+
} ) => {
|
|
59
|
+
// If the rule is conditional then it will not have selector text.
|
|
60
|
+
// Recurse into child CSS ruleset to determine selector eligibility.
|
|
61
|
+
if ( conditionText ) {
|
|
62
|
+
return matchFromRules( __cssRules );
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
selectorText &&
|
|
67
|
+
( selectorText.includes(
|
|
68
|
+
'.editor-styles-wrapper'
|
|
69
|
+
) ||
|
|
70
|
+
selectorText.includes( '.wp-block' ) )
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if ( matchFromRules( cssRules ) ) {
|
|
77
|
+
const isInline = ownerNode.tagName === 'STYLE';
|
|
78
|
+
|
|
79
|
+
if ( isInline ) {
|
|
80
|
+
// If the current target is inline,
|
|
81
|
+
// it could be a dependency of an existing stylesheet.
|
|
82
|
+
// Look for that dependency and add it BEFORE the current target.
|
|
83
|
+
const mainStylesCssId = ownerNode.id.replace(
|
|
84
|
+
'-inline-css',
|
|
85
|
+
'-css'
|
|
86
|
+
);
|
|
87
|
+
const mainStylesElement =
|
|
88
|
+
document.getElementById( mainStylesCssId );
|
|
89
|
+
if ( mainStylesElement ) {
|
|
90
|
+
accumulator.push( mainStylesElement.cloneNode( true ) );
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
accumulator.push( ownerNode.cloneNode( true ) );
|
|
95
|
+
|
|
96
|
+
if ( ! isInline ) {
|
|
97
|
+
// If the current target is not inline,
|
|
98
|
+
// we still look for inline styles that could be relevant for the current target.
|
|
99
|
+
// If they exist, add them AFTER the current target.
|
|
100
|
+
const inlineStylesCssId = ownerNode.id.replace(
|
|
101
|
+
'-css',
|
|
102
|
+
'-inline-css'
|
|
103
|
+
);
|
|
104
|
+
const inlineStylesElement =
|
|
105
|
+
document.getElementById( inlineStylesCssId );
|
|
106
|
+
if ( inlineStylesElement ) {
|
|
107
|
+
accumulator.push(
|
|
108
|
+
inlineStylesElement.cloneNode( true )
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return accumulator;
|
|
115
|
+
},
|
|
116
|
+
[]
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
return compatibilityStyles;
|
|
120
|
+
}
|
|
@@ -28,7 +28,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
28
28
|
*/
|
|
29
29
|
import { useBlockSelectionClearer } from '../block-selection-clearer';
|
|
30
30
|
import { useWritingFlow } from '../writing-flow';
|
|
31
|
-
import {
|
|
31
|
+
import { getCompatibilityStyles } from './get-compatibility-styles';
|
|
32
32
|
import { store as blockEditorStore } from '../../store';
|
|
33
33
|
|
|
34
34
|
function bubbleEvent( event, Constructor, frame ) {
|
|
@@ -121,7 +121,6 @@ function Iframe( {
|
|
|
121
121
|
const { styles = '', scripts = '' } = resolvedAssets;
|
|
122
122
|
const [ iframeDocument, setIframeDocument ] = useState();
|
|
123
123
|
const [ bodyClasses, setBodyClasses ] = useState( [] );
|
|
124
|
-
const compatStyles = useCompatibilityStyles();
|
|
125
124
|
const clearerRef = useBlockSelectionClearer();
|
|
126
125
|
const [ before, writingFlowRef, after ] = useWritingFlow();
|
|
127
126
|
const [ contentResizeListener, { height: contentHeight } ] =
|
|
@@ -156,7 +155,7 @@ function Iframe( {
|
|
|
156
155
|
|
|
157
156
|
contentDocument.dir = ownerDocument.dir;
|
|
158
157
|
|
|
159
|
-
for ( const compatStyle of
|
|
158
|
+
for ( const compatStyle of getCompatibilityStyles() ) {
|
|
160
159
|
if ( contentDocument.getElementById( compatStyle.id ) ) {
|
|
161
160
|
continue;
|
|
162
161
|
}
|
package/src/components/index.js
CHANGED
|
@@ -152,8 +152,10 @@ export { default as WritingFlow } from './writing-flow';
|
|
|
152
152
|
export { default as useBlockDisplayInformation } from './use-block-display-information';
|
|
153
153
|
export { default as __unstableIframe } from './iframe';
|
|
154
154
|
export {
|
|
155
|
-
RecursionProvider
|
|
156
|
-
|
|
155
|
+
RecursionProvider,
|
|
156
|
+
DeprecatedExperimentalRecursionProvider as __experimentalRecursionProvider,
|
|
157
|
+
useHasRecursion,
|
|
158
|
+
DeprecatedExperimentalUseHasRecursion as __experimentalUseHasRecursion,
|
|
157
159
|
} from './recursion-provider';
|
|
158
160
|
export { default as __experimentalBlockPatternsList } from './block-patterns-list';
|
|
159
161
|
export { default as __experimentalPublishDateTimePicker } from './publish-date-time-picker';
|
|
@@ -61,8 +61,10 @@ export { default as PanelColorSettings } from './panel-color-settings';
|
|
|
61
61
|
export { default as __experimentalPanelColorGradientSettings } from './colors-gradients/panel-color-gradient-settings';
|
|
62
62
|
export { useSettings, default as useSetting } from './use-settings';
|
|
63
63
|
export {
|
|
64
|
-
RecursionProvider
|
|
65
|
-
|
|
64
|
+
RecursionProvider,
|
|
65
|
+
DeprecatedExperimentalRecursionProvider as __experimentalRecursionProvider,
|
|
66
|
+
useHasRecursion,
|
|
67
|
+
DeprecatedExperimentalUseHasRecursion as __experimentalUseHasRecursion,
|
|
66
68
|
} from './recursion-provider';
|
|
67
69
|
export { default as Warning } from './warning';
|
|
68
70
|
export { default as ContrastChecker } from './contrast-checker';
|
|
@@ -20,6 +20,7 @@ const InspectorControlsTypography = createSlotFill(
|
|
|
20
20
|
);
|
|
21
21
|
const InspectorControlsListView = createSlotFill( 'InspectorControlsListView' );
|
|
22
22
|
const InspectorControlsStyles = createSlotFill( 'InspectorControlsStyles' );
|
|
23
|
+
const InspectorControlsEffects = createSlotFill( 'InspectorControlsEffects' );
|
|
23
24
|
|
|
24
25
|
const groups = {
|
|
25
26
|
default: InspectorControlsDefault,
|
|
@@ -28,6 +29,7 @@ const groups = {
|
|
|
28
29
|
border: InspectorControlsBorder,
|
|
29
30
|
color: InspectorControlsColor,
|
|
30
31
|
dimensions: InspectorControlsDimensions,
|
|
32
|
+
effects: InspectorControlsEffects,
|
|
31
33
|
filter: InspectorControlsFilter,
|
|
32
34
|
list: InspectorControlsListView,
|
|
33
35
|
position: InspectorControlsPosition,
|
|
@@ -46,6 +46,7 @@ const StylesTab = ( { blockName, clientId, hasBlockStyles } ) => {
|
|
|
46
46
|
label={ __( 'Dimensions' ) }
|
|
47
47
|
/>
|
|
48
48
|
<InspectorControls.Slot group="border" label={ __( 'Border' ) } />
|
|
49
|
+
<InspectorControls.Slot group="effects" label={ __( 'Effects' ) } />
|
|
49
50
|
<InspectorControls.Slot group="styles" />
|
|
50
51
|
</>
|
|
51
52
|
);
|
|
@@ -40,6 +40,7 @@ export default function useInspectorControlsTabs( blockName ) {
|
|
|
40
40
|
position: positionGroup,
|
|
41
41
|
styles: stylesGroup,
|
|
42
42
|
typography: typographyGroup,
|
|
43
|
+
effects: effectsGroup,
|
|
43
44
|
} = InspectorControlsGroups;
|
|
44
45
|
|
|
45
46
|
// List View Tab: If there are any fills for the list group add that tab.
|
|
@@ -55,6 +56,7 @@ export default function useInspectorControlsTabs( blockName ) {
|
|
|
55
56
|
...( useSlotFills( dimensionsGroup.Slot.__unstableName ) || [] ),
|
|
56
57
|
...( useSlotFills( stylesGroup.Slot.__unstableName ) || [] ),
|
|
57
58
|
...( useSlotFills( typographyGroup.Slot.__unstableName ) || [] ),
|
|
59
|
+
...( useSlotFills( effectsGroup.Slot.__unstableName ) || [] ),
|
|
58
60
|
];
|
|
59
61
|
const hasStyleFills = styleFills.length;
|
|
60
62
|
|
|
@@ -10,12 +10,15 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
10
|
import {
|
|
11
11
|
Button,
|
|
12
12
|
ExternalLink,
|
|
13
|
-
|
|
13
|
+
__experimentalTruncate as Truncate,
|
|
14
14
|
Tooltip,
|
|
15
15
|
} from '@wordpress/components';
|
|
16
|
+
import { useCopyToClipboard } from '@wordpress/compose';
|
|
16
17
|
import { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';
|
|
17
|
-
import { Icon, globe, info, linkOff, edit } from '@wordpress/icons';
|
|
18
|
+
import { Icon, globe, info, linkOff, edit, copy } from '@wordpress/icons';
|
|
18
19
|
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
20
|
+
import { useDispatch } from '@wordpress/data';
|
|
21
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Internal dependencies
|
|
@@ -41,7 +44,7 @@ export default function LinkPreview( {
|
|
|
41
44
|
const hasRichData = richData && Object.keys( richData ).length;
|
|
42
45
|
|
|
43
46
|
const displayURL =
|
|
44
|
-
( value && filterURLForDisplay( safeDecodeURI( value.url ),
|
|
47
|
+
( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||
|
|
45
48
|
'';
|
|
46
49
|
|
|
47
50
|
// url can be undefined if the href attribute is unset
|
|
@@ -61,6 +64,14 @@ export default function LinkPreview( {
|
|
|
61
64
|
icon = <Icon icon={ globe } />;
|
|
62
65
|
}
|
|
63
66
|
|
|
67
|
+
const { createNotice } = useDispatch( noticesStore );
|
|
68
|
+
const ref = useCopyToClipboard( value.url, () => {
|
|
69
|
+
createNotice( 'info', __( 'Copied URL to clipboard.' ), {
|
|
70
|
+
isDismissible: true,
|
|
71
|
+
type: 'snackbar',
|
|
72
|
+
} );
|
|
73
|
+
} );
|
|
74
|
+
|
|
64
75
|
return (
|
|
65
76
|
<div
|
|
66
77
|
aria-label={ __( 'Currently selected' ) }
|
|
@@ -88,21 +99,21 @@ export default function LinkPreview( {
|
|
|
88
99
|
<span className="block-editor-link-control__search-item-details">
|
|
89
100
|
{ ! isEmptyURL ? (
|
|
90
101
|
<>
|
|
91
|
-
<Tooltip
|
|
92
|
-
text={ value.url }
|
|
93
|
-
placement="bottom-start"
|
|
94
|
-
>
|
|
102
|
+
<Tooltip text={ value.url }>
|
|
95
103
|
<ExternalLink
|
|
96
104
|
className="block-editor-link-control__search-item-title"
|
|
97
105
|
href={ value.url }
|
|
98
106
|
>
|
|
99
|
-
{
|
|
107
|
+
<Truncate numberOfLines={ 1 }>
|
|
108
|
+
{ displayTitle }
|
|
109
|
+
</Truncate>
|
|
100
110
|
</ExternalLink>
|
|
101
111
|
</Tooltip>
|
|
102
|
-
|
|
103
112
|
{ value?.url && displayTitle !== displayURL && (
|
|
104
113
|
<span className="block-editor-link-control__search-item-info">
|
|
105
|
-
{
|
|
114
|
+
<Truncate numberOfLines={ 1 }>
|
|
115
|
+
{ displayURL }
|
|
116
|
+
</Truncate>
|
|
106
117
|
</span>
|
|
107
118
|
) }
|
|
108
119
|
</>
|
|
@@ -119,7 +130,7 @@ export default function LinkPreview( {
|
|
|
119
130
|
label={ __( 'Edit' ) }
|
|
120
131
|
className="block-editor-link-control__search-item-action"
|
|
121
132
|
onClick={ onEditClick }
|
|
122
|
-
|
|
133
|
+
size="compact"
|
|
123
134
|
/>
|
|
124
135
|
{ hasUnlinkControl && (
|
|
125
136
|
<Button
|
|
@@ -127,54 +138,19 @@ export default function LinkPreview( {
|
|
|
127
138
|
label={ __( 'Unlink' ) }
|
|
128
139
|
className="block-editor-link-control__search-item-action block-editor-link-control__unlink"
|
|
129
140
|
onClick={ onRemove }
|
|
130
|
-
|
|
141
|
+
size="compact"
|
|
131
142
|
/>
|
|
132
143
|
) }
|
|
144
|
+
<Button
|
|
145
|
+
icon={ copy }
|
|
146
|
+
label={ __( 'Copy URL' ) }
|
|
147
|
+
className="block-editor-link-control__search-item-action block-editor-link-control__copy"
|
|
148
|
+
ref={ ref }
|
|
149
|
+
disabled={ isEmptyURL }
|
|
150
|
+
size="compact"
|
|
151
|
+
/>
|
|
133
152
|
<ViewerSlot fillProps={ value } />
|
|
134
153
|
</div>
|
|
135
|
-
|
|
136
|
-
{ !! (
|
|
137
|
-
( hasRichData &&
|
|
138
|
-
( richData?.image || richData?.description ) ) ||
|
|
139
|
-
isFetching
|
|
140
|
-
) && (
|
|
141
|
-
<div className="block-editor-link-control__search-item-bottom">
|
|
142
|
-
{ ( richData?.image || isFetching ) && (
|
|
143
|
-
<div
|
|
144
|
-
aria-hidden={ ! richData?.image }
|
|
145
|
-
className={ classnames(
|
|
146
|
-
'block-editor-link-control__search-item-image',
|
|
147
|
-
{
|
|
148
|
-
'is-placeholder': ! richData?.image,
|
|
149
|
-
}
|
|
150
|
-
) }
|
|
151
|
-
>
|
|
152
|
-
{ richData?.image && (
|
|
153
|
-
<img src={ richData?.image } alt="" />
|
|
154
|
-
) }
|
|
155
|
-
</div>
|
|
156
|
-
) }
|
|
157
|
-
|
|
158
|
-
{ ( richData?.description || isFetching ) && (
|
|
159
|
-
<div
|
|
160
|
-
aria-hidden={ ! richData?.description }
|
|
161
|
-
className={ classnames(
|
|
162
|
-
'block-editor-link-control__search-item-description',
|
|
163
|
-
{
|
|
164
|
-
'is-placeholder': ! richData?.description,
|
|
165
|
-
}
|
|
166
|
-
) }
|
|
167
|
-
>
|
|
168
|
-
{ richData?.description && (
|
|
169
|
-
<Text truncate numberOfLines="2">
|
|
170
|
-
{ richData.description }
|
|
171
|
-
</Text>
|
|
172
|
-
) }
|
|
173
|
-
</div>
|
|
174
|
-
) }
|
|
175
|
-
</div>
|
|
176
|
-
) }
|
|
177
|
-
|
|
178
154
|
{ additionalControls && additionalControls() }
|
|
179
155
|
</div>
|
|
180
156
|
);
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
1
|
/**
|
|
6
2
|
* WordPress dependencies
|
|
7
3
|
*/
|
|
@@ -119,10 +115,6 @@ const LinkControlSearchInput = forwardRef(
|
|
|
119
115
|
}
|
|
120
116
|
};
|
|
121
117
|
|
|
122
|
-
const inputClasses = classnames( className, {
|
|
123
|
-
// 'has-no-label': ! hideLabelFromVision,
|
|
124
|
-
} );
|
|
125
|
-
|
|
126
118
|
return (
|
|
127
119
|
<div className="block-editor-link-control__search-input-container">
|
|
128
120
|
<URLInput
|
|
@@ -130,7 +122,7 @@ const LinkControlSearchInput = forwardRef(
|
|
|
130
122
|
__nextHasNoMarginBottom
|
|
131
123
|
label={ __( 'Link' ) }
|
|
132
124
|
hideLabelFromVision={ hideLabelFromVision }
|
|
133
|
-
className={
|
|
125
|
+
className={ className }
|
|
134
126
|
value={ value }
|
|
135
127
|
onChange={ onInputChange }
|
|
136
128
|
placeholder={ placeholder ?? __( 'Search or type url' ) }
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
$block-editor-link-control-number-of-actions: 1;
|
|
2
|
-
$preview-image-height: 140px;
|
|
3
2
|
|
|
4
3
|
@keyframes loadingpulse {
|
|
5
4
|
0% {
|
|
@@ -51,13 +50,6 @@ $preview-image-height: 140px;
|
|
|
51
50
|
position: relative;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
// If the input doesn't have a visible label then
|
|
55
|
-
// we need to expand the input itself to occupy
|
|
56
|
-
// the full available horizontal space.
|
|
57
|
-
.block-editor-link-control__search-input.has-no-label .block-editor-url-input__input {
|
|
58
|
-
flex: 1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
53
|
.block-editor-link-control__field {
|
|
62
54
|
margin: $grid-unit-20; // allow margin collapse for vertical spacing.
|
|
63
55
|
|
|
@@ -77,6 +69,10 @@ $preview-image-height: 140px;
|
|
|
77
69
|
padding: $grid-unit-10 $button-size-next-default-40px $grid-unit-10 $grid-unit-20;
|
|
78
70
|
position: relative;
|
|
79
71
|
width: 100%;
|
|
72
|
+
|
|
73
|
+
.has-actions & {
|
|
74
|
+
padding-right: $grid-unit-20;
|
|
75
|
+
}
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
|
|
@@ -183,6 +179,7 @@ $preview-image-height: 140px;
|
|
|
183
179
|
flex-direction: row;
|
|
184
180
|
align-items: flex-start;
|
|
185
181
|
margin-right: $grid-unit-10;
|
|
182
|
+
gap: $grid-unit-10;
|
|
186
183
|
|
|
187
184
|
// Force text to wrap to improve UX when encountering long lines
|
|
188
185
|
// of text, particular those with no spaces.
|
|
@@ -191,6 +188,9 @@ $preview-image-height: 140px;
|
|
|
191
188
|
overflow-wrap: break-word;
|
|
192
189
|
|
|
193
190
|
.block-editor-link-control__search-item-info {
|
|
191
|
+
color: $gray-700;
|
|
192
|
+
line-height: 1.1;
|
|
193
|
+
font-size: $helptext-font-size;
|
|
194
194
|
word-break: break-all;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -209,17 +209,29 @@ $preview-image-height: 140px;
|
|
|
209
209
|
word-break: break-all;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
.block-editor-link-control__search-item-details {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
justify-content: space-between;
|
|
216
|
+
gap: $grid-unit-05;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.block-editor-link-control__search-item-header .block-editor-link-control__search-item-icon {
|
|
220
|
+
background-color: $gray-100;
|
|
221
|
+
width: $grid-unit-40;
|
|
222
|
+
height: $grid-unit-40;
|
|
223
|
+
border-radius: $radius-block-ui;
|
|
224
|
+
}
|
|
225
|
+
|
|
212
226
|
.block-editor-link-control__search-item-icon {
|
|
213
227
|
position: relative;
|
|
214
|
-
margin-right: $grid-unit-10;
|
|
215
|
-
max-height: 24px;
|
|
216
228
|
flex-shrink: 0;
|
|
217
|
-
width: 24px;
|
|
218
229
|
display: flex;
|
|
219
230
|
justify-content: center;
|
|
231
|
+
align-items: center;
|
|
220
232
|
|
|
221
233
|
img {
|
|
222
|
-
width:
|
|
234
|
+
width: $grid-unit-20; // favicons often have a source of 32px
|
|
223
235
|
}
|
|
224
236
|
}
|
|
225
237
|
|
|
@@ -230,10 +242,13 @@ $preview-image-height: 140px;
|
|
|
230
242
|
}
|
|
231
243
|
|
|
232
244
|
.block-editor-link-control__search-item-title {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
border-radius: $radius-block-ui;
|
|
246
|
+
line-height: 1.1;
|
|
247
|
+
|
|
248
|
+
&:focus-visible {
|
|
249
|
+
@include block-toolbar-button-style__focus();
|
|
250
|
+
text-decoration: none;
|
|
251
|
+
}
|
|
237
252
|
|
|
238
253
|
mark {
|
|
239
254
|
font-weight: 600;
|
|
@@ -249,58 +264,6 @@ $preview-image-height: 140px;
|
|
|
249
264
|
display: none; // specifically requested to be removed visually as well.
|
|
250
265
|
}
|
|
251
266
|
}
|
|
252
|
-
|
|
253
|
-
.block-editor-link-control__search-item-description {
|
|
254
|
-
padding-top: 12px;
|
|
255
|
-
margin: 0;
|
|
256
|
-
|
|
257
|
-
&.is-placeholder {
|
|
258
|
-
margin-top: 12px;
|
|
259
|
-
padding-top: 0;
|
|
260
|
-
height: 28px;
|
|
261
|
-
display: flex;
|
|
262
|
-
flex-direction: column;
|
|
263
|
-
justify-content: space-around;
|
|
264
|
-
|
|
265
|
-
&::before,
|
|
266
|
-
&::after {
|
|
267
|
-
display: block;
|
|
268
|
-
content: "";
|
|
269
|
-
height: 0.7em;
|
|
270
|
-
width: 100%;
|
|
271
|
-
background-color: $gray-100;
|
|
272
|
-
border-radius: 3px;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.components-text {
|
|
277
|
-
font-size: 0.9em;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.block-editor-link-control__search-item-image {
|
|
282
|
-
display: flex;
|
|
283
|
-
width: 100%;
|
|
284
|
-
background-color: $gray-100;
|
|
285
|
-
justify-content: center;
|
|
286
|
-
height: $preview-image-height; // limit height
|
|
287
|
-
max-height: $preview-image-height; // limit height
|
|
288
|
-
overflow: hidden;
|
|
289
|
-
border-radius: 2px;
|
|
290
|
-
margin-top: 12px;
|
|
291
|
-
|
|
292
|
-
&.is-placeholder {
|
|
293
|
-
background-color: $gray-100;
|
|
294
|
-
border-radius: 3px;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
img {
|
|
298
|
-
display: block; // remove unwanted space below image
|
|
299
|
-
width: 100%;
|
|
300
|
-
height: 100%;
|
|
301
|
-
object-fit: contain;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
267
|
}
|
|
305
268
|
|
|
306
269
|
.block-editor-link-control__search-item-top {
|
|
@@ -310,24 +273,7 @@ $preview-image-height: 140px;
|
|
|
310
273
|
align-items: center;
|
|
311
274
|
}
|
|
312
275
|
|
|
313
|
-
.block-editor-link-control__search-item-bottom {
|
|
314
|
-
transition: opacity 1.5s;
|
|
315
|
-
width: 100%;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
276
|
.block-editor-link-control__search-item.is-fetching {
|
|
319
|
-
.block-editor-link-control__search-item-description {
|
|
320
|
-
&::before,
|
|
321
|
-
&::after {
|
|
322
|
-
animation: loadingpulse 1s linear infinite;
|
|
323
|
-
animation-delay: 0.5s; // avoid animating for fast network responses
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.block-editor-link-control__search-item-image {
|
|
328
|
-
animation: loadingpulse 1s linear infinite;
|
|
329
|
-
animation-delay: 0.5s; // avoid animating for fast network responses
|
|
330
|
-
}
|
|
331
277
|
|
|
332
278
|
.block-editor-link-control__search-item-icon {
|
|
333
279
|
svg,
|
|
@@ -2244,7 +2244,8 @@ describe( 'Rich link previews', () => {
|
|
|
2244
2244
|
|
|
2245
2245
|
const titlePreview = screen.getByText( selectedLink.title );
|
|
2246
2246
|
|
|
2247
|
-
|
|
2247
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
2248
|
+
expect( titlePreview.parentElement ).toHaveClass(
|
|
2248
2249
|
'block-editor-link-control__search-item-title'
|
|
2249
2250
|
);
|
|
2250
2251
|
} );
|
|
@@ -74,7 +74,11 @@ const ListViewBlockContents = forwardRef(
|
|
|
74
74
|
setInsertedBlock={ setInsertedBlock }
|
|
75
75
|
/>
|
|
76
76
|
) }
|
|
77
|
-
<BlockDraggable
|
|
77
|
+
<BlockDraggable
|
|
78
|
+
appendToOwnerDocument
|
|
79
|
+
clientIds={ draggableClientIds }
|
|
80
|
+
cloneClassname={ 'block-editor-list-view-draggable-chip' }
|
|
81
|
+
>
|
|
78
82
|
{ ( { draggable, onDragStart, onDragEnd } ) => (
|
|
79
83
|
<ListViewBlockSelectButton
|
|
80
84
|
ref={ ref }
|