@wordpress/edit-post 8.46.0 → 8.47.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/back-button/fullscreen-mode-close.cjs +10 -3
  3. package/build/components/back-button/fullscreen-mode-close.cjs.map +3 -3
  4. package/build/components/layout/index.cjs +34 -21
  5. package/build/components/layout/index.cjs.map +3 -3
  6. package/build/components/meta-boxes/use-meta-box-initialization.cjs +21 -7
  7. package/build/components/meta-boxes/use-meta-box-initialization.cjs.map +2 -2
  8. package/build/index.cjs +120 -9
  9. package/build/index.cjs.map +3 -3
  10. package/build-module/components/back-button/fullscreen-mode-close.mjs +21 -8
  11. package/build-module/components/back-button/fullscreen-mode-close.mjs.map +2 -2
  12. package/build-module/components/layout/index.mjs +37 -25
  13. package/build-module/components/layout/index.mjs.map +2 -2
  14. package/build-module/components/meta-boxes/use-meta-box-initialization.mjs +21 -7
  15. package/build-module/components/meta-boxes/use-meta-box-initialization.mjs.map +2 -2
  16. package/build-module/index.mjs +121 -10
  17. package/build-module/index.mjs.map +2 -2
  18. package/build-style/experimental-admin-bar-in-editor-rtl.css +50 -0
  19. package/build-style/experimental-admin-bar-in-editor.css +50 -0
  20. package/build-style/style-rtl.css +51 -0
  21. package/build-style/style.css +51 -0
  22. package/package.json +36 -36
  23. package/src/components/back-button/fullscreen-mode-close.js +39 -21
  24. package/src/components/layout/index.js +75 -66
  25. package/src/components/layout/index.native.js +3 -3
  26. package/src/components/meta-boxes/test/use-meta-box-initialization.js +31 -0
  27. package/src/components/meta-boxes/use-meta-box-initialization.js +30 -11
  28. package/src/experimental-admin-bar-in-editor.scss +67 -0
  29. package/src/index.js +155 -11
  30. package/src/style.scss +1 -0
@@ -6,7 +6,7 @@ import {
6
6
  } from "@wordpress/block-library";
7
7
  import deprecated from "@wordpress/deprecated";
8
8
  import { createRoot, StrictMode } from "@wordpress/element";
9
- import { dispatch, select } from "@wordpress/data";
9
+ import { dispatch, resolveSelect, select } from "@wordpress/data";
10
10
  import { store as preferencesStore } from "@wordpress/preferences";
11
11
  import {
12
12
  registerLegacyWidgetBlock,
@@ -16,6 +16,8 @@ import {
16
16
  store as editorStore,
17
17
  privateApis as editorPrivateApis
18
18
  } from "@wordpress/editor";
19
+ import { store as coreDataStore } from "@wordpress/core-data";
20
+ import apiFetch from "@wordpress/api-fetch";
19
21
  import Layout from "./components/layout/index.mjs";
20
22
  import { unlock } from "./lock-unlock.mjs";
21
23
  import { default as default2 } from "./components/back-button/fullscreen-mode-close.mjs";
@@ -26,6 +28,9 @@ var {
26
28
  BackButton: __experimentalMainDashboardButton,
27
29
  registerCoreBlockBindingsSources
28
30
  } = unlock(editorPrivateApis);
31
+ var { enablePreloadMultiUse, clearPreloadedData } = unlock(
32
+ apiFetch.privateApis
33
+ );
29
34
  function initializeEditor(id, postType, postId, settings, initialEdits) {
30
35
  const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches;
31
36
  const target = document.getElementById(id);
@@ -95,19 +100,125 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
95
100
  }
96
101
  window.addEventListener("dragover", (e) => e.preventDefault(), false);
97
102
  window.addEventListener("drop", (e) => e.preventDefault(), false);
98
- root.render(
99
- /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(
100
- Layout,
101
- {
102
- settings,
103
- postId,
103
+ enablePreloadMultiUse();
104
+ const preloadedResolutions = preloadResolutions(postType, postId);
105
+ preloadedResolutions.finally(() => {
106
+ clearPreloadedData();
107
+ if (postType && postId) {
108
+ const post = select(coreDataStore).getEntityRecord(
109
+ "postType",
104
110
  postType,
105
- initialEdits
111
+ postId
112
+ );
113
+ if (post) {
114
+ dispatch(editorStore).setupEditor(
115
+ post,
116
+ initialEdits,
117
+ settings.template
118
+ );
106
119
  }
107
- ) })
108
- );
120
+ }
121
+ root.render(
122
+ /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(
123
+ Layout,
124
+ {
125
+ settings,
126
+ postId,
127
+ postType,
128
+ initialEdits
129
+ }
130
+ ) })
131
+ );
132
+ });
109
133
  return root;
110
134
  }
135
+ async function preloadResolutions(postType, postId) {
136
+ const core = resolveSelect(coreDataStore);
137
+ const coreSelect = select(coreDataStore);
138
+ try {
139
+ await Promise.all([
140
+ core.getCurrentUser(),
141
+ core.getEntitiesConfig("postType"),
142
+ core.getEntitiesConfig("taxonomy"),
143
+ core.getEntitiesConfig("root"),
144
+ core.getEntityRecords("root", "taxonomy"),
145
+ core.getCurrentTheme(),
146
+ // Forward-resolver alias of `getCurrentTheme` with its own
147
+ // resolution metadata, so it needs a separate kick.
148
+ core.getThemeSupports(),
149
+ core.getBlockPatternCategories(),
150
+ core.__experimentalGetCurrentGlobalStylesId(),
151
+ core.__experimentalGetCurrentThemeBaseGlobalStyles(),
152
+ core.__experimentalGetCurrentThemeGlobalStylesVariations(),
153
+ core.getEntityRecord("root", "__unstableBase"),
154
+ core.getEntityRecord("root", "site"),
155
+ core.canUser("read", { kind: "root", name: "site" }),
156
+ core.canUser("create", { kind: "postType", name: "attachment" }),
157
+ core.canUser("create", { kind: "postType", name: "page" }),
158
+ core.canUser("create", { kind: "postType", name: "wp_block" }),
159
+ core.canUser("create", {
160
+ kind: "postType",
161
+ name: "wp_template"
162
+ }),
163
+ // Per-post resolvers. `getPostType` and `getEditedEntityRecord`
164
+ // are shorthand/forward-resolver aliases with their own
165
+ // resolution metadata, so they need separate kicks.
166
+ ...postType && postId ? [
167
+ core.getPostType(postType),
168
+ core.getEntityRecord("postType", postType, postId),
169
+ core.getEditedEntityRecord(
170
+ "postType",
171
+ postType,
172
+ postId
173
+ ),
174
+ core.getAutosaves(postType, postId),
175
+ core.getDefaultTemplateId({ slug: "front-page" }),
176
+ core.canUser("create", {
177
+ kind: "postType",
178
+ name: postType
179
+ })
180
+ ] : []
181
+ ]);
182
+ const tasks = [];
183
+ const globalStylesId = coreSelect.__experimentalGetCurrentGlobalStylesId();
184
+ if (globalStylesId) {
185
+ tasks.push(
186
+ core.getEntityRecord("root", "globalStyles", globalStylesId),
187
+ core.canUser("read", {
188
+ kind: "root",
189
+ name: "globalStyles",
190
+ id: globalStylesId
191
+ })
192
+ );
193
+ }
194
+ if (postType && postId) {
195
+ const post = coreSelect.getEntityRecord(
196
+ "postType",
197
+ postType,
198
+ postId
199
+ );
200
+ if (post) {
201
+ let slug = "page" === postType ? "page" : "single-" + postType;
202
+ if (post.slug) {
203
+ slug += "-" + post.slug;
204
+ }
205
+ tasks.push(core.getDefaultTemplateId({ slug }));
206
+ if (post.author) {
207
+ tasks.push(
208
+ core.getUser(post.author, {
209
+ context: "view",
210
+ _fields: "id,name"
211
+ })
212
+ );
213
+ }
214
+ }
215
+ }
216
+ if (tasks.length) {
217
+ await Promise.all(tasks);
218
+ }
219
+ } catch {
220
+ }
221
+ }
111
222
  function reinitializeEditor() {
112
223
  deprecated("wp.editPost.reinitializeEditor", {
113
224
  since: "6.2",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.js"],
4
- "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, StrictMode } 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\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( 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\teditorTool: 'edit',\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\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tshowCollaborationCursor: false,\n\t\tshowCollaborationNotifications: true,\n\t} );\n\n\tif ( window.__clientSideMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\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\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.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<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\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/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
5
- "mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC,SAAS,UAAU,cAAc;AACjC,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AAKP,OAAO,YAAY;AACnB,SAAS,cAAc;AAuJvB,SAAoB,WAAXA,gBAAoD;AAE7D,SAAS,aAAa;AACtB,cAAc;AAzBX;AA/HH,IAAM;AAAA,EACL,YAAY;AAAA,EACZ;AACD,IAAI,OAAQ,iBAAkB;AAavB,SAAS,iBACf,IACA,UACA,QACA,UACA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AAEnC,YAAQ;AAAA,MACP;AAAA,IACD;AAAA,EACD;AASA,QAAM,WAAW,OAAO,UAAU,UAAU,QAAS,QAAS,MAAM;AACpE,MAAK,UAAW;AACf,WAAO,iBAAkB,UAAU,CAAE,UAAW;AAC/C,YAAM,wBAAwB,SAAS;AAAA,QACtC;AAAA,MACD,EAAG,CAAE;AACL,UAAK,MAAM,WAAW,UAAW;AAGhC,YAAK,OAAO,UAAU,KAAM;AAC3B,gCAAsB,YACrB,sBAAsB,YAAY,OAAO;AAAA,QAC3C;AAEA,YACC,SAAS,uBAAwB,gBAAiB,EAAG,CAAE,GACtD;AACD,iBAAO,SAAU,GAAG,CAAE;AAAA,QACvB;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH;AAGA,SAAO,iBAAkB,YAAY,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AACxE,SAAO,iBAAkB,QAAQ,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AAEpE,OAAK;AAAA,IACJ,oBAAC,cACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD,GACD;AAAA,EACD;AAEA,SAAO;AACR;AAKO,SAAS,qBAAqB;AACpC,aAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
4
+ "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, StrictMode } from '@wordpress/element';\nimport { dispatch, resolveSelect, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\nconst { enablePreloadMultiUse, clearPreloadedData } = unlock(\n\tapiFetch.privateApis\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 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\teditorTool: 'edit',\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\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tshowCollaborationCursor: false,\n\t\tshowCollaborationNotifications: true,\n\t} );\n\n\tif ( window.__clientSideMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\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\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.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\t// Drive the resolvers whose data `createPreloadingMiddleware`\n\t// already has cached so every metadata entry they touch is\n\t// `finished` by the time React mounts \u2014 no `setTimeout(0)`\n\t// resolution dance on first render. Multi-use lets a single\n\t// preloaded URL back several selectors (e.g. /wp/v2/settings GET +\n\t// OPTIONS serves `getEntitiesConfig`, `canUser`, `getEntityRecord`).\n\tenablePreloadMultiUse();\n\tconst preloadedResolutions = preloadResolutions( postType, postId );\n\n\tpreloadedResolutions.finally( () => {\n\t\t// Anything not consumed by the kickoff falls through to a real\n\t\t// network request from here on. `clearPreloadedData` logs which\n\t\t// preload entries (if any) were never served.\n\t\tclearPreloadedData();\n\t\tif ( postType && postId ) {\n\t\t\tconst post = select( coreDataStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\tdispatch( editorStore ).setupEditor(\n\t\t\t\t\tpost,\n\t\t\t\t\tinitialEdits,\n\t\t\t\t\tsettings.template\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<Layout\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n\n\treturn root;\n}\n\n/**\n * Drive resolvers to completion against the preload cache before React\n * mounts. Two phases: known-up-front args (post id + type), then args\n * derived from phase-1 state (post slug \u2192 template, current global\n * styles id \u2192 record + canUser).\n *\n * @param {string} postType Current post type.\n * @param {number} postId Current post id.\n * @return {Promise<void>} Resolves when the kickoff resolvers settle.\n */\nasync function preloadResolutions( postType, postId ) {\n\tconst core = resolveSelect( coreDataStore );\n\tconst coreSelect = select( coreDataStore );\n\n\ttry {\n\t\tawait Promise.all( [\n\t\t\tcore.getCurrentUser(),\n\t\t\tcore.getEntitiesConfig( 'postType' ),\n\t\t\tcore.getEntitiesConfig( 'taxonomy' ),\n\t\t\tcore.getEntitiesConfig( 'root' ),\n\t\t\tcore.getEntityRecords( 'root', 'taxonomy' ),\n\t\t\tcore.getCurrentTheme(),\n\t\t\t// Forward-resolver alias of `getCurrentTheme` with its own\n\t\t\t// resolution metadata, so it needs a separate kick.\n\t\t\tcore.getThemeSupports(),\n\t\t\tcore.getBlockPatternCategories(),\n\t\t\tcore.__experimentalGetCurrentGlobalStylesId(),\n\t\t\tcore.__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t\tcore.__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t\tcore.getEntityRecord( 'root', '__unstableBase' ),\n\t\t\tcore.getEntityRecord( 'root', 'site' ),\n\t\t\tcore.canUser( 'read', { kind: 'root', name: 'site' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'attachment' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'page' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'wp_block' } ),\n\t\t\tcore.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t\t// Per-post resolvers. `getPostType` and `getEditedEntityRecord`\n\t\t\t// are shorthand/forward-resolver aliases with their own\n\t\t\t// resolution metadata, so they need separate kicks.\n\t\t\t...( postType && postId\n\t\t\t\t? [\n\t\t\t\t\t\tcore.getPostType( postType ),\n\t\t\t\t\t\tcore.getEntityRecord( 'postType', postType, postId ),\n\t\t\t\t\t\tcore.getEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcore.getAutosaves( postType, postId ),\n\t\t\t\t\t\tcore.getDefaultTemplateId( { slug: 'front-page' } ),\n\t\t\t\t\t\tcore.canUser( 'create', {\n\t\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\t\tname: postType,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [] ),\n\t\t] );\n\n\t\t// Phase 2: read derived data out of state.\n\t\tconst tasks = [];\n\t\tconst globalStylesId =\n\t\t\tcoreSelect.__experimentalGetCurrentGlobalStylesId();\n\t\tif ( globalStylesId ) {\n\t\t\ttasks.push(\n\t\t\t\tcore.getEntityRecord( 'root', 'globalStyles', globalStylesId ),\n\t\t\t\tcore.canUser( 'read', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\tid: globalStylesId,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\tconst post = coreSelect.getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\t// Mirrors core-data's `getDefaultTemplate` slug formula.\n\t\t\t\tlet slug = 'page' === postType ? 'page' : 'single-' + postType;\n\t\t\t\tif ( post.slug ) {\n\t\t\t\t\tslug += '-' + post.slug;\n\t\t\t\t}\n\t\t\t\ttasks.push( core.getDefaultTemplateId( { slug } ) );\n\n\t\t\t\tif ( post.author ) {\n\t\t\t\t\ttasks.push(\n\t\t\t\t\t\tcore.getUser( post.author, {\n\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t_fields: 'id,name',\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( tasks.length ) {\n\t\t\tawait Promise.all( tasks );\n\t\t}\n\t} catch {\n\t\t// Resolver failures here would also surface on demand; don't block render.\n\t}\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/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
5
+ "mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC,SAAS,UAAU,eAAe,cAAc;AAChD,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,SAAS,qBAAqB;AACvC,OAAO,cAAc;AAKrB,OAAO,YAAY;AACnB,SAAS,cAAc;AAqSvB,SAAoB,WAAXA,gBAAoD;AAE7D,SAAS,aAAa;AACtB,cAAc;AAvIV;AA/JJ,IAAM;AAAA,EACL,YAAY;AAAA,EACZ;AACD,IAAI,OAAQ,iBAAkB;AAE9B,IAAM,EAAE,uBAAuB,mBAAmB,IAAI;AAAA,EACrD,SAAS;AACV;AAaO,SAAS,iBACf,IACA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AAM;AAAA,QACL,KAAK,gBAAiB,QAAQ,gBAAgB,cAAe;AAAA,QAC7D,KAAK,QAAS,QAAQ;AAAA,UACrB,MAAM;AAAA,UACN,MAAM;AAAA,UACN,IAAI;AAAA,QACL,CAAE;AAAA,MACH;AAAA,IACD;AAEA,QAAK,YAAY,QAAS;AACzB,YAAM,OAAO,WAAW;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACD;AACA,UAAK,MAAO;AAEX,YAAI,OAAO,WAAW,WAAW,SAAS,YAAY;AACtD,YAAK,KAAK,MAAO;AAChB,kBAAQ,MAAM,KAAK;AAAA,QACpB;AACA,cAAM,KAAM,KAAK,qBAAsB,EAAE,KAAK,CAAE,CAAE;AAElD,YAAK,KAAK,QAAS;AAClB,gBAAM;AAAA,YACL,KAAK,QAAS,KAAK,QAAQ;AAAA,cAC1B,SAAS;AAAA,cACT,SAAS;AAAA,YACV,CAAE;AAAA,UACH;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAEA,QAAK,MAAM,QAAS;AACnB,YAAM,QAAQ,IAAK,KAAM;AAAA,IAC1B;AAAA,EACD,QAAQ;AAAA,EAER;AACD;AAKO,SAAS,qBAAqB;AACpC,aAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
6
6
  "names": ["default"]
7
7
  }
@@ -0,0 +1,50 @@
1
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 32px;
6
+ height: 32px;
7
+ }
8
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
9
+ top: auto;
10
+ right: auto;
11
+ width: 32px;
12
+ height: 32px;
13
+ background: transparent;
14
+ }
15
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
16
+ color: var(--wp-admin-theme-color);
17
+ }
18
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
19
+ grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
20
+ }
21
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
22
+ grid-template-columns: 32px min-content 1fr min-content 64px;
23
+ }
24
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
25
+ padding-right: 8px;
26
+ }
27
+ @media (min-width: 782px) {
28
+ body.has-admin-bar-in-editor.is-fullscreen-mode {
29
+ margin-top: 0;
30
+ height: 100%;
31
+ }
32
+ body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
33
+ display: block;
34
+ }
35
+ body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
36
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
37
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
38
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
39
+ top: var(--wp-admin--admin-bar--height, 0);
40
+ }
41
+ body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
42
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
43
+ }
44
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
45
+ --wp-admin--admin-bar--height: 0;
46
+ }
47
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
48
+ display: none;
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 32px;
6
+ height: 32px;
7
+ }
8
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
9
+ top: auto;
10
+ left: auto;
11
+ width: 32px;
12
+ height: 32px;
13
+ background: transparent;
14
+ }
15
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
16
+ color: var(--wp-admin-theme-color);
17
+ }
18
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
19
+ grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
20
+ }
21
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
22
+ grid-template-columns: 32px min-content 1fr min-content 64px;
23
+ }
24
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
25
+ padding-left: 8px;
26
+ }
27
+ @media (min-width: 782px) {
28
+ body.has-admin-bar-in-editor.is-fullscreen-mode {
29
+ margin-top: 0;
30
+ height: 100%;
31
+ }
32
+ body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
33
+ display: block;
34
+ }
35
+ body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
36
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
37
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
38
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
39
+ top: var(--wp-admin--admin-bar--height, 0);
40
+ }
41
+ body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
42
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
43
+ }
44
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
45
+ --wp-admin--admin-bar--height: 0;
46
+ }
47
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
48
+ display: none;
49
+ }
50
+ }
@@ -442,6 +442,57 @@
442
442
  fill: #fff;
443
443
  }
444
444
 
445
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
446
+ display: flex;
447
+ align-items: center;
448
+ justify-content: center;
449
+ width: 32px;
450
+ height: 32px;
451
+ }
452
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
453
+ top: auto;
454
+ right: auto;
455
+ width: 32px;
456
+ height: 32px;
457
+ background: transparent;
458
+ }
459
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
460
+ color: var(--wp-admin-theme-color);
461
+ }
462
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
463
+ grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
464
+ }
465
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
466
+ grid-template-columns: 32px min-content 1fr min-content 64px;
467
+ }
468
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
469
+ padding-right: 8px;
470
+ }
471
+ @media (min-width: 782px) {
472
+ body.has-admin-bar-in-editor.is-fullscreen-mode {
473
+ margin-top: 0;
474
+ height: 100%;
475
+ }
476
+ body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
477
+ display: block;
478
+ }
479
+ body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
480
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
481
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
482
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
483
+ top: var(--wp-admin--admin-bar--height, 0);
484
+ }
485
+ body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
486
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
487
+ }
488
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
489
+ --wp-admin--admin-bar--height: 0;
490
+ }
491
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
492
+ display: none;
493
+ }
494
+ }
495
+
445
496
  body.js.block-editor-page {
446
497
  background: #fff;
447
498
  }
@@ -442,6 +442,57 @@
442
442
  fill: #fff;
443
443
  }
444
444
 
445
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
446
+ display: flex;
447
+ align-items: center;
448
+ justify-content: center;
449
+ width: 32px;
450
+ height: 32px;
451
+ }
452
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
453
+ top: auto;
454
+ left: auto;
455
+ width: 32px;
456
+ height: 32px;
457
+ background: transparent;
458
+ }
459
+ body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
460
+ color: var(--wp-admin-theme-color);
461
+ }
462
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
463
+ grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
464
+ }
465
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
466
+ grid-template-columns: 32px min-content 1fr min-content 64px;
467
+ }
468
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
469
+ padding-left: 8px;
470
+ }
471
+ @media (min-width: 782px) {
472
+ body.has-admin-bar-in-editor.is-fullscreen-mode {
473
+ margin-top: 0;
474
+ height: 100%;
475
+ }
476
+ body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
477
+ display: block;
478
+ }
479
+ body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
480
+ body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
481
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
482
+ body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
483
+ top: var(--wp-admin--admin-bar--height, 0);
484
+ }
485
+ body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
486
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
487
+ }
488
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
489
+ --wp-admin--admin-bar--height: 0;
490
+ }
491
+ body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
492
+ display: none;
493
+ }
494
+ }
495
+
445
496
  body.js.block-editor-page {
446
497
  background: #fff;
447
498
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "8.46.0",
3
+ "version": "8.47.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -48,47 +48,47 @@
48
48
  "postbox"
49
49
  ],
50
50
  "dependencies": {
51
- "@wordpress/a11y": "^4.46.0",
52
- "@wordpress/admin-ui": "^2.1.0",
53
- "@wordpress/api-fetch": "^7.46.0",
54
- "@wordpress/base-styles": "^8.0.0",
55
- "@wordpress/block-editor": "^15.19.0",
56
- "@wordpress/block-library": "^9.46.0",
57
- "@wordpress/blocks": "^15.19.0",
58
- "@wordpress/commands": "^1.46.0",
59
- "@wordpress/components": "^33.1.0",
60
- "@wordpress/compose": "^7.46.0",
61
- "@wordpress/core-data": "^7.46.0",
62
- "@wordpress/data": "^10.46.0",
63
- "@wordpress/deprecated": "^4.46.0",
64
- "@wordpress/dom": "^4.46.0",
65
- "@wordpress/editor": "^14.46.0",
66
- "@wordpress/element": "^6.46.0",
67
- "@wordpress/global-styles-engine": "^1.13.0",
68
- "@wordpress/hooks": "^4.46.0",
69
- "@wordpress/html-entities": "^4.46.0",
70
- "@wordpress/i18n": "^6.19.0",
71
- "@wordpress/icons": "^13.1.0",
72
- "@wordpress/keyboard-shortcuts": "^5.46.0",
73
- "@wordpress/keycodes": "^4.46.0",
74
- "@wordpress/notices": "^5.46.0",
75
- "@wordpress/plugins": "^7.46.0",
76
- "@wordpress/preferences": "^4.46.0",
77
- "@wordpress/private-apis": "^1.46.0",
78
- "@wordpress/ui": "^0.13.0",
79
- "@wordpress/url": "^4.46.0",
80
- "@wordpress/viewport": "^6.46.0",
81
- "@wordpress/warning": "^3.46.0",
82
- "@wordpress/widgets": "^4.46.0",
51
+ "@wordpress/a11y": "^4.47.0",
52
+ "@wordpress/admin-ui": "^2.2.0",
53
+ "@wordpress/api-fetch": "^7.47.0",
54
+ "@wordpress/base-styles": "^9.0.0",
55
+ "@wordpress/block-editor": "^15.20.0",
56
+ "@wordpress/block-library": "^9.47.0",
57
+ "@wordpress/blocks": "^15.20.0",
58
+ "@wordpress/commands": "^1.47.0",
59
+ "@wordpress/components": "^34.0.0",
60
+ "@wordpress/compose": "^8.0.0",
61
+ "@wordpress/core-data": "^7.47.0",
62
+ "@wordpress/data": "^10.47.0",
63
+ "@wordpress/deprecated": "^4.47.0",
64
+ "@wordpress/dom": "^4.47.0",
65
+ "@wordpress/editor": "^14.47.0",
66
+ "@wordpress/element": "^7.0.0",
67
+ "@wordpress/global-styles-engine": "^1.14.0",
68
+ "@wordpress/hooks": "^4.47.0",
69
+ "@wordpress/html-entities": "^4.47.0",
70
+ "@wordpress/i18n": "^6.20.0",
71
+ "@wordpress/icons": "^13.2.0",
72
+ "@wordpress/keyboard-shortcuts": "^5.47.0",
73
+ "@wordpress/keycodes": "^4.47.0",
74
+ "@wordpress/notices": "^5.47.0",
75
+ "@wordpress/plugins": "^7.47.0",
76
+ "@wordpress/preferences": "^4.47.0",
77
+ "@wordpress/private-apis": "^1.47.0",
78
+ "@wordpress/ui": "^0.14.0",
79
+ "@wordpress/url": "^4.47.0",
80
+ "@wordpress/viewport": "^6.47.0",
81
+ "@wordpress/warning": "^3.47.0",
82
+ "@wordpress/widgets": "^4.47.0",
83
83
  "clsx": "^2.1.1",
84
84
  "memize": "^2.1.0"
85
85
  },
86
86
  "peerDependencies": {
87
- "react": "^18.0.0",
88
- "react-dom": "^18.0.0"
87
+ "react": "^19.2.4",
88
+ "react-dom": "^19.2.4"
89
89
  },
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "51264e33b95fadff9a06b68141e674ce9cde9675"
93
+ "gitHead": "d653c5fd6161571a0c2ebde28553d6e25624eacc"
94
94
  }
@@ -9,12 +9,18 @@ import clsx from 'clsx';
9
9
  import { useSelect } from '@wordpress/data';
10
10
  import {
11
11
  Button,
12
- Icon,
12
+ Icon as WCIcon,
13
13
  __unstableMotion as motion,
14
14
  } from '@wordpress/components';
15
- import { __ } from '@wordpress/i18n';
15
+ import { __, isRTL } from '@wordpress/i18n';
16
16
  import { addQueryArgs } from '@wordpress/url';
17
- import { wordpress, arrowUpLeft } from '@wordpress/icons';
17
+ import {
18
+ wordpress,
19
+ arrowUpLeft,
20
+ arrowUpRight,
21
+ chevronLeft,
22
+ chevronRight,
23
+ } from '@wordpress/icons';
18
24
  import { store as editorStore } from '@wordpress/editor';
19
25
  import { store as coreStore } from '@wordpress/core-data';
20
26
  import { useReducedMotion } from '@wordpress/compose';
@@ -90,7 +96,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
90
96
  );
91
97
  } else {
92
98
  siteIconContent = (
93
- <Icon
99
+ <WCIcon
94
100
  className="edit-post-fullscreen-mode-close-site-icon__icon"
95
101
  icon={ wordpress }
96
102
  size={ 48 }
@@ -100,7 +106,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
100
106
 
101
107
  // Override default icon if custom icon is provided via props.
102
108
  const buttonIcon = icon ? (
103
- <Icon size="36px" icon={ icon } />
109
+ <WCIcon size="36px" icon={ icon } />
104
110
  ) : (
105
111
  <div className="edit-post-fullscreen-mode-close-site-icon">
106
112
  { siteIconContent }
@@ -119,6 +125,8 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
119
125
 
120
126
  const buttonLabel = postType?.labels?.view_items ?? __( 'Back' );
121
127
 
128
+ const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
129
+
122
130
  return (
123
131
  <motion.div
124
132
  className="edit-post-fullscreen-mode-close__view-mode-toggle"
@@ -136,23 +144,33 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
136
144
  showTooltip={ showTooltip }
137
145
  tooltipPosition="bottom"
138
146
  >
139
- <motion.div variants={ ! disableMotion && siteIconVariants }>
140
- <div className="edit-post-fullscreen-mode-close__view-mode-toggle-icon">
141
- { buttonIcon }
142
- </div>
143
- </motion.div>
144
- </Button>
145
- <motion.div
146
- className={ clsx(
147
- 'edit-post-fullscreen-mode-close__back-icon',
148
- {
149
- 'has-site-icon': siteIconUrl,
150
- }
147
+ { ! hasAdminBarInEditor && (
148
+ <motion.div
149
+ variants={ ! disableMotion && siteIconVariants }
150
+ >
151
+ <div className="edit-post-fullscreen-mode-close__view-mode-toggle-icon">
152
+ { buttonIcon }
153
+ </div>
154
+ </motion.div>
151
155
  ) }
152
- variants={ ! disableMotion && toggleHomeIconVariants }
153
- >
154
- <Icon icon={ arrowUpLeft } />
155
- </motion.div>
156
+ </Button>
157
+ { hasAdminBarInEditor ? (
158
+ <div className="edit-post-fullscreen-mode-close__back-icon">
159
+ <WCIcon icon={ isRTL() ? chevronRight : chevronLeft } />
160
+ </div>
161
+ ) : (
162
+ <motion.div
163
+ className={ clsx(
164
+ 'edit-post-fullscreen-mode-close__back-icon',
165
+ {
166
+ 'has-site-icon': siteIconUrl,
167
+ }
168
+ ) }
169
+ variants={ ! disableMotion && toggleHomeIconVariants }
170
+ >
171
+ <WCIcon icon={ isRTL() ? arrowUpRight : arrowUpLeft } />
172
+ </motion.div>
173
+ ) }
156
174
  </motion.div>
157
175
  );
158
176
  }