@wordpress/block-editor 12.9.1-next.5a1d1283.0 → 12.10.1
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 +6 -0
- package/README.md +33 -3
- package/build/components/block-canvas/index.js +107 -0
- package/build/components/block-canvas/index.js.map +1 -0
- package/build/components/block-inspector/index.js +4 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +28 -8
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +68 -0
- package/build/components/block-patterns-paging/index.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js +28 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +4 -7
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -0
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +3 -7
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +18 -7
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +5 -1
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +1 -1
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +2 -4
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +8 -21
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +20 -1
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/duotone/utils.js +68 -0
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/editor-styles/index.js +28 -9
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/global-styles/hooks.js +2 -101
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +61 -0
- package/build/components/global-styles/image-settings-panel.js.map +1 -0
- package/build/components/global-styles/index.js +11 -17
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +19 -15
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/iframe/index.js +67 -33
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +2 -5
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +9 -9
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/index.js +8 -12
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +6 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +13 -7
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +12 -6
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +45 -22
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +9 -9
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-filter.js +137 -0
- package/build/components/inserter/block-patterns-filter.js.map +1 -0
- package/build/components/inserter/block-patterns-tab.js +128 -42
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +61 -0
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -0
- package/build/components/inserter/hooks/use-patterns-state.js +21 -10
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/menu.js +13 -11
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/search-results.js +4 -3
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.js +1 -12
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +12 -1
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/fill.js +24 -13
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/groups.js +5 -3
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/slot.js +13 -0
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/link-control/index.js +12 -2
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -3
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +13 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +29 -24
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/media-placeholder/index.js +2 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +11 -11
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +2 -3
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/constants.js +30 -0
- package/build/components/media-upload/constants.js.map +1 -0
- package/build/components/media-upload/index.native.js +63 -53
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +1 -1
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/rich-text/index.js +34 -35
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +14 -32
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +95 -0
- package/build/components/rich-text/multiline.js.map +1 -0
- package/build/components/rich-text/split-value.js +10 -16
- package/build/components/rich-text/split-value.js.map +1 -1
- package/build/components/rich-text/use-enter.js +31 -40
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +18 -33
- package/build/components/rich-text/use-paste-handler.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/use-block-commands/index.js +30 -18
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +5 -2
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/hooks/background.js +263 -0
- package/build/hooks/background.js.map +1 -0
- package/build/hooks/block-hooks.js +188 -0
- package/build/hooks/block-hooks.js.map +1 -0
- package/build/hooks/block-rename-ui.js +161 -0
- package/build/hooks/block-rename-ui.js.map +1 -0
- package/build/hooks/duotone.js +29 -42
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +2 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +31 -14
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +4 -2
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +10 -3
- package/build/hooks/style.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +33 -10
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +42 -8
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +25 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +43 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +84 -23
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +0 -4
- package/build/store/utils.js.map +1 -1
- package/build-module/components/block-canvas/index.js +97 -0
- package/build-module/components/block-canvas/index.js.map +1 -0
- package/build-module/components/block-inspector/index.js +4 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +30 -10
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +61 -0
- package/build-module/components/block-patterns-paging/index.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +28 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +4 -7
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -0
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +3 -7
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +18 -7
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +5 -1
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +1 -1
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +2 -4
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +8 -21
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/default-block-appender/index.native.js +20 -1
- package/build-module/components/default-block-appender/index.native.js.map +1 -1
- package/build-module/components/duotone/utils.js +65 -0
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/editor-styles/index.js +28 -9
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -100
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +53 -0
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -0
- package/build-module/components/global-styles/index.js +2 -2
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +18 -16
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/iframe/index.js +66 -33
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +2 -5
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +9 -9
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +2 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +14 -8
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +12 -6
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +47 -24
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +9 -9
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-filter.js +128 -0
- package/build-module/components/inserter/block-patterns-filter.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab.js +125 -44
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +54 -0
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -0
- package/build-module/components/inserter/hooks/use-patterns-state.js +22 -10
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/menu.js +13 -11
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/search-results.js +4 -3
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.js +1 -12
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +13 -2
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +25 -14
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +5 -3
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +15 -1
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/link-control/index.js +12 -2
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -3
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +13 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +30 -25
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +2 -2
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +7 -7
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +2 -3
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/constants.js +14 -0
- package/build-module/components/media-upload/constants.js.map +1 -0
- package/build-module/components/media-upload/index.native.js +53 -34
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +1 -1
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +35 -37
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +15 -33
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +87 -0
- package/build-module/components/rich-text/multiline.js.map +1 -0
- package/build-module/components/rich-text/split-value.js +10 -16
- package/build-module/components/rich-text/split-value.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +33 -42
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +19 -34
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +2 -2
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +28 -16
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +5 -2
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/hooks/background.js +249 -0
- package/build-module/hooks/background.js.map +1 -0
- package/build-module/hooks/block-hooks.js +181 -0
- package/build-module/hooks/block-hooks.js.map +1 -0
- package/build-module/hooks/block-rename-ui.js +154 -0
- package/build-module/hooks/block-rename-ui.js.map +1 -0
- package/build-module/hooks/duotone.js +26 -39
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +2 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +33 -16
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +4 -2
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +10 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +33 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +39 -8
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +23 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +41 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +78 -22
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +0 -4
- package/build-module/store/utils.js.map +1 -1
- package/build-style/content-rtl.css +0 -1
- package/build-style/content.css +0 -1
- package/build-style/style-rtl.css +201 -131
- package/build-style/style.css +201 -131
- package/package.json +32 -32
- package/src/components/block-canvas/index.js +108 -0
- package/src/components/block-inspector/index.js +5 -1
- package/src/components/block-list/content.scss +0 -1
- package/src/components/block-patterns-list/index.js +53 -19
- package/src/components/block-patterns-list/style.scss +26 -9
- package/src/components/block-patterns-paging/index.js +92 -0
- package/src/components/block-patterns-paging/style.scss +45 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +44 -0
- package/src/components/block-settings-menu-controls/index.js +4 -9
- package/src/components/block-styles/index.js +1 -0
- package/src/components/block-styles/style.scss +3 -3
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -6
- package/src/components/block-tools/block-contextual-toolbar.js +16 -5
- package/src/components/block-tools/block-selection-button.js +9 -1
- package/src/components/block-tools/style.scss +0 -98
- package/src/components/border-radius-control/input-controls.js +1 -1
- package/src/components/border-radius-control/linked-button.js +8 -11
- package/src/components/color-palette/test/__snapshots__/control.js.snap +34 -21
- package/src/components/colors/with-colors.js +3 -2
- package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +8 -35
- package/src/components/default-block-appender/index.native.js +26 -3
- package/src/components/duotone/utils.js +65 -0
- package/src/components/editor-styles/index.js +32 -23
- package/src/components/global-styles/hooks.js +4 -112
- package/src/components/global-styles/image-settings-panel.js +71 -0
- package/src/components/global-styles/index.js +4 -3
- package/src/components/global-styles/use-global-styles-output.js +25 -16
- package/src/components/global-styles/utils.js +1 -2
- package/src/components/iframe/index.js +72 -33
- package/src/components/image-editor/use-save-image.js +2 -9
- package/src/components/image-editor/use-transform-image.js +9 -9
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +2 -2
- package/src/components/inner-blocks/use-nested-settings-update.js +15 -10
- package/src/components/inserter/block-patterns-explorer/explorer.js +17 -5
- package/src/components/inserter/block-patterns-explorer/patterns-list.js +68 -43
- package/src/components/inserter/block-patterns-explorer/sidebar.js +8 -8
- package/src/components/inserter/block-patterns-filter.js +183 -0
- package/src/components/inserter/block-patterns-tab.js +217 -58
- package/src/components/inserter/hooks/use-patterns-paging.js +76 -0
- package/src/components/inserter/hooks/use-patterns-state.js +27 -16
- package/src/components/inserter/menu.js +15 -17
- package/src/components/inserter/search-results.js +6 -4
- package/src/components/inserter/style.scss +36 -7
- package/src/components/inserter/tabs.js +2 -12
- package/src/components/inserter/test/index.native.js +8 -12
- package/src/components/inspector-controls/block-support-slot-container.js +19 -3
- package/src/components/inspector-controls/fill.js +28 -14
- package/src/components/inspector-controls/groups.js +6 -2
- package/src/components/inspector-controls/slot.js +28 -3
- package/src/components/inspector-controls-tabs/styles-tab.js +4 -0
- package/src/components/link-control/index.js +13 -0
- package/src/components/link-control/style.scss +23 -2
- package/src/components/link-control/test/index.js +88 -6
- package/src/components/list-view/block-select-button.js +1 -3
- package/src/components/list-view/block.js +19 -1
- package/src/components/list-view/style.scss +1 -2
- package/src/components/list-view/use-block-selection.js +38 -32
- package/src/components/media-placeholder/README.md +2 -2
- package/src/components/media-placeholder/index.js +2 -2
- package/src/components/media-placeholder/index.native.js +11 -12
- package/src/components/media-replace-flow/index.js +2 -2
- package/src/components/media-replace-flow/test/index.js +5 -23
- package/src/components/media-upload/README.md +3 -2
- package/src/components/media-upload/constants.js +15 -0
- package/src/components/media-upload/index.native.js +66 -40
- package/src/components/media-upload/style.native.scss +4 -0
- package/src/components/media-upload/test/index.native.js +2 -2
- package/src/components/preview-options/README.md +7 -0
- package/src/components/preview-options/index.js +1 -1
- package/src/components/rich-text/index.js +48 -44
- package/src/components/rich-text/index.native.js +14 -42
- package/src/components/rich-text/multiline.js +121 -0
- package/src/components/rich-text/split-value.js +10 -35
- package/src/components/rich-text/use-enter.js +32 -42
- package/src/components/rich-text/use-paste-handler.js +16 -40
- package/src/components/spacing-sizes-control/style.scss +5 -7
- package/src/components/spacing-sizes-control/utils.js +1 -2
- package/src/components/use-block-commands/index.js +28 -20
- package/src/components/use-block-display-information/index.js +3 -0
- package/src/hooks/background.js +299 -0
- package/src/hooks/background.scss +75 -0
- package/src/hooks/block-hooks.js +257 -0
- package/src/hooks/block-hooks.scss +16 -0
- package/src/hooks/block-rename-ui.js +231 -0
- package/src/hooks/block-rename-ui.scss +3 -0
- package/src/hooks/duotone.js +42 -43
- package/src/hooks/index.js +2 -2
- package/src/hooks/layout.js +31 -33
- package/src/hooks/position.js +4 -3
- package/src/hooks/style.js +11 -2
- package/src/hooks/test/align.native.js +4 -3
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +52 -10
- package/src/store/private-actions.js +37 -6
- package/src/store/private-selectors.js +28 -3
- package/src/store/reducer.js +38 -0
- package/src/store/selectors.js +107 -26
- package/src/store/test/actions.js +19 -8
- package/src/store/test/private-actions.js +17 -0
- package/src/store/test/reducer.js +25 -0
- package/src/store/test/selectors.js +130 -123
- package/src/store/utils.js +3 -10
- package/src/style.scss +4 -0
- package/build/components/duotone/components.js +0 -135
- package/build/components/duotone/components.js.map +0 -1
- package/build/components/duotone/index.js +0 -38
- package/build/components/duotone/index.js.map +0 -1
- package/build/components/global-styles/behaviors-panel.js +0 -64
- package/build/components/global-styles/behaviors-panel.js.map +0 -1
- package/build/components/inserter/reusable-blocks-tab.js +0 -85
- package/build/components/inserter/reusable-blocks-tab.js.map +0 -1
- package/build/hooks/auto-inserting-blocks.js +0 -174
- package/build/hooks/auto-inserting-blocks.js.map +0 -1
- package/build/hooks/behaviors.js +0 -173
- package/build/hooks/behaviors.js.map +0 -1
- package/build-module/components/duotone/components.js +0 -126
- package/build-module/components/duotone/components.js.map +0 -1
- package/build-module/components/duotone/index.js +0 -3
- package/build-module/components/duotone/index.js.map +0 -1
- package/build-module/components/global-styles/behaviors-panel.js +0 -57
- package/build-module/components/global-styles/behaviors-panel.js.map +0 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +0 -76
- package/build-module/components/inserter/reusable-blocks-tab.js.map +0 -1
- package/build-module/hooks/auto-inserting-blocks.js +0 -167
- package/build-module/hooks/auto-inserting-blocks.js.map +0 -1
- package/build-module/hooks/behaviors.js +0 -166
- package/build-module/hooks/behaviors.js.map +0 -1
- package/src/components/duotone/components.js +0 -133
- package/src/components/duotone/index.js +0 -7
- package/src/components/global-styles/behaviors-panel.js +0 -71
- package/src/components/inserter/reusable-blocks-tab.js +0 -84
- package/src/components/inserter/test/reusable-blocks-tab.js +0 -73
- package/src/hooks/auto-inserting-blocks.js +0 -232
- package/src/hooks/behaviors.js +0 -206
|
@@ -526,130 +526,131 @@ describe( 'selectors', () => {
|
|
|
526
526
|
} );
|
|
527
527
|
|
|
528
528
|
describe( 'getClientIdsOfDescendants', () => {
|
|
529
|
+
const state = {
|
|
530
|
+
blocks: {
|
|
531
|
+
byClientId: new Map(
|
|
532
|
+
Object.entries( {
|
|
533
|
+
'uuid-2': {
|
|
534
|
+
clientId: 'uuid-2',
|
|
535
|
+
name: 'core/image',
|
|
536
|
+
},
|
|
537
|
+
'uuid-4': {
|
|
538
|
+
clientId: 'uuid-4',
|
|
539
|
+
name: 'core/paragraph',
|
|
540
|
+
},
|
|
541
|
+
'uuid-6': {
|
|
542
|
+
clientId: 'uuid-6',
|
|
543
|
+
name: 'core/paragraph',
|
|
544
|
+
},
|
|
545
|
+
'uuid-8': {
|
|
546
|
+
clientId: 'uuid-8',
|
|
547
|
+
name: 'core/block',
|
|
548
|
+
},
|
|
549
|
+
'uuid-10': {
|
|
550
|
+
clientId: 'uuid-10',
|
|
551
|
+
name: 'core/columns',
|
|
552
|
+
},
|
|
553
|
+
'uuid-12': {
|
|
554
|
+
clientId: 'uuid-12',
|
|
555
|
+
name: 'core/column',
|
|
556
|
+
},
|
|
557
|
+
'uuid-14': {
|
|
558
|
+
clientId: 'uuid-14',
|
|
559
|
+
name: 'core/column',
|
|
560
|
+
},
|
|
561
|
+
'uuid-16': {
|
|
562
|
+
clientId: 'uuid-16',
|
|
563
|
+
name: 'core/quote',
|
|
564
|
+
},
|
|
565
|
+
'uuid-18': {
|
|
566
|
+
clientId: 'uuid-18',
|
|
567
|
+
name: 'core/block',
|
|
568
|
+
},
|
|
569
|
+
'uuid-20': {
|
|
570
|
+
clientId: 'uuid-20',
|
|
571
|
+
name: 'core/gallery',
|
|
572
|
+
},
|
|
573
|
+
'uuid-22': {
|
|
574
|
+
clientId: 'uuid-22',
|
|
575
|
+
name: 'core/block',
|
|
576
|
+
},
|
|
577
|
+
'uuid-24': {
|
|
578
|
+
clientId: 'uuid-24',
|
|
579
|
+
name: 'core/columns',
|
|
580
|
+
},
|
|
581
|
+
'uuid-26': {
|
|
582
|
+
clientId: 'uuid-26',
|
|
583
|
+
name: 'core/column',
|
|
584
|
+
},
|
|
585
|
+
'uuid-28': {
|
|
586
|
+
clientId: 'uuid-28',
|
|
587
|
+
name: 'core/column',
|
|
588
|
+
},
|
|
589
|
+
'uuid-30': {
|
|
590
|
+
clientId: 'uuid-30',
|
|
591
|
+
name: 'core/paragraph',
|
|
592
|
+
},
|
|
593
|
+
} )
|
|
594
|
+
),
|
|
595
|
+
attributes: new Map(
|
|
596
|
+
Object.entries( {
|
|
597
|
+
'uuid-2': {},
|
|
598
|
+
'uuid-4': {},
|
|
599
|
+
'uuid-6': {},
|
|
600
|
+
'uuid-8': {},
|
|
601
|
+
'uuid-10': {},
|
|
602
|
+
'uuid-12': {},
|
|
603
|
+
'uuid-14': {},
|
|
604
|
+
'uuid-16': {},
|
|
605
|
+
'uuid-18': {},
|
|
606
|
+
'uuid-20': {},
|
|
607
|
+
'uuid-22': {},
|
|
608
|
+
'uuid-24': {},
|
|
609
|
+
'uuid-26': {},
|
|
610
|
+
'uuid-28': {},
|
|
611
|
+
'uuid-30': {},
|
|
612
|
+
} )
|
|
613
|
+
),
|
|
614
|
+
order: new Map(
|
|
615
|
+
Object.entries( {
|
|
616
|
+
'': [ 'uuid-6', 'uuid-8', 'uuid-10', 'uuid-22' ],
|
|
617
|
+
'uuid-2': [],
|
|
618
|
+
'uuid-4': [],
|
|
619
|
+
'uuid-6': [],
|
|
620
|
+
'uuid-8': [],
|
|
621
|
+
'uuid-10': [ 'uuid-12', 'uuid-14' ],
|
|
622
|
+
'uuid-12': [ 'uuid-16' ],
|
|
623
|
+
'uuid-14': [ 'uuid-18' ],
|
|
624
|
+
'uuid-16': [],
|
|
625
|
+
'uuid-18': [ 'uuid-24' ],
|
|
626
|
+
'uuid-20': [],
|
|
627
|
+
'uuid-22': [],
|
|
628
|
+
'uuid-24': [ 'uuid-26', 'uuid-28' ],
|
|
629
|
+
'uuid-26': [],
|
|
630
|
+
'uuid-28': [ 'uuid-30' ],
|
|
631
|
+
} )
|
|
632
|
+
),
|
|
633
|
+
parents: new Map(
|
|
634
|
+
Object.entries( {
|
|
635
|
+
'uuid-6': '',
|
|
636
|
+
'uuid-8': '',
|
|
637
|
+
'uuid-10': '',
|
|
638
|
+
'uuid-22': '',
|
|
639
|
+
'uuid-12': 'uuid-10',
|
|
640
|
+
'uuid-14': 'uuid-10',
|
|
641
|
+
'uuid-16': 'uuid-12',
|
|
642
|
+
'uuid-18': 'uuid-14',
|
|
643
|
+
'uuid-24': 'uuid-18',
|
|
644
|
+
'uuid-26': 'uuid-24',
|
|
645
|
+
'uuid-28': 'uuid-24',
|
|
646
|
+
'uuid-30': 'uuid-28',
|
|
647
|
+
} )
|
|
648
|
+
),
|
|
649
|
+
controlledInnerBlocks: {},
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
|
|
529
653
|
it( 'should return the ids of any descendants in sequential order, given an array of clientIds', () => {
|
|
530
|
-
const state = {
|
|
531
|
-
blocks: {
|
|
532
|
-
byClientId: new Map(
|
|
533
|
-
Object.entries( {
|
|
534
|
-
'uuid-2': {
|
|
535
|
-
clientId: 'uuid-2',
|
|
536
|
-
name: 'core/image',
|
|
537
|
-
},
|
|
538
|
-
'uuid-4': {
|
|
539
|
-
clientId: 'uuid-4',
|
|
540
|
-
name: 'core/paragraph',
|
|
541
|
-
},
|
|
542
|
-
'uuid-6': {
|
|
543
|
-
clientId: 'uuid-6',
|
|
544
|
-
name: 'core/paragraph',
|
|
545
|
-
},
|
|
546
|
-
'uuid-8': {
|
|
547
|
-
clientId: 'uuid-8',
|
|
548
|
-
name: 'core/block',
|
|
549
|
-
},
|
|
550
|
-
'uuid-10': {
|
|
551
|
-
clientId: 'uuid-10',
|
|
552
|
-
name: 'core/columns',
|
|
553
|
-
},
|
|
554
|
-
'uuid-12': {
|
|
555
|
-
clientId: 'uuid-12',
|
|
556
|
-
name: 'core/column',
|
|
557
|
-
},
|
|
558
|
-
'uuid-14': {
|
|
559
|
-
clientId: 'uuid-14',
|
|
560
|
-
name: 'core/column',
|
|
561
|
-
},
|
|
562
|
-
'uuid-16': {
|
|
563
|
-
clientId: 'uuid-16',
|
|
564
|
-
name: 'core/quote',
|
|
565
|
-
},
|
|
566
|
-
'uuid-18': {
|
|
567
|
-
clientId: 'uuid-18',
|
|
568
|
-
name: 'core/block',
|
|
569
|
-
},
|
|
570
|
-
'uuid-20': {
|
|
571
|
-
clientId: 'uuid-20',
|
|
572
|
-
name: 'core/gallery',
|
|
573
|
-
},
|
|
574
|
-
'uuid-22': {
|
|
575
|
-
clientId: 'uuid-22',
|
|
576
|
-
name: 'core/block',
|
|
577
|
-
},
|
|
578
|
-
'uuid-24': {
|
|
579
|
-
clientId: 'uuid-24',
|
|
580
|
-
name: 'core/columns',
|
|
581
|
-
},
|
|
582
|
-
'uuid-26': {
|
|
583
|
-
clientId: 'uuid-26',
|
|
584
|
-
name: 'core/column',
|
|
585
|
-
},
|
|
586
|
-
'uuid-28': {
|
|
587
|
-
clientId: 'uuid-28',
|
|
588
|
-
name: 'core/column',
|
|
589
|
-
},
|
|
590
|
-
'uuid-30': {
|
|
591
|
-
clientId: 'uuid-30',
|
|
592
|
-
name: 'core/paragraph',
|
|
593
|
-
},
|
|
594
|
-
} )
|
|
595
|
-
),
|
|
596
|
-
attributes: new Map(
|
|
597
|
-
Object.entries( {
|
|
598
|
-
'uuid-2': {},
|
|
599
|
-
'uuid-4': {},
|
|
600
|
-
'uuid-6': {},
|
|
601
|
-
'uuid-8': {},
|
|
602
|
-
'uuid-10': {},
|
|
603
|
-
'uuid-12': {},
|
|
604
|
-
'uuid-14': {},
|
|
605
|
-
'uuid-16': {},
|
|
606
|
-
'uuid-18': {},
|
|
607
|
-
'uuid-20': {},
|
|
608
|
-
'uuid-22': {},
|
|
609
|
-
'uuid-24': {},
|
|
610
|
-
'uuid-26': {},
|
|
611
|
-
'uuid-28': {},
|
|
612
|
-
'uuid-30': {},
|
|
613
|
-
} )
|
|
614
|
-
),
|
|
615
|
-
order: new Map(
|
|
616
|
-
Object.entries( {
|
|
617
|
-
'': [ 'uuid-6', 'uuid-8', 'uuid-10', 'uuid-22' ],
|
|
618
|
-
'uuid-2': [],
|
|
619
|
-
'uuid-4': [],
|
|
620
|
-
'uuid-6': [],
|
|
621
|
-
'uuid-8': [],
|
|
622
|
-
'uuid-10': [ 'uuid-12', 'uuid-14' ],
|
|
623
|
-
'uuid-12': [ 'uuid-16' ],
|
|
624
|
-
'uuid-14': [ 'uuid-18' ],
|
|
625
|
-
'uuid-16': [],
|
|
626
|
-
'uuid-18': [ 'uuid-24' ],
|
|
627
|
-
'uuid-20': [],
|
|
628
|
-
'uuid-22': [],
|
|
629
|
-
'uuid-24': [ 'uuid-26', 'uuid-28' ],
|
|
630
|
-
'uuid-26': [],
|
|
631
|
-
'uuid-28': [ 'uuid-30' ],
|
|
632
|
-
} )
|
|
633
|
-
),
|
|
634
|
-
parents: new Map(
|
|
635
|
-
Object.entries( {
|
|
636
|
-
'uuid-6': '',
|
|
637
|
-
'uuid-8': '',
|
|
638
|
-
'uuid-10': '',
|
|
639
|
-
'uuid-22': '',
|
|
640
|
-
'uuid-12': 'uuid-10',
|
|
641
|
-
'uuid-14': 'uuid-10',
|
|
642
|
-
'uuid-16': 'uuid-12',
|
|
643
|
-
'uuid-18': 'uuid-14',
|
|
644
|
-
'uuid-24': 'uuid-18',
|
|
645
|
-
'uuid-26': 'uuid-24',
|
|
646
|
-
'uuid-28': 'uuid-24',
|
|
647
|
-
'uuid-30': 'uuid-28',
|
|
648
|
-
} )
|
|
649
|
-
),
|
|
650
|
-
controlledInnerBlocks: {},
|
|
651
|
-
},
|
|
652
|
-
};
|
|
653
654
|
expect( getClientIdsOfDescendants( state, [ 'uuid-10' ] ) ).toEqual(
|
|
654
655
|
[
|
|
655
656
|
'uuid-12',
|
|
@@ -663,6 +664,12 @@ describe( 'selectors', () => {
|
|
|
663
664
|
]
|
|
664
665
|
);
|
|
665
666
|
} );
|
|
667
|
+
|
|
668
|
+
it( 'should return same value when called with same state and argument', () => {
|
|
669
|
+
expect( getClientIdsOfDescendants( state, 'uuid-10' ) ).toBe(
|
|
670
|
+
getClientIdsOfDescendants( state, 'uuid-10' )
|
|
671
|
+
);
|
|
672
|
+
} );
|
|
666
673
|
} );
|
|
667
674
|
|
|
668
675
|
describe( 'getClientIdsWithDescendants', () => {
|
package/src/store/utils.js
CHANGED
|
@@ -6,14 +6,7 @@
|
|
|
6
6
|
* @return {Object} The mapped object.
|
|
7
7
|
*/
|
|
8
8
|
export function mapRichTextSettings( attributeDefinition ) {
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__unstablePreserveWhiteSpace: preserveWhiteSpace,
|
|
13
|
-
} = attributeDefinition;
|
|
14
|
-
return {
|
|
15
|
-
multilineTag,
|
|
16
|
-
multilineWrapperTags,
|
|
17
|
-
preserveWhiteSpace,
|
|
18
|
-
};
|
|
9
|
+
const { __unstablePreserveWhiteSpace: preserveWhiteSpace } =
|
|
10
|
+
attributeDefinition;
|
|
11
|
+
return { preserveWhiteSpace };
|
|
19
12
|
}
|
package/src/style.scss
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@import "./components/block-navigation/style.scss";
|
|
13
13
|
@import "./components/block-parent-selector/style.scss";
|
|
14
14
|
@import "./components/block-patterns-list/style.scss";
|
|
15
|
+
@import "./components/block-patterns-paging/style.scss";
|
|
15
16
|
@import "./components/block-popover/style.scss";
|
|
16
17
|
@import "./components/block-preview/style.scss";
|
|
17
18
|
@import "./components/block-settings-menu/style.scss";
|
|
@@ -46,6 +47,8 @@
|
|
|
46
47
|
@import "./components/url-input/style.scss";
|
|
47
48
|
@import "./components/url-popover/style.scss";
|
|
48
49
|
@import "./hooks/anchor.scss";
|
|
50
|
+
@import "./hooks/block-hooks.scss";
|
|
51
|
+
@import "./hooks/background.scss";
|
|
49
52
|
@import "./hooks/border.scss";
|
|
50
53
|
@import "./hooks/color.scss";
|
|
51
54
|
@import "./hooks/dimensions.scss";
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
@import "./hooks/padding.scss";
|
|
54
57
|
@import "./hooks/position.scss";
|
|
55
58
|
@import "./hooks/typography.scss";
|
|
59
|
+
@import "./hooks/block-rename-ui.scss";
|
|
56
60
|
|
|
57
61
|
@import "./components/block-toolbar/style.scss";
|
|
58
62
|
@import "./components/inserter/style.scss";
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DuotoneFilter = DuotoneFilter;
|
|
7
|
-
exports.DuotoneStylesheet = DuotoneStylesheet;
|
|
8
|
-
exports.DuotoneUnsetStylesheet = DuotoneUnsetStylesheet;
|
|
9
|
-
exports.PresetDuotoneFilter = PresetDuotoneFilter;
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _components = require("@wordpress/components");
|
|
12
|
-
var _index = require("./index");
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* SVG and stylesheet needed for rendering the duotone filter.
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} props Duotone props.
|
|
25
|
-
* @param {string} props.selector Selector to apply the filter to.
|
|
26
|
-
* @param {string} props.id Unique id for this duotone filter.
|
|
27
|
-
*
|
|
28
|
-
* @return {WPElement} Duotone element.
|
|
29
|
-
*/
|
|
30
|
-
function DuotoneStylesheet({
|
|
31
|
-
selector,
|
|
32
|
-
id
|
|
33
|
-
}) {
|
|
34
|
-
const css = `
|
|
35
|
-
${selector} {
|
|
36
|
-
filter: url( #${id} );
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
return (0, _element.createElement)("style", null, css);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Stylesheet for disabling a global styles duotone filter.
|
|
44
|
-
*
|
|
45
|
-
* @param {Object} props Duotone props.
|
|
46
|
-
* @param {string} props.selector Selector to disable the filter for.
|
|
47
|
-
*
|
|
48
|
-
* @return {WPElement} Filter none style element.
|
|
49
|
-
*/
|
|
50
|
-
function DuotoneUnsetStylesheet({
|
|
51
|
-
selector
|
|
52
|
-
}) {
|
|
53
|
-
const css = `
|
|
54
|
-
${selector} {
|
|
55
|
-
filter: none;
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
return (0, _element.createElement)("style", null, css);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* The SVG part of the duotone filter.
|
|
63
|
-
*
|
|
64
|
-
* @param {Object} props Duotone props.
|
|
65
|
-
* @param {string} props.id Unique id for this duotone filter.
|
|
66
|
-
* @param {string[]} props.colors Color strings from dark to light.
|
|
67
|
-
*
|
|
68
|
-
* @return {WPElement} Duotone SVG.
|
|
69
|
-
*/
|
|
70
|
-
function DuotoneFilter({
|
|
71
|
-
id,
|
|
72
|
-
colors
|
|
73
|
-
}) {
|
|
74
|
-
const values = (0, _index.__unstableGetValuesFromColors)(colors);
|
|
75
|
-
return (0, _element.createElement)(_components.SVG, {
|
|
76
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
77
|
-
viewBox: "0 0 0 0",
|
|
78
|
-
width: "0",
|
|
79
|
-
height: "0",
|
|
80
|
-
focusable: "false",
|
|
81
|
-
role: "none",
|
|
82
|
-
style: {
|
|
83
|
-
visibility: 'hidden',
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
left: '-9999px',
|
|
86
|
-
overflow: 'hidden'
|
|
87
|
-
}
|
|
88
|
-
}, (0, _element.createElement)("defs", null, (0, _element.createElement)("filter", {
|
|
89
|
-
id: id
|
|
90
|
-
}, (0, _element.createElement)("feColorMatrix", {
|
|
91
|
-
// Use sRGB instead of linearRGB so transparency looks correct.
|
|
92
|
-
colorInterpolationFilters: "sRGB",
|
|
93
|
-
type: "matrix"
|
|
94
|
-
// Use perceptual brightness to convert to grayscale.
|
|
95
|
-
,
|
|
96
|
-
values: " .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "
|
|
97
|
-
}), (0, _element.createElement)("feComponentTransfer", {
|
|
98
|
-
// Use sRGB instead of linearRGB to be consistent with how CSS gradients work.
|
|
99
|
-
colorInterpolationFilters: "sRGB"
|
|
100
|
-
}, (0, _element.createElement)("feFuncR", {
|
|
101
|
-
type: "table",
|
|
102
|
-
tableValues: values.r.join(' ')
|
|
103
|
-
}), (0, _element.createElement)("feFuncG", {
|
|
104
|
-
type: "table",
|
|
105
|
-
tableValues: values.g.join(' ')
|
|
106
|
-
}), (0, _element.createElement)("feFuncB", {
|
|
107
|
-
type: "table",
|
|
108
|
-
tableValues: values.b.join(' ')
|
|
109
|
-
}), (0, _element.createElement)("feFuncA", {
|
|
110
|
-
type: "table",
|
|
111
|
-
tableValues: values.a.join(' ')
|
|
112
|
-
})), (0, _element.createElement)("feComposite", {
|
|
113
|
-
// Re-mask the image with the original transparency since the feColorMatrix above loses that information.
|
|
114
|
-
in2: "SourceGraphic",
|
|
115
|
-
operator: "in"
|
|
116
|
-
}))));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* SVG from a duotone preset
|
|
121
|
-
*
|
|
122
|
-
* @param {Object} props Duotone props.
|
|
123
|
-
* @param {Object} props.preset Duotone preset settings.
|
|
124
|
-
*
|
|
125
|
-
* @return {WPElement} Duotone element.
|
|
126
|
-
*/
|
|
127
|
-
function PresetDuotoneFilter({
|
|
128
|
-
preset
|
|
129
|
-
}) {
|
|
130
|
-
return (0, _element.createElement)(DuotoneFilter, {
|
|
131
|
-
id: `wp-duotone-${preset.slug}`,
|
|
132
|
-
colors: preset.colors
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=components.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_index","DuotoneStylesheet","selector","id","css","_element","createElement","DuotoneUnsetStylesheet","DuotoneFilter","colors","values","getValuesFromColors","SVG","xmlnsXlink","viewBox","width","height","focusable","role","style","visibility","position","left","overflow","colorInterpolationFilters","type","tableValues","r","join","g","b","a","in2","operator","PresetDuotoneFilter","preset","slug"],"sources":["@wordpress/block-editor/src/components/duotone/components.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { __unstableGetValuesFromColors as getValuesFromColors } from './index';\n\n/**\n * SVG and stylesheet needed for rendering the duotone filter.\n *\n * @param {Object} props Duotone props.\n * @param {string} props.selector Selector to apply the filter to.\n * @param {string} props.id Unique id for this duotone filter.\n *\n * @return {WPElement} Duotone element.\n */\nexport function DuotoneStylesheet( { selector, id } ) {\n\tconst css = `\n${ selector } {\n\tfilter: url( #${ id } );\n}\n`;\n\treturn <style>{ css }</style>;\n}\n\n/**\n * Stylesheet for disabling a global styles duotone filter.\n *\n * @param {Object} props Duotone props.\n * @param {string} props.selector Selector to disable the filter for.\n *\n * @return {WPElement} Filter none style element.\n */\nexport function DuotoneUnsetStylesheet( { selector } ) {\n\tconst css = `\n${ selector } {\n\tfilter: none;\n}\n`;\n\treturn <style>{ css }</style>;\n}\n\n/**\n * The SVG part of the duotone filter.\n *\n * @param {Object} props Duotone props.\n * @param {string} props.id Unique id for this duotone filter.\n * @param {string[]} props.colors Color strings from dark to light.\n *\n * @return {WPElement} Duotone SVG.\n */\nexport function DuotoneFilter( { id, colors } ) {\n\tconst values = getValuesFromColors( colors );\n\treturn (\n\t\t<SVG\n\t\t\txmlnsXlink=\"http://www.w3.org/1999/xlink\"\n\t\t\tviewBox=\"0 0 0 0\"\n\t\t\twidth=\"0\"\n\t\t\theight=\"0\"\n\t\t\tfocusable=\"false\"\n\t\t\trole=\"none\"\n\t\t\tstyle={ {\n\t\t\t\tvisibility: 'hidden',\n\t\t\t\tposition: 'absolute',\n\t\t\t\tleft: '-9999px',\n\t\t\t\toverflow: 'hidden',\n\t\t\t} }\n\t\t>\n\t\t\t<defs>\n\t\t\t\t<filter id={ id }>\n\t\t\t\t\t<feColorMatrix\n\t\t\t\t\t\t// Use sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\t\t\tcolorInterpolationFilters=\"sRGB\"\n\t\t\t\t\t\ttype=\"matrix\"\n\t\t\t\t\t\t// Use perceptual brightness to convert to grayscale.\n\t\t\t\t\t\tvalues=\"\n\t\t\t\t\t\t\t.299 .587 .114 0 0\n\t\t\t\t\t\t\t.299 .587 .114 0 0\n\t\t\t\t\t\t\t.299 .587 .114 0 0\n\t\t\t\t\t\t\t.299 .587 .114 0 0\n\t\t\t\t\t\t\"\n\t\t\t\t\t/>\n\t\t\t\t\t<feComponentTransfer\n\t\t\t\t\t\t// Use sRGB instead of linearRGB to be consistent with how CSS gradients work.\n\t\t\t\t\t\tcolorInterpolationFilters=\"sRGB\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<feFuncR\n\t\t\t\t\t\t\ttype=\"table\"\n\t\t\t\t\t\t\ttableValues={ values.r.join( ' ' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<feFuncG\n\t\t\t\t\t\t\ttype=\"table\"\n\t\t\t\t\t\t\ttableValues={ values.g.join( ' ' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<feFuncB\n\t\t\t\t\t\t\ttype=\"table\"\n\t\t\t\t\t\t\ttableValues={ values.b.join( ' ' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<feFuncA\n\t\t\t\t\t\t\ttype=\"table\"\n\t\t\t\t\t\t\ttableValues={ values.a.join( ' ' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</feComponentTransfer>\n\t\t\t\t\t<feComposite\n\t\t\t\t\t\t// Re-mask the image with the original transparency since the feColorMatrix above loses that information.\n\t\t\t\t\t\tin2=\"SourceGraphic\"\n\t\t\t\t\t\toperator=\"in\"\n\t\t\t\t\t/>\n\t\t\t\t</filter>\n\t\t\t</defs>\n\t\t</SVG>\n\t);\n}\n\n/**\n * SVG from a duotone preset\n *\n * @param {Object} props Duotone props.\n * @param {Object} props.preset Duotone preset settings.\n *\n * @return {WPElement} Duotone element.\n */\nexport function PresetDuotoneFilter( { preset } ) {\n\treturn (\n\t\t<DuotoneFilter\n\t\t\tid={ `wp-duotone-${ preset.slug }` }\n\t\t\tcolors={ preset.colors }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAG,CAAC,EAAG;EACrD,MAAMC,GAAG,GAAI;AACd,EAAGF,QAAU;AACb,iBAAkBC,EAAI;AACtB;AACA,CAAC;EACA,OAAO,IAAAE,QAAA,CAAAC,aAAA,iBAASF,GAAY,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,sBAAsBA,CAAE;EAAEL;AAAS,CAAC,EAAG;EACtD,MAAME,GAAG,GAAI;AACd,EAAGF,QAAU;AACb;AACA;AACA,CAAC;EACA,OAAO,IAAAG,QAAA,CAAAC,aAAA,iBAASF,GAAY,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,aAAaA,CAAE;EAAEL,EAAE;EAAEM;AA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I,CAAE,GAAI;EAAG,CACpC,CACmB,CAAC,EACtB,IAAAvB,QAAA,CAAAC,aAAA;IACC;IACA0B,GAAG,EAAC,eAAe;IACnBC,QAAQ,EAAC;EAAI,CACb,CACM,CACH,CACF,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAE;EAAEC;AAAO,CAAC,EAAG;EACjD,OACC,IAAA9B,QAAA,CAAAC,aAAA,EAACE,aAAa;IACbL,EAAE,EAAI,cAAcgC,MAAM,CAACC,IAAM,EAAG;IACpC3B,MAAM,EAAG0B,MAAM,CAAC1B;EAAQ,CACxB,CAAC;AAEJ"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "__unstableDuotoneFilter", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _components.DuotoneFilter;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "__unstableDuotoneStylesheet", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _components.DuotoneStylesheet;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "__unstableDuotoneUnsetStylesheet", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _components.DuotoneUnsetStylesheet;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "__unstableGetValuesFromColors", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _utils.getValuesFromColors;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "__unstablePresetDuotoneFilter", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _components.PresetDuotoneFilter;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var _utils = require("./utils");
|
|
37
|
-
var _components = require("./components");
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","_components"],"sources":["@wordpress/block-editor/src/components/duotone/index.js"],"sourcesContent":["export { getValuesFromColors as __unstableGetValuesFromColors } from './utils';\nexport {\n\tDuotoneFilter as __unstableDuotoneFilter,\n\tPresetDuotoneFilter as __unstablePresetDuotoneFilter,\n\tDuotoneStylesheet as __unstableDuotoneStylesheet,\n\tDuotoneUnsetStylesheet as __unstableDuotoneUnsetStylesheet,\n} from './components';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = _default;
|
|
7
|
-
var _element = require("@wordpress/element");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
function _default({
|
|
15
|
-
onChange,
|
|
16
|
-
value,
|
|
17
|
-
behaviors
|
|
18
|
-
}) {
|
|
19
|
-
const defaultBehaviors = {
|
|
20
|
-
default: {
|
|
21
|
-
value: 'default',
|
|
22
|
-
label: (0, _i18n.__)('Default')
|
|
23
|
-
},
|
|
24
|
-
noBehaviors: {
|
|
25
|
-
value: '',
|
|
26
|
-
label: (0, _i18n.__)('No behaviors')
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const behaviorsOptions = Object.entries(behaviors).map(([behaviorName]) => ({
|
|
30
|
-
value: behaviorName,
|
|
31
|
-
// Capitalize the first letter of the behavior name.
|
|
32
|
-
label: `${behaviorName.charAt(0).toUpperCase()}${behaviorName.slice(1).toLowerCase()}`
|
|
33
|
-
}));
|
|
34
|
-
const options = [...Object.values(defaultBehaviors), ...behaviorsOptions];
|
|
35
|
-
const animations = [{
|
|
36
|
-
value: 'zoom',
|
|
37
|
-
label: (0, _i18n.__)('Zoom')
|
|
38
|
-
}, {
|
|
39
|
-
value: 'fade',
|
|
40
|
-
label: (0, _i18n.__)('Fade')
|
|
41
|
-
}];
|
|
42
|
-
return (0, _element.createElement)("div", {
|
|
43
|
-
style: {
|
|
44
|
-
marginTop: '2rem'
|
|
45
|
-
}
|
|
46
|
-
}, (0, _element.createElement)(_components.SelectControl, {
|
|
47
|
-
label: (0, _i18n.__)('Behaviors')
|
|
48
|
-
// At the moment we are only supporting one behavior (Lightbox)
|
|
49
|
-
,
|
|
50
|
-
value: value,
|
|
51
|
-
options: options,
|
|
52
|
-
onChange: onChange,
|
|
53
|
-
hideCancelButton: true,
|
|
54
|
-
size: "__unstable-large"
|
|
55
|
-
}), value === 'lightbox' && (0, _element.createElement)(_components.SelectControl, {
|
|
56
|
-
label: (0, _i18n.__)('Animation'),
|
|
57
|
-
value: behaviors?.lightbox.animation ? behaviors?.lightbox.animation : '',
|
|
58
|
-
options: animations,
|
|
59
|
-
onChange: onChange,
|
|
60
|
-
hideCancelButton: false,
|
|
61
|
-
size: "__unstable-large"
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=behaviors-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_default","onChange","value","behaviors","defaultBehaviors","default","label","__","noBehaviors","behaviorsOptions","Object","entries","map","behaviorName","charAt","toUpperCase","slice","toLowerCase","options","values","animations","_element","createElement","style","marginTop","SelectControl","hideCancelButton","size","lightbox","animation"],"sources":["@wordpress/block-editor/src/components/global-styles/behaviors-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ( { onChange, value, behaviors } ) {\n\tconst defaultBehaviors = {\n\t\tdefault: {\n\t\t\tvalue: 'default',\n\t\t\tlabel: __( 'Default' ),\n\t\t},\n\t\tnoBehaviors: {\n\t\t\tvalue: '',\n\t\t\tlabel: __( 'No behaviors' ),\n\t\t},\n\t};\n\n\tconst behaviorsOptions = Object.entries( behaviors ).map(\n\t\t( [ behaviorName ] ) => ( {\n\t\t\tvalue: behaviorName,\n\t\t\t// Capitalize the first letter of the behavior name.\n\t\t\tlabel: `${ behaviorName.charAt( 0 ).toUpperCase() }${ behaviorName\n\t\t\t\t.slice( 1 )\n\t\t\t\t.toLowerCase() }`,\n\t\t} )\n\t);\n\n\tconst options = [\n\t\t...Object.values( defaultBehaviors ),\n\t\t...behaviorsOptions,\n\t];\n\n\tconst animations = [\n\t\t{\n\t\t\tvalue: 'zoom',\n\t\t\tlabel: __( 'Zoom' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'fade',\n\t\t\tlabel: __( 'Fade' ),\n\t\t},\n\t];\n\treturn (\n\t\t<div style={ { marginTop: '2rem' } }>\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'Behaviors' ) }\n\t\t\t\t// At the moment we are only supporting one behavior (Lightbox)\n\t\t\t\tvalue={ value }\n\t\t\t\toptions={ options }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideCancelButton={ true }\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t/>\n\t\t\t{ value === 'lightbox' && (\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'Animation' ) }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tbehaviors?.lightbox.animation\n\t\t\t\t\t\t\t? behaviors?.lightbox.animation\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t}\n\t\t\t\t\toptions={ animations }\n\t\t\t\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,GACnC,IAAAH,QAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA4B,aAAa;IACbnB,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY;IACxB;IAAA;IACAL,KAAK,EAAGA,KAAO;IACfgB,OAAO,EAAGA,OAAS;IACnBjB,QAAQ,EAAGA,QAAU;IACrByB,gBAAgB,EAAG,IAAM;IACzBC,IAAI,EAAC;EAAkB,CACvB,CAAC,EACAzB,KAAK,KAAK,UAAU,IACrB,IAAAmB,QAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA4B,aAAa;IACbnB,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BL,KAAK,EACJC,SAAS,EAAEyB,QAAQ,CAACC,SAAS,GAC1B1B,SAAS,EAAEyB,QAAQ,CAACC,SAAS,GAC7B,EACH;IACDX,OAAO,EAAGE,UAAY;IACtBnB,QAAQ,EAAGA,QAAU;IACrByB,gBAAgB,EAAG,KAAO;IAC1BC,IAAI,EAAC;EAAkB,CACvB,CAEE,CAAC;AAER"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ReusableBlocksTab = ReusableBlocksTab;
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _url = require("@wordpress/url");
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
var _blockTypesList = _interopRequireDefault(require("../block-types-list"));
|
|
14
|
-
var _panel = _interopRequireDefault(require("./panel"));
|
|
15
|
-
var _noResults = _interopRequireDefault(require("./no-results"));
|
|
16
|
-
var _useBlockTypesState = _interopRequireDefault(require("./hooks/use-block-types-state"));
|
|
17
|
-
var _reusableBlockRenameHint = _interopRequireDefault(require("./reusable-block-rename-hint"));
|
|
18
|
-
/**
|
|
19
|
-
* WordPress dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
function ReusableBlocksList({
|
|
27
|
-
onHover,
|
|
28
|
-
onInsert,
|
|
29
|
-
rootClientId
|
|
30
|
-
}) {
|
|
31
|
-
const [items,,, onSelectItem] = (0, _useBlockTypesState.default)(rootClientId, onInsert);
|
|
32
|
-
const filteredItems = (0, _element.useMemo)(() => {
|
|
33
|
-
return items.filter(({
|
|
34
|
-
category,
|
|
35
|
-
syncStatus
|
|
36
|
-
}) => category === 'reusable' && syncStatus !== 'unsynced');
|
|
37
|
-
}, [items]);
|
|
38
|
-
if (filteredItems.length === 0) {
|
|
39
|
-
return (0, _element.createElement)(_noResults.default, null);
|
|
40
|
-
}
|
|
41
|
-
return (0, _element.createElement)(_panel.default, {
|
|
42
|
-
title: (0, _i18n.__)('Synced patterns')
|
|
43
|
-
}, (0, _element.createElement)(_blockTypesList.default, {
|
|
44
|
-
items: filteredItems,
|
|
45
|
-
onSelect: onSelectItem,
|
|
46
|
-
onHover: onHover,
|
|
47
|
-
label: (0, _i18n.__)('Synced patterns')
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// The unwrapped component is only exported for use by unit tests.
|
|
52
|
-
/**
|
|
53
|
-
* List of reusable blocks shown in the "Reusable" tab of the inserter.
|
|
54
|
-
*
|
|
55
|
-
* @param {Object} props Component props.
|
|
56
|
-
* @param {?string} props.rootClientId Client id of block to insert into.
|
|
57
|
-
* @param {Function} props.onInsert Callback to run when item is inserted.
|
|
58
|
-
* @param {Function} props.onHover Callback to run when item is hovered.
|
|
59
|
-
*
|
|
60
|
-
* @return {WPComponent} The component.
|
|
61
|
-
*/
|
|
62
|
-
function ReusableBlocksTab({
|
|
63
|
-
rootClientId,
|
|
64
|
-
onInsert,
|
|
65
|
-
onHover
|
|
66
|
-
}) {
|
|
67
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
|
|
68
|
-
className: "block-editor-inserter__hint"
|
|
69
|
-
}, (0, _element.createElement)(_reusableBlockRenameHint.default, null)), (0, _element.createElement)(ReusableBlocksList, {
|
|
70
|
-
onHover: onHover,
|
|
71
|
-
onInsert: onInsert,
|
|
72
|
-
rootClientId: rootClientId
|
|
73
|
-
}), (0, _element.createElement)("div", {
|
|
74
|
-
className: "block-editor-inserter__manage-reusable-blocks-container"
|
|
75
|
-
}, (0, _element.createElement)(_components.Button, {
|
|
76
|
-
className: "block-editor-inserter__manage-reusable-blocks",
|
|
77
|
-
variant: "secondary",
|
|
78
|
-
href: (0, _url.addQueryArgs)('edit.php', {
|
|
79
|
-
post_type: 'wp_block'
|
|
80
|
-
})
|
|
81
|
-
}, (0, _i18n.__)('Manage my patterns'))));
|
|
82
|
-
}
|
|
83
|
-
var _default = ReusableBlocksTab;
|
|
84
|
-
exports.default = _default;
|
|
85
|
-
//# sourceMappingURL=reusable-blocks-tab.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_url","_components","_blockTypesList","_interopRequireDefault","_panel","_noResults","_useBlockTypesState","_reusableBlockRenameHint","ReusableBlocksList","onHover","onInsert","rootClientId","items","onSelectItem","useBlockTypesState","filteredItems","useMemo","filter","category","syncStatus","length","createElement","default","title","__","onSelect","label","ReusableBlocksTab","Fragment","className","Button","variant","href","addQueryArgs","post_type","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter/reusable-blocks-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport InserterNoResults from './no-results';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport ReusableBlocksRenameHint from './reusable-block-rename-hint';\n\nfunction ReusableBlocksList( { onHover, onInsert, rootClientId } ) {\n\tconst [ items, , , onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tconst filteredItems = useMemo( () => {\n\t\treturn items.filter(\n\t\t\t( { category, syncStatus } ) =>\n\t\t\t\tcategory === 'reusable' && syncStatus !== 'unsynced'\n\t\t);\n\t}, [ items ] );\n\n\tif ( filteredItems.length === 0 ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\treturn (\n\t\t<InserterPanel title={ __( 'Synced patterns' ) }>\n\t\t\t<BlockTypesList\n\t\t\t\titems={ filteredItems }\n\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tlabel={ __( 'Synced patterns' ) }\n\t\t\t/>\n\t\t</InserterPanel>\n\t);\n}\n\n// The unwrapped component is only exported for use by unit tests.\n/**\n * List of reusable blocks shown in the \"Reusable\" tab of the inserter.\n *\n * @param {Object} props Component props.\n * @param {?string} props.rootClientId Client id of block to insert into.\n * @param {Function} props.onInsert Callback to run when item is inserted.\n * @param {Function} props.onHover Callback to run when item is hovered.\n *\n * @return {WPComponent} The component.\n */\nexport function ReusableBlocksTab( { rootClientId, onInsert, onHover } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__hint\">\n\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t</div>\n\t\t\t<ReusableBlocksList\n\t\t\t\tonHover={ onHover }\n\t\t\t\tonInsert={ onInsert }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t/>\n\t\t\t<div className=\"block-editor-inserter__manage-reusable-blocks-container\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"block-editor-inserter__manage-reusable-blocks\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type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