@wordpress/edit-post 7.1.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +1 -1
- package/README.md +1 -11
- package/build/components/block-manager/category.js +12 -8
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/header/index.js +3 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +5 -8
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +1 -0
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/template-title/index.js +3 -1
- package/build/components/header/template-title/index.js.map +1 -1
- package/build/components/layout/index.js +3 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/meta-boxes/index.js +1 -7
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +1 -7
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +2 -2
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +8 -10
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +1 -0
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +2 -2
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +2 -2
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +2 -2
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/start-page-options/index.js +2 -4
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/visual-editor/index.js +3 -17
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/editor.js +14 -12
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +6 -3
- package/build/editor.native.js.map +1 -1
- package/build/experiments.js +19 -0
- package/build/experiments.js.map +1 -0
- package/build/index.js +17 -31
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +1 -3
- package/build/plugins/index.js.map +1 -1
- package/build-module/components/block-manager/category.js +12 -7
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/header/index.js +3 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js +5 -7
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +1 -0
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/template-title/index.js +3 -1
- package/build-module/components/header/template-title/index.js.map +1 -1
- package/build-module/components/layout/index.js +3 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +1 -6
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +1 -6
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +2 -2
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +9 -11
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/sidebar/post-template/form.js +1 -0
- package/build-module/components/sidebar/post-template/form.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +2 -2
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-url/index.js +2 -2
- package/build-module/components/sidebar/post-url/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +2 -2
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +2 -4
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -17
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/editor.js +15 -14
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +6 -2
- package/build-module/editor.native.js.map +1 -1
- package/build-module/experiments.js +9 -0
- package/build-module/experiments.js.map +1 -0
- package/build-module/index.js +16 -31
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +1 -2
- package/build-module/plugins/index.js.map +1 -1
- package/build-style/style-rtl.css +7 -2
- package/build-style/style.css +7 -2
- package/package.json +29 -28
- package/src/components/block-manager/category.js +4 -9
- package/src/components/header/index.js +5 -4
- package/src/components/header/template-title/delete-template.js +4 -10
- package/src/components/header/template-title/edit-template-title.js +1 -0
- package/src/components/header/template-title/index.js +1 -1
- package/src/components/header/template-title/style.scss +1 -4
- package/src/components/layout/index.js +5 -4
- package/src/components/meta-boxes/index.js +1 -6
- package/src/components/preferences-modal/meta-boxes-section.js +1 -6
- package/src/components/preferences-modal/options/test/enable-custom-fields.js +3 -11
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +3 -2
- package/src/components/sidebar/post-schedule/index.js +1 -2
- package/src/components/sidebar/post-template/create-modal.js +18 -24
- package/src/components/sidebar/post-template/form.js +1 -0
- package/src/components/sidebar/post-template/index.js +1 -2
- package/src/components/sidebar/post-url/index.js +1 -2
- package/src/components/sidebar/post-visibility/index.js +1 -1
- package/src/components/sidebar/settings-header/style.scss +8 -0
- package/src/components/start-page-options/index.js +2 -7
- package/src/components/visual-editor/index.js +11 -32
- package/src/editor.js +25 -38
- package/src/editor.native.js +1 -2
- package/src/experiments.js +10 -0
- package/src/index.js +17 -56
- package/src/plugins/index.js +0 -2
- package/build/plugins/navigation-list-view-menu-item.js +0 -48
- package/build/plugins/navigation-list-view-menu-item.js.map +0 -1
- package/build-module/plugins/navigation-list-view-menu-item.js +0 -40
- package/build-module/plugins/navigation-list-view-menu-item.js.map +0 -1
- package/src/plugins/navigation-list-view-menu-item.js +0 -56
package/build-module/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
7
7
|
import { registerCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
|
|
8
|
-
import
|
|
8
|
+
import deprecated from '@wordpress/deprecated';
|
|
9
|
+
import { createRoot } from '@wordpress/element';
|
|
9
10
|
import { dispatch, select } from '@wordpress/data';
|
|
10
11
|
import { addFilter } from '@wordpress/hooks';
|
|
11
12
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
@@ -18,32 +19,6 @@ import './hooks';
|
|
|
18
19
|
import './plugins';
|
|
19
20
|
import Editor from './editor';
|
|
20
21
|
import { store as editPostStore } from './store';
|
|
21
|
-
/**
|
|
22
|
-
* Reinitializes the editor after the user chooses to reboot the editor after
|
|
23
|
-
* an unhandled error occurs, replacing previously mounted editor element using
|
|
24
|
-
* an initial state from prior to the crash.
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} postType Post type of the post to edit.
|
|
27
|
-
* @param {Object} postId ID of the post to edit.
|
|
28
|
-
* @param {Element} target DOM node in which editor is rendered.
|
|
29
|
-
* @param {?Object} settings Editor settings object.
|
|
30
|
-
* @param {Object} initialEdits Programmatic edits to apply initially, to be
|
|
31
|
-
* considered as non-user-initiated (bypass for
|
|
32
|
-
* unsaved changes prompt).
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
export function reinitializeEditor(postType, postId, target, settings, initialEdits) {
|
|
36
|
-
unmountComponentAtNode(target);
|
|
37
|
-
const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
|
|
38
|
-
render(createElement(Editor, {
|
|
39
|
-
settings: settings,
|
|
40
|
-
onError: reboot,
|
|
41
|
-
postId: postId,
|
|
42
|
-
postType: postType,
|
|
43
|
-
initialEdits: initialEdits,
|
|
44
|
-
recovery: true
|
|
45
|
-
}), target);
|
|
46
|
-
}
|
|
47
22
|
/**
|
|
48
23
|
* Initializes and returns an instance of Editor.
|
|
49
24
|
*
|
|
@@ -58,7 +33,7 @@ export function reinitializeEditor(postType, postId, target, settings, initialEd
|
|
|
58
33
|
|
|
59
34
|
export function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
60
35
|
const target = document.getElementById(id);
|
|
61
|
-
const
|
|
36
|
+
const root = createRoot(target);
|
|
62
37
|
dispatch(preferencesStore).setDefaults('core/edit-post', {
|
|
63
38
|
editorMode: 'visual',
|
|
64
39
|
fixedToolbar: false,
|
|
@@ -146,13 +121,23 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
146
121
|
|
|
147
122
|
window.addEventListener('dragover', e => e.preventDefault(), false);
|
|
148
123
|
window.addEventListener('drop', e => e.preventDefault(), false);
|
|
149
|
-
render(createElement(Editor, {
|
|
124
|
+
root.render(createElement(Editor, {
|
|
150
125
|
settings: settings,
|
|
151
|
-
onError: reboot,
|
|
152
126
|
postId: postId,
|
|
153
127
|
postType: postType,
|
|
154
128
|
initialEdits: initialEdits
|
|
155
|
-
})
|
|
129
|
+
}));
|
|
130
|
+
return root;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Used to reinitialize the editor after an error. Now it's a deprecated noop function.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
export function reinitializeEditor() {
|
|
137
|
+
deprecated('wp.editPost.reinitializeEditor', {
|
|
138
|
+
since: '6.2',
|
|
139
|
+
version: '6.3'
|
|
140
|
+
});
|
|
156
141
|
}
|
|
157
142
|
export { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';
|
|
158
143
|
export { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","render","unmountComponentAtNode","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","Editor","editPostStore","reinitializeEditor","postType","postId","target","settings","initialEdits","reboot","bind","initializeEditor","id","document","getElementById","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,yBAAT,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CACNC,QADM,EAENC,MAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACDb,EAAAA,sBAAsB,CAAEW,MAAF,CAAtB;AACA,QAAMG,MAAM,GAAGN,kBAAkB,CAACO,IAAnB,CACd,IADc,EAE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,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASjF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { registerLegacyWidgetBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {Element} target DOM node in which editor is rendered.\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 reinitializeEditor(\n\tpostType,\n\tpostId,\n\ttarget,\n\tsettings,\n\tinitialEdits\n) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t\trecovery\n\t\t/>,\n\t\ttarget\n\t);\n}\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 target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind(\n\t\tnull,\n\t\tpostType,\n\t\tpostId,\n\t\ttarget,\n\t\tsettings,\n\t\tinitialEdits\n\t);\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { 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/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\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\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>,\n\t\ttarget\n\t);\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,yBAAT,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CACNC,EADM,EAENC,QAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBP,EAAzB,CAAf;AACA,QAAMQ,IAAI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C,cAAF,EAA9C,EAAkE,KAAlE;AACAZ,EAAAA,MAAM,CAACI,gBAAP,CAAyB,MAAzB,EAAmCO,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEA9C,EAAAA,IAAI,CAAC+C,MAAL,CACC,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGpD,QADZ;AAEC,IAAA,MAAM,EAAGD,MAFV;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,YAAY,EAAGG;AAJhB,IADD;AASA,SAAOI,IAAP;AACA;AAED;AACA;AACA;;AACA,OAAO,SAASgD,kBAAT,GAA8B;AACpClE,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CmE,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASnF,KAAT,QAAsB,SAAtB","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 { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { registerLegacyWidgetBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\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 target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { 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/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\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 PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
@@ -16,7 +16,6 @@ import CopyContentMenuItem from './copy-content-menu-item';
|
|
|
16
16
|
import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
|
|
17
17
|
import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
|
|
18
18
|
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
19
|
-
import NavigationListViewMenuItem from './navigation-list-view-menu-item';
|
|
20
19
|
registerPlugin('edit-post', {
|
|
21
20
|
render() {
|
|
22
21
|
return createElement(Fragment, null, createElement(ToolsMoreMenuGroup, null, _ref => {
|
|
@@ -41,7 +40,7 @@ registerPlugin('edit-post', {
|
|
|
41
40
|
},
|
|
42
41
|
/* translators: accessibility text */
|
|
43
42
|
__('(opens in a new tab)'))));
|
|
44
|
-
})
|
|
43
|
+
}));
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","render","onClose","post_type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,uBAAzC;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,6BAAP,MAA0C,qCAA1C;AACA,OAAOC,kBAAP,MAA+B,4CAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEAL,cAAc,CAAE,WAAF,EAAe;AAC5BM,EAAAA,MAAM,GAAG;AACR,WACC,8BACC,cAAC,kBAAD,QACG;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aACD,8BACC,cAAC,QAAD;AACC,QAAA,IAAI,EAAC,UADN;AAEC,QAAA,IAAI,EAAGN,YAAY,CAAE,UAAF,EAAc;AAChCO,UAAAA,SAAS,EAAE;AADqB,SAAd;AAFpB,SAMGT,EAAE,CAAE,wBAAF,CANL,CADD,EASC,cAAC,6BAAD;AACC,QAAA,QAAQ,EAAGQ;AADZ,QATD,EAYC,cAAC,oBAAD,OAZD,EAaC,cAAC,mBAAD,OAbD,EAcC,cAAC,QAAD;AACC,QAAA,IAAI,EAAC,UADN;AAEC,QAAA,IAAI,EAAGT,QAFR;AAGC,QAAA,IAAI,EAAGC,EAAE,CACR,yDADQ,CAHV;AAMC,QAAA,MAAM,EAAC,QANR;AAOC,QAAA,GAAG,EAAC;AAPL,SASGA,EAAE,CAAE,MAAF,CATL,EAUC,cAAC,cAAD;AAAgB,QAAA,EAAE,EAAC;AAAnB;AAEE;AACAA,MAAAA,EAAE,CAAE,sBAAF,CAHJ,CAVD,CAdD,CADC;AAAA,KADH,CADD,CADD;AAwCA;;AA1C2B,CAAf,CAAd","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Manage Reusable blocks' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/wordpress-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
|
|
@@ -501,6 +501,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
501
501
|
box-shadow: none;
|
|
502
502
|
font-weight: 500;
|
|
503
503
|
}
|
|
504
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active::after {
|
|
505
|
+
content: none;
|
|
506
|
+
}
|
|
504
507
|
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
505
508
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
506
509
|
}
|
|
@@ -993,8 +996,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
993
996
|
|
|
994
997
|
.edit-post-template-top-area__popover .components-popover__content {
|
|
995
998
|
min-width: 280px;
|
|
996
|
-
}
|
|
997
|
-
.edit-post-template-top-area__popover .components-popover__content > div {
|
|
998
999
|
padding: 0;
|
|
999
1000
|
}
|
|
1000
1001
|
.edit-post-template-top-area__popover .edit-site-template-details__group {
|
|
@@ -1642,6 +1643,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1642
1643
|
.components-button.edit-post-sidebar__panel-tab:focus:not(:disabled) {
|
|
1643
1644
|
position: relative;
|
|
1644
1645
|
box-shadow: none;
|
|
1646
|
+
outline: none;
|
|
1645
1647
|
}
|
|
1646
1648
|
.components-button.edit-post-sidebar__panel-tab::after {
|
|
1647
1649
|
content: "";
|
|
@@ -1663,6 +1665,8 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1663
1665
|
}
|
|
1664
1666
|
.components-button.edit-post-sidebar__panel-tab.is-active::after {
|
|
1665
1667
|
height: calc(1 * var(--wp-admin-border-width-focus));
|
|
1668
|
+
outline: 2px solid transparent;
|
|
1669
|
+
outline-offset: -1px;
|
|
1666
1670
|
}
|
|
1667
1671
|
.components-button.edit-post-sidebar__panel-tab::before {
|
|
1668
1672
|
content: "";
|
|
@@ -1684,6 +1688,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1684
1688
|
}
|
|
1685
1689
|
.components-button.edit-post-sidebar__panel-tab:focus-visible::before {
|
|
1686
1690
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1691
|
+
outline: 2px solid transparent;
|
|
1687
1692
|
}
|
|
1688
1693
|
|
|
1689
1694
|
h2.edit-post-template-summary__title {
|
package/build-style/style.css
CHANGED
|
@@ -501,6 +501,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
501
501
|
box-shadow: none;
|
|
502
502
|
font-weight: 500;
|
|
503
503
|
}
|
|
504
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active::after {
|
|
505
|
+
content: none;
|
|
506
|
+
}
|
|
504
507
|
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
505
508
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
506
509
|
}
|
|
@@ -993,8 +996,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
993
996
|
|
|
994
997
|
.edit-post-template-top-area__popover .components-popover__content {
|
|
995
998
|
min-width: 280px;
|
|
996
|
-
}
|
|
997
|
-
.edit-post-template-top-area__popover .components-popover__content > div {
|
|
998
999
|
padding: 0;
|
|
999
1000
|
}
|
|
1000
1001
|
.edit-post-template-top-area__popover .edit-site-template-details__group {
|
|
@@ -1642,6 +1643,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1642
1643
|
.components-button.edit-post-sidebar__panel-tab:focus:not(:disabled) {
|
|
1643
1644
|
position: relative;
|
|
1644
1645
|
box-shadow: none;
|
|
1646
|
+
outline: none;
|
|
1645
1647
|
}
|
|
1646
1648
|
.components-button.edit-post-sidebar__panel-tab::after {
|
|
1647
1649
|
content: "";
|
|
@@ -1663,6 +1665,8 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1663
1665
|
}
|
|
1664
1666
|
.components-button.edit-post-sidebar__panel-tab.is-active::after {
|
|
1665
1667
|
height: calc(1 * var(--wp-admin-border-width-focus));
|
|
1668
|
+
outline: 2px solid transparent;
|
|
1669
|
+
outline-offset: -1px;
|
|
1666
1670
|
}
|
|
1667
1671
|
.components-button.edit-post-sidebar__panel-tab::before {
|
|
1668
1672
|
content: "";
|
|
@@ -1684,6 +1688,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1684
1688
|
}
|
|
1685
1689
|
.components-button.edit-post-sidebar__panel-tab:focus-visible::before {
|
|
1686
1690
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1691
|
+
outline: 2px solid transparent;
|
|
1687
1692
|
}
|
|
1688
1693
|
|
|
1689
1694
|
h2.edit-post-template-summary__title {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,32 +27,33 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^11.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/components": "^23.
|
|
36
|
-
"@wordpress/compose": "^6.
|
|
37
|
-
"@wordpress/core-data": "^6.
|
|
38
|
-
"@wordpress/data": "^8.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/editor": "^13.
|
|
41
|
-
"@wordpress/element": "^5.
|
|
42
|
-
"@wordpress/
|
|
43
|
-
"@wordpress/
|
|
44
|
-
"@wordpress/
|
|
45
|
-
"@wordpress/
|
|
46
|
-
"@wordpress/
|
|
47
|
-
"@wordpress/
|
|
48
|
-
"@wordpress/
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
30
|
+
"@wordpress/a11y": "^3.26.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.23.0",
|
|
32
|
+
"@wordpress/block-editor": "^11.3.0",
|
|
33
|
+
"@wordpress/block-library": "^8.3.0",
|
|
34
|
+
"@wordpress/blocks": "^12.3.0",
|
|
35
|
+
"@wordpress/components": "^23.3.0",
|
|
36
|
+
"@wordpress/compose": "^6.3.0",
|
|
37
|
+
"@wordpress/core-data": "^6.3.0",
|
|
38
|
+
"@wordpress/data": "^8.3.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.26.0",
|
|
40
|
+
"@wordpress/editor": "^13.3.0",
|
|
41
|
+
"@wordpress/element": "^5.3.0",
|
|
42
|
+
"@wordpress/experiments": "^0.8.0",
|
|
43
|
+
"@wordpress/hooks": "^3.26.0",
|
|
44
|
+
"@wordpress/i18n": "^4.26.0",
|
|
45
|
+
"@wordpress/icons": "^9.17.0",
|
|
46
|
+
"@wordpress/interface": "^5.3.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^4.3.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.26.0",
|
|
49
|
+
"@wordpress/media-utils": "^4.17.0",
|
|
50
|
+
"@wordpress/notices": "^3.26.0",
|
|
51
|
+
"@wordpress/plugins": "^5.3.0",
|
|
52
|
+
"@wordpress/preferences": "^3.3.0",
|
|
53
|
+
"@wordpress/url": "^3.27.0",
|
|
54
|
+
"@wordpress/viewport": "^5.3.0",
|
|
55
|
+
"@wordpress/warning": "^2.26.0",
|
|
56
|
+
"@wordpress/widgets": "^3.3.0",
|
|
56
57
|
"classnames": "^2.3.1",
|
|
57
58
|
"lodash": "^4.17.21",
|
|
58
59
|
"memize": "^1.1.0",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"publishConfig": {
|
|
66
67
|
"access": "public"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "cab6ebe2b4c5dbacfd753dcae4a2406559c4813c"
|
|
69
70
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -50,7 +45,7 @@ function BlockManagerCategory( { title, blockTypes } ) {
|
|
|
50
45
|
}, [] );
|
|
51
46
|
const toggleAllVisible = useCallback(
|
|
52
47
|
( nextIsChecked ) => {
|
|
53
|
-
const blockNames = map(
|
|
48
|
+
const blockNames = blockTypes.map( ( { name } ) => name );
|
|
54
49
|
if ( nextIsChecked ) {
|
|
55
50
|
showBlockTypes( blockNames );
|
|
56
51
|
} else {
|
|
@@ -64,9 +59,9 @@ function BlockManagerCategory( { title, blockTypes } ) {
|
|
|
64
59
|
return null;
|
|
65
60
|
}
|
|
66
61
|
|
|
67
|
-
const checkedBlockNames =
|
|
68
|
-
(
|
|
69
|
-
|
|
62
|
+
const checkedBlockNames = filteredBlockTypes
|
|
63
|
+
.map( ( { name } ) => name )
|
|
64
|
+
.filter( ( type ) => ! hiddenBlockTypes.includes( type ) );
|
|
70
65
|
|
|
71
66
|
const titleId = 'edit-post-block-manager__category-title-' + instanceId;
|
|
72
67
|
|
|
@@ -31,7 +31,7 @@ function Header( { setEntitiesSavedStatesCallback } ) {
|
|
|
31
31
|
isPublishSidebarOpened,
|
|
32
32
|
isSaving,
|
|
33
33
|
showIconLabels,
|
|
34
|
-
|
|
34
|
+
isDistractionFreeMode,
|
|
35
35
|
} = useSelect(
|
|
36
36
|
( select ) => ( {
|
|
37
37
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
@@ -40,13 +40,14 @@ function Header( { setEntitiesSavedStatesCallback } ) {
|
|
|
40
40
|
isSaving: select( editPostStore ).isSavingMetaBoxes(),
|
|
41
41
|
showIconLabels:
|
|
42
42
|
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
43
|
-
|
|
44
|
-
select( editPostStore ).isFeatureActive( 'distractionFree' )
|
|
45
|
-
isLargeViewport,
|
|
43
|
+
isDistractionFreeMode:
|
|
44
|
+
select( editPostStore ).isFeatureActive( 'distractionFree' ),
|
|
46
45
|
} ),
|
|
47
46
|
[]
|
|
48
47
|
);
|
|
49
48
|
|
|
49
|
+
const isDistractionFree = isDistractionFreeMode && isLargeViewport;
|
|
50
|
+
|
|
50
51
|
const classes = classnames( 'edit-post-header' );
|
|
51
52
|
|
|
52
53
|
const slideY = {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { pickBy } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -58,11 +53,10 @@ export default function DeleteTemplate() {
|
|
|
58
53
|
template: '',
|
|
59
54
|
} );
|
|
60
55
|
const settings = getEditorSettings();
|
|
61
|
-
const newAvailableTemplates =
|
|
62
|
-
settings.availableTemplates
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
56
|
+
const newAvailableTemplates = Object.fromEntries(
|
|
57
|
+
Object.entries( settings.availableTemplates ?? {} ).filter(
|
|
58
|
+
( [ id ] ) => id !== template.slug
|
|
59
|
+
)
|
|
66
60
|
);
|
|
67
61
|
updateEditorSettings( {
|
|
68
62
|
...settings,
|
|
@@ -83,7 +83,7 @@ function Layout( { styles } ) {
|
|
|
83
83
|
isInserterOpened,
|
|
84
84
|
isListViewOpened,
|
|
85
85
|
showIconLabels,
|
|
86
|
-
|
|
86
|
+
isDistractionFreeMode,
|
|
87
87
|
showBlockBreadcrumbs,
|
|
88
88
|
isTemplateMode,
|
|
89
89
|
documentLabel,
|
|
@@ -116,9 +116,8 @@ function Layout( { styles } ) {
|
|
|
116
116
|
).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),
|
|
117
117
|
showIconLabels:
|
|
118
118
|
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
119
|
-
|
|
120
|
-
select( editPostStore ).isFeatureActive( 'distractionFree' )
|
|
121
|
-
isLargeViewport,
|
|
119
|
+
isDistractionFreeMode:
|
|
120
|
+
select( editPostStore ).isFeatureActive( 'distractionFree' ),
|
|
122
121
|
showBlockBreadcrumbs: select( editPostStore ).isFeatureActive(
|
|
123
122
|
'showBlockBreadcrumbs'
|
|
124
123
|
),
|
|
@@ -127,6 +126,8 @@ function Layout( { styles } ) {
|
|
|
127
126
|
};
|
|
128
127
|
}, [] );
|
|
129
128
|
|
|
129
|
+
const isDistractionFree = isDistractionFreeMode && isLargeViewport;
|
|
130
|
+
|
|
130
131
|
const className = classnames( 'edit-post-layout', 'is-mode-' + mode, {
|
|
131
132
|
'is-sidebar-opened': sidebarIsOpened,
|
|
132
133
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -50,7 +45,7 @@ export default function MetaBoxes( { location } ) {
|
|
|
50
45
|
|
|
51
46
|
return (
|
|
52
47
|
<>
|
|
53
|
-
{
|
|
48
|
+
{ ( metaBoxes ?? [] ).map( ( { id } ) => (
|
|
54
49
|
<MetaBoxVisibility key={ id } id={ id } />
|
|
55
50
|
) ) }
|
|
56
51
|
<MetaBoxesArea location={ location } />
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -36,7 +31,7 @@ export function MetaBoxesSection( {
|
|
|
36
31
|
{ areCustomFieldsRegistered && (
|
|
37
32
|
<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />
|
|
38
33
|
) }
|
|
39
|
-
{ map(
|
|
34
|
+
{ thirdPartyMetaBoxes.map( ( { id, title } ) => (
|
|
40
35
|
<EnablePanelOption
|
|
41
36
|
key={ id }
|
|
42
37
|
label={ title }
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
CustomFieldsConfirmation,
|
|
13
13
|
} from '../enable-custom-fields';
|
|
14
14
|
|
|
15
|
-
jest.useFakeTimers();
|
|
16
|
-
|
|
17
15
|
describe( 'EnableCustomFieldsOption', () => {
|
|
18
16
|
it( 'renders a checked checkbox when custom fields are enabled', () => {
|
|
19
17
|
const { container } = render(
|
|
@@ -32,9 +30,7 @@ describe( 'EnableCustomFieldsOption', () => {
|
|
|
32
30
|
} );
|
|
33
31
|
|
|
34
32
|
it( 'renders an unchecked checkbox and a confirmation message when toggled off', async () => {
|
|
35
|
-
const user = userEvent.setup(
|
|
36
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
37
|
-
} );
|
|
33
|
+
const user = userEvent.setup();
|
|
38
34
|
|
|
39
35
|
const { container } = render(
|
|
40
36
|
<EnableCustomFieldsOption areCustomFieldsEnabled />
|
|
@@ -46,9 +42,7 @@ describe( 'EnableCustomFieldsOption', () => {
|
|
|
46
42
|
} );
|
|
47
43
|
|
|
48
44
|
it( 'renders a checked checkbox and a confirmation message when toggled on', async () => {
|
|
49
|
-
const user = userEvent.setup(
|
|
50
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
51
|
-
} );
|
|
45
|
+
const user = userEvent.setup();
|
|
52
46
|
|
|
53
47
|
const { container } = render(
|
|
54
48
|
<EnableCustomFieldsOption areCustomFieldsEnabled={ false } />
|
|
@@ -62,9 +56,7 @@ describe( 'EnableCustomFieldsOption', () => {
|
|
|
62
56
|
|
|
63
57
|
describe( 'CustomFieldsConfirmation', () => {
|
|
64
58
|
it( 'submits the toggle-custom-fields-form', async () => {
|
|
65
|
-
const user = userEvent.setup(
|
|
66
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
67
|
-
} );
|
|
59
|
+
const user = userEvent.setup();
|
|
68
60
|
const submit = jest.fn();
|
|
69
61
|
const getElementById = jest
|
|
70
62
|
.spyOn( document, 'getElementById' )
|
|
@@ -84,7 +84,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
84
84
|
</h1>
|
|
85
85
|
</div>
|
|
86
86
|
<button
|
|
87
|
-
aria-label="Close
|
|
87
|
+
aria-label="Close"
|
|
88
88
|
class="components-button has-icon"
|
|
89
89
|
type="button"
|
|
90
90
|
>
|
|
@@ -597,6 +597,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
597
597
|
background: none;
|
|
598
598
|
text-align: start;
|
|
599
599
|
padding: calc((36px - calc(13px * 1.2) - 2px) / 2) 12px;
|
|
600
|
+
box-sizing: border-box;
|
|
600
601
|
width: 100%;
|
|
601
602
|
display: block;
|
|
602
603
|
margin: 0;
|
|
@@ -702,7 +703,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
702
703
|
</h1>
|
|
703
704
|
</div>
|
|
704
705
|
<button
|
|
705
|
-
aria-label="Close
|
|
706
|
+
aria-label="Close"
|
|
706
707
|
class="components-button has-icon"
|
|
707
708
|
type="button"
|
|
708
709
|
>
|
|
@@ -16,7 +16,7 @@ export default function PostSchedule() {
|
|
|
16
16
|
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
17
17
|
// Memoize popoverProps to avoid returning a new object every time.
|
|
18
18
|
const popoverProps = useMemo(
|
|
19
|
-
() => ( { anchor: popoverAnchor } ),
|
|
19
|
+
() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),
|
|
20
20
|
[ popoverAnchor ]
|
|
21
21
|
);
|
|
22
22
|
|
|
@@ -29,7 +29,6 @@ export default function PostSchedule() {
|
|
|
29
29
|
<span>{ __( 'Publish' ) }</span>
|
|
30
30
|
<Dropdown
|
|
31
31
|
popoverProps={ popoverProps }
|
|
32
|
-
position="bottom left"
|
|
33
32
|
contentClassName="edit-post-post-schedule__dialog"
|
|
34
33
|
focusOnMount
|
|
35
34
|
renderToggle={ ( { isOpen, onToggle } ) => (
|