@wordpress/edit-post 7.31.0 → 7.33.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 +4 -0
- package/README.md +9 -323
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -1
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -38
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +5 -5
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -1
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +7 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +11 -13
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +12 -4
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -36
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +4 -7
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +16 -21
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -21
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +9 -9
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +42 -40
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -1
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +62 -0
- package/build/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +9 -4
- package/build/editor.js.map +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +7 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +36 -19
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +7 -12
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -4
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +46 -31
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +1 -15
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +44 -24
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -2
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -38
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +4 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +5 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +11 -3
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -36
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +4 -5
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +15 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -20
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +9 -10
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +55 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +9 -4
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +9 -26
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +8 -8
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -4
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +38 -22
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -13
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +42 -21
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/style-rtl.css +12 -454
- package/build-style/style.css +12 -454
- package/package.json +32 -34
- package/src/classic.scss +2 -1
- package/src/components/editor-initialization/index.js +1 -5
- package/src/components/editor-initialization/listener-hooks.js +1 -40
- package/src/components/editor-initialization/test/listener-hooks.js +1 -96
- package/src/components/header/index.js +3 -4
- package/src/components/header/index.native.js +1 -1
- package/src/components/header/more-menu/index.js +3 -4
- package/src/components/header/post-publish-button-or-toggle.js +10 -11
- package/src/components/header/preferences-menu-item/index.js +9 -3
- package/src/components/header/style.scss +5 -3
- package/src/components/header/test/index.js +13 -1
- package/src/components/keyboard-shortcuts/index.js +3 -44
- package/src/components/layout/actions-panel.js +5 -4
- package/src/components/layout/index.js +20 -42
- package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
- package/src/components/preferences-modal/index.js +1 -24
- package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
- package/src/components/sidebar/post-status/index.js +6 -9
- package/src/components/sidebar/settings-sidebar/index.js +64 -56
- package/src/components/visual-editor/block-inspector-button.js +1 -1
- package/src/components/visual-editor/index.js +4 -0
- package/src/components/visual-editor/use-padding-appender.js +66 -0
- package/src/editor.js +14 -4
- package/src/hooks/commands/use-common-commands.js +13 -28
- package/src/hooks/use-navigate-to-entity-record.js +37 -24
- package/src/index.js +11 -6
- package/src/index.native.js +1 -4
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
- package/src/store/actions.js +37 -24
- package/src/store/reducer.js +0 -13
- package/src/store/selectors.js +52 -36
- package/src/store/test/actions.js +11 -10
- package/src/style.scss +1 -20
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build/components/header/plugin-more-menu-item/index.js +0 -78
- package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
- package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -104
- package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar/template-summary/index.js +0 -36
- package/build/components/sidebar/template-summary/index.js.map +0 -1
- package/build/components/start-page-options/index.js +0 -107
- package/build/components/start-page-options/index.js.map +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar/template-summary/index.js +0 -29
- package/build-module/components/sidebar/template-summary/index.js.map +0 -1
- package/build-module/components/start-page-options/index.js +0 -100
- package/build-module/components/start-page-options/index.js.map +0 -1
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
- package/src/components/header/plugin-more-menu-item/index.js +0 -73
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
- package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
- package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
- package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
- package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-sidebar/index.js +0 -94
- package/src/components/sidebar/template-summary/index.js +0 -37
- package/src/components/sidebar/template-summary/style.scss +0 -5
- package/src/components/start-page-options/index.js +0 -108
- package/src/components/start-page-options/style.scss +0 -26
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -41,61 +41,7 @@ _Parameters_
|
|
|
41
41
|
|
|
42
42
|
### PluginBlockSettingsMenuItem
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_Usage_
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
// Using ES5 syntax
|
|
50
|
-
var __ = wp.i18n.__;
|
|
51
|
-
var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;
|
|
52
|
-
|
|
53
|
-
function doOnClick() {
|
|
54
|
-
// To be called when the user clicks the menu item.
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function MyPluginBlockSettingsMenuItem() {
|
|
58
|
-
return React.createElement( PluginBlockSettingsMenuItem, {
|
|
59
|
-
allowedBlocks: [ 'core/paragraph' ],
|
|
60
|
-
icon: 'dashicon-name',
|
|
61
|
-
label: __( 'Menu item text' ),
|
|
62
|
-
onClick: doOnClick,
|
|
63
|
-
} );
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```jsx
|
|
68
|
-
// Using ESNext syntax
|
|
69
|
-
import { __ } from '@wordpress/i18n';
|
|
70
|
-
import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';
|
|
71
|
-
|
|
72
|
-
const doOnClick = () => {
|
|
73
|
-
// To be called when the user clicks the menu item.
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const MyPluginBlockSettingsMenuItem = () => (
|
|
77
|
-
<PluginBlockSettingsMenuItem
|
|
78
|
-
allowedBlocks={ [ 'core/paragraph' ] }
|
|
79
|
-
icon="dashicon-name"
|
|
80
|
-
label={ __( 'Menu item text' ) }
|
|
81
|
-
onClick={ doOnClick }
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
_Parameters_
|
|
87
|
-
|
|
88
|
-
- _props_ `Object`: Component props.
|
|
89
|
-
- _props.allowedBlocks_ `[Array]`: An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.
|
|
90
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
|
|
91
|
-
- _props.label_ `string`: The menu item text.
|
|
92
|
-
- _props.onClick_ `Function`: Callback function to be executed when the user click the menu item.
|
|
93
|
-
- _props.small_ `[boolean]`: Whether to render the label or not.
|
|
94
|
-
- _props.role_ `[string]`: The ARIA role for the menu item.
|
|
95
|
-
|
|
96
|
-
_Returns_
|
|
97
|
-
|
|
98
|
-
- `Component`: The component to be rendered.
|
|
44
|
+
Undocumented declaration.
|
|
99
45
|
|
|
100
46
|
### PluginDocumentSettingPanel
|
|
101
47
|
|
|
@@ -103,100 +49,13 @@ Undocumented declaration.
|
|
|
103
49
|
|
|
104
50
|
### PluginMoreMenuItem
|
|
105
51
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
_Usage_
|
|
109
|
-
|
|
110
|
-
```js
|
|
111
|
-
// Using ES5 syntax
|
|
112
|
-
var __ = wp.i18n.__;
|
|
113
|
-
var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
|
|
114
|
-
var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
115
|
-
|
|
116
|
-
function onButtonClick() {
|
|
117
|
-
alert( 'Button clicked.' );
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function MyButtonMoreMenuItem() {
|
|
121
|
-
return React.createElement(
|
|
122
|
-
PluginMoreMenuItem,
|
|
123
|
-
{
|
|
124
|
-
icon: moreIcon,
|
|
125
|
-
onClick: onButtonClick,
|
|
126
|
-
},
|
|
127
|
-
__( 'My button title' )
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
```jsx
|
|
133
|
-
// Using ESNext syntax
|
|
134
|
-
import { __ } from '@wordpress/i18n';
|
|
135
|
-
import { PluginMoreMenuItem } from '@wordpress/edit-post';
|
|
136
|
-
import { more } from '@wordpress/icons';
|
|
137
|
-
|
|
138
|
-
function onButtonClick() {
|
|
139
|
-
alert( 'Button clicked.' );
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const MyButtonMoreMenuItem = () => (
|
|
143
|
-
<PluginMoreMenuItem icon={ more } onClick={ onButtonClick }>
|
|
144
|
-
{ __( 'My button title' ) }
|
|
145
|
-
</PluginMoreMenuItem>
|
|
146
|
-
);
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
_Parameters_
|
|
150
|
-
|
|
151
|
-
- _props_ `Object`: Component properties.
|
|
152
|
-
- _props.href_ `[string]`: When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
153
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
154
|
-
- _props.onClick_ `[Function]`: The callback function to be executed when the user clicks the menu item.
|
|
155
|
-
- _props.other_ `[...*]`: Any additional props are passed through to the underlying [MenuItem](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.
|
|
156
|
-
|
|
157
|
-
_Returns_
|
|
158
|
-
|
|
159
|
-
- `Component`: The component to be rendered.
|
|
52
|
+
Undocumented declaration.
|
|
160
53
|
|
|
161
54
|
### PluginPostPublishPanel
|
|
162
55
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
_Usage_
|
|
166
|
-
|
|
167
|
-
```js
|
|
168
|
-
// Using ES5 syntax
|
|
169
|
-
var __ = wp.i18n.__;
|
|
170
|
-
var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
|
|
171
|
-
|
|
172
|
-
function MyPluginPostPublishPanel() {
|
|
173
|
-
return React.createElement(
|
|
174
|
-
PluginPostPublishPanel,
|
|
175
|
-
{
|
|
176
|
-
className: 'my-plugin-post-publish-panel',
|
|
177
|
-
title: __( 'My panel title' ),
|
|
178
|
-
initialOpen: true,
|
|
179
|
-
},
|
|
180
|
-
__( 'My panel content' )
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
```
|
|
56
|
+
> **Deprecated** since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
|
|
184
57
|
|
|
185
|
-
|
|
186
|
-
// Using ESNext syntax
|
|
187
|
-
import { __ } from '@wordpress/i18n';
|
|
188
|
-
import { PluginPostPublishPanel } from '@wordpress/edit-post';
|
|
189
|
-
|
|
190
|
-
const MyPluginPostPublishPanel = () => (
|
|
191
|
-
<PluginPostPublishPanel
|
|
192
|
-
className="my-plugin-post-publish-panel"
|
|
193
|
-
title={ __( 'My panel title' ) }
|
|
194
|
-
initialOpen={ true }
|
|
195
|
-
>
|
|
196
|
-
{ __( 'My panel content' ) }
|
|
197
|
-
</PluginPostPublishPanel>
|
|
198
|
-
);
|
|
199
|
-
```
|
|
58
|
+
Renders provided content to the post-publish panel in the publish flow (side panel that opens after a user publishes the post).
|
|
200
59
|
|
|
201
60
|
_Parameters_
|
|
202
61
|
|
|
@@ -213,87 +72,13 @@ _Returns_
|
|
|
213
72
|
|
|
214
73
|
### PluginPostStatusInfo
|
|
215
74
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
_Usage_
|
|
219
|
-
|
|
220
|
-
```js
|
|
221
|
-
// Using ES5 syntax
|
|
222
|
-
var __ = wp.i18n.__;
|
|
223
|
-
var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
|
|
224
|
-
|
|
225
|
-
function MyPluginPostStatusInfo() {
|
|
226
|
-
return React.createElement(
|
|
227
|
-
PluginPostStatusInfo,
|
|
228
|
-
{
|
|
229
|
-
className: 'my-plugin-post-status-info',
|
|
230
|
-
},
|
|
231
|
-
__( 'My post status info' )
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
```jsx
|
|
237
|
-
// Using ESNext syntax
|
|
238
|
-
import { __ } from '@wordpress/i18n';
|
|
239
|
-
import { PluginPostStatusInfo } from '@wordpress/edit-post';
|
|
240
|
-
|
|
241
|
-
const MyPluginPostStatusInfo = () => (
|
|
242
|
-
<PluginPostStatusInfo className="my-plugin-post-status-info">
|
|
243
|
-
{ __( 'My post status info' ) }
|
|
244
|
-
</PluginPostStatusInfo>
|
|
245
|
-
);
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
_Parameters_
|
|
249
|
-
|
|
250
|
-
- _props_ `Object`: Component properties.
|
|
251
|
-
- _props.className_ `[string]`: An optional class name added to the row.
|
|
252
|
-
- _props.children_ `Element`: Children to be rendered.
|
|
253
|
-
|
|
254
|
-
_Returns_
|
|
255
|
-
|
|
256
|
-
- `Component`: The component to be rendered.
|
|
75
|
+
Undocumented declaration.
|
|
257
76
|
|
|
258
77
|
### PluginPrePublishPanel
|
|
259
78
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
_Usage_
|
|
263
|
-
|
|
264
|
-
```js
|
|
265
|
-
// Using ES5 syntax
|
|
266
|
-
var __ = wp.i18n.__;
|
|
267
|
-
var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
|
|
268
|
-
|
|
269
|
-
function MyPluginPrePublishPanel() {
|
|
270
|
-
return React.createElement(
|
|
271
|
-
PluginPrePublishPanel,
|
|
272
|
-
{
|
|
273
|
-
className: 'my-plugin-pre-publish-panel',
|
|
274
|
-
title: __( 'My panel title' ),
|
|
275
|
-
initialOpen: true,
|
|
276
|
-
},
|
|
277
|
-
__( 'My panel content' )
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
```
|
|
79
|
+
> **Deprecated** since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
281
80
|
|
|
282
|
-
|
|
283
|
-
// Using ESNext syntax
|
|
284
|
-
import { __ } from '@wordpress/i18n';
|
|
285
|
-
import { PluginPrePublishPanel } from '@wordpress/edit-post';
|
|
286
|
-
|
|
287
|
-
const MyPluginPrePublishPanel = () => (
|
|
288
|
-
<PluginPrePublishPanel
|
|
289
|
-
className="my-plugin-pre-publish-panel"
|
|
290
|
-
title={ __( 'My panel title' ) }
|
|
291
|
-
initialOpen={ true }
|
|
292
|
-
>
|
|
293
|
-
{ __( 'My panel content' ) }
|
|
294
|
-
</PluginPrePublishPanel>
|
|
295
|
-
);
|
|
296
|
-
```
|
|
81
|
+
Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
297
82
|
|
|
298
83
|
_Parameters_
|
|
299
84
|
|
|
@@ -310,110 +95,11 @@ _Returns_
|
|
|
310
95
|
|
|
311
96
|
### PluginSidebar
|
|
312
97
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
```js
|
|
316
|
-
wp.data
|
|
317
|
-
.dispatch( 'core/edit-post' )
|
|
318
|
-
.openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
_Related_
|
|
322
|
-
|
|
323
|
-
- PluginSidebarMoreMenuItem
|
|
324
|
-
|
|
325
|
-
_Usage_
|
|
326
|
-
|
|
327
|
-
```js
|
|
328
|
-
// Using ES5 syntax
|
|
329
|
-
var __ = wp.i18n.__;
|
|
330
|
-
var el = React.createElement;
|
|
331
|
-
var PanelBody = wp.components.PanelBody;
|
|
332
|
-
var PluginSidebar = wp.editPost.PluginSidebar;
|
|
333
|
-
var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
334
|
-
|
|
335
|
-
function MyPluginSidebar() {
|
|
336
|
-
return el(
|
|
337
|
-
PluginSidebar,
|
|
338
|
-
{
|
|
339
|
-
name: 'my-sidebar',
|
|
340
|
-
title: 'My sidebar title',
|
|
341
|
-
icon: moreIcon,
|
|
342
|
-
},
|
|
343
|
-
el( PanelBody, {}, __( 'My sidebar content' ) )
|
|
344
|
-
);
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
```jsx
|
|
349
|
-
// Using ESNext syntax
|
|
350
|
-
import { __ } from '@wordpress/i18n';
|
|
351
|
-
import { PanelBody } from '@wordpress/components';
|
|
352
|
-
import { PluginSidebar } from '@wordpress/edit-post';
|
|
353
|
-
import { more } from '@wordpress/icons';
|
|
354
|
-
|
|
355
|
-
const MyPluginSidebar = () => (
|
|
356
|
-
<PluginSidebar name="my-sidebar" title="My sidebar title" icon={ more }>
|
|
357
|
-
<PanelBody>{ __( 'My sidebar content' ) }</PanelBody>
|
|
358
|
-
</PluginSidebar>
|
|
359
|
-
);
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
_Parameters_
|
|
363
|
-
|
|
364
|
-
- _props_ `Object`: Element props.
|
|
365
|
-
- _props.name_ `string`: A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
366
|
-
- _props.className_ `[string]`: An optional class name added to the sidebar body.
|
|
367
|
-
- _props.title_ `string`: Title displayed at the top of the sidebar.
|
|
368
|
-
- _props.isPinnable_ `[boolean]`: Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
|
|
369
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
98
|
+
Undocumented declaration.
|
|
370
99
|
|
|
371
100
|
### PluginSidebarMoreMenuItem
|
|
372
101
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
_Usage_
|
|
376
|
-
|
|
377
|
-
```js
|
|
378
|
-
// Using ES5 syntax
|
|
379
|
-
var __ = wp.i18n.__;
|
|
380
|
-
var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
|
|
381
|
-
var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
382
|
-
|
|
383
|
-
function MySidebarMoreMenuItem() {
|
|
384
|
-
return React.createElement(
|
|
385
|
-
PluginSidebarMoreMenuItem,
|
|
386
|
-
{
|
|
387
|
-
target: 'my-sidebar',
|
|
388
|
-
icon: moreIcon,
|
|
389
|
-
},
|
|
390
|
-
__( 'My sidebar title' )
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
```jsx
|
|
396
|
-
// Using ESNext syntax
|
|
397
|
-
import { __ } from '@wordpress/i18n';
|
|
398
|
-
import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
|
|
399
|
-
import { more } from '@wordpress/icons';
|
|
400
|
-
|
|
401
|
-
const MySidebarMoreMenuItem = () => (
|
|
402
|
-
<PluginSidebarMoreMenuItem target="my-sidebar" icon={ more }>
|
|
403
|
-
{ __( 'My sidebar title' ) }
|
|
404
|
-
</PluginSidebarMoreMenuItem>
|
|
405
|
-
);
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
_Parameters_
|
|
409
|
-
|
|
410
|
-
- _props_ `Object`: Component props.
|
|
411
|
-
- _props.target_ `string`: A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
412
|
-
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
413
|
-
|
|
414
|
-
_Returns_
|
|
415
|
-
|
|
416
|
-
- `Component`: The component to be rendered.
|
|
102
|
+
Undocumented declaration.
|
|
417
103
|
|
|
418
104
|
### reinitializeEditor
|
|
419
105
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","getPostTrashedURL","postType","trashed","post_type","ids","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","isSavingPost","hasHistory","props","setTrashURL","setBrowserURL","window","location","href","history","replaceState","id","setState","render","exports","_default","default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\n/**\n * Returns the Post's Trashed URL.\n *\n * @param {number} postId Post ID.\n * @param {string} postType Post Type.\n *\n * @return {string} Post trashed URL.\n */\nexport function getPostTrashedURL( postId, postType ) {\n\treturn addQueryArgs( 'edit.php', {\n\t\ttrashed: 1,\n\t\tpost_type: postType,\n\t\tids: postId,\n\t} );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, postType, isSavingPost, hasHistory } =\n\t\t\tthis.props;\n\t\tconst { historyId } = this.state;\n\n\t\t// Posts are still dirty while saving so wait for saving to finish\n\t\t// to avoid the unsaved changes warning when trashing posts.\n\t\tif ( postStatus === 'trash' && ! isSavingPost ) {\n\t\t\tthis.setTrashURL( postId, postType );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId &&\n\t\t\t! hasHistory\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Navigates the browser to the post trashed URL to show a notice about the trashed post.\n\t *\n\t * @param {number} postId Post ID.\n\t * @param {string} postType Post Type.\n\t */\n\tsetTrashURL( postId, postType ) {\n\t\twindow.location.href = getPostTrashedURL( postId, postType );\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost, isSavingPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t\tpostType: type,\n\t\tisSavingPost: isSavingPost(),\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAAEJ,MAAM,EAAEK,QAAQ,EAAG;EACrD,OAAO,IAAAJ,iBAAY,EAAE,UAAU,EAAE;IAChCK,OAAO,EAAE,CAAC;IACVC,SAAS,EAAEF,QAAQ;IACnBG,GAAG,EAAER;EACN,CAAE,CAAC;AACJ;AAEO,MAAMS,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC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OAAA,CAAAE,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACxC,MAAM;IAAEC,cAAc;IAAElB;EAAa,CAAC,GAAGiB,MAAM,CAAEE,aAAY,CAAC;EAC9D,MAAMnC,IAAI,GAAGkC,cAAc,CAAC,CAAC;EAC7B,IAAI;IAAER,EAAE;IAAEU,MAAM;IAAEC;EAAK,CAAC,GAAGrC,IAAI;EAC/B,MAAMsC,UAAU,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBZ,EAAE,GAAG1B,IAAI,CAACwC,KAAK;EAChB;EAEA,OAAO;IACN1C,MAAM,EAAE4B,EAAE;IACVX,UAAU,EAAEqB,MAAM;IAClBjC,QAAQ,EAAEkC,IAAI;IACdrB,YAAY,EAAEA,YAAY,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAET,UAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","getPostTrashedURL","postType","trashed","post_type","ids","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","isSavingPost","hasHistory","props","setTrashURL","setBrowserURL","window","location","href","history","replaceState","id","setState","render","exports","_default","default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\n/**\n * Returns the Post's Trashed URL.\n *\n * @param {number} postId Post ID.\n * @param {string} postType Post Type.\n *\n * @return {string} Post trashed URL.\n */\nexport function getPostTrashedURL( postId, postType ) {\n\treturn addQueryArgs( 'edit.php', {\n\t\ttrashed: 1,\n\t\tpost_type: postType,\n\t\tids: postId,\n\t} );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, postType, isSavingPost, hasHistory } =\n\t\t\tthis.props;\n\t\tconst { historyId } = this.state;\n\n\t\t// Posts are still dirty while saving so wait for saving to finish\n\t\t// to avoid the unsaved changes warning when trashing posts.\n\t\tif ( postStatus === 'trash' && ! isSavingPost ) {\n\t\t\tthis.setTrashURL( postId, postType );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId &&\n\t\t\t! hasHistory\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Navigates the browser to the post trashed URL to show a notice about the trashed post.\n\t *\n\t * @param {number} postId Post ID.\n\t * @param {string} postType Post Type.\n\t */\n\tsetTrashURL( postId, postType ) {\n\t\twindow.location.href = getPostTrashedURL( postId, postType );\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost, isSavingPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t\tpostType: type,\n\t\tisSavingPost: isSavingPost(),\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAAEJ,MAAM,EAAEK,QAAQ,EAAG;EACrD,OAAO,IAAAJ,iBAAY,EAAE,UAAU,EAAE;IAChCK,OAAO,EAAE,CAAC;IACVC,SAAS,EAAEF,QAAQ;IACnBG,GAAG,EAAER;EACN,CAAE,CAAC;AACJ;AAEO,MAAMS,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZC,SAAS,EAAE;IACZ,CAAC;EACF;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,MAAM;MAAEhB,MAAM;MAAEiB,UAAU;MAAEZ,QAAQ;MAAEa,YAAY;MAAEC;IAAW,CAAC,GAC/D,IAAI,CAACC,KAAK;IACX,MAAM;MAAEN;IAAU,CAAC,GAAG,IAAI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C,UAAU,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBZ,EAAE,GAAG1B,IAAI,CAACwC,KAAK;EAChB;EAEA,OAAO;IACN1C,MAAM,EAAE4B,EAAE;IACVX,UAAU,EAAEqB,MAAM;IAClBjC,QAAQ,EAAEkC,IAAI;IACdrB,YAAY,EAAEA,YAAY,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAET,UAAW,CAAC","ignoreList":[]}
|
|
@@ -16,7 +16,6 @@ var _listenerHooks = require("./listener-hooks");
|
|
|
16
16
|
* @return {null} This is a data component so does not render any ui.
|
|
17
17
|
*/
|
|
18
18
|
function EditorInitialization() {
|
|
19
|
-
(0, _listenerHooks.useBlockSelectionListener)();
|
|
20
19
|
(0, _listenerHooks.useUpdatePostLinkListener)();
|
|
21
20
|
return null;
|
|
22
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_listenerHooks","require","EditorInitialization","
|
|
1
|
+
{"version":3,"names":["_listenerHooks","require","EditorInitialization","useUpdatePostLinkListener"],"sources":["@wordpress/edit-post/src/components/editor-initialization/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useUpdatePostLinkListener } from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization() {\n\tuseUpdatePostLinkListener();\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,IAAAC,wCAAyB,EAAC,CAAC;EAC3B,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useUpdatePostLinkListener =
|
|
6
|
+
exports.useUpdatePostLinkListener = void 0;
|
|
7
7
|
var _data = require("@wordpress/data");
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
9
|
var _editor = require("@wordpress/editor");
|
|
11
|
-
var _preferences = require("@wordpress/preferences");
|
|
12
10
|
var _constants = require("../../store/constants");
|
|
13
11
|
/**
|
|
14
12
|
* WordPress dependencies
|
|
@@ -18,45 +16,10 @@ var _constants = require("../../store/constants");
|
|
|
18
16
|
* Internal dependencies
|
|
19
17
|
*/
|
|
20
18
|
|
|
21
|
-
/**
|
|
22
|
-
* This listener hook monitors for block selection and triggers the appropriate
|
|
23
|
-
* sidebar state.
|
|
24
|
-
*/
|
|
25
|
-
const useBlockSelectionListener = () => {
|
|
26
|
-
const {
|
|
27
|
-
hasBlockSelection,
|
|
28
|
-
isEditorSidebarOpened,
|
|
29
|
-
isDistractionFree
|
|
30
|
-
} = (0, _data.useSelect)(select => {
|
|
31
|
-
const {
|
|
32
|
-
get
|
|
33
|
-
} = select(_preferences.store);
|
|
34
|
-
return {
|
|
35
|
-
hasBlockSelection: !!select(_blockEditor.store).getBlockSelectionStart(),
|
|
36
|
-
isEditorSidebarOpened: select(_constants.STORE_NAME).isEditorSidebarOpened(),
|
|
37
|
-
isDistractionFree: get('core', 'distractionFree')
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
const {
|
|
41
|
-
openGeneralSidebar
|
|
42
|
-
} = (0, _data.useDispatch)(_constants.STORE_NAME);
|
|
43
|
-
(0, _element.useEffect)(() => {
|
|
44
|
-
if (!isEditorSidebarOpened || isDistractionFree) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (hasBlockSelection) {
|
|
48
|
-
openGeneralSidebar('edit-post/block');
|
|
49
|
-
} else {
|
|
50
|
-
openGeneralSidebar('edit-post/document');
|
|
51
|
-
}
|
|
52
|
-
}, [hasBlockSelection, isDistractionFree, isEditorSidebarOpened, openGeneralSidebar]);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
19
|
/**
|
|
56
20
|
* This listener hook monitors any change in permalink and updates the view
|
|
57
21
|
* post link in the admin bar.
|
|
58
22
|
*/
|
|
59
|
-
exports.useBlockSelectionListener = useBlockSelectionListener;
|
|
60
23
|
const useUpdatePostLinkListener = () => {
|
|
61
24
|
const {
|
|
62
25
|
newPermalink
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_editor","_constants","useUpdatePostLinkListener","newPermalink","useSelect","select","editorStore","getCurrentPost","link","nodeToUpdate","useRef","useEffect","current","document","querySelector","VIEW_AS_PREVIEW_LINK_SELECTOR","VIEW_AS_LINK_SELECTOR","setAttribute","exports"],"sources":["@wordpress/edit-post/src/components/editor-initialization/listener-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport {\n\tVIEW_AS_LINK_SELECTOR,\n\tVIEW_AS_PREVIEW_LINK_SELECTOR,\n} from '../../store/constants';\n\n/**\n * This listener hook monitors any change in permalink and updates the view\n * post link in the admin bar.\n */\nexport const useUpdatePostLinkListener = () => {\n\tconst { newPermalink } = useSelect(\n\t\t( select ) => ( {\n\t\t\tnewPermalink: select( editorStore ).getCurrentPost().link,\n\t\t} ),\n\t\t[]\n\t);\n\tconst nodeToUpdate = useRef();\n\n\tuseEffect( () => {\n\t\tnodeToUpdate.current =\n\t\t\tdocument.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||\n\t\t\tdocument.querySelector( VIEW_AS_LINK_SELECTOR );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! newPermalink || ! nodeToUpdate.current ) {\n\t\t\treturn;\n\t\t}\n\t\tnodeToUpdate.current.setAttribute( 'href', newPermalink );\n\t}, [ newPermalink ] );\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACO,MAAMI,yBAAyB,GAAGA,CAAA,KAAM;EAC9C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAC/BC,MAAM,KAAQ;IACfF,YAAY,EAAEE,MAAM,CAAEC,aAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC;EACtD,CAAC,CAAE,EACH,EACD,CAAC;EACD,MAAMC,YAAY,GAAG,IAAAC,eAAM,EAAC,CAAC;EAE7B,IAAAC,kBAAS,EAAE,MAAM;IAChBF,YAAY,CAACG,OAAO,GACnBC,QAAQ,CAACC,aAAa,CAAEC,wCAA8B,CAAC,IACvDF,QAAQ,CAACC,aAAa,CAAEE,gCAAsB,CAAC;EACjD,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAL,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAER,YAAY,IAAI,CAAEM,YAAY,CAACG,OAAO,EAAG;MAC/C;IACD;IACAH,YAAY,CAACG,OAAO,CAACK,YAAY,CAAE,MAAM,EAAEd,YAAa,CAAC;EAC1D,CAAC,EAAE,CAAEA,YAAY,CAAG,CAAC;AACtB,CAAC;AAACe,OAAA,CAAAhB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","_react","createElement","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","classnames","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA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CAAC;EAEhE,OACC,IAAAd,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA8C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC;EAAQ,GAC9B,IAAA3B,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAgE,MAAM;IACNb,SAAS,EAAGE,OAAS;IACrB1C,IAAI,EAAG4C,UAAY;IACnBU,KAAK,EAAGN,WAAa;IACrBlD,WAAW,EAAGA;EAAa,GAEzB0B,UACK,CACG,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","_react","createElement","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","classnames","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAGA,SAASU,mBAAmBA,CAAE;EAAEC,WAAW;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAY,CAAC,EAAG;EAAA,IAAAC,qBAAA;EACxE,MAAM;IAAEC,QAAQ;IAAEC,oBAAoB;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EACxEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAmB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACpD,MAAM;MAAEC;IAAgB,CAAC,GAAGH,MAAM,CAAEI,YAAc,CAAC;IACnD,MAAM;MAAEC,eAAe;MAAEC,WAAW;MAAEC;IAAY,CAAC,GAClDP,MAAM,CAAEQ,eAAU,CA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EAEA;EACA,IAAKzB,IAAI,EAAG;IACXyB,UAAU,GAAG,IAAAC,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAsC,IAAI;MAACC,IAAI,EAAC,MAAM;MAAC7B,IAAI,EAAGA;IAAM,CAAE,CAAC;EAChD;EAEA,MAAM2C,OAAO,GAAG,IAAAC,mBAAU,EAAE;IAC3B,iCAAiC,EAAE,IAAI;IACvC,UAAU,EAAErC;EACb,CAAE,CAAC;EAEH,MAAMsC,UAAU,GACf5C,IAAI,aAAJA,IAAI,cAAJA,IAAI,GACJ,IAAA6C,iBAAY,EAAE,UAAU,EAAE;IACzBC,SAAS,EAAEzC,QAAQ,CAAC0C;EACrB,CAAE,CAAC;EAEJ,MAAMC,WAAW,IAAA9C,qBAAA,GAAGG,QAAQ,EAAE4C,MAAM,EAAEC,UAAU,cAAAhD,qBAAA,cAAAA,qBAAA,GAAI,IAAAqC,QAAE,EAAE,MAAO,CAAC;EAEhE,OACC,IAAAd,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA8C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC;EAAQ,GAC9B,IAAA3B,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAgE,MAAM;IACNb,SAAS,EAAGE,OAAS;IACrB1C,IAAI,EAAG4C,UAAY;IACnBU,KAAK,EAAGN,WAAa;IACrBlD,WAAW,EAAGA;EAAa,GAEzB0B,UACK,CACG,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_compose","_data","_viewport","_i18n","_blockEditor","_components","_icons","_editor","_blocks","_reactNativeBridge","_style","_interopRequireDefault","_store","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","useRef","containerStyle","usePreferredColorSchemeStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","useEffect","onUndoSubscription","subscribeOnUndoPressed","onRedoSubscription","subscribeOnRedoPressed","remove","toggleUndoButton","toggleRedoButton","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","useCallback","blockType","createBlock","undefined","source","inserterMethod","renderMediaButtons","_react","createElement","ToolbarGroup","ToolbarButton","key","title","__","icon","imageIcon","onClick","testID","extraProps","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","View","ref","accessibilityLabel","style","ScrollView","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","Inserter","disabled","BlockToolbar","passedStyle","keyboardClose","_default","exports","default","compose","withSelect","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","withDispatch","dispatch","clearSelectedBlock","togglePostTitleSelection","withViewportMatch","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":";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,EACH,IAAAQ,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,kBAAkB;IAAE/F;EAAY,CAAC,GACxC8F,QAAQ,CAAEZ,kBAAiB,CAAC;EAC7B,MAAM;IAAEc;EAAyB,CAAC,GAAGF,QAAQ,CAAEV,aAAY,CAAC;EAE5D,OAAO;IACNxF,IAAI,EAAEkG,QAAQ,CAAEV,aAAY,CAAC,CAACxF,IAAI;IAClCC,IAAI,EAAEiG,QAAQ,CAAEV,aAAY,CAAC,CAACvF,IAAI;IAClCI,cAAcA,CAAA,EAAG;MAChB8F,kBAAkB,CAAC,CAAC;MACpBC,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDhG;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAiG,2BAAiB,EAAE;EAAEC,eAAe,EAAE;AAAS,CAAE,CAAC,CACjD,CAAC,CAAEzG,aAAc,CAAC"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_compose","_data","_viewport","_i18n","_blockEditor","_components","_icons","_editor","_blocks","_reactNativeBridge","_style","_interopRequireDefault","_store","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","useRef","containerStyle","usePreferredColorSchemeStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","useEffect","onUndoSubscription","subscribeOnUndoPressed","onRedoSubscription","subscribeOnRedoPressed","remove","toggleUndoButton","toggleRedoButton","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","useCallback","blockType","createBlock","undefined","source","inserterMethod","renderMediaButtons","_react","createElement","ToolbarGroup","ToolbarButton","key","title","__","icon","imageIcon","onClick","testID","extraProps","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","View","ref","accessibilityLabel","style","ScrollView","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","Inserter","disabled","BlockToolbar","passedStyle","keyboardClose","_default","exports","default","compose","withSelect","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","withDispatch","dispatch","clearSelectedBlock","togglePostTitleSelection","withViewportMatch","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAOA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AAUA,IAAAY,MAAA,GAAAC,sBAA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