@wordpress/edit-post 8.8.6 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/back-button/fullscreen-mode-close.js +2 -4
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +3 -12
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js +2 -5
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +2 -4
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +4 -13
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js +2 -5
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +10 -1
- package/build-style/classic.css +10 -1
- package/build-style/style-rtl.css +10 -1
- package/build-style/style.css +10 -1
- package/package.json +31 -31
- package/src/components/back-button/fullscreen-mode-close.js +1 -2
- package/src/components/back-button/test/__snapshots__/fullscreen-mode-close.js.snap +1 -1
- package/src/components/init-pattern-modal/index.js +5 -12
- package/src/components/preferences-modal/enable-custom-fields.js +1 -3
- package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +2 -2
- package/src/store/selectors.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -96,10 +96,8 @@ function FullscreenModeClose({
|
|
|
96
96
|
const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0, _i18n.__)('Back');
|
|
97
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
|
|
98
98
|
whileHover: "expand",
|
|
99
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
100
|
-
|
|
101
|
-
, {
|
|
102
|
-
__next40pxDefaultSize: false,
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
100
|
+
__next40pxDefaultSize: true,
|
|
103
101
|
className: classes,
|
|
104
102
|
href: buttonHref,
|
|
105
103
|
label: buttonLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","__next40pxDefaultSize","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","__next40pxDefaultSize","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KA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,QAAA,eAC9B,IAAArD,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAA6D,MAAM;MACNC,qBAAqB;MACrBf,SAAS,EAAGE,OAAS;MACrBtC,IAAI,EAAGwC,UAAY;MACnBY,KAAK,EAAGR,WAAa;MACrB9C,WAAW,EAAGA,WAAa;MAAAmD,QAAA,EAEzB5B;IAAU,CACL;EAAC,CACE,CAAC;AAEf;AAAC,IAAAgC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1D,mBAAmB","ignoreList":[]}
|
|
@@ -18,7 +18,6 @@ function InitPatternModal() {
|
|
|
18
18
|
const {
|
|
19
19
|
editPost
|
|
20
20
|
} = (0, _data.useDispatch)(_editor.store);
|
|
21
|
-
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
|
|
22
21
|
const [syncType, setSyncType] = (0, _element.useState)(undefined);
|
|
23
22
|
const [title, setTitle] = (0, _element.useState)('');
|
|
24
23
|
const {
|
|
@@ -34,13 +33,7 @@ function InitPatternModal() {
|
|
|
34
33
|
isNewPost: isCleanNewPost()
|
|
35
34
|
};
|
|
36
35
|
}, []);
|
|
37
|
-
(0, _element.
|
|
38
|
-
if (isNewPost && postType === 'wp_block') {
|
|
39
|
-
setIsModalOpen(true);
|
|
40
|
-
}
|
|
41
|
-
// We only want the modal to open when the page is first loaded.
|
|
42
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
-
}, []);
|
|
36
|
+
const [isModalOpen, setIsModalOpen] = (0, _element.useState)(() => isNewPost && postType === 'wp_block' ? true : false);
|
|
44
37
|
if (postType !== 'wp_block' || !isNewPost) {
|
|
45
38
|
return null;
|
|
46
39
|
}
|
|
@@ -82,10 +75,8 @@ function InitPatternModal() {
|
|
|
82
75
|
}
|
|
83
76
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
84
77
|
justify: "right",
|
|
85
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
86
|
-
|
|
87
|
-
, {
|
|
88
|
-
__next40pxDefaultSize: false,
|
|
78
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
79
|
+
__next40pxDefaultSize: true,
|
|
89
80
|
variant: "primary",
|
|
90
81
|
type: "submit",
|
|
91
82
|
disabled: !title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_jsxRuntime","InitPatternModal","editPost","useDispatch","editorStore","
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_jsxRuntime","InitPatternModal","editPost","useDispatch","editorStore","syncType","setSyncType","useState","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","isModalOpen","setIsModalOpen","jsx","Fragment","children","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","jsxs","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","accessibleWhenDisabled"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( () =>\n\t\tisNewPost && postType === 'wp_block' ? true : false\n\t);\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAdzD;AACA;AACA;;AAce,SAASM,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/C,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAC,iBAAQ,EAAEC,SAAU,CAAC;EACvD,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAH,iBAAQ,EAAE,EAAG,CAAC;EAE1C,MA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mB,GAAA,EAACtB,WAAA,CAAAqC,WAAW;YACXC,KAAK,EAAG,IAAAZ,QAAE,EAAE,MAAO,CAAG;YACtBa,KAAK,EAAG3B,KAAO;YACf4B,QAAQ,EAAG3B,QAAU;YACrB4B,WAAW,EAAG,IAAAf,QAAE,EAAE,YAAa,CAAG;YAClCgB,SAAS,EAAC,mCAAmC;YAC7CC,uBAAuB;YACvBC,qBAAqB;UAAA,CACrB,CAAC,eACF,IAAAzC,WAAA,CAAAmB,GAAA,EAACtB,WAAA,CAAA6C,aAAa;YACbF,uBAAuB;YACvBL,KAAK,EAAG,IAAAQ,QAAE,EAAE,QAAQ,EAAE,oBAAqB,CAAG;YAC9CC,IAAI,EAAG,IAAArB,QAAE,EACR,8CACD,CAAG;YACHsB,OAAO,EAAG,CAAExC,QAAU;YACtBgC,QAAQ,EAAGA,CAAA,KAAM;cAChB/B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGG,SAC3B,CAAC;YACF;UAAG,CACH,CAAC,eACF,IAAAR,WAAA,CAAAmB,GAAA,EAACtB,WAAA,CAAAiD,oBAAM;YAACC,OAAO,EAAC,OAAO;YAAA1B,QAAA,eACtB,IAAArB,WAAA,CAAAmB,GAAA,EAACtB,WAAA,CAAAmD,MAAM;cACNP,qBAAqB;cACrBQ,OAAO,EAAC,SAAS;cACjBC,IAAI,EAAC,QAAQ;cACbC,QAAQ,EAAG,CAAE1C,KAAO;cACpB2C,sBAAsB;cAAA/B,QAAA,EAEpB,IAAAE,QAAE,EAAE,QAAS;YAAC,CACT;UAAC,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACD;EACP,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -41,11 +41,8 @@ function CustomFieldsConfirmation({
|
|
|
41
41
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
42
42
|
className: "edit-post-preferences-modal__custom-fields-confirmation-message",
|
|
43
43
|
children: (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')
|
|
44
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
45
|
-
|
|
46
|
-
, {
|
|
47
|
-
__next40pxDefaultSize: false,
|
|
48
|
-
className: "edit-post-preferences-modal__custom-fields-confirmation-button",
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
45
|
+
__next40pxDefaultSize: true,
|
|
49
46
|
variant: "secondary",
|
|
50
47
|
isBusy: isReloading,
|
|
51
48
|
accessibleWhenDisabled: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,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AAU,GACT,IAAAS,QAAE,EAAE,oBAAqB,CAAC,GAC1B,IAAAA,QAAE,EAAE,oBAAqB;IAAC,CACtB,CAAC;EAAA,CACR,CAAC;AAEL;AAEO,SAASQ,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAlB,iBAAQ,EAAEgB,sBAAuB,CAAC;EAEtE,oBACC,IAAAnC,WAAA,CAAAuB,GAAA,EAACtB,oBAAoB;IACpBiC,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAf,QAAA,EAEvBc,SAAS,KAAKD,sBAAsB,iBACrC,IAAAnC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGoB;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC1CR,sBAAsB,EACrB,CAAC,CAAEQ,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEb,wBAAyB,CAAC","ignoreList":[]}
|
package/build/store/selectors.js
CHANGED
|
@@ -455,7 +455,7 @@ const __experimentalGetInsertionPoint = exports.__experimentalGetInsertionPoint
|
|
|
455
455
|
since: '6.5',
|
|
456
456
|
version: '6.7'
|
|
457
457
|
});
|
|
458
|
-
return (0, _lockUnlock.unlock)(select(_editor.store)).
|
|
458
|
+
return (0, _lockUnlock.unlock)(select(_editor.store)).getInserter();
|
|
459
459
|
});
|
|
460
460
|
|
|
461
461
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_preferences","_coreData","_editor","_deprecated","_interopRequireDefault","_lockUnlock","_privateSelectors","interfaceStore","unlock","editorPrivateApis","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","exports","createRegistrySelector","select","_select$get","preferencesStore","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","editorStore","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","templateId","getEditedPostTemplateId","coreStore","getEditedEntityRecord"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { getEditedPostTemplateId } from './private-selectors';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateId = getEditedPostTemplateId( state );\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\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M;EAC5E,IAAAuB,mBAAU,EAAG,8CAA6C,EAAE;IAC3DC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EACH,OAAOzB,MAAM,CAAEsC,aAAY,CAAC,CAACuC,kBAAkB,CAAC,CAAC,KAAK,aAAa;AACpE,CAAE,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAE/C,KAAK,EAAG;EAChD,OAAOA,KAAK,CAACsB,SAAS,CAAC0B,WAAW;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAAlF,OAAA,CAAAkF,qBAAA,GAAG,IAAAjF,4BAAsB,EACxDC,MAAM,IAAQ+B,KAAK,IAAM;EAC1B,MAAMkD,UAAU,GAAG,IAAAC,yCAAuB,EAAEnD,KAAM,CAAC;EACnD,IAAK,CAAEkD,UAAU,EAAG;IACnB,OAAO/C,SAAS;EACjB;EACA,OAAOlC,MAAM,CAAEmF,eAAU,CAAC,CAACC,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbH,UACD,CAAC;AACF,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_preferences","_coreData","_editor","_deprecated","_interopRequireDefault","_lockUnlock","_privateSelectors","interfaceStore","unlock","editorPrivateApis","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","exports","createRegistrySelector","select","_select$get","preferencesStore","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","editorStore","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInserter","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","templateId","getEditedPostTemplateId","coreStore","getEditedEntityRecord"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { getEditedPostTemplateId } from './private-selectors';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInserter();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateId = getEditedPostTemplateId( state );\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAe,CAAC,GAAG,IAAAC,kBA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AG,IAAAjF,4BAAsB,EACxDC,MAAM,IAAQ+B,KAAK,IAAM;EAC1B,MAAMkD,UAAU,GAAG,IAAAC,yCAAuB,EAAEnD,KAAM,CAAC;EACnD,IAAK,CAAEkD,UAAU,EAAG;IACnB,OAAO/C,SAAS;EACjB;EACA,OAAOlC,MAAM,CAAEmF,eAAU,CAAC,CAACC,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbH,UACD,CAAC;AACF,CACD,CAAC","ignoreList":[]}
|
|
@@ -88,10 +88,8 @@ function FullscreenModeClose({
|
|
|
88
88
|
const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : __('Back');
|
|
89
89
|
return /*#__PURE__*/_jsx(motion.div, {
|
|
90
90
|
whileHover: "expand",
|
|
91
|
-
children: /*#__PURE__*/_jsx(Button
|
|
92
|
-
|
|
93
|
-
, {
|
|
94
|
-
__next40pxDefaultSize: false,
|
|
91
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
92
|
+
__next40pxDefaultSize: true,
|
|
95
93
|
className: classes,
|
|
96
94
|
href: buttonHref,
|
|
97
95
|
label: buttonLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","jsx","_jsx","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","getEntityRecord","getPostType","isResolving","siteData","undefined","_postType","type","site_icon_url","disableMotion","buttonIcon","size","effect","expand","scale","transition","duration","img","variants","alt","className","src","classes","buttonHref","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","__next40pxDefaultSize","label"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\
|
|
1
|
+
{"version":3,"names":["clsx","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","jsx","_jsx","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","getEntityRecord","getPostType","isResolving","siteData","undefined","_postType","type","site_icon_url","disableMotion","buttonIcon","size","effect","expand","scale","transition","duration","img","variants","alt","className","src","classes","buttonHref","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","__next40pxDefaultSize","label"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName={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AAW,IAAA/B,qBAAA,GAAGE,QAAQ,EAAE8B,MAAM,EAAEC,UAAU,cAAAjC,qBAAA,cAAAA,qBAAA,GAAId,EAAE,CAAE,MAAO,CAAC;EAEhE,oBACCQ,IAAA,CAACT,MAAM,CAACiD,GAAG;IAACC,UAAU,EAAC,QAAQ;IAAAC,QAAA,eAC9B1C,IAAA,CAACZ,MAAM;MACNuD,qBAAqB;MACrBZ,SAAS,EAAGE,OAAS;MACrB7B,IAAI,EAAG8B,UAAY;MACnBU,KAAK,EAAGP,WAAa;MACrBnC,WAAW,EAAGA,WAAa;MAAAwC,QAAA,EAEzBrB;IAAU,CACL;EAAC,CACE,CAAC;AAEf;AAEA,eAAepB,mBAAmB","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __, _x } from '@wordpress/i18n';
|
|
6
6
|
import { Modal, Button, __experimentalHStack as HStack, __experimentalVStack as VStack, ToggleControl, TextControl } from '@wordpress/components';
|
|
7
|
-
import {
|
|
7
|
+
import { useState } from '@wordpress/element';
|
|
8
8
|
import { store as editorStore } from '@wordpress/editor';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -13,7 +13,6 @@ export default function InitPatternModal() {
|
|
|
13
13
|
const {
|
|
14
14
|
editPost
|
|
15
15
|
} = useDispatch(editorStore);
|
|
16
|
-
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
17
16
|
const [syncType, setSyncType] = useState(undefined);
|
|
18
17
|
const [title, setTitle] = useState('');
|
|
19
18
|
const {
|
|
@@ -29,13 +28,7 @@ export default function InitPatternModal() {
|
|
|
29
28
|
isNewPost: isCleanNewPost()
|
|
30
29
|
};
|
|
31
30
|
}, []);
|
|
32
|
-
|
|
33
|
-
if (isNewPost && postType === 'wp_block') {
|
|
34
|
-
setIsModalOpen(true);
|
|
35
|
-
}
|
|
36
|
-
// We only want the modal to open when the page is first loaded.
|
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
}, []);
|
|
31
|
+
const [isModalOpen, setIsModalOpen] = useState(() => isNewPost && postType === 'wp_block' ? true : false);
|
|
39
32
|
if (postType !== 'wp_block' || !isNewPost) {
|
|
40
33
|
return null;
|
|
41
34
|
}
|
|
@@ -77,10 +70,8 @@ export default function InitPatternModal() {
|
|
|
77
70
|
}
|
|
78
71
|
}), /*#__PURE__*/_jsx(HStack, {
|
|
79
72
|
justify: "right",
|
|
80
|
-
children: /*#__PURE__*/_jsx(Button
|
|
81
|
-
|
|
82
|
-
, {
|
|
83
|
-
__next40pxDefaultSize: false,
|
|
73
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
74
|
+
__next40pxDefaultSize: true,
|
|
84
75
|
variant: "primary",
|
|
85
76
|
type: "submit",
|
|
86
77
|
disabled: !title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","__","_x","Modal","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","ToggleControl","TextControl","
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","__","_x","Modal","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","ToggleControl","TextControl","useState","store","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","InitPatternModal","editPost","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","select","getEditedPostAttribute","isCleanNewPost","isModalOpen","setIsModalOpen","children","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","spacing","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","help","checked","justify","variant","type","disabled","accessibleWhenDisabled"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( () =>\n\t\tisNewPost && postType === 'wp_block' ? true : false\n\t);\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,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AAC,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACD;EACP,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -34,11 +34,8 @@ export function CustomFieldsConfirmation({
|
|
|
34
34
|
children: [/*#__PURE__*/_jsx("p", {
|
|
35
35
|
className: "edit-post-preferences-modal__custom-fields-confirmation-message",
|
|
36
36
|
children: __('A page reload is required for this change. Make sure your content is saved before reloading.')
|
|
37
|
-
}), /*#__PURE__*/_jsx(Button
|
|
38
|
-
|
|
39
|
-
, {
|
|
40
|
-
__next40pxDefaultSize: false,
|
|
41
|
-
className: "edit-post-preferences-modal__custom-fields-confirmation-button",
|
|
37
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
38
|
+
__next40pxDefaultSize: true,
|
|
42
39
|
variant: "secondary",
|
|
43
40
|
isBusy: isReloading,
|
|
44
41
|
accessibleWhenDisabled: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","children","className","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\
|
|
1
|
+
{"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","children","className","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( En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EAAGR,WAAa;MACxBS,OAAO,EAAGA,CAAA,KAAM;QACfR,cAAc,CAAE,IAAK,CAAC;QACtBb,sBAAsB,CAAC,CAAC;MACzB,CAAG;MAAAc,QAAA,EAEDH,UAAU,GACT3B,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,oBAAqB;IAAC,CACtB,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,OAAO,SAASsC,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG3C,QAAQ,CAAEyC,sBAAuB,CAAC;EAEtE,oBACC9B,IAAA,CAACK,oBAAoB;IACpBwB,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAZ,QAAA,EAEvBW,SAAS,KAAKD,sBAAsB,iBACrC9B,IAAA,CAACgB,wBAAwB;MAACC,UAAU,EAAGc;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB;AAEA,eAAevC,UAAU,CAAI0C,MAAM,KAAQ;EAC1CJ,sBAAsB,EACrB,CAAC,CAAEI,MAAM,CAAExC,WAAY,CAAC,CAACyC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAER,wBAAyB,CAAC","ignoreList":[]}
|
|
@@ -437,7 +437,7 @@ export const __experimentalGetInsertionPoint = createRegistrySelector(select =>
|
|
|
437
437
|
since: '6.5',
|
|
438
438
|
version: '6.7'
|
|
439
439
|
});
|
|
440
|
-
return unlock(select(editorStore)).
|
|
440
|
+
return unlock(select(editorStore)).getInserter();
|
|
441
441
|
});
|
|
442
442
|
|
|
443
443
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSelector","createRegistrySelector","store","preferencesStore","coreStore","editorStore","privateApis","editorPrivateApis","deprecated","unlock","getEditedPostTemplateId","interfaceStore","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","templateId","getEditedEntityRecord"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { getEditedPostTemplateId } from './private-selectors';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateId = getEditedPostTemplateId( state );\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;A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F,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createSelector","createRegistrySelector","store","preferencesStore","coreStore","editorStore","privateApis","editorPrivateApis","deprecated","unlock","getEditedPostTemplateId","interfaceStore","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInserter","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","templateId","getEditedEntityRecord"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { getEditedPostTemplateId } from './private-selectors';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInserter();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateId = getEditedPostTemplateId( state );\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SACCF,KAAK,IAAIG,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,uBAAuB,QAAQ,qBAAqB;AAE7D,MAAM;EAAEC;AAAe,CAAC,GAAGF,MAAM,CAAEF,iBAAkB,CAAC;AACtD,MAAMK,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGb,sBAAsB,CAChDc,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAEZ,gBAAiB,CAAC,CAACc,GAAG,CAAE,MAAM,EAAE,YAAa,CAAC,cAAAD,WAAA,cAAAA,WAAA,GAAI,QAAQ;AAAA,CACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GAAGjB,sBAAsB,CACxDc,MAAM,IAAM,MAAM;EACnB,MAAMI,oBAAoB,GACzBJ,MAAM,CAAEJ,cAAe,CAAC,CAACS,0BAA0B,CAAE,MAAO,CAAC;EAC9D,OAAO,CAAE,oBAAoB,EAAE,iBAAiB,CAAE,CAACC,QAAQ,CAC1DF,oBACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;A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AK,CAAEgD,UAAU,EAAG;IACnB,OAAO7C,SAAS;EACjB;EACA,OAAOhC,MAAM,CAAEX,SAAU,CAAC,CAACyF,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbD,UACD,CAAC;AACF,CACD,CAAC","ignoreList":[]}
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* Fonts & basic variables.
|
|
31
31
|
*/
|
|
32
|
+
/**
|
|
33
|
+
* Typography
|
|
34
|
+
*/
|
|
32
35
|
/**
|
|
33
36
|
* Grid System.
|
|
34
37
|
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
@@ -43,7 +46,10 @@
|
|
|
43
46
|
* Dimensions.
|
|
44
47
|
*/
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Mobile specific styles
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Editor styles.
|
|
47
53
|
*/
|
|
48
54
|
/**
|
|
49
55
|
* Block & Editor UI.
|
|
@@ -67,6 +73,9 @@
|
|
|
67
73
|
* Creates a fading overlay to signify that the content is longer
|
|
68
74
|
* than the space allows.
|
|
69
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* Typography
|
|
78
|
+
*/
|
|
70
79
|
/**
|
|
71
80
|
* Breakpoint mixins
|
|
72
81
|
*/
|
package/build-style/classic.css
CHANGED
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* Fonts & basic variables.
|
|
31
31
|
*/
|
|
32
|
+
/**
|
|
33
|
+
* Typography
|
|
34
|
+
*/
|
|
32
35
|
/**
|
|
33
36
|
* Grid System.
|
|
34
37
|
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
@@ -43,7 +46,10 @@
|
|
|
43
46
|
* Dimensions.
|
|
44
47
|
*/
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Mobile specific styles
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Editor styles.
|
|
47
53
|
*/
|
|
48
54
|
/**
|
|
49
55
|
* Block & Editor UI.
|
|
@@ -67,6 +73,9 @@
|
|
|
67
73
|
* Creates a fading overlay to signify that the content is longer
|
|
68
74
|
* than the space allows.
|
|
69
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* Typography
|
|
78
|
+
*/
|
|
70
79
|
/**
|
|
71
80
|
* Breakpoint mixins
|
|
72
81
|
*/
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* Fonts & basic variables.
|
|
31
31
|
*/
|
|
32
|
+
/**
|
|
33
|
+
* Typography
|
|
34
|
+
*/
|
|
32
35
|
/**
|
|
33
36
|
* Grid System.
|
|
34
37
|
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
@@ -43,7 +46,10 @@
|
|
|
43
46
|
* Dimensions.
|
|
44
47
|
*/
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Mobile specific styles
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Editor styles.
|
|
47
53
|
*/
|
|
48
54
|
/**
|
|
49
55
|
* Block & Editor UI.
|
|
@@ -67,6 +73,9 @@
|
|
|
67
73
|
* Creates a fading overlay to signify that the content is longer
|
|
68
74
|
* than the space allows.
|
|
69
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* Typography
|
|
78
|
+
*/
|
|
70
79
|
/**
|
|
71
80
|
* Breakpoint mixins
|
|
72
81
|
*/
|
package/build-style/style.css
CHANGED
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* Fonts & basic variables.
|
|
31
31
|
*/
|
|
32
|
+
/**
|
|
33
|
+
* Typography
|
|
34
|
+
*/
|
|
32
35
|
/**
|
|
33
36
|
* Grid System.
|
|
34
37
|
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
@@ -43,7 +46,10 @@
|
|
|
43
46
|
* Dimensions.
|
|
44
47
|
*/
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* Mobile specific styles
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Editor styles.
|
|
47
53
|
*/
|
|
48
54
|
/**
|
|
49
55
|
* Block & Editor UI.
|
|
@@ -67,6 +73,9 @@
|
|
|
67
73
|
* Creates a fading overlay to signify that the content is longer
|
|
68
74
|
* than the space allows.
|
|
69
75
|
*/
|
|
76
|
+
/**
|
|
77
|
+
* Typography
|
|
78
|
+
*/
|
|
70
79
|
/**
|
|
71
80
|
* Breakpoint mixins
|
|
72
81
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,35 +28,35 @@
|
|
|
28
28
|
"react-native": "src/index",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
|
-
"@wordpress/a11y": "^4.
|
|
32
|
-
"@wordpress/api-fetch": "^7.
|
|
33
|
-
"@wordpress/block-editor": "^14.
|
|
34
|
-
"@wordpress/block-library": "^9.
|
|
35
|
-
"@wordpress/blocks": "^13.
|
|
36
|
-
"@wordpress/commands": "^1.
|
|
37
|
-
"@wordpress/components": "^28.
|
|
38
|
-
"@wordpress/compose": "^7.
|
|
39
|
-
"@wordpress/core-commands": "^1.
|
|
40
|
-
"@wordpress/core-data": "^7.
|
|
41
|
-
"@wordpress/data": "^10.
|
|
42
|
-
"@wordpress/deprecated": "^4.
|
|
43
|
-
"@wordpress/dom": "^4.
|
|
44
|
-
"@wordpress/editor": "^14.
|
|
45
|
-
"@wordpress/element": "^6.
|
|
46
|
-
"@wordpress/hooks": "^4.
|
|
47
|
-
"@wordpress/html-entities": "^4.
|
|
48
|
-
"@wordpress/i18n": "^5.
|
|
49
|
-
"@wordpress/icons": "^10.
|
|
50
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
51
|
-
"@wordpress/keycodes": "^4.
|
|
52
|
-
"@wordpress/notices": "^5.
|
|
53
|
-
"@wordpress/plugins": "^7.
|
|
54
|
-
"@wordpress/preferences": "^4.
|
|
55
|
-
"@wordpress/private-apis": "^1.
|
|
56
|
-
"@wordpress/url": "^4.
|
|
57
|
-
"@wordpress/viewport": "^6.
|
|
58
|
-
"@wordpress/warning": "^3.
|
|
59
|
-
"@wordpress/widgets": "^4.
|
|
31
|
+
"@wordpress/a11y": "^4.9.0",
|
|
32
|
+
"@wordpress/api-fetch": "^7.9.0",
|
|
33
|
+
"@wordpress/block-editor": "^14.4.0",
|
|
34
|
+
"@wordpress/block-library": "^9.9.0",
|
|
35
|
+
"@wordpress/blocks": "^13.9.0",
|
|
36
|
+
"@wordpress/commands": "^1.9.0",
|
|
37
|
+
"@wordpress/components": "^28.9.0",
|
|
38
|
+
"@wordpress/compose": "^7.9.0",
|
|
39
|
+
"@wordpress/core-commands": "^1.9.0",
|
|
40
|
+
"@wordpress/core-data": "^7.9.0",
|
|
41
|
+
"@wordpress/data": "^10.9.0",
|
|
42
|
+
"@wordpress/deprecated": "^4.9.0",
|
|
43
|
+
"@wordpress/dom": "^4.9.0",
|
|
44
|
+
"@wordpress/editor": "^14.9.0",
|
|
45
|
+
"@wordpress/element": "^6.9.0",
|
|
46
|
+
"@wordpress/hooks": "^4.9.0",
|
|
47
|
+
"@wordpress/html-entities": "^4.9.0",
|
|
48
|
+
"@wordpress/i18n": "^5.9.0",
|
|
49
|
+
"@wordpress/icons": "^10.9.0",
|
|
50
|
+
"@wordpress/keyboard-shortcuts": "^5.9.0",
|
|
51
|
+
"@wordpress/keycodes": "^4.9.0",
|
|
52
|
+
"@wordpress/notices": "^5.9.0",
|
|
53
|
+
"@wordpress/plugins": "^7.9.0",
|
|
54
|
+
"@wordpress/preferences": "^4.9.0",
|
|
55
|
+
"@wordpress/private-apis": "^1.9.0",
|
|
56
|
+
"@wordpress/url": "^4.9.0",
|
|
57
|
+
"@wordpress/viewport": "^6.9.0",
|
|
58
|
+
"@wordpress/warning": "^3.9.0",
|
|
59
|
+
"@wordpress/widgets": "^4.9.0",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
61
61
|
"memize": "^2.1.0"
|
|
62
62
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "2e5495c635910cb34bfaca3c6258d2e989f66214"
|
|
71
71
|
}
|
|
@@ -91,8 +91,7 @@ function FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {
|
|
|
91
91
|
return (
|
|
92
92
|
<motion.div whileHover="expand">
|
|
93
93
|
<Button
|
|
94
|
-
|
|
95
|
-
__next40pxDefaultSize={ false }
|
|
94
|
+
__next40pxDefaultSize
|
|
96
95
|
className={ classes }
|
|
97
96
|
href={ buttonHref }
|
|
98
97
|
label={ buttonLabel }
|
|
@@ -5,7 +5,7 @@ exports[`FullscreenModeClose when in full screen mode should display a default s
|
|
|
5
5
|
<div>
|
|
6
6
|
<a
|
|
7
7
|
aria-label="Back"
|
|
8
|
-
class="components-button edit-post-fullscreen-mode-close"
|
|
8
|
+
class="components-button edit-post-fullscreen-mode-close is-next-40px-default-size"
|
|
9
9
|
href="edit.php?"
|
|
10
10
|
>
|
|
11
11
|
<svg
|
|
@@ -11,12 +11,11 @@ import {
|
|
|
11
11
|
ToggleControl,
|
|
12
12
|
TextControl,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
|
-
import {
|
|
14
|
+
import { useState } from '@wordpress/element';
|
|
15
15
|
import { store as editorStore } from '@wordpress/editor';
|
|
16
16
|
|
|
17
17
|
export default function InitPatternModal() {
|
|
18
18
|
const { editPost } = useDispatch( editorStore );
|
|
19
|
-
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
20
19
|
const [ syncType, setSyncType ] = useState( undefined );
|
|
21
20
|
const [ title, setTitle ] = useState( '' );
|
|
22
21
|
|
|
@@ -28,14 +27,9 @@ export default function InitPatternModal() {
|
|
|
28
27
|
isNewPost: isCleanNewPost(),
|
|
29
28
|
};
|
|
30
29
|
}, [] );
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setIsModalOpen( true );
|
|
35
|
-
}
|
|
36
|
-
// We only want the modal to open when the page is first loaded.
|
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
}, [] );
|
|
30
|
+
const [ isModalOpen, setIsModalOpen ] = useState( () =>
|
|
31
|
+
isNewPost && postType === 'wp_block' ? true : false
|
|
32
|
+
);
|
|
39
33
|
|
|
40
34
|
if ( postType !== 'wp_block' || ! isNewPost ) {
|
|
41
35
|
return null;
|
|
@@ -88,8 +82,7 @@ export default function InitPatternModal() {
|
|
|
88
82
|
/>
|
|
89
83
|
<HStack justify="right">
|
|
90
84
|
<Button
|
|
91
|
-
|
|
92
|
-
__next40pxDefaultSize={ false }
|
|
85
|
+
__next40pxDefaultSize
|
|
93
86
|
variant="primary"
|
|
94
87
|
type="submit"
|
|
95
88
|
disabled={ ! title }
|
|
@@ -39,9 +39,7 @@ export function CustomFieldsConfirmation( { willEnable } ) {
|
|
|
39
39
|
) }
|
|
40
40
|
</p>
|
|
41
41
|
<Button
|
|
42
|
-
|
|
43
|
-
__next40pxDefaultSize={ false }
|
|
44
|
-
className="edit-post-preferences-modal__custom-fields-confirmation-button"
|
|
42
|
+
__next40pxDefaultSize
|
|
45
43
|
variant="secondary"
|
|
46
44
|
isBusy={ isReloading }
|
|
47
45
|
accessibleWhenDisabled
|
|
@@ -97,7 +97,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
|
|
|
97
97
|
A page reload is required for this change. Make sure your content is saved before reloading.
|
|
98
98
|
</p>
|
|
99
99
|
<button
|
|
100
|
-
class="components-button
|
|
100
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
101
101
|
type="button"
|
|
102
102
|
>
|
|
103
103
|
Show & Reload Page
|
|
@@ -300,7 +300,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmati
|
|
|
300
300
|
A page reload is required for this change. Make sure your content is saved before reloading.
|
|
301
301
|
</p>
|
|
302
302
|
<button
|
|
303
|
-
class="components-button
|
|
303
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
304
304
|
type="button"
|
|
305
305
|
>
|
|
306
306
|
Hide & Reload Page
|
package/src/store/selectors.js
CHANGED