@wordpress/editor 14.19.1 → 14.20.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/commands/index.js +1 -1
  3. package/build/components/commands/index.js.map +1 -1
  4. package/build/components/post-actions/actions.js +10 -8
  5. package/build/components/post-actions/actions.js.map +1 -1
  6. package/build/components/post-publish-panel/maybe-category-panel.js +19 -3
  7. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  8. package/build/components/post-publish-panel/maybe-tags-panel.js +16 -6
  9. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  10. package/build/components/post-status/index.js +1 -1
  11. package/build/components/post-status/index.js.map +1 -1
  12. package/build/components/post-sticky/index.js +1 -1
  13. package/build/components/post-sticky/index.js.map +1 -1
  14. package/build/components/post-template/hooks.js +6 -5
  15. package/build/components/post-template/hooks.js.map +1 -1
  16. package/build/components/post-template/swap-template-button.js +2 -3
  17. package/build/components/post-template/swap-template-button.js.map +1 -1
  18. package/build/components/post-visibility/index.js +39 -109
  19. package/build/components/post-visibility/index.js.map +1 -1
  20. package/build/components/post-visibility/label.js +2 -2
  21. package/build/components/post-visibility/label.js.map +1 -1
  22. package/build/components/post-visibility/utils.js +14 -15
  23. package/build/components/post-visibility/utils.js.map +1 -1
  24. package/build/components/provider/index.js +7 -4
  25. package/build/components/provider/index.js.map +1 -1
  26. package/build-module/components/commands/index.js +1 -1
  27. package/build-module/components/commands/index.js.map +1 -1
  28. package/build-module/components/post-actions/actions.js +10 -8
  29. package/build-module/components/post-actions/actions.js.map +1 -1
  30. package/build-module/components/post-publish-panel/maybe-category-panel.js +19 -3
  31. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  32. package/build-module/components/post-publish-panel/maybe-tags-panel.js +16 -6
  33. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  34. package/build-module/components/post-status/index.js +1 -1
  35. package/build-module/components/post-status/index.js.map +1 -1
  36. package/build-module/components/post-sticky/index.js +1 -1
  37. package/build-module/components/post-sticky/index.js.map +1 -1
  38. package/build-module/components/post-template/hooks.js +6 -5
  39. package/build-module/components/post-template/hooks.js.map +1 -1
  40. package/build-module/components/post-template/swap-template-button.js +2 -3
  41. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  42. package/build-module/components/post-visibility/index.js +41 -111
  43. package/build-module/components/post-visibility/index.js.map +1 -1
  44. package/build-module/components/post-visibility/label.js +3 -3
  45. package/build-module/components/post-visibility/label.js.map +1 -1
  46. package/build-module/components/post-visibility/utils.js +13 -14
  47. package/build-module/components/post-visibility/utils.js.map +1 -1
  48. package/build-module/components/provider/index.js +7 -4
  49. package/build-module/components/provider/index.js.map +1 -1
  50. package/build-style/style-rtl.css +2 -137
  51. package/build-style/style.css +2 -137
  52. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  53. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  54. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
  55. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  56. package/build-types/components/post-template/swap-template-button.d.ts +1 -1
  57. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  58. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  59. package/build-types/components/post-visibility/label.d.ts.map +1 -1
  60. package/build-types/components/post-visibility/utils.d.ts +5 -20
  61. package/build-types/components/post-visibility/utils.d.ts.map +1 -1
  62. package/build-types/components/provider/index.d.ts.map +1 -1
  63. package/package.json +37 -37
  64. package/src/components/autocompleters/style.scss +2 -3
  65. package/src/components/commands/index.js +1 -1
  66. package/src/components/post-actions/actions.js +13 -8
  67. package/src/components/post-publish-panel/maybe-category-panel.js +20 -5
  68. package/src/components/post-publish-panel/maybe-tags-panel.js +39 -22
  69. package/src/components/post-status/index.js +1 -1
  70. package/src/components/post-sticky/index.js +1 -1
  71. package/src/components/post-template/hooks.js +12 -8
  72. package/src/components/post-template/swap-template-button.js +6 -4
  73. package/src/components/post-visibility/index.js +41 -118
  74. package/src/components/post-visibility/label.js +7 -4
  75. package/src/components/post-visibility/utils.js +11 -8
  76. package/src/components/provider/index.js +9 -4
  77. package/src/style.scss +0 -1
  78. package/tsconfig.tsbuildinfo +1 -1
  79. package/src/components/post-visibility/style.scss +0 -27
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useState","decodeEntities","__experimentalBlockPatternsList","BlockPatternsList","MenuItem","Modal","__","useDispatch","store","coreStore","parse","useAvailableTemplates","useEditedPostContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SwapTemplateButton","onClick","showModal","setShowModal","postType","postId","availableTemplates","editEntityRecord","length","onTemplateSelect","template","name","undoIgnore","children","title","onRequestClose","overlayClassName","isFullScreen","className","TemplatesList","onSelect","templatesAsPatterns","map","slug","blocks","content","raw","rendered","id","label","blockPatterns","onClickPattern"],"sources":["@wordpress/editor/src/components/post-template/swap-template-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { MenuItem, Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useAvailableTemplates, useEditedPostContext } from './hooks';\n\nexport default function SwapTemplateButton( { onClick } ) {\n\tconst [ showModal, setShowModal ] = useState( false );\n\tconst { postType, postId } = useEditedPostContext();\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tif ( ! availableTemplates?.length ) {\n\t\treturn null;\n\t}\n\tconst onTemplateSelect = async ( template ) => {\n\t\teditEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{ template: template.name },\n\t\t\t{ undoIgnore: true }\n\t\t);\n\t\tsetShowModal( false ); // Close the template suggestions modal first.\n\t\tonClick();\n\t};\n\treturn (\n\t\t<>\n\t\t\t<MenuItem onClick={ () => setShowModal( true ) }>\n\t\t\t\t{ __( 'Change template' ) }\n\t\t\t</MenuItem>\n\t\t\t{ showModal && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Choose a template' ) }\n\t\t\t\t\tonRequestClose={ () => setShowModal( false ) }\n\t\t\t\t\toverlayClassName=\"editor-post-template__swap-template-modal\"\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<div className=\"editor-post-template__swap-template-modal-content\">\n\t\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction TemplatesList( { postType, onSelect } ) {\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst templatesAsPatterns = useMemo(\n\t\t() =>\n\t\t\tavailableTemplates.map( ( template ) => ( {\n\t\t\t\tname: template.slug,\n\t\t\t\tblocks: parse( template.content.raw ),\n\t\t\t\ttitle: decodeEntities( template.title.rendered ),\n\t\t\t\tid: template.id,\n\t\t\t} ) ),\n\t\t[ availableTemplates ]\n\t);\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ templatesAsPatterns }\n\t\t\tonClickPattern={ onSelect }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,+BAA+B,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC9F,SAASC,QAAQ,EAAEC,KAAK,QAAQ,u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K,EAAG3B,EAAE,CAAE,mBAAoB,CAAG;MACnC4B,cAAc,EAAGA,CAAA,KAAMZ,YAAY,CAAE,KAAM,CAAG;MAC9Ca,gBAAgB,EAAC,2CAA2C;MAC5DC,YAAY;MAAAJ,QAAA,eAEZlB,IAAA;QAAKuB,SAAS,EAAC,mDAAmD;QAAAL,QAAA,eACjElB,IAAA,CAACwB,aAAa;UACbf,QAAQ,EAAGA,QAAU;UACrBgB,QAAQ,EAAGX;QAAkB,CAC7B;MAAC,CACE;IAAC,CACA,CACP;EAAA,CACA,CAAC;AAEL;AAEA,SAASU,aAAaA,CAAE;EAAEf,QAAQ;EAAEgB;AAAS,CAAC,EAAG;EAChD,MAAMd,kBAAkB,GAAGd,qBAAqB,CAAEY,QAAS,CAAC;EAC5D,MAAMiB,mBAAmB,GAAGzC,OAAO,CAClC,MACC0B,kBAAkB,CAACgB,GAAG,CAAIZ,QAAQ,KAAQ;IACzCC,IAAI,EAAED,QAAQ,CAACa,IAAI;IACnBC,MAAM,EAAEjC,KAAK,CAAEmB,QAAQ,CAACe,OAAO,CAACC,GAAI,CAAC;IACrCZ,KAAK,EAAEhC,cAAc,CAAE4B,QAAQ,CAACI,KAAK,CAACa,QAAS,CAAC;IAChDC,EAAE,EAAElB,QAAQ,CAACkB;EACd,CAAC,CAAG,CAAC,EACN,CAAEtB,kBAAkB,CACrB,CAAC;EACD,oBACCX,IAAA,CAACX,iBAAiB;IACjB6C,KAAK,EAAG1C,EAAE,CAAE,WAAY,CAAG;IAC3B2C,aAAa,EAAGT,mBAAqB;IACrCU,cAAc,EAAGX;EAAU,CAC3B,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useState","decodeEntities","__experimentalBlockPatternsList","BlockPatternsList","MenuItem","Modal","__","useDispatch","store","coreStore","parse","useAvailableTemplates","useEditedPostContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SwapTemplateButton","onClick","showModal","setShowModal","postType","postId","availableTemplates","editEntityRecord","onTemplateSelect","template","name","undoIgnore","children","disabled","length","accessibleWhenDisabled","title","onRequestClose","overlayClassName","isFullScreen","className","TemplatesList","onSelect","templatesAsPatterns","map","slug","blocks","content","raw","rendered","id","label","blockPatterns","onClickPattern"],"sources":["@wordpress/editor/src/components/post-template/swap-template-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { MenuItem, Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useAvailableTemplates, useEditedPostContext } from './hooks';\n\nexport default function SwapTemplateButton( { onClick } ) {\n\tconst [ showModal, setShowModal ] = useState( false );\n\tconst { postType, postId } = useEditedPostContext();\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst onTemplateSelect = async ( template ) => {\n\t\teditEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\t{ template: template.name },\n\t\t\t{ undoIgnore: true }\n\t\t);\n\t\tsetShowModal( false ); // Close the template suggestions modal first.\n\t\tonClick();\n\t};\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tdisabled={ ! availableTemplates?.length }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tonClick={ () => setShowModal( true ) }\n\t\t\t>\n\t\t\t\t{ __( 'Change template' ) }\n\t\t\t</MenuItem>\n\t\t\t{ showModal && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Choose a template' ) }\n\t\t\t\t\tonRequestClose={ () => setShowModal( false ) }\n\t\t\t\t\toverlayClassName=\"editor-post-template__swap-template-modal\"\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<div className=\"editor-post-template__swap-template-modal-content\">\n\t\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction TemplatesList( { postType, onSelect } ) {\n\tconst availableTemplates = useAvailableTemplates( postType );\n\tconst templatesAsPatterns = useMemo(\n\t\t() =>\n\t\t\tavailableTemplates.map( ( template ) => ( {\n\t\t\t\tname: template.slug,\n\t\t\t\tblocks: parse( template.content.raw ),\n\t\t\t\ttitle: decodeEntities( template.title.rendered ),\n\t\t\t\tid: template.id,\n\t\t\t} ) ),\n\t\t[ availableTemplates ]\n\t);\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ templatesAsPatterns }\n\t\t\tonClickPattern={ onSelect }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,+BAA+B,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC9F,SAASC,QAAQ,EAAEC,KAAK,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,SAASC,qBAAqB,EAAEC,oBAAoB,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtE,eAAe,SAASC,kBAAkBA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACzD,MAAM,CAAEC,SAAS,EA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AEkB;AAAS,CAAC,EAAG;EAChD,MAAMhB,kBAAkB,GAAGd,qBAAqB,CAAEY,QAAS,CAAC;EAC5D,MAAMmB,mBAAmB,GAAG3C,OAAO,CAClC,MACC0B,kBAAkB,CAACkB,GAAG,CAAIf,QAAQ,KAAQ;IACzCC,IAAI,EAAED,QAAQ,CAACgB,IAAI;IACnBC,MAAM,EAAEnC,KAAK,CAAEkB,QAAQ,CAACkB,OAAO,CAACC,GAAI,CAAC;IACrCZ,KAAK,EAAElC,cAAc,CAAE2B,QAAQ,CAACO,KAAK,CAACa,QAAS,CAAC;IAChDC,EAAE,EAAErB,QAAQ,CAACqB;EACd,CAAC,CAAG,CAAC,EACN,CAAExB,kBAAkB,CACrB,CAAC;EACD,oBACCX,IAAA,CAACX,iBAAiB;IACjB+C,KAAK,EAAG5C,EAAE,CAAE,WAAY,CAAG;IAC3B6C,aAAa,EAAGT,mBAAqB;IACrCU,cAAc,EAAGX;EAAU,CAC3B,CAAC;AAEJ","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useState } from '@wordpress/element';
6
- import { VisuallyHidden, __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
6
+ import { TextControl, RadioControl, __experimentalVStack as VStack } from '@wordpress/components';
7
7
  import { useInstanceId } from '@wordpress/compose';
8
8
  import { useSelect, useDispatch } from '@wordpress/data';
9
9
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
@@ -11,7 +11,7 @@ import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { visibilityOptions } from './utils';
14
+ import { VISIBILITY_OPTIONS } from './utils';
15
15
  import { store as editorStore } from '../../store';
16
16
 
17
17
  /**
@@ -36,43 +36,30 @@ export default function PostVisibility({
36
36
  password: select(editorStore).getEditedPostAttribute('password')
37
37
  }));
38
38
  const {
39
- editPost,
40
- savePost
39
+ editPost
41
40
  } = useDispatch(editorStore);
42
41
  const [hasPassword, setHasPassword] = useState(!!password);
43
- const [showPrivateConfirmDialog, setShowPrivateConfirmDialog] = useState(false);
44
- const setPublic = () => {
42
+ function updateVisibility(value) {
43
+ const nextValues = {
44
+ public: {
45
+ status: visibility === 'private' ? 'draft' : status,
46
+ password: ''
47
+ },
48
+ private: {
49
+ status: 'private',
50
+ password: ''
51
+ },
52
+ password: {
53
+ status: visibility === 'private' ? 'draft' : status,
54
+ password: password || ''
55
+ }
56
+ };
57
+ editPost(nextValues[value]);
58
+ setHasPassword(value === 'password');
59
+ }
60
+ const updatePassword = value => {
45
61
  editPost({
46
- status: visibility === 'private' ? 'draft' : status,
47
- password: ''
48
- });
49
- setHasPassword(false);
50
- };
51
- const setPrivate = () => {
52
- setShowPrivateConfirmDialog(true);
53
- };
54
- const confirmPrivate = () => {
55
- editPost({
56
- status: 'private',
57
- password: ''
58
- });
59
- setHasPassword(false);
60
- setShowPrivateConfirmDialog(false);
61
- savePost();
62
- };
63
- const handleDialogCancel = () => {
64
- setShowPrivateConfirmDialog(false);
65
- };
66
- const setPasswordProtected = () => {
67
- editPost({
68
- status: visibility === 'private' ? 'draft' : status,
69
- password: password || ''
70
- });
71
- setHasPassword(true);
72
- };
73
- const updatePassword = event => {
74
- editPost({
75
- password: event.target.value
62
+ password: value
76
63
  });
77
64
  };
78
65
  return /*#__PURE__*/_jsxs("div", {
@@ -81,82 +68,25 @@ export default function PostVisibility({
81
68
  title: __('Visibility'),
82
69
  help: __('Control how this post is viewed.'),
83
70
  onClose: onClose
84
- }), /*#__PURE__*/_jsxs("fieldset", {
85
- className: "editor-post-visibility__fieldset",
86
- children: [/*#__PURE__*/_jsx(VisuallyHidden, {
87
- as: "legend",
88
- children: __('Visibility')
89
- }), /*#__PURE__*/_jsx(PostVisibilityChoice, {
90
- instanceId: instanceId,
91
- value: "public",
92
- label: visibilityOptions.public.label,
93
- info: visibilityOptions.public.info,
94
- checked: visibility === 'public' && !hasPassword,
95
- onChange: setPublic
96
- }), /*#__PURE__*/_jsx(PostVisibilityChoice, {
97
- instanceId: instanceId,
98
- value: "private",
99
- label: visibilityOptions.private.label,
100
- info: visibilityOptions.private.info,
101
- checked: visibility === 'private',
102
- onChange: setPrivate
103
- }), /*#__PURE__*/_jsx(PostVisibilityChoice, {
104
- instanceId: instanceId,
105
- value: "password",
106
- label: visibilityOptions.password.label,
107
- info: visibilityOptions.password.info,
108
- checked: hasPassword,
109
- onChange: setPasswordProtected
110
- }), hasPassword && /*#__PURE__*/_jsxs("div", {
111
- className: "editor-post-visibility__password",
112
- children: [/*#__PURE__*/_jsx(VisuallyHidden, {
113
- as: "label",
114
- htmlFor: `editor-post-visibility__password-input-${instanceId}`,
115
- children: __('Create password')
116
- }), /*#__PURE__*/_jsx("input", {
117
- className: "editor-post-visibility__password-input",
118
- id: `editor-post-visibility__password-input-${instanceId}`,
119
- type: "text",
120
- onChange: updatePassword,
121
- value: password,
122
- placeholder: __('Use a secure password')
123
- })]
71
+ }), /*#__PURE__*/_jsxs(VStack, {
72
+ spacing: 4,
73
+ children: [/*#__PURE__*/_jsx(RadioControl, {
74
+ label: __('Visibility'),
75
+ hideLabelFromVision: true,
76
+ options: VISIBILITY_OPTIONS,
77
+ selected: hasPassword ? 'password' : visibility,
78
+ onChange: updateVisibility
79
+ }), hasPassword && /*#__PURE__*/_jsx(TextControl, {
80
+ label: __('Password'),
81
+ onChange: updatePassword,
82
+ value: password,
83
+ placeholder: __('Use a secure password'),
84
+ type: "text",
85
+ id: `editor-post-visibility__password-input-${instanceId}`,
86
+ __next40pxDefaultSize: true,
87
+ __nextHasNoMarginBottom: true,
88
+ maxLength: 255
124
89
  })]
125
- }), /*#__PURE__*/_jsx(ConfirmDialog, {
126
- isOpen: showPrivateConfirmDialog,
127
- onConfirm: confirmPrivate,
128
- onCancel: handleDialogCancel,
129
- confirmButtonText: __('Publish'),
130
- size: "medium",
131
- children: __('Would you like to privately publish this post now?')
132
- })]
133
- });
134
- }
135
- function PostVisibilityChoice({
136
- instanceId,
137
- value,
138
- label,
139
- info,
140
- ...props
141
- }) {
142
- return /*#__PURE__*/_jsxs("div", {
143
- className: "editor-post-visibility__choice",
144
- children: [/*#__PURE__*/_jsx("input", {
145
- type: "radio",
146
- name: `editor-post-visibility__setting-${instanceId}`,
147
- value: value,
148
- id: `editor-post-${value}-${instanceId}`,
149
- "aria-describedby": `editor-post-${value}-${instanceId}-description`,
150
- className: "editor-post-visibility__radio",
151
- ...props
152
- }), /*#__PURE__*/_jsx("label", {
153
- htmlFor: `editor-post-${value}-${instanceId}`,
154
- className: "editor-post-visibility__label",
155
- children: label
156
- }), /*#__PURE__*/_jsx("p", {
157
- id: `editor-post-${value}-${instanceId}-description`,
158
- className: "editor-post-visibility__info",
159
- children: info
160
90
  })]
161
91
  });
162
92
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","jsx","_jsx","jsxs","_jsxs","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","className","children","title","help","as","PostVisibilityChoice","label","public","info","checked","onChange","private","htmlFor","id","type","placeholder","isOpen","onConfirm","onCancel","confirmButtonText","size","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Allows users to set the visibility of a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose Function to call when the popover is closed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t\tconfirmButtonText={ __( 'Publish' ) }\n\t\t\t\tsize=\"medium\"\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,cAAc,EACdC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,aAAa,QA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C,eACXc,IAAA,CAACV,aAAa;MACbqD,MAAM,EAAG3B,wBAA0B;MACnC4B,SAAS,EAAGxB,cAAgB;MAC5ByB,QAAQ,EAAGxB,kBAAoB;MAC/ByB,iBAAiB,EAAG5D,EAAE,CAAE,SAAU,CAAG;MACrC6D,IAAI,EAAC,QAAQ;MAAAnB,QAAA,EAEX1C,EAAE,CAAE,oDAAqD;IAAC,CAC9C,CAAC;EAAA,CACZ,CAAC;AAER;AAEA,SAAS8C,oBAAoBA,CAAE;EAAE3B,UAAU;EAAEqB,KAAK;EAAEO,KAAK;EAAEE,IAAI;EAAE,GAAGa;AAAM,CAAC,EAAG;EAC7E,oBACC9C,KAAA;IAAKyB,SAAS,EAAC,gCAAgC;IAAAC,QAAA,gBAC9C5B,IAAA;MACCyC,IAAI,EAAC,OAAO;MACZQ,IAAI,EAAG,mCAAoC5C,UAAU,EAAK;MAC1DqB,KAAK,EAAGA,KAAO;MACfc,EAAE,EAAG,eAAgBd,KAAK,IAAMrB,UAAU,EAAK;MAC/C,oBAAmB,eAAgBqB,KAAK,IAAMrB,UAAU,cAAiB;MACzEsB,SAAS,EAAC,+BAA+B;MAAA,GACpCqB;IAAK,CACV,CAAC,eACFhD,IAAA;MACCuC,OAAO,EAAG,eAAgBb,KAAK,IAAMrB,UAAU,EAAK;MACpDsB,SAAS,EAAC,+BAA+B;MAAAC,QAAA,EAEvCK;IAAK,CACD,CAAC,eACRjC,IAAA;MACCwC,EAAE,EAAG,eAAgBd,KAAK,IAAMrB,UAAU,cAAiB;MAC3DsB,SAAS,EAAC,8BAA8B;MAAAC,QAAA,EAEtCO;IAAI,CACJ,CAAC;EAAA,CACA,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["__","useState","TextControl","RadioControl","__experimentalVStack","VStack","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","VISIBILITY_OPTIONS","store","editorStore","jsx","_jsx","jsxs","_jsxs","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","hasPassword","setHasPassword","updateVisibility","value","nextValues","public","private","updatePassword","className","children","title","help","spacing","label","hideLabelFromVision","options","selected","onChange","placeholder","type","id","__next40pxDefaultSize","__nextHasNoMarginBottom","maxLength"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tTextControl,\n\tRadioControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { VISIBILITY_OPTIONS } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Allows users to set the visibility of a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose Function to call when the popover is closed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\n\tfunction updateVisibility( value ) {\n\t\tconst nextValues = {\n\t\t\tpublic: {\n\t\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\t\tpassword: '',\n\t\t\t},\n\t\t\tprivate: { status: 'private', password: '' },\n\t\t\tpassword: {\n\t\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\t\tpassword: password || '',\n\t\t\t},\n\t\t};\n\n\t\teditPost( nextValues[ value ] );\n\t\tsetHasPassword( value === 'password' );\n\t}\n\n\tconst updatePassword = ( value ) => {\n\t\teditPost( { password: value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<RadioControl\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\toptions={ VISIBILITY_OPTIONS }\n\t\t\t\t\tselected={ hasPassword ? 'password' : visibility }\n\t\t\t\t\tonChange={ updateVisibility }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tmaxLength={ 255 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,WAAW,EACXC,YAAY,EACZC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,K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;EAEA,MAAMI,cAAc,GAAKJ,KAAK,IAAM;IACnCJ,QAAQ,CAAE;MAAEJ,QAAQ,EAAEQ;IAAM,CAAE,CAAC;EAChC,CAAC;EAED,oBACCd,KAAA;IAAKmB,SAAS,EAAC,wBAAwB;IAAAC,QAAA,gBACtCtB,IAAA,CAACL,sBAAsB;MACtB4B,KAAK,EAAGtC,EAAE,CAAE,YAAa,CAAG;MAC5BuC,IAAI,EAAGvC,EAAE,CAAE,kCAAmC,CAAG;MACjDmB,OAAO,EAAGA;IAAS,CACnB,CAAC,eACFF,KAAA,CAACZ,MAAM;MAACmC,OAAO,EAAG,CAAG;MAAAH,QAAA,gBACpBtB,IAAA,CAACZ,YAAY;QACZsC,KAAK,EAAGzC,EAAE,CAAE,YAAa,CAAG;QAC5B0C,mBAAmB;QACnBC,OAAO,EAAGhC,kBAAoB;QAC9BiC,QAAQ,EAAGhB,WAAW,GAAG,UAAU,GAAGN,UAAY;QAClDuB,QAAQ,EAAGf;MAAkB,CAC7B,CAAC,EACAF,WAAW,iBACZb,IAAA,CAACb,WAAW;QACXuC,KAAK,EAAGzC,EAAE,CAAE,UAAW,CAAG;QAC1B6C,QAAQ,EAAGV,cAAgB;QAC3BJ,KAAK,EAAGR,QAAU;QAClBuB,WAAW,EAAG9C,EAAE,CAAE,uBAAwB,CAAG;QAC7C+C,IAAI,EAAC,MAAM;QACXC,EAAE,EAAG,0CAA2C5B,UAAU,EAAK;QAC/D6B,qBAAqB;QACrBC,uBAAuB;QACvBC,SAAS,EAAG;MAAK,CACjB,CACD;IAAA,CACM,CAAC;EAAA,CACL,CAAC;AAER","ignoreList":[]}
@@ -6,7 +6,7 @@ import { useSelect } from '@wordpress/data';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { visibilityOptions } from './utils';
9
+ import { VISIBILITY_OPTIONS } from './utils';
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
12
  /**
@@ -24,7 +24,7 @@ export default function PostVisibilityLabel() {
24
24
  * @return {string} Post visibility label.
25
25
  */
26
26
  export function usePostVisibilityLabel() {
27
- const visibility = useSelect(select => select(editorStore).getEditedPostVisibility());
28
- return visibilityOptions[visibility]?.label;
27
+ const visibility = useSelect(select => select(editorStore).getEditedPostVisibility(), []);
28
+ return VISIBILITY_OPTIONS.find(option => option.value === visibility)?.label;
29
29
  }
30
30
  //# sourceMappingURL=label.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Returns the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\n/**\n * Get the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAM,IACrCA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAC/C,CAAC;EACD,OAAOP,iBAAiB,CAAEK,UAAU,CAAE,EAAEG,KAAK;AAC9C","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","VISIBILITY_OPTIONS","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","find","option","value","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { VISIBILITY_OPTIONS } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Returns the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\n/**\n * Get the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostVisibility(),\n\t\t[]\n\t);\n\n\treturn VISIBILITY_OPTIONS.find( ( option ) => option.value === visibility )\n\t\t?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CACzBO,MAAM,IAAMA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAAC,EAC7D,EACD,CAAC;EAED,OAAOP,kBAAkB,CAACQ,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACC,KAAK,KAAKL,UAAW,CAAC,EACxEM,KAAK;AACT","ignoreList":[]}
@@ -2,18 +2,17 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- export const visibilityOptions = {
6
- public: {
7
- label: __('Public'),
8
- info: __('Visible to everyone.')
9
- },
10
- private: {
11
- label: __('Private'),
12
- info: __('Only visible to site admins and editors.')
13
- },
14
- password: {
15
- label: __('Password protected'),
16
- info: __('Only those with the password can view this post.')
17
- }
18
- };
5
+ export const VISIBILITY_OPTIONS = [{
6
+ label: __('Public'),
7
+ value: 'public',
8
+ description: __('Visible to everyone.')
9
+ }, {
10
+ label: __('Private'),
11
+ value: 'private',
12
+ description: __('Only visible to site admins and editors.')
13
+ }, {
14
+ label: __('Password protected'),
15
+ value: 'password',
16
+ description: __('Only visible to those who know the password.')
17
+ }];
19
18
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","visibilityOptions","public","label","info","private","password"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,MAAM,EAAE;IACPC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBI,IAAI,EAAEJ,EAAE,CAAE,sBAAuB;EAClC,CAAC;EACDK,OAAO,EAAE;IACRF,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;IACtBI,IAAI,EAAEJ,EAAE,CAAE,0CAA2C;EACtD,CAAC;EACDM,QAAQ,EAAE;IACTH,KAAK,EAAEH,EAAE,CAAE,oBAAqB,CAAC;IACjCI,IAAI,EAAEJ,EAAE,CAAE,kDAAmD;EAC9D;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","VISIBILITY_OPTIONS","label","value","description"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const VISIBILITY_OPTIONS = [\n\t{\n\t\tlabel: __( 'Public' ),\n\t\tvalue: 'public',\n\t\tdescription: __( 'Visible to everyone.' ),\n\t},\n\t{\n\t\tlabel: __( 'Private' ),\n\t\tvalue: 'private',\n\t\tdescription: __( 'Only visible to site admins and editors.' ),\n\t},\n\t{\n\t\tlabel: __( 'Password protected' ),\n\t\tvalue: 'password',\n\t\tdescription: __( 'Only visible to those who know the password.' ),\n\t},\n];\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,kBAAkB,GAAG,CACjC;EACCC,KAAK,EAAEF,EAAE,CAAE,QAAS,CAAC;EACrBG,KAAK,EAAE,QAAQ;EACfC,WAAW,EAAEJ,EAAE,CAAE,sBAAuB;AACzC,CAAC,EACD;EACCE,KAAK,EAAEF,EAAE,CAAE,SAAU,CAAC;EACtBG,KAAK,EAAE,SAAS;EAChBC,WAAW,EAAEJ,EAAE,CAAE,0CAA2C;AAC7D,CAAC,EACD;EACCE,KAAK,EAAEF,EAAE,CAAE,oBAAqB,CAAC;EACjCG,KAAK,EAAE,UAAU;EACjBC,WAAW,EAAEJ,EAAE,CAAE,8CAA+C;AACjE,CAAC,CACD","ignoreList":[]}
@@ -158,6 +158,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
158
158
  const {
159
159
  getEntitiesConfig
160
160
  } = select(coreStore);
161
+ const _mode = getRenderingMode();
161
162
  const _defaultMode = getDefaultRenderingMode(post.type);
162
163
  /**
163
164
  * To avoid content "flash", wait until rendering mode has been resolved.
@@ -166,12 +167,14 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
166
167
  * - Wait for template to be resolved if the default mode is 'template-locked'.
167
168
  * - Wait for default mode to be resolved otherwise.
168
169
  */
169
- const hasResolvedMode = _defaultMode === 'template-locked' ? hasTemplate : _defaultMode !== undefined;
170
+ const hasResolvedDefaultMode = _defaultMode === 'template-locked' ? hasTemplate : _defaultMode !== undefined;
171
+ // Wait until the default mode is retrieved and start rendering canvas.
172
+ const isRenderingModeReady = _defaultMode !== undefined;
170
173
  return {
171
174
  editorSettings: getEditorSettings(),
172
- isReady: __unstableIsEditorReady() && hasResolvedMode,
173
- mode: getRenderingMode(),
174
- defaultMode: _defaultMode,
175
+ isReady: __unstableIsEditorReady(),
176
+ mode: isRenderingModeReady ? _mode : undefined,
177
+ defaultMode: hasResolvedDefaultMode ? _defaultMode : undefined,
175
178
  selection: getEditorSelection(),
176
179
  postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null
177
180
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getDefaultRenderingMode","getEntitiesConfig","_defaultMode","hasResolvedMode","undefined","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst _defaultMode = getDefaultRenderingMode( post.type );\n\t\t\t\t/**\n\t\t\t\t * To avoid content \"flash\", wait until rendering mode has been resolved.\n\t\t\t\t * This is important for the initial render of the editor.\n\t\t\t\t *\n\t\t\t\t * - Wait for template to be resolved if the default mode is 'template-locked'.\n\t\t\t\t * - Wait for default mode to be resolved otherwise.\n\t\t\t\t */\n\t\t\t\tconst hasResolvedMode =\n\t\t\t\t\t_defaultMode === 'template-locked'\n\t\t\t\t\t\t? hasTemplate\n\t\t\t\t\t\t: _defaultMode !== undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasResolvedMode,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode: _defaultMode,\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = hasTemplate && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tif ( defaultMode ) {\n\t\t\t\tsetRenderingMode( defaultMode );\n\t\t\t}\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,i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xB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsF,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACCpF,IAAA,CAAC2B,0BAA0B;IAAA,GACrByD,KAAK;IACVpD,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDqD,KAAK,CAACrD;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAeoD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getDefaultRenderingMode","getEntitiesConfig","_mode","_defaultMode","hasResolvedDefaultMode","undefined","isRenderingModeReady","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst _mode = getRenderingMode();\n\t\t\t\tconst _defaultMode = getDefaultRenderingMode( post.type );\n\t\t\t\t/**\n\t\t\t\t * To avoid content \"flash\", wait until rendering mode has been resolved.\n\t\t\t\t * This is important for the initial render of the editor.\n\t\t\t\t *\n\t\t\t\t * - Wait for template to be resolved if the default mode is 'template-locked'.\n\t\t\t\t * - Wait for default mode to be resolved otherwise.\n\t\t\t\t */\n\t\t\t\tconst hasResolvedDefaultMode =\n\t\t\t\t\t_defaultMode === 'template-locked'\n\t\t\t\t\t\t? hasTemplate\n\t\t\t\t\t\t: _defaultMode !== undefined;\n\t\t\t\t// Wait until the default mode is retrieved and start rendering canvas.\n\t\t\t\tconst isRenderingModeReady = _defaultMode !== undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: isRenderingModeReady ? _mode : undefined,\n\t\t\t\t\tdefaultMode: hasResolvedDefaultMode\n\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = hasTemplate && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tif ( defaultMode ) {\n\t\t\t\tsetRenderingMode( defaultMode );\n\t\t\t}\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB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