@wordpress/edit-site 4.0.2 → 4.0.3-next.a55ed9455a.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/build/components/app/index.js +20 -0
- package/build/components/app/index.js.map +1 -1
- package/build/components/editor/global-styles-renderer.js +7 -3
- package/build/components/editor/global-styles-renderer.js.map +1 -1
- package/build/components/editor/index.js +3 -18
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +31 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/utils.js +2 -2
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/index.js +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +9 -21
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/more-menu/site-export.js +1 -1
- package/build/components/header/more-menu/site-export.js.map +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js +4 -8
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/table.js +6 -19
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +9 -3
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +5 -5
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/welcome-guide/editor.js +6 -6
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/styles.js +6 -4
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/index.js +12 -11
- package/build/index.js.map +1 -1
- package/build/store/actions.js +38 -34
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +3 -6
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +0 -44
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +31 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/app/index.js +16 -0
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/editor/global-styles-renderer.js +6 -3
- package/build-module/components/editor/global-styles-renderer.js.map +1 -1
- package/build-module/components/editor/index.js +4 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +31 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/utils.js +2 -2
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +11 -22
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/more-menu/site-export.js +1 -1
- package/build-module/components/header/more-menu/site-export.js.map +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js +4 -8
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/table.js +7 -20
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +9 -3
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +4 -4
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +5 -5
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +5 -4
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/index.js +11 -10
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -34
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +4 -7
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +0 -40
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +90 -28
- package/build-style/style.css +90 -28
- package/package.json +33 -27
- package/src/components/app/index.js +19 -0
- package/src/components/editor/global-styles-renderer.js +7 -1
- package/src/components/editor/index.js +2 -20
- package/src/components/global-styles/screen-block-list.js +27 -2
- package/src/components/global-styles/screen-typography.js +1 -2
- package/src/components/global-styles/utils.js +2 -2
- package/src/components/header/index.js +1 -1
- package/src/components/header/more-menu/index.js +12 -29
- package/src/components/header/more-menu/site-export.js +1 -1
- package/src/components/header/more-menu/welcome-guide-menu-item.js +3 -7
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/list/table.js +13 -21
- package/src/components/navigation-sidebar/navigation-panel/index.js +16 -11
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +1 -1
- package/src/components/sidebar/global-styles-sidebar.js +6 -3
- package/src/components/sidebar/style.scss +1 -1
- package/src/components/welcome-guide/editor.js +8 -4
- package/src/components/welcome-guide/styles.js +5 -3
- package/src/index.js +12 -10
- package/src/store/actions.js +22 -13
- package/src/store/index.js +2 -6
- package/src/store/reducer.js +0 -30
- package/src/store/selectors.js +34 -10
- package/src/store/test/actions.js +17 -0
- package/src/store/test/reducer.js +0 -22
- package/src/store/test/selectors.js +14 -52
- package/src/style.scss +0 -1
- package/build/components/header/feature-toggle/index.js +0 -66
- package/build/components/header/feature-toggle/index.js.map +0 -1
- package/build/components/routes/redirect-to-homepage.js +0 -106
- package/build/components/routes/redirect-to-homepage.js.map +0 -1
- package/build/store/defaults.js +0 -15
- package/build/store/defaults.js.map +0 -1
- package/build-module/components/header/feature-toggle/index.js +0 -52
- package/build-module/components/header/feature-toggle/index.js.map +0 -1
- package/build-module/components/routes/redirect-to-homepage.js +0 -94
- package/build-module/components/routes/redirect-to-homepage.js.map +0 -1
- package/build-module/store/defaults.js +0 -8
- package/build-module/store/defaults.js.map +0 -1
- package/src/components/header/feature-toggle/index.js +0 -55
- package/src/components/header/more-menu/style.scss +0 -29
- package/src/components/routes/redirect-to-homepage.js +0 -94
- package/src/store/defaults.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { map, keyBy } from 'lodash';
|
|
5
5
|
import createSelector from 'rememo';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -9,9 +9,11 @@ import createSelector from 'rememo';
|
|
|
9
9
|
|
|
10
10
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
11
11
|
import { createRegistrySelector } from '@wordpress/data';
|
|
12
|
+
import deprecated from '@wordpress/deprecated';
|
|
12
13
|
import { uploadMedia } from '@wordpress/media-utils';
|
|
13
14
|
import { isTemplatePart } from '@wordpress/blocks';
|
|
14
15
|
import { Platform } from '@wordpress/element';
|
|
16
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
17
|
/**
|
|
16
18
|
* Internal dependencies
|
|
17
19
|
*/
|
|
@@ -22,17 +24,32 @@ import { getTemplateLocation, isTemplateSuperseded } from '../components/navigat
|
|
|
22
24
|
* @typedef {'template'|'template_type'} TemplateType Template type.
|
|
23
25
|
*/
|
|
24
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Helper for getting a preference from the preferences store.
|
|
29
|
+
*
|
|
30
|
+
* This is only present so that `getSettings` doesn't need to be made a
|
|
31
|
+
* registry selector.
|
|
32
|
+
*
|
|
33
|
+
* It's unstable because the selector needs to be exported and so part of the
|
|
34
|
+
* public API to work.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export const __unstableGetPreference = createRegistrySelector(select => (state, name) => select(preferencesStore).get('core/edit-site', name));
|
|
25
38
|
/**
|
|
26
39
|
* Returns whether the given feature is enabled or not.
|
|
27
40
|
*
|
|
28
|
-
* @param {Object} state
|
|
29
|
-
* @param {string}
|
|
41
|
+
* @param {Object} state Global application state.
|
|
42
|
+
* @param {string} featureName Feature slug.
|
|
30
43
|
*
|
|
31
44
|
* @return {boolean} Is active.
|
|
32
45
|
*/
|
|
33
46
|
|
|
34
|
-
export function isFeatureActive(state,
|
|
35
|
-
|
|
47
|
+
export function isFeatureActive(state, featureName) {
|
|
48
|
+
deprecated(`select( 'core/interface' ).isFeatureActive`, {
|
|
49
|
+
since: '6.0',
|
|
50
|
+
alternative: `select( 'core/preferences' ).get`
|
|
51
|
+
});
|
|
52
|
+
return !!__unstableGetPreference(state, featureName);
|
|
36
53
|
}
|
|
37
54
|
/**
|
|
38
55
|
* Returns the current editing canvas device type.
|
|
@@ -80,8 +97,8 @@ export const getReusableBlocks = createRegistrySelector(select => () => {
|
|
|
80
97
|
export const getSettings = createSelector((state, setIsInserterOpen) => {
|
|
81
98
|
const settings = { ...state.settings,
|
|
82
99
|
outlineMode: true,
|
|
83
|
-
focusMode:
|
|
84
|
-
hasFixedToolbar:
|
|
100
|
+
focusMode: !!__unstableGetPreference(state, 'focusMode'),
|
|
101
|
+
hasFixedToolbar: !!__unstableGetPreference(state, 'fixedToolbar'),
|
|
85
102
|
__experimentalSetIsInserterOpened: setIsInserterOpen,
|
|
86
103
|
__experimentalReusableBlocks: getReusableBlocks(state),
|
|
87
104
|
__experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
|
|
@@ -110,7 +127,7 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
|
|
|
110
127
|
};
|
|
111
128
|
|
|
112
129
|
return settings;
|
|
113
|
-
}, state => [getCanUserCreateMedia(state), state.settings,
|
|
130
|
+
}, state => [getCanUserCreateMedia(state), state.settings, __unstableGetPreference(state, 'focusMode'), __unstableGetPreference(state, 'fixedToolbar'), getReusableBlocks(state), getEditedPostType(state)]);
|
|
114
131
|
/**
|
|
115
132
|
* Returns the current home template ID.
|
|
116
133
|
*
|
|
@@ -303,6 +320,6 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(select =>
|
|
|
303
320
|
*/
|
|
304
321
|
|
|
305
322
|
export function getEditorMode(state) {
|
|
306
|
-
return state
|
|
323
|
+
return __unstableGetPreference(state, 'editorMode');
|
|
307
324
|
}
|
|
308
325
|
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","isTemplatePart","Platform","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","type","getEditedPostId","id","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId","getEditorMode","editorMode"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,QAAhC;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QA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CAAP;AAeA,CAjCmE,CAA9D;AAoCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASO,aAAT,CAAwB5E,KAAxB,EAAgC;AACtC,SAAOA,KAAK,CAACE,WAAN,CAAkB2E,UAAlB,IAAgC,QAAvC;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, feature ) {\n\treturn get( state.preferences.features, [ feature ], false );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: isFeatureActive( state, 'focusMode' ),\n\t\t\thasFixedToolbar: isFeatureActive( state, 'fixedToolbar' ),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\t'wp_template' === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\tisFeatureActive( state, 'focusMode' ),\n\t\tisFeatureActive( state, 'fixedToolbar' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost;\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select(\n\t\t\tcoreDataStore\n\t\t).getEntityRecords( 'postType', 'wp_template_part', { per_page: -1 } );\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn state.preferences.editorMode || 'visual';\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","isTemplatePart","Platform","preferencesStore","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","type","getEditedPostId","id","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId","getEditorMode"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,KAAd,QAA2B,QAA3B;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASN,KAAK,IAAIO,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,uBAAuB,GAAGZ,sBAAsB,CAC1Da,MAAF,IAAc,CAAEC,KAAF,EAASC,IAAT,KACbF,MAAM,CAAER,gBAAF,CAAN,CAA2BW,GAA3B,CAAgC,gBAAhC,EAAkDD,IAAlD,CAF2D,CAAtD;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,eAAT,CAA0BH,KAA1B,EAAiCI,WAAjC,EAA+C;AACrDjB,EAAAA,UAAU,CAAG,4CAAH,EAAgD;AACzDkB,IAAAA,KAAK,EAAE,KADkD;AAEzDC,IAAAA,WAAW,EAAG;AAF2C,GAAhD,CAAV;AAKA,SAAO,CAAC,CAAER,uBAAuB,CAAEE,KAAF,EA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BC,UAHgB,CAAjB;AAMA,QAAMsB,aAAa,GAAGtE,MAAM,CAC3Bd,aAD2B,CAAN,CAEpB6B,gBAFoB,CAEF,UAFE,EAEU,kBAFV,EAE8B;AAAEC,IAAAA,QAAQ,EAAE,CAAC;AAAb,GAF9B,CAAtB;AAGA,QAAMuD,iBAAiB,GAAGxF,KAAK,CAC9BuF,aAD8B,EAE5BE,YAAF,IAAoBA,YAAY,CAAChC,EAFH,CAA/B;AAKA,SAAO,qBAAES,QAAQ,CAACwB,MAAX,+DAAqB,EAArB,EACLC,MADK,CACKC,KAAF,IAAarF,cAAc,CAAEqF,KAAF,CAD9B,EAEL7F,GAFK,CAEE6F,KAAF,IAAa;AAClB,UAAM;AACLC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,KAAF;AAASnB,QAAAA;AAAT;AADP,QAEFiB,KAFJ;AAGA,UAAMG,cAAc,GAAI,GAAGD,KAAO,KAAKnB,IAAM,EAA7C;AACA,UAAMc,YAAY,GAAGD,iBAAiB,CAAEO,cAAF,CAAtC;AAEA,WAAO;AACNN,MAAAA,YADM;AAENG,MAAAA;AAFM,KAAP;AAIA,GAbK,EAcLD,MAdK,CAcG;AAAA,QAAE;AAAEF,MAAAA;AAAF,KAAF;AAAA,WAAwB,CAAC,CAAEA,YAA3B;AAAA,GAdH,CAAP;AAeA,CAjCmE,CAA9D;AAoCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASO,aAAT,CAAwB9E,KAAxB,EAAgC;AACtC,SAAOF,uBAAuB,CAAEE,KAAF,EAAS,YAAT,CAA9B;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/interface' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\t'wp_template' === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost;\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select(\n\t\t\tcoreDataStore\n\t\t).getEntityRecords( 'postType', 'wp_template_part', { per_page: -1 } );\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n"]}
|
|
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
447
447
|
max-height: 24px;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
@media (min-width: 600px) {
|
|
451
|
+
.interface-preferences-modal {
|
|
452
|
+
width: calc(100% - 32px);
|
|
453
|
+
height: calc(100% - 120px);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
@media (min-width: 782px) {
|
|
457
|
+
.interface-preferences-modal {
|
|
458
|
+
width: 750px;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
@media (min-width: 960px) {
|
|
462
|
+
.interface-preferences-modal {
|
|
463
|
+
height: 70%;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
@media (max-width: 781px) {
|
|
467
|
+
.interface-preferences-modal .components-modal__content {
|
|
468
|
+
padding: 0;
|
|
469
|
+
}
|
|
470
|
+
.interface-preferences-modal .components-modal__content::before {
|
|
471
|
+
content: none;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.interface-preferences__tabs .components-tab-panel__tabs {
|
|
476
|
+
position: absolute;
|
|
477
|
+
top: 84px;
|
|
478
|
+
right: 16px;
|
|
479
|
+
width: 160px;
|
|
480
|
+
}
|
|
481
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
|
|
482
|
+
border-radius: 2px;
|
|
483
|
+
font-weight: 400;
|
|
484
|
+
}
|
|
485
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
|
|
486
|
+
background: #f0f0f0;
|
|
487
|
+
box-shadow: none;
|
|
488
|
+
font-weight: 500;
|
|
489
|
+
}
|
|
490
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
491
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
492
|
+
}
|
|
493
|
+
.interface-preferences__tabs .components-tab-panel__tab-content {
|
|
494
|
+
padding-right: 24px;
|
|
495
|
+
margin-right: 160px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@media (max-width: 781px) {
|
|
499
|
+
.interface-preferences__provider {
|
|
500
|
+
height: 100%;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
.interface-preferences-modal__section {
|
|
504
|
+
margin: 0 0 2.5rem 0;
|
|
505
|
+
}
|
|
506
|
+
.interface-preferences-modal__section:last-child {
|
|
507
|
+
margin: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.interface-preferences-modal__section-title {
|
|
511
|
+
font-size: 0.9rem;
|
|
512
|
+
font-weight: 600;
|
|
513
|
+
margin-top: 0;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.interface-preferences-modal__section-description {
|
|
517
|
+
margin: -8px 0 8px 0;
|
|
518
|
+
font-size: 12px;
|
|
519
|
+
font-style: normal;
|
|
520
|
+
color: #757575;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field {
|
|
524
|
+
align-items: center;
|
|
525
|
+
display: flex;
|
|
526
|
+
margin-bottom: 0;
|
|
527
|
+
}
|
|
528
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field > label {
|
|
529
|
+
flex-grow: 1;
|
|
530
|
+
padding: 0.6rem 10px 0.6rem 0;
|
|
531
|
+
}
|
|
532
|
+
.interface-preferences-modal__option .components-base-control__help {
|
|
533
|
+
margin: -8px 58px 8px 0;
|
|
534
|
+
font-size: 12px;
|
|
535
|
+
font-style: normal;
|
|
536
|
+
color: #757575;
|
|
537
|
+
}
|
|
538
|
+
|
|
450
539
|
.edit-site-block-editor__editor-styles-wrapper .components-button {
|
|
451
540
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
452
541
|
font-size: 13px;
|
|
@@ -916,33 +1005,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
916
1005
|
min-width: 240px;
|
|
917
1006
|
}
|
|
918
1007
|
|
|
919
|
-
.edit-site-more-menu {
|
|
920
|
-
margin-right: -4px;
|
|
921
|
-
}
|
|
922
|
-
.edit-site-more-menu .components-button {
|
|
923
|
-
width: auto;
|
|
924
|
-
padding: 0 2px;
|
|
925
|
-
}
|
|
926
|
-
@media (min-width: 600px) {
|
|
927
|
-
.edit-site-more-menu {
|
|
928
|
-
margin-right: 4px;
|
|
929
|
-
}
|
|
930
|
-
.edit-site-more-menu .components-button {
|
|
931
|
-
padding: 0 4px;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.edit-site-more-menu__content .components-popover__content {
|
|
936
|
-
min-width: 260px;
|
|
937
|
-
}
|
|
938
|
-
.edit-site-more-menu__content .components-popover__content .components-dropdown-menu__menu {
|
|
939
|
-
padding: 0;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
.components-popover.edit-site-more-menu__content {
|
|
943
|
-
z-index: 99998;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
1008
|
.edit-site-navigation-toggle {
|
|
947
1009
|
align-items: center;
|
|
948
1010
|
background: #1e1e1e;
|
|
@@ -1384,7 +1446,7 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1384
1446
|
.edit-site-global-styles-sidebar {
|
|
1385
1447
|
display: flex;
|
|
1386
1448
|
flex-direction: column;
|
|
1387
|
-
height: 100%;
|
|
1449
|
+
min-height: 100%;
|
|
1388
1450
|
}
|
|
1389
1451
|
.edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
|
|
1390
1452
|
display: flex;
|
package/build-style/style.css
CHANGED
|
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
447
447
|
max-height: 24px;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
@media (min-width: 600px) {
|
|
451
|
+
.interface-preferences-modal {
|
|
452
|
+
width: calc(100% - 32px);
|
|
453
|
+
height: calc(100% - 120px);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
@media (min-width: 782px) {
|
|
457
|
+
.interface-preferences-modal {
|
|
458
|
+
width: 750px;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
@media (min-width: 960px) {
|
|
462
|
+
.interface-preferences-modal {
|
|
463
|
+
height: 70%;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
@media (max-width: 781px) {
|
|
467
|
+
.interface-preferences-modal .components-modal__content {
|
|
468
|
+
padding: 0;
|
|
469
|
+
}
|
|
470
|
+
.interface-preferences-modal .components-modal__content::before {
|
|
471
|
+
content: none;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.interface-preferences__tabs .components-tab-panel__tabs {
|
|
476
|
+
position: absolute;
|
|
477
|
+
top: 84px;
|
|
478
|
+
left: 16px;
|
|
479
|
+
width: 160px;
|
|
480
|
+
}
|
|
481
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
|
|
482
|
+
border-radius: 2px;
|
|
483
|
+
font-weight: 400;
|
|
484
|
+
}
|
|
485
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
|
|
486
|
+
background: #f0f0f0;
|
|
487
|
+
box-shadow: none;
|
|
488
|
+
font-weight: 500;
|
|
489
|
+
}
|
|
490
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
491
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
492
|
+
}
|
|
493
|
+
.interface-preferences__tabs .components-tab-panel__tab-content {
|
|
494
|
+
padding-left: 24px;
|
|
495
|
+
margin-left: 160px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@media (max-width: 781px) {
|
|
499
|
+
.interface-preferences__provider {
|
|
500
|
+
height: 100%;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
.interface-preferences-modal__section {
|
|
504
|
+
margin: 0 0 2.5rem 0;
|
|
505
|
+
}
|
|
506
|
+
.interface-preferences-modal__section:last-child {
|
|
507
|
+
margin: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.interface-preferences-modal__section-title {
|
|
511
|
+
font-size: 0.9rem;
|
|
512
|
+
font-weight: 600;
|
|
513
|
+
margin-top: 0;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.interface-preferences-modal__section-description {
|
|
517
|
+
margin: -8px 0 8px 0;
|
|
518
|
+
font-size: 12px;
|
|
519
|
+
font-style: normal;
|
|
520
|
+
color: #757575;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field {
|
|
524
|
+
align-items: center;
|
|
525
|
+
display: flex;
|
|
526
|
+
margin-bottom: 0;
|
|
527
|
+
}
|
|
528
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field > label {
|
|
529
|
+
flex-grow: 1;
|
|
530
|
+
padding: 0.6rem 0 0.6rem 10px;
|
|
531
|
+
}
|
|
532
|
+
.interface-preferences-modal__option .components-base-control__help {
|
|
533
|
+
margin: -8px 0 8px 58px;
|
|
534
|
+
font-size: 12px;
|
|
535
|
+
font-style: normal;
|
|
536
|
+
color: #757575;
|
|
537
|
+
}
|
|
538
|
+
|
|
450
539
|
.edit-site-block-editor__editor-styles-wrapper .components-button {
|
|
451
540
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
452
541
|
font-size: 13px;
|
|
@@ -916,33 +1005,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
916
1005
|
min-width: 240px;
|
|
917
1006
|
}
|
|
918
1007
|
|
|
919
|
-
.edit-site-more-menu {
|
|
920
|
-
margin-left: -4px;
|
|
921
|
-
}
|
|
922
|
-
.edit-site-more-menu .components-button {
|
|
923
|
-
width: auto;
|
|
924
|
-
padding: 0 2px;
|
|
925
|
-
}
|
|
926
|
-
@media (min-width: 600px) {
|
|
927
|
-
.edit-site-more-menu {
|
|
928
|
-
margin-left: 4px;
|
|
929
|
-
}
|
|
930
|
-
.edit-site-more-menu .components-button {
|
|
931
|
-
padding: 0 4px;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.edit-site-more-menu__content .components-popover__content {
|
|
936
|
-
min-width: 260px;
|
|
937
|
-
}
|
|
938
|
-
.edit-site-more-menu__content .components-popover__content .components-dropdown-menu__menu {
|
|
939
|
-
padding: 0;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
.components-popover.edit-site-more-menu__content {
|
|
943
|
-
z-index: 99998;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
1008
|
.edit-site-navigation-toggle {
|
|
947
1009
|
align-items: center;
|
|
948
1010
|
background: #1e1e1e;
|
|
@@ -1384,7 +1446,7 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1384
1446
|
.edit-site-global-styles-sidebar {
|
|
1385
1447
|
display: flex;
|
|
1386
1448
|
flex-direction: column;
|
|
1387
|
-
height: 100%;
|
|
1449
|
+
min-height: 100%;
|
|
1388
1450
|
}
|
|
1389
1451
|
.edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
|
|
1390
1452
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3-next.a55ed9455a.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,31 +27,33 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.0.
|
|
32
|
-
"@wordpress/block-editor": "^8.2.0",
|
|
33
|
-
"@wordpress/block-library": "^7.0.
|
|
34
|
-
"@wordpress/blocks": "^11.2.
|
|
35
|
-
"@wordpress/components": "^19.
|
|
36
|
-
"@wordpress/compose": "^5.1.
|
|
37
|
-
"@wordpress/core-data": "^4.1.
|
|
38
|
-
"@wordpress/data": "^6.3.0",
|
|
39
|
-
"@wordpress/
|
|
40
|
-
"@wordpress/
|
|
41
|
-
"@wordpress/
|
|
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/
|
|
30
|
+
"@wordpress/a11y": "^3.3.2-next.a55ed9455a.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.0.2-next.a55ed9455a.0",
|
|
32
|
+
"@wordpress/block-editor": "^8.2.1-next.a55ed9455a.0",
|
|
33
|
+
"@wordpress/block-library": "^7.0.3-next.a55ed9455a.0",
|
|
34
|
+
"@wordpress/blocks": "^11.2.3-next.a55ed9455a.0",
|
|
35
|
+
"@wordpress/components": "^19.6.1-next.a55ed9455a.0",
|
|
36
|
+
"@wordpress/compose": "^5.1.3-next.a55ed9455a.0",
|
|
37
|
+
"@wordpress/core-data": "^4.1.3-next.a55ed9455a.0",
|
|
38
|
+
"@wordpress/data": "^6.3.1-next.a55ed9455a.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.3.2-next.a55ed9455a.0",
|
|
40
|
+
"@wordpress/editor": "^12.3.1-next.a55ed9455a.0",
|
|
41
|
+
"@wordpress/element": "^4.1.3-next.a55ed9455a.0",
|
|
42
|
+
"@wordpress/hooks": "^3.3.2-next.a55ed9455a.0",
|
|
43
|
+
"@wordpress/html-entities": "^3.3.2-next.a55ed9455a.0",
|
|
44
|
+
"@wordpress/i18n": "^4.3.2-next.a55ed9455a.0",
|
|
45
|
+
"@wordpress/icons": "^7.0.2-next.a55ed9455a.0",
|
|
46
|
+
"@wordpress/interface": "^4.2.4-next.a55ed9455a.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^3.1.3-next.a55ed9455a.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.3.2-next.a55ed9455a.0",
|
|
49
|
+
"@wordpress/media-utils": "^3.1.2-next.a55ed9455a.0",
|
|
50
|
+
"@wordpress/notices": "^3.3.3-next.a55ed9455a.0",
|
|
51
|
+
"@wordpress/plugins": "^4.1.4-next.a55ed9455a.0",
|
|
52
|
+
"@wordpress/preferences": "^1.0.0-prerelease",
|
|
53
|
+
"@wordpress/reusable-blocks": "^3.1.4-next.a55ed9455a.0",
|
|
54
|
+
"@wordpress/style-engine": "^0.2.1-next.a55ed9455a.0",
|
|
55
|
+
"@wordpress/url": "^3.4.2-next.a55ed9455a.0",
|
|
56
|
+
"@wordpress/viewport": "^4.1.3-next.a55ed9455a.0",
|
|
55
57
|
"classnames": "^2.3.1",
|
|
56
58
|
"downloadjs": "^1.4.7",
|
|
57
59
|
"history": "^5.1.0",
|
|
@@ -59,8 +61,12 @@
|
|
|
59
61
|
"react-autosize-textarea": "^7.1.0",
|
|
60
62
|
"rememo": "^3.0.0"
|
|
61
63
|
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"react": "^17.0.0",
|
|
66
|
+
"react-dom": "^17.0.0"
|
|
67
|
+
},
|
|
62
68
|
"publishConfig": {
|
|
63
69
|
"access": "public"
|
|
64
70
|
},
|
|
65
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "c5108185851b824d531bce55991a3589947e8551"
|
|
66
72
|
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { SlotFillProvider } from '@wordpress/components';
|
|
5
5
|
import { UnsavedChangesWarning } from '@wordpress/editor';
|
|
6
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
import { PluginArea } from '@wordpress/plugins';
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Internal dependencies
|
|
@@ -14,6 +18,20 @@ import NavigationSidebar from '../navigation-sidebar';
|
|
|
14
18
|
import getIsListPage from '../../utils/get-is-list-page';
|
|
15
19
|
|
|
16
20
|
export default function EditSiteApp( { reboot } ) {
|
|
21
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
22
|
+
|
|
23
|
+
function onPluginAreaError( name ) {
|
|
24
|
+
createErrorNotice(
|
|
25
|
+
sprintf(
|
|
26
|
+
/* translators: %s: plugin name */
|
|
27
|
+
__(
|
|
28
|
+
'The "%s" plugin has encountered an error and cannot be rendered.'
|
|
29
|
+
),
|
|
30
|
+
name
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
17
35
|
return (
|
|
18
36
|
<SlotFillProvider>
|
|
19
37
|
<UnsavedChangesWarning />
|
|
@@ -29,6 +47,7 @@ export default function EditSiteApp( { reboot } ) {
|
|
|
29
47
|
) : (
|
|
30
48
|
<Editor onError={ reboot } />
|
|
31
49
|
) }
|
|
50
|
+
<PluginArea onError={ onPluginAreaError } />
|
|
32
51
|
{ /* Keep the instance of the sidebar to ensure focus will not be lost
|
|
33
52
|
* when navigating to other pages. */ }
|
|
34
53
|
<NavigationSidebar
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { filter } from 'lodash';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -25,7 +30,8 @@ function useGlobalStylesRenderer() {
|
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
const currentStoreSettings = getSettings();
|
|
28
|
-
const nonGlobalStyles =
|
|
33
|
+
const nonGlobalStyles = filter(
|
|
34
|
+
currentStoreSettings.styles,
|
|
29
35
|
( style ) => ! style.isGlobalStyles
|
|
30
36
|
);
|
|
31
37
|
updateSettings( {
|
|
@@ -16,13 +16,11 @@ import {
|
|
|
16
16
|
EditorSnackbars,
|
|
17
17
|
EntitiesSavedStates,
|
|
18
18
|
} from '@wordpress/editor';
|
|
19
|
-
import { __
|
|
20
|
-
import { PluginArea } from '@wordpress/plugins';
|
|
19
|
+
import { __ } from '@wordpress/i18n';
|
|
21
20
|
import {
|
|
22
21
|
ShortcutProvider,
|
|
23
22
|
store as keyboardShortcutsStore,
|
|
24
23
|
} from '@wordpress/keyboard-shortcuts';
|
|
25
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Internal dependencies
|
|
@@ -111,7 +109,6 @@ function Editor( { onError } ) {
|
|
|
111
109
|
}, [] );
|
|
112
110
|
const { setPage, setIsInserterOpened } = useDispatch( editSiteStore );
|
|
113
111
|
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
114
|
-
const { createErrorNotice } = useDispatch( noticesStore );
|
|
115
112
|
|
|
116
113
|
const [
|
|
117
114
|
isEntitiesSavedStatesOpen,
|
|
@@ -167,7 +164,7 @@ function Editor( { onError } ) {
|
|
|
167
164
|
[ enableComplementaryArea ]
|
|
168
165
|
);
|
|
169
166
|
|
|
170
|
-
// Don't render the Editor until the settings are set and loaded
|
|
167
|
+
// Don't render the Editor until the settings are set and loaded.
|
|
171
168
|
const isReady =
|
|
172
169
|
settings?.siteUrl &&
|
|
173
170
|
templateType !== undefined &&
|
|
@@ -183,18 +180,6 @@ function Editor( { onError } ) {
|
|
|
183
180
|
return null;
|
|
184
181
|
};
|
|
185
182
|
|
|
186
|
-
function onPluginAreaError( name ) {
|
|
187
|
-
createErrorNotice(
|
|
188
|
-
sprintf(
|
|
189
|
-
/* translators: %s: plugin name */
|
|
190
|
-
__(
|
|
191
|
-
'The "%s" plugin has encountered an error and cannot be rendered.'
|
|
192
|
-
),
|
|
193
|
-
name
|
|
194
|
-
)
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
183
|
// Only announce the title once the editor is ready to prevent "Replace"
|
|
199
184
|
// action in <URlQueryController> from double-announcing.
|
|
200
185
|
useTitle( isReady && __( 'Editor (beta)' ) );
|
|
@@ -314,9 +299,6 @@ function Editor( { onError } ) {
|
|
|
314
299
|
/>
|
|
315
300
|
<WelcomeGuide />
|
|
316
301
|
<Popover.Slot />
|
|
317
|
-
<PluginArea
|
|
318
|
-
onError={ onPluginAreaError }
|
|
319
|
-
/>
|
|
320
302
|
</ErrorBoundary>
|
|
321
303
|
</BlockContextProvider>
|
|
322
304
|
</GlobalStylesProvider>
|