@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-controls/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +14 -28
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +4 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -4
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +7 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/block-tools/index.js +12 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +156 -23
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +33 -25
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/url-input/index.js +3 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +5 -6
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +7 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +6 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +3 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +12 -8
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +27 -22
- package/build/utils/dom.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +15 -27
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +4 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -4
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +7 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/block-tools/index.js +13 -10
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +157 -24
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +33 -25
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/url-input/index.js +3 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +4 -4
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +7 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +6 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +3 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +12 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +25 -21
- package/build-module/utils/dom.js.map +1 -1
- package/build-style/content-rtl.css +30 -15
- package/build-style/content.css +30 -15
- package/build-style/style-rtl.css +92 -3
- package/build-style/style.css +92 -3
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/components/block-canvas/style.scss +1 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-inspector/style.scss +2 -1
- package/src/components/block-list/block.js +28 -48
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/index.story.js +2 -19
- package/src/components/block-popover/index.js +4 -4
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/change-design.js +1 -7
- package/src/components/block-toolbar/index.js +6 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/index.js +26 -10
- package/src/components/block-tools/style.scss +12 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -1
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +16 -3
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +204 -44
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +41 -37
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/components/rich-text/index.js +8 -1
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/url-input/index.js +3 -4
- package/src/components/use-block-commands/index.js +245 -234
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +6 -6
- package/src/hooks/utils.js +8 -3
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +6 -7
- package/src/store/selectors.js +60 -45
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/selectors.js +87 -58
- package/src/store/utils.js +12 -11
- package/src/style.scss +1 -0
- package/src/utils/dom.js +26 -21
- package/src/utils/test/dom.js +224 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -46,18 +46,18 @@ export default function useInspectorControlsTabs( blockName ) {
|
|
|
46
46
|
|
|
47
47
|
// List View Tab: If there are any fills for the list group add that tab.
|
|
48
48
|
const listViewDisabled = useIsListViewTabDisabled( blockName );
|
|
49
|
-
const listFills = useSlotFills( listGroup.
|
|
49
|
+
const listFills = useSlotFills( listGroup.name );
|
|
50
50
|
const hasListFills = ! listViewDisabled && !! listFills && listFills.length;
|
|
51
51
|
|
|
52
52
|
// Styles Tab: Add this tab if there are any fills for block supports
|
|
53
53
|
// e.g. border, color, spacing, typography, etc.
|
|
54
54
|
const styleFills = [
|
|
55
|
-
...( useSlotFills( borderGroup.
|
|
56
|
-
...( useSlotFills( colorGroup.
|
|
57
|
-
...( useSlotFills( dimensionsGroup.
|
|
58
|
-
...( useSlotFills( stylesGroup.
|
|
59
|
-
...( useSlotFills( typographyGroup.
|
|
60
|
-
...( useSlotFills( effectsGroup.
|
|
55
|
+
...( useSlotFills( borderGroup.name ) || [] ),
|
|
56
|
+
...( useSlotFills( colorGroup.name ) || [] ),
|
|
57
|
+
...( useSlotFills( dimensionsGroup.name ) || [] ),
|
|
58
|
+
...( useSlotFills( stylesGroup.name ) || [] ),
|
|
59
|
+
...( useSlotFills( typographyGroup.name ) || [] ),
|
|
60
|
+
...( useSlotFills( effectsGroup.name ) || [] ),
|
|
61
61
|
];
|
|
62
62
|
const hasStyleFills = styleFills.length;
|
|
63
63
|
|
|
@@ -67,12 +67,12 @@ export default function useInspectorControlsTabs( blockName ) {
|
|
|
67
67
|
// the advanced controls slot as well to ensure they are rendered.
|
|
68
68
|
const advancedFills = [
|
|
69
69
|
...( useSlotFills( InspectorAdvancedControls.slotName ) || [] ),
|
|
70
|
-
...( useSlotFills( bindingsGroup.
|
|
70
|
+
...( useSlotFills( bindingsGroup.name ) || [] ),
|
|
71
71
|
];
|
|
72
72
|
|
|
73
73
|
const settingsFills = [
|
|
74
|
-
...( useSlotFills( defaultGroup.
|
|
75
|
-
...( useSlotFills( positionGroup.
|
|
74
|
+
...( useSlotFills( defaultGroup.name ) || [] ),
|
|
75
|
+
...( useSlotFills( positionGroup.name ) || [] ),
|
|
76
76
|
...( hasListFills && hasStyleFills > 1 ? advancedFills : [] ),
|
|
77
77
|
];
|
|
78
78
|
|
|
@@ -239,7 +239,7 @@ export function MediaPlaceholder( {
|
|
|
239
239
|
( block.name === 'core/image' ||
|
|
240
240
|
block.name === 'core/audio' ||
|
|
241
241
|
block.name === 'core/video' ) &&
|
|
242
|
-
block.attributes.url
|
|
242
|
+
( block.attributes.url || block.attributes.src )
|
|
243
243
|
? [ block ]
|
|
244
244
|
: recursivelyFindMediaFromBlocks( block.innerBlocks )
|
|
245
245
|
);
|
|
@@ -252,33 +252,37 @@ export function MediaPlaceholder( {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
const uploadedMediaList = await Promise.all(
|
|
255
|
-
mediaBlocks.map( ( block ) =>
|
|
256
|
-
block.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
255
|
+
mediaBlocks.map( ( block ) => {
|
|
256
|
+
const blockType = block.name.split( '/' )[ 1 ];
|
|
257
|
+
if ( block.attributes.id ) {
|
|
258
|
+
block.attributes.type = blockType;
|
|
259
|
+
return block.attributes;
|
|
260
|
+
}
|
|
261
|
+
return new Promise( ( resolve, reject ) => {
|
|
262
|
+
window
|
|
263
|
+
.fetch( block.attributes.url )
|
|
264
|
+
.then( ( response ) => response.blob() )
|
|
265
|
+
.then( ( blob ) =>
|
|
266
|
+
mediaUpload( {
|
|
267
|
+
filesList: [ blob ],
|
|
268
|
+
additionalData: {
|
|
269
|
+
title: block.attributes.title,
|
|
270
|
+
alt_text: block.attributes.alt,
|
|
271
|
+
caption: block.attributes.caption,
|
|
272
|
+
type: blockType,
|
|
273
|
+
},
|
|
274
|
+
onFileChange: ( [ media ] ) => {
|
|
275
|
+
if ( media.id ) {
|
|
276
|
+
resolve( media );
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
allowedTypes,
|
|
280
|
+
onError: reject,
|
|
281
|
+
} )
|
|
282
|
+
)
|
|
283
|
+
.catch( () => resolve( block.attributes.url ) );
|
|
284
|
+
} );
|
|
285
|
+
} )
|
|
282
286
|
).catch( ( err ) => onError( err ) );
|
|
283
287
|
|
|
284
288
|
if ( multiple ) {
|
|
@@ -288,8 +292,10 @@ export function MediaPlaceholder( {
|
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
|
|
291
|
-
async function
|
|
292
|
-
const blocks = pasteHandler( {
|
|
295
|
+
async function onDrop( event ) {
|
|
296
|
+
const blocks = pasteHandler( {
|
|
297
|
+
HTML: event.dataTransfer?.getData( 'default' ),
|
|
298
|
+
} );
|
|
293
299
|
return await handleBlocksDrop( blocks );
|
|
294
300
|
}
|
|
295
301
|
|
|
@@ -317,20 +323,20 @@ export function MediaPlaceholder( {
|
|
|
317
323
|
|
|
318
324
|
if ( instructions === undefined && mediaUpload ) {
|
|
319
325
|
instructions = __(
|
|
320
|
-
'
|
|
326
|
+
'Drag and drop an image or video, upload, or choose from your library.'
|
|
321
327
|
);
|
|
322
328
|
|
|
323
329
|
if ( isAudio ) {
|
|
324
330
|
instructions = __(
|
|
325
|
-
'
|
|
331
|
+
'Drag and drop an audio file, upload, or choose from your library.'
|
|
326
332
|
);
|
|
327
333
|
} else if ( isImage ) {
|
|
328
334
|
instructions = __(
|
|
329
|
-
'
|
|
335
|
+
'Drag and drop an image, upload, or choose from your library.'
|
|
330
336
|
);
|
|
331
337
|
} else if ( isVideo ) {
|
|
332
338
|
instructions = __(
|
|
333
|
-
'
|
|
339
|
+
'Drag and drop a video, upload, or choose from your library.'
|
|
334
340
|
);
|
|
335
341
|
}
|
|
336
342
|
}
|
|
@@ -379,9 +385,7 @@ export function MediaPlaceholder( {
|
|
|
379
385
|
return null;
|
|
380
386
|
}
|
|
381
387
|
|
|
382
|
-
return
|
|
383
|
-
<DropZone onFilesDrop={ onFilesUpload } onHTMLDrop={ onHTMLDrop } />
|
|
384
|
-
);
|
|
388
|
+
return <DropZone onFilesDrop={ onFilesUpload } onDrop={ onDrop } />;
|
|
385
389
|
};
|
|
386
390
|
|
|
387
391
|
const renderCancelLink = () => {
|
|
@@ -22,7 +22,9 @@ jest.mock( '../../../store/actions', () => {
|
|
|
22
22
|
...actions,
|
|
23
23
|
resetBlocks: jest.fn( actions.resetBlocks ),
|
|
24
24
|
replaceInnerBlocks: jest.fn( actions.replaceInnerBlocks ),
|
|
25
|
-
setHasControlledInnerBlocks: jest.fn(
|
|
25
|
+
setHasControlledInnerBlocks: jest.fn(
|
|
26
|
+
actions.setHasControlledInnerBlocks
|
|
27
|
+
),
|
|
26
28
|
};
|
|
27
29
|
} );
|
|
28
30
|
|
|
@@ -13,16 +13,6 @@
|
|
|
13
13
|
&:focus {
|
|
14
14
|
// Removes outline added by the browser.
|
|
15
15
|
outline: none;
|
|
16
|
-
|
|
17
|
-
[data-rich-text-format-boundary] {
|
|
18
|
-
border-radius: $radius-small;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.block-editor-rich-text__editable {
|
|
24
|
-
> p:first-child {
|
|
25
|
-
margin-top: 0;
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
|
|
@@ -40,3 +30,18 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
40
30
|
background: rgb(255, 255, 0);
|
|
41
31
|
}
|
|
42
32
|
}
|
|
33
|
+
|
|
34
|
+
[data-rich-text-comment],
|
|
35
|
+
[data-rich-text-format-boundary] {
|
|
36
|
+
border-radius: $radius-small;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-rich-text-comment] {
|
|
40
|
+
background-color: currentColor;
|
|
41
|
+
|
|
42
|
+
span {
|
|
43
|
+
filter: invert(100%);
|
|
44
|
+
color: currentColor;
|
|
45
|
+
padding: 0 2px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -233,7 +233,14 @@ export function RichTextWrapper(
|
|
|
233
233
|
bindingsLabel: _bindingsLabel,
|
|
234
234
|
};
|
|
235
235
|
},
|
|
236
|
-
[
|
|
236
|
+
[
|
|
237
|
+
blockBindings,
|
|
238
|
+
identifier,
|
|
239
|
+
blockName,
|
|
240
|
+
adjustedValue,
|
|
241
|
+
clientId,
|
|
242
|
+
blockContext,
|
|
243
|
+
]
|
|
237
244
|
);
|
|
238
245
|
|
|
239
246
|
const shouldDisableEditing = readOnly || disableBoundBlock;
|
|
@@ -533,10 +533,9 @@ class URLInput extends Component {
|
|
|
533
533
|
<Popover placement="bottom" focusOnMount={ false }>
|
|
534
534
|
<div
|
|
535
535
|
{ ...suggestionsListProps }
|
|
536
|
-
className={ clsx(
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
) }
|
|
536
|
+
className={ clsx( 'block-editor-url-input__suggestions', {
|
|
537
|
+
[ `${ className }__suggestions` ]: className,
|
|
538
|
+
} ) }
|
|
540
539
|
>
|
|
541
540
|
{ suggestions.map( ( suggestion, index ) => (
|
|
542
541
|
<Button
|