@wordpress/edit-post 7.33.0 → 7.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +22 -36
- package/build/components/header/index.js +17 -48
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +17 -43
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +0 -88
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +18 -11
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +29 -6
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +40 -10
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/deprecated.js +132 -0
- package/build/deprecated.js.map +1 -0
- package/build/index.js +19 -58
- package/build/index.js.map +1 -1
- package/build-module/components/header/index.js +20 -51
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +17 -43
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +1 -89
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +18 -11
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -12
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +30 -7
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +43 -13
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/deprecated.js +116 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/index.js +2 -15
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +6 -141
- package/build-style/style.css +6 -141
- package/package.json +31 -31
- package/src/components/header/index.js +24 -69
- package/src/components/header/more-menu/index.js +27 -42
- package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/src/components/header/style.scss +0 -79
- package/src/components/keyboard-shortcuts/index.js +1 -106
- package/src/components/layout/index.js +12 -6
- package/src/components/layout/style.scss +7 -80
- package/src/components/preferences-modal/index.js +2 -22
- package/src/components/sidebar/post-status/index.js +57 -17
- package/src/components/sidebar/settings-sidebar/index.js +60 -24
- package/src/deprecated.js +107 -0
- package/src/index.js +3 -24
- package/build/components/header/post-publish-button-or-toggle.js +0 -94
- package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build/components/header/preferences-menu-item/index.js +0 -39
- package/build/components/header/preferences-menu-item/index.js.map +0 -1
- package/build/components/header/tools-more-menu-group/index.js +0 -26
- package/build/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build/components/header/writing-menu/index.js +0 -71
- package/build/components/header/writing-menu/index.js.map +0 -1
- package/build/components/layout/actions-panel.js +0 -86
- package/build/components/layout/actions-panel.js.map +0 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build/plugins/copy-content-menu-item/index.js +0 -39
- package/build/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build/plugins/index.js +0 -69
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -44
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +0 -86
- package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build-module/components/header/preferences-menu-item/index.js +0 -32
- package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
- package/build-module/components/header/tools-more-menu-group/index.js +0 -19
- package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/header/writing-menu/index.js +0 -64
- package/build-module/components/header/writing-menu/index.js.map +0 -1
- package/build-module/components/layout/actions-panel.js +0 -78
- package/build-module/components/layout/actions-panel.js.map +0 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build-module/plugins/copy-content-menu-item/index.js +0 -32
- package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build-module/plugins/index.js +0 -65
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/src/components/header/post-publish-button-or-toggle.js +0 -97
- package/src/components/header/preferences-menu-item/index.js +0 -31
- package/src/components/header/test/index.js +0 -63
- package/src/components/header/tools-more-menu-group/index.js +0 -20
- package/src/components/header/writing-menu/index.js +0 -73
- package/src/components/layout/actions-panel.js +0 -103
- package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
- package/src/components/preferences-modal/test/index.js +0 -28
- package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
- package/src/plugins/copy-content-menu-item/index.js +0 -29
- package/src/plugins/index.js +0 -85
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
- /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { createElement
|
|
1
|
+
import { createElement } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { BlockInspector, store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { Platform, useCallback, useContext, useEffect, useRef } from '@wordpress/element';
|
|
8
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
|
+
import { isRTL, __, sprintf } from '@wordpress/i18n';
|
|
9
9
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
10
10
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
11
|
-
import { store as editorStore, PageAttributesPanel, PluginDocumentSettingPanel, PluginSidebar, PostDiscussionPanel,
|
|
11
|
+
import { store as editorStore, PageAttributesPanel, PluginDocumentSettingPanel, PluginSidebar, PostDiscussionPanel, PostLastRevisionPanel, PostTaxonomiesPanel, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
12
12
|
import { addQueryArgs } from '@wordpress/url';
|
|
13
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
@@ -40,14 +41,6 @@ export const sidebars = {
|
|
|
40
41
|
document: 'edit-post/document',
|
|
41
42
|
block: 'edit-post/block'
|
|
42
43
|
};
|
|
43
|
-
function onActionPerformed(actionId, items) {
|
|
44
|
-
if (actionId === 'move-to-trash') {
|
|
45
|
-
const postType = items[0].type;
|
|
46
|
-
document.location.href = addQueryArgs('edit.php', {
|
|
47
|
-
post_type: postType
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
44
|
const SidebarContent = ({
|
|
52
45
|
tabName,
|
|
53
46
|
keyboardShortcut,
|
|
@@ -78,6 +71,43 @@ const SidebarContent = ({
|
|
|
78
71
|
selectedTabElement?.focus();
|
|
79
72
|
}
|
|
80
73
|
}, [tabName]);
|
|
74
|
+
const {
|
|
75
|
+
createSuccessNotice
|
|
76
|
+
} = useDispatch(noticesStore);
|
|
77
|
+
const onActionPerformed = useCallback((actionId, items) => {
|
|
78
|
+
switch (actionId) {
|
|
79
|
+
case 'move-to-trash':
|
|
80
|
+
{
|
|
81
|
+
const postType = items[0].type;
|
|
82
|
+
document.location.href = addQueryArgs('edit.php', {
|
|
83
|
+
post_type: postType
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 'duplicate-post':
|
|
88
|
+
{
|
|
89
|
+
const newItem = items[0];
|
|
90
|
+
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
91
|
+
createSuccessNotice(sprintf(
|
|
92
|
+
// translators: %s: Title of the created post e.g: "Post 1".
|
|
93
|
+
__('"%s" successfully created.'), title), {
|
|
94
|
+
type: 'snackbar',
|
|
95
|
+
id: 'duplicate-post-action',
|
|
96
|
+
actions: [{
|
|
97
|
+
label: __('Edit'),
|
|
98
|
+
onClick: () => {
|
|
99
|
+
const postId = newItem.id;
|
|
100
|
+
document.location.href = addQueryArgs('post.php', {
|
|
101
|
+
post: postId,
|
|
102
|
+
action: 'edit'
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}, [createSuccessNotice]);
|
|
81
111
|
return createElement(PluginSidebar, {
|
|
82
112
|
identifier: tabName,
|
|
83
113
|
header: createElement(Tabs.Context.Provider, {
|
|
@@ -106,9 +136,9 @@ const SidebarContent = ({
|
|
|
106
136
|
actions: createElement(PostActions, {
|
|
107
137
|
onActionPerformed: onActionPerformed
|
|
108
138
|
})
|
|
109
|
-
}), !isEditingTemplate && createElement(
|
|
139
|
+
}), !isEditingTemplate && createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null), createElement(PatternOverridesPanel, null), !isEditingTemplate && createElement(MetaBoxes, {
|
|
110
140
|
location: "side"
|
|
111
|
-
}))
|
|
141
|
+
})), createElement(Tabs.TabPanel, {
|
|
112
142
|
tabId: sidebars.block,
|
|
113
143
|
focusable: false
|
|
114
144
|
}, createElement(BlockInspector, null))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","useEffect","useRef","isRTL","__","drawerLeft","drawerRight","keyboardShortcutsStore","editorStore","PageAttributesPanel","PluginDocumentSettingPanel","PluginSidebar","PostDiscussionPanel","PostExcerptPanel","PostLastRevisionPanel","PostTaxonomiesPanel","privateApis","editorPrivateApis","addQueryArgs","SettingsHeader","PostStatus","MetaBoxes","editPostStore","componentsPrivateApis","unlock","PostCardPanel","PostActions","interfaceStore","Tabs","PatternOverridesPanel","useAutoSwitchEditorSidebars","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","onActionPerformed","actionId","items","postType","type","location","href","post_type","SidebarContent","tabName","keyboardShortcut","isEditingTemplate","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","createElement","identifier","header","Provider","value","ref","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","actions","Fragment","Slot","SettingsSidebar","shortcut","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentPostType","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPluginSidebar,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions, interfaceStore } =\n\tunlock( editorPrivateApis );\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { PatternOverridesPanel, useAutoSwitchEditorSidebars } =\n\tunlock( editorPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nfunction onActionPerformed( actionId, items ) {\n\tif ( actionId === 'move-to-trash' ) {\n\t\tconst postType = items[ 0 ].type;\n\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType,\n\t\t} );\n\t}\n}\n\nconst SidebarContent = ( { tabName, keyboardShortcut, isEditingTemplate } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\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\t{ ! isEditingTemplate && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};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,GAAGpG,WAAW,CAAEyB,aAAc,CAAC;EAE3D,MAAM4E,WAAW,GAAGnG,WAAW,CAC5BoG,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,kBAAkB,CAAEE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC7B,aAAA,CAACxC,IAAI;IACJwE,aAAa,EAAGrD,OAAS;IACzBsD,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG;EAAO,GAEtBlC,aAAA,CAACtB,cAAc;IACdC,OAAO,EAAGA,OAAS;IACnBC,gBAAgB,EAAGA,gBAAkB;IACrCC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET,CAAC;AAED,eAAesC,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","useEffect","useRef","isRTL","__","sprintf","drawerLeft","drawerRight","keyboardShortcutsStore","editorStore","PageAttributesPanel","PluginDocumentSettingPanel","PluginSidebar","PostDiscussionPanel","PostLastRevisionPanel","PostTaxonomiesPanel","privateApis","editorPrivateApis","addQueryArgs","noticesStore","SettingsHeader","PostStatus","MetaBoxes","editPostStore","componentsPrivateApis","unlock","PostCardPanel","PostActions","interfaceStore","Tabs","PatternOverridesPanel","useAutoSwitchEditorSidebars","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","SidebarContent","tabName","keyboardShortcut","isEditingTemplate","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","createSuccessNotice","onActionPerformed","actionId","items","postType","type","location","href","post_type","newItem","title","rendered","actions","label","onClick","postId","post","action","createElement","identifier","header","Provider","value","ref","closeLabel","className","headerClassName","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","Slot","SettingsSidebar","shortcut","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentPostType","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPluginSidebar,\n\tPostDiscussionPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions, interfaceStore } =\n\tunlock( editorPrivateApis );\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { PatternOverridesPanel, useAutoSwitchEditorSidebars } =\n\tunlock( editorPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( { tabName, keyboardShortcut, isEditingTemplate } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst postType = items[ 0 ].type;\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\tpost_type: postType,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\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\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\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\t{ ! isEditingTemplate && <PostStatus /> }\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ ! isEditingTemplate && <MetaBoxes location=\"side\" /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,QAAQ,EACRC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC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K,EACdF,QAAQ,CAACC,QAAQ,CACjB,CAACgE,QAAQ,CAAEH,OAAQ,CAAC;IACrB,IAAII,QAAQ,GAAGJ,OAAO;IACtB,IAAK,CAAEE,sBAAsB,EAAG;MAC/BE,QAAQ,GAAG,CAAC,CAAErE,MAAM,CACnBtC,gBACD,CAAC,CAAC4G,sBAAsB,CAAC,CAAC,GACvBnE,QAAQ,CAACE,KAAK,GACdF,QAAQ,CAACC,QAAQ;IACrB;IAEA,OAAO;MACNG,OAAO,EAAE8D,QAAQ;MACjB7D,gBAAgB,EAAEuD,QAAQ;MAC1BtD,iBAAiB,EAChBT,MAAM,CAAExB,WAAY,CAAC,CAAC+F,kBAAkB,CAAC,CAAC,KAC1C;IACF,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,MAAM;IAAEC;EAAmB,CAAC,GAAG5G,WAAW,CAAE0B,aAAc,CAAC;EAE3D,MAAMmF,WAAW,GAAG3G,WAAW,CAC5B4G,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,kBAAkB,CAAEE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC1B,aAAA,CAAClD,IAAI;IACJ+E,aAAa,EAAGpE,OAAS;IACzBqE,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG;EAAO,GAEtB/B,aAAA,CAACxC,cAAc;IACdC,OAAO,EAAGA,OAAS;IACnBC,gBAAgB,EAAGA,gBAAkB;IACrCC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET,CAAC;AAED,eAAeqD,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { privateApis as editorPrivateApis, PluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem, PluginDocumentSettingPanel as EditorPluginDocumentSettingPanel, PluginMoreMenuItem as EditorPluginMoreMenuItem, PluginPrePublishPanel as EditorPluginPrePublishPanel, PluginPostPublishPanel as EditorPluginPostPublishPanel, PluginPostStatusInfo as EditorPluginPostStatusInfo, PluginSidebar as EditorPluginSidebar, PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem } from '@wordpress/editor';
|
|
6
|
+
import deprecated from '@wordpress/deprecated';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from './lock-unlock';
|
|
12
|
+
const {
|
|
13
|
+
PluginPostExcerpt
|
|
14
|
+
} = unlock(editorPrivateApis);
|
|
15
|
+
const deprecateSlot = name => {
|
|
16
|
+
deprecated(`wp.editPost.${name}`, {
|
|
17
|
+
since: '6.6',
|
|
18
|
+
alternative: `wp.editor.${name}`
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/* eslint-disable jsdoc/require-param */
|
|
23
|
+
/**
|
|
24
|
+
* @see PluginBlockSettingsMenuItem in @wordpress/editor package.
|
|
25
|
+
*/
|
|
26
|
+
export function PluginBlockSettingsMenuItem(props) {
|
|
27
|
+
deprecateSlot('PluginBlockSettingsMenuItem');
|
|
28
|
+
return createElement(EditorPluginBlockSettingsMenuItem, {
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @see PluginDocumentSettingPanel in @wordpress/editor package.
|
|
35
|
+
*/
|
|
36
|
+
export function PluginDocumentSettingPanel(props) {
|
|
37
|
+
deprecateSlot('PluginDocumentSettingPanel');
|
|
38
|
+
return createElement(EditorPluginDocumentSettingPanel, {
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @see PluginMoreMenuItem in @wordpress/editor package.
|
|
45
|
+
*/
|
|
46
|
+
export function PluginMoreMenuItem(props) {
|
|
47
|
+
deprecateSlot('PluginMoreMenuItem');
|
|
48
|
+
return createElement(EditorPluginMoreMenuItem, {
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @see PluginPrePublishPanel in @wordpress/editor package.
|
|
55
|
+
*/
|
|
56
|
+
export function PluginPrePublishPanel(props) {
|
|
57
|
+
deprecateSlot('PluginPrePublishPanel');
|
|
58
|
+
return createElement(EditorPluginPrePublishPanel, {
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @see PluginPostPublishPanel in @wordpress/editor package.
|
|
65
|
+
*/
|
|
66
|
+
export function PluginPostPublishPanel(props) {
|
|
67
|
+
deprecateSlot('PluginPostPublishPanel');
|
|
68
|
+
return createElement(EditorPluginPostPublishPanel, {
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @see PluginPostStatusInfo in @wordpress/editor package.
|
|
75
|
+
*/
|
|
76
|
+
export function PluginPostStatusInfo(props) {
|
|
77
|
+
deprecateSlot('PluginPostStatusInfo');
|
|
78
|
+
return createElement(EditorPluginPostStatusInfo, {
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @see PluginSidebar in @wordpress/editor package.
|
|
85
|
+
*/
|
|
86
|
+
export function PluginSidebar(props) {
|
|
87
|
+
deprecateSlot('PluginSidebar');
|
|
88
|
+
return createElement(EditorPluginSidebar, {
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @see PluginSidebarMoreMenuItem in @wordpress/editor package.
|
|
95
|
+
*/
|
|
96
|
+
export function PluginSidebarMoreMenuItem(props) {
|
|
97
|
+
deprecateSlot('PluginSidebarMoreMenuItem');
|
|
98
|
+
return createElement(EditorPluginSidebarMoreMenuItem, {
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @see PluginPostExcerpt in @wordpress/editor package.
|
|
105
|
+
*/
|
|
106
|
+
export function __experimentalPluginPostExcerpt() {
|
|
107
|
+
deprecated('wp.editPost.__experimentalPluginPostExcerpt', {
|
|
108
|
+
since: '6.6',
|
|
109
|
+
hint: 'Core and custom panels can be access programmatically using their panel name.',
|
|
110
|
+
link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically'
|
|
111
|
+
});
|
|
112
|
+
return PluginPostExcerpt;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* eslint-enable jsdoc/require-param */
|
|
116
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["privateApis","editorPrivateApis","PluginBlockSettingsMenuItem","EditorPluginBlockSettingsMenuItem","PluginDocumentSettingPanel","EditorPluginDocumentSettingPanel","PluginMoreMenuItem","EditorPluginMoreMenuItem","PluginPrePublishPanel","EditorPluginPrePublishPanel","PluginPostPublishPanel","EditorPluginPostPublishPanel","PluginPostStatusInfo","EditorPluginPostStatusInfo","PluginSidebar","EditorPluginSidebar","PluginSidebarMoreMenuItem","EditorPluginSidebarMoreMenuItem","deprecated","unlock","PluginPostExcerpt","deprecateSlot","name","since","alternative","props","createElement","__experimentalPluginPostExcerpt","hint","link"],"sources":["@wordpress/edit-post/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as editorPrivateApis,\n\tPluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel as EditorPluginDocumentSettingPanel,\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginPrePublishPanel as EditorPluginPrePublishPanel,\n\tPluginPostPublishPanel as EditorPluginPostPublishPanel,\n\tPluginPostStatusInfo as EditorPluginPostStatusInfo,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nconst { PluginPostExcerpt } = unlock( editorPrivateApis );\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginBlockSettingsMenuItem in @wordpress/editor package.\n */\nexport function PluginBlockSettingsMenuItem( props ) {\n\tdeprecateSlot( 'PluginBlockSettingsMenuItem' );\n\treturn <EditorPluginBlockSettingsMenuItem { ...props } />;\n}\n\n/**\n * @see PluginDocumentSettingPanel in @wordpress/editor package.\n */\nexport function PluginDocumentSettingPanel( props ) {\n\tdeprecateSlot( 'PluginDocumentSettingPanel' );\n\treturn <EditorPluginDocumentSettingPanel { ...props } />;\n}\n\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPrePublishPanel in @wordpress/editor package.\n */\nexport function PluginPrePublishPanel( props ) {\n\tdeprecateSlot( 'PluginPrePublishPanel' );\n\treturn <EditorPluginPrePublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostPublishPanel in @wordpress/editor package.\n */\nexport function PluginPostPublishPanel( props ) {\n\tdeprecateSlot( 'PluginPostPublishPanel' );\n\treturn <EditorPluginPostPublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostStatusInfo in @wordpress/editor package.\n */\nexport function PluginPostStatusInfo( props ) {\n\tdeprecateSlot( 'PluginPostStatusInfo' );\n\treturn <EditorPluginPostStatusInfo { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPostExcerpt in @wordpress/editor package.\n */\nexport function __experimentalPluginPostExcerpt() {\n\tdeprecated( 'wp.editPost.__experimentalPluginPostExcerpt', {\n\t\tsince: '6.6',\n\t\thint: 'Core and custom panels can be access programmatically using their panel name.',\n\t\tlink: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically',\n\t} );\n\treturn PluginPostExcerpt;\n}\n\n/* eslint-enable jsdoc/require-param */\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,iBAAiB,EAChCC,2BAA2B,IAAIC,iCAAiC,EAChEC,0BAA0B,IAAIC,gCAAgC,EAC9DC,kBAAkB,IAAIC,wBAAwB,EAC9CC,qBAAqB,IAAIC,2BAA2B,EACpDC,sBAAsB,IAAIC,4BAA4B,EACtDC,oBAAoB,IAAIC,0BAA0B,EAClDC,aAAa,IAAIC,mBAAmB,EACpCC,yBAAyB,IAAIC,+BAA+B,QACtD,mBAAmB;AAC1B,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,eAAe;AACtC,MAAM;EAAEC;AAAkB,CAAC,GAAGD,MAAM,CAAElB,iBAAkB,CAAC;AAEzD,MAAMoB,aAAa,GAAKC,IAAI,IAAM;EACjCJ,UAAU,CAAG,eAAeI,IAAM,EAAC,EAAE;IACpCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG,aAAaF,IAA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;AAC5C;;AAEA;AACA;AACA;AACA,OAAO,SAAST,yBAAyBA,CAAES,KAAK,EAAG;EAClDJ,aAAa,CAAE,2BAA4B,CAAC;EAC5C,OAAOK,aAAA,CAACT,+BAA+B;IAAA,GAAMQ;EAAK,CAAI,CAAC;AACxD;;AAEA;AACA;AACA;AACA,OAAO,SAASE,+BAA+BA,CAAA,EAAG;EACjDT,UAAU,CAAE,6CAA6C,EAAE;IAC1DK,KAAK,EAAE,KAAK;IACZK,IAAI,EAAE,+EAA+E;IACrFC,IAAI,EAAE;EACP,CAAE,CAAC;EACH,OAAOT,iBAAiB;AACzB;;AAEA","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -9,18 +9,13 @@ import { createRoot } from '@wordpress/element';
|
|
|
9
9
|
import { dispatch, select } from '@wordpress/data';
|
|
10
10
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
11
|
import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
12
|
-
import {
|
|
12
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import './hooks';
|
|
18
|
-
import './plugins';
|
|
19
18
|
import Editor from './editor';
|
|
20
|
-
import { unlock } from './lock-unlock';
|
|
21
|
-
const {
|
|
22
|
-
PluginPostExcerpt: __experimentalPluginPostExcerpt
|
|
23
|
-
} = unlock(editorPrivateApis);
|
|
24
19
|
|
|
25
20
|
/**
|
|
26
21
|
* Initializes and returns an instance of Editor.
|
|
@@ -129,16 +124,8 @@ export function reinitializeEditor() {
|
|
|
129
124
|
version: '6.3'
|
|
130
125
|
});
|
|
131
126
|
}
|
|
132
|
-
export { PluginBlockSettingsMenuItem };
|
|
133
|
-
export { PluginDocumentSettingPanel };
|
|
134
|
-
export { PluginMoreMenuItem };
|
|
135
|
-
export { PluginPostStatusInfo };
|
|
136
|
-
export { PluginSidebar };
|
|
137
|
-
export { PluginSidebarMoreMenuItem };
|
|
138
|
-
export { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';
|
|
139
|
-
export { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';
|
|
140
127
|
export { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';
|
|
141
128
|
export { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';
|
|
142
|
-
export { __experimentalPluginPostExcerpt };
|
|
143
129
|
export { store } from './store';
|
|
130
|
+
export * from './deprecated';
|
|
144
131
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostStatusInfo","PluginSidebar","PluginSidebarMoreMenuItem","privateApis","editorPrivateApis","editorStore","Editor","unlock","PluginPostExcerpt","__experimentalPluginPostExcerpt","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","reapplyBlockTypeFilters","get","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginPostPublishPanel","PluginPrePublishPanel","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel,\n\tPluginMoreMenuItem,\n\tPluginPostStatusInfo,\n\tPluginSidebar,\n\tPluginSidebarMoreMenuItem,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginBlockSettingsMenuItem };\nexport { PluginDocumentSettingPanel };\nexport { PluginMoreMenuItem };\nexport { PluginPostStatusInfo };\nexport { PluginSidebar };\nexport { PluginSidebarMoreMenuItem };\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,4CAA4C,QACtC,0BAA0B;AACjC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,iBAAiB;AAClD,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,kBAAkB,EAClBC,oBAAoB,EACpBC,aAAa,EACbC,yBAAyB,EACzBC,WAAW,IAAIC,iBAAiB,EAChClB,KAAK,IAAImB,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAO,SAAS;AAChB,OAAO,WAAW;AAClB,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,eAAe;AAEtC,MAAM;EAAEC,iBAAiB,EAAEC;AAAgC,CAAC,GAC3DF,MAAM,CAAEH,iBAAkB,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,gBAAgBA,CAC/BC,EAAE,EACFC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACX;EACD,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAC1E,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEX,EAAG,CAAC;EAC5C,MAAMY,IAAI,GAAGhC,UAAU,CAAE6B,MAAO,CAAC;EAEjC5B,QAAQ,CAAEE,gBAAiB,CAAC,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OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,SAAS4C,kBAAkBA,CAAA,EAAG;EACpC7E,UAAU,CAAE,gCAAgC,EAAE;IAC7C8E,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASxE,2BAA2B;AACpC,SAASC,0BAA0B;AACnC,SAASC,kBAAkB;AAC3B,SAASC,oBAAoB;AAC7B,SAASC,aAAa;AACtB,SAASC,yBAAyB;AAClC,SAASoE,OAAO,IAAIC,sBAAsB,QAAQ,gDAAgD;AAClG,SAASD,OAAO,IAAIE,qBAAqB,QAAQ,+CAA+C;AAChG,SAASF,OAAO,IAAIG,iCAAiC,QAAQ,2CAA2C;AACxG,SAASH,OAAO,IAAII,iCAAiC,QAAQ,2CAA2C;AACxG,SAASjE,+BAA+B;AACxC,SAASvB,KAAK,QAAQ,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editorStore","Editor","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","reapplyBlockTypeFilters","get","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport Editor from './editor';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\n\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,4CAA4C,QACtC,0BAA0B;AACjC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,iBAAiB;AAClD,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;AAC3B,S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AC6C,QAAQ,CAAE,CAAC,EAAE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACA7C,MAAM,CAACuC,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzE/C,MAAM,CAACuC,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEzC,IAAI,CAAC0C,MAAM,CACVC,aAAA,CAACzD,MAAM;IACNK,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,SAAS4C,kBAAkBA,CAAA,EAAG;EACpClE,UAAU,CAAE,gCAAgC,EAAE;IAC7CmE,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,iCAAiC,QAAQ,2CAA2C;AACxG,SAASD,OAAO,IAAIE,iCAAiC,QAAQ,2CAA2C;AAExG,SAAS3E,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc","ignoreList":[]}
|
|
@@ -140,64 +140,6 @@
|
|
|
140
140
|
display: block;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper {
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
height: 60px;
|
|
148
|
-
}
|
|
149
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
|
|
150
|
-
border-bottom: 0;
|
|
151
|
-
height: 100%;
|
|
152
|
-
}
|
|
153
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar {
|
|
154
|
-
height: 100%;
|
|
155
|
-
padding-top: 15px;
|
|
156
|
-
}
|
|
157
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar .components-button:not(.block-editor-block-mover-button) {
|
|
158
|
-
height: 32px;
|
|
159
|
-
}
|
|
160
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper::after {
|
|
161
|
-
content: "";
|
|
162
|
-
width: 1px;
|
|
163
|
-
height: 24px;
|
|
164
|
-
background-color: #ddd;
|
|
165
|
-
margin-right: 8px;
|
|
166
|
-
}
|
|
167
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group,
|
|
168
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar {
|
|
169
|
-
border-left: none;
|
|
170
|
-
}
|
|
171
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group::after,
|
|
172
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar::after {
|
|
173
|
-
content: "";
|
|
174
|
-
width: 1px;
|
|
175
|
-
height: 24px;
|
|
176
|
-
background-color: #ddd;
|
|
177
|
-
margin-top: 4px;
|
|
178
|
-
margin-right: 8px;
|
|
179
|
-
}
|
|
180
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
|
|
181
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
|
|
182
|
-
display: none;
|
|
183
|
-
}
|
|
184
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
|
|
185
|
-
height: 32px;
|
|
186
|
-
overflow: visible;
|
|
187
|
-
}
|
|
188
|
-
@media (min-width: 600px) {
|
|
189
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container {
|
|
190
|
-
position: relative;
|
|
191
|
-
top: -10px;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper.is-collapsed {
|
|
195
|
-
display: none;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.edit-post-header__block-tools-toggle {
|
|
199
|
-
margin-right: 2px;
|
|
200
|
-
}
|
|
201
143
|
|
|
202
144
|
.edit-post-header__center {
|
|
203
145
|
flex-grow: 1;
|
|
@@ -472,13 +414,17 @@
|
|
|
472
414
|
.edit-post-layout .components-editor-notices__snackbar {
|
|
473
415
|
position: fixed;
|
|
474
416
|
left: 0;
|
|
475
|
-
bottom:
|
|
417
|
+
bottom: 16px;
|
|
476
418
|
padding-right: 16px;
|
|
477
419
|
padding-left: 16px;
|
|
478
420
|
}
|
|
479
421
|
|
|
480
422
|
.is-distraction-free .components-editor-notices__snackbar {
|
|
481
|
-
bottom:
|
|
423
|
+
bottom: 16px;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.has-block-breadcrumbs .components-editor-notices__snackbar {
|
|
427
|
+
bottom: 40px;
|
|
482
428
|
}
|
|
483
429
|
|
|
484
430
|
.edit-post-layout .components-editor-notices__snackbar {
|
|
@@ -519,87 +465,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
519
465
|
right: 0 !important;
|
|
520
466
|
}
|
|
521
467
|
|
|
522
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
523
|
-
position: fixed;
|
|
524
|
-
z-index: 100001;
|
|
525
|
-
top: 46px;
|
|
526
|
-
bottom: 0;
|
|
527
|
-
left: 0;
|
|
528
|
-
right: 0;
|
|
529
|
-
overflow: auto;
|
|
530
|
-
}
|
|
531
|
-
@media (min-width: 782px) {
|
|
532
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
533
|
-
z-index: 99998;
|
|
534
|
-
top: 32px;
|
|
535
|
-
right: auto;
|
|
536
|
-
width: 281px;
|
|
537
|
-
border-right: 1px solid #ddd;
|
|
538
|
-
transform: translateX(-100%);
|
|
539
|
-
animation: edit-post-post-publish-panel__slide-in-animation 0.1s forwards;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
@media (min-width: 782px) and (prefers-reduced-motion: reduce) {
|
|
543
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
544
|
-
animation-duration: 1ms;
|
|
545
|
-
animation-delay: 0s;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
@media (min-width: 782px) {
|
|
549
|
-
body.is-fullscreen-mode .edit-post-layout .editor-post-publish-panel {
|
|
550
|
-
top: 0;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
@media (min-width: 782px) {
|
|
554
|
-
[role=region]:focus .edit-post-layout .editor-post-publish-panel {
|
|
555
|
-
transform: translateX(0%);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
@keyframes edit-post-post-publish-panel__slide-in-animation {
|
|
560
|
-
100% {
|
|
561
|
-
transform: translateX(0%);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
.edit-post-layout .editor-post-publish-panel__header-publish-button {
|
|
565
|
-
justify-content: center;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
.edit-post-layout__toggle-publish-panel,
|
|
569
|
-
.edit-post-layout__toggle-sidebar-panel,
|
|
570
|
-
.edit-post-layout__toggle-entities-saved-states-panel {
|
|
571
|
-
z-index: 100000;
|
|
572
|
-
position: fixed !important;
|
|
573
|
-
top: -9999em;
|
|
574
|
-
bottom: auto;
|
|
575
|
-
right: auto;
|
|
576
|
-
left: 0;
|
|
577
|
-
box-sizing: border-box;
|
|
578
|
-
width: 280px;
|
|
579
|
-
background-color: #fff;
|
|
580
|
-
border: 1px dotted #ddd;
|
|
581
|
-
height: auto !important;
|
|
582
|
-
padding: 24px;
|
|
583
|
-
display: flex;
|
|
584
|
-
justify-content: center;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.interface-interface-skeleton__sidebar:focus .edit-post-layout__toggle-sidebar-panel, .interface-interface-skeleton__sidebar:focus-within .edit-post-layout__toggle-sidebar-panel {
|
|
588
|
-
top: auto;
|
|
589
|
-
bottom: 0;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-entities-saved-states-panel, .interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-entities-saved-states-panel,
|
|
593
|
-
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-publish-panel,
|
|
594
|
-
.interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-publish-panel {
|
|
595
|
-
top: auto;
|
|
596
|
-
bottom: 0;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.edit-post-layout .entities-saved-states__panel-header {
|
|
600
|
-
height: 61px;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
468
|
.edit-post-meta-boxes-area {
|
|
604
469
|
position: relative;
|
|
605
470
|
/**
|