@wordpress/editor 14.16.0 → 14.17.1
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/README.md +19 -19
- package/build/components/document-outline/check.js +3 -3
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/header/index.js +11 -6
- package/build/components/header/index.js.map +1 -1
- package/build/components/page-attributes/check.js +3 -3
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/post-pending-status/check.js +3 -3
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-schedule/check.js +3 -3
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-sticky/check.js +3 -3
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-trash/check.js +3 -3
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-type-support-check/index.js +6 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +3 -3
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/start-page-options/index.js +15 -6
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +4 -4
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/document-outline/check.js +3 -3
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/header/index.js +11 -6
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +3 -3
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-schedule/check.js +3 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-sticky/check.js +3 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-trash/check.js +3 -3
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +6 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +3 -3
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +15 -6
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +4 -4
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +11 -23
- package/build-style/style.css +11 -23
- package/build-types/components/document-outline/check.d.ts +5 -5
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts +5 -5
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts +5 -5
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts +5 -5
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts +5 -5
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts +2 -2
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-trash/check.d.ts +5 -5
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts +8 -8
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts +5 -5
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts +6 -6
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +4 -4
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/document-bar/style.scss +4 -2
- package/src/components/document-outline/check.js +3 -3
- package/src/components/document-tools/style.scss +3 -2
- package/src/components/header/index.js +18 -21
- package/src/components/page-attributes/check.js +3 -3
- package/src/components/post-featured-image/style.scss +4 -2
- package/src/components/post-pending-status/check.js +3 -3
- package/src/components/post-publish-panel/style.scss +5 -3
- package/src/components/post-schedule/check.js +3 -3
- package/src/components/post-sticky/check.js +3 -3
- package/src/components/post-taxonomies/check.js +1 -1
- package/src/components/post-text-editor/style.scss +4 -2
- package/src/components/post-trash/check.js +3 -3
- package/src/components/post-type-support-check/index.js +6 -6
- package/src/components/post-url/check.js +3 -3
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/provider/index.js +2 -2
- package/src/components/start-page-options/index.js +20 -12
- package/src/components/theme-support-check/index.js +4 -4
- package/src/private-apis.js +7 -1
- package/src/store/selectors.js +4 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","editorStore","PageAttributesCheck","children","supportsPageAttributes","select","getEditedPostAttribute","getPostType","postType","supports"],"sources":["@wordpress/editor/src/components/page-attributes/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post type supports page attributes.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","editorStore","PageAttributesCheck","children","supportsPageAttributes","select","getEditedPostAttribute","getPostType","postType","supports"],"sources":["@wordpress/editor/src/components/page-attributes/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post type supports page attributes.\n *\n * @param {Object} props - The component props.\n * @param {React.ReactNode} props.children - The child components to render.\n *\n * @return {React.ReactNode} The rendered child components or null if page attributes are not supported.\n */\nexport function PageAttributesCheck( { children } ) {\n\tconst supportsPageAttributes = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn !! postType?.supports?.[ 'page-attributes' ];\n\t}, [] );\n\n\t// Only render fields if post type supports page attributes or available templates exist.\n\tif ( ! supportsPageAttributes ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PageAttributesCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnD,MAAMC,sBAAsB,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACvD,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEJ,WAAY,CAAC;IACxD,MAAM;MAAEM;IAAY,CAAC,GAAGF,MAAM,CAAEL,SAAU,CAAC;IAC3C,MAAMQ,QAAQ,GAAGD,WAAW,CAAED,sBAAsB,CAAE,MAAO,CAAE,CAAC;IAEhE,OAAO,CAAC,CAAEE,QAAQ,EAAEC,QAAQ,GAAI,iBAAiB,CAAE;EACpD,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA,IAAK,CAAEL,sBAAsB,EAAG;IAC/B,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,mBAAmB","ignoreList":[]}
|
|
@@ -13,10 +13,10 @@ import { store as editorStore } from '../../store';
|
|
|
13
13
|
* If the post is already published or the user doesn't have the
|
|
14
14
|
* capability to publish, it returns null.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
16
|
+
* @param {Object} props Component properties.
|
|
17
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
18
18
|
*
|
|
19
|
-
* @return {React.
|
|
19
|
+
* @return {React.ReactNode} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
|
|
20
20
|
*/
|
|
21
21
|
export function PostPendingStatusCheck({
|
|
22
22
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object} props Component properties.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.\n */\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
|
|
@@ -11,10 +11,10 @@ import { store as editorStore } from '../../store';
|
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper component that renders its children only if post has a publish action.
|
|
13
13
|
*
|
|
14
|
-
* @param {Object}
|
|
15
|
-
* @param {React.
|
|
14
|
+
* @param {Object} props Props.
|
|
15
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
16
16
|
*
|
|
17
|
-
* @return {React.
|
|
17
|
+
* @return {React.ReactNode} - The component to be rendered or null if there is no publish action.
|
|
18
18
|
*/
|
|
19
19
|
export default function PostScheduleCheck({
|
|
20
20
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","editorStore","PostScheduleCheck","children","hasPublishAction","select","_select$getCurrentPos","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a publish action.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","editorStore","PostScheduleCheck","children","hasPublishAction","select","_select$getCurrentPos","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a publish action.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} - The component to be rendered or null if there is no publish action.\n */\nexport default function PostScheduleCheck( { children } ) {\n\tconst hasPublishAction = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t}, [] );\n\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAMC,gBAAgB,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACjD,QAAAA,qBAAA,GACCD,MAAM,CAAEJ,WAAY,CAAC,CAACM,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEF,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
|
|
@@ -11,10 +11,10 @@ import { store as editorStore } from '../../store';
|
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper component that renders its children only if post has a sticky action.
|
|
13
13
|
*
|
|
14
|
-
* @param {Object}
|
|
15
|
-
* @param {React.
|
|
14
|
+
* @param {Object} props Props.
|
|
15
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
16
16
|
*
|
|
17
|
-
* @return {React.
|
|
17
|
+
* @return {React.ReactNode} The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
|
|
18
18
|
*/
|
|
19
19
|
export default function PostStickyCheck({
|
|
20
20
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","editorStore","PostStickyCheck","children","hasStickyAction","postType","select","_post$_links$wpActio","post","getCurrentPost","_links","getCurrentPostType"],"sources":["@wordpress/editor/src/components/post-sticky/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a sticky action.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","editorStore","PostStickyCheck","children","hasStickyAction","postType","select","_post$_links$wpActio","post","getCurrentPost","_links","getCurrentPostType"],"sources":["@wordpress/editor/src/components/post-sticky/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a sticky action.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The component to be rendered or null if post type is not 'post' or hasStickyAction is false.\n */\nexport default function PostStickyCheck( { children } ) {\n\tconst { hasStickyAction, postType } = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\treturn {\n\t\t\thasStickyAction: post._links?.[ 'wp:action-sticky' ] ?? false,\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif ( postType !== 'post' || ! hasStickyAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,eAAe;IAAEC;EAAS,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,oBAAA;IAC9D,MAAMC,IAAI,GAAGF,MAAM,CAAEL,WAAY,CAAC,CAACQ,cAAc,CAAC,CAAC;IACnD,OAAO;MACNL,eAAe,GAAAG,oBAAA,GAAEC,IAAI,CAACE,MAAM,GAAI,kBAAkB,CAAE,cAAAH,oBAAA,cAAAA,oBAAA,GAAI,KAAK;MAC7DF,QAAQ,EAAEC,MAAM,CAAEL,WAAY,CAAC,CAACU,kBAAkB,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKN,QAAQ,KAAK,MAAM,IAAI,CAAED,eAAe,EAAG;IAC/C,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
|
|
@@ -15,7 +15,7 @@ import { store as editorStore } from '../../store';
|
|
|
15
15
|
* @param {Object} props The component props.
|
|
16
16
|
* @param {React.ReactNode} props.children The children components to render.
|
|
17
17
|
*
|
|
18
|
-
* @return {React.
|
|
18
|
+
* @return {React.ReactNode} The rendered children components or null if the current post type has no taxonomies.
|
|
19
19
|
*/
|
|
20
20
|
export default function PostTaxonomiesCheck({
|
|
21
21
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostTaxonomiesCheck","children","hasTaxonomies","select","postType","getCurrentPostType","taxonomies","getTaxonomies","per_page","some","taxonomy","types","includes"],"sources":["@wordpress/editor/src/components/post-taxonomies/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the children components only if the current post type has taxonomies.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The children components to render.\n *\n * @return {React.
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostTaxonomiesCheck","children","hasTaxonomies","select","postType","getCurrentPostType","taxonomies","getTaxonomies","per_page","some","taxonomy","types","includes"],"sources":["@wordpress/editor/src/components/post-taxonomies/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the children components only if the current post type has taxonomies.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The children components to render.\n *\n * @return {React.ReactNode} The rendered children components or null if the current post type has no taxonomies.\n */\nexport default function PostTaxonomiesCheck( { children } ) {\n\tconst hasTaxonomies = useSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst taxonomies = select( coreStore ).getTaxonomies( {\n\t\t\tper_page: -1,\n\t\t} );\n\t\treturn taxonomies?.some( ( taxonomy ) =>\n\t\t\ttaxonomy.types.includes( postType )\n\t\t);\n\t}, [] );\n\tif ( ! hasTaxonomies ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC3D,MAAMC,aAAa,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAC9C,MAAMC,QAAQ,GAAGD,MAAM,CAAEJ,WAAY,CAAC,CAACM,kBAAkB,CAAC,CAAC;IAC3D,MAAMC,UAAU,GAAGH,MAAM,CAAEL,SAAU,CAAC,CAACS,aAAa,CAAE;MACrDC,QAAQ,EAAE,CAAC;IACZ,CAAE,CAAC;IACH,OAAOF,UAAU,EAAEG,IAAI,CAAIC,QAAQ,IAClCA,QAAQ,CAACC,KAAK,CAACC,QAAQ,CAAER,QAAS,CACnC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,IAAK,CAAEF,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
|
|
@@ -13,10 +13,10 @@ import { GLOBAL_POST_TYPES } from '../../store/constants';
|
|
|
13
13
|
/**
|
|
14
14
|
* Wrapper component that renders its children only if the post can be trashed.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
16
|
+
* @param {Object} props The component props.
|
|
17
|
+
* @param {React.ReactNode} props.children The child components.
|
|
18
18
|
*
|
|
19
|
-
* @return {React.
|
|
19
|
+
* @return {React.ReactNode} The rendered child components or null if the post can't be trashed.
|
|
20
20
|
*/
|
|
21
21
|
export default function PostTrashCheck({
|
|
22
22
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","editorStore","GLOBAL_POST_TYPES","PostTrashCheck","children","canTrashPost","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","canUser","postType","postId","isNew","canUserDelete","kind","name","id","includes"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { GLOBAL_POST_TYPES } from '../../store/constants';\n\n/**\n * Wrapper component that renders its children only if the post can be trashed.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","editorStore","GLOBAL_POST_TYPES","PostTrashCheck","children","canTrashPost","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","canUser","postType","postId","isNew","canUserDelete","kind","name","id","includes"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { GLOBAL_POST_TYPES } from '../../store/constants';\n\n/**\n * Wrapper component that renders its children only if the post can be trashed.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The rendered child components or null if the post can't be trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst postType = getCurrentPostType();\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst canUserDelete = !! postId\n\t\t\t? canUser( 'delete', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t\tid: postId,\n\t\t\t } )\n\t\t\t: false;\n\n\t\treturn {\n\t\t\tcanTrashPost:\n\t\t\t\t( ! isNew || postId ) &&\n\t\t\t\tcanUserDelete &&\n\t\t\t\t! GLOBAL_POST_TYPES.includes( postType ),\n\t\t};\n\t}, [] );\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,iBAAiB,QAAQ,uBAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC;EAAa,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACjD,MAAM;MAAEC,eAAe;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAC9DH,MAAM,CAAEL,WAAY,CAAC;IACtB,MAAM;MAAES;IAAQ,CAAC,GAAGJ,MAAM,CAAEN,SAAU,CAAC;IACvC,MAAMW,QAAQ,GAAGF,kBAAkB,CAAC,CAAC;IACrC,MAAMG,MAAM,GAAGJ,gBAAgB,CAAC,CAAC;IACjC,MAAMK,KAAK,GAAGN,eAAe,CAAC,CAAC;IAC/B,MAAMO,aAAa,GAAG,CAAC,CAAEF,MAAM,GAC5BF,OAAO,CAAE,QAAQ,EAAE;MACnBK,IAAI,EAAE,UAAU;MAChBC,IAAI,EAAEL,QAAQ;MACdM,EAAE,EAAEL;IACJ,CAAE,CAAC,GACH,KAAK;IAER,OAAO;MACNP,YAAY,EACX,CAAE,CAAEQ,KAAK,IAAID,MAAM,KACnBE,aAAa,IACb,CAAEZ,iBAAiB,CAACgB,QAAQ,CAAEP,QAAS;IACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,IAAK,CAAEN,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
|
|
@@ -14,13 +14,13 @@ import { store as editorStore } from '../../store';
|
|
|
14
14
|
* A component which renders its own children only if the current editor post
|
|
15
15
|
* type supports one of the given `supportKeys` prop.
|
|
16
16
|
*
|
|
17
|
-
* @param {Object}
|
|
18
|
-
* @param {React.
|
|
19
|
-
*
|
|
20
|
-
* @param {(string|string[])}
|
|
21
|
-
*
|
|
17
|
+
* @param {Object} props Props.
|
|
18
|
+
* @param {React.ReactNode} props.children Children to be rendered if post
|
|
19
|
+
* type supports.
|
|
20
|
+
* @param {(string|string[])} props.supportKeys String or string array of keys
|
|
21
|
+
* to test.
|
|
22
22
|
*
|
|
23
|
-
* @return {React.
|
|
23
|
+
* @return {React.ReactNode} The component to be rendered.
|
|
24
24
|
*/
|
|
25
25
|
function PostTypeSupportCheck({
|
|
26
26
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostTypeSupportCheck","children","supportKeys","postType","select","getEditedPostAttribute","getPostType","isSupported","Array","isArray","some","key","supports"],"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostTypeSupportCheck","children","supportKeys","postType","select","getEditedPostAttribute","getPostType","isSupported","Array","isArray","some","key","supports"],"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {React.ReactNode} The component to be rendered.\n */\nfunction PostTypeSupportCheck( { children, supportKeys } ) {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn getPostType( getEditedPostAttribute( 'type' ) );\n\t}, [] );\n\tlet isSupported = !! postType;\n\tif ( postType ) {\n\t\tisSupported = (\n\t\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t\t).some( ( key ) => !! postType.supports[ key ] );\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostTypeSupportCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EAC1D,MAAMC,QAAQ,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACzC,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEL,WAAY,CAAC;IACxD,MAAM;MAAEO;IAAY,CAAC,GAAGF,MAAM,CAAEN,SAAU,CAAC;IAC3C,OAAOQ,WAAW,CAAED,sBAAsB,CAAE,MAAO,CAAE,CAAC;EACvD,CAAC,EAAE,EAAG,CAAC;EACP,IAAIE,WAAW,GAAG,CAAC,CAAEJ,QAAQ;EAC7B,IAAKA,QAAQ,EAAG;IACfI,WAAW,GAAG,CACbC,KAAK,CAACC,OAAO,CAAEP,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DQ,IAAI,CAAIC,GAAG,IAAM,CAAC,CAAER,QAAQ,CAACS,QAAQ,CAAED,GAAG,CAAG,CAAC;EACjD;EAEA,IAAK,CAAEJ,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAON,QAAQ;AAChB;AAEA,eAAeD,oBAAoB","ignoreList":[]}
|
|
@@ -12,10 +12,10 @@ import { store as editorStore } from '../../store';
|
|
|
12
12
|
/**
|
|
13
13
|
* Check if the post URL is valid and visible.
|
|
14
14
|
*
|
|
15
|
-
* @param {Object}
|
|
16
|
-
* @param {React.
|
|
15
|
+
* @param {Object} props The component props.
|
|
16
|
+
* @param {React.ReactNode} props.children The child components.
|
|
17
17
|
*
|
|
18
|
-
* @return {React.
|
|
18
|
+
* @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.
|
|
19
19
|
*/
|
|
20
20
|
export default function PostURLCheck({
|
|
21
21
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostURLCheck","children","isVisible","select","postTypeSlug","getCurrentPostType","postType","getPostType","viewable","post","getCurrentPost","link","permalinkParts","getPermalinkParts"],"sources":["@wordpress/editor/src/components/post-url/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Check if the post URL is valid and visible.\n *\n * @param {Object}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","editorStore","PostURLCheck","children","isVisible","select","postTypeSlug","getCurrentPostType","postType","getPostType","viewable","post","getCurrentPost","link","permalinkParts","getPermalinkParts"],"sources":["@wordpress/editor/src/components/post-url/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Check if the post URL is valid and visible.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.\n */\nexport default function PostURLCheck( { children } ) {\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( ! post.link ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tif ( ! permalinkParts ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAYA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMC,SAAS,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAC1C,MAAMC,YAAY,GAAGD,MAAM,CAAEJ,WAAY,CAAC,CAACM,kBAAkB,CAAC,CAAC;IAC/D,MAAMC,QAAQ,GAAGH,MAAM,CAAEL,SAAU,CAAC,CAACS,WAAW,CAAEH,YAAa,CAAC;IAChE,IAAK,CAAEE,QAAQ,EAAEE,QAAQ,EAAG;MAC3B,OAAO,KAAK;IACb;IAEA,MAAMC,IAAI,GAAGN,MAAM,CAAEJ,WAAY,CAAC,CAACW,cAAc,CAAC,CAAC;IACnD,IAAK,CAAED,IAAI,CAACE,IAAI,EAAG;MAClB,OAAO,KAAK;IACb;IAEA,MAAMC,cAAc,GAAGT,MAAM,CAAEJ,WAAY,CAAC,CAACc,iBAAiB,CAAC,CAAC;IAChE,IAAK,CAAED,cAAc,EAAG;MACvB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEV,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
|
|
@@ -179,7 +179,7 @@ function PreferencesModalContents({
|
|
|
179
179
|
children: /*#__PURE__*/_jsx(PreferenceToggleControl, {
|
|
180
180
|
scope: "core",
|
|
181
181
|
featureName: "keepCaretInsideBlock",
|
|
182
|
-
help: __('Keeps the text cursor within
|
|
182
|
+
help: __('Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'),
|
|
183
183
|
label: __('Contain text cursor inside block')
|
|
184
184
|
})
|
|
185
185
|
}), /*#__PURE__*/_jsx(PreferencesModalSection, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","BlockVisibility","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","select","isModalActive","closeModal","children","PreferencesModalContents","isLargeViewport","showBlockBreadcrumbsOption","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","window","__experimentalMediaProcessing","filter","Boolean"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from './block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View sidebar by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows starter patterns when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\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\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\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\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\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</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\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\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,wBAAwB;AAC/B,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,OAAOC,sCAAsC,MAAM,wCAAwC;AAC3F,OAAOC,0BAA0B,MAAM,0BAA0B;A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AE,CAAE,eAAgB;QAAG,CAC/B,CAAC;MAAA,CACsB;IAAC,CACzB;EAEJ,CAAC,CACD,CAACyE,MAAM,CAAEC,OAAQ,CAAC,EACpB,CACClC,0BAA0B,EAC1BR,aAAa,EACbe,mBAAmB,EACnBD,mBAAmB,EACnBG,aAAa,EACbV,eAAe,CAEjB,CAAC;EAED,oBAAOjB,IAAA,CAACM,oBAAoB;IAACsB,QAAQ,EAAGA;EAAU,CAAE,CAAC;AACtD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","BlockVisibility","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","select","isModalActive","closeModal","children","PreferencesModalContents","isLargeViewport","showBlockBreadcrumbsOption","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","window","__experimentalMediaProcessing","filter","Boolean"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from './block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View sidebar by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows starter patterns when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\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\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\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\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\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</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\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</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\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\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\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\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],"mappings":";A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E,CAAE,SAAU,CAAG;QACzB2D,WAAW,EAAG3D,EAAE,CACf,qDACD,CAAG;QAAAqC,QAAA,gBAEHf,IAAA,CAACQ,uBAAuB;UACvByB,KAAK,EAAC,YAAY;UAClBC,WAAW,EAAC,kBAAkB;UAC9BC,IAAI,EAAGzD,EAAE,CACR,sDACD,CAAG;UACH0D,KAAK,EAAG1D,EAAE,CAAE,wBAAyB;QAAG,CACxC,CAAC,eACFsB,IAAA,CAACQ,uBAAuB;UACvByB,KAAK,EAAC,YAAY;UAClBC,WAAW,EAAC,iBAAiB;UAC7BC,IAAI,EAAGzD,EAAE,CACR,uDACD,CAAG;UACH0D,KAAK,EAAG1D,EAAE,CAAE,eAAgB;QAAG,CAC/B,CAAC;MAAA,CACsB;IAAC,CACzB;EAEJ,CAAC,CACD,CAACyE,MAAM,CAAEC,OAAQ,CAAC,EACpB,CACClC,0BAA0B,EAC1BR,aAAa,EACbe,mBAAmB,EACnBD,mBAAmB,EACnBG,aAAa,EACbV,eAAe,CAEjB,CAAC;EAED,oBAAOjB,IAAA,CAACM,oBAAoB;IAACsB,QAAQ,EAAGA;EAAU,CAAE,CAAC;AACtD","ignoreList":[]}
|
|
@@ -167,7 +167,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
167
167
|
} = select(coreStore);
|
|
168
168
|
const postTypeSupports = getPostType(post.type)?.supports;
|
|
169
169
|
const hasLoadedPostObject = hasFinishedResolution('getPostType', [post.type]);
|
|
170
|
-
const _defaultMode = Array.isArray(postTypeSupports?.editor) ? postTypeSupports.editor.find(features => '
|
|
170
|
+
const _defaultMode = Array.isArray(postTypeSupports?.editor) ? postTypeSupports.editor.find(features => 'default-mode' in features)?.['default-mode'] : undefined;
|
|
171
171
|
const hasDefaultMode = RENDERING_MODES.includes(_defaultMode);
|
|
172
172
|
return {
|
|
173
173
|
editorSettings: getEditorSettings(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","RENDERING_MODES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","getPostType","hasFinishedResolution","postTypeSupports","supports","hasLoadedPostObject","_defaultMode","Array","isArray","editor","find","features","default_mode","undefined","hasDefaultMode","includes","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst {\n\t\t\t\t\tgetEntitiesConfig,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t} = select( coreStore );\n\n\t\t\t\tconst postTypeSupports = getPostType( post.type )?.supports;\n\t\t\t\tconst hasLoadedPostObject = hasFinishedResolution(\n\t\t\t\t\t'getPostType',\n\t\t\t\t\t[ post.type ]\n\t\t\t\t);\n\n\t\t\t\tconst _defaultMode = Array.isArray( postTypeSupports?.editor )\n\t\t\t\t\t? postTypeSupports.editor.find(\n\t\t\t\t\t\t\t( features ) => 'default_mode' in features\n\t\t\t\t\t )?.default_mode\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hasDefaultMode = RENDERING_MODES.includes( _defaultMode );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasLoadedPostObject,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && hasDefaultMode\n\t\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,IAAIC,SAAS,QACZ,sBAAsB;AAC7B,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASF,WAAW,IAAIG,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAAST,KAAK,IAAIU,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiG,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC/F,IAAA,CAAC4B,0BAA0B;IAAA,GACrBmE,KAAK;IACV9D,4BAA4B,EAAG1D,mBAAqB;IAAAyD,QAAA,EAElD+D,KAAK,CAAC/D;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAe8D,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","RENDERING_MODES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","getPostType","hasFinishedResolution","postTypeSupports","supports","hasLoadedPostObject","_defaultMode","Array","isArray","editor","find","features","undefined","hasDefaultMode","includes","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst {\n\t\t\t\t\tgetEntitiesConfig,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t} = select( coreStore );\n\n\t\t\t\tconst postTypeSupports = getPostType( post.type )?.supports;\n\t\t\t\tconst hasLoadedPostObject = hasFinishedResolution(\n\t\t\t\t\t'getPostType',\n\t\t\t\t\t[ post.type ]\n\t\t\t\t);\n\n\t\t\t\tconst _defaultMode = Array.isArray( postTypeSupports?.editor )\n\t\t\t\t\t? postTypeSupports.editor.find(\n\t\t\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t\t\t )?.[ 'default-mode' ]\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hasDefaultMode = RENDERING_MODES.includes( _defaultMode );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasLoadedPostObject,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && hasDefaultMode\n\t\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,IAAIC,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AuB,IAAE,CAAC,eAC3BK,IAAA,CAACR,yBAAyB,IAAE,CAAC,eAC7BQ,IAAA,CAACV,oBAAoB,IAAE,CAAC,eACxBU,IAAA,CAACT,gBAAgB,IAAE,CAAC,eACpBS,IAAA,CAACN,oBAAoB,IAAE,CAAC,eACxBM,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,qBAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgG,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC9F,IAAA,CAAC4B,0BAA0B;IAAA,GACrBkE,KAAK;IACV7D,4BAA4B,EAAG1D,mBAAqB;IAAAyD,QAAA,EAElD8D,KAAK,CAAC9D;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAe6D,cAAc","ignoreList":[]}
|
|
@@ -13,11 +13,9 @@ import { store as editorStore } from '../../store';
|
|
|
13
13
|
export default function StartPageOptions() {
|
|
14
14
|
const {
|
|
15
15
|
postId,
|
|
16
|
-
|
|
16
|
+
enabled
|
|
17
17
|
} = useSelect(select => {
|
|
18
18
|
const {
|
|
19
|
-
isEditedPostDirty,
|
|
20
|
-
isEditedPostEmpty,
|
|
21
19
|
getCurrentPostId,
|
|
22
20
|
getCurrentPostType
|
|
23
21
|
} = select(editorStore);
|
|
@@ -25,20 +23,31 @@ export default function StartPageOptions() {
|
|
|
25
23
|
const choosePatternModalEnabled = select(preferencesStore).get('core', 'enableChoosePatternModal');
|
|
26
24
|
return {
|
|
27
25
|
postId: getCurrentPostId(),
|
|
28
|
-
|
|
26
|
+
enabled: choosePatternModalEnabled && !preferencesModalActive && 'page' === getCurrentPostType()
|
|
29
27
|
};
|
|
30
28
|
}, []);
|
|
29
|
+
const {
|
|
30
|
+
isEditedPostDirty,
|
|
31
|
+
isEditedPostEmpty
|
|
32
|
+
} = useSelect(editorStore);
|
|
31
33
|
const {
|
|
32
34
|
setIsInserterOpened
|
|
33
35
|
} = useDispatch(editorStore);
|
|
34
36
|
useEffect(() => {
|
|
35
|
-
if (
|
|
37
|
+
if (!enabled) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const isFreshPage = !isEditedPostDirty() && isEditedPostEmpty();
|
|
41
|
+
if (isFreshPage) {
|
|
36
42
|
setIsInserterOpened({
|
|
37
43
|
tab: 'patterns',
|
|
38
44
|
category: 'core/starter-content'
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.
|
|
49
|
+
// Examples: changing pages in the List View, creating a new page via Command Palette.
|
|
50
|
+
}, [postId, enabled, setIsInserterOpened, isEditedPostDirty, isEditedPostEmpty]);
|
|
42
51
|
return null;
|
|
43
52
|
}
|
|
44
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useSelect","useDispatch","store","preferencesStore","interfaceStore","editorStore","StartPageOptions","postId","
|
|
1
|
+
{"version":3,"names":["useEffect","useSelect","useDispatch","store","preferencesStore","interfaceStore","editorStore","StartPageOptions","postId","enabled","select","getCurrentPostId","getCurrentPostType","preferencesModalActive","isModalActive","choosePatternModalEnabled","get","isEditedPostDirty","isEditedPostEmpty","setIsInserterOpened","isFreshPage","tab","category"],"sources":["@wordpress/editor/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function StartPageOptions() {\n\tconst { postId, enabled } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst preferencesModalActive =\n\t\t\tselect( interfaceStore ).isModalActive( 'editor/preferences' );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\t! preferencesModalActive &&\n\t\t\t\t'page' === getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { setIsInserterOpened } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\tif ( isFreshPage ) {\n\t\t\tsetIsInserterOpened( {\n\t\t\t\ttab: 'patterns',\n\t\t\t\tcategory: 'core/starter-content',\n\t\t\t} );\n\t\t}\n\n\t\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\t}, [\n\t\tpostId,\n\t\tenabled,\n\t\tsetIsInserterOpened,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACpD,MAAM;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAAGF,MAAM,CAAEJ,WAAY,CAAC;IACtE,MAAMO,sBAAsB,GAC3BH,MAAM,CAAEL,cAAe,CAAC,CAACS,aAAa,CAAE,oBAAqB,CAAC;IAC/D,MAAMC,yBAAyB,GAAGL,MAAM,CAAEN,gBAAiB,CAAC,CAACY,GAAG,CAC/D,MAAM,EACN,0BACD,CAAC;IACD,OAAO;MACNR,MAAM,EAAEG,gBAAgB,CAAC,CAAC;MAC1BF,OAAO,EACNM,yBAAyB,IACzB,CAAEF,sBAAsB,IACxB,MAAM,KAAKD,kBAAkB,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEK,iBAAiB;IAAEC;EAAkB,CAAC,GAAGjB,SAAS,CAAEK,WAAY,CAAC;EACzE,MAAM;IAAEa;EAAoB,CAAC,GAAGjB,WAAW,CAAEI,WAAY,CAAC;EAE1DN,SAAS,CAAE,MAAM;IAChB,IAAK,CAAES,OAAO,EAAG;MAChB;IACD;IAEA,MAAMW,WAAW,GAAG,CAAEH,iBAAiB,CAAC,CAAC,IAAIC,iBAAiB,CAAC,CAAC;IAChE,IAAKE,WAAW,EAAG;MAClBD,mBAAmB,CAAE;QACpBE,GAAG,EAAE,UAAU;QACfC,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ;;IAEA;IACA;EACD,CAAC,EAAE,CACFd,MAAM,EACNC,OAAO,EACPU,mBAAmB,EACnBF,iBAAiB,EACjBC,iBAAiB,CAChB,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -13,11 +13,11 @@ import { store as editorStore } from '../../store';
|
|
|
13
13
|
/**
|
|
14
14
|
* Checks if the current theme supports specific features and renders the children if supported.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
18
|
-
* @param {string|string[]}
|
|
16
|
+
* @param {Object} props The component props.
|
|
17
|
+
* @param {React.ReactNode} props.children The children to render if the theme supports the specified features.
|
|
18
|
+
* @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
|
|
19
19
|
*
|
|
20
|
-
* @return {React.
|
|
20
|
+
* @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null.
|
|
21
21
|
*/
|
|
22
22
|
export default function ThemeSupportCheck({
|
|
23
23
|
children,
|