@wordpress/edit-site 3.0.24 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE.md +1 -1
- package/README.md +7 -1
- package/build/components/block-editor/resizable-editor.js +1 -0
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +95 -0
- package/build/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build/components/code-editor/index.js +79 -0
- package/build/components/code-editor/index.js.map +1 -0
- package/build/components/editor/index.js +39 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +81 -22
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +4 -6
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +1 -0
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/header.js +2 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +35 -12
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -3
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +46 -15
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +9 -12
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +0 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +0 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -6
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +0 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +6 -12
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +22 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +138 -0
- package/build/components/global-styles/screen-style-variations.js.map +1 -0
- package/build/components/global-styles/screen-text-color.js +6 -12
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -2
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +31 -14
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header/index.js +12 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +78 -0
- package/build/components/header/mode-switcher/index.js.map +1 -0
- package/build/components/header/more-menu/copy-content-menu-item.js +74 -0
- package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/header/more-menu/index.js +72 -39
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build/components/header/more-menu/site-export.js.map +1 -0
- package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/header/tools-more-menu-group/index.js +1 -5
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +26 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -4
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +3 -3
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/added-by.js +51 -50
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/routes/redirect-to-homepage.js +87 -0
- package/build/components/routes/redirect-to-homepage.js.map +1 -0
- package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +4 -2
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +1 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -38
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +10 -5
- package/build/index.js.map +1 -1
- package/build/store/actions.js +29 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +11 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -0
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +83 -0
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build-module/components/code-editor/index.js +62 -0
- package/build-module/components/code-editor/index.js.map +1 -0
- package/build-module/components/editor/index.js +38 -10
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +82 -23
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +1 -1
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +35 -10
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -2
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -15
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +9 -13
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +0 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +0 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +2 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +0 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -13
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +21 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +119 -0
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -0
- package/build-module/components/global-styles/screen-text-color.js +7 -13
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -2
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +29 -14
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header/index.js +13 -5
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +65 -0
- package/build-module/components/header/mode-switcher/index.js.map +1 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js +59 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/header/more-menu/index.js +67 -40
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build-module/components/header/more-menu/site-export.js.map +1 -0
- package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/header/tools-more-menu-group/index.js +2 -5
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +26 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +5 -4
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +3 -3
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/added-by.js +52 -51
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/routes/redirect-to-homepage.js +75 -0
- package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +4 -2
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +3 -40
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +9 -4
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +25 -25
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +11 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +202 -72
- package/build-style/style.css +202 -72
- package/package.json +28 -30
- package/src/components/block-editor/resizable-editor.js +1 -0
- package/src/components/block-editor/style.scss +15 -23
- package/src/components/code-editor/code-editor-text-area.js +79 -0
- package/src/components/code-editor/index.js +65 -0
- package/src/components/code-editor/style.scss +100 -0
- package/src/components/editor/index.js +55 -10
- package/src/components/global-styles/border-panel.js +106 -42
- package/src/components/global-styles/context-menu.js +1 -1
- package/src/components/global-styles/global-styles-provider.js +1 -2
- package/src/components/global-styles/header.js +3 -5
- package/src/components/global-styles/navigation-button.js +31 -10
- package/src/components/global-styles/palette.js +6 -2
- package/src/components/global-styles/preview.js +46 -18
- package/src/components/global-styles/screen-background-color.js +7 -12
- package/src/components/global-styles/screen-block-list.js +1 -2
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-color-palette.js +0 -2
- package/src/components/global-styles/screen-colors.js +2 -3
- package/src/components/global-styles/screen-layout.js +1 -5
- package/src/components/global-styles/screen-link-color.js +6 -16
- package/src/components/global-styles/screen-root.js +32 -3
- package/src/components/global-styles/screen-style-variations.js +130 -0
- package/src/components/global-styles/screen-text-color.js +6 -16
- package/src/components/global-styles/screen-typography-element.js +0 -4
- package/src/components/global-styles/screen-typography.js +2 -3
- package/src/components/global-styles/style.scss +24 -25
- package/src/components/global-styles/ui.js +55 -25
- package/src/components/header/document-actions/style.scss +1 -9
- package/src/components/header/index.js +10 -2
- package/src/components/header/mode-switcher/index.js +67 -0
- package/src/components/header/more-menu/copy-content-menu-item.js +53 -0
- package/src/components/header/more-menu/index.js +107 -44
- package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/src/components/header/style.scss +2 -1
- package/src/components/header/tools-more-menu-group/index.js +2 -7
- package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
- package/src/components/keyboard-shortcuts/index.js +27 -1
- package/src/components/list/actions/index.js +5 -4
- package/src/components/list/actions/rename-menu-item.js +3 -3
- package/src/components/list/added-by.js +57 -63
- package/src/components/routes/redirect-to-homepage.js +71 -0
- package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
- package/src/components/secondary-sidebar/style.scss +0 -4
- package/src/components/sidebar/default-sidebar.js +2 -0
- package/src/components/sidebar/global-styles-sidebar.js +1 -0
- package/src/components/sidebar/style.scss +21 -14
- package/src/components/url-query-controller/index.js +3 -35
- package/src/index.js +10 -3
- package/src/store/actions.js +24 -37
- package/src/store/defaults.js +1 -0
- package/src/store/reducer.js +6 -0
- package/src/store/selectors.js +11 -0
- package/src/store/test/actions.js +2 -92
- package/src/style.scss +2 -0
- package/build/plugins/index.js +0 -28
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/site-export.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item.js.map +0 -1
- package/build-module/plugins/index.js +0 -20
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/site-export.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
- package/src/plugins/index.js +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","PREFERENCES_DEFAULTS","MENU_ROOT","preferences","features","state","action","type","feature","deviceType","settings","editedPost","id","templateId","page","templatePartId","homeTemplateId","navigationPanel","menu","isOpen","value","blockInserterPanel","listViewPanel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,YAArC;AACA,SAASC,SAAT,QAA0B,6DAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGH,eAAe,CAAE;AAC3CI,EAAAA,QAAQ,GAAkD;AAAA,QAAhDC,KAAgD,uEAAxCJ,oBAAoB,CAACG,QAAmB;AAAA,QAATE,MAAS;;AACzD,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,gBAAL;AAAuB;AACtB,iBAAO,EACN,GAAGF,KADG;AAEN,aAAEC,MAAM,CAACE,OAAT,GAAoB,CAAEH,KAAK,CAAEC,MAAM,CAACE,OAAT;AAFrB,WAAP;AAIA;;AACD;AACC,eAAOH,KAAP;AARF;AAUA;;AAZ0C,CAAF,CAAnC;AAeP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,UAAT,GAAiD;AAAA,MAA5BJ,KAA4B,uEAApB,SAAoB;AAAA,MAATC,MAAS;;AACvD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACG,UAAd;AAFF;;AAKA,SAAOJ,KAAP;AACA;AAED;AACA;AACA;AACA;A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AACD,SAAK,wBAAL;AACC,aAAOC,MAAM,CAACc,KAAd;AAPF;;AASA,SAAOf,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASiB,aAAT,GAAgD;AAAA,MAAxBjB,KAAwB,uEAAhB,KAAgB;AAAA,MAATC,MAAS;;AACtD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,+BAAL;AACC,aAAO,KAAP;;AACD,SAAK,gCAAL;AACC,aAAOD,MAAM,CAACa,MAAP,GAAgB,KAAhB,GAAwBd,KAA/B;;AACD,SAAK,wBAAL;AACC,aAAOC,MAAM,CAACc,KAAP,GAAe,KAAf,GAAuBf,KAA9B;;AACD,SAAK,yBAAL;AACC,aAAOC,MAAM,CAACa,MAAd;AARF;;AAUA,SAAOd,KAAP;AACA;AAED,eAAeL,eAAe,CAAE;AAC/BG,EAAAA,WAD+B;AAE/BM,EAAAA,UAF+B;AAG/BC,EAAAA,QAH+B;AAI/BC,EAAAA,UAJ+B;AAK/BK,EAAAA,cAL+B;AAM/BC,EAAAA,eAN+B;AAO/BI,EAAAA,kBAP+B;AAQ/BC,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS } from './defaults';\nimport { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n * @return {Object} Updated state.\n */\nexport const preferences = combineReducers( {\n\tfeatures( state = PREFERENCES_DEFAULTS.features, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_FEATURE': {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ action.feature ]: ! state[ action.feature ],\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn state;\n\t\t}\n\t},\n} );\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE':\n\t\tcase 'SET_PAGE':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template',\n\t\t\t\tid: action.templateId,\n\t\t\t\tpage: action.page,\n\t\t\t};\n\t\tcase 'SET_TEMPLATE_PART':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template_part',\n\t\t\t\tid: action.templatePartId,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the site's homepage.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function homeTemplateId( state, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_HOME_TEMPLATE':\n\t\t\treturn action.homeTemplateId;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the navigation panel, such as its active menu\n * and whether it should be opened or closed.\n *\n * Note: this reducer interacts with the inserter and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function navigationPanel(\n\tstate = { menu: MENU_ROOT, isOpen: false },\n\taction\n) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_NAVIGATION_PANEL_ACTIVE_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: true,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: ! action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen ? false : state.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.value ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.value ? false : state.isOpen,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpreferences,\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\thomeTemplateId,\n\tnavigationPanel,\n\tblockInserterPanel,\n\tlistViewPanel,\n} );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","PREFERENCES_DEFAULTS","MENU_ROOT","preferences","features","state","action","type","feature","editorMode","mode","deviceType","settings","editedPost","id","templateId","page","templatePartId","homeTemplateId","navigationPanel","menu","isOpen","value","blockInserterPanel","listViewPanel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,YAArC;AACA,SAASC,SAAT,QAA0B,6DAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGH,eAAe,CAAE;AAC3CI,EAAAA,QAAQ,GAAkD;AAAA,QAAhDC,KAAgD,uEAAxCJ,oBAAoB,CAACG,QAAmB;AAAA,QAATE,MAAS;;AACzD,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,gBAAL;AAAuB;AACtB,iBAAO,EACN,GAAGF,KAD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AA,UAF+B;AAG/BC,EAAAA,QAH+B;AAI/BC,EAAAA,UAJ+B;AAK/BK,EAAAA,cAL+B;AAM/BC,EAAAA,eAN+B;AAO/BI,EAAAA,kBAP+B;AAQ/BC,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS } from './defaults';\nimport { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n * @return {Object} Updated state.\n */\nexport const preferences = combineReducers( {\n\tfeatures( state = PREFERENCES_DEFAULTS.features, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_FEATURE': {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ action.feature ]: ! state[ action.feature ],\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn state;\n\t\t}\n\t},\n\teditorMode( state = PREFERENCES_DEFAULTS.editorMode, action ) {\n\t\tif ( action.type === 'SWITCH_MODE' ) {\n\t\t\treturn action.mode;\n\t\t}\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE':\n\t\tcase 'SET_PAGE':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template',\n\t\t\t\tid: action.templateId,\n\t\t\t\tpage: action.page,\n\t\t\t};\n\t\tcase 'SET_TEMPLATE_PART':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template_part',\n\t\t\t\tid: action.templatePartId,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the site's homepage.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function homeTemplateId( state, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_HOME_TEMPLATE':\n\t\t\treturn action.homeTemplateId;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the navigation panel, such as its active menu\n * and whether it should be opened or closed.\n *\n * Note: this reducer interacts with the inserter and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function navigationPanel(\n\tstate = { menu: MENU_ROOT, isOpen: false },\n\taction\n) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_NAVIGATION_PANEL_ACTIVE_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: true,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: ! action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen ? false : state.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.value ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.value ? false : state.isOpen,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpreferences,\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\thomeTemplateId,\n\tnavigationPanel,\n\tblockInserterPanel,\n\tlistViewPanel,\n} );\n"]}
|
|
@@ -293,4 +293,15 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(select =>
|
|
|
293
293
|
return !!templatePart;
|
|
294
294
|
});
|
|
295
295
|
});
|
|
296
|
+
/**
|
|
297
|
+
* Returns the current editing mode.
|
|
298
|
+
*
|
|
299
|
+
* @param {Object} state Global application state.
|
|
300
|
+
*
|
|
301
|
+
* @return {string} Editing mode.
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
export function getEditorMode(state) {
|
|
305
|
+
return state.preferences.editorMode || 'visual';
|
|
306
|
+
}
|
|
296
307
|
//# 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","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","getEditedPostType","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"],"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,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;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,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAiCC,OAAjC,EAA2C;AACjD,SAAOlB,GAAG,CAAEiB,KAAK,CAACE,WAAN,CAAkBC,QAApB,EAA8B,CAAEF,OAAF,CAA9B,EAA2C,KAA3C,CAAV;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CJ,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACK,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjB,sBAAsB,CAAIkB,MAAF,IAAc,MAC1EA,MAAM,CAAEnB,aAAF,CAAN,CAAwBoB,OAAxB,CAAiC,QAAjC,EAA2C,OAA3C,CAD0D,CAApD;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,iBAAiB,GAAGpB,sBAAs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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","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};\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]\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"]}
|
|
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","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","getEditedPostType","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,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;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,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAiCC,OAAjC,EAA2C;AACjD,SAAOlB,GAAG,CAAEiB,KAAK,CAACE,WAAN,CAAkBC,QAApB,EAA8B,CAAEF,OAAF,CAA9B,EAA2C,KAA3C,CAAV;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CJ,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACK,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjB,sBAAsB,CAAIkB,MAAF,IAAc,MAC1EA,MAAM,CAAEnB,aAAF,CAAN,CAAwBoB,OAAxB,CAAiC,QAAjC,EAA2C,OAA3C,CAD0D,CAApD;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,iBAAiB,GAAGpB,sBAAsB,CAAIkB,MAAF,IAAc,MAAM;AAC5E,QAAMG,KAAK,GAAGlB,QAAQ,CAACmB,EAAT,KAAgB,KAA9B;AACA,SAAOD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NN,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,CAAwB3E,KAAxB,EAAgC;AACtC,SAAOA,KAAK,CAACE,WAAN,CAAkB0E,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};\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]\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"]}
|
|
@@ -470,9 +470,9 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
470
470
|
.edit-site-visual-editor.is-focus-mode .components-resizable-box__container {
|
|
471
471
|
overflow: visible;
|
|
472
472
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
.edit-site-visual-editor .components-resizable-box__container {
|
|
474
|
+
margin: 0 auto;
|
|
475
|
+
overflow: auto;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
.edit-site-visual-editor__back-button {
|
|
@@ -485,58 +485,144 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
485
485
|
color: #f0f0f0;
|
|
486
486
|
}
|
|
487
487
|
|
|
488
|
-
.components-resizable-box__container {
|
|
489
|
-
margin: 0 auto;
|
|
490
|
-
overflow: auto;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
488
|
.resizable-editor__drag-handle {
|
|
494
489
|
position: absolute;
|
|
495
490
|
top: 0;
|
|
496
491
|
bottom: 0;
|
|
497
492
|
padding: 0;
|
|
498
493
|
margin: auto 0;
|
|
499
|
-
width:
|
|
494
|
+
width: 4px;
|
|
500
495
|
height: 100px;
|
|
501
496
|
-webkit-appearance: none;
|
|
502
497
|
appearance: none;
|
|
503
|
-
cursor:
|
|
498
|
+
cursor: ew-resize;
|
|
504
499
|
outline: none;
|
|
505
|
-
background: #
|
|
506
|
-
border-radius:
|
|
500
|
+
background: #949494;
|
|
501
|
+
border-radius: 2px;
|
|
507
502
|
border: 0;
|
|
508
503
|
}
|
|
509
504
|
.resizable-editor__drag-handle.is-left {
|
|
510
|
-
right: -
|
|
505
|
+
right: -16px;
|
|
511
506
|
}
|
|
512
507
|
.resizable-editor__drag-handle.is-right {
|
|
513
|
-
left: -
|
|
508
|
+
left: -16px;
|
|
514
509
|
}
|
|
515
|
-
.resizable-editor__drag-handle:hover {
|
|
516
|
-
background: #
|
|
517
|
-
}
|
|
518
|
-
.resizable-editor__drag-handle:active {
|
|
519
|
-
cursor: grabbing;
|
|
520
|
-
background: #949494;
|
|
510
|
+
.resizable-editor__drag-handle:hover, .resizable-editor__drag-handle:active {
|
|
511
|
+
background: #ccc;
|
|
521
512
|
}
|
|
522
513
|
.resizable-editor__drag-handle:focus {
|
|
523
514
|
box-shadow: 0 0 0 1px #2f2f2f, 0 0 0 calc(var(--wp-admin-border-width-focus) + 1px) var(--wp-admin-theme-color);
|
|
524
515
|
}
|
|
525
516
|
|
|
517
|
+
.edit-site-code-editor {
|
|
518
|
+
position: relative;
|
|
519
|
+
width: 100%;
|
|
520
|
+
background-color: #fff;
|
|
521
|
+
flex-grow: 1;
|
|
522
|
+
}
|
|
523
|
+
.edit-site-code-editor__body {
|
|
524
|
+
width: 100%;
|
|
525
|
+
padding: 0 12px 12px 12px;
|
|
526
|
+
max-width: 1080px;
|
|
527
|
+
margin-right: auto;
|
|
528
|
+
margin-left: auto;
|
|
529
|
+
}
|
|
530
|
+
@media (min-width: 960px) {
|
|
531
|
+
.edit-site-code-editor__body {
|
|
532
|
+
padding: 16px 24px 96px 24px;
|
|
533
|
+
padding: 0 24px 24px 24px;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
.edit-site-code-editor__toolbar {
|
|
537
|
+
position: sticky;
|
|
538
|
+
z-index: 1;
|
|
539
|
+
top: 0;
|
|
540
|
+
right: 0;
|
|
541
|
+
left: 0;
|
|
542
|
+
display: flex;
|
|
543
|
+
background: rgba(255, 255, 255, 0.8);
|
|
544
|
+
padding: 4px 12px;
|
|
545
|
+
}
|
|
546
|
+
@media (min-width: 600px) {
|
|
547
|
+
.edit-site-code-editor__toolbar {
|
|
548
|
+
padding: 12px;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
@media (min-width: 960px) {
|
|
552
|
+
.edit-site-code-editor__toolbar {
|
|
553
|
+
padding: 12px 24px;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
.edit-site-code-editor__toolbar h2 {
|
|
557
|
+
line-height: 36px;
|
|
558
|
+
margin: 0 0 0 auto;
|
|
559
|
+
font-size: 13px;
|
|
560
|
+
color: #1e1e1e;
|
|
561
|
+
}
|
|
562
|
+
.edit-site-code-editor__toolbar .components-button svg {
|
|
563
|
+
order: 1;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area {
|
|
567
|
+
border: 1px solid #949494;
|
|
568
|
+
border-radius: 0;
|
|
569
|
+
display: block;
|
|
570
|
+
margin: 0;
|
|
571
|
+
width: 100%;
|
|
572
|
+
box-shadow: none;
|
|
573
|
+
resize: none;
|
|
574
|
+
overflow: hidden;
|
|
575
|
+
font-family: Menlo, Consolas, monaco, monospace;
|
|
576
|
+
line-height: 2.4;
|
|
577
|
+
min-height: 200px;
|
|
578
|
+
transition: border 0.1s ease-out, box-shadow 0.1s linear;
|
|
579
|
+
padding: 16px;
|
|
580
|
+
/* Fonts smaller than 16px causes mobile safari to zoom. */
|
|
581
|
+
font-size: 16px !important;
|
|
582
|
+
}
|
|
583
|
+
@media (prefers-reduced-motion: reduce) {
|
|
584
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area {
|
|
585
|
+
transition-duration: 0s;
|
|
586
|
+
transition-delay: 0s;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
@media (min-width: 600px) {
|
|
590
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area {
|
|
591
|
+
padding: 24px;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
@media (min-width: 600px) {
|
|
595
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area {
|
|
596
|
+
font-size: 15px !important;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:focus {
|
|
600
|
+
border-color: var(--wp-admin-theme-color);
|
|
601
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
602
|
+
position: relative;
|
|
603
|
+
}
|
|
604
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area::-webkit-input-placeholder {
|
|
605
|
+
color: rgba(30, 30, 30, 0.62);
|
|
606
|
+
}
|
|
607
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area::-moz-placeholder {
|
|
608
|
+
color: rgba(30, 30, 30, 0.62);
|
|
609
|
+
opacity: 1;
|
|
610
|
+
}
|
|
611
|
+
textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-input-placeholder {
|
|
612
|
+
color: rgba(30, 30, 30, 0.62);
|
|
613
|
+
}
|
|
614
|
+
|
|
526
615
|
.edit-site-global-styles-preview {
|
|
527
616
|
display: flex;
|
|
528
617
|
align-items: center;
|
|
529
618
|
justify-content: center;
|
|
530
|
-
min-height: 152px;
|
|
531
619
|
line-height: 1;
|
|
620
|
+
cursor: pointer;
|
|
532
621
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
width: 36px;
|
|
538
|
-
margin-right: 0;
|
|
539
|
-
padding: 0;
|
|
622
|
+
|
|
623
|
+
.edit-site-global-styles-preview__iframe {
|
|
624
|
+
max-width: 100%;
|
|
625
|
+
display: block;
|
|
540
626
|
}
|
|
541
627
|
|
|
542
628
|
.edit-site-typography-panel__preview {
|
|
@@ -567,13 +653,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
567
653
|
margin: 16px;
|
|
568
654
|
}
|
|
569
655
|
.edit-site-global-styles-screen-colors .component-color-indicator {
|
|
570
|
-
margin-right: 0;
|
|
571
|
-
display: block;
|
|
572
|
-
border-radius: 50%;
|
|
573
|
-
height: 24px;
|
|
574
|
-
width: 24px;
|
|
575
|
-
padding: 0;
|
|
576
|
-
border: 1px solid #ddd;
|
|
577
656
|
background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
578
657
|
}
|
|
579
658
|
|
|
@@ -597,20 +676,28 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
597
676
|
min-height: 32px;
|
|
598
677
|
}
|
|
599
678
|
|
|
600
|
-
h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-heading {
|
|
601
|
-
text-transform: uppercase;
|
|
602
|
-
line-height: 24px;
|
|
603
|
-
font-weight: 500;
|
|
604
|
-
font-size: 11px;
|
|
605
|
-
margin-bottom: 8px;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
679
|
.edit-site-screen-text-color__control,
|
|
609
680
|
.edit-site-screen-link-color__control,
|
|
610
681
|
.edit-site-screen-background-color__control {
|
|
611
682
|
padding: 16px;
|
|
612
683
|
}
|
|
613
684
|
|
|
685
|
+
.edit-site-global-styles-variations_item {
|
|
686
|
+
box-sizing: border-box;
|
|
687
|
+
padding: 2px;
|
|
688
|
+
border-radius: 2px;
|
|
689
|
+
border: #e0e0e0 1px solid;
|
|
690
|
+
}
|
|
691
|
+
.edit-site-global-styles-variations_item.is-active {
|
|
692
|
+
border: #1e1e1e 1px solid;
|
|
693
|
+
}
|
|
694
|
+
.edit-site-global-styles-variations_item:hover {
|
|
695
|
+
border: var(--wp-admin-theme-color) 1px solid;
|
|
696
|
+
}
|
|
697
|
+
.edit-site-global-styles-variations_item:focus {
|
|
698
|
+
border: var(--wp-admin-theme-color) 1px solid;
|
|
699
|
+
}
|
|
700
|
+
|
|
614
701
|
.edit-site-header {
|
|
615
702
|
align-items: center;
|
|
616
703
|
background-color: #fff;
|
|
@@ -639,6 +726,8 @@ body.is-fullscreen-mode .edit-site-header {
|
|
|
639
726
|
display: flex;
|
|
640
727
|
align-items: center;
|
|
641
728
|
height: 100%;
|
|
729
|
+
flex-grow: 1;
|
|
730
|
+
justify-content: center;
|
|
642
731
|
min-width: 0;
|
|
643
732
|
}
|
|
644
733
|
.edit-site-header .edit-site-header_end {
|
|
@@ -716,7 +805,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
716
805
|
.edit-site-header__actions {
|
|
717
806
|
display: inline-flex;
|
|
718
807
|
align-items: center;
|
|
719
|
-
flex-wrap: wrap;
|
|
720
808
|
padding-left: 4px;
|
|
721
809
|
}
|
|
722
810
|
.edit-site-header__actions .interface-pinned-items {
|
|
@@ -771,6 +859,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
771
859
|
display: flex;
|
|
772
860
|
flex-direction: column;
|
|
773
861
|
justify-content: center;
|
|
862
|
+
padding: 0 8px;
|
|
774
863
|
height: 100%;
|
|
775
864
|
min-width: 0;
|
|
776
865
|
}
|
|
@@ -797,17 +886,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
797
886
|
white-space: nowrap;
|
|
798
887
|
overflow: hidden;
|
|
799
888
|
text-overflow: ellipsis;
|
|
800
|
-
max-width: 120px;
|
|
801
|
-
}
|
|
802
|
-
@media (min-width: 782px) {
|
|
803
|
-
.edit-site-document-actions .edit-site-document-actions__title {
|
|
804
|
-
max-width: 75px;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
@media (min-width: 1080px) {
|
|
808
|
-
.edit-site-document-actions .edit-site-document-actions__title {
|
|
809
|
-
max-width: 180px;
|
|
810
|
-
}
|
|
811
889
|
}
|
|
812
890
|
.edit-site-document-actions .edit-site-document-actions__secondary-item {
|
|
813
891
|
white-space: nowrap;
|
|
@@ -1302,6 +1380,20 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1302
1380
|
margin: 0;
|
|
1303
1381
|
}
|
|
1304
1382
|
|
|
1383
|
+
.edit-site-global-styles-sidebar {
|
|
1384
|
+
display: flex;
|
|
1385
|
+
flex-direction: column;
|
|
1386
|
+
height: 100%;
|
|
1387
|
+
}
|
|
1388
|
+
.edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
|
|
1389
|
+
display: flex;
|
|
1390
|
+
flex-direction: column;
|
|
1391
|
+
flex: 1;
|
|
1392
|
+
}
|
|
1393
|
+
.edit-site-global-styles-sidebar__navigator-screen {
|
|
1394
|
+
flex: 1;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1305
1397
|
.edit-site-global-styles-sidebar .interface-complementary-area-header .components-button.has-icon {
|
|
1306
1398
|
margin-right: 0;
|
|
1307
1399
|
}
|
|
@@ -1310,18 +1402,6 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1310
1402
|
margin-right: auto;
|
|
1311
1403
|
}
|
|
1312
1404
|
|
|
1313
|
-
.edit-site-global-styles-sidebar__border-controls-row {
|
|
1314
|
-
display: flex;
|
|
1315
|
-
justify-content: space-between;
|
|
1316
|
-
margin-bottom: 12px;
|
|
1317
|
-
}
|
|
1318
|
-
.edit-site-global-styles-sidebar__border-controls-row > * {
|
|
1319
|
-
width: calc(50% - 8px);
|
|
1320
|
-
}
|
|
1321
|
-
.edit-site-global-styles-sidebar__border-controls-row .components-border-style-control__buttons {
|
|
1322
|
-
margin-bottom: 0;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
1405
|
.edit-site-global-styles-sidebar .components-navigation__menu-title-heading {
|
|
1326
1406
|
font-size: 15.6px;
|
|
1327
1407
|
font-weight: 500;
|
|
@@ -1336,6 +1416,10 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1336
1416
|
border: 0;
|
|
1337
1417
|
}
|
|
1338
1418
|
|
|
1419
|
+
.edit-site-global-styles-sidebar .components-tools-panel-item.single-column {
|
|
1420
|
+
grid-column: span 1;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1339
1423
|
.edit-site-global-styles-sidebar__blocks-group {
|
|
1340
1424
|
padding-top: 24px;
|
|
1341
1425
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1707,11 +1791,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1707
1791
|
display: flex;
|
|
1708
1792
|
justify-content: flex-end;
|
|
1709
1793
|
}
|
|
1710
|
-
@media (min-width: 782px) {
|
|
1711
|
-
.edit-site-editor__inserter-panel-header {
|
|
1712
|
-
display: none;
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
1794
|
|
|
1716
1795
|
.edit-site-editor__inserter-panel-content,
|
|
1717
1796
|
.edit-site-editor__list-view-panel-content {
|
|
@@ -1773,6 +1852,57 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1773
1852
|
vertical-align: text-top;
|
|
1774
1853
|
}
|
|
1775
1854
|
|
|
1855
|
+
.edit-site-keyboard-shortcut-help-modal__section {
|
|
1856
|
+
margin: 0 0 2rem 0;
|
|
1857
|
+
}
|
|
1858
|
+
.edit-site-keyboard-shortcut-help-modal__main-shortcuts .edit-site-keyboard-shortcut-help-modal__shortcut-list {
|
|
1859
|
+
margin-top: -25px;
|
|
1860
|
+
}
|
|
1861
|
+
.edit-site-keyboard-shortcut-help-modal__section-title {
|
|
1862
|
+
font-size: 0.9rem;
|
|
1863
|
+
font-weight: 600;
|
|
1864
|
+
}
|
|
1865
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut {
|
|
1866
|
+
display: flex;
|
|
1867
|
+
align-items: baseline;
|
|
1868
|
+
padding: 0.6rem 0;
|
|
1869
|
+
border-top: 1px solid #ddd;
|
|
1870
|
+
margin-bottom: 0;
|
|
1871
|
+
}
|
|
1872
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut:last-child {
|
|
1873
|
+
border-bottom: 1px solid #ddd;
|
|
1874
|
+
}
|
|
1875
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut:empty {
|
|
1876
|
+
display: none;
|
|
1877
|
+
}
|
|
1878
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-term {
|
|
1879
|
+
font-weight: 600;
|
|
1880
|
+
margin: 0 1rem 0 0;
|
|
1881
|
+
text-align: left;
|
|
1882
|
+
}
|
|
1883
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-description {
|
|
1884
|
+
flex: 1;
|
|
1885
|
+
margin: 0;
|
|
1886
|
+
flex-basis: auto;
|
|
1887
|
+
}
|
|
1888
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
1889
|
+
display: block;
|
|
1890
|
+
background: none;
|
|
1891
|
+
margin: 0;
|
|
1892
|
+
padding: 0;
|
|
1893
|
+
}
|
|
1894
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-key-combination + .edit-site-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
1895
|
+
margin-top: 10px;
|
|
1896
|
+
}
|
|
1897
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-key {
|
|
1898
|
+
padding: 0.25rem 0.5rem;
|
|
1899
|
+
border-radius: 8%;
|
|
1900
|
+
margin: 0 0.2rem 0 0.2rem;
|
|
1901
|
+
}
|
|
1902
|
+
.edit-site-keyboard-shortcut-help-modal__shortcut-key:last-child {
|
|
1903
|
+
margin: 0 0.2rem 0 0;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1776
1906
|
html.wp-toolbar {
|
|
1777
1907
|
background: #fff;
|
|
1778
1908
|
}
|