@wordpress/edit-post 7.34.0 → 8.0.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 +15 -2
- package/build/commands/use-commands.js +56 -0
- package/build/commands/use-commands.js.map +1 -0
- package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build/components/back-button/index.js +57 -0
- package/build/components/back-button/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +63 -62
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.native.js +2 -2
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +50 -43
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/layout/index.js +134 -156
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +28 -21
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build/components/layout/use-padding-appender.js.map +1 -0
- package/build/components/layout/use-should-iframe.js +46 -0
- package/build/components/layout/use-should-iframe.js.map +1 -0
- package/build/components/meta-boxes/index.js +10 -9
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +13 -13
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/more-menu/index.js +49 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/preferences-modal/enable-custom-fields.js +23 -18
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +13 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/visual-editor/header.native.js +11 -10
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.native.js +3 -3
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +50 -33
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +12 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +9 -9
- package/build/deprecated.js.map +1 -1
- package/build/editor.js +16 -11
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +18 -12
- package/build/editor.native.js.map +1 -1
- package/build/index.js +12 -13
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/commands/use-commands.js +49 -0
- package/build-module/commands/use-commands.js.map +1 -0
- package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +18 -16
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
- package/build-module/components/back-button/index.js +49 -0
- package/build-module/components/back-button/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +64 -62
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -2
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +52 -43
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +139 -159
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +30 -21
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/{visual-editor → layout}/use-padding-appender.js +6 -1
- package/build-module/components/layout/use-padding-appender.js.map +1 -0
- package/build-module/components/layout/use-should-iframe.js +39 -0
- package/build-module/components/layout/use-should-iframe.js.map +1 -0
- package/build-module/components/meta-boxes/index.js +12 -9
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +13 -11
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +43 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +6 -5
- package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +11 -10
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +3 -3
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +52 -33
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +14 -8
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +9 -9
- package/build-module/deprecated.js.map +1 -1
- package/build-module/editor.js +17 -11
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +18 -12
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +10 -7
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +31 -392
- package/build-style/style.css +31 -392
- package/package.json +33 -33
- package/src/commands/use-commands.js +48 -0
- package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +3 -3
- package/src/components/back-button/index.js +34 -0
- package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
- package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
- package/src/components/layout/index.js +151 -207
- package/src/components/layout/style.scss +9 -17
- package/src/components/{visual-editor → layout}/use-padding-appender.js +7 -1
- package/src/components/layout/use-should-iframe.js +40 -0
- package/src/components/meta-boxes/meta-boxes-area/index.js +4 -8
- package/src/components/{header/more-menu → more-menu}/index.js +2 -2
- package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +1 -1
- package/src/index.js +11 -6
- package/src/store/selectors.js +8 -5
- package/src/style.scss +3 -10
- package/src/test/__snapshots__/editor.native.js.snap +72 -0
- package/src/test/editor.native.js +77 -0
- package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build/components/header/index.js +0 -158
- package/build/components/header/index.js.map +0 -1
- package/build/components/header/main-dashboard-button/index.js +0 -33
- package/build/components/header/main-dashboard-button/index.js.map +0 -1
- package/build/components/header/more-menu/index.js +0 -43
- package/build/components/header/more-menu/index.js.map +0 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/sidebar/post-format/index.js +0 -21
- package/build/components/sidebar/post-format/index.js.map +0 -1
- package/build/components/sidebar/post-pending-status/index.js +0 -26
- package/build/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build/components/sidebar/post-slug/index.js +0 -21
- package/build/components/sidebar/post-slug/index.js.map +0 -1
- package/build/components/sidebar/post-status/index.js +0 -92
- package/build/components/sidebar/post-status/index.js.map +0 -1
- package/build/components/sidebar/post-sticky/index.js +0 -26
- package/build/components/sidebar/post-sticky/index.js.map +0 -1
- package/build/components/sidebar/post-trash/index.js +0 -16
- package/build/components/sidebar/post-trash/index.js.map +0 -1
- package/build/components/sidebar/post-visibility/index.js +0 -78
- package/build/components/sidebar/post-visibility/index.js.map +0 -1
- package/build/components/sidebar/settings-header/index.js +0 -53
- package/build/components/sidebar/settings-header/index.js.map +0 -1
- package/build/components/sidebar/settings-sidebar/index.js +0 -193
- package/build/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build/components/text-editor/index.js +0 -61
- package/build/components/text-editor/index.js.map +0 -1
- package/build/components/visual-editor/block-inspector-button.js +0 -55
- package/build/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build/components/visual-editor/index.js +0 -92
- package/build/components/visual-editor/index.js.map +0 -1
- package/build/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build/hooks/commands/use-common-commands.js +0 -119
- package/build/hooks/commands/use-common-commands.js.map +0 -1
- package/build/hooks/components/index.js +0 -11
- package/build/hooks/components/index.js.map +0 -1
- package/build/hooks/index.js +0 -5
- package/build/hooks/index.js.map +0 -1
- package/build/hooks/validate-multiple-use/index.js +0 -134
- package/build/hooks/validate-multiple-use/index.js.map +0 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
- package/build-module/components/header/index.js +0 -150
- package/build-module/components/header/index.js.map +0 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -26
- package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
- package/build-module/components/header/more-menu/index.js +0 -35
- package/build-module/components/header/more-menu/index.js.map +0 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/sidebar/post-format/index.js +0 -13
- package/build-module/components/sidebar/post-format/index.js.map +0 -1
- package/build-module/components/sidebar/post-pending-status/index.js +0 -18
- package/build-module/components/sidebar/post-pending-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-slug/index.js +0 -13
- package/build-module/components/sidebar/post-slug/index.js.map +0 -1
- package/build-module/components/sidebar/post-status/index.js +0 -84
- package/build-module/components/sidebar/post-status/index.js.map +0 -1
- package/build-module/components/sidebar/post-sticky/index.js +0 -18
- package/build-module/components/sidebar/post-sticky/index.js.map +0 -1
- package/build-module/components/sidebar/post-trash/index.js +0 -9
- package/build-module/components/sidebar/post-trash/index.js.map +0 -1
- package/build-module/components/sidebar/post-visibility/index.js +0 -70
- package/build-module/components/sidebar/post-visibility/index.js.map +0 -1
- package/build-module/components/sidebar/settings-header/index.js +0 -46
- package/build-module/components/sidebar/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +0 -185
- package/build-module/components/sidebar/settings-sidebar/index.js.map +0 -1
- package/build-module/components/text-editor/index.js +0 -54
- package/build-module/components/text-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/block-inspector-button.js +0 -47
- package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/visual-editor/index.js +0 -84
- package/build-module/components/visual-editor/index.js.map +0 -1
- package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
- package/build-module/hooks/commands/use-common-commands.js +0 -112
- package/build-module/hooks/commands/use-common-commands.js.map +0 -1
- package/build-module/hooks/components/index.js +0 -8
- package/build-module/hooks/components/index.js.map +0 -1
- package/build-module/hooks/index.js +0 -6
- package/build-module/hooks/index.js.map +0 -1
- package/build-module/hooks/validate-multiple-use/index.js +0 -132
- package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
- package/src/components/header/index.js +0 -156
- package/src/components/header/main-dashboard-button/index.js +0 -28
- package/src/components/header/style.scss +0 -251
- package/src/components/sidebar/post-format/index.js +0 -20
- package/src/components/sidebar/post-format/style.scss +0 -5
- package/src/components/sidebar/post-pending-status/index.js +0 -27
- package/src/components/sidebar/post-slug/index.js +0 -17
- package/src/components/sidebar/post-slug/style.scss +0 -5
- package/src/components/sidebar/post-status/index.js +0 -128
- package/src/components/sidebar/post-sticky/index.js +0 -27
- package/src/components/sidebar/post-trash/index.js +0 -12
- package/src/components/sidebar/post-visibility/index.js +0 -88
- package/src/components/sidebar/post-visibility/style.scss +0 -5
- package/src/components/sidebar/settings-header/index.js +0 -49
- package/src/components/sidebar/settings-sidebar/index.js +0 -247
- package/src/components/sidebar/style.scss +0 -18
- package/src/components/text-editor/index.js +0 -63
- package/src/components/text-editor/style.scss +0 -71
- package/src/components/visual-editor/block-inspector-button.js +0 -59
- package/src/components/visual-editor/index.js +0 -101
- package/src/components/visual-editor/style.scss +0 -53
- package/src/hooks/commands/use-common-commands.js +0 -126
- package/src/hooks/components/index.js +0 -13
- package/src/hooks/index.js +0 -5
- package/src/hooks/validate-multiple-use/index.js +0 -163
- /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
- /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { DocumentBar, PostSavedState, PostPreviewButton, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
|
-
import { useSelect } from '@wordpress/data';
|
|
12
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
13
|
-
import { __unstableMotion as motion } from '@wordpress/components';
|
|
14
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
|
-
import { useState } from '@wordpress/element';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
import FullscreenModeClose from './fullscreen-mode-close';
|
|
21
|
-
import PostEditorMoreMenu from './more-menu';
|
|
22
|
-
import MainDashboardButton from './main-dashboard-button';
|
|
23
|
-
import { store as editPostStore } from '../../store';
|
|
24
|
-
import { unlock } from '../../lock-unlock';
|
|
25
|
-
const {
|
|
26
|
-
CollapsableBlockToolbar,
|
|
27
|
-
DocumentTools,
|
|
28
|
-
PostViewLink,
|
|
29
|
-
PreviewDropdown,
|
|
30
|
-
PinnedItems,
|
|
31
|
-
MoreMenu,
|
|
32
|
-
PostPublishButtonOrToggle
|
|
33
|
-
} = unlock(editorPrivateApis);
|
|
34
|
-
const slideY = {
|
|
35
|
-
hidden: {
|
|
36
|
-
y: '-50px'
|
|
37
|
-
},
|
|
38
|
-
distractionFreeInactive: {
|
|
39
|
-
y: 0
|
|
40
|
-
},
|
|
41
|
-
hover: {
|
|
42
|
-
y: 0,
|
|
43
|
-
transition: {
|
|
44
|
-
type: 'tween',
|
|
45
|
-
delay: 0.2
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const slideX = {
|
|
50
|
-
hidden: {
|
|
51
|
-
x: '-100%'
|
|
52
|
-
},
|
|
53
|
-
distractionFreeInactive: {
|
|
54
|
-
x: 0
|
|
55
|
-
},
|
|
56
|
-
hover: {
|
|
57
|
-
x: 0,
|
|
58
|
-
transition: {
|
|
59
|
-
type: 'tween',
|
|
60
|
-
delay: 0.2
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
function Header({
|
|
65
|
-
setEntitiesSavedStatesCallback,
|
|
66
|
-
initialPost
|
|
67
|
-
}) {
|
|
68
|
-
const isWideViewport = useViewportMatch('large');
|
|
69
|
-
const isLargeViewport = useViewportMatch('medium');
|
|
70
|
-
const {
|
|
71
|
-
isTextEditor,
|
|
72
|
-
hasActiveMetaboxes,
|
|
73
|
-
isPublishSidebarOpened,
|
|
74
|
-
showIconLabels,
|
|
75
|
-
hasHistory,
|
|
76
|
-
hasFixedToolbar
|
|
77
|
-
} = useSelect(select => {
|
|
78
|
-
const {
|
|
79
|
-
get: getPreference
|
|
80
|
-
} = select(preferencesStore);
|
|
81
|
-
const {
|
|
82
|
-
getEditorMode
|
|
83
|
-
} = select(editorStore);
|
|
84
|
-
return {
|
|
85
|
-
isTextEditor: getEditorMode() === 'text',
|
|
86
|
-
hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
|
|
87
|
-
hasHistory: !!select(editorStore).getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
88
|
-
isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
|
|
89
|
-
showIconLabels: getPreference('core', 'showIconLabels'),
|
|
90
|
-
hasFixedToolbar: getPreference('core', 'fixedToolbar')
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
const hasTopToolbar = isLargeViewport && hasFixedToolbar;
|
|
94
|
-
const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
|
|
95
|
-
return createElement("div", {
|
|
96
|
-
className: "edit-post-header"
|
|
97
|
-
}, createElement(MainDashboardButton.Slot, null, createElement(motion.div, {
|
|
98
|
-
variants: slideX,
|
|
99
|
-
transition: {
|
|
100
|
-
type: 'tween',
|
|
101
|
-
delay: 0.8
|
|
102
|
-
}
|
|
103
|
-
}, createElement(FullscreenModeClose, {
|
|
104
|
-
showTooltip: true,
|
|
105
|
-
initialPost: initialPost
|
|
106
|
-
}))), createElement(motion.div, {
|
|
107
|
-
variants: slideY,
|
|
108
|
-
transition: {
|
|
109
|
-
type: 'tween',
|
|
110
|
-
delay: 0.8
|
|
111
|
-
},
|
|
112
|
-
className: "edit-post-header__toolbar"
|
|
113
|
-
}, createElement(DocumentTools, {
|
|
114
|
-
disableBlockTools: isTextEditor
|
|
115
|
-
}), hasTopToolbar && createElement(CollapsableBlockToolbar, {
|
|
116
|
-
isCollapsed: isBlockToolsCollapsed,
|
|
117
|
-
onToggle: setIsBlockToolsCollapsed
|
|
118
|
-
}), createElement("div", {
|
|
119
|
-
className: classnames('edit-post-header__center', {
|
|
120
|
-
'is-collapsed': hasHistory && !isBlockToolsCollapsed && hasTopToolbar
|
|
121
|
-
})
|
|
122
|
-
}, hasHistory && createElement(DocumentBar, null))), createElement(motion.div, {
|
|
123
|
-
variants: slideY,
|
|
124
|
-
transition: {
|
|
125
|
-
type: 'tween',
|
|
126
|
-
delay: 0.8
|
|
127
|
-
},
|
|
128
|
-
className: "edit-post-header__settings"
|
|
129
|
-
}, !isPublishSidebarOpened &&
|
|
130
|
-
// This button isn't completely hidden by the publish sidebar.
|
|
131
|
-
// We can't hide the whole toolbar when the publish sidebar is open because
|
|
132
|
-
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
|
|
133
|
-
// We track that DOM node to return focus to the PostPublishButtonOrToggle
|
|
134
|
-
// when the publish sidebar has been closed.
|
|
135
|
-
createElement(PostSavedState, {
|
|
136
|
-
forceIsDirty: hasActiveMetaboxes
|
|
137
|
-
}), createElement(PreviewDropdown, {
|
|
138
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
139
|
-
}), createElement(PostPreviewButton, {
|
|
140
|
-
className: "edit-post-header__post-preview-button",
|
|
141
|
-
forceIsAutosaveable: hasActiveMetaboxes
|
|
142
|
-
}), createElement(PostViewLink, null), createElement(PostPublishButtonOrToggle, {
|
|
143
|
-
forceIsDirty: hasActiveMetaboxes,
|
|
144
|
-
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
|
|
145
|
-
}), (isWideViewport || !showIconLabels) && createElement(PinnedItems.Slot, {
|
|
146
|
-
scope: "core"
|
|
147
|
-
}), createElement(MoreMenu, null), createElement(PostEditorMoreMenu, null)));
|
|
148
|
-
}
|
|
149
|
-
export default Header;
|
|
150
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","DocumentBar","PostSavedState","PostPreviewButton","store","editorStore","privateApis","editorPrivateApis","useSelect","useViewportMatch","__unstableMotion","motion","preferencesStore","useState","FullscreenModeClose","PostEditorMoreMenu","MainDashboardButton","editPostStore","unlock","CollapsableBlockToolbar","DocumentTools","PostViewLink","PreviewDropdown","PinnedItems","MoreMenu","PostPublishButtonOrToggle","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","initialPost","isWideViewport","isLargeViewport","isTextEditor","hasActiveMetaboxes","isPublishSidebarOpened","showIconLabels","hasHistory","hasFixedToolbar","select","get","getPreference","getEditorMode","hasMetaBoxes","getEditorSettings","onNavigateToPreviousEntityRecord","hasTopToolbar","isBlockToolsCollapsed","setIsBlockToolsCollapsed","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","isCollapsed","onToggle","forceIsDirty","forceIsAutosaveable","scope"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDocumentBar,\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport PostEditorMoreMenu from './more-menu';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tCollapsableBlockToolbar,\n\tDocumentTools,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPinnedItems,\n\tMoreMenu,\n\tPostPublishButtonOrToggle,\n} = unlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback, initialPost } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tisTextEditor,\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t\thasFixedToolbar,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory:\n\t\t\t\t!! select( editorStore ).getEditorSettings()\n\t\t\t\t\t.onNavigateToPreviousEntityRecord,\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\n\tconst hasTopToolbar = isLargeViewport && hasFixedToolbar;\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasTopToolbar && (\n\t\t\t\t\t<CollapsableBlockToolbar\n\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\thasHistory &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasTopToolbar,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasHistory && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core\" />\n\t\t\t\t) }\n\t\t\t\t<MoreMenu />\n\t\t\t\t<PostEditorMoreMenu />\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __experimentalUseSlotFills as useSlotFills, createSlotFill } from '@wordpress/components';
|
|
6
|
-
const slotName = '__experimentalMainDashboardButton';
|
|
7
|
-
const {
|
|
8
|
-
Fill,
|
|
9
|
-
Slot: MainDashboardButtonSlot
|
|
10
|
-
} = createSlotFill(slotName);
|
|
11
|
-
const MainDashboardButton = Fill;
|
|
12
|
-
const Slot = ({
|
|
13
|
-
children
|
|
14
|
-
}) => {
|
|
15
|
-
const fills = useSlotFills(slotName);
|
|
16
|
-
const hasFills = Boolean(fills && fills.length);
|
|
17
|
-
if (!hasFills) {
|
|
18
|
-
return children;
|
|
19
|
-
}
|
|
20
|
-
return createElement(MainDashboardButtonSlot, {
|
|
21
|
-
bubblesVirtually: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
MainDashboardButton.Slot = Slot;
|
|
25
|
-
export default MainDashboardButton;
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalUseSlotFills","useSlotFills","createSlotFill","slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","fills","hasFills","Boolean","length","createElement","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlotFills as useSlotFills,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst fills = useSlotFills( slotName );\n\tconst hasFills = Boolean( fills && fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,QACR,uBAAuB;AAE9B,MAAMC,QAAQ,GAAG,mCAAmC;AAEpD,MAAM;EAAEC,IAAI;EAAEC,IAAI,EAAEC;AAAwB,CAAC,GAAGJ,cAAc,CAAEC,QAAS,CAAC;AAE1E,MAAMI,mBAAmB,GAAGH,IAAI;AAEhC,MAAMC,IAAI,GAAGA,CAAE;EAAEG;AAAS,CAAC,KAAM;EAChC,MAAMC,KAAK,GAAGR,YAAY,CAAEE,QAAS,CAAC;EACtC,MAAMO,QAAQ,GAAGC,OAAO,CAAEF,KAAK,IAAIA,KAAK,CAACG,MAAO,CAAC;EAEjD,IAAK,CAAEF,QAAQ,EAAG;IACjB,OAAOF,QAAQ;EAChB;EAEA,OAAOK,aAAA,CAACP,uBAAuB;IAACQ,gBAAgB;EAAA,CAAE,CAAC;AACpD,CAAC;AAEDP,mBAAmB,CAACF,IAAI,GAAGA,IAAI;AAE/B,eAAeE,mBAAmB","ignoreList":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
7
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
|
-
import { PreferenceToggleMenuItem } from '@wordpress/preferences';
|
|
9
|
-
import { displayShortcut } from '@wordpress/keycodes';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { unlock } from '../../../lock-unlock';
|
|
15
|
-
import ManagePatternsMenuItem from './manage-patterns-menu-item';
|
|
16
|
-
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
17
|
-
import EditPostPreferencesModal from '../../preferences-modal';
|
|
18
|
-
const {
|
|
19
|
-
ToolsMoreMenuGroup,
|
|
20
|
-
ViewMoreMenuGroup
|
|
21
|
-
} = unlock(editorPrivateApis);
|
|
22
|
-
const MoreMenu = () => {
|
|
23
|
-
const isLargeViewport = useViewportMatch('large');
|
|
24
|
-
return createElement(Fragment, null, isLargeViewport && createElement(ViewMoreMenuGroup, null, createElement(PreferenceToggleMenuItem, {
|
|
25
|
-
scope: "core/edit-post",
|
|
26
|
-
name: "fullscreenMode",
|
|
27
|
-
label: __('Fullscreen mode'),
|
|
28
|
-
info: __('Show and hide the admin user interface'),
|
|
29
|
-
messageActivated: __('Fullscreen mode activated'),
|
|
30
|
-
messageDeactivated: __('Fullscreen mode deactivated'),
|
|
31
|
-
shortcut: displayShortcut.secondary('f')
|
|
32
|
-
})), createElement(ToolsMoreMenuGroup, null, createElement(ManagePatternsMenuItem, null), createElement(WelcomeGuideMenuItem, null)), createElement(EditPostPreferencesModal, null));
|
|
33
|
-
};
|
|
34
|
-
export default MoreMenu;
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","useViewportMatch","privateApis","editorPrivateApis","PreferenceToggleMenuItem","displayShortcut","unlock","ManagePatternsMenuItem","WelcomeGuideMenuItem","EditPostPreferencesModal","ToolsMoreMenuGroup","ViewMoreMenuGroup","MoreMenu","isLargeViewport","createElement","Fragment","scope","name","label","info","messageActivated","messageDeactivated","shortcut","secondary"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,wBAAwB,MAAM,yBAAyB;AAE9D,MAAM;EAAEC,kBAAkB;EAAEC;AAAkB,CAAC,GAAGL,MAAM,CAAEH,iBAAkB,CAAC;AAE7E,MAAMS,QAAQ,GAAGA,CAAA,KAAM;EACtB,MAAMC,eAAe,GAAGZ,gBAAgB,CAAE,OAAQ,CAAC;EAEnD,OACCa,aAAA,CAAAC,QAAA,QACGF,eAAe,IAChBC,aAAA,CAACH,iBAAiB,QACjBG,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAC,gBAAgB;IACrBC,KAAK,EAAGlB,EAAE,CAAE,iBAAkB,CAAG;IACjCmB,IAAI,EAAGnB,EAAE,CAAE,wCAAyC,CAAG;IACvDoB,gBAAgB,EAAGpB,EAAE,CAAE,2BAA4B,CAAG;IACtDqB,kBAAkB,EAAGrB,EAAE,CACtB,6BACD,CAAG;IACHsB,QAAQ,EAAGjB,eAAe,CAACkB,SAAS,CAAE,GAAI;EAAG,CAC7C,CACiB,CACnB,EACDT,aAAA,CAACJ,kBAAkB,QAClBI,aAAA,CAACP,sBAAsB,MAAE,CAAC,EAC1BO,aAAA,CAACN,oBAAoB,MAAE,CACJ,CAAC,EACrBM,aAAA,CAACL,wBAAwB,MAAE,CAC1B,CAAC;AAEL,CAAC;AAED,eAAeG,QAAQ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MenuItem","store","coreStore","useSelect","__","addQueryArgs","ManagePatternsMenuItem","url","select","canUser","defaultUrl","post_type","patternsUrl","path","createElement","role","href"],"sources":["@wordpress/edit-post/src/components/header/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAGJ,SAAS,CAAIK,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEN,SAAU,CAAC;IACvC,MAAMQ,UAAU,GAAGL,YAAY,CAAE,UAAU,EAAE;MAC5CM,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAGP,YAAY,CAAE,iBAAiB,EAAE;MACpDQ,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAOJ,OAAO,CAAE,MAAM,EAAE,WAAY,CAAC,GAAGG,WAAW,GAAGF,UAAU;EACjE,CAAC,EAAE,EAAG,CAAC;EAEP,OACCI,aAAA,CAACd,QAAQ;IAACe,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGT;EAAK,GACnCH,EAAE,CAAE,iBAAkB,CACf,CAAC;AAEb;AAEA,eAAeE,sBAAsB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","PreferenceToggleMenuItem","__","store","editorStore","WelcomeGuideMenuItem","isEditingTemplate","select","getCurrentPostType","createElement","scope","name","label"],"sources":["@wordpress/edit-post/src/components/header/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAGN,SAAS,CAChCO,MAAM,IACPA,MAAM,CAAEH,WAAY,CAAC,CAACI,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACCC,aAAA,CAACR,wBAAwB;IACxBS,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGL,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEM,KAAK,EAAGV,EAAE,CAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PanelRow } from '@wordpress/components';
|
|
6
|
-
import { PostFormat as PostFormatForm, PostFormatCheck } from '@wordpress/editor';
|
|
7
|
-
export function PostFormat() {
|
|
8
|
-
return createElement(PostFormatCheck, null, createElement(PanelRow, {
|
|
9
|
-
className: "edit-post-post-format"
|
|
10
|
-
}, createElement(PostFormatForm, null)));
|
|
11
|
-
}
|
|
12
|
-
export default PostFormat;
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PanelRow","PostFormat","PostFormatForm","PostFormatCheck","createElement","className"],"sources":["@wordpress/edit-post/src/components/sidebar/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport {\n\tPostFormat as PostFormatForm,\n\tPostFormatCheck,\n} from '@wordpress/editor';\n\nexport function PostFormat() {\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<PanelRow className=\"edit-post-post-format\">\n\t\t\t\t<PostFormatForm />\n\t\t\t</PanelRow>\n\t\t</PostFormatCheck>\n\t);\n}\n\nexport default PostFormat;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SACCC,UAAU,IAAIC,cAAc,EAC5BC,eAAe,QACT,mBAAmB;AAE1B,OAAO,SAASF,UAAUA,CAAA,EAAG;EAC5B,OACCG,aAAA,CAACD,eAAe,QACfC,aAAA,CAACJ,QAAQ;IAACK,SAAS,EAAC;EAAuB,GAC1CD,aAAA,CAACF,cAAc,MAAE,CACR,CACM,CAAC;AAEpB;AAEA,eAAeD,UAAU","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PostPendingStatus as PostPendingStatusForm, PostPendingStatusCheck, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { unlock } from '../../../lock-unlock';
|
|
11
|
-
const {
|
|
12
|
-
PostPanelRow
|
|
13
|
-
} = unlock(editorPrivateApis);
|
|
14
|
-
export function PostPendingStatus() {
|
|
15
|
-
return createElement(PostPendingStatusCheck, null, createElement(PostPanelRow, null, createElement(PostPendingStatusForm, null)));
|
|
16
|
-
}
|
|
17
|
-
export default PostPendingStatus;
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PostPendingStatus","PostPendingStatusForm","PostPendingStatusCheck","privateApis","editorPrivateApis","unlock","PostPanelRow","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostPendingStatus as PostPendingStatusForm,\n\tPostPendingStatusCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostPendingStatus() {\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostPendingStatusForm />\n\t\t\t</PostPanelRow>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,iBAAiB,IAAIC,qBAAqB,EAC1CC,sBAAsB,EACtBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAa,CAAC,GAAGD,MAAM,CAAED,iBAAkB,CAAC;AAEpD,OAAO,SAASJ,iBAAiBA,CAAA,EAAG;EACnC,OACCO,aAAA,CAACL,sBAAsB,QACtBK,aAAA,CAACD,YAAY,QACZC,aAAA,CAACN,qBAAqB,MAAE,CACX,CACS,CAAC;AAE3B;AAEA,eAAeD,iBAAiB","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PanelRow } from '@wordpress/components';
|
|
6
|
-
import { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';
|
|
7
|
-
export function PostSlug() {
|
|
8
|
-
return createElement(PostSlugCheck, null, createElement(PanelRow, {
|
|
9
|
-
className: "edit-post-post-slug"
|
|
10
|
-
}, createElement(PostSlugForm, null)));
|
|
11
|
-
}
|
|
12
|
-
export default PostSlug;
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PanelRow","PostSlug","PostSlugForm","PostSlugCheck","createElement","className"],"sources":["@wordpress/edit-post/src/components/sidebar/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelRow } from '@wordpress/components';\nimport { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';\n\nexport function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PanelRow className=\"edit-post-post-slug\">\n\t\t\t\t<PostSlugForm />\n\t\t\t</PanelRow>\n\t\t</PostSlugCheck>\n\t);\n}\n\nexport default PostSlug;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,QAAQ,IAAIC,YAAY,EAAEC,aAAa,QAAQ,mBAAmB;AAE3E,OAAO,SAASF,QAAQA,CAAA,EAAG;EAC1B,OACCG,aAAA,CAACD,aAAa,QACbC,aAAA,CAACJ,QAAQ;IAACK,SAAS,EAAC;EAAqB,GACxCD,aAAA,CAACF,YAAY,MAAE,CACN,CACI,CAAC;AAElB;AAEA,eAAeD,QAAQ","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { __experimentalHStack as HStack, __experimentalVStack as VStack, PanelBody } from '@wordpress/components';
|
|
7
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
-
import { PluginPostStatusInfo, PostAuthorPanel, PostSchedulePanel, PostSyncStatus, PostURLPanel, PostTemplatePanel, PostFeaturedImagePanel, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import PostTrash from '../post-trash';
|
|
14
|
-
import PostSticky from '../post-sticky';
|
|
15
|
-
import PostSlug from '../post-slug';
|
|
16
|
-
import PostFormat from '../post-format';
|
|
17
|
-
import { unlock } from '../../../lock-unlock';
|
|
18
|
-
const {
|
|
19
|
-
PostStatus: PostStatusPanel,
|
|
20
|
-
PrivatePostExcerptPanel,
|
|
21
|
-
PostContentInformation,
|
|
22
|
-
PostLastEditedPanel
|
|
23
|
-
} = unlock(editorPrivateApis);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Module Constants
|
|
27
|
-
*/
|
|
28
|
-
const PANEL_NAME = 'post-status';
|
|
29
|
-
export default function PostStatus() {
|
|
30
|
-
const {
|
|
31
|
-
isOpened,
|
|
32
|
-
isRemoved,
|
|
33
|
-
showPostContentPanels
|
|
34
|
-
} = useSelect(select => {
|
|
35
|
-
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
36
|
-
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
37
|
-
const {
|
|
38
|
-
isEditorPanelRemoved,
|
|
39
|
-
isEditorPanelOpened,
|
|
40
|
-
getCurrentPostType
|
|
41
|
-
} = select(editorStore);
|
|
42
|
-
const postType = getCurrentPostType();
|
|
43
|
-
return {
|
|
44
|
-
isRemoved: isEditorPanelRemoved(PANEL_NAME),
|
|
45
|
-
isOpened: isEditorPanelOpened(PANEL_NAME),
|
|
46
|
-
// Post excerpt panel is rendered in different place depending on the post type.
|
|
47
|
-
// So we cannot make this check inside the PostExcerpt component based on the current edited entity.
|
|
48
|
-
showPostContentPanels: !['wp_template', 'wp_template_part', 'wp_block'].includes(postType)
|
|
49
|
-
};
|
|
50
|
-
}, []);
|
|
51
|
-
const {
|
|
52
|
-
toggleEditorPanelOpened
|
|
53
|
-
} = useDispatch(editorStore);
|
|
54
|
-
if (isRemoved) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
return createElement(PanelBody, {
|
|
58
|
-
className: "edit-post-post-status",
|
|
59
|
-
title: __('Summary'),
|
|
60
|
-
opened: isOpened,
|
|
61
|
-
onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
|
|
62
|
-
}, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, showPostContentPanels && createElement(VStack, {
|
|
63
|
-
spacing: 3
|
|
64
|
-
// TODO: this needs to be consolidated with the panel in site editor, when we unify them.
|
|
65
|
-
,
|
|
66
|
-
style: {
|
|
67
|
-
marginBlockEnd: '24px'
|
|
68
|
-
}
|
|
69
|
-
}, createElement(PostFeaturedImagePanel, {
|
|
70
|
-
withPanelBody: false
|
|
71
|
-
}), createElement(PrivatePostExcerptPanel, null), createElement(VStack, {
|
|
72
|
-
spacing: 1
|
|
73
|
-
}, createElement(PostContentInformation, null), createElement(PostLastEditedPanel, null))), createElement(VStack, {
|
|
74
|
-
spacing: 1,
|
|
75
|
-
style: {
|
|
76
|
-
marginBlockEnd: '12px'
|
|
77
|
-
}
|
|
78
|
-
}, createElement(PostStatusPanel, null), createElement(PostSchedulePanel, null), createElement(PostTemplatePanel, null), createElement(PostURLPanel, null), createElement(PostSyncStatus, null)), createElement(PostSticky, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthorPanel, null), fills, createElement(HStack, {
|
|
79
|
-
style: {
|
|
80
|
-
marginTop: '16px'
|
|
81
|
-
}
|
|
82
|
-
}, createElement(PostTrash, null)))));
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHStack","HStack","__experimentalVStack","VStack","PanelBody","useDispatch","useSelect","PluginPostStatusInfo","PostAuthorPanel","PostSchedulePanel","PostSyncStatus","PostURLPanel","PostTemplatePanel","PostFeaturedImagePanel","store","editorStore","privateApis","editorPrivateApis","PostTrash","PostSticky","PostSlug","PostFormat","unlock","PostStatus","PostStatusPanel","PrivatePostExcerptPanel","PostContentInformation","PostLastEditedPanel","PANEL_NAME","isOpened","isRemoved","showPostContentPanels","select","isEditorPanelRemoved","isEditorPanelOpened","getCurrentPostType","postType","includes","toggleEditorPanelOpened","createElement","className","title","opened","onToggle","Slot","fills","Fragment","spacing","style","marginBlockEnd","withPanelBody","marginTop"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPluginPostStatusInfo,\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tPostFeaturedImagePanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport { unlock } from '../../../lock-unlock';\n\nconst {\n\tPostStatus: PostStatusPanel,\n\tPrivatePostExcerptPanel,\n\tPostContentInformation,\n\tPostLastEditedPanel,\n} = unlock( editorPrivateApis );\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved, showPostContentPanels } = useSelect(\n\t\t( select ) => {\n\t\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\t\tconst {\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tisEditorPanelOpened,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst postType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\t\t// Post excerpt panel is rendered in different place depending on the post type.\n\t\t\t\t// So we cannot make this check inside the PostExcerpt component based on the current edited entity.\n\t\t\t\tshowPostContentPanels: ! [\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t'wp_block',\n\t\t\t\t].includes( postType ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showPostContentPanels && (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\t\t\t\t// TODO: this needs to be consolidated with the panel in site editor, when we unify them.\n\t\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '24px' } }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostFeaturedImagePanel\n\t\t\t\t\t\t\t\t\twithPanelBody={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PrivatePostExcerptPanel />\n\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t\tstyle={ { marginBlockEnd: '12px' } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PostSticky as PostStickyForm, PostStickyCheck, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { unlock } from '../../../lock-unlock';
|
|
11
|
-
const {
|
|
12
|
-
PostPanelRow
|
|
13
|
-
} = unlock(editorPrivateApis);
|
|
14
|
-
export function PostSticky() {
|
|
15
|
-
return createElement(PostStickyCheck, null, createElement(PostPanelRow, null, createElement(PostStickyForm, null)));
|
|
16
|
-
}
|
|
17
|
-
export default PostSticky;
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PostSticky","PostStickyForm","PostStickyCheck","privateApis","editorPrivateApis","unlock","PostPanelRow","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/post-sticky/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostSticky as PostStickyForm,\n\tPostStickyCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostSticky() {\n\treturn (\n\t\t<PostStickyCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostStickyForm />\n\t\t\t</PostPanelRow>\n\t\t</PostStickyCheck>\n\t);\n}\n\nexport default PostSticky;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,UAAU,IAAIC,cAAc,EAC5BC,eAAe,EACfC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAa,CAAC,GAAGD,MAAM,CAAED,iBAAkB,CAAC;AAEpD,OAAO,SAASJ,UAAUA,CAAA,EAAG;EAC5B,OACCO,aAAA,CAACL,eAAe,QACfK,aAAA,CAACD,YAAY,QACZC,aAAA,CAACN,cAAc,MAAE,CACJ,CACE,CAAC;AAEpB;AAEA,eAAeD,UAAU","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';
|
|
6
|
-
export default function PostTrash() {
|
|
7
|
-
return createElement(PostTrashCheck, null, createElement(PostTrashLink, null));
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PostTrash","PostTrashLink","PostTrashCheck","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,IAAIC,aAAa,EAAEC,cAAc,QAAQ,mBAAmB;AAE9E,eAAe,SAASF,SAASA,CAAA,EAAG;EACnC,OACCG,aAAA,CAACD,cAAc,QACdC,aAAA,CAACF,aAAa,MAAE,CACD,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
-
import { Dropdown, Button } from '@wordpress/components';
|
|
7
|
-
import { PostVisibility as PostVisibilityForm, PostVisibilityLabel, PostVisibilityCheck, usePostVisibilityLabel, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
|
-
import { useMemo, useState } from '@wordpress/element';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { unlock } from '../../../lock-unlock';
|
|
14
|
-
const {
|
|
15
|
-
PostPanelRow
|
|
16
|
-
} = unlock(editorPrivateApis);
|
|
17
|
-
export function PostVisibility() {
|
|
18
|
-
// Use internal state instead of a ref to make sure that the component
|
|
19
|
-
// re-renders when the popover's anchor updates.
|
|
20
|
-
const [popoverAnchor, setPopoverAnchor] = useState(null);
|
|
21
|
-
// Memoize popoverProps to avoid returning a new object every time.
|
|
22
|
-
const popoverProps = useMemo(() => ({
|
|
23
|
-
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
24
|
-
// move around when the label changes.
|
|
25
|
-
anchor: popoverAnchor,
|
|
26
|
-
placement: 'bottom-end'
|
|
27
|
-
}), [popoverAnchor]);
|
|
28
|
-
return createElement(PostVisibilityCheck, {
|
|
29
|
-
render: ({
|
|
30
|
-
canEdit
|
|
31
|
-
}) => createElement(PostPanelRow, {
|
|
32
|
-
label: __('Visibility'),
|
|
33
|
-
ref: setPopoverAnchor
|
|
34
|
-
}, !canEdit && createElement("span", null, createElement(PostVisibilityLabel, null)), canEdit && createElement(Dropdown, {
|
|
35
|
-
contentClassName: "edit-post-post-visibility__dialog",
|
|
36
|
-
popoverProps: popoverProps,
|
|
37
|
-
focusOnMount: true,
|
|
38
|
-
renderToggle: ({
|
|
39
|
-
isOpen,
|
|
40
|
-
onToggle
|
|
41
|
-
}) => createElement(PostVisibilityToggle, {
|
|
42
|
-
isOpen: isOpen,
|
|
43
|
-
onClick: onToggle
|
|
44
|
-
}),
|
|
45
|
-
renderContent: ({
|
|
46
|
-
onClose
|
|
47
|
-
}) => createElement(PostVisibilityForm, {
|
|
48
|
-
onClose: onClose
|
|
49
|
-
})
|
|
50
|
-
}))
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function PostVisibilityToggle({
|
|
54
|
-
isOpen,
|
|
55
|
-
onClick
|
|
56
|
-
}) {
|
|
57
|
-
const label = usePostVisibilityLabel();
|
|
58
|
-
return createElement(Button, {
|
|
59
|
-
__next40pxDefaultSize: true,
|
|
60
|
-
className: "edit-post-post-visibility__toggle",
|
|
61
|
-
variant: "tertiary",
|
|
62
|
-
"aria-expanded": isOpen
|
|
63
|
-
// translators: %s: Current post visibility.
|
|
64
|
-
,
|
|
65
|
-
"aria-label": sprintf(__('Select visibility: %s'), label),
|
|
66
|
-
onClick: onClick
|
|
67
|
-
}, label);
|
|
68
|
-
}
|
|
69
|
-
export default PostVisibility;
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","Dropdown","Button","PostVisibility","PostVisibilityForm","PostVisibilityLabel","PostVisibilityCheck","usePostVisibilityLabel","privateApis","editorPrivateApis","useMemo","useState","unlock","PostPanelRow","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","createElement","render","canEdit","label","ref","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","__next40pxDefaultSize","className","variant"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PostPanelRow\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PostPanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SACCC,cAAc,IAAIC,kBAAkB,EACpCC,mBAAmB,EACnBC,mBAAmB,EACnBC,sBAAsB,EACtBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAa,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAEpD,OAAO,SAASN,cAAcA,CAAA,EAAG;EAChC;EACA;EACA,MAAM,CAAEW,aAAa,EAAEC,gBAAgB,CAAE,GAAGJ,QAAQ,CAAE,IAAK,CAAC;EAC5D;EACA,MAAMK,YAAY,GAAGN,OAAO,CAC3B,OAAQ;IACP;IACA;IACAO,MAAM,EAAEH,aAAa;IACrBI,SAAS,EAAE;EACZ,CAAC,CAAE,EACH,CAAEJ,aAAa,CAChB,CAAC;EAED,OACCK,aAAA,CAACb,mBAAmB;IACnBc,MAAM,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KACrBF,aAAA,CAACN,YAAY;MACZS,KAAK,EAAGvB,EAAE,CAAE,YAAa,CAAG;MAC5BwB,GAAG,EAAGR;IAAkB,GAEtB,CAAEM,OAAO,IACVF,aAAA,eACCA,aAAA,CAACd,mBAAmB,MAAE,CACjB,CACN,EACCgB,OAAO,IACRF,aAAA,CAAClB,QAAQ;MACRuB,gBAAgB,EAAC,mCAAmC;MACpDR,YAAY,EAAGA,YAAc;MAC7BS,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAEC,MAAM;QAAEC;MAAS,CAAC,KACpCT,aAAA,CAACU,oBAAoB;QACpBF,MAAM,EAAGA,MAAQ;QACjBG,OAAO,EAAGF;MAAU,CACpB,CACC;MACHG,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,KAC5Bb,aAAA,CAACf,kBAAkB;QAAC4B,OAAO,EAAGA;MAAS,CAAE;IACvC,CACH,CAEW;EACZ,CACH,CAAC;AAEJ;AAEA,SAASH,oBAAoBA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EACpD,MAAMR,KAAK,GAAGf,sBAAsB,CAAC,CAAC;EACtC,OACCY,aAAA,CAACjB,MAAM;IACN+B,qBAAqB;IACrBC,SAAS,EAAC,mCAAmC;IAC7CC,OAAO,EAAC,UAAU;IAClB,iBAAgBR;IAChB;IAAA;IACA,cAAa3B,OAAO,CAAED,EAAE,CAAE,uBAAwB,CAAC,EAAEuB,KAAM,CAAG;IAC9DQ,OAAO,EAAGA;EAAS,GAEjBR,KACK,CAAC;AAEX;AAEA,eAAenB,cAAc","ignoreList":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
6
|
-
import { __, _x } from '@wordpress/i18n';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import { forwardRef } from '@wordpress/element';
|
|
9
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { unlock } from '../../../lock-unlock';
|
|
15
|
-
import { sidebars } from '../settings-sidebar';
|
|
16
|
-
const {
|
|
17
|
-
Tabs
|
|
18
|
-
} = unlock(componentsPrivateApis);
|
|
19
|
-
const SettingsHeader = (_, ref) => {
|
|
20
|
-
const {
|
|
21
|
-
documentLabel
|
|
22
|
-
} = useSelect(select => {
|
|
23
|
-
const {
|
|
24
|
-
getPostTypeLabel
|
|
25
|
-
} = select(editorStore);
|
|
26
|
-
return {
|
|
27
|
-
// translators: Default label for the Document sidebar tab, not selected.
|
|
28
|
-
documentLabel: getPostTypeLabel() || _x('Document', 'noun')
|
|
29
|
-
};
|
|
30
|
-
}, []);
|
|
31
|
-
return createElement(Tabs.TabList, {
|
|
32
|
-
ref: ref
|
|
33
|
-
}, createElement(Tabs.Tab, {
|
|
34
|
-
tabId: sidebars.document
|
|
35
|
-
// Used for focus management in the SettingsSidebar component.
|
|
36
|
-
,
|
|
37
|
-
"data-tab-id": sidebars.document
|
|
38
|
-
}, documentLabel), createElement(Tabs.Tab, {
|
|
39
|
-
tabId: sidebars.block
|
|
40
|
-
// Used for focus management in the SettingsSidebar component.
|
|
41
|
-
,
|
|
42
|
-
"data-tab-id": sidebars.block
|
|
43
|
-
}, __('Block')));
|
|
44
|
-
};
|
|
45
|
-
export default forwardRef(SettingsHeader);
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","forwardRef","store","editorStore","unlock","sidebars","Tabs","SettingsHeader","_","ref","documentLabel","select","getPostTypeLabel","createElement","TabList","Tab","tabId","document","block"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default forwardRef( SettingsHeader );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGF,MAAM,CAAEP,qBAAsB,CAAC;AAEhD,MAAMU,cAAc,GAAGA,CAAEC,CAAC,EAAEC,GAAG,KAAM;EACpC,MAAM;IAAEC;EAAc,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IAClD,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAER,WAAY,CAAC;IAElD,OAAO;MACN;MACAO,aAAa,EAAEE,gBAAgB,CAAC,CAAC,IAAIb,EAAE,CAAE,UAAU,EAAE,MAAO;IAC7D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCc,aAAA,CAACP,IAAI,CAACQ,OAAO;IAACL,GAAG,EAAGA;EAAK,GACxBI,aAAA,CAACP,IAAI,CAACS,GAAG;IACRC,KAAK,EAAGX,QAAQ,CAACY;IACjB;IAAA;IACA,eAAcZ,QAAQ,CAACY;EAAU,GAE/BP,aACO,CAAC,EACXG,aAAA,CAACP,IAAI,CAACS,GAAG;IACRC,KAAK,EAAGX,QAAQ,CAACa;IACjB;IAAA;IACA,eAAcb,QAAQ,CAACa;EAAO,GAG5BpB,EAAE,CAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAED,eAAeG,UAAU,CAAEM,cAAe,CAAC","ignoreList":[]}
|