@wordpress/edit-site 6.34.1-next.2f1c7c01b.0 → 6.35.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 (47) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/editor/index.js +9 -18
  3. package/build/components/editor/index.js.map +2 -2
  4. package/build/components/page-patterns/index.js +1 -1
  5. package/build/components/page-patterns/index.js.map +2 -2
  6. package/build/index.js +0 -3
  7. package/build/index.js.map +2 -2
  8. package/build-module/components/editor/index.js +9 -18
  9. package/build-module/components/editor/index.js.map +2 -2
  10. package/build-module/components/page-patterns/index.js +1 -1
  11. package/build-module/components/page-patterns/index.js.map +2 -2
  12. package/build-module/index.js +0 -2
  13. package/build-module/index.js.map +2 -2
  14. package/build-style/style-rtl.css +41 -40
  15. package/build-style/style.css +41 -40
  16. package/package.json +46 -46
  17. package/src/components/editor/index.js +11 -27
  18. package/src/components/page-patterns/index.js +1 -1
  19. package/src/index.js +0 -4
  20. package/build/components/posts-app/index.js +0 -51
  21. package/build/components/posts-app/index.js.map +0 -7
  22. package/build/components/posts-app-routes/index.js +0 -46
  23. package/build/components/posts-app-routes/index.js.map +0 -7
  24. package/build/components/posts-app-routes/post-item.js +0 -61
  25. package/build/components/posts-app-routes/post-item.js.map +0 -7
  26. package/build/components/posts-app-routes/posts.js +0 -106
  27. package/build/components/posts-app-routes/posts.js.map +0 -7
  28. package/build/posts.js +0 -96
  29. package/build/posts.js.map +0 -7
  30. package/build-module/components/posts-app/index.js +0 -20
  31. package/build-module/components/posts-app/index.js.map +0 -7
  32. package/build-module/components/posts-app-routes/index.js +0 -21
  33. package/build-module/components/posts-app-routes/index.js.map +0 -7
  34. package/build-module/components/posts-app-routes/post-item.js +0 -26
  35. package/build-module/components/posts-app-routes/post-item.js.map +0 -7
  36. package/build-module/components/posts-app-routes/posts.js +0 -71
  37. package/build-module/components/posts-app-routes/posts.js.map +0 -7
  38. package/build-module/posts.js +0 -68
  39. package/build-module/posts.js.map +0 -7
  40. package/build-style/posts-rtl.css +0 -3105
  41. package/build-style/posts.css +0 -3105
  42. package/src/components/posts-app/index.js +0 -27
  43. package/src/components/posts-app-routes/index.js +0 -25
  44. package/src/components/posts-app-routes/post-item.js +0 -27
  45. package/src/components/posts-app-routes/posts.js +0 -79
  46. package/src/posts.js +0 -91
  47. package/src/posts.scss +0 -57
@@ -1,27 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
- import { useSelect } from '@wordpress/data';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import Layout from '../layout';
11
- import { useRegisterPostsAppRoutes } from '../posts-app-routes';
12
- import { unlock } from '../../lock-unlock';
13
- import { store as editSiteStore } from '../../store';
14
-
15
- const { RouterProvider } = unlock( routerPrivateApis );
16
-
17
- export default function PostsApp() {
18
- useRegisterPostsAppRoutes();
19
- const routes = useSelect( ( select ) => {
20
- return unlock( select( editSiteStore ) ).getRoutes();
21
- }, [] );
22
- return (
23
- <RouterProvider routes={ routes } pathArg="p">
24
- <Layout />
25
- </RouterProvider>
26
- );
27
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useRegistry, useDispatch } from '@wordpress/data';
5
- import { useEffect } from '@wordpress/element';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import { unlock } from '../../lock-unlock';
11
- import { store as siteEditorStore } from '../../store';
12
- import { postsRoute } from './posts';
13
- import { postItemRoute } from './post-item';
14
-
15
- const routes = [ postItemRoute, postsRoute ];
16
-
17
- export function useRegisterPostsAppRoutes() {
18
- const registry = useRegistry();
19
- const { registerRoute } = unlock( useDispatch( siteEditorStore ) );
20
- useEffect( () => {
21
- registry.batch( () => {
22
- routes.forEach( registerRoute );
23
- } );
24
- }, [ registry, registerRoute ] );
25
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import Editor from '../editor';
10
- import DataViewsSidebarContent from '../sidebar-dataviews';
11
- import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
-
13
- export const postItemRoute = {
14
- name: 'post-item',
15
- path: '/post/:postId',
16
- areas: {
17
- sidebar: (
18
- <SidebarNavigationScreen
19
- title={ __( 'Posts' ) }
20
- isRoot
21
- content={ <DataViewsSidebarContent postType="post" /> }
22
- />
23
- ),
24
- mobile: <Editor isPostsList />,
25
- preview: <Editor isPostsList />,
26
- },
27
- };
@@ -1,79 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
- import { __ } from '@wordpress/i18n';
6
- import { loadView } from '@wordpress/views';
7
- import { resolveSelect } from '@wordpress/data';
8
- import { store as coreStore } from '@wordpress/core-data';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import Editor from '../editor';
14
- import SidebarNavigationScreen from '../sidebar-navigation-screen';
15
- import DataViewsSidebarContent from '../sidebar-dataviews';
16
- import PostList from '../post-list';
17
- import { unlock } from '../../lock-unlock';
18
- import { PostEdit } from '../post-edit';
19
- import { getDefaultView } from '../post-list/view-utils';
20
-
21
- const { useLocation } = unlock( routerPrivateApis );
22
-
23
- async function isListView( query ) {
24
- const { activeView = 'all' } = query;
25
- const postTypeObject =
26
- await resolveSelect( coreStore ).getPostType( 'post' );
27
- const view = await loadView( {
28
- kind: 'postType',
29
- name: 'post',
30
- slug: activeView,
31
- defaultView: getDefaultView( postTypeObject, activeView ),
32
- } );
33
- return view.type === 'list';
34
- }
35
-
36
- function MobilePostsView() {
37
- const { query = {} } = useLocation();
38
- const { canvas = 'view' } = query;
39
-
40
- return canvas === 'edit' ? <Editor /> : <PostList postType="post" />;
41
- }
42
-
43
- export const postsRoute = {
44
- name: 'posts',
45
- path: '/',
46
- areas: {
47
- sidebar: (
48
- <SidebarNavigationScreen
49
- title={ __( 'Posts' ) }
50
- isRoot
51
- content={ <DataViewsSidebarContent postType="post" /> }
52
- />
53
- ),
54
- content: <PostList postType="post" />,
55
- async preview( { query } ) {
56
- const isList = await isListView( query );
57
- return isList ? <Editor isPostsList /> : undefined;
58
- },
59
- mobile: <MobilePostsView />,
60
- async edit( { query } ) {
61
- const isList = await isListView( query );
62
- const hasQuickEdit = ! isList && !! query.quickEdit;
63
- return hasQuickEdit ? (
64
- <PostEdit postType="post" postId={ query.postId } />
65
- ) : undefined;
66
- },
67
- },
68
- widths: {
69
- async content( { query } ) {
70
- const isList = await isListView( query );
71
- return isList ? 380 : undefined;
72
- },
73
- async edit( { query } ) {
74
- const isList = await isListView( query );
75
- const hasQuickEdit = ! isList && !! query.quickEdit;
76
- return hasQuickEdit ? 380 : undefined;
77
- },
78
- },
79
- };
package/src/posts.js DELETED
@@ -1,91 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { store as blocksStore } from '@wordpress/blocks';
5
- import {
6
- registerCoreBlocks,
7
- __experimentalGetCoreBlocks,
8
- __experimentalRegisterExperimentalCoreBlocks,
9
- } from '@wordpress/block-library';
10
- import { dispatch } from '@wordpress/data';
11
- import { createRoot, StrictMode } from '@wordpress/element';
12
- import { store as preferencesStore } from '@wordpress/preferences';
13
- import {
14
- registerLegacyWidgetBlock,
15
- registerWidgetGroupBlock,
16
- } from '@wordpress/widgets';
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
- import { store as editSiteStore } from './store';
22
-
23
- /**
24
- * Internal dependencies
25
- */
26
- import PostsApp from './components/posts-app';
27
-
28
- /**
29
- * Initializes the "Posts Dashboard"
30
- * @param {string} id ID of the root element to render the screen in.
31
- * @param {Object} settings Editor settings.
32
- */
33
- export function initializePostsDashboard( id, settings ) {
34
- if ( ! globalThis.IS_GUTENBERG_PLUGIN ) {
35
- return;
36
- }
37
- const target = document.getElementById( id );
38
- const root = createRoot( target );
39
-
40
- dispatch( blocksStore ).reapplyBlockTypeFilters();
41
- const coreBlocks = __experimentalGetCoreBlocks().filter(
42
- ( { name } ) => name !== 'core/freeform'
43
- );
44
- registerCoreBlocks( coreBlocks );
45
- dispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );
46
- registerLegacyWidgetBlock( { inserter: false } );
47
- registerWidgetGroupBlock( { inserter: false } );
48
- if ( globalThis.IS_GUTENBERG_PLUGIN ) {
49
- __experimentalRegisterExperimentalCoreBlocks( {
50
- enableFSEBlocks: true,
51
- } );
52
- }
53
-
54
- // We dispatch actions and update the store synchronously before rendering
55
- // so that we won't trigger unnecessary re-renders with useEffect.
56
- dispatch( preferencesStore ).setDefaults( 'core/edit-site', {
57
- welcomeGuide: true,
58
- welcomeGuideStyles: true,
59
- welcomeGuidePage: true,
60
- welcomeGuideTemplate: true,
61
- } );
62
-
63
- dispatch( preferencesStore ).setDefaults( 'core', {
64
- allowRightClickOverrides: true,
65
- distractionFree: false,
66
- editorMode: 'visual',
67
- editorTool: 'edit',
68
- fixedToolbar: false,
69
- focusMode: false,
70
- inactivePanels: [],
71
- keepCaretInsideBlock: false,
72
- openPanels: [ 'post-status' ],
73
- showBlockBreadcrumbs: true,
74
- showListViewByDefault: false,
75
- enableChoosePatternModal: true,
76
- } );
77
-
78
- dispatch( editSiteStore ).updateSettings( settings );
79
-
80
- // Prevent the default browser action for files dropped outside of dropzones.
81
- window.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );
82
- window.addEventListener( 'drop', ( e ) => e.preventDefault(), false );
83
-
84
- root.render(
85
- <StrictMode>
86
- <PostsApp />
87
- </StrictMode>
88
- );
89
-
90
- return root;
91
- }
package/src/posts.scss DELETED
@@ -1,57 +0,0 @@
1
- @use "@wordpress/base-styles/mixins" as *;
2
- @use "@wordpress/base-styles/default-custom-properties";
3
-
4
- @use "@wordpress/admin-ui/build-style/style.css" as admin-ui;
5
- @use "@wordpress/dataviews/build-style/style.css" as dataviews;
6
- @use "./components/layout/style.scss" as *;
7
- @use "./components/save-hub/style.scss" as *;
8
- @use "./components/save-panel/style.scss" as *;
9
- @use "./components/sidebar/style.scss" as *;
10
- @use "./components/site-hub/style.scss" as *;
11
- @use "./components/site-icon/style.scss" as *;
12
- @use "./components/post-list/style.scss" as *;
13
- @use "./components/resizable-frame/style.scss" as *;
14
-
15
- @include wordpress-admin-schemes();
16
-
17
- #wpadminbar,
18
- #adminmenumain {
19
- display: none;
20
- }
21
- #wpcontent {
22
- margin-left: 0;
23
- }
24
- body.js #wpbody {
25
- padding-top: 0;
26
- }
27
- body {
28
- @include wp-admin-reset("#gutenberg-posts-dashboard");
29
- }
30
- #gutenberg-posts-dashboard {
31
- @include reset;
32
- height: 100vh;
33
-
34
- // On mobile the main content area has to scroll, otherwise you can invoke
35
- // the over-scroll bounce on the non-scrolling container, for a bad experience.
36
- @include break-small {
37
- bottom: 0;
38
- left: 0;
39
- min-height: 100vh;
40
- position: fixed;
41
- right: 0;
42
- top: 0;
43
- }
44
-
45
- .no-js & {
46
- min-height: 0;
47
- position: static;
48
- }
49
-
50
- .components-editor-notices__snackbar {
51
- position: fixed;
52
- right: 0;
53
- bottom: 16px;
54
- padding-left: 16px;
55
- padding-right: 16px;
56
- }
57
- }