@wordpress/edit-post 8.6.1 → 8.7.1-next.5368f64a9.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 +2 -0
- package/build/components/back-button/fullscreen-mode-close.js +4 -1
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build/components/browser-url/index.js +2 -41
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +4 -4
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +4 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/layout/index.js +4 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/use-padding-appender.js +4 -9
- package/build/components/layout/use-padding-appender.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js +4 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/store/private-selectors.js +2 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +4 -1
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build-module/components/browser-url/index.js +2 -40
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +4 -4
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +4 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +4 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/use-padding-appender.js +4 -9
- package/build-module/components/layout/use-padding-appender.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +4 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/index.js +7 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-selectors.js +2 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/package.json +31 -31
- package/src/components/back-button/fullscreen-mode-close.js +2 -0
- package/src/components/back-button/style.scss +2 -2
- package/src/components/browser-url/index.js +2 -38
- package/src/components/browser-url/test/index.js +1 -9
- package/src/components/editor-initialization/listener-hooks.js +4 -4
- package/src/components/init-pattern-modal/index.js +2 -0
- package/src/components/layout/index.js +3 -8
- package/src/components/layout/use-padding-appender.js +5 -10
- package/src/components/preferences-modal/enable-custom-fields.js +2 -0
- package/src/index.js +8 -0
- package/src/store/private-selectors.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -96,7 +96,10 @@ function FullscreenModeClose({
|
|
|
96
96
|
const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0, _i18n.__)('Back');
|
|
97
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
|
|
98
98
|
whileHover: "expand",
|
|
99
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
100
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
101
|
+
, {
|
|
102
|
+
__next40pxDefaultSize: false,
|
|
100
103
|
className: classes,
|
|
101
104
|
href: buttonHref,
|
|
102
105
|
label: buttonLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAAsD,IAAAS,WAAA,GAAAT,OAAA;AAnBtD;AACA;AACA;;AAGA;AACA;AACA;;AAcA,SAASU,mBAAmBA,CAAE;EAAEC,WAAW;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAY,CAAC,EAAG;EAAA,IAAAC,qBAAA;EACxE,MAAM;IAAE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G,IAAAC,QAAE,EAAE,WAAY,CAAG;MACzBC,SAAS,EAAC,2CAA2C;MACrDC,GAAG,EAAGhC;IAAa,CACnB,CACD;EACF;EAEA,IAAKF,oBAAoB,EAAG;IAC3BkB,UAAU,GAAG,IAAI;EAClB;;EAEA;EACA,IAAKtB,IAAI,EAAG;IACXsB,UAAU,gBAAG,IAAAzB,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAAkC,IAAI;MAACC,IAAI,EAAC,MAAM;MAACzB,IAAI,EAAGA;IAAM,CAAE,CAAC;EAChD;EAEA,MAAMuC,OAAO,GAAG,IAAAC,aAAI,EAAE,iCAAiC,EAAE;IACxD,UAAU,EAAElC;EACb,CAAE,CAAC;EAEH,MAAMmC,UAAU,GACfxC,IAAI,aAAJA,IAAI,cAAJA,IAAI,GACJ,IAAAyC,iBAAY,EAAE,UAAU,EAAE;IACzBC,SAAS,EAAEtC,QAAQ,CAACuC;EACrB,CAAE,CAAC;EAEJ,MAAMC,WAAW,IAAA1C,qBAAA,GAAGE,QAAQ,EAAEyC,MAAM,EAAEC,UAAU,cAAA5C,qBAAA,cAAAA,qBAAA,GAAI,IAAAiC,QAAE,EAAE,MAAO,CAAC;EAEhE,oBACC,IAAAvC,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAA0C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC,QAAQ;IAAAC,QAAA,eAC9B,IAAArD,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAA6D,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","__next40pxDefaultSize","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAAsD,IAAAS,WAAA,GAAAT,OAAA;AAnBtD;AACA;AACA;;AAGA;AACA;A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U,CACL;EAAC,CACE,CAAC;AAEf;AAAC,IAAAgC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1D,mBAAmB","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.BrowserURL = void 0;
|
|
7
7
|
exports.getPostEditURL = getPostEditURL;
|
|
8
|
-
exports.getPostTrashedURL = getPostTrashedURL;
|
|
9
8
|
var _element = require("@wordpress/element");
|
|
10
9
|
var _data = require("@wordpress/data");
|
|
11
10
|
var _url = require("@wordpress/url");
|
|
@@ -27,22 +26,6 @@ function getPostEditURL(postId) {
|
|
|
27
26
|
action: 'edit'
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Returns the Post's Trashed URL.
|
|
33
|
-
*
|
|
34
|
-
* @param {number} postId Post ID.
|
|
35
|
-
* @param {string} postType Post Type.
|
|
36
|
-
*
|
|
37
|
-
* @return {string} Post trashed URL.
|
|
38
|
-
*/
|
|
39
|
-
function getPostTrashedURL(postId, postType) {
|
|
40
|
-
return (0, _url.addQueryArgs)('edit.php', {
|
|
41
|
-
trashed: 1,
|
|
42
|
-
post_type: postType,
|
|
43
|
-
ids: postId
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
29
|
class BrowserURL extends _element.Component {
|
|
47
30
|
constructor() {
|
|
48
31
|
super(...arguments);
|
|
@@ -54,35 +37,16 @@ class BrowserURL extends _element.Component {
|
|
|
54
37
|
const {
|
|
55
38
|
postId,
|
|
56
39
|
postStatus,
|
|
57
|
-
postType,
|
|
58
|
-
isSavingPost,
|
|
59
40
|
hasHistory
|
|
60
41
|
} = this.props;
|
|
61
42
|
const {
|
|
62
43
|
historyId
|
|
63
44
|
} = this.state;
|
|
64
|
-
|
|
65
|
-
// Posts are still dirty while saving so wait for saving to finish
|
|
66
|
-
// to avoid the unsaved changes warning when trashing posts.
|
|
67
|
-
if (postStatus === 'trash' && !isSavingPost) {
|
|
68
|
-
this.setTrashURL(postId, postType);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
45
|
if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) {
|
|
72
46
|
this.setBrowserURL(postId);
|
|
73
47
|
}
|
|
74
48
|
}
|
|
75
49
|
|
|
76
|
-
/**
|
|
77
|
-
* Navigates the browser to the post trashed URL to show a notice about the trashed post.
|
|
78
|
-
*
|
|
79
|
-
* @param {number} postId Post ID.
|
|
80
|
-
* @param {string} postType Post Type.
|
|
81
|
-
*/
|
|
82
|
-
setTrashURL(postId, postType) {
|
|
83
|
-
window.location.href = getPostTrashedURL(postId, postType);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
50
|
/**
|
|
87
51
|
* Replaces the browser URL with a post editor link for the given post ID.
|
|
88
52
|
*
|
|
@@ -107,8 +71,7 @@ class BrowserURL extends _element.Component {
|
|
|
107
71
|
exports.BrowserURL = BrowserURL;
|
|
108
72
|
var _default = exports.default = (0, _data.withSelect)(select => {
|
|
109
73
|
const {
|
|
110
|
-
getCurrentPost
|
|
111
|
-
isSavingPost
|
|
74
|
+
getCurrentPost
|
|
112
75
|
} = select(_editor.store);
|
|
113
76
|
const post = getCurrentPost();
|
|
114
77
|
let {
|
|
@@ -122,9 +85,7 @@ var _default = exports.default = (0, _data.withSelect)(select => {
|
|
|
122
85
|
}
|
|
123
86
|
return {
|
|
124
87
|
postId: id,
|
|
125
|
-
postStatus: status
|
|
126
|
-
postType: type,
|
|
127
|
-
isSavingPost: isSavingPost()
|
|
88
|
+
postStatus: status
|
|
128
89
|
};
|
|
129
90
|
})(BrowserURL);
|
|
130
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","hasHistory","props","setBrowserURL","window","history","replaceState","id","setState","render","exports","_default","default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, hasHistory } = this.props;\n\t\tconst { historyId } = this.state;\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId &&\n\t\t\t! hasHistory\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;AAEO,MAAMC,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZC,SAAS,EAAE;IACZ,CAAC;EACF;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,MAAM;MAAEX,MAAM;MAAEY,UAAU;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACC,KAAK;IACrD,MAAM;MAAEL;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEhC,IACC,CAAER,MAAM,KAAKW,SAAS,CAACX,MAAM,IAAIA,MAAM,KAAKS,SAAS,KACrDG,UAAU,KAAK,YAAY,IAC3BZ,MAAM,IACN,CAAEa,UAAU,EACX;MACD,IAAI,CAACE,aAAa,CAAEf,MAAO,CAAC;IAC7B;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACCe,aAAaA,CAAEf,MAAM,EAAG;IACvBgB,MAAM,CAACC,OAAO,CAACC,YAAY,CAC1B;MAAEC,EAAE,EAAEnB;IAAO,CAAC,EACd,OAAO,GAAGA,MAAM,EAChBD,cAAc,CAAEC,MAAO,CACxB,CAAC;IAED,IAAI,CAACoB,QAAQ,CAAE,OAAQ;MACtBX,SAAS,EAAET;IACZ,CAAC,CAAG,CAAC;EACN;EAEAqB,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAACC,OAAA,CAAAlB,UAAA,GAAAA,UAAA;AAAA,IAAAmB,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAe,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EAChD,MAAM1B,IAAI,GAAGyB,cAAc,CAAC,CAAC;EAC7B,IAAI;IAAER,EAAE;IAAEU,MAAM;IAAEC;EAAK,CAAC,GAAG5B,IAAI;EAC/B,MAAM6B,UAAU,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBZ,EAAE,GAAGjB,IAAI,CAAC+B,KAAK;EAChB;EAEA,OAAO;IACNjC,MAAM,EAAEmB,EAAE;IACVP,UAAU,EAAEiB;EACb,CAAC;AACF,CAAE,CAAC,CAAEzB,UAAW,CAAC","ignoreList":[]}
|
|
@@ -26,15 +26,15 @@ const useUpdatePostLinkListener = () => {
|
|
|
26
26
|
} = (0, _data.useSelect)(select => ({
|
|
27
27
|
newPermalink: select(_editor.store).getCurrentPost().link
|
|
28
28
|
}), []);
|
|
29
|
-
const
|
|
29
|
+
const nodeToUpdateRef = (0, _element.useRef)();
|
|
30
30
|
(0, _element.useEffect)(() => {
|
|
31
|
-
|
|
31
|
+
nodeToUpdateRef.current = document.querySelector(_constants.VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(_constants.VIEW_AS_LINK_SELECTOR);
|
|
32
32
|
}, []);
|
|
33
33
|
(0, _element.useEffect)(() => {
|
|
34
|
-
if (!newPermalink || !
|
|
34
|
+
if (!newPermalink || !nodeToUpdateRef.current) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
nodeToUpdateRef.current.setAttribute('href', newPermalink);
|
|
38
38
|
}, [newPermalink]);
|
|
39
39
|
};
|
|
40
40
|
exports.useUpdatePostLinkListener = useUpdatePostLinkListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_editor","_constants","useUpdatePostLinkListener","newPermalink","useSelect","select","editorStore","getCurrentPost","link","
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_editor","_constants","useUpdatePostLinkListener","newPermalink","useSelect","select","editorStore","getCurrentPost","link","nodeToUpdateRef","useRef","useEffect","current","document","querySelector","VIEW_AS_PREVIEW_LINK_SELECTOR","VIEW_AS_LINK_SELECTOR","setAttribute","exports"],"sources":["@wordpress/edit-post/src/components/editor-initialization/listener-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport {\n\tVIEW_AS_LINK_SELECTOR,\n\tVIEW_AS_PREVIEW_LINK_SELECTOR,\n} from '../../store/constants';\n\n/**\n * This listener hook monitors any change in permalink and updates the view\n * post link in the admin bar.\n */\nexport const useUpdatePostLinkListener = () => {\n\tconst { newPermalink } = useSelect(\n\t\t( select ) => ( {\n\t\t\tnewPermalink: select( editorStore ).getCurrentPost().link,\n\t\t} ),\n\t\t[]\n\t);\n\tconst nodeToUpdateRef = useRef();\n\n\tuseEffect( () => {\n\t\tnodeToUpdateRef.current =\n\t\t\tdocument.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||\n\t\t\tdocument.querySelector( VIEW_AS_LINK_SELECTOR );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! newPermalink || ! nodeToUpdateRef.current ) {\n\t\t\treturn;\n\t\t}\n\t\tnodeToUpdateRef.current.setAttribute( 'href', newPermalink );\n\t}, [ newPermalink ] );\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACO,MAAMI,yBAAyB,GAAGA,CAAA,KAAM;EAC9C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAC/BC,MAAM,KAAQ;IACfF,YAAY,EAAEE,MAAM,CAAEC,aAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC;EACtD,CAAC,CAAE,EACH,EACD,CAAC;EACD,MAAMC,eAAe,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEhC,IAAAC,kBAAS,EAAE,MAAM;IAChBF,eAAe,CAACG,OAAO,GACtBC,QAAQ,CAACC,aAAa,CAAEC,wCAA8B,CAAC,IACvDF,QAAQ,CAACC,aAAa,CAAEE,gCAAsB,CAAC;EACjD,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAL,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAER,YAAY,IAAI,CAAEM,eAAe,CAACG,OAAO,EAAG;MAClD;IACD;IACAH,eAAe,CAACG,OAAO,CAACK,YAAY,CAAE,MAAM,EAAEd,YAAa,CAAC;EAC7D,CAAC,EAAE,CAAEA,YAAY,CAAG,CAAC;AACtB,CAAC;AAACe,OAAA,CAAAhB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -82,7 +82,10 @@ function InitPatternModal() {
|
|
|
82
82
|
}
|
|
83
83
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
84
84
|
justify: "right",
|
|
85
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
86
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
87
|
+
, {
|
|
88
|
+
__next40pxDefaultSize: false,
|
|
86
89
|
variant: "primary",
|
|
87
90
|
type: "submit",
|
|
88
91
|
disabled: !title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_jsxRuntime","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","jsx","Fragment","children","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","jsxs","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","accessibleWhenDisabled"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAdzD;AACA;AACA;;AAce,SAASM,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAF,iBAAQ,EAAEG,SAAU,CAAC;EACvD,MAAM,CAAEC,KAAK,EAAE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nC,WAAA,CAAAoC,oBAAM;UAACC,OAAO,EAAC,GAAG;UAAAZ,QAAA,gBAClB,IAAAtB,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAsC,WAAW;YACXC,KAAK,EAAG,IAAAZ,QAAE,EAAE,MAAO,CAAG;YACtBa,KAAK,EAAG1B,KAAO;YACf2B,QAAQ,EAAG1B,QAAU;YACrB2B,WAAW,EAAG,IAAAf,QAAE,EAAE,YAAa,CAAG;YAClCgB,SAAS,EAAC,mCAAmC;YAC7CC,uBAAuB;YACvBC,qBAAqB;UAAA,CACrB,CAAC,eACF,IAAA1C,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAA8C,aAAa;YACbF,uBAAuB;YACvBL,KAAK,EAAG,IAAAQ,QAAE,EAAE,QAAQ,EAAE,oBAAqB,CAAG;YAC9CC,IAAI,EAAG,IAAArB,QAAE,EACR,8CACD,CAAG;YACHsB,OAAO,EAAG,CAAEtC,QAAU;YACtB8B,QAAQ,EAAGA,CAAA,KAAM;cAChB7B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;YACF;UAAG,CACH,CAAC,eACF,IAAAV,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAkD,oBAAM;YAACC,OAAO,EAAC,OAAO;YAAA1B,QAAA,eACtB,IAAAtB,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAoD,
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_jsxRuntime","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","jsx","Fragment","children","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","jsxs","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","accessibleWhenDisabled"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\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Q,QAAE,EAAE,QAAQ,EAAE,oBAAqB,CAAG;YAC9CC,IAAI,EAAG,IAAArB,QAAE,EACR,8CACD,CAAG;YACHsB,OAAO,EAAG,CAAEtC,QAAU;YACtB8B,QAAQ,EAAGA,CAAA,KAAM;cAChB7B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;YACF;UAAG,CACH,CAAC,eACF,IAAAV,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAkD,oBAAM;YAACC,OAAO,EAAC,OAAO;YAAA1B,QAAA,eACtB,IAAAtB,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAoD;YACA;YAAA;cACAP,qBAAqB,EAAG,KAAO;cAC/BQ,OAAO,EAAC,SAAS;cACjBC,IAAI,EAAC,QAAQ;cACbC,QAAQ,EAAG,CAAEzC,KAAO;cACpB0C,sBAAsB;cAAA/B,QAAA,EAEpB,IAAAE,QAAE,EAAE,QAAS;YAAC,CACT;UAAC,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACD;EACP,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -71,7 +71,6 @@ function useEditorStyles() {
|
|
|
71
71
|
hasThemeStyleSupport,
|
|
72
72
|
editorSettings,
|
|
73
73
|
isZoomedOutView,
|
|
74
|
-
hasMetaBoxes,
|
|
75
74
|
renderingMode,
|
|
76
75
|
postType
|
|
77
76
|
} = (0, _data.useSelect)(select => {
|
|
@@ -87,7 +86,6 @@ function useEditorStyles() {
|
|
|
87
86
|
hasThemeStyleSupport: select(_store.store).isFeatureActive('themeStyles'),
|
|
88
87
|
editorSettings: select(_editor.store).getEditorSettings(),
|
|
89
88
|
isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
|
|
90
|
-
hasMetaBoxes: select(_store.store).hasMetaBoxes(),
|
|
91
89
|
renderingMode: getRenderingMode(),
|
|
92
90
|
postType: _postType
|
|
93
91
|
};
|
|
@@ -117,13 +115,11 @@ function useEditorStyles() {
|
|
|
117
115
|
}
|
|
118
116
|
const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles;
|
|
119
117
|
|
|
120
|
-
// Add a
|
|
121
|
-
//
|
|
122
|
-
if (!isZoomedOutView &&
|
|
118
|
+
// Add a space for the typewriter effect. When typing in the last block,
|
|
119
|
+
// there needs to be room to scroll up.
|
|
120
|
+
if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
|
|
123
121
|
return [...baseStyles, {
|
|
124
|
-
|
|
125
|
-
// specificity.
|
|
126
|
-
css: ':root :where(body){padding-bottom: 40vh}'
|
|
122
|
+
css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'
|
|
127
123
|
}];
|
|
128
124
|
}
|
|
129
125
|
return baseStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","hasMetaBoxes","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","templateId","_getPostType$viewable","get","preferencesStore","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","getEditorMode","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","className","clsx","onPluginAreaError","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","post","action","initialPost","backButton","useViewportMatch","jsx","default","SlotFillProvider","children","jsxs","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\thasMetaBoxes,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( editorSettings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a constant padding for the typewriter effect. When typing at the\n\t\t// bottom, there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\t! hasMetaBoxes &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\t// Should override global styles padding, so ensure 0-1-0\n\t\t\t\t\t// specificity.\n\t\t\t\t\tcss: ':root :where(body){padding-bottom: 40vh}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\n\t\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPost.postType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\tcurrentPost.postType !== 'wp_template'\n\t\t\t\t\t\t? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ settings.supportsTemplateMode, currentPost.postType ]\n\t);\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<CommandMenu />\n\t\t\t\t<WelcomeGuide postType={ currentPost.postType } />\n\t\t\t\t<Editor\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tpostType={ currentPost.postType }\n\t\t\t\t\tpostId={ currentPost.postId }\n\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t\textraContent={\n\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t{ backButton }\n\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t</Editor>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AA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M","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","includes","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","templateId","_getPostType$viewable","get","preferencesStore","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","getEditorMode","hasMetaBoxes","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","className","clsx","onPluginAreaError","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","post","action","initialPost","backButton","useViewportMatch","jsx","default","SlotFillProvider","children","jsxs","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( editorSettings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\t// Add a space for the typewriter effect. When typing in the last block,\n\t\t// there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: ':root :where(.editor-styles-wrapper)::after {content: \"\"; display: block; height: 40vh;}',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\tpostType,\n\t] );\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\n\t\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPost.postType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\tcurrentPost.postType !== 'wp_template'\n\t\t\t\t\t\t? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ settings.supportsTemplateMode, currentPost.postType ]\n\t);\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles();\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<CommandMenu />\n\t\t\t\t<WelcomeGuide postType={ currentPost.postType } />\n\t\t\t\t<Editor\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tpostType={ currentPost.postType }\n\t\t\t\t\tpostId={ currentPost.postId }\n\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t\textraContent={\n\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t{ backButton }\n\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t</Editor>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,IAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AAKA,IAAAiB,WAAA,GAAAlB,sBAAA,CAAAC,OAAA;AACA,IAAAkB,qBAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,kBAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,iBAAA,GAAArB,sBAAA,CAAAC,OAAA;AACA,IAAAqB,WAA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AAAuI,GAAA,EAAClJ,iBAAA,CAAAmJ,OAAgB,IAAE,CAAC,eACpB,IAAAxI,WAAA,CAAAuI,GAAA,EAAClK,QAAA,CAAAqL,UAAU;UAACC,OAAO,EAAGhD;QAAmB,CAAE,CAAC,eAC5C,IAAA3G,WAAA,CAAAuI,GAAA,EAAC/I,SAAA,CAAAgJ,OAAkB,IAAE,CAAC,EACpBH,UAAU,eACZ,IAAArI,WAAA,CAAAuI,GAAA,EAACrK,OAAA,CAAA0L,eAAe,IAAE,CAAC;MAAA,CACZ,CAAC;IAAA,CACK;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEcnF,MAAM","ignoreList":[]}
|
|
@@ -25,8 +25,8 @@ function usePaddingAppender() {
|
|
|
25
25
|
const {
|
|
26
26
|
defaultView
|
|
27
27
|
} = ownerDocument;
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
28
|
+
const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10);
|
|
29
|
+
if (!pseudoHeight) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -39,20 +39,15 @@ function usePaddingAppender() {
|
|
|
39
39
|
if (event.clientY < lastChildRect.bottom) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
event.
|
|
42
|
+
event.stopPropagation();
|
|
43
43
|
const blockOrder = registry.select(_blockEditor.store).getBlockOrder('');
|
|
44
44
|
const lastBlockClientId = blockOrder[blockOrder.length - 1];
|
|
45
|
-
|
|
46
|
-
// Do nothing when only default block appender is present.
|
|
47
|
-
if (!lastBlockClientId) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
45
|
const lastBlock = registry.select(_blockEditor.store).getBlock(lastBlockClientId);
|
|
51
46
|
const {
|
|
52
47
|
selectBlock,
|
|
53
48
|
insertDefaultBlock
|
|
54
49
|
} = registry.dispatch(_blockEditor.store);
|
|
55
|
-
if ((0, _blocks.isUnmodifiedDefaultBlock)(lastBlock)) {
|
|
50
|
+
if (lastBlock && (0, _blocks.isUnmodifiedDefaultBlock)(lastBlock)) {
|
|
56
51
|
selectBlock(lastBlockClientId);
|
|
57
52
|
} else {
|
|
58
53
|
insertDefaultBlock();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","
|
|
1
|
+
{"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","pseudoHeight","parseInt","getComputedStyle","height","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","stopPropagation","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst pseudoHeight = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node, ':after' ).height,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! pseudoHeight ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( lastBlock && isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B,IAAKA,KAAK,CAACC,MAAM,KAAKH,IAAI,EAAG;QAC5B;MACD;MAEA,MAAM;QAAEI;MAAc,CAAC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,CACX,CAAC;AACF","ignoreList":[]}
|
|
@@ -41,7 +41,10 @@ function CustomFieldsConfirmation({
|
|
|
41
41
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
42
42
|
className: "edit-post-preferences-modal__custom-fields-confirmation-message",
|
|
43
43
|
children: (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')
|
|
44
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
45
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
46
|
+
, {
|
|
47
|
+
__next40pxDefaultSize: false,
|
|
45
48
|
className: "edit-post-preferences-modal__custom-fields-confirmation-button",
|
|
46
49
|
variant: "secondary",
|
|
47
50
|
isBusy: isReloading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAES;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAE,IAAAC,0BAAqB,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExER,gBAAgB,CAACS,MAAM,CAAC,CAAC;AAC1B;AAEO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,oBACC,IAAAnB,WAAA,CAAAoB,IAAA,EAAApB,WAAA,CAAAqB,QAAA;IAAAC,QAAA,gBACC,IAAAtB,WAAA,CAAAuB,GAAA;MAAGC,SAAS,EAAC,iEAAiE;MAAAF,QAAA,EAC3E,IAAAG,QAAE,EACH,8FACD;IAAC,CACC,CAAC,eACJ,IAAAzB,WAAA,CAAAuB,GAAA,EAAC7B,WAAA,CAAAgC,
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAES;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,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BAAQ,EAAEgB,sBAAuB,CAAC;EAEtE,oBACC,IAAAnC,WAAA,CAAAuB,GAAA,EAACtB,oBAAoB;IACpBiC,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAf,QAAA,EAEvBc,SAAS,KAAKD,sBAAsB,iBACrC,IAAAnC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGoB;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC1CR,sBAAsB,EACrB,CAAC,CAAEQ,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEb,wBAAyB,CAAC","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -97,8 +97,15 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
97
97
|
showBlockBreadcrumbs: true,
|
|
98
98
|
showIconLabels: false,
|
|
99
99
|
showListViewByDefault: false,
|
|
100
|
+
enableChoosePatternModal: true,
|
|
100
101
|
isPublishSidebarEnabled: true
|
|
101
102
|
});
|
|
103
|
+
if (window.__experimentalMediaProcessing) {
|
|
104
|
+
(0, _data.dispatch)(_preferences.store).setDefaults('core/media', {
|
|
105
|
+
requireApproval: true,
|
|
106
|
+
optimizeOnUpload: true
|
|
107
|
+
});
|
|
108
|
+
}
|
|
102
109
|
(0, _data.dispatch)(_blocks.store).reapplyBlockTypeFilters();
|
|
103
110
|
|
|
104
111
|
// Check if the block list view should be open by default.
|