@wordpress/block-editor 8.5.7 → 9.1.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 +11 -0
- package/README.md +5 -2
- package/build/components/block-alignment-control/constants.js +48 -0
- package/build/components/block-alignment-control/constants.js.map +1 -0
- package/build/components/block-alignment-control/ui.js +9 -40
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +92 -0
- package/build/components/block-alignment-control/ui.native.js.map +1 -0
- package/build/components/block-alignment-matrix-control/index.js +1 -6
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-content-overlay/index.js +5 -74
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +64 -0
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -0
- package/build/components/block-draggable/dropping-insertion-point.native.js +157 -0
- package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -0
- package/build/components/block-draggable/index.native.js +484 -0
- package/build/components/block-draggable/index.native.js.map +1 -0
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +130 -0
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -0
- package/build/components/block-list/block-list-context.native.js +195 -0
- package/build/components/block-list/block-list-context.native.js.map +1 -0
- package/build/components/block-list/block-list-item-cell.native.js +67 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -0
- package/build/components/block-list/block-list-item.native.js +12 -9
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block.native.js +29 -6
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +75 -23
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +8 -4
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +1 -7
- package/build/components/block-list/use-block-props/use-block-class-names.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/modal.js +34 -4
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +2 -1
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +4 -1
- package/build/components/block-lock/use-block-lock.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +9 -3
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +4 -4
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +39 -65
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +17 -4
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +11 -5
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-popover/inbetween.js +191 -0
- package/build/components/block-popover/inbetween.js.map +1 -0
- package/build/components/block-popover/index.js +85 -0
- package/build/components/block-popover/index.js.map +1 -0
- package/build/components/{block-tools → block-popover}/use-popover-scroll.js +4 -1
- package/build/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build/components/block-preview/index.js +1 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -10
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +4 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +5 -5
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -121
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +216 -0
- package/build/components/block-tools/selected-block-popover.js.map +1 -0
- package/build/components/border-radius-control/input-controls.js +10 -3
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/color-style-selector/index.js +9 -0
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +149 -44
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/duotone-control/index.js +5 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +3 -1
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/index.js +5 -23
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/index.native.js +31 -9
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/link-control/constants.js +11 -1
- package/build/components/link-control/constants.js.map +1 -1
- package/build/components/link-control/search-results.js +4 -3
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +4 -4
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block.js +15 -15
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +9 -13
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/context.js +1 -4
- package/build/components/list-view/context.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +0 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +15 -32
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +12 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +0 -1
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +1 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/url-input/index.js +11 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +3 -1
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +167 -0
- package/build/components/use-block-drop-zone/index.native.js.map +1 -0
- package/build/components/use-on-block-drop/index.native.js +95 -0
- package/build/components/use-on-block-drop/index.native.js.map +1 -0
- package/build/components/use-setting/index.js +42 -18
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +463 -44
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +14 -7
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/index.js +3 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/margin.js +64 -12
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +60 -12
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/settings.js +32 -0
- package/build/hooks/settings.js.map +1 -0
- package/build/hooks/style.js +14 -13
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +6 -2
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-border-props.js +22 -32
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/store/actions.js +14 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +0 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +0 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +47 -15
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js +36 -0
- package/build-module/components/block-alignment-control/constants.js.map +1 -0
- package/build-module/components/block-alignment-control/ui.js +4 -35
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +78 -0
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -0
- package/build-module/components/block-alignment-matrix-control/index.js +1 -6
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +4 -70
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +50 -0
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -0
- package/build-module/components/block-draggable/dropping-insertion-point.native.js +137 -0
- package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -0
- package/build-module/components/block-draggable/index.native.js +449 -0
- package/build-module/components/block-draggable/index.native.js.map +1 -0
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +120 -0
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -0
- package/build-module/components/block-list/block-list-context.native.js +179 -0
- package/build-module/components/block-list/block-list-context.native.js.map +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js +59 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -0
- package/build-module/components/block-list/block-list-item.native.js +12 -9
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +28 -6
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +72 -23
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +9 -5
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +1 -7
- package/build-module/components/block-list/use-block-props/use-block-class-names.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/modal.js +34 -5
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +2 -1
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +4 -1
- package/build-module/components/block-lock/use-block-lock.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +8 -3
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +5 -5
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +38 -63
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +18 -5
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +10 -5
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +173 -0
- package/build-module/components/block-popover/inbetween.js.map +1 -0
- package/build-module/components/block-popover/index.js +72 -0
- package/build-module/components/block-popover/index.js.map +1 -0
- package/build-module/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build-module/components/block-preview/index.js +1 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -9
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +3 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +3 -3
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +16 -121
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +199 -0
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -0
- package/build-module/components/border-radius-control/input-controls.js +11 -4
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +6 -0
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +151 -46
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/duotone-control/index.js +4 -1
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +2 -1
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/index.js +1 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +32 -11
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/link-control/constants.js +5 -0
- package/build-module/components/link-control/constants.js.map +1 -1
- package/build-module/components/link-control/search-results.js +3 -4
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +5 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block.js +15 -16
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -13
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/context.js +1 -4
- package/build-module/components/list-view/context.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +0 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +15 -31
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +12 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +0 -1
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -5
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -4
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +11 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +3 -1
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +148 -0
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -0
- package/build-module/components/use-on-block-drop/index.native.js +83 -0
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -0
- package/build-module/components/use-setting/index.js +43 -19
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +453 -44
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +11 -6
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/dimensions.js +5 -5
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/margin.js +61 -13
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +57 -13
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/settings.js +29 -0
- package/build-module/hooks/settings.js.map +1 -0
- package/build-module/hooks/style.js +15 -14
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +6 -2
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-border-props.js +21 -30
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/store/actions.js +14 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +0 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +0 -24
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +44 -15
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +148 -410
- package/build-style/style.css +148 -410
- package/package.json +28 -28
- package/src/components/block-alignment-control/constants.js +45 -0
- package/src/components/block-alignment-control/ui.js +69 -109
- package/src/components/block-alignment-control/ui.native.js +86 -0
- package/src/components/block-alignment-matrix-control/index.js +1 -5
- package/src/components/block-content-overlay/index.js +9 -79
- package/src/components/block-content-overlay/style.scss +2 -11
- package/src/components/block-draggable/draggable-chip.native.js +49 -0
- package/src/components/block-draggable/dropping-insertion-point.native.js +181 -0
- package/src/components/block-draggable/dropping-insertion-point.native.scss +8 -0
- package/src/components/block-draggable/index.native.js +458 -0
- package/src/components/block-draggable/style.native.scss +19 -0
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +135 -0
- package/src/components/block-list/block-list-context.native.js +175 -0
- package/src/components/block-list/block-list-item-cell.native.js +49 -0
- package/src/components/block-list/block-list-item.native.js +7 -11
- package/src/components/block-list/block.native.js +38 -8
- package/src/components/block-list/index.native.js +54 -13
- package/src/components/block-list/style.scss +7 -18
- package/src/components/block-list/test/block-list-context.native.js +253 -0
- package/src/components/block-list/test/fixtures/block-list-context.native.js +79 -0
- package/src/components/block-list/use-block-props/index.js +10 -5
- package/src/components/block-list/use-block-props/use-block-class-names.js +1 -11
- package/src/components/block-list/use-in-between-inserter.js +1 -1
- package/src/components/block-lock/modal.js +42 -3
- package/src/components/block-lock/toolbar.js +2 -2
- package/src/components/block-lock/use-block-lock.js +4 -1
- package/src/components/block-mobile-toolbar/index.native.js +8 -1
- package/src/components/block-mover/button.js +5 -7
- package/src/components/block-mover/index.js +37 -60
- package/src/components/block-mover/index.native.js +22 -6
- package/src/components/block-mover/stories/index.js +110 -0
- package/src/components/block-mover/style.scss +48 -138
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +6 -0
- package/src/components/block-navigation/dropdown.js +12 -8
- package/src/components/block-popover/README.md +41 -0
- package/src/components/block-popover/inbetween.js +188 -0
- package/src/components/block-popover/index.js +75 -0
- package/src/components/block-popover/style.scss +28 -0
- package/src/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/src/components/block-preview/index.js +1 -4
- package/src/components/block-styles/index.js +1 -12
- package/src/components/block-switcher/style.scss +2 -43
- package/src/components/block-toolbar/style.scss +0 -12
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-selection-button.js +3 -1
- package/src/components/block-tools/index.js +6 -4
- package/src/components/block-tools/insertion-point.js +19 -152
- package/src/components/block-tools/{block-popover.js → selected-block-popover.js} +24 -151
- package/src/components/block-tools/style.scss +12 -135
- package/src/components/border-radius-control/input-controls.js +16 -8
- package/src/components/border-radius-control/style.scss +7 -3
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/color-style-selector/index.js +18 -9
- package/src/components/colors-gradients/dropdown.js +156 -62
- package/src/components/colors-gradients/style.scss +51 -23
- package/src/components/default-block-appender/style.scss +1 -2
- package/src/components/duotone-control/index.js +8 -1
- package/src/components/duotone-control/style.scss +1 -7
- package/src/components/gradients/README.md +29 -0
- package/src/components/image-editor/use-save-image.js +2 -1
- package/src/components/image-size-control/README.md +1 -1
- package/src/components/index.js +1 -3
- package/src/components/inserter/index.native.js +60 -25
- package/src/components/inserter/style.native.scss +25 -3
- package/src/components/inserter/style.scss +2 -1
- package/src/components/link-control/constants.js +11 -0
- package/src/components/link-control/search-results.js +4 -5
- package/src/components/link-control/use-search-handler.js +11 -5
- package/src/components/list-view/block.js +24 -34
- package/src/components/list-view/branch.js +10 -20
- package/src/components/list-view/context.js +1 -4
- package/src/components/list-view/drop-indicator.js +0 -1
- package/src/components/list-view/index.js +11 -41
- package/src/components/list-view/style.scss +2 -1
- package/src/components/navigable-toolbar/README.md +16 -0
- package/src/components/navigable-toolbar/index.js +12 -2
- package/src/components/preview-options/style.scss +0 -4
- package/src/components/rich-text/format-toolbar-container.js +0 -1
- package/src/components/rich-text/index.js +1 -3
- package/src/components/rich-text/index.native.js +0 -4
- package/src/components/rich-text/style.scss +2 -8
- package/src/components/url-input/index.js +9 -4
- package/src/components/use-block-display-information/index.js +2 -0
- package/src/components/use-block-drop-zone/index.native.js +173 -0
- package/src/components/use-on-block-drop/index.native.js +119 -0
- package/src/components/use-setting/index.js +57 -21
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +429 -72
- package/src/hooks/color-panel.js +13 -9
- package/src/hooks/color.scss +0 -62
- package/src/hooks/dimensions.js +44 -38
- package/src/hooks/index.js +2 -1
- package/src/hooks/margin.js +64 -15
- package/src/hooks/padding.js +60 -15
- package/src/hooks/padding.scss +12 -0
- package/src/hooks/settings.js +32 -0
- package/src/hooks/style.js +25 -39
- package/src/hooks/test/settings.js +48 -0
- package/src/hooks/typography.js +2 -0
- package/src/hooks/use-border-props.js +15 -32
- package/src/store/actions.js +14 -2
- package/src/store/defaults.js +0 -1
- package/src/store/reducer.js +0 -21
- package/src/store/selectors.js +46 -15
- package/src/store/test/actions.js +0 -18
- package/src/store/test/reducer.js +0 -19
- package/src/store/test/selectors.js +17 -19
- package/src/style.scss +2 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-mobile-toolbar/index.js +0 -42
- package/build/components/block-mobile-toolbar/index.js.map +0 -1
- package/build/components/block-tools/block-popover.js +0 -327
- package/build/components/block-tools/block-popover.js.map +0 -1
- package/build/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build/components/border-style-control/index.js +0 -60
- package/build/components/border-style-control/index.js.map +0 -1
- package/build/components/colors-gradients/tools-panel-color-dropdown.js +0 -89
- package/build/components/colors-gradients/tools-panel-color-dropdown.js.map +0 -1
- package/build/components/list-view/appender.js +0 -93
- package/build/components/list-view/appender.js.map +0 -1
- package/build/components/list-view/list-item.js +0 -62
- package/build/components/list-view/list-item.js.map +0 -1
- package/build/components/rich-text/use-caret-in-format.js +0 -43
- package/build/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build/hooks/border-color.js +0 -302
- package/build/hooks/border-color.js.map +0 -1
- package/build/hooks/border-style.js +0 -96
- package/build/hooks/border-style.js.map +0 -1
- package/build/hooks/border-width.js +0 -162
- package/build/hooks/border-width.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/index.js +0 -31
- package/build-module/components/block-mobile-toolbar/index.js.map +0 -1
- package/build-module/components/block-tools/block-popover.js +0 -306
- package/build-module/components/block-tools/block-popover.js.map +0 -1
- package/build-module/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build-module/components/border-style-control/index.js +0 -50
- package/build-module/components/border-style-control/index.js.map +0 -1
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js +0 -75
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js.map +0 -1
- package/build-module/components/list-view/appender.js +0 -76
- package/build-module/components/list-view/appender.js.map +0 -1
- package/build-module/components/list-view/list-item.js +0 -47
- package/build-module/components/list-view/list-item.js.map +0 -1
- package/build-module/components/rich-text/use-caret-in-format.js +0 -33
- package/build-module/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build-module/hooks/border-color.js +0 -276
- package/build-module/hooks/border-color.js.map +0 -1
- package/build-module/hooks/border-style.js +0 -78
- package/build-module/hooks/border-style.js.map +0 -1
- package/build-module/hooks/border-width.js +0 -143
- package/build-module/hooks/border-width.js.map +0 -1
- package/src/components/block-alignment-matrix-control/style.scss +0 -10
- package/src/components/block-mobile-toolbar/index.js +0 -24
- package/src/components/block-mobile-toolbar/style.scss +0 -29
- package/src/components/border-style-control/index.js +0 -47
- package/src/components/border-style-control/style.scss +0 -18
- package/src/components/colors-gradients/tools-panel-color-dropdown.js +0 -85
- package/src/components/list-view/appender.js +0 -82
- package/src/components/list-view/list-item.js +0 -59
- package/src/components/rich-text/use-caret-in-format.js +0 -28
- package/src/hooks/border-color.js +0 -315
- package/src/hooks/border-style.js +0 -64
- package/src/hooks/border-width.js +0 -139
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = WrappedBlockPopover;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _lodash = require("lodash");
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _blocks = require("@wordpress/blocks");
|
|
17
|
-
|
|
18
|
-
var _components = require("@wordpress/components");
|
|
19
|
-
|
|
20
|
-
var _data = require("@wordpress/data");
|
|
21
|
-
|
|
22
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
23
|
-
|
|
24
|
-
var _compose = require("@wordpress/compose");
|
|
25
|
-
|
|
26
|
-
var _dom = require("@wordpress/dom");
|
|
27
|
-
|
|
28
|
-
var _blockSelectionButton = _interopRequireDefault(require("./block-selection-button"));
|
|
29
|
-
|
|
30
|
-
var _blockContextualToolbar = _interopRequireDefault(require("./block-contextual-toolbar"));
|
|
31
|
-
|
|
32
|
-
var _inserter = _interopRequireDefault(require("../inserter"));
|
|
33
|
-
|
|
34
|
-
var _store = require("../../store");
|
|
35
|
-
|
|
36
|
-
var _useBlockRefs = require("../block-list/use-block-props/use-block-refs");
|
|
37
|
-
|
|
38
|
-
var _usePopoverScroll = require("./use-popover-scroll");
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* External dependencies
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* WordPress dependencies
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Internal dependencies
|
|
50
|
-
*/
|
|
51
|
-
function selector(select) {
|
|
52
|
-
const {
|
|
53
|
-
isNavigationMode,
|
|
54
|
-
isMultiSelecting,
|
|
55
|
-
hasMultiSelection,
|
|
56
|
-
isTyping,
|
|
57
|
-
isCaretWithinFormattedText,
|
|
58
|
-
getSettings,
|
|
59
|
-
getLastMultiSelectedBlockClientId
|
|
60
|
-
} = select(_store.store);
|
|
61
|
-
return {
|
|
62
|
-
isNavigationMode: isNavigationMode(),
|
|
63
|
-
isMultiSelecting: isMultiSelecting(),
|
|
64
|
-
isTyping: isTyping(),
|
|
65
|
-
isCaretWithinFormattedText: isCaretWithinFormattedText(),
|
|
66
|
-
hasMultiSelection: hasMultiSelection(),
|
|
67
|
-
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
68
|
-
lastClientId: getLastMultiSelectedBlockClientId()
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function BlockPopover(_ref) {
|
|
73
|
-
let {
|
|
74
|
-
clientId,
|
|
75
|
-
rootClientId,
|
|
76
|
-
isValid,
|
|
77
|
-
isEmptyDefaultBlock,
|
|
78
|
-
capturingClientId,
|
|
79
|
-
__unstablePopoverSlot,
|
|
80
|
-
__unstableContentRef
|
|
81
|
-
} = _ref;
|
|
82
|
-
const {
|
|
83
|
-
isNavigationMode,
|
|
84
|
-
isMultiSelecting,
|
|
85
|
-
isTyping,
|
|
86
|
-
isCaretWithinFormattedText,
|
|
87
|
-
hasMultiSelection,
|
|
88
|
-
hasFixedToolbar,
|
|
89
|
-
lastClientId
|
|
90
|
-
} = (0, _data.useSelect)(selector, []);
|
|
91
|
-
const isInsertionPointVisible = (0, _data.useSelect)(select => {
|
|
92
|
-
const {
|
|
93
|
-
isBlockInsertionPointVisible,
|
|
94
|
-
getBlockInsertionPoint,
|
|
95
|
-
getBlockOrder
|
|
96
|
-
} = select(_store.store);
|
|
97
|
-
|
|
98
|
-
if (!isBlockInsertionPointVisible()) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const insertionPoint = getBlockInsertionPoint();
|
|
103
|
-
const order = getBlockOrder(insertionPoint.rootClientId);
|
|
104
|
-
return order[insertionPoint.index] === clientId;
|
|
105
|
-
}, [clientId]);
|
|
106
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
107
|
-
const [isToolbarForced, setIsToolbarForced] = (0, _element.useState)(false);
|
|
108
|
-
const [isInserterShown, setIsInserterShown] = (0, _element.useState)(false);
|
|
109
|
-
const {
|
|
110
|
-
stopTyping
|
|
111
|
-
} = (0, _data.useDispatch)(_store.store); // Controls when the side inserter on empty lines should
|
|
112
|
-
// be shown, including writing and selection modes.
|
|
113
|
-
|
|
114
|
-
const showEmptyBlockSideInserter = !isTyping && !isNavigationMode && isEmptyDefaultBlock && isValid;
|
|
115
|
-
const shouldShowBreadcrumb = isNavigationMode;
|
|
116
|
-
const shouldShowContextualToolbar = !isNavigationMode && !hasFixedToolbar && isLargeViewport && !showEmptyBlockSideInserter && !isMultiSelecting && (!isTyping || isCaretWithinFormattedText);
|
|
117
|
-
const canFocusHiddenToolbar = !isNavigationMode && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock;
|
|
118
|
-
(0, _keyboardShortcuts.useShortcut)('core/block-editor/focus-toolbar', () => {
|
|
119
|
-
setIsToolbarForced(true);
|
|
120
|
-
stopTyping(true);
|
|
121
|
-
}, {
|
|
122
|
-
isDisabled: !canFocusHiddenToolbar
|
|
123
|
-
});
|
|
124
|
-
(0, _element.useEffect)(() => {
|
|
125
|
-
if (!shouldShowContextualToolbar) {
|
|
126
|
-
setIsToolbarForced(false);
|
|
127
|
-
}
|
|
128
|
-
}, [shouldShowContextualToolbar]); // Stores the active toolbar item index so the block toolbar can return focus
|
|
129
|
-
// to it when re-mounting.
|
|
130
|
-
|
|
131
|
-
const initialToolbarItemIndexRef = (0, _element.useRef)();
|
|
132
|
-
const selectedElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
|
|
133
|
-
const lastSelectedElement = (0, _useBlockRefs.__unstableUseBlockElement)(lastClientId);
|
|
134
|
-
const capturingElement = (0, _useBlockRefs.__unstableUseBlockElement)(capturingClientId);
|
|
135
|
-
const popoverScrollRef = (0, _usePopoverScroll.usePopoverScroll)(__unstableContentRef);
|
|
136
|
-
|
|
137
|
-
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !isToolbarForced && !showEmptyBlockSideInserter) {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
let node = selectedElement;
|
|
142
|
-
|
|
143
|
-
if (!node) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (capturingClientId) {
|
|
148
|
-
node = capturingElement;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
let anchorRef = node;
|
|
152
|
-
|
|
153
|
-
if (hasMultiSelection) {
|
|
154
|
-
// Wait to render the popover until the bottom reference is available
|
|
155
|
-
// as well.
|
|
156
|
-
if (!lastSelectedElement) {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
anchorRef = {
|
|
161
|
-
top: node,
|
|
162
|
-
bottom: lastSelectedElement
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function onFocus() {
|
|
167
|
-
setIsInserterShown(true);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function onBlur() {
|
|
171
|
-
setIsInserterShown(false);
|
|
172
|
-
} // Position above the anchor, pop out towards the right, and position in the
|
|
173
|
-
// left corner. For the side inserter, pop out towards the left, and
|
|
174
|
-
// position in the right corner.
|
|
175
|
-
// To do: refactor `Popover` to make this prop clearer.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const popoverPosition = showEmptyBlockSideInserter ? 'top left right' : 'top right left';
|
|
179
|
-
const {
|
|
180
|
-
ownerDocument
|
|
181
|
-
} = node;
|
|
182
|
-
const stickyBoundaryElement = showEmptyBlockSideInserter ? undefined : // The sticky boundary element should be the boundary at which the
|
|
183
|
-
// the block toolbar becomes sticky when the block scolls out of view.
|
|
184
|
-
// In case of an iframe, this should be the iframe boundary, otherwise
|
|
185
|
-
// the scroll container.
|
|
186
|
-
ownerDocument.defaultView.frameElement || (0, _dom.getScrollContainer)(node) || ownerDocument.body;
|
|
187
|
-
return (0, _element.createElement)(_components.Popover, {
|
|
188
|
-
ref: popoverScrollRef,
|
|
189
|
-
noArrow: true,
|
|
190
|
-
animate: false,
|
|
191
|
-
position: popoverPosition,
|
|
192
|
-
focusOnMount: false,
|
|
193
|
-
anchorRef: anchorRef,
|
|
194
|
-
className: (0, _classnames.default)('block-editor-block-list__block-popover', {
|
|
195
|
-
'is-insertion-point-visible': isInsertionPointVisible
|
|
196
|
-
}),
|
|
197
|
-
__unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
|
|
198
|
-
// otherwise render in place (not in the the default popover slot).
|
|
199
|
-
,
|
|
200
|
-
__unstableSlotName: __unstablePopoverSlot || null,
|
|
201
|
-
__unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
|
|
202
|
-
,
|
|
203
|
-
__unstableObserveElement: node,
|
|
204
|
-
shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
|
|
205
|
-
// obscure specific sections of a block.
|
|
206
|
-
,
|
|
207
|
-
__unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
|
|
208
|
-
}, (shouldShowContextualToolbar || isToolbarForced) && (0, _element.createElement)("div", {
|
|
209
|
-
onFocus: onFocus,
|
|
210
|
-
onBlur: onBlur // While ideally it would be enough to capture the
|
|
211
|
-
// bubbling focus event from the Inserter, due to the
|
|
212
|
-
// characteristics of click focusing of `button`s in
|
|
213
|
-
// Firefox and Safari, it is not reliable.
|
|
214
|
-
//
|
|
215
|
-
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
|
216
|
-
,
|
|
217
|
-
tabIndex: -1,
|
|
218
|
-
className: (0, _classnames.default)('block-editor-block-list__block-popover-inserter', {
|
|
219
|
-
'is-visible': isInserterShown
|
|
220
|
-
})
|
|
221
|
-
}, (0, _element.createElement)(_inserter.default, {
|
|
222
|
-
clientId: clientId,
|
|
223
|
-
rootClientId: rootClientId,
|
|
224
|
-
__experimentalIsQuick: true
|
|
225
|
-
})), (shouldShowContextualToolbar || isToolbarForced) && (0, _element.createElement)(_blockContextualToolbar.default // If the toolbar is being shown because of being forced
|
|
226
|
-
// it should focus the toolbar right after the mount.
|
|
227
|
-
, {
|
|
228
|
-
focusOnMount: isToolbarForced,
|
|
229
|
-
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
|
|
230
|
-
__experimentalOnIndexChange: index => {
|
|
231
|
-
initialToolbarItemIndexRef.current = index;
|
|
232
|
-
} // Resets the index whenever the active block changes so
|
|
233
|
-
// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
|
|
234
|
-
,
|
|
235
|
-
key: clientId
|
|
236
|
-
}), shouldShowBreadcrumb && (0, _element.createElement)(_blockSelectionButton.default, {
|
|
237
|
-
clientId: clientId,
|
|
238
|
-
rootClientId: rootClientId,
|
|
239
|
-
blockElement: node
|
|
240
|
-
}), showEmptyBlockSideInserter && (0, _element.createElement)("div", {
|
|
241
|
-
className: "block-editor-block-list__empty-block-inserter"
|
|
242
|
-
}, (0, _element.createElement)(_inserter.default, {
|
|
243
|
-
position: "bottom right",
|
|
244
|
-
rootClientId: rootClientId,
|
|
245
|
-
clientId: clientId,
|
|
246
|
-
__experimentalIsQuick: true
|
|
247
|
-
})));
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function wrapperSelector(select) {
|
|
251
|
-
const {
|
|
252
|
-
getSelectedBlockClientId,
|
|
253
|
-
getFirstMultiSelectedBlockClientId,
|
|
254
|
-
getBlockRootClientId,
|
|
255
|
-
getBlock,
|
|
256
|
-
getBlockParents,
|
|
257
|
-
__experimentalGetBlockListSettingsForBlocks
|
|
258
|
-
} = select(_store.store);
|
|
259
|
-
const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
|
260
|
-
|
|
261
|
-
if (!clientId) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const {
|
|
266
|
-
name,
|
|
267
|
-
attributes = {},
|
|
268
|
-
isValid
|
|
269
|
-
} = getBlock(clientId) || {};
|
|
270
|
-
const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId.
|
|
271
|
-
|
|
272
|
-
const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const capturingClientId = (0, _lodash.find)(blockParentsClientIds, parentClientId => {
|
|
276
|
-
var _parentBlockListSetti;
|
|
277
|
-
|
|
278
|
-
return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
|
|
279
|
-
});
|
|
280
|
-
return {
|
|
281
|
-
clientId,
|
|
282
|
-
rootClientId: getBlockRootClientId(clientId),
|
|
283
|
-
name,
|
|
284
|
-
isValid,
|
|
285
|
-
isEmptyDefaultBlock: name && (0, _blocks.isUnmodifiedDefaultBlock)({
|
|
286
|
-
name,
|
|
287
|
-
attributes
|
|
288
|
-
}),
|
|
289
|
-
capturingClientId
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function WrappedBlockPopover(_ref2) {
|
|
294
|
-
let {
|
|
295
|
-
__unstablePopoverSlot,
|
|
296
|
-
__unstableContentRef
|
|
297
|
-
} = _ref2;
|
|
298
|
-
const selected = (0, _data.useSelect)(wrapperSelector, []);
|
|
299
|
-
|
|
300
|
-
if (!selected) {
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const {
|
|
305
|
-
clientId,
|
|
306
|
-
rootClientId,
|
|
307
|
-
name,
|
|
308
|
-
isValid,
|
|
309
|
-
isEmptyDefaultBlock,
|
|
310
|
-
capturingClientId
|
|
311
|
-
} = selected;
|
|
312
|
-
|
|
313
|
-
if (!name) {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return (0, _element.createElement)(BlockPopover, {
|
|
318
|
-
clientId: clientId,
|
|
319
|
-
rootClientId: rootClientId,
|
|
320
|
-
isValid: isValid,
|
|
321
|
-
isEmptyDefaultBlock: isEmptyDefaultBlock,
|
|
322
|
-
capturingClientId: capturingClientId,
|
|
323
|
-
__unstablePopoverSlot: __unstablePopoverSlot,
|
|
324
|
-
__unstableContentRef: __unstableContentRef
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
//# sourceMappingURL=block-popover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/block-popover.js"],"names":["selector","select","isNavigationMode","isMultiSelecting","hasMultiSelection","isTyping","isCaretWithinFormattedText","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","hasFixedToolbar","lastClientId","BlockPopover","clientId","rootClientId","isValid","isEmptyDefaultBlock","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","setIsToolbarForced","isInserterShown","setIsInserterShown","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","isDisabled","initialToolbarItemIndexRef","selectedElement","lastSelectedElement","capturingElement","popoverScrollRef","node","anchorRef","top","bottom","onFocus","onBlur","popoverPosition","ownerDocument","stickyBoundaryElement","undefined","defaultView","frameElement","body","current","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","parentClientId","__experimentalCaptureToolbars","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AAQA,SAASA,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,QAAM;AACLC,IAAAA,gBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,0BALK;AAMLC,IAAAA,WANK;AAOLC,IAAAA;AAPK,MAQFP,MAAM,CAAEQ,YAAF,CARV;AASA,SAAO;AACNP,IAAAA,gBAAgB,EAAEA,gBAAgB,EAD5B;AAENC,IAAAA,gBAAgB,EAAEA,gBAAgB,EAF5B;AAGNE,IAAAA,QAAQ,EAAEA,QAAQ,EAHZ;AAINC,IAAAA,0BAA0B,EAAEA,0BAA0B,EAJhD;AAKNF,IAAAA,iBAAiB,EAAEA,iBAAiB,EAL9B;AAMNM,IAAAA,eAAe,EAAEH,WAAW,GAAGG,eANzB;AAONC,IAAAA,YAAY,EAAEH,iCAAiC;AAPzC,GAAP;AASA;;AAED,SAASI,YAAT,OAQI;AAAA,MARmB;AACtBC,IAAAA,QADsB;AAEtBC,IAAAA,YAFsB;AAGtBC,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A,OAAO,EAAGC,OAHX;AAIC,IAAA,mBAAmB,EAAGC,mBAJvB;AAKC,IAAA,iBAAiB,EAAGC,iBALrB;AAMC,IAAA,qBAAqB,EAAGC,qBANzB;AAOC,IAAA,oBAAoB,EAAGC;AAPxB,IADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport { usePopoverScroll } from './use-popover-scroll';\n\nfunction selector( select ) {\n\tconst {\n\t\tisNavigationMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\tisCaretWithinFormattedText,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\treturn {\n\t\tisNavigationMode: isNavigationMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisCaretWithinFormattedText: isCaretWithinFormattedText(),\n\t\thasMultiSelection: hasMultiSelection(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tlastClientId: getLastMultiSelectedBlockClientId(),\n\t};\n}\n\nfunction BlockPopover( {\n\tclientId,\n\trootClientId,\n\tisValid,\n\tisEmptyDefaultBlock,\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\tisNavigationMode,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisCaretWithinFormattedText,\n\t\thasMultiSelection,\n\t\thasFixedToolbar,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst [ isToolbarForced, setIsToolbarForced ] = useState( false );\n\tconst [ isInserterShown, setIsInserterShown ] = useState( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\t// Controls when the side inserter on empty lines should\n\t// be shown, including writing and selection modes.\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && ! isNavigationMode && isEmptyDefaultBlock && isValid;\n\tconst shouldShowBreadcrumb = isNavigationMode;\n\tconst shouldShowContextualToolbar =\n\t\t! isNavigationMode &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isMultiSelecting &&\n\t\t( ! isTyping || isCaretWithinFormattedText );\n\tconst canFocusHiddenToolbar =\n\t\t! isNavigationMode &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tsetIsToolbarForced( true );\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( ! shouldShowContextualToolbar ) {\n\t\t\tsetIsToolbarForced( false );\n\t\t}\n\t}, [ shouldShowContextualToolbar ] );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( lastClientId );\n\tconst capturingElement = useBlockElement( capturingClientId );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\tif (\n\t\t! shouldShowBreadcrumb &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! isToolbarForced &&\n\t\t! showEmptyBlockSideInserter\n\t) {\n\t\treturn null;\n\t}\n\n\tlet node = selectedElement;\n\n\tif ( ! node ) {\n\t\treturn null;\n\t}\n\n\tif ( capturingClientId ) {\n\t\tnode = capturingElement;\n\t}\n\n\tlet anchorRef = node;\n\n\tif ( hasMultiSelection ) {\n\t\t// Wait to render the popover until the bottom reference is available\n\t\t// as well.\n\t\tif ( ! lastSelectedElement ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tanchorRef = {\n\t\t\ttop: node,\n\t\t\tbottom: lastSelectedElement,\n\t\t};\n\t}\n\n\tfunction onFocus() {\n\t\tsetIsInserterShown( true );\n\t}\n\n\tfunction onBlur() {\n\t\tsetIsInserterShown( false );\n\t}\n\n\t// Position above the anchor, pop out towards the right, and position in the\n\t// left corner. For the side inserter, pop out towards the left, and\n\t// position in the right corner.\n\t// To do: refactor `Popover` to make this prop clearer.\n\tconst popoverPosition = showEmptyBlockSideInserter\n\t\t? 'top left right'\n\t\t: 'top right left';\n\tconst { ownerDocument } = node;\n\tconst stickyBoundaryElement = showEmptyBlockSideInserter\n\t\t? undefined\n\t\t: // The sticky boundary element should be the boundary at which the\n\t\t // the block toolbar becomes sticky when the block scolls out of view.\n\t\t // In case of an iframe, this should be the iframe boundary, otherwise\n\t\t // the scroll container.\n\t\t ownerDocument.defaultView.frameElement ||\n\t\t getScrollContainer( node ) ||\n\t\t ownerDocument.body;\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tnoArrow\n\t\t\tanimate={ false }\n\t\t\tposition={ popoverPosition }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchorRef={ anchorRef }\n\t\t\tclassName={ classnames( 'block-editor-block-list__block-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\t__unstableStickyBoundaryElement={ stickyBoundaryElement }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t__unstableBoundaryParent\n\t\t\t// Observe movement for block animations (especially horizontal).\n\t\t\t__unstableObserveElement={ node }\n\t\t\tshouldAnchorIncludePadding\n\t\t\t// Used to safeguard sticky position behavior against cases where it would permanently\n\t\t\t// obscure specific sections of a block.\n\t\t\t__unstableEditorCanvasWrapper={ __unstableContentRef?.current }\n\t\t>\n\t\t\t{ ( shouldShowContextualToolbar || isToolbarForced ) && (\n\t\t\t\t<div\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\t// While ideally it would be enough to capture the\n\t\t\t\t\t// bubbling focus event from the Inserter, due to the\n\t\t\t\t\t// characteristics of click focusing of `button`s in\n\t\t\t\t\t// Firefox and Safari, it is not reliable.\n\t\t\t\t\t//\n\t\t\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-popover-inserter',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-visible': isInserterShown,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<Inserter\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ( shouldShowContextualToolbar || isToolbarForced ) && (\n\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\tfocusOnMount={ isToolbarForced }\n\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t} }\n\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t<BlockSelectionButton\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tblockElement={ node }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t<Inserter\n\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {}, isValid } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = find(\n\t\tblockParentsClientIds,\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisValid,\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisValid,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisValid={ isValid }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/use-popover-scroll.js"],"names":["usePopoverScroll","scrollableRef","node","onWheel","event","deltaX","deltaY","current","scrollBy","options","passive","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,aAA3B,EAA2C;AACjD,SAAO,2BACJC,IAAF,IAAY;AACX,QAAK,CAAED,aAAP,EAAuB;AACtB;AACA;;AAED,aAASE,OAAT,CAAkBC,KAAlB,EAA0B;AACzB,YAAM;AAAEC,QAAAA,MAAF;AAAUC,QAAAA;AAAV,UAAqBF,KAA3B;AACAH,MAAAA,aAAa,CAACM,OAAd,CAAsBC,QAAtB,CAAgCH,MAAhC,EAAwCC,MAAxC;AACA,KARU,CASX;AACA;;;AACA,UAAMG,OAAO,GAAG;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAAhB;AACAR,IAAAA,IAAI,CAACS,gBAAL,CAAuB,OAAvB,EAAgCR,OAAhC,EAAyCM,OAAzC;AACA,WAAO,MAAM;AACZP,MAAAA,IAAI,CAACU,mBAAL,CAA0B,OAA1B,EAAmCT,OAAnC,EAA4CM,OAA5C;AACA,KAFD;AAGA,GAjBK,EAkBN,CAAER,aAAF,CAlBM,CAAP;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} scrollableRef\n */\nexport function usePopoverScroll( scrollableRef ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! scrollableRef ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tscrollableRef.current.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ scrollableRef ]\n\t);\n}\n"]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = BorderStyleControl;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
|
-
var _icons = require("@wordpress/icons");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
const BORDER_STYLES = [{
|
|
20
|
-
label: (0, _i18n.__)('Solid'),
|
|
21
|
-
icon: _icons.lineSolid,
|
|
22
|
-
value: 'solid'
|
|
23
|
-
}, {
|
|
24
|
-
label: (0, _i18n.__)('Dashed'),
|
|
25
|
-
icon: _icons.lineDashed,
|
|
26
|
-
value: 'dashed'
|
|
27
|
-
}, {
|
|
28
|
-
label: (0, _i18n.__)('Dotted'),
|
|
29
|
-
icon: _icons.lineDotted,
|
|
30
|
-
value: 'dotted'
|
|
31
|
-
}];
|
|
32
|
-
/**
|
|
33
|
-
* Control to display border style options.
|
|
34
|
-
*
|
|
35
|
-
* @param {Object} props Component props.
|
|
36
|
-
* @param {Function} props.onChange Handler for changing border style selection.
|
|
37
|
-
* @param {string} props.value Currently selected border style value.
|
|
38
|
-
*
|
|
39
|
-
* @return {WPElement} Custom border style segmented control.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
function BorderStyleControl(_ref) {
|
|
43
|
-
let {
|
|
44
|
-
onChange,
|
|
45
|
-
value
|
|
46
|
-
} = _ref;
|
|
47
|
-
return (0, _element.createElement)("fieldset", {
|
|
48
|
-
className: "components-border-style-control"
|
|
49
|
-
}, (0, _element.createElement)("legend", null, (0, _i18n.__)('Style')), (0, _element.createElement)("div", {
|
|
50
|
-
className: "components-border-style-control__buttons"
|
|
51
|
-
}, BORDER_STYLES.map(borderStyle => (0, _element.createElement)(_components.Button, {
|
|
52
|
-
key: borderStyle.value,
|
|
53
|
-
icon: borderStyle.icon,
|
|
54
|
-
isSmall: true,
|
|
55
|
-
isPressed: borderStyle.value === value,
|
|
56
|
-
onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value),
|
|
57
|
-
"aria-label": borderStyle.label
|
|
58
|
-
}))));
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/border-style-control/index.js"],"names":["BORDER_STYLES","label","icon","lineSolid","value","lineDashed","lineDotted","BorderStyleControl","onChange","map","borderStyle","undefined"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,aAAa,GAAG,CACrB;AAAEC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAAT;AAAwBC,EAAAA,IAAI,EAAEC,gBAA9B;AAAyCC,EAAAA,KAAK,EAAE;AAAhD,CADqB,EAErB;AAAEH,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAAT;AAAyBC,EAAAA,IAAI,EAAEG,iBAA/B;AAA2CD,EAAAA,KAAK,EAAE;AAAlD,CAFqB,EAGrB;AAAEH,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAAT;AAAyBC,EAAAA,IAAI,EAAEI,iBAA/B;AAA2CF,EAAAA,KAAK,EAAE;AAAlD,CAHqB,CAAtB;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASG,kBAAT,OAAmD;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYJ,IAAAA;AAAZ,GAAsB;AACjE,SACC;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,4CAAU,cAAI,OAAJ,CAAV,CADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGJ,aAAa,CAACS,GAAd,CAAqBC,WAAF,IACpB,4BAAC,kBAAD;AACC,IAAA,GAAG,EAAGA,WAAW,CAACN,KADnB;AAEC,IAAA,IAAI,EAAGM,WAAW,CAACR,IAFpB;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,SAAS,EAAGQ,WAAW,CAACN,KAAZ,KAAsBA,KAJnC;AAKC,IAAA,OAAO,EAAG,MACTI,QAAQ,CACPE,WAAW,CAACN,KAAZ,KAAsBA,KAAtB,GACGO,SADH,GAEGD,WAAW,CAACN,KAHR,CANV;AAYC,kBAAaM,WAAW,CAACT;AAZ1B,IADC,CADH,CAFD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { lineDashed, lineDotted, lineSolid } from '@wordpress/icons';\n\nconst BORDER_STYLES = [\n\t{ label: __( 'Solid' ), icon: lineSolid, value: 'solid' },\n\t{ label: __( 'Dashed' ), icon: lineDashed, value: 'dashed' },\n\t{ label: __( 'Dotted' ), icon: lineDotted, value: 'dotted' },\n];\n\n/**\n * Control to display border style options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Handler for changing border style selection.\n * @param {string} props.value Currently selected border style value.\n *\n * @return {WPElement} Custom border style segmented control.\n */\nexport default function BorderStyleControl( { onChange, value } ) {\n\treturn (\n\t\t<fieldset className=\"components-border-style-control\">\n\t\t\t<legend>{ __( 'Style' ) }</legend>\n\t\t\t<div className=\"components-border-style-control__buttons\">\n\t\t\t\t{ BORDER_STYLES.map( ( borderStyle ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ borderStyle.value }\n\t\t\t\t\t\ticon={ borderStyle.icon }\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tisPressed={ borderStyle.value === value }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\tborderStyle.value === value\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: borderStyle.value\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ borderStyle.label }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"]}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = ToolsPanelColorDropdown;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _components = require("@wordpress/components");
|
|
17
|
-
|
|
18
|
-
var _control = _interopRequireDefault(require("./control"));
|
|
19
|
-
|
|
20
|
-
var _useMultipleOriginColorsAndGradients = _interopRequireDefault(require("./use-multiple-origin-colors-and-gradients"));
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* External dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* WordPress dependencies
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Internal dependencies
|
|
32
|
-
*/
|
|
33
|
-
function ToolsPanelColorDropdown(_ref) {
|
|
34
|
-
var _settings$gradientVal;
|
|
35
|
-
|
|
36
|
-
let {
|
|
37
|
-
settings,
|
|
38
|
-
enableAlpha,
|
|
39
|
-
...otherProps
|
|
40
|
-
} = _ref;
|
|
41
|
-
const colorGradientSettings = (0, _useMultipleOriginColorsAndGradients.default)();
|
|
42
|
-
const controlSettings = { ...colorGradientSettings,
|
|
43
|
-
clearable: false,
|
|
44
|
-
enableAlpha,
|
|
45
|
-
label: settings.label,
|
|
46
|
-
onColorChange: settings.onColorChange,
|
|
47
|
-
onGradientChange: settings.onGradientChange,
|
|
48
|
-
colorValue: settings.colorValue,
|
|
49
|
-
gradientValue: settings.gradientValue
|
|
50
|
-
};
|
|
51
|
-
const selectedColor = (_settings$gradientVal = settings.gradientValue) !== null && _settings$gradientVal !== void 0 ? _settings$gradientVal : settings.colorValue;
|
|
52
|
-
return (0, _element.createElement)(_components.__experimentalToolsPanelItem, (0, _extends2.default)({
|
|
53
|
-
hasValue: settings.hasValue,
|
|
54
|
-
label: settings.label,
|
|
55
|
-
onDeselect: settings.onDeselect,
|
|
56
|
-
isShownByDefault: settings.isShownByDefault,
|
|
57
|
-
resetAllFilter: settings.resetAllFilter
|
|
58
|
-
}, otherProps, {
|
|
59
|
-
className: "block-editor-tools-panel-color-gradient-settings__item"
|
|
60
|
-
}), (0, _element.createElement)(_components.Dropdown, {
|
|
61
|
-
className: "block-editor-tools-panel-color-dropdown",
|
|
62
|
-
contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content",
|
|
63
|
-
renderToggle: _ref2 => {
|
|
64
|
-
let {
|
|
65
|
-
isOpen,
|
|
66
|
-
onToggle
|
|
67
|
-
} = _ref2;
|
|
68
|
-
return (0, _element.createElement)(_components.Button, {
|
|
69
|
-
onClick: onToggle,
|
|
70
|
-
"aria-expanded": isOpen,
|
|
71
|
-
className: (0, _classnames.default)('block-editor-panel-color-gradient-settings__dropdown', {
|
|
72
|
-
'is-open': isOpen
|
|
73
|
-
})
|
|
74
|
-
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
75
|
-
justify: "flex-start"
|
|
76
|
-
}, (0, _element.createElement)(_components.ColorIndicator, {
|
|
77
|
-
className: "block-editor-panel-color-gradient-settings__color-indicator",
|
|
78
|
-
colorValue: selectedColor
|
|
79
|
-
}), (0, _element.createElement)(_components.FlexItem, null, settings.label)));
|
|
80
|
-
},
|
|
81
|
-
renderContent: () => (0, _element.createElement)(_control.default, (0, _extends2.default)({
|
|
82
|
-
showTitle: false,
|
|
83
|
-
__experimentalHasMultipleOrigins: true,
|
|
84
|
-
__experimentalIsRenderedInSidebar: true,
|
|
85
|
-
enableAlpha: true
|
|
86
|
-
}, controlSettings))
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=tools-panel-color-dropdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/tools-panel-color-dropdown.js"],"names":["ToolsPanelColorDropdown","settings","enableAlpha","otherProps","colorGradientSettings","controlSettings","clearable","label","onColorChange","onGradientChange","colorValue","gradientValue","selectedColor","hasValue","onDeselect","isShownByDefault","resetAllFilter","isOpen","onToggle"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAYA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,uBAAT,OAIX;AAAA;;AAAA,MAJ6C;AAChDC,IAAAA,QADgD;AAEhDC,IAAAA,WAFgD;AAGhD,OAAGC;AAH6C,GAI7C;AACH,QAAMC,qBAAqB,GAAG,mDAA9B;AACA,QAAMC,eAAe,GAAG,EACvB,GAAGD,qBADoB;AAEvBE,IAAAA,SAAS,EAAE,KAFY;AAGvBJ,IAAAA,WAHuB;AAIvBK,IAAAA,KAAK,EAAEN,QAAQ,CAACM,KAJO;AAKvBC,IAAAA,aAAa,EAAEP,QAAQ,CAACO,aALD;AAMvBC,IAAAA,gBAAgB,EAAER,QAAQ,CAACQ,gBANJ;AAOvBC,IAAAA,UAAU,EAAET,QAAQ,CAACS,UAPE;AAQvBC,IAAAA,aAAa,EAAEV,QAAQ,CAACU;AARD,GAAxB;AAUA,QAAMC,aAAa,4BAAGX,QAAQ,CAACU,aAAZ,yEAA6BV,QAAQ,CAACS,UAAzD;AAEA,SACC,4BAAC,wCAAD;AACC,IAAA,QAAQ,EAAGT,QAAQ,CAACY,QADrB;AAEC,IAAA,KAAK,EAAGZ,QAAQ,CAACM,KAFlB;AAGC,IAAA,UAAU,EAAGN,QAAQ,CAACa,UAHvB;AAIC,IAAA,gBAAgB,EAAGb,QAAQ,CAACc,gBAJ7B;AAKC,IAAA,cAAc,EAAGd,QAAQ,CAACe;AAL3B,KAMMb,UANN;AAOC,IAAA,SAAS,EAAC;AAPX,MASC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,yCADX;AAEC,IAAA,gBAAgB,EAAC,8DAFlB;AAGC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEc,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD;AACC,QAAA,OAAO,EAAGA,QADX;AAEC,yBAAgBD,MAFjB;AAGC,QAAA,SAAS,EAAG,yBACX,sDADW,EAEX;AAAE,qBAAWA;AAAb,SAFW;AAHb,SAQC,4BAAC,gCAAD;AAAQ,QAAA,OAAO,EAAC;AAAhB,SACC,4BAAC,0BAAD;AACC,QAAA,SAAS,EAAC,6DADX;AAEC,QAAA,UAAU,EAAGL;AAFd,QADD,EAKC,4BAAC,oBAAD,QAAYX,QAAQ,CAACM,KAArB,CALD,CARD,CADc;AAAA,KAHhB;AAqBC,IAAA,aAAa,EAAG,MACf,4BAAC,gBAAD;AACC,MAAA,SAAS,EAAG,KADb;AAEC,MAAA,gCAAgC,MAFjC;AAGC,MAAA,iCAAiC,MAHlC;AAIC,MAAA,WAAW;AAJZ,OAKMF,eALN;AAtBF,IATD,CADD;AA2CA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\nimport useMultipleOriginColorsAndGradients from './use-multiple-origin-colors-and-gradients';\n\nexport default function ToolsPanelColorDropdown( {\n\tsettings,\n\tenableAlpha,\n\t...otherProps\n} ) {\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst controlSettings = {\n\t\t...colorGradientSettings,\n\t\tclearable: false,\n\t\tenableAlpha,\n\t\tlabel: settings.label,\n\t\tonColorChange: settings.onColorChange,\n\t\tonGradientChange: settings.onGradientChange,\n\t\tcolorValue: settings.colorValue,\n\t\tgradientValue: settings.gradientValue,\n\t};\n\tconst selectedColor = settings.gradientValue ?? settings.colorValue;\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ settings.hasValue }\n\t\t\tlabel={ settings.label }\n\t\t\tonDeselect={ settings.onDeselect }\n\t\t\tisShownByDefault={ settings.isShownByDefault }\n\t\t\tresetAllFilter={ settings.resetAllFilter }\n\t\t\t{ ...otherProps }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t>\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-tools-panel-color-dropdown\"\n\t\t\t\tcontentClassName=\"block-editor-panel-color-gradient-settings__dropdown-content\"\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\t\t\t\t\t\tcolorValue={ selectedColor }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<FlexItem>{ settings.label }</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\tshowTitle={ false }\n\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tenableAlpha\n\t\t\t\t\t\t{ ...controlSettings }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n"]}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = ListViewAppender;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _components = require("@wordpress/components");
|
|
15
|
-
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
17
|
-
|
|
18
|
-
var _i18n = require("@wordpress/i18n");
|
|
19
|
-
|
|
20
|
-
var _data = require("@wordpress/data");
|
|
21
|
-
|
|
22
|
-
var _leaf = _interopRequireDefault(require("./leaf"));
|
|
23
|
-
|
|
24
|
-
var _inserter = _interopRequireDefault(require("../inserter"));
|
|
25
|
-
|
|
26
|
-
var _store = require("../../store");
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* External dependencies
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* WordPress dependencies
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Internal dependencies
|
|
38
|
-
*/
|
|
39
|
-
function ListViewAppender(_ref) {
|
|
40
|
-
let {
|
|
41
|
-
parentBlockClientId,
|
|
42
|
-
position,
|
|
43
|
-
level,
|
|
44
|
-
rowCount,
|
|
45
|
-
path
|
|
46
|
-
} = _ref;
|
|
47
|
-
const isDragging = (0, _data.useSelect)(select => {
|
|
48
|
-
const {
|
|
49
|
-
isBlockBeingDragged,
|
|
50
|
-
isAncestorBeingDragged
|
|
51
|
-
} = select(_store.store);
|
|
52
|
-
return isBlockBeingDragged(parentBlockClientId) || isAncestorBeingDragged(parentBlockClientId);
|
|
53
|
-
}, [parentBlockClientId]);
|
|
54
|
-
const instanceId = (0, _compose.useInstanceId)(ListViewAppender);
|
|
55
|
-
const descriptionId = `list-view-appender-row__description_${instanceId}`;
|
|
56
|
-
const appenderPositionDescription = (0, _i18n.sprintf)(
|
|
57
|
-
/* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */
|
|
58
|
-
(0, _i18n.__)('Add block at position %1$d, Level %2$d'), position, level);
|
|
59
|
-
return (0, _element.createElement)(_leaf.default, {
|
|
60
|
-
className: (0, _classnames.default)({
|
|
61
|
-
'is-dragging': isDragging
|
|
62
|
-
}),
|
|
63
|
-
level: level,
|
|
64
|
-
position: position,
|
|
65
|
-
rowCount: rowCount,
|
|
66
|
-
path: path
|
|
67
|
-
}, (0, _element.createElement)(_components.__experimentalTreeGridCell, {
|
|
68
|
-
className: "block-editor-list-view-appender__cell",
|
|
69
|
-
colSpan: "3"
|
|
70
|
-
}, _ref2 => {
|
|
71
|
-
let {
|
|
72
|
-
ref,
|
|
73
|
-
tabIndex,
|
|
74
|
-
onFocus
|
|
75
|
-
} = _ref2;
|
|
76
|
-
return (0, _element.createElement)("div", {
|
|
77
|
-
className: "block-editor-list-view-appender__container"
|
|
78
|
-
}, (0, _element.createElement)(_inserter.default, {
|
|
79
|
-
rootClientId: parentBlockClientId,
|
|
80
|
-
__experimentalIsQuick: true,
|
|
81
|
-
"aria-describedby": descriptionId,
|
|
82
|
-
toggleProps: {
|
|
83
|
-
ref,
|
|
84
|
-
tabIndex,
|
|
85
|
-
onFocus
|
|
86
|
-
}
|
|
87
|
-
}), (0, _element.createElement)("div", {
|
|
88
|
-
className: "block-editor-list-view-appender__description",
|
|
89
|
-
id: descriptionId
|
|
90
|
-
}, appenderPositionDescription));
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=appender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"names":["ListViewAppender","parentBlockClientId","position","level","rowCount","path","isDragging","select","isBlockBeingDragged","isAncestorBeingDragged","blockEditorStore","instanceId","descriptionId","appenderPositionDescription","ref","tabIndex","onFocus"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKe,SAASA,gBAAT,OAMX;AAAA,MANsC;AACzCC,IAAAA,mBADyC;AAEzCC,IAAAA,QAFyC;AAGzCC,IAAAA,KAHyC;AAIzCC,IAAAA,QAJyC;AAKzCC,IAAAA;AALyC,GAMtC;AACH,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,mBAAF;AAAuBC,MAAAA;AAAvB,QAAkDF,MAAM,CAC7DG,YAD6D,CAA9D;AAIA,WACCF,mBAAmB,CAAEP,mBAAF,CAAnB,IACAQ,sBAAsB,CAAER,mBAAF,CAFvB;AAIA,GAViB,EAWlB,CAAEA,mBAAF,CAXkB,CAAnB;AAaA,QAAMU,UAAU,GAAG,4BAAeX,gBAAf,CAAnB;AACA,QAAMY,aAAa,GAAI,uCAAuCD,UAAY,EAA1E;AAEA,QAAME,2BAA2B,GAAG;AACnC;AACA,gBAAI,wCAAJ,CAFmC,EAGnCX,QAHmC,EAInCC,KAJmC,CAApC;AAOA,SACC,4BAAC,aAAD;AACC,IAAA,SAAS,EAAG,yBAAY;AAAE,qBAAeG;AAAjB,KAAZ,CADb;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,QAAQ,EAAGE,QAJZ;AAKC,IAAA,IAAI,EAAGC;AALR,KAOC,4BAAC,sCAAD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG;AAAA,QAAE;AAAES,MAAAA,GAAF;AAAOC,MAAAA,QAAP;AAAiBC,MAAAA;AAAjB,KAAF;AAAA,WACD;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,iBAAD;AACC,MAAA,YAAY,EAAGf,mBADhB;AAEC,MAAA,qBAAqB,MAFtB;AAGC,0BAAmBW,aAHpB;AAIC,MAAA,WAAW,EAAG;AAAEE,QAAAA,GAAF;AAAOC,QAAAA,QAAP;AAAiBC,QAAAA;AAAjB;AAJf,MADD,EAOC;AACC,MAAA,SAAS,EAAC,8CADX;AAEC,MAAA,EAAE,EAAGJ;AAFN,OAIGC,2BAJH,CAPD,CADC;AAAA,GAJH,CAPD,CADD;AA+BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalTreeGridCell as TreeGridCell } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function ListViewAppender( {\n\tparentBlockClientId,\n\tposition,\n\tlevel,\n\trowCount,\n\tpath,\n} ) {\n\tconst isDragging = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockBeingDragged, isAncestorBeingDragged } = select(\n\t\t\t\tblockEditorStore\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\tisBlockBeingDragged( parentBlockClientId ) ||\n\t\t\t\tisAncestorBeingDragged( parentBlockClientId )\n\t\t\t);\n\t\t},\n\t\t[ parentBlockClientId ]\n\t);\n\tconst instanceId = useInstanceId( ListViewAppender );\n\tconst descriptionId = `list-view-appender-row__description_${ instanceId }`;\n\n\tconst appenderPositionDescription = sprintf(\n\t\t/* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */\n\t\t__( 'Add block at position %1$d, Level %2$d' ),\n\t\tposition,\n\t\tlevel\n\t);\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classnames( { 'is-dragging': isDragging } ) }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-appender__cell\"\n\t\t\t\tcolSpan=\"3\"\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-appender__container\">\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\trootClientId={ parentBlockClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t\t\ttoggleProps={ { ref, tabIndex, onFocus } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-appender__description\"\n\t\t\t\t\t\t\tid={ descriptionId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ appenderPositionDescription }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t</ListViewLeaf>\n\t);\n}\n"]}
|