@wordpress/block-editor 11.0.0 → 11.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 +9 -1
- package/README.md +2 -1
- package/build/components/alignment-control/ui.js +1 -7
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +4 -3
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-icon/index.js +4 -2
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-inspector/index.js +55 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +46 -34
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +39 -34
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +18 -18
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +1 -1
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +14 -7
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -3
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/utils.js +7 -10
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-toolbar/index.native.js +6 -8
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +1 -3
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -1
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/colors/utils.js +2 -6
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors-gradients/control.js +0 -3
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +0 -2
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -19
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -3
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/copy-handler/index.js +37 -9
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +5 -2
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/utils.js +10 -4
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +11 -6
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -8
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/iframe/index.js +13 -95
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +93 -0
- package/build/components/iframe/use-compatibility-styles.js.map +1 -0
- package/build/components/inner-blocks/index.js +6 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +4 -3
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/index.js +13 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +8 -5
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +6 -3
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +15 -14
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +4 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -1
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +21 -26
- package/build/components/off-canvas-editor/appender.js.map +1 -1
- package/build/components/off-canvas-editor/block-select-button.js +3 -2
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build/components/off-canvas-editor/block.js +57 -45
- package/build/components/off-canvas-editor/block.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +5 -1
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/off-canvas-editor/use-inserted-block.js +58 -0
- package/build/components/off-canvas-editor/use-inserted-block.js.map +1 -0
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/format-edit.js +12 -10
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +21 -12
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +0 -1
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +1 -1
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/typewriter/index.js +1 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -2
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/writing-flow/index.js +1 -1
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/hooks/border.js +0 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +0 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -2
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/font-family.js +4 -4
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +5 -3
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/use-typography-props.js +11 -8
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/store/reducer.js +21 -7
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pasting.js +6 -11
- package/build/utils/pasting.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -6
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +4 -3
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-icon/index.js +4 -2
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +56 -5
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +46 -34
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +39 -32
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -18
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +14 -7
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +1 -2
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/utils.js +7 -9
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js +6 -8
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +1 -2
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -1
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/colors/utils.js +3 -7
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +0 -3
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +0 -2
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +4 -19
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/copy-handler/index.js +38 -10
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +5 -2
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +11 -5
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +12 -7
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -7
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/iframe/index.js +12 -95
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +85 -0
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -0
- package/build-module/components/inner-blocks/index.js +6 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +4 -3
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/index.js +13 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +8 -5
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +6 -3
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +15 -13
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +4 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -1
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +21 -27
- package/build-module/components/off-canvas-editor/appender.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-select-button.js +3 -2
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build-module/components/off-canvas-editor/block.js +58 -46
- package/build-module/components/off-canvas-editor/block.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +5 -1
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/use-inserted-block.js +47 -0
- package/build-module/components/off-canvas-editor/use-inserted-block.js.map +1 -0
- package/build-module/components/responsive-block-control/label.js +1 -2
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +12 -9
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +22 -12
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +0 -1
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +1 -1
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/writing-flow/index.js +1 -1
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/hooks/border.js +0 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +0 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -2
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/font-family.js +5 -5
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +5 -3
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +11 -8
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/store/reducer.js +21 -6
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pasting.js +6 -10
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +3 -3
- package/build-style/content.css +3 -3
- package/build-style/default-editor-styles-rtl.css +3 -3
- package/build-style/default-editor-styles.css +3 -3
- package/build-style/style-rtl.css +35 -11
- package/build-style/style.css +35 -11
- package/package.json +29 -29
- package/src/components/alignment-control/test/index.js +2 -0
- package/src/components/alignment-control/ui.js +1 -7
- package/src/components/block-alignment-control/test/index.js +2 -0
- package/src/components/block-alignment-control/use-available-alignments.js +4 -3
- package/src/components/block-icon/index.js +4 -2
- package/src/components/block-icon/test/index.js +9 -5
- package/src/components/block-inspector/index.js +77 -4
- package/src/components/block-inspector/style.scss +7 -0
- package/src/components/block-list-appender/index.js +65 -54
- package/src/components/block-list-appender/index.native.js +45 -34
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +18 -22
- package/src/components/block-mobile-toolbar/index.native.js +1 -1
- package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap +125 -0
- package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +439 -0
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +42 -0
- package/src/components/block-mover/test/index.native.js +157 -1
- package/src/components/block-pattern-setup/index.js +15 -6
- package/src/components/block-pattern-setup/style.scss +29 -1
- package/src/components/block-styles/index.native.js +1 -2
- package/src/components/block-styles/utils.js +5 -7
- package/src/components/block-switcher/test/index.js +3 -2
- package/src/components/block-toolbar/index.native.js +8 -11
- package/src/components/block-tools/selected-block-popover.js +1 -3
- package/src/components/block-variation-picker/index.js +5 -1
- package/src/components/block-vertical-alignment-control/test/index.js +2 -0
- package/src/components/colors/test/with-colors.js +2 -0
- package/src/components/colors/utils.js +5 -3
- package/src/components/colors-gradients/control.js +0 -7
- package/src/components/colors-gradients/dropdown.js +0 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -22
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +4 -2
- package/src/components/copy-handler/index.js +53 -7
- package/src/components/default-block-appender/test/index.js +2 -0
- package/src/components/font-sizes/fluid-utils.js +7 -1
- package/src/components/font-sizes/utils.js +5 -3
- package/src/components/font-sizes/with-font-sizes.js +4 -4
- package/src/components/gradients/use-gradient.js +2 -7
- package/src/components/iframe/index.js +8 -103
- package/src/components/iframe/use-compatibility-styles.js +95 -0
- package/src/components/image-size-control/test/index.js +147 -79
- package/src/components/inner-blocks/index.js +4 -2
- package/src/components/inserter/hooks/use-insertion-point.js +3 -2
- package/src/components/inserter/index.js +15 -2
- package/src/components/inserter/media-tab/hooks.js +5 -4
- package/src/components/inserter/quick-inserter.js +3 -0
- package/src/components/inserter/search-items.js +1 -2
- package/src/components/inserter/search-results.js +2 -0
- package/src/components/link-control/test/index.js +18 -4
- package/src/components/list-view/block-select-button.js +1 -1
- package/src/components/list-view/style.scss +1 -7
- package/src/components/media-replace-flow/test/index.js +2 -0
- package/src/components/off-canvas-editor/appender.js +30 -25
- package/src/components/off-canvas-editor/block-select-button.js +6 -2
- package/src/components/off-canvas-editor/block.js +93 -76
- package/src/components/off-canvas-editor/index.js +9 -0
- package/src/components/off-canvas-editor/style.scss +5 -1
- package/src/components/off-canvas-editor/test/use-inserted-block.js +108 -0
- package/src/components/off-canvas-editor/use-inserted-block.js +47 -0
- package/src/components/responsive-block-control/label.js +2 -3
- package/src/components/responsive-block-control/test/index.js +4 -2
- package/src/components/rich-text/format-edit.js +6 -10
- package/src/components/rich-text/index.js +1 -0
- package/src/components/rich-text/use-paste-handler.js +33 -14
- package/src/components/spacing-sizes-control/index.js +0 -1
- package/src/components/spacing-sizes-control/utils.js +1 -1
- package/src/components/typewriter/index.js +3 -1
- package/src/components/url-input/test/button.js +2 -0
- package/src/components/url-popover/image-url-input-ui.js +5 -4
- package/src/components/url-popover/test/index.js +21 -5
- package/src/components/warning/test/index.js +2 -0
- package/src/components/writing-flow/index.js +1 -1
- package/src/hooks/border.js +0 -1
- package/src/hooks/color-panel.js +0 -1
- package/src/hooks/color.js +0 -2
- package/src/hooks/font-family.js +3 -5
- package/src/hooks/font-size.js +13 -4
- package/src/hooks/test/use-typography-props.js +26 -0
- package/src/hooks/use-typography-props.js +15 -7
- package/src/store/reducer.js +13 -6
- package/src/store/selectors.js +2 -3
- package/src/utils/pasting.js +3 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/colors-gradients/use-common-single-multiple-selects.js +0 -21
- package/build/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
- package/build/components/rich-text/file-paste-handler.js +0 -21
- package/build/components/rich-text/file-paste-handler.js.map +0 -1
- package/build-module/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
- package/build-module/components/colors-gradients/use-common-single-multiple-selects.js.map +0 -1
- package/build-module/components/rich-text/file-paste-handler.js +0 -13
- package/build-module/components/rich-text/file-paste-handler.js.map +0 -1
- package/src/components/colors-gradients/use-common-single-multiple-selects.js +0 -11
- package/src/components/rich-text/file-paste-handler.js +0 -13
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createBlobURL } from '@wordpress/blob';
|
|
5
4
|
import { getFilesFromDataTransfer } from '@wordpress/dom';
|
|
6
5
|
export function getPasteEventData(_ref) {
|
|
7
6
|
let {
|
|
@@ -26,21 +25,18 @@ export function getPasteEventData(_ref) {
|
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const files = getFilesFromDataTransfer(clipboardData)
|
|
30
|
-
let {
|
|
31
|
-
type
|
|
32
|
-
} = _ref2;
|
|
33
|
-
return /^image\/(?:jpe?g|png|gif|webp)$/.test(type);
|
|
34
|
-
});
|
|
28
|
+
const files = getFilesFromDataTransfer(clipboardData);
|
|
35
29
|
|
|
36
30
|
if (files.length && !shouldDismissPastedFiles(files, html, plainText)) {
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
return {
|
|
32
|
+
files
|
|
33
|
+
};
|
|
39
34
|
}
|
|
40
35
|
|
|
41
36
|
return {
|
|
42
37
|
html,
|
|
43
|
-
plainText
|
|
38
|
+
plainText,
|
|
39
|
+
files: []
|
|
44
40
|
};
|
|
45
41
|
}
|
|
46
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/pasting.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/pasting.js"],"names":["getFilesFromDataTransfer","getPasteEventData","clipboardData","plainText","html","getData","error1","error2","files","length","shouldDismissPastedFiles","type","indexOf","IMAGE_TAG","match","IMG_WITH_LOCAL_SRC"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAT,QAAyC,gBAAzC;AAEA,OAAO,SAASC,iBAAT,OAAgD;AAAA,MAApB;AAAEC,IAAAA;AAAF,GAAoB;AACtD,MAAIC,SAAS,GAAG,EAAhB;AACA,MAAIC,IAAI,GAAG,EAAX,CAFsD,CAItD;AACA;AACA;;AACA,MAAI;AACHD,IAAAA,SAAS,GAAGD,aAAa,CAACG,OAAd,CAAuB,YAAvB,CAAZ;AACAD,IAAAA,IAAI,GAAGF,aAAa,CAACG,OAAd,CAAuB,WAAvB,CAAP;AACA,GAHD,CAGE,OAAQC,MAAR,EAAiB;AAClB,QAAI;AACHF,MAAAA,IAAI,GAAGF,aAAa,CAACG,OAAd,CAAuB,MAAvB,CAAP;AACA,KAFD,CAEE,OAAQE,MAAR,EAAiB;AAClB;AACA;AACA;AACA;AACA;AACD;;AAED,QAAMC,KAAK,GAAGR,wBAAwB,CAAEE,aAAF,CAAtC;;AAEA,MACCM,KAAK,CAACC,MAAN,IACA,CAAEC,wBAAwB,CAAEF,KAAF,EAASJ,IAAT,EAAeD,SAAf,CAF3B,EAGE;AACD,WAAO;AAAEK,MAAAA;AAAF,KAAP;AACA;;AAED,SAAO;AAAEJ,IAAAA,IAAF;AAAQD,IAAAA,SAAR;AAAmBK,IAAAA,KAAK,EAAE;AAA1B,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,wBAAT,CAAmCF,KAAnC,EAA0CJ;AAAK;AAA/C,EAAkE;AACxE;AACA;AACA,MACCA,IAAI,IACJ,CAAAI,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,MAAP,MAAkB,CADlB,IAEAD,KAAK,CAAE,CAAF,CAAL,CAAWG,IAAX,CAAgBC,OAAhB,CAAyB,QAAzB,MAAwC,CAHzC,EAIE;AAAA;;AACD;AACA;AACA;AACA;AACA,UAAMC,SAAS,GAAG,aAAlB;AACA,QAAK,gBAAAT,IAAI,CAACU,KAAL,CAAYD,SAAZ,6DAAyBJ,MAAzB,MAAoC,CAAzC,EAA6C,OAAO,IAAP,CAN5C,CAQD;AACA;AACA;AACA;AACA;AACA;;AACA,UAAMM,kBAAkB,GAAG,iCAA3B;AACA,QAAKX,IAAI,CAACU,KAAL,CAAYC,kBAAZ,CAAL,EAAwC,OAAO,IAAP;AACxC;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\nexport function getPasteEventData( { clipboardData } ) {\n\tlet plainText = '';\n\tlet html = '';\n\n\t// IE11 only supports `Text` as an argument for `getData` and will\n\t// otherwise throw an invalid argument error, so we try the standard\n\t// arguments first, then fallback to `Text` if they fail.\n\ttry {\n\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\thtml = clipboardData.getData( 'text/html' );\n\t} catch ( error1 ) {\n\t\ttry {\n\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t} catch ( error2 ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst files = getFilesFromDataTransfer( clipboardData );\n\n\tif (\n\t\tfiles.length &&\n\t\t! shouldDismissPastedFiles( files, html, plainText )\n\t) {\n\t\treturn { files };\n\t}\n\n\treturn { html, plainText, files: [] };\n}\n\n/**\n * Given a collection of DataTransfer files and HTML and plain text strings,\n * determine whether the files are to be dismissed in favor of the HTML.\n *\n * Certain office-type programs, like Microsoft Word or Apple Numbers,\n * will, upon copy, generate a screenshot of the content being copied and\n * attach it to the clipboard alongside the actual rich text that the user\n * sought to copy. In those cases, we should let Gutenberg handle the rich text\n * content and not the screenshot, since this allows Gutenberg to insert\n * meaningful blocks, like paragraphs, lists or even tables.\n *\n * @param {File[]} files File objects obtained from a paste event\n * @param {string} html HTML content obtained from a paste event\n * @return {boolean} True if the files should be dismissed\n */\nexport function shouldDismissPastedFiles( files, html /*, plainText */ ) {\n\t// The question is only relevant when there is actual HTML content and when\n\t// there is exactly one image file.\n\tif (\n\t\thtml &&\n\t\tfiles?.length === 1 &&\n\t\tfiles[ 0 ].type.indexOf( 'image/' ) === 0\n\t) {\n\t\t// A single <img> tag found in the HTML source suggests that the\n\t\t// content being pasted revolves around an image. Sometimes there are\n\t\t// other elements found, like <figure>, but we assume that the user's\n\t\t// intention is to paste the actual image file.\n\t\tconst IMAGE_TAG = /<\\s*img\\b/gi;\n\t\tif ( html.match( IMAGE_TAG )?.length !== 1 ) return true;\n\n\t\t// Even when there is exactly one <img> tag in the HTML payload, we\n\t\t// choose to weed out local images, i.e. those whose source starts with\n\t\t// \"file://\". These payloads occur in specific configurations, such as\n\t\t// when copying an entire document from Microsoft Word, that contains\n\t\t// text and exactly one image, and pasting that content using Google\n\t\t// Chrome.\n\t\tconst IMG_WITH_LOCAL_SRC = /<\\s*img\\b[^>]*\\bsrc=\"file:\\/\\//i;\n\t\tif ( html.match( IMG_WITH_LOCAL_SRC ) ) return true;\n\t}\n\n\treturn false;\n}\n"]}
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
package/build-style/content.css
CHANGED
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -158,6 +158,9 @@
|
|
|
158
158
|
.block-editor-block-inspector .components-base-control:last-child {
|
|
159
159
|
margin-bottom: 8px;
|
|
160
160
|
}
|
|
161
|
+
.block-editor-block-inspector .components-focal-point-picker-control .components-base-control {
|
|
162
|
+
margin-bottom: 0;
|
|
163
|
+
}
|
|
161
164
|
.block-editor-block-inspector .components-panel__body {
|
|
162
165
|
border: none;
|
|
163
166
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1171,6 +1174,9 @@
|
|
|
1171
1174
|
width: 100%;
|
|
1172
1175
|
border-radius: 2px;
|
|
1173
1176
|
}
|
|
1177
|
+
.block-editor-block-pattern-setup.view-mode-grid {
|
|
1178
|
+
padding-top: 4px;
|
|
1179
|
+
}
|
|
1174
1180
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__toolbar {
|
|
1175
1181
|
justify-content: center;
|
|
1176
1182
|
}
|
|
@@ -1192,10 +1198,26 @@
|
|
|
1192
1198
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container div[role=button] {
|
|
1193
1199
|
cursor: pointer;
|
|
1194
1200
|
}
|
|
1201
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-preview__container {
|
|
1202
|
+
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
1203
|
+
}
|
|
1204
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-preview__container {
|
|
1205
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1206
|
+
outline: 2px solid transparent;
|
|
1207
|
+
}
|
|
1208
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-pattern-setup-list__item-title, .block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-pattern-setup-list__item-title {
|
|
1209
|
+
color: var(--wp-admin-theme-color);
|
|
1210
|
+
}
|
|
1195
1211
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item {
|
|
1196
1212
|
break-inside: avoid-column;
|
|
1197
1213
|
margin-bottom: 24px;
|
|
1198
1214
|
}
|
|
1215
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-pattern-setup-list__item-title {
|
|
1216
|
+
padding-top: 8px;
|
|
1217
|
+
font-size: 12px;
|
|
1218
|
+
text-align: center;
|
|
1219
|
+
cursor: pointer;
|
|
1220
|
+
}
|
|
1199
1221
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__container {
|
|
1200
1222
|
min-height: 100px;
|
|
1201
1223
|
border-radius: 2px;
|
|
@@ -1237,6 +1259,7 @@
|
|
|
1237
1259
|
display: flex;
|
|
1238
1260
|
flex-direction: column;
|
|
1239
1261
|
width: 100%;
|
|
1262
|
+
height: 100%;
|
|
1240
1263
|
box-sizing: border-box;
|
|
1241
1264
|
}
|
|
1242
1265
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container {
|
|
@@ -1244,6 +1267,7 @@
|
|
|
1244
1267
|
position: relative;
|
|
1245
1268
|
padding: 0;
|
|
1246
1269
|
margin: 0;
|
|
1270
|
+
height: 100%;
|
|
1247
1271
|
list-style: none;
|
|
1248
1272
|
transform-style: preserve-3d;
|
|
1249
1273
|
}
|
|
@@ -1254,6 +1278,8 @@
|
|
|
1254
1278
|
position: absolute;
|
|
1255
1279
|
top: 0;
|
|
1256
1280
|
width: 100%;
|
|
1281
|
+
height: 100%;
|
|
1282
|
+
background-color: #fff;
|
|
1257
1283
|
margin: auto;
|
|
1258
1284
|
padding: 0;
|
|
1259
1285
|
transition: transform 0.5s, z-index 0.5s;
|
|
@@ -2328,9 +2354,8 @@
|
|
|
2328
2354
|
}
|
|
2329
2355
|
}
|
|
2330
2356
|
.block-editor-list-view-leaf .block-editor-block-icon {
|
|
2331
|
-
align-self: flex-start;
|
|
2332
2357
|
margin-left: 8px;
|
|
2333
|
-
|
|
2358
|
+
flex: 0 0 24px;
|
|
2334
2359
|
}
|
|
2335
2360
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,
|
|
2336
2361
|
.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell,
|
|
@@ -2462,11 +2487,6 @@
|
|
|
2462
2487
|
}
|
|
2463
2488
|
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__lock {
|
|
2464
2489
|
line-height: 0;
|
|
2465
|
-
width: 24px;
|
|
2466
|
-
min-width: 24px;
|
|
2467
|
-
margin-right: auto;
|
|
2468
|
-
padding: 0;
|
|
2469
|
-
vertical-align: middle;
|
|
2470
2490
|
}
|
|
2471
2491
|
|
|
2472
2492
|
.block-editor-list-view-block-select-button__description,
|
|
@@ -4143,7 +4163,7 @@
|
|
|
4143
4163
|
.offcanvas-editor__appender .block-editor-inserter__toggle {
|
|
4144
4164
|
background-color: #1e1e1e;
|
|
4145
4165
|
color: #fff;
|
|
4146
|
-
margin: 8px
|
|
4166
|
+
margin: 8px 24px 0 0;
|
|
4147
4167
|
border-radius: 2px;
|
|
4148
4168
|
height: 24px;
|
|
4149
4169
|
min-width: 24px;
|
|
@@ -4164,6 +4184,10 @@
|
|
|
4164
4184
|
max-width: 248px;
|
|
4165
4185
|
}
|
|
4166
4186
|
|
|
4187
|
+
.offcanvas-editor-list-view-is-empty {
|
|
4188
|
+
margin-right: 16px;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4167
4191
|
body.admin-color-light {
|
|
4168
4192
|
--wp-admin-theme-color: #0085ba;
|
|
4169
4193
|
--wp-admin-theme-color--rgb: 0, 133, 186;
|
package/build-style/style.css
CHANGED
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -158,6 +158,9 @@
|
|
|
158
158
|
.block-editor-block-inspector .components-base-control:last-child {
|
|
159
159
|
margin-bottom: 8px;
|
|
160
160
|
}
|
|
161
|
+
.block-editor-block-inspector .components-focal-point-picker-control .components-base-control {
|
|
162
|
+
margin-bottom: 0;
|
|
163
|
+
}
|
|
161
164
|
.block-editor-block-inspector .components-panel__body {
|
|
162
165
|
border: none;
|
|
163
166
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1171,6 +1174,9 @@
|
|
|
1171
1174
|
width: 100%;
|
|
1172
1175
|
border-radius: 2px;
|
|
1173
1176
|
}
|
|
1177
|
+
.block-editor-block-pattern-setup.view-mode-grid {
|
|
1178
|
+
padding-top: 4px;
|
|
1179
|
+
}
|
|
1174
1180
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__toolbar {
|
|
1175
1181
|
justify-content: center;
|
|
1176
1182
|
}
|
|
@@ -1192,10 +1198,26 @@
|
|
|
1192
1198
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container div[role=button] {
|
|
1193
1199
|
cursor: pointer;
|
|
1194
1200
|
}
|
|
1201
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-preview__container {
|
|
1202
|
+
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
1203
|
+
}
|
|
1204
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-preview__container {
|
|
1205
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1206
|
+
outline: 2px solid transparent;
|
|
1207
|
+
}
|
|
1208
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:hover .block-editor-block-pattern-setup-list__item-title, .block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__item:focus .block-editor-block-pattern-setup-list__item-title {
|
|
1209
|
+
color: var(--wp-admin-theme-color);
|
|
1210
|
+
}
|
|
1195
1211
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item {
|
|
1196
1212
|
break-inside: avoid-column;
|
|
1197
1213
|
margin-bottom: 24px;
|
|
1198
1214
|
}
|
|
1215
|
+
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-pattern-setup-list__item-title {
|
|
1216
|
+
padding-top: 8px;
|
|
1217
|
+
font-size: 12px;
|
|
1218
|
+
text-align: center;
|
|
1219
|
+
cursor: pointer;
|
|
1220
|
+
}
|
|
1199
1221
|
.block-editor-block-pattern-setup.view-mode-grid .block-editor-block-pattern-setup__container .block-editor-block-pattern-setup-list__list-item .block-editor-block-preview__container {
|
|
1200
1222
|
min-height: 100px;
|
|
1201
1223
|
border-radius: 2px;
|
|
@@ -1237,6 +1259,7 @@
|
|
|
1237
1259
|
display: flex;
|
|
1238
1260
|
flex-direction: column;
|
|
1239
1261
|
width: 100%;
|
|
1262
|
+
height: 100%;
|
|
1240
1263
|
box-sizing: border-box;
|
|
1241
1264
|
}
|
|
1242
1265
|
.block-editor-block-pattern-setup .block-editor-block-pattern-setup__container .carousel-container {
|
|
@@ -1244,6 +1267,7 @@
|
|
|
1244
1267
|
position: relative;
|
|
1245
1268
|
padding: 0;
|
|
1246
1269
|
margin: 0;
|
|
1270
|
+
height: 100%;
|
|
1247
1271
|
list-style: none;
|
|
1248
1272
|
transform-style: preserve-3d;
|
|
1249
1273
|
}
|
|
@@ -1254,6 +1278,8 @@
|
|
|
1254
1278
|
position: absolute;
|
|
1255
1279
|
top: 0;
|
|
1256
1280
|
width: 100%;
|
|
1281
|
+
height: 100%;
|
|
1282
|
+
background-color: #fff;
|
|
1257
1283
|
margin: auto;
|
|
1258
1284
|
padding: 0;
|
|
1259
1285
|
transition: transform 0.5s, z-index 0.5s;
|
|
@@ -2328,9 +2354,8 @@
|
|
|
2328
2354
|
}
|
|
2329
2355
|
}
|
|
2330
2356
|
.block-editor-list-view-leaf .block-editor-block-icon {
|
|
2331
|
-
align-self: flex-start;
|
|
2332
2357
|
margin-right: 8px;
|
|
2333
|
-
|
|
2358
|
+
flex: 0 0 24px;
|
|
2334
2359
|
}
|
|
2335
2360
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell,
|
|
2336
2361
|
.block-editor-list-view-leaf .block-editor-list-view-block__mover-cell,
|
|
@@ -2462,11 +2487,6 @@
|
|
|
2462
2487
|
}
|
|
2463
2488
|
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__lock {
|
|
2464
2489
|
line-height: 0;
|
|
2465
|
-
width: 24px;
|
|
2466
|
-
min-width: 24px;
|
|
2467
|
-
margin-left: auto;
|
|
2468
|
-
padding: 0;
|
|
2469
|
-
vertical-align: middle;
|
|
2470
2490
|
}
|
|
2471
2491
|
|
|
2472
2492
|
.block-editor-list-view-block-select-button__description,
|
|
@@ -4143,7 +4163,7 @@
|
|
|
4143
4163
|
.offcanvas-editor__appender .block-editor-inserter__toggle {
|
|
4144
4164
|
background-color: #1e1e1e;
|
|
4145
4165
|
color: #fff;
|
|
4146
|
-
margin: 8px 0 0
|
|
4166
|
+
margin: 8px 0 0 24px;
|
|
4147
4167
|
border-radius: 2px;
|
|
4148
4168
|
height: 24px;
|
|
4149
4169
|
min-width: 24px;
|
|
@@ -4164,6 +4184,10 @@
|
|
|
4164
4184
|
max-width: 248px;
|
|
4165
4185
|
}
|
|
4166
4186
|
|
|
4187
|
+
.offcanvas-editor-list-view-is-empty {
|
|
4188
|
+
margin-left: 16px;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4167
4191
|
body.admin-color-light {
|
|
4168
4192
|
--wp-admin-theme-color: #0085ba;
|
|
4169
4193
|
--wp-admin-theme-color--rgb: 0, 133, 186;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,33 +33,33 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^23.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/data": "^8.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/escape-html": "^2.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
53
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/notices": "^3.
|
|
56
|
-
"@wordpress/rich-text": "^6.
|
|
57
|
-
"@wordpress/shortcode": "^3.
|
|
58
|
-
"@wordpress/style-engine": "^1.
|
|
59
|
-
"@wordpress/token-list": "^2.
|
|
60
|
-
"@wordpress/url": "^3.
|
|
61
|
-
"@wordpress/warning": "^2.
|
|
62
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.24.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.21.0",
|
|
38
|
+
"@wordpress/blob": "^3.24.0",
|
|
39
|
+
"@wordpress/blocks": "^12.1.0",
|
|
40
|
+
"@wordpress/components": "^23.1.0",
|
|
41
|
+
"@wordpress/compose": "^6.1.0",
|
|
42
|
+
"@wordpress/data": "^8.1.0",
|
|
43
|
+
"@wordpress/date": "^4.24.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.24.0",
|
|
45
|
+
"@wordpress/dom": "^3.24.0",
|
|
46
|
+
"@wordpress/element": "^5.1.0",
|
|
47
|
+
"@wordpress/escape-html": "^2.24.0",
|
|
48
|
+
"@wordpress/hooks": "^3.24.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.24.0",
|
|
50
|
+
"@wordpress/i18n": "^4.24.0",
|
|
51
|
+
"@wordpress/icons": "^9.15.0",
|
|
52
|
+
"@wordpress/is-shallow-equal": "^4.24.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.1.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.24.0",
|
|
55
|
+
"@wordpress/notices": "^3.24.0",
|
|
56
|
+
"@wordpress/rich-text": "^6.1.0",
|
|
57
|
+
"@wordpress/shortcode": "^3.24.0",
|
|
58
|
+
"@wordpress/style-engine": "^1.7.0",
|
|
59
|
+
"@wordpress/token-list": "^2.24.0",
|
|
60
|
+
"@wordpress/url": "^3.25.0",
|
|
61
|
+
"@wordpress/warning": "^2.24.0",
|
|
62
|
+
"@wordpress/wordcount": "^3.24.0",
|
|
63
63
|
"change-case": "^4.1.2",
|
|
64
64
|
"classnames": "^2.3.1",
|
|
65
65
|
"colord": "^2.7.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "200bee7b06b15f6fa655e25b6ab69cbd6b49a357"
|
|
85
85
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { find } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -46,8 +41,7 @@ function AlignmentUI( {
|
|
|
46
41
|
return () => onChange( value === align ? undefined : align );
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
const activeAlignment = find(
|
|
50
|
-
alignmentControls,
|
|
44
|
+
const activeAlignment = alignmentControls.find(
|
|
51
45
|
( control ) => control.align === value
|
|
52
46
|
);
|
|
53
47
|
|
|
@@ -10,6 +10,7 @@ import { useLayout } from '../block-list/layout';
|
|
|
10
10
|
import { store as blockEditorStore } from '../../store';
|
|
11
11
|
import { getLayoutType } from '../../layouts';
|
|
12
12
|
|
|
13
|
+
const EMPTY_ARRAY = [];
|
|
13
14
|
const DEFAULT_CONTROLS = [ 'none', 'left', 'center', 'right', 'wide', 'full' ];
|
|
14
15
|
const WIDE_CONTROLS = [ 'wide', 'full' ];
|
|
15
16
|
|
|
@@ -40,14 +41,14 @@ export default function useAvailableAlignments( controls = DEFAULT_CONTROLS ) {
|
|
|
40
41
|
// While we treat `none` as an alignment, we shouldn't return it if no
|
|
41
42
|
// other alignments exist.
|
|
42
43
|
if ( alignments.length === 1 && alignments[ 0 ].name === 'none' ) {
|
|
43
|
-
return
|
|
44
|
+
return EMPTY_ARRAY;
|
|
44
45
|
}
|
|
45
46
|
return alignments;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
// Starting here, it's the fallback for themes not supporting the layout config.
|
|
49
50
|
if ( layoutType.name !== 'default' && layoutType.name !== 'constrained' ) {
|
|
50
|
-
return
|
|
51
|
+
return EMPTY_ARRAY;
|
|
51
52
|
}
|
|
52
53
|
const { alignments: availableAlignments = DEFAULT_CONTROLS } = layout;
|
|
53
54
|
const enabledControls = controls
|
|
@@ -66,7 +67,7 @@ export default function useAvailableAlignments( controls = DEFAULT_CONTROLS ) {
|
|
|
66
67
|
enabledControls.length === 1 &&
|
|
67
68
|
enabledControls[ 0 ].name === 'none'
|
|
68
69
|
) {
|
|
69
|
-
return
|
|
70
|
+
return EMPTY_ARRAY;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
return enabledControls;
|
|
@@ -10,14 +10,16 @@ import { Icon } from '@wordpress/components';
|
|
|
10
10
|
import { blockDefault } from '@wordpress/icons';
|
|
11
11
|
import { memo } from '@wordpress/element';
|
|
12
12
|
|
|
13
|
-
function BlockIcon( { icon, showColors = false, className } ) {
|
|
13
|
+
function BlockIcon( { icon, showColors = false, className, context } ) {
|
|
14
14
|
if ( icon?.src === 'block-default' ) {
|
|
15
15
|
icon = {
|
|
16
16
|
src: blockDefault,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const renderedIcon =
|
|
20
|
+
const renderedIcon = (
|
|
21
|
+
<Icon icon={ icon && icon.src ? icon.src : icon } context={ context } />
|
|
22
|
+
);
|
|
21
23
|
const style = showColors
|
|
22
24
|
? {
|
|
23
25
|
backgroundColor: icon && icon.background,
|
|
@@ -13,6 +13,10 @@ import { image } from '@wordpress/icons';
|
|
|
13
13
|
*/
|
|
14
14
|
import BlockIcon from '../';
|
|
15
15
|
|
|
16
|
+
function getIconWrapper( container ) {
|
|
17
|
+
return container.firstChild;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
describe( 'BlockIcon', () => {
|
|
17
21
|
it( 'renders a Icon', () => {
|
|
18
22
|
const { container } = render( <BlockIcon icon={ image } /> );
|
|
@@ -23,13 +27,13 @@ describe( 'BlockIcon', () => {
|
|
|
23
27
|
it( 'renders a span without the has-colors classname', () => {
|
|
24
28
|
const { container } = render( <BlockIcon icon={ image } /> );
|
|
25
29
|
|
|
26
|
-
expect( container
|
|
30
|
+
expect( getIconWrapper( container ) ).not.toHaveClass( 'has-colors' );
|
|
27
31
|
} );
|
|
28
32
|
|
|
29
33
|
it( 'renders a span with the has-colors classname', () => {
|
|
30
34
|
const { container } = render( <BlockIcon icon={ image } showColors /> );
|
|
31
35
|
|
|
32
|
-
expect( container
|
|
36
|
+
expect( getIconWrapper( container ) ).toHaveClass( 'has-colors' );
|
|
33
37
|
} );
|
|
34
38
|
|
|
35
39
|
it( 'supports adding a className to the wrapper', () => {
|
|
@@ -37,7 +41,7 @@ describe( 'BlockIcon', () => {
|
|
|
37
41
|
<BlockIcon icon={ image } className="foo-bar" />
|
|
38
42
|
);
|
|
39
43
|
|
|
40
|
-
expect( container
|
|
44
|
+
expect( getIconWrapper( container ) ).toHaveClass( 'foo-bar' );
|
|
41
45
|
} );
|
|
42
46
|
|
|
43
47
|
it( 'skips adding background and foreground styles when colors are not enabled', () => {
|
|
@@ -51,7 +55,7 @@ describe( 'BlockIcon', () => {
|
|
|
51
55
|
/>
|
|
52
56
|
);
|
|
53
57
|
|
|
54
|
-
expect( container
|
|
58
|
+
expect( getIconWrapper( container ) ).not.toHaveAttribute( 'style' );
|
|
55
59
|
} );
|
|
56
60
|
|
|
57
61
|
it( 'adds background and foreground styles when colors are enabled', () => {
|
|
@@ -66,7 +70,7 @@ describe( 'BlockIcon', () => {
|
|
|
66
70
|
/>
|
|
67
71
|
);
|
|
68
72
|
|
|
69
|
-
expect( container
|
|
73
|
+
expect( getIconWrapper( container ) ).toHaveStyle( {
|
|
70
74
|
backgroundColor: 'white',
|
|
71
75
|
color: 'black',
|
|
72
76
|
} );
|