@wordpress/block-editor 12.20.0 → 12.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-actions/index.js +45 -32
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-bindings-toolbar-indicator/index.js +25 -0
- package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -0
- package/build/components/block-edit/context.js +2 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +8 -3
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +1 -1
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +23 -7
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.native.js +0 -3
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +8 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-popover/cover.js +68 -0
- package/build/components/block-popover/cover.js.map +1 -0
- package/build/components/block-popover/drop-zone.js +2 -3
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/index.js +1 -19
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/index.js +2 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +2 -4
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +12 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/index.js +21 -10
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +89 -0
- package/build/components/block-toolbar/shuffle.js.map +1 -0
- package/build/components/block-toolbar/use-has-block-toolbar.js +43 -0
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
- package/build/components/block-tools/block-selection-button.js +5 -1
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +2 -5
- package/build/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build/components/block-tools/index.js +9 -26
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +60 -0
- package/build/components/block-tools/use-show-block-tools.js.map +1 -0
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -1
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/global-styles/border-panel.js +21 -8
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +1 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +6 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +80 -23
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +7 -5
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +15 -15
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js +77 -0
- package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -0
- package/build/components/grid-visualizer/grid-visualizer.js +81 -0
- package/build/components/grid-visualizer/grid-visualizer.js.map +1 -0
- package/build/components/grid-visualizer/index.js +20 -0
- package/build/components/grid-visualizer/index.js.map +1 -0
- package/build/components/grid-visualizer/utils.js +10 -0
- package/build/components/grid-visualizer/utils.js.map +1 -0
- package/build/components/iframe/index.js +61 -16
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.native.js +7 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +8 -2
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +9 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +1 -1
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/search-results.js +3 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +2 -1
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +1 -1
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/link-control/link-preview.js +4 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-select-button.js +10 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +2 -1
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +3 -5
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +1 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/index.js +46 -26
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-enter.js +3 -0
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-popover/index.js +3 -3
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +2 -1
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/utils.js +23 -6
- package/build/components/writing-flow/utils.js.map +1 -1
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +34 -8
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/border.js +6 -4
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/dimensions.js +3 -4
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-size.js +6 -7
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +39 -0
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/layout.js +11 -4
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +115 -0
- package/build/hooks/spacing-visualizer.js.map +1 -0
- package/build/hooks/use-bindings-attributes.js +171 -48
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-typography-props.js +1 -2
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/layouts/grid.js +6 -2
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +7 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +42 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +29 -55
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -8
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +3 -20
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +27 -15
- package/build/store/selectors.js.map +1 -1
- package/build/utils/calculate-scale.js +17 -0
- package/build/utils/calculate-scale.js.map +1 -0
- package/build-module/components/block-actions/index.js +45 -32
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-bindings-toolbar-indicator/index.js +18 -0
- package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -0
- 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 +9 -4
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -5
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +1 -1
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +23 -7
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +0 -3
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +9 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-popover/cover.js +60 -0
- package/build-module/components/block-popover/cover.js.map +1 -0
- package/build-module/components/block-popover/drop-zone.js +2 -3
- package/build-module/components/block-popover/drop-zone.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -19
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +2 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -5
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -10
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +21 -11
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +82 -0
- package/build-module/components/block-toolbar/shuffle.js.map +1 -0
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +36 -0
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
- package/build-module/components/block-tools/block-selection-button.js +5 -1
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +2 -5
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
- package/build-module/components/block-tools/index.js +9 -26
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +54 -0
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -0
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-palette/control.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +1 -1
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +22 -10
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +1 -1
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +82 -24
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +7 -5
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +16 -16
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +2 -2
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js +69 -0
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid-visualizer/grid-visualizer.js +73 -0
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -0
- package/build-module/components/grid-visualizer/index.js +3 -0
- package/build-module/components/grid-visualizer/index.js.map +1 -0
- package/build-module/components/grid-visualizer/utils.js +4 -0
- package/build-module/components/grid-visualizer/utils.js.map +1 -0
- package/build-module/components/iframe/index.js +61 -16
- package/build-module/components/iframe/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/inner-blocks/use-nested-settings-update.js +8 -2
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +9 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/search-results.js +3 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +2 -1
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -1
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +5 -2
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +11 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +3 -2
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +3 -5
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +1 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +47 -28
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +3 -0
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-popover/index.js +3 -3
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +3 -2
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +22 -7
- package/build-module/components/writing-flow/utils.js.map +1 -1
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +34 -8
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/border.js +7 -5
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/dimensions.js +1 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-size.js +7 -8
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +39 -0
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/layout.js +11 -4
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +106 -0
- package/build-module/hooks/spacing-visualizer.js.map +1 -0
- package/build-module/hooks/use-bindings-attributes.js +172 -49
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +2 -3
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/layouts/grid.js +6 -2
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +7 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +42 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +29 -54
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +3 -20
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +23 -13
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/calculate-scale.js +11 -0
- package/build-module/utils/calculate-scale.js.map +1 -0
- package/build-style/content-rtl.css +8 -2
- package/build-style/content.css +8 -2
- package/build-style/default-editor-styles-rtl.css +1 -0
- package/build-style/default-editor-styles.css +1 -0
- package/build-style/style-rtl.css +113 -22
- package/build-style/style.css +113 -22
- package/package.json +31 -31
- package/src/components/block-actions/index.js +57 -47
- package/src/components/block-bindings-toolbar-indicator/index.js +20 -0
- package/src/components/block-bindings-toolbar-indicator/style.scss +14 -0
- package/src/components/block-draggable/test/index.native.js +2 -2
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +5 -1
- package/src/components/block-inspector/index.js +7 -5
- package/src/components/block-list/block-invalid-warning.native.js +1 -1
- package/src/components/block-list/block-list-item.native.js +1 -1
- package/src/components/block-list/block-outline.native.js +36 -21
- package/src/components/block-list/block-selection-button.native.js +1 -3
- package/src/components/block-list/block.native.js +0 -3
- package/src/components/block-list/content.scss +5 -1
- package/src/components/block-list/test/block-outline.native.js +255 -0
- package/src/components/block-list/use-block-props/index.js +12 -2
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -7
- package/src/components/block-mover/index.native.js +1 -1
- package/src/components/block-popover/cover.js +63 -0
- package/src/components/block-popover/drop-zone.js +3 -4
- package/src/components/block-popover/index.js +1 -28
- package/src/components/block-preview/index.js +3 -1
- package/src/components/block-removal-warning-modal/index.js +5 -19
- package/src/components/block-rename/modal.js +1 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +12 -9
- package/src/components/block-switcher/block-transformations-menu.native.js +1 -1
- package/src/components/block-toolbar/block-toolbar-menu.native.js +2 -2
- package/src/components/block-toolbar/index.js +19 -15
- package/src/components/block-toolbar/shuffle.js +93 -0
- package/src/components/block-toolbar/use-has-block-toolbar.js +49 -0
- package/src/components/block-tools/block-selection-button.js +4 -0
- package/src/components/block-tools/empty-block-inserter.js +3 -6
- package/src/components/block-tools/index.js +13 -36
- package/src/components/block-tools/use-show-block-tools.js +73 -0
- package/src/components/caption/index.native.js +1 -1
- package/src/components/child-layout-control/index.js +1 -1
- package/src/components/color-palette/control.js +1 -1
- package/src/components/colors-gradients/control.js +1 -1
- package/src/components/colors-gradients/test/control.js +2 -2
- package/src/components/contrast-checker/test/index.js +10 -10
- package/src/components/default-block-appender/content.scss +5 -2
- package/src/components/global-styles/border-panel.js +35 -24
- package/src/components/global-styles/color-panel.js +1 -1
- package/src/components/global-styles/image-settings-panel.js +1 -1
- package/src/components/global-styles/index.js +5 -1
- package/src/components/global-styles/shadow-panel-components.js +92 -23
- package/src/components/global-styles/style.scss +33 -10
- package/src/components/global-styles/test/typography-utils.js +231 -81
- package/src/components/global-styles/typography-utils.js +10 -7
- package/src/components/global-styles/use-global-styles-output.js +14 -16
- package/src/components/global-styles/utils.js +2 -8
- package/src/components/grid-visualizer/grid-item-resizer.js +100 -0
- package/src/components/grid-visualizer/grid-visualizer.js +81 -0
- package/src/components/grid-visualizer/index.js +2 -0
- package/src/components/grid-visualizer/style.scss +33 -0
- package/src/components/grid-visualizer/utils.js +5 -0
- package/src/components/iframe/index.js +78 -31
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
- package/src/components/inserter/media-tab/media-preview.js +1 -1
- package/src/components/inserter/menu.js +10 -4
- package/src/components/inserter/menu.native.js +3 -3
- package/src/components/inserter/mobile-tab-navigation.js +1 -1
- package/src/components/inserter/search-results.js +2 -1
- package/src/components/inserter/style.scss +10 -0
- package/src/components/inserter/tabs.js +2 -1
- package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
- package/src/components/inspector-controls-tabs/index.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/src/components/line-height-control/test/index.js +1 -1
- package/src/components/link-control/link-preview.js +9 -2
- package/src/components/link-control/search-input.js +1 -1
- package/src/components/link-control/style.scss +9 -0
- package/src/components/list-view/block-select-button.js +16 -2
- package/src/components/list-view/branch.js +1 -1
- package/src/components/list-view/drop-indicator.js +1 -1
- package/src/components/list-view/index.js +1 -1
- package/src/components/list-view/style.scss +8 -0
- package/src/components/list-view/use-clipboard-handler.js +3 -2
- package/src/components/panel-color-settings/index.js +1 -1
- package/src/components/panel-color-settings/test/index.js +3 -3
- package/src/components/provider/index.js +1 -4
- package/src/components/resizable-box-popover/index.js +4 -6
- package/src/components/responsive-block-control/README.md +4 -4
- package/src/components/responsive-block-control/index.js +1 -1
- package/src/components/responsive-block-control/test/index.js +5 -5
- package/src/components/rich-text/index.js +76 -53
- package/src/components/rich-text/use-enter.js +4 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/src/components/url-popover/index.js +5 -5
- package/src/components/url-popover/style.scss +1 -0
- package/src/components/writing-flow/use-clipboard-handler.js +3 -2
- package/src/components/writing-flow/utils.js +31 -16
- package/src/hooks/background.js +1 -1
- package/src/hooks/block-hooks.js +47 -9
- package/src/hooks/block-hooks.scss +6 -0
- package/src/hooks/border.js +16 -4
- package/src/hooks/dimensions.js +1 -2
- package/src/hooks/font-size.js +7 -12
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout-child.js +38 -0
- package/src/hooks/layout.js +12 -1
- package/src/hooks/line-height.js +1 -1
- package/src/hooks/spacing-visualizer.js +126 -0
- package/src/hooks/{padding.scss → spacing.scss} +1 -1
- package/src/hooks/use-bindings-attributes.js +215 -65
- package/src/hooks/use-typography-props.js +2 -8
- package/src/layouts/grid.js +8 -3
- package/src/private-apis.js +6 -2
- package/src/store/actions.js +56 -18
- package/src/store/private-actions.js +34 -79
- package/src/store/private-selectors.js +0 -8
- package/src/store/reducer.js +2 -23
- package/src/store/selectors.js +41 -46
- package/src/store/test/actions.js +0 -4
- package/src/style.scss +3 -1
- package/src/utils/calculate-scale.js +20 -0
- package/build/hooks/margin.js +0 -86
- package/build/hooks/margin.js.map +0 -1
- package/build/hooks/padding.js +0 -78
- package/build/hooks/padding.js.map +0 -1
- package/build/utils/use-can-block-toolbar-be-focused.js +0 -46
- package/build/utils/use-can-block-toolbar-be-focused.js.map +0 -1
- package/build-module/hooks/margin.js +0 -78
- package/build-module/hooks/margin.js.map +0 -1
- package/build-module/hooks/padding.js +0 -70
- package/build-module/hooks/padding.js.map +0 -1
- package/build-module/utils/use-can-block-toolbar-be-focused.js +0 -40
- package/build-module/utils/use-can-block-toolbar-be-focused.js.map +0 -1
- package/src/hooks/margin.js +0 -91
- package/src/hooks/padding.js +0 -82
- package/src/utils/use-can-block-toolbar-be-focused.js +0 -48
|
@@ -341,14 +341,6 @@ export function getLastFocus( state ) {
|
|
|
341
341
|
return state.lastFocus;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
export function getAllBlockBindingsSources( state ) {
|
|
345
|
-
return state.blockBindingsSources;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
export function getBlockBindingsSource( state, sourceName ) {
|
|
349
|
-
return state.blockBindingsSources[ sourceName ];
|
|
350
|
-
}
|
|
351
|
-
|
|
352
344
|
/**
|
|
353
345
|
* Returns true if the user is dragging anything, or false otherwise. It is possible for a
|
|
354
346
|
* user to be dragging data from outside of the editor, so this selector is separate from
|
package/src/store/reducer.js
CHANGED
|
@@ -1521,17 +1521,11 @@ export function isSelectionEnabled( state = true, action ) {
|
|
|
1521
1521
|
function removalPromptData( state = false, action ) {
|
|
1522
1522
|
switch ( action.type ) {
|
|
1523
1523
|
case 'DISPLAY_BLOCK_REMOVAL_PROMPT':
|
|
1524
|
-
const {
|
|
1525
|
-
clientIds,
|
|
1526
|
-
selectPrevious,
|
|
1527
|
-
blockNamesForPrompt,
|
|
1528
|
-
messageType,
|
|
1529
|
-
} = action;
|
|
1524
|
+
const { clientIds, selectPrevious, message } = action;
|
|
1530
1525
|
return {
|
|
1531
1526
|
clientIds,
|
|
1532
1527
|
selectPrevious,
|
|
1533
|
-
|
|
1534
|
-
messageType,
|
|
1528
|
+
message,
|
|
1535
1529
|
};
|
|
1536
1530
|
case 'CLEAR_BLOCK_REMOVAL_PROMPT':
|
|
1537
1531
|
return false;
|
|
@@ -2050,20 +2044,6 @@ export function lastFocus( state = false, action ) {
|
|
|
2050
2044
|
return state;
|
|
2051
2045
|
}
|
|
2052
2046
|
|
|
2053
|
-
function blockBindingsSources( state = {}, action ) {
|
|
2054
|
-
if ( action.type === 'REGISTER_BLOCK_BINDINGS_SOURCE' ) {
|
|
2055
|
-
return {
|
|
2056
|
-
...state,
|
|
2057
|
-
[ action.sourceName ]: {
|
|
2058
|
-
label: action.sourceLabel,
|
|
2059
|
-
useSource: action.useSource,
|
|
2060
|
-
lockAttributesEditing: action.lockAttributesEditing ?? true,
|
|
2061
|
-
},
|
|
2062
|
-
};
|
|
2063
|
-
}
|
|
2064
|
-
return state;
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
2047
|
const combinedReducers = combineReducers( {
|
|
2068
2048
|
blocks,
|
|
2069
2049
|
isDragging,
|
|
@@ -2095,7 +2075,6 @@ const combinedReducers = combineReducers( {
|
|
|
2095
2075
|
blockRemovalRules,
|
|
2096
2076
|
openedBlockSettingsMenu,
|
|
2097
2077
|
registeredInserterMediaCategories,
|
|
2098
|
-
blockBindingsSources,
|
|
2099
2078
|
} );
|
|
2100
2079
|
|
|
2101
2080
|
function withAutomaticChangeReset( reducer ) {
|
package/src/store/selectors.js
CHANGED
|
@@ -2231,56 +2231,41 @@ export const __experimentalGetAllowedBlocks = createSelector(
|
|
|
2231
2231
|
* @param {Object} state Editor state.
|
|
2232
2232
|
* @param {?string} rootClientId Optional root client ID of block list.
|
|
2233
2233
|
*
|
|
2234
|
-
* @return {
|
|
2234
|
+
* @return {WPDirectInsertBlock|undefined} The block type to be directly inserted.
|
|
2235
2235
|
*
|
|
2236
2236
|
* @typedef {Object} WPDirectInsertBlock
|
|
2237
2237
|
* @property {string} name The type of block.
|
|
2238
2238
|
* @property {?Object} attributes Attributes to pass to the newly created block.
|
|
2239
2239
|
* @property {?Array<string>} attributesToCopy Attributes to be copied from adjecent blocks when inserted.
|
|
2240
2240
|
*/
|
|
2241
|
-
export
|
|
2242
|
-
(
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
if ( ! defaultBlock || ! directInsert ) {
|
|
2251
|
-
return;
|
|
2252
|
-
}
|
|
2253
|
-
if ( typeof directInsert === 'function' ) {
|
|
2254
|
-
return directInsert( getBlock( state, rootClientId ) )
|
|
2255
|
-
? defaultBlock
|
|
2256
|
-
: null;
|
|
2257
|
-
}
|
|
2258
|
-
return defaultBlock;
|
|
2259
|
-
},
|
|
2260
|
-
( state, rootClientId ) => [
|
|
2261
|
-
state.blockListSettings[ rootClientId ],
|
|
2262
|
-
state.blocks.tree.get( rootClientId ),
|
|
2263
|
-
]
|
|
2264
|
-
);
|
|
2241
|
+
export function getDirectInsertBlock( state, rootClientId = null ) {
|
|
2242
|
+
if ( ! rootClientId ) {
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
const { defaultBlock, directInsert } =
|
|
2246
|
+
state.blockListSettings[ rootClientId ] ?? {};
|
|
2247
|
+
if ( ! defaultBlock || ! directInsert ) {
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2265
2250
|
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2251
|
+
return defaultBlock;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
export function __experimentalGetDirectInsertBlock(
|
|
2255
|
+
state,
|
|
2256
|
+
rootClientId = null
|
|
2257
|
+
) {
|
|
2258
|
+
deprecated(
|
|
2259
|
+
'wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',
|
|
2260
|
+
{
|
|
2261
|
+
alternative:
|
|
2262
|
+
'wp.data.select( "core/block-editor" ).getDirectInsertBlock',
|
|
2263
|
+
since: '6.3',
|
|
2264
|
+
version: '6.4',
|
|
2265
|
+
}
|
|
2266
|
+
);
|
|
2267
|
+
return getDirectInsertBlock( state, rootClientId );
|
|
2268
|
+
}
|
|
2284
2269
|
|
|
2285
2270
|
export const __experimentalGetParsedPattern = createRegistrySelector(
|
|
2286
2271
|
( select ) =>
|
|
@@ -2293,11 +2278,21 @@ export const __experimentalGetParsedPattern = createRegistrySelector(
|
|
|
2293
2278
|
if ( ! pattern ) {
|
|
2294
2279
|
return null;
|
|
2295
2280
|
}
|
|
2281
|
+
const blocks = parse( pattern.content, {
|
|
2282
|
+
__unstableSkipMigrationLogs: true,
|
|
2283
|
+
} );
|
|
2284
|
+
if ( blocks.length === 1 ) {
|
|
2285
|
+
blocks[ 0 ].attributes = {
|
|
2286
|
+
...blocks[ 0 ].attributes,
|
|
2287
|
+
metadata: {
|
|
2288
|
+
...( blocks[ 0 ].attributes.metadata || {} ),
|
|
2289
|
+
categories: pattern.categories,
|
|
2290
|
+
},
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2296
2293
|
return {
|
|
2297
2294
|
...pattern,
|
|
2298
|
-
blocks
|
|
2299
|
-
__unstableSkipMigrationLogs: true,
|
|
2300
|
-
} ),
|
|
2295
|
+
blocks,
|
|
2301
2296
|
};
|
|
2302
2297
|
}, getAllPatternsDependants( select ) )
|
|
2303
2298
|
);
|
|
@@ -832,10 +832,6 @@ describe( 'actions', () => {
|
|
|
832
832
|
blockB.clientId
|
|
833
833
|
)( { select, dispatch } );
|
|
834
834
|
|
|
835
|
-
expect( dispatch ).toHaveBeenCalledWith( {
|
|
836
|
-
type: 'MERGE_BLOCKS',
|
|
837
|
-
blocks: [ blockA.clientId, blockB.clientId ],
|
|
838
|
-
} );
|
|
839
835
|
expect( dispatch.selectBlock ).toHaveBeenCalledWith( 'chicken' );
|
|
840
836
|
} );
|
|
841
837
|
|
package/src/style.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import "./autocompleters/style.scss";
|
|
2
2
|
@import "./components/block-alignment-control/style.scss";
|
|
3
|
+
@import "./components/block-bindings-toolbar-indicator/style.scss";
|
|
3
4
|
@import "./components/block-canvas/style.scss";
|
|
4
5
|
@import "./components/block-icon/style.scss";
|
|
5
6
|
@import "./components/block-inspector/style.scss";
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
@import "./components/duotone-control/style.scss";
|
|
28
29
|
@import "./components/font-appearance-control/style.scss";
|
|
29
30
|
@import "./components/global-styles/style.scss";
|
|
31
|
+
@import "./components/grid-visualizer/style.scss";
|
|
30
32
|
@import "./components/height-control/style.scss";
|
|
31
33
|
@import "./components/image-size-control/style.scss";
|
|
32
34
|
@import "./components/inserter-list-item/style.scss";
|
|
@@ -52,8 +54,8 @@
|
|
|
52
54
|
@import "./hooks/color.scss";
|
|
53
55
|
@import "./hooks/dimensions.scss";
|
|
54
56
|
@import "./hooks/layout.scss";
|
|
55
|
-
@import "./hooks/padding.scss";
|
|
56
57
|
@import "./hooks/position.scss";
|
|
58
|
+
@import "./hooks/spacing.scss";
|
|
57
59
|
@import "./hooks/typography.scss";
|
|
58
60
|
|
|
59
61
|
@import "./components/block-toolbar/style.scss";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const clamp = ( lowerlimit, width, upperlimit ) => {
|
|
2
|
+
if ( width < lowerlimit ) return lowerlimit;
|
|
3
|
+
if ( width > upperlimit ) return upperlimit;
|
|
4
|
+
return width;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default function calculateScale( scaleConfig, width ) {
|
|
8
|
+
const scaleSlope =
|
|
9
|
+
( scaleConfig.maxScale - scaleConfig.minScale ) /
|
|
10
|
+
( scaleConfig.maxWidth - scaleConfig.minWidth );
|
|
11
|
+
|
|
12
|
+
const scaleIntercept =
|
|
13
|
+
scaleConfig.minScale - scaleSlope * scaleConfig.minWidth;
|
|
14
|
+
|
|
15
|
+
return clamp(
|
|
16
|
+
scaleConfig.maxScale,
|
|
17
|
+
scaleSlope * width + scaleIntercept,
|
|
18
|
+
scaleConfig.minScale
|
|
19
|
+
);
|
|
20
|
+
}
|
package/build/hooks/margin.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.MarginVisualizer = MarginVisualizer;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _isShallowEqual = _interopRequireDefault(require("@wordpress/is-shallow-equal"));
|
|
11
|
-
var _blockPopover = _interopRequireDefault(require("../components/block-popover"));
|
|
12
|
-
var _useBlockRefs = require("../components/block-list/use-block-props/use-block-refs");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function getComputedCSS(element, property) {
|
|
22
|
-
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
|
|
23
|
-
}
|
|
24
|
-
function MarginVisualizer({
|
|
25
|
-
clientId,
|
|
26
|
-
attributes,
|
|
27
|
-
forceShow
|
|
28
|
-
}) {
|
|
29
|
-
const blockElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
|
|
30
|
-
const [style, setStyle] = (0, _element.useState)();
|
|
31
|
-
const margin = attributes?.style?.spacing?.margin;
|
|
32
|
-
(0, _element.useEffect)(() => {
|
|
33
|
-
if (!blockElement || null === blockElement.ownerDocument.defaultView) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const top = getComputedCSS(blockElement, 'margin-top');
|
|
37
|
-
const right = getComputedCSS(blockElement, 'margin-right');
|
|
38
|
-
const bottom = getComputedCSS(blockElement, 'margin-bottom');
|
|
39
|
-
const left = getComputedCSS(blockElement, 'margin-left');
|
|
40
|
-
setStyle({
|
|
41
|
-
borderTopWidth: top,
|
|
42
|
-
borderRightWidth: right,
|
|
43
|
-
borderBottomWidth: bottom,
|
|
44
|
-
borderLeftWidth: left,
|
|
45
|
-
top: top ? `-${top}` : 0,
|
|
46
|
-
right: right ? `-${right}` : 0,
|
|
47
|
-
bottom: bottom ? `-${bottom}` : 0,
|
|
48
|
-
left: left ? `-${left}` : 0
|
|
49
|
-
});
|
|
50
|
-
}, [blockElement, margin]);
|
|
51
|
-
const [isActive, setIsActive] = (0, _element.useState)(false);
|
|
52
|
-
const valueRef = (0, _element.useRef)(margin);
|
|
53
|
-
const timeoutRef = (0, _element.useRef)();
|
|
54
|
-
const clearTimer = () => {
|
|
55
|
-
if (timeoutRef.current) {
|
|
56
|
-
window.clearTimeout(timeoutRef.current);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
(0, _element.useEffect)(() => {
|
|
60
|
-
if (!(0, _isShallowEqual.default)(margin, valueRef.current) && !forceShow) {
|
|
61
|
-
setIsActive(true);
|
|
62
|
-
valueRef.current = margin;
|
|
63
|
-
timeoutRef.current = setTimeout(() => {
|
|
64
|
-
setIsActive(false);
|
|
65
|
-
}, 400);
|
|
66
|
-
}
|
|
67
|
-
return () => {
|
|
68
|
-
setIsActive(false);
|
|
69
|
-
clearTimer();
|
|
70
|
-
};
|
|
71
|
-
}, [margin, forceShow]);
|
|
72
|
-
if (!isActive && !forceShow) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
return (0, _react.createElement)(_blockPopover.default, {
|
|
76
|
-
clientId: clientId,
|
|
77
|
-
__unstableCoverTarget: true,
|
|
78
|
-
__unstableRefreshSize: margin,
|
|
79
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
80
|
-
shift: false
|
|
81
|
-
}, (0, _react.createElement)("div", {
|
|
82
|
-
className: "block-editor__padding-visualizer",
|
|
83
|
-
style: style
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=margin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_blockPopover","_useBlockRefs","getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","MarginVisualizer","clientId","attributes","forceShow","blockElement","useBlockElement","style","setStyle","useState","margin","spacing","useEffect","top","right","bottom","left","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","useRef","timeoutRef","clearTimer","current","window","clearTimeout","isShallowEqual","setTimeout","_react","createElement","default","__unstableCoverTarget","__unstableRefreshSize","__unstablePopoverSlot","shift","className"],"sources":["@wordpress/block-editor/src/hooks/margin.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function MarginVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst margin = attributes?.style?.spacing?.margin;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst top = getComputedCSS( blockElement, 'margin-top' );\n\t\tconst right = getComputedCSS( blockElement, 'margin-right' );\n\t\tconst bottom = getComputedCSS( blockElement, 'margin-bottom' );\n\t\tconst left = getComputedCSS( blockElement, 'margin-left' );\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: top,\n\t\t\tborderRightWidth: right,\n\t\t\tborderBottomWidth: bottom,\n\t\t\tborderLeftWidth: left,\n\t\t\ttop: top ? `-${ top }` : 0,\n\t\t\tright: right ? `-${ right }` : 0,\n\t\t\tbottom: bottom ? `-${ bottom }` : 0,\n\t\t\tleft: left ? `-${ left }` : 0,\n\t\t} );\n\t}, [ blockElement, margin ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( margin );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( margin, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = margin;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ margin, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ margin }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASK,cAAcA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EAC5C,OAAOD,OAAO,CAACE,aAAa,CAACC,WAAW,CACtCC,gBAAgB,CAAEJ,OAAQ,CAAC,CAC3BK,gBAAgB,CAAEJ,QAAS,CAAC;AAC/B;AAEO,SAASK,gBAAgBA,CAAE;EAAEC,QAAQ;EAAEC,UAAU;EAAEC;AAAU,CAAC,EAAG;EACvE,MAAMC,YAAY,GAAG,IAAAC,uCAAe,EAAEJ,QAAS,CAAC;EAChD,MAAM,CAAEK,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAC,CAAC;EAEtC,MAAMC,MAAM,GAAGP,UAAU,EAAEI,KAAK,EAAEI,OAAO,EAAED,MAAM;EAEjD,IAAAE,kBAAS,EAAE,MAAM;IAChB,IACC,CAAEP,YAAY,IACd,IAAI,KAAKA,YAAY,CAACR,aAAa,CAACC,WAAW,EAC9C;MACD;IACD;IAEA,MAAMe,GAAG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nBC,QAAQ,CAACI,OAAO,GAAGjB,MAAM;MAEzBe,UAAU,CAACE,OAAO,GAAGI,UAAU,CAAE,MAAM;QACtCT,WAAW,CAAE,KAAM,CAAC;MACrB,CAAC,EAAE,GAAI,CAAC;IACT;IAEA,OAAO,MAAM;MACZA,WAAW,CAAE,KAAM,CAAC;MACpBI,UAAU,CAAC,CAAC;IACb,CAAC;EACF,CAAC,EAAE,CAAEhB,MAAM,EAAEN,SAAS,CAAG,CAAC;EAE1B,IAAK,CAAEiB,QAAQ,IAAI,CAAEjB,SAAS,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACC,IAAA4B,MAAA,CAAAC,aAAA,EAACzC,aAAA,CAAA0C,OAAY;IACZhC,QAAQ,EAAGA,QAAU;IACrBiC,qBAAqB;IACrBC,qBAAqB,EAAG1B,MAAQ;IAChC2B,qBAAqB,EAAC,eAAe;IACrCC,KAAK,EAAG;EAAO,GAEf,IAAAN,MAAA,CAAAC,aAAA;IAAKM,SAAS,EAAC,kCAAkC;IAAChC,KAAK,EAAGA;EAAO,CAAE,CACtD,CAAC;AAEjB"}
|
package/build/hooks/padding.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.PaddingVisualizer = PaddingVisualizer;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _isShallowEqual = _interopRequireDefault(require("@wordpress/is-shallow-equal"));
|
|
11
|
-
var _blockPopover = _interopRequireDefault(require("../components/block-popover"));
|
|
12
|
-
var _useBlockRefs = require("../components/block-list/use-block-props/use-block-refs");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
function getComputedCSS(element, property) {
|
|
22
|
-
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
|
|
23
|
-
}
|
|
24
|
-
function PaddingVisualizer({
|
|
25
|
-
clientId,
|
|
26
|
-
value,
|
|
27
|
-
forceShow
|
|
28
|
-
}) {
|
|
29
|
-
const blockElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
|
|
30
|
-
const [style, setStyle] = (0, _element.useState)();
|
|
31
|
-
const padding = value?.spacing?.padding;
|
|
32
|
-
(0, _element.useEffect)(() => {
|
|
33
|
-
if (!blockElement || null === blockElement.ownerDocument.defaultView) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
setStyle({
|
|
37
|
-
borderTopWidth: getComputedCSS(blockElement, 'padding-top'),
|
|
38
|
-
borderRightWidth: getComputedCSS(blockElement, 'padding-right'),
|
|
39
|
-
borderBottomWidth: getComputedCSS(blockElement, 'padding-bottom'),
|
|
40
|
-
borderLeftWidth: getComputedCSS(blockElement, 'padding-left')
|
|
41
|
-
});
|
|
42
|
-
}, [blockElement, padding]);
|
|
43
|
-
const [isActive, setIsActive] = (0, _element.useState)(false);
|
|
44
|
-
const valueRef = (0, _element.useRef)(padding);
|
|
45
|
-
const timeoutRef = (0, _element.useRef)();
|
|
46
|
-
const clearTimer = () => {
|
|
47
|
-
if (timeoutRef.current) {
|
|
48
|
-
window.clearTimeout(timeoutRef.current);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
(0, _element.useEffect)(() => {
|
|
52
|
-
if (!(0, _isShallowEqual.default)(padding, valueRef.current) && !forceShow) {
|
|
53
|
-
setIsActive(true);
|
|
54
|
-
valueRef.current = padding;
|
|
55
|
-
timeoutRef.current = setTimeout(() => {
|
|
56
|
-
setIsActive(false);
|
|
57
|
-
}, 400);
|
|
58
|
-
}
|
|
59
|
-
return () => {
|
|
60
|
-
setIsActive(false);
|
|
61
|
-
clearTimer();
|
|
62
|
-
};
|
|
63
|
-
}, [padding, forceShow]);
|
|
64
|
-
if (!isActive && !forceShow) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
return (0, _react.createElement)(_blockPopover.default, {
|
|
68
|
-
clientId: clientId,
|
|
69
|
-
__unstableCoverTarget: true,
|
|
70
|
-
__unstableRefreshSize: padding,
|
|
71
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
72
|
-
shift: false
|
|
73
|
-
}, (0, _react.createElement)("div", {
|
|
74
|
-
className: "block-editor__padding-visualizer",
|
|
75
|
-
style: style
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=padding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_blockPopover","_useBlockRefs","getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","PaddingVisualizer","clientId","value","forceShow","blockElement","useBlockElement","style","setStyle","useState","padding","spacing","useEffect","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","useRef","timeoutRef","clearTimer","current","window","clearTimeout","isShallowEqual","setTimeout","_react","createElement","default","__unstableCoverTarget","__unstableRefreshSize","__unstablePopoverSlot","shift","className"],"sources":["@wordpress/block-editor/src/hooks/padding.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function PaddingVisualizer( { clientId, value, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst padding = value?.spacing?.padding;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: getComputedCSS( blockElement, 'padding-top' ),\n\t\t\tborderRightWidth: getComputedCSS( blockElement, 'padding-right' ),\n\t\t\tborderBottomWidth: getComputedCSS( blockElement, 'padding-bottom' ),\n\t\t\tborderLeftWidth: getComputedCSS( blockElement, 'padding-left' ),\n\t\t} );\n\t}, [ blockElement, padding ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( padding );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( padding, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = padding;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ padding, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ padding }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OA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D,UAAU,CAACE,OAAO,EAAG;MACzBC,MAAM,CAACC,YAAY,CAAEJ,UAAU,CAACE,OAAQ,CAAC;IAC1C;EACD,CAAC;EAED,IAAAX,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAE,IAAAc,uBAAc,EAAEhB,OAAO,EAAES,QAAQ,CAACI,OAAQ,CAAC,IAAI,CAAEnB,SAAS,EAAG;MACnEc,WAAW,CAAE,IAAK,CAAC;MACnBC,QAAQ,CAACI,OAAO,GAAGb,OAAO;MAE1BW,UAAU,CAACE,OAAO,GAAGI,UAAU,CAAE,MAAM;QACtCT,WAAW,CAAE,KAAM,CAAC;MACrB,CAAC,EAAE,GAAI,CAAC;IACT;IAEA,OAAO,MAAM;MACZA,WAAW,CAAE,KAAM,CAAC;MACpBI,UAAU,CAAC,CAAC;IACb,CAAC;EACF,CAAC,EAAE,CAAEZ,OAAO,EAAEN,SAAS,CAAG,CAAC;EAE3B,IAAK,CAAEa,QAAQ,IAAI,CAAEb,SAAS,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAwB,MAAA,CAAAC,aAAA,EAACrC,aAAA,CAAAsC,OAAY;IACZ5B,QAAQ,EAAGA,QAAU;IACrB6B,qBAAqB;IACrBC,qBAAqB,EAAGtB,OAAS;IACjCuB,qBAAqB,EAAC,eAAe;IACrCC,KAAK,EAAG;EAAO,GAEf,IAAAN,MAAA,CAAAC,aAAA;IAAKM,SAAS,EAAC,kCAAkC;IAAC5B,KAAK,EAAGA;EAAO,CAAE,CACtD,CAAC;AAEjB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useCanBlockToolbarBeFocused = useCanBlockToolbarBeFocused;
|
|
7
|
-
var _data = require("@wordpress/data");
|
|
8
|
-
var _blocks = require("@wordpress/blocks");
|
|
9
|
-
var _store = require("../store");
|
|
10
|
-
var _lockUnlock = require("../lock-unlock");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Returns true if the block toolbar should be able to receive focus.
|
|
21
|
-
*
|
|
22
|
-
* @return {boolean} Whether the block toolbar should be able to receive focus
|
|
23
|
-
*/
|
|
24
|
-
function useCanBlockToolbarBeFocused() {
|
|
25
|
-
return (0, _data.useSelect)(select => {
|
|
26
|
-
const {
|
|
27
|
-
__unstableGetEditorMode,
|
|
28
|
-
getBlock,
|
|
29
|
-
getSettings,
|
|
30
|
-
getSelectedBlockClientId,
|
|
31
|
-
getFirstMultiSelectedBlockClientId
|
|
32
|
-
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
33
|
-
const selectedBlockId = getFirstMultiSelectedBlockClientId() || getSelectedBlockClientId();
|
|
34
|
-
const isEmptyDefaultBlock = (0, _blocks.isUnmodifiedDefaultBlock)(getBlock(selectedBlockId) || {});
|
|
35
|
-
|
|
36
|
-
// Fixed Toolbar can be focused when:
|
|
37
|
-
// - a block is selected
|
|
38
|
-
// - fixed toolbar is on
|
|
39
|
-
// Block Toolbar Popover can be focused when:
|
|
40
|
-
// - a block is selected
|
|
41
|
-
// - we are in edit mode
|
|
42
|
-
// - it is not an empty default block
|
|
43
|
-
return !!selectedBlockId && (getSettings().hasFixedToolbar || __unstableGetEditorMode() === 'edit' && !isEmptyDefaultBlock);
|
|
44
|
-
}, []);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=use-can-block-toolbar-be-focused.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blocks","_store","_lockUnlock","useCanBlockToolbarBeFocused","useSelect","select","__unstableGetEditorMode","getBlock","getSettings","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","unlock","blockEditorStore","selectedBlockId","isEmptyDefaultBlock","isUnmodifiedDefaultBlock","hasFixedToolbar"],"sources":["@wordpress/block-editor/src/utils/use-can-block-toolbar-be-focused.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Returns true if the block toolbar should be able to receive focus.\n *\n * @return {boolean} Whether the block toolbar should be able to receive focus\n */\nexport function useCanBlockToolbarBeFocused() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableGetEditorMode,\n\t\t\tgetBlock,\n\t\t\tgetSettings,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst selectedBlockId =\n\t\t\tgetFirstMultiSelectedBlockClientId() || getSelectedBlockClientId();\n\t\tconst isEmptyDefaultBlock = isUnmodifiedDefaultBlock(\n\t\t\tgetBlock( selectedBlockId ) || {}\n\t\t);\n\n\t\t// Fixed Toolbar can be focused when:\n\t\t// - a block is selected\n\t\t// - fixed toolbar is on\n\t\t// Block Toolbar Popover can be focused when:\n\t\t// - a block is selected\n\t\t// - we are in edit mode\n\t\t// - it is not an empty default block\n\t\treturn (\n\t\t\t!! selectedBlockId &&\n\t\t\t( getSettings().hasFixedToolbar ||\n\t\t\t\t( __unstableGetEditorMode() === 'edit' &&\n\t\t\t\t\t! isEmptyDefaultBlock ) )\n\t\t);\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASI,2BAA2BA,CAAA,EAAG;EAC7C,OAAO,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC/B,MAAM;MACLC,uBAAuB;MACvBC,QAAQ;MACRC,WAAW;MACXC,wBAAwB;MACxBC;IACD,CAAC,GAAG,IAAAC,kBAAM,EAAEN,MAAM,CAAEO,YAAiB,CAAE,CAAC;IAExC,MAAMC,eAAe,GACpBH,kCAAkC,CAAC,CAAC,IAAID,wBAAwB,CAAC,CAAC;IACnE,MAAMK,mBAAmB,GAAG,IAAAC,gCAAwB,EACnDR,QAAQ,CAAEM,eAAgB,CAAC,IAAI,CAAC,CACjC,CAAC;;IAED;IACA;IACA;IACA;IACA;IACA;IACA;IACA,OACC,CAAC,CAAEA,eAAe,KAChBL,WAAW,CAAC,CAAC,CAACQ,eAAe,IAC5BV,uBAAuB,CAAC,CAAC,KAAK,MAAM,IACrC,CAAEQ,mBAAqB,CAAE;EAE7B,CAAC,EAAE,EAAG,CAAC;AACR"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
6
|
-
import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import BlockPopover from '../components/block-popover';
|
|
12
|
-
import { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
|
|
13
|
-
function getComputedCSS(element, property) {
|
|
14
|
-
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
|
|
15
|
-
}
|
|
16
|
-
export function MarginVisualizer({
|
|
17
|
-
clientId,
|
|
18
|
-
attributes,
|
|
19
|
-
forceShow
|
|
20
|
-
}) {
|
|
21
|
-
const blockElement = useBlockElement(clientId);
|
|
22
|
-
const [style, setStyle] = useState();
|
|
23
|
-
const margin = attributes?.style?.spacing?.margin;
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!blockElement || null === blockElement.ownerDocument.defaultView) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const top = getComputedCSS(blockElement, 'margin-top');
|
|
29
|
-
const right = getComputedCSS(blockElement, 'margin-right');
|
|
30
|
-
const bottom = getComputedCSS(blockElement, 'margin-bottom');
|
|
31
|
-
const left = getComputedCSS(blockElement, 'margin-left');
|
|
32
|
-
setStyle({
|
|
33
|
-
borderTopWidth: top,
|
|
34
|
-
borderRightWidth: right,
|
|
35
|
-
borderBottomWidth: bottom,
|
|
36
|
-
borderLeftWidth: left,
|
|
37
|
-
top: top ? `-${top}` : 0,
|
|
38
|
-
right: right ? `-${right}` : 0,
|
|
39
|
-
bottom: bottom ? `-${bottom}` : 0,
|
|
40
|
-
left: left ? `-${left}` : 0
|
|
41
|
-
});
|
|
42
|
-
}, [blockElement, margin]);
|
|
43
|
-
const [isActive, setIsActive] = useState(false);
|
|
44
|
-
const valueRef = useRef(margin);
|
|
45
|
-
const timeoutRef = useRef();
|
|
46
|
-
const clearTimer = () => {
|
|
47
|
-
if (timeoutRef.current) {
|
|
48
|
-
window.clearTimeout(timeoutRef.current);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!isShallowEqual(margin, valueRef.current) && !forceShow) {
|
|
53
|
-
setIsActive(true);
|
|
54
|
-
valueRef.current = margin;
|
|
55
|
-
timeoutRef.current = setTimeout(() => {
|
|
56
|
-
setIsActive(false);
|
|
57
|
-
}, 400);
|
|
58
|
-
}
|
|
59
|
-
return () => {
|
|
60
|
-
setIsActive(false);
|
|
61
|
-
clearTimer();
|
|
62
|
-
};
|
|
63
|
-
}, [margin, forceShow]);
|
|
64
|
-
if (!isActive && !forceShow) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
return createElement(BlockPopover, {
|
|
68
|
-
clientId: clientId,
|
|
69
|
-
__unstableCoverTarget: true,
|
|
70
|
-
__unstableRefreshSize: margin,
|
|
71
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
72
|
-
shift: false
|
|
73
|
-
}, createElement("div", {
|
|
74
|
-
className: "block-editor__padding-visualizer",
|
|
75
|
-
style: style
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=margin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useRef","useEffect","isShallowEqual","BlockPopover","__unstableUseBlockElement","useBlockElement","getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","MarginVisualizer","clientId","attributes","forceShow","blockElement","style","setStyle","margin","spacing","top","right","bottom","left","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout","createElement","__unstableCoverTarget","__unstableRefreshSize","__unstablePopoverSlot","shift","className"],"sources":["@wordpress/block-editor/src/hooks/margin.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function MarginVisualizer( { clientId, attributes, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst margin = attributes?.style?.spacing?.margin;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst top = getComputedCSS( blockElement, 'margin-top' );\n\t\tconst right = getComputedCSS( blockElement, 'margin-right' );\n\t\tconst bottom = getComputedCSS( blockElement, 'margin-bottom' );\n\t\tconst left = getComputedCSS( blockElement, 'margin-left' );\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: top,\n\t\t\tborderRightWidth: right,\n\t\t\tborderBottomWidth: bottom,\n\t\t\tborderLeftWidth: left,\n\t\t\ttop: top ? `-${ top }` : 0,\n\t\t\tright: right ? `-${ right }` : 0,\n\t\t\tbottom: bottom ? `-${ bottom }` : 0,\n\t\t\tleft: left ? `-${ left }` : 0,\n\t\t} );\n\t}, [ blockElement, margin ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( margin );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( margin, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = margin;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ margin, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ margin }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t\t<div className=\"block-editor__padding-visualizer\" style={ style } />\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAChE,OAAOC,cAAc,MAAM,6BAA6B;;AAExD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,6BAA6B;AACtD,SA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,CAAC;AAEjB"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
6
|
-
import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import BlockPopover from '../components/block-popover';
|
|
12
|
-
import { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
|
|
13
|
-
function getComputedCSS(element, property) {
|
|
14
|
-
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
|
|
15
|
-
}
|
|
16
|
-
export function PaddingVisualizer({
|
|
17
|
-
clientId,
|
|
18
|
-
value,
|
|
19
|
-
forceShow
|
|
20
|
-
}) {
|
|
21
|
-
const blockElement = useBlockElement(clientId);
|
|
22
|
-
const [style, setStyle] = useState();
|
|
23
|
-
const padding = value?.spacing?.padding;
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!blockElement || null === blockElement.ownerDocument.defaultView) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
setStyle({
|
|
29
|
-
borderTopWidth: getComputedCSS(blockElement, 'padding-top'),
|
|
30
|
-
borderRightWidth: getComputedCSS(blockElement, 'padding-right'),
|
|
31
|
-
borderBottomWidth: getComputedCSS(blockElement, 'padding-bottom'),
|
|
32
|
-
borderLeftWidth: getComputedCSS(blockElement, 'padding-left')
|
|
33
|
-
});
|
|
34
|
-
}, [blockElement, padding]);
|
|
35
|
-
const [isActive, setIsActive] = useState(false);
|
|
36
|
-
const valueRef = useRef(padding);
|
|
37
|
-
const timeoutRef = useRef();
|
|
38
|
-
const clearTimer = () => {
|
|
39
|
-
if (timeoutRef.current) {
|
|
40
|
-
window.clearTimeout(timeoutRef.current);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (!isShallowEqual(padding, valueRef.current) && !forceShow) {
|
|
45
|
-
setIsActive(true);
|
|
46
|
-
valueRef.current = padding;
|
|
47
|
-
timeoutRef.current = setTimeout(() => {
|
|
48
|
-
setIsActive(false);
|
|
49
|
-
}, 400);
|
|
50
|
-
}
|
|
51
|
-
return () => {
|
|
52
|
-
setIsActive(false);
|
|
53
|
-
clearTimer();
|
|
54
|
-
};
|
|
55
|
-
}, [padding, forceShow]);
|
|
56
|
-
if (!isActive && !forceShow) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return createElement(BlockPopover, {
|
|
60
|
-
clientId: clientId,
|
|
61
|
-
__unstableCoverTarget: true,
|
|
62
|
-
__unstableRefreshSize: padding,
|
|
63
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
64
|
-
shift: false
|
|
65
|
-
}, createElement("div", {
|
|
66
|
-
className: "block-editor__padding-visualizer",
|
|
67
|
-
style: style
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=padding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useRef","useEffect","isShallowEqual","BlockPopover","__unstableUseBlockElement","useBlockElement","getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue","PaddingVisualizer","clientId","value","forceShow","blockElement","style","setStyle","padding","spacing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","isActive","setIsActive","valueRef","timeoutRef","clearTimer","current","window","clearTimeout","setTimeout","createElement","__unstableCoverTarget","__unstableRefreshSize","__unstablePopoverSlot","shift","className"],"sources":["@wordpress/block-editor/src/hooks/padding.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../components/block-popover';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n\nexport function PaddingVisualizer( { clientId, value, forceShow } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst [ style, setStyle ] = useState();\n\n\tconst padding = value?.spacing?.padding;\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! blockElement ||\n\t\t\tnull === blockElement.ownerDocument.defaultView\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetStyle( {\n\t\t\tborderTopWidth: getComputedCSS( blockElement, 'padding-top' ),\n\t\t\tborderRightWidth: getComputedCSS( blockElement, 'padding-right' ),\n\t\t\tborderBottomWidth: getComputedCSS( blockElement, 'padding-bottom' ),\n\t\t\tborderLeftWidth: getComputedCSS( blockElement, 'padding-left' ),\n\t\t} );\n\t}, [ blockElement, padding ] );\n\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst valueRef = useRef( padding );\n\tconst timeoutRef = useRef();\n\n\tconst clearTimer = () => {\n\t\tif ( timeoutRef.current ) {\n\t\t\twindow.clearTimeout( timeoutRef.current );\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isShallowEqual( padding, valueRef.current ) && ! forceShow ) {\n\t\t\tsetIsActive( true );\n\t\t\tvalueRef.current = padding;\n\n\t\t\ttimeoutRef.current = setTimeout( () => {\n\t\t\t\tsetIsActive( false );\n\t\t\t}, 400 );\n\t\t}\n\n\t\treturn () => {\n\t\t\tsetIsActive( false );\n\t\t\tclearTimer();\n\t\t};\n\t}, [ padding, forceShow ] );\n\n\tif ( ! isActive && ! forceShow ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstableRefreshSize={ padding }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tshift={ false }\n\t\t>\n\t\t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