@wordpress/editor 12.4.0 → 12.5.2

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 (50) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/entities-saved-states/entity-type-list.js +11 -5
  3. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  4. package/build/components/post-excerpt/index.js +1 -1
  5. package/build/components/post-excerpt/index.js.map +1 -1
  6. package/build/components/provider/use-block-editor-settings.js +15 -2
  7. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  8. package/build/store/actions.js +27 -26
  9. package/build/store/actions.js.map +1 -1
  10. package/build/store/defaults.js +2 -8
  11. package/build/store/defaults.js.map +1 -1
  12. package/build/store/index.js +3 -8
  13. package/build/store/index.js.map +1 -1
  14. package/build/store/reducer.js +0 -30
  15. package/build/store/reducer.js.map +1 -1
  16. package/build/store/reducer.native.js +0 -1
  17. package/build/store/reducer.native.js.map +1 -1
  18. package/build/store/selectors.js +4 -11
  19. package/build/store/selectors.js.map +1 -1
  20. package/build-module/components/entities-saved-states/entity-type-list.js +12 -6
  21. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  22. package/build-module/components/post-excerpt/index.js +1 -1
  23. package/build-module/components/post-excerpt/index.js.map +1 -1
  24. package/build-module/components/provider/use-block-editor-settings.js +15 -2
  25. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  26. package/build-module/store/actions.js +21 -22
  27. package/build-module/store/actions.js.map +1 -1
  28. package/build-module/store/defaults.js +0 -5
  29. package/build-module/store/defaults.js.map +1 -1
  30. package/build-module/store/index.js +3 -8
  31. package/build-module/store/index.js.map +1 -1
  32. package/build-module/store/reducer.js +1 -29
  33. package/build-module/store/reducer.js.map +1 -1
  34. package/build-module/store/reducer.native.js +1 -2
  35. package/build-module/store/reducer.native.js.map +1 -1
  36. package/build-module/store/selectors.js +2 -10
  37. package/build-module/store/selectors.js.map +1 -1
  38. package/package.json +27 -26
  39. package/src/components/entities-saved-states/entity-type-list.js +15 -16
  40. package/src/components/post-excerpt/index.js +3 -1
  41. package/src/components/provider/use-block-editor-settings.js +22 -3
  42. package/src/store/actions.js +13 -16
  43. package/src/store/defaults.js +0 -5
  44. package/src/store/index.js +2 -8
  45. package/src/store/reducer.js +1 -28
  46. package/src/store/reducer.native.js +0 -2
  47. package/src/store/selectors.js +8 -9
  48. package/src/store/test/actions.js +37 -0
  49. package/src/store/test/reducer.js +0 -31
  50. package/src/store/test/selectors.js +0 -35
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 12.5.0 (2022-04-08)
6
+
5
7
  ## 12.4.0 (2022-03-23)
6
8
 
7
9
  ## 12.3.0 (2022-03-11)
@@ -32,13 +32,13 @@ var _entityRecordItem = _interopRequireDefault(require("./entity-record-item"));
32
32
  /**
33
33
  * Internal dependencies
34
34
  */
35
- function getEntityDescription(entity, length) {
35
+ function getEntityDescription(entity, count) {
36
36
  switch (entity) {
37
37
  case 'site':
38
- return (0, _i18n._n)('This change will affect your whole site.', 'These changes will affect your whole site.', length);
38
+ return 1 === count ? (0, _i18n.__)('This change will affect your whole site.') : (0, _i18n.__)('These changes will affect your whole site.');
39
39
 
40
40
  case 'wp_template':
41
- return (0, _i18n._n)('This change will affect pages and posts that use this template.', 'These changes will affect pages and posts that use these templates.', length);
41
+ return (0, _i18n.__)('This change will affect pages and posts that use this template.');
42
42
 
43
43
  case 'page':
44
44
  case 'post':
@@ -53,14 +53,20 @@ function EntityTypeList(_ref) {
53
53
  setUnselectedEntities,
54
54
  closePanel
55
55
  } = _ref;
56
+ const count = list.length;
56
57
  const firstRecord = list[0];
57
58
  const entityConfig = (0, _data.useSelect)(select => select(_coreData.store).getEntityConfig(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]);
58
59
  const {
59
60
  name
60
61
  } = firstRecord;
61
- const entityLabel = name === 'wp_template_part' ? (0, _i18n._n)('Template Part', 'Template Parts', list.length) : entityConfig.label; // Set description based on type of entity.
62
+ let entityLabel = entityConfig.label;
62
63
 
63
- const description = getEntityDescription(name, list.length);
64
+ if (name === 'wp_template_part') {
65
+ entityLabel = 1 === count ? (0, _i18n.__)('Template Part') : (0, _i18n.__)('Template Parts');
66
+ } // Set description based on type of entity.
67
+
68
+
69
+ const description = getEntityDescription(name, count);
64
70
  return (0, _element.createElement)(_components.PanelBody, {
65
71
  title: entityLabel,
66
72
  initialOpen: true
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","length","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","firstRecord","entityConfig","select","coreStore","getEntityConfig","kind","name","entityLabel","label","description","map","record","key","property","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,MAAvC,EAAgD;AAC/C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,cACN,0CADM,EAEN,4CAFM,EAGNC,MAHM,CAAP;;AAKD,SAAK,aAAL;AACC,aAAO,cACN,iEADM,EAEN,qEAFM,EAGNA,MAHM,CAAP;;AAKD,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO,cAAI,0CAAJ,CAAP;AAfF;AAiBA;;AAEc,SAASC,cAAT,OAKX;AAAA,MALoC;AACvCC,IAAAA,IADuC;AAEvCC,IAAAA,kBAFuC;AAGvCC,IAAAA,qBAHuC;AAIvCC,IAAAA;AAJuC,GAKpC;AACH,QAAMC,WAAW,GAAGJ,IAAI,CAAE,CAAF,CAAxB;AACA,QAAMK,YAAY,GAAG,qBAClBC,MAAF,IACCA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACCJ,WAAW,CAACK,IADb,EAECL,WAAW,CAACM,IAFb,CAFmB,EAMpB,CAAEN,WAAW,CAACK,IAAd,EAAoBL,WAAW,CAACM,IAAhC,CANoB,CAArB;AAQA,QAAM;AAAEA,IAAAA;AAAF,MAAWN,WAAjB;AACA,QAAMO,WAAW,GAChBD,IAAI,KAAK,kBAAT,GACG,cAAI,eAAJ,EAAqB,gBAArB,EAAuCV,IAAI,CAACF,MAA5C,CADH,GAEGO,YAAY,CAACO,KAHjB,CAXG,CAeH;;AACA,QAAMC,WAAW,GAAGjB,oBAAoB,CAAEc,IAAF,EAAQV,IAAI,CAACF,MAAb,CAAxC;AAEA,SACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAGa,WAAnB;AAAiC,IAAA,WAAW,EAAG;AAA/C,KACGE,WAAW,IAAI,4BAAC,oBAAD,QAAYA,WAAZ,CADlB,EAEGb,IAAI,CAACc,GAAL,CAAYC,MAAF,IAAc;AACzB,WACC,4BAAC,yBAAD;AACC,MAAA,GAAG,EAAGA,MAAM,CAACC,GAAP,IAAcD,MAAM,CAACE,QAD5B;AAEC,MAAA,MAAM,EAAGF,MAFV;AAGC,MAAA,OAAO,EACN,CAAE,kBACDd,kBADC,EAECiB,GAAF,IACCA,GAAG,CAACT,IAAJ,KAAaM,MAAM,CAACN,IAApB,IACAS,GAAG,CAACR,IAAJ,KAAaK,MAAM,CAACL,IADpB,IAEAQ,GAAG,CAACF,GAAJ,KAAYD,MAAM,CAACC,GAFnB,IAGAE,GAAG,CAACD,QAAJ,KAAiBF,MAAM,CAACE,QANxB,CAJJ;AAaC,MAAA,QAAQ,EAAKE,KAAF,IACVjB,qBAAqB,CAAEa,MAAF,EAAUI,KAAV,CAdvB;AAgBC,MAAA,UAAU,EAAGhB;AAhBd,MADD;AAoBA,GArBC,CAFH,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nfunction getEntityDescription( entity, length ) {\n\tswitch ( entity ) {\n\t\tcase 'site':\n\t\t\treturn _n(\n\t\t\t\t'This change will affect your whole site.',\n\t\t\t\t'These changes will affect your whole site.',\n\t\t\t\tlength\n\t\t\t);\n\t\tcase 'wp_template':\n\t\t\treturn _n(\n\t\t\t\t'This change will affect pages and posts that use this template.',\n\t\t\t\t'These changes will affect pages and posts that use these templates.',\n\t\t\t\tlength\n\t\t\t);\n\t\tcase 'page':\n\t\tcase 'post':\n\t\t\treturn __( 'The following content has been modified.' );\n\t}\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n\tclosePanel,\n} ) {\n\tconst firstRecord = list[ 0 ];\n\tconst entityConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityConfig(\n\t\t\t\tfirstRecord.kind,\n\t\t\t\tfirstRecord.name\n\t\t\t),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\tconst { name } = firstRecord;\n\tconst entityLabel =\n\t\tname === 'wp_template_part'\n\t\t\t? _n( 'Template Part', 'Template Parts', list.length )\n\t\t\t: entityConfig.label;\n\t// Set description based on type of entity.\n\tconst description = getEntityDescription( name, list.length );\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen={ true }>\n\t\t\t{ description && <PanelRow>{ description }</PanelRow> }\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! some(\n\t\t\t\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosePanel={ closePanel }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</PanelBody>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","count","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","length","firstRecord","entityConfig","select","coreStore","getEntityConfig","kind","name","entityLabel","label","description","map","record","key","property","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,KAAvC,EAA+C;AAC9C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,MAAMC,KAAN,GACJ,cAAI,0CAAJ,CADI,GAEJ,cAAI,4CAAJ,CAFH;;AAGD,SAAK,aAAL;AACC,aAAO,cACN,iEADM,CAAP;;AAGD,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO,cAAI,0CAAJ,CAAP;AAXF;AAaA;;AAEc,SAASC,cAAT,OAKX;AAAA,MALoC;AACvCC,IAAAA,IADuC;AAEvCC,IAAAA,kBAFuC;AAGvCC,IAAAA,qBAHuC;AAIvCC,IAAAA;AAJuC,GAKpC;AACH,QAAML,KAAK,GAAGE,IAAI,CAACI,MAAnB;AACA,QAAMC,WAAW,GAAGL,IAAI,CAAE,CAAF,CAAxB;AACA,QAAMM,YAAY,GAAG,qBAClBC,MAAF,IACCA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACCJ,WAAW,CAACK,IADb,EAECL,WAAW,CAACM,IAFb,CAFmB,EAMpB,CAAEN,WAAW,CAACK,IAAd,EAAoBL,WAAW,CAACM,IAAhC,CANoB,CAArB;AAQA,QAAM;AAAEA,IAAAA;AAAF,MAAWN,WAAjB;AAEA,MAAIO,WAAW,GAAGN,YAAY,CAACO,KAA/B;;AACA,MAAKF,IAAI,KAAK,kBAAd,EAAmC;AAClCC,IAAAA,WAAW,GACV,MAAMd,KAAN,GAAc,cAAI,eAAJ,CAAd,GAAsC,cAAI,gBAAJ,CADvC;AAEA,GAjBE,CAkBH;;;AACA,QAAMgB,WAAW,GAAGlB,oBAAoB,CAAEe,IAAF,EAAQb,KAAR,CAAxC;AAEA,SACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAGc,WAAnB;AAAiC,IAAA,WAAW,EAAG;AAA/C,KACGE,WAAW,IAAI,4BAAC,oBAAD,QAAYA,WAAZ,CADlB,EAEGd,IAAI,CAACe,GAAL,CAAYC,MAAF,IAAc;AACzB,WACC,4BAAC,yBAAD;AACC,MAAA,GAAG,EAAGA,MAAM,CAACC,GAAP,IAAcD,MAAM,CAACE,QAD5B;AAEC,MAAA,MAAM,EAAGF,MAFV;AAGC,MAAA,OAAO,EACN,CAAE,kBACDf,kBADC,EAECkB,GAAF,IACCA,GAAG,CAACT,IAAJ,KAAaM,MAAM,CAACN,IAApB,IACAS,GAAG,CAACR,IAAJ,KAAaK,MAAM,CAACL,IADpB,IAEAQ,GAAG,CAACF,GAAJ,KAAYD,MAAM,CAACC,GAFnB,IAGAE,GAAG,CAACD,QAAJ,KAAiBF,MAAM,CAACE,QANxB,CAJJ;AAaC,MAAA,QAAQ,EAAKE,KAAF,IACVlB,qBAAqB,CAAEc,MAAF,EAAUI,KAAV,CAdvB;AAgBC,MAAA,UAAU,EAAGjB;AAhBd,MADD;AAoBA,GArBC,CAFH,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nfunction getEntityDescription( entity, count ) {\n\tswitch ( entity ) {\n\t\tcase 'site':\n\t\t\treturn 1 === count\n\t\t\t\t? __( 'This change will affect your whole site.' )\n\t\t\t\t: __( 'These changes will affect your whole site.' );\n\t\tcase 'wp_template':\n\t\t\treturn __(\n\t\t\t\t'This change will affect pages and posts that use this template.'\n\t\t\t);\n\t\tcase 'page':\n\t\tcase 'post':\n\t\t\treturn __( 'The following content has been modified.' );\n\t}\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n\tclosePanel,\n} ) {\n\tconst count = list.length;\n\tconst firstRecord = list[ 0 ];\n\tconst entityConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityConfig(\n\t\t\t\tfirstRecord.kind,\n\t\t\t\tfirstRecord.name\n\t\t\t),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\tconst { name } = firstRecord;\n\n\tlet entityLabel = entityConfig.label;\n\tif ( name === 'wp_template_part' ) {\n\t\tentityLabel =\n\t\t\t1 === count ? __( 'Template Part' ) : __( 'Template Parts' );\n\t}\n\t// Set description based on type of entity.\n\tconst description = getEntityDescription( name, count );\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen={ true }>\n\t\t\t{ description && <PanelRow>{ description }</PanelRow> }\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! some(\n\t\t\t\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosePanel={ closePanel }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</PanelBody>\n\t);\n}\n"]}
@@ -37,7 +37,7 @@ function PostExcerpt(_ref) {
37
37
  onChange: value => onUpdateExcerpt(value),
38
38
  value: excerpt
39
39
  }), (0, _element.createElement)(_components.ExternalLink, {
40
- href: (0, _i18n.__)('https://wordpress.org/support/article/excerpt/')
40
+ href: (0, _i18n.__)('https://wordpress.org/support/article/settings-sidebar/#excerpt')
41
41
  }, (0, _i18n.__)('Learn more about manual excerpts')));
42
42
  }
43
43
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-excerpt/index.js"],"names":["PostExcerpt","excerpt","onUpdateExcerpt","value","select","editorStore","getEditedPostAttribute","dispatch","editPost"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,WAAT,OAAqD;AAAA,MAA/B;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA+B;AACpD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,2BAAD;AACC,IAAA,KAAK,EAAG,cAAI,6BAAJ,CADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,QAAQ,EAAKC,KAAF,IAAaD,eAAe,CAAEC,KAAF,CAHxC;AAIC,IAAA,KAAK,EAAGF;AAJT,IADD,EAOC,4BAAC,wBAAD;AACC,IAAA,IAAI,EAAG,cAAI,gDAAJ;AADR,KAGG,cAAI,kCAAJ,CAHH,CAPD,CADD;AAeA;;eAEc,sBAAS,CACvB,sBAAcG,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,OAAO,EAAEG,MAAM,CAAEC,YAAF,CAAN,CAAsBC,sBAAtB,CAA8C,SAA9C;AADH,GAAP;AAGA,CAJD,CADuB,EAMvB,wBAAgBC,QAAF,KAAkB;AAC/BL,EAAAA,eAAe,CAAED,OAAF,EAAY;AAC1BM,IAAAA,QAAQ,CAAEF,YAAF,CAAR,CAAwBG,QAAxB,CAAkC;AAAEP,MAAAA;AAAF,KAAlC;AACA;;AAH8B,CAAlB,CAAd,CANuB,CAAT,EAWVD,WAXU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink, TextareaControl } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostExcerpt( { excerpt, onUpdateExcerpt } ) {\n\treturn (\n\t\t<div className=\"editor-post-excerpt\">\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ __( 'Write an excerpt (optional)' ) }\n\t\t\t\tclassName=\"editor-post-excerpt__textarea\"\n\t\t\t\tonChange={ ( value ) => onUpdateExcerpt( value ) }\n\t\t\t\tvalue={ excerpt }\n\t\t\t/>\n\t\t\t<ExternalLink\n\t\t\t\thref={ __( 'https://wordpress.org/support/article/excerpt/' ) }\n\t\t\t>\n\t\t\t\t{ __( 'Learn more about manual excerpts' ) }\n\t\t\t</ExternalLink>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\texcerpt: select( editorStore ).getEditedPostAttribute( 'excerpt' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonUpdateExcerpt( excerpt ) {\n\t\t\tdispatch( editorStore ).editPost( { excerpt } );\n\t\t},\n\t} ) ),\n] )( PostExcerpt );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-excerpt/index.js"],"names":["PostExcerpt","excerpt","onUpdateExcerpt","value","select","editorStore","getEditedPostAttribute","dispatch","editPost"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,WAAT,OAAqD;AAAA,MAA/B;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA+B;AACpD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,2BAAD;AACC,IAAA,KAAK,EAAG,cAAI,6BAAJ,CADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,QAAQ,EAAKC,KAAF,IAAaD,eAAe,CAAEC,KAAF,CAHxC;AAIC,IAAA,KAAK,EAAGF;AAJT,IADD,EAOC,4BAAC,wBAAD;AACC,IAAA,IAAI,EAAG,cACN,iEADM;AADR,KAKG,cAAI,kCAAJ,CALH,CAPD,CADD;AAiBA;;eAEc,sBAAS,CACvB,sBAAcG,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,OAAO,EAAEG,MAAM,CAAEC,YAAF,CAAN,CAAsBC,sBAAtB,CAA8C,SAA9C;AADH,GAAP;AAGA,CAJD,CADuB,EAMvB,wBAAgBC,QAAF,KAAkB;AAC/BL,EAAAA,eAAe,CAAED,OAAF,EAAY;AAC1BM,IAAAA,QAAQ,CAAEF,YAAF,CAAR,CAAwBG,QAAxB,CAAkC;AAAEP,MAAAA;AAAF,KAAlC;AACA;;AAH8B,CAAlB,CAAd,CANuB,CAAT,EAWVD,WAXU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink, TextareaControl } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostExcerpt( { excerpt, onUpdateExcerpt } ) {\n\treturn (\n\t\t<div className=\"editor-post-excerpt\">\n\t\t\t<TextareaControl\n\t\t\t\tlabel={ __( 'Write an excerpt (optional)' ) }\n\t\t\t\tclassName=\"editor-post-excerpt__textarea\"\n\t\t\t\tonChange={ ( value ) => onUpdateExcerpt( value ) }\n\t\t\t\tvalue={ excerpt }\n\t\t\t/>\n\t\t\t<ExternalLink\n\t\t\t\thref={ __(\n\t\t\t\t\t'https://wordpress.org/support/article/settings-sidebar/#excerpt'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ __( 'Learn more about manual excerpts' ) }\n\t\t\t</ExternalLink>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\texcerpt: select( editorStore ).getEditedPostAttribute( 'excerpt' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonUpdateExcerpt( excerpt ) {\n\t\t\tdispatch( editorStore ).editPost( { excerpt } );\n\t\t},\n\t} ) ),\n] )( PostExcerpt );\n"]}
@@ -67,6 +67,17 @@ function useBlockEditorSettings(settings, hasTemplate) {
67
67
  pageOnFront: siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.page_on_front
68
68
  };
69
69
  }, []);
70
+ const {
71
+ __experimentalBlockPatterns: settingsBlockPatterns,
72
+ __experimentalBlockPatternCategories: settingsBlockPatternCategories
73
+ } = settings;
74
+ const {
75
+ blockPatterns,
76
+ blockPatternCategories
77
+ } = (0, _data.useSelect)(select => ({
78
+ blockPatterns: settingsBlockPatterns !== null && settingsBlockPatterns !== void 0 ? settingsBlockPatterns : select(_coreData.store).getBlockPatterns(),
79
+ blockPatternCategories: settingsBlockPatternCategories !== null && settingsBlockPatternCategories !== void 0 ? settingsBlockPatternCategories : select(_coreData.store).getBlockPatternCategories()
80
+ }), [settingsBlockPatterns, settingsBlockPatternCategories]);
70
81
  const {
71
82
  undo
72
83
  } = (0, _data.useDispatch)(_store.store);
@@ -91,9 +102,11 @@ function useBlockEditorSettings(settings, hasTemplate) {
91
102
  return saveEntityRecord('postType', 'page', options);
92
103
  };
93
104
 
94
- return (0, _element.useMemo)(() => ({ ...(0, _lodash.pick)(settings, ['__experimentalBlockDirectory', '__experimentalBlockPatternCategories', '__experimentalBlockPatterns', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__experimentalGenerateAnchors', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'bodyPlaceholder', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomGradients', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'focusMode', 'fontSizes', 'gradients', 'hasFixedToolbar', 'hasReducedUI', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'maxWidth', 'onUpdateDefaultBlockStyles', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableResolvedAssets']),
105
+ return (0, _element.useMemo)(() => ({ ...(0, _lodash.pick)(settings, ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'bodyPlaceholder', 'canLockBlocks', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomGradients', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'focusMode', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'hasReducedUI', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'maxWidth', 'onUpdateDefaultBlockStyles', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableResolvedAssets']),
95
106
  mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
96
107
  __experimentalReusableBlocks: reusableBlocks,
108
+ __experimentalBlockPatterns: blockPatterns,
109
+ __experimentalBlockPatternCategories: blockPatternCategories,
97
110
  __experimentalFetchLinkSuggestions: (search, searchOptions) => (0, _coreData.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
98
111
  __experimentalFetchRichUrlData: _coreData.__experimentalFetchUrlData,
99
112
  __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
@@ -103,7 +116,7 @@ function useBlockEditorSettings(settings, hasTemplate) {
103
116
  __experimentalUserCanCreatePages: userCanCreatePages,
104
117
  pageOnFront,
105
118
  __experimentalPreferPatternsOnRoot: hasTemplate
106
- }), [settings, hasUploadPermissions, reusableBlocks, canUseUnfilteredHTML, undo, hasTemplate, userCanCreatePages, pageOnFront]);
119
+ }), [settings, hasUploadPermissions, reusableBlocks, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, hasTemplate, userCanCreatePages, pageOnFront]);
107
120
  }
108
121
 
109
122
  var _default = useBlockEditorSettings;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","select","canUserUseUnfilteredHTML","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","siteSettings","getEntityRecords","per_page","page_on_front","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","mediaUpload","undefined","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;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,oCA/CzB;AAgDPC,IAAAA,sCAAsC,EAAE/B,oBAhDjC;AAiDPgC,IAAAA,kBAAkB,EAAEhB,IAjDb;AAkDPiB,IAAAA,WAAW,EAAEpC,WAlDN;AAmDPqC,IAAAA,8BAA8B,EAAEhB,gBAnDzB;AAoDPiB,IAAAA,gCAAgC,EAAElC,kBApD3B;AAqDPC,IAAAA,WArDO;AAsDPkC,IAAAA,kCAAkC,EAAEvC;AAtD7B,GAAR,CADM,EAyDN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAICE,oBAJD,EAKCgB,IALD,EAMCnB,WAND,EAOCI,kBAPD,EAQCC,WARD,CAzDM,CAAP;AAoEA;;eAEcP,sB","sourcesContent":["/**\n * External dependencies\n */\nimport { pick, defaultTo } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML } = select( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: [], // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: defaultTo(\n\t\t\t\tcanUser( 'create', 'media' ),\n\t\t\t\ttrue\n\t\t\t),\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t};\n\t}, [] );\n\n\tconst { undo } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...pick( settings, [\n\t\t\t\t'__experimentalBlockDirectory',\n\t\t\t\t'__experimentalBlockPatternCategories',\n\t\t\t\t'__experimentalBlockPatterns',\n\t\t\t\t'__experimentalDiscussionSettings',\n\t\t\t\t'__experimentalFeatures',\n\t\t\t\t'__experimentalPreferredStyleVariations',\n\t\t\t\t'__experimentalSetIsInserterOpened',\n\t\t\t\t'__experimentalGenerateAnchors',\n\t\t\t\t'__unstableGalleryWithImageBlocks',\n\t\t\t\t'alignWide',\n\t\t\t\t'allowedBlockTypes',\n\t\t\t\t'bodyPlaceholder',\n\t\t\t\t'codeEditingEnabled',\n\t\t\t\t'colors',\n\t\t\t\t'disableCustomColors',\n\t\t\t\t'disableCustomFontSizes',\n\t\t\t\t'disableCustomGradients',\n\t\t\t\t'enableCustomLineHeight',\n\t\t\t\t'enableCustomSpacing',\n\t\t\t\t'enableCustomUnits',\n\t\t\t\t'focusMode',\n\t\t\t\t'fontSizes',\n\t\t\t\t'gradients',\n\t\t\t\t'hasFixedToolbar',\n\t\t\t\t'hasReducedUI',\n\t\t\t\t'imageDefaultSize',\n\t\t\t\t'imageDimensions',\n\t\t\t\t'imageEditing',\n\t\t\t\t'imageSizes',\n\t\t\t\t'isRTL',\n\t\t\t\t'keepCaretInsideBlock',\n\t\t\t\t'maxWidth',\n\t\t\t\t'onUpdateDefaultBlockStyles',\n\t\t\t\t'styles',\n\t\t\t\t'template',\n\t\t\t\t'templateLock',\n\t\t\t\t'titlePlaceholder',\n\t\t\t\t'supportsLayout',\n\t\t\t\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t\t\t\t'__unstableResolvedAssets',\n\t\t\t] ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","select","canUserUseUnfilteredHTML","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","siteSettings","getEntityRecords","per_page","page_on_front","__experimentalBlockPatterns","settingsBlockPatterns","__experimentalBlockPatternCategories","settingsBlockPatternCategories","blockPatterns","blockPatternCategories","getBlockPatterns","getBlockPatternCategories","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","mediaUpload","undefined","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAT,CAAiCC,QAAjC,EAA2CC,WAA3C,EAAyD;AACxD,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,kBAJK;AAKLC,IAAAA;AALK,MAMF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA;AAAF,QAA+BD,MAAM,CAAEE,YAAF,CAA3C;AACA,UAAMC,KAAK,GAAGC,kBAASC,EAAT,KAAgB,KAA9B;AACA,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,QAA+BP,MAAM,CAAEQ,eAAF,CAA3C;AAEA,UAAMC,YAAY,GAAGF,eAAe,CAAE,MAAF,EAAU,MAAV,CAApC;AAEA,WAAO;AACNV,MAAAA,oBAAoB,EAA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AjDjC;AAkDPwC,IAAAA,kBAAkB,EAAEhB,IAlDb;AAmDPiB,IAAAA,WAAW,EAAE5C,WAnDN;AAoDP6C,IAAAA,8BAA8B,EAAEhB,gBApDzB;AAqDPiB,IAAAA,gCAAgC,EAAE1C,kBArD3B;AAsDPC,IAAAA,WAtDO;AAuDP0C,IAAAA,kCAAkC,EAAE/C;AAvD7B,GAAR,CADM,EA0DN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAICsB,aAJD,EAKCC,sBALD,EAMCrB,oBAND,EAOCwB,IAPD,EAQC3B,WARD,EASCI,kBATD,EAUCC,WAVD,CA1DM,CAAP;AAuEA;;eAEcP,sB","sourcesContent":["/**\n * External dependencies\n */\nimport { pick, defaultTo } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML } = select( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: [], // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: defaultTo(\n\t\t\t\tcanUser( 'create', 'media' ),\n\t\t\t\ttrue\n\t\t\t),\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\t__experimentalBlockPatterns: settingsBlockPatterns,\n\t\t__experimentalBlockPatternCategories: settingsBlockPatternCategories,\n\t} = settings;\n\n\tconst { blockPatterns, blockPatternCategories } = useSelect(\n\t\t( select ) => ( {\n\t\t\tblockPatterns:\n\t\t\t\tsettingsBlockPatterns ?? select( coreStore ).getBlockPatterns(),\n\t\t\tblockPatternCategories:\n\t\t\t\tsettingsBlockPatternCategories ??\n\t\t\t\tselect( coreStore ).getBlockPatternCategories(),\n\t\t} ),\n\t\t[ settingsBlockPatterns, settingsBlockPatternCategories ]\n\t);\n\n\tconst { undo } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...pick( settings, [\n\t\t\t\t'__experimentalBlockDirectory',\n\t\t\t\t'__experimentalDiscussionSettings',\n\t\t\t\t'__experimentalFeatures',\n\t\t\t\t'__experimentalPreferredStyleVariations',\n\t\t\t\t'__experimentalSetIsInserterOpened',\n\t\t\t\t'__unstableGalleryWithImageBlocks',\n\t\t\t\t'alignWide',\n\t\t\t\t'allowedBlockTypes',\n\t\t\t\t'bodyPlaceholder',\n\t\t\t\t'canLockBlocks',\n\t\t\t\t'codeEditingEnabled',\n\t\t\t\t'colors',\n\t\t\t\t'disableCustomColors',\n\t\t\t\t'disableCustomFontSizes',\n\t\t\t\t'disableCustomGradients',\n\t\t\t\t'enableCustomLineHeight',\n\t\t\t\t'enableCustomSpacing',\n\t\t\t\t'enableCustomUnits',\n\t\t\t\t'focusMode',\n\t\t\t\t'fontSizes',\n\t\t\t\t'gradients',\n\t\t\t\t'generateAnchors',\n\t\t\t\t'hasFixedToolbar',\n\t\t\t\t'hasReducedUI',\n\t\t\t\t'imageDefaultSize',\n\t\t\t\t'imageDimensions',\n\t\t\t\t'imageEditing',\n\t\t\t\t'imageSizes',\n\t\t\t\t'isRTL',\n\t\t\t\t'keepCaretInsideBlock',\n\t\t\t\t'maxWidth',\n\t\t\t\t'onUpdateDefaultBlockStyles',\n\t\t\t\t'styles',\n\t\t\t\t'template',\n\t\t\t\t'templateLock',\n\t\t\t\t'titlePlaceholder',\n\t\t\t\t'supportsLayout',\n\t\t\t\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t\t\t\t'__unstableResolvedAssets',\n\t\t\t] ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
@@ -8,10 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.__experimentalTearDownEditor = __experimentalTearDownEditor;
9
9
  exports.clearSelectedBlock = exports.autosave = void 0;
10
10
  exports.createUndoLevel = createUndoLevel;
11
- exports.disablePublishSidebar = disablePublishSidebar;
12
- exports.editPost = void 0;
13
- exports.enablePublishSidebar = enablePublishSidebar;
14
- exports.insertDefaultBlock = exports.insertBlocks = exports.insertBlock = exports.hideInsertionPoint = exports.exitFormattedText = exports.enterFormattedText = void 0;
11
+ exports.insertDefaultBlock = exports.insertBlocks = exports.insertBlock = exports.hideInsertionPoint = exports.exitFormattedText = exports.enterFormattedText = exports.enablePublishSidebar = exports.editPost = exports.disablePublishSidebar = void 0;
15
12
  exports.lockPostAutosaving = lockPostAutosaving;
16
13
  exports.lockPostSaving = lockPostSaving;
17
14
  exports.redo = exports.receiveBlocks = exports.multiSelect = exports.moveBlocksUp = exports.moveBlocksDown = exports.moveBlockToPosition = exports.mergeBlocks = void 0;
@@ -42,6 +39,8 @@ var _coreData = require("@wordpress/core-data");
42
39
 
43
40
  var _blockEditor = require("@wordpress/block-editor");
44
41
 
42
+ var _preferences = require("@wordpress/preferences");
43
+
45
44
  var _constants = require("./constants");
46
45
 
47
46
  var _localAutosave = require("./local-autosave");
@@ -416,29 +415,29 @@ function updatePostLock(lock) {
416
415
  };
417
416
  }
418
417
  /**
419
- * Action that enables the publish sidebar.
420
- *
421
- * @return {Object} Action object
418
+ * Enable the publish sidebar.
422
419
  */
423
420
 
424
421
 
425
- function enablePublishSidebar() {
426
- return {
427
- type: 'ENABLE_PUBLISH_SIDEBAR'
428
- };
429
- }
422
+ const enablePublishSidebar = () => _ref9 => {
423
+ let {
424
+ registry
425
+ } = _ref9;
426
+ registry.dispatch(_preferences.store).set('core/edit-post', 'isPublishSidebarEnabled', true);
427
+ };
430
428
  /**
431
- * Action that disables the publish sidebar.
432
- *
433
- * @return {Object} Action object
429
+ * Disables the publish sidebar.
434
430
  */
435
431
 
436
432
 
437
- function disablePublishSidebar() {
438
- return {
439
- type: 'DISABLE_PUBLISH_SIDEBAR'
440
- };
441
- }
433
+ exports.enablePublishSidebar = enablePublishSidebar;
434
+
435
+ const disablePublishSidebar = () => _ref10 => {
436
+ let {
437
+ registry
438
+ } = _ref10;
439
+ registry.dispatch(_preferences.store).set('core/edit-post', 'isPublishSidebarEnabled', false);
440
+ };
442
441
  /**
443
442
  * Action that locks post saving.
444
443
  *
@@ -484,6 +483,8 @@ function disablePublishSidebar() {
484
483
  */
485
484
 
486
485
 
486
+ exports.disablePublishSidebar = disablePublishSidebar;
487
+
487
488
  function lockPostSaving(lockName) {
488
489
  return {
489
490
  type: 'LOCK_POST_SAVING',
@@ -563,12 +564,12 @@ function unlockPostAutosaving(lockName) {
563
564
 
564
565
  const resetEditorBlocks = function (blocks) {
565
566
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
566
- return _ref9 => {
567
+ return _ref11 => {
567
568
  let {
568
569
  select,
569
570
  dispatch,
570
571
  registry
571
- } = _ref9;
572
+ } = _ref11;
572
573
  const {
573
574
  __unstableShouldCreateUndoLevel,
574
575
  selection
@@ -594,10 +595,10 @@ const resetEditorBlocks = function (blocks) {
594
595
  // a new undo level.
595
596
 
596
597
 
597
- edits.content = _ref10 => {
598
+ edits.content = _ref12 => {
598
599
  let {
599
600
  blocks: blocksForSerialization = []
600
- } = _ref10;
601
+ } = _ref12;
601
602
  return (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization);
602
603
  };
603
604
  }
@@ -632,10 +633,10 @@ const getBlockEditorAction = name => function () {
632
633
  args[_key] = arguments[_key];
633
634
  }
634
635
 
635
- return _ref11 => {
636
+ return _ref13 => {
636
637
  let {
637
638
  registry
638
- } = _ref11;
639
+ } = _ref13;
639
640
  (0, _deprecated.default)("`wp.data.dispatch( 'core/editor' )." + name + '`', {
640
641
  since: '5.3',
641
642
  alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","coreStore","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","noticesStore","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","blockEditorStore","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","TRASH_POST_NOTICE_ID","path","rest_base","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,CAAEC,IAAF,EAAQC,KAAR,EAAeC,QAAf,KAA6B,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC3EA,EAAAA,QAAQ,CAACC,gBAAT,CAA2BJ,IAA3B,EAD2E,CAE3E;;AACA,QAAMK,SAAS,GAAGL,IAAI,CAACM,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIH,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIK,OAAJ;;AACA,QAAK,iBAAKN,KAAL,EAAY,CAAE,SAAF,CAAZ,CAAL,EAAmC;AAClCM,MAAAA,OAAO,GAAGN,KAAK,CAACM,OAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,OAAO,GAAGP,IAAI,CAACO,OAAL,CAAaC,GAAvB;AACA;;AACD,QAAIC,MAAM,GAAG,mBAAOF,OAAP,CAAb;AACAE,IAAAA,MAAM,GAAG,2CAA+BA,MAA/B,EAAuCP,QAAvC,CAAT;AACAC,IAAAA,QAAQ,CAACO,iBAAT,CAA4BD,MAA5B,EAAoC;AACnCE,MAAAA,+BAA+B,EAAE;AADE,KAApC;AAGA;;AACD,MACCV,KAAK,IACLW,MAAM,CAACC,MAAP,CAAeZ,KAAf,EAAuBa,IAAvB,CACC;AAAA;;AA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C;AACtC,SAAO;AACNvD,IAAAA,IAAI,EAAE,kBADA;AAENuD,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASC,oBAAT,GAAgC;AACtC,SAAO;AACNxD,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASyD,qBAAT,GAAiC;AACvC,SAAO;AACNzD,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS0D,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN3D,IAAAA,IAAI,EAAE,kBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN3D,IAAAA,IAAI,EAAE,oBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN3D,IAAAA,IAAI,EAAE,sBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BH,QAA/B,EAA0C;AAChD,SAAO;AACN3D,IAAAA,IAAI,EAAE,wBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMpE,iBAAiB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oB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor = ( post, edits, template ) => ( { dispatch } ) => {\n\tdispatch.setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.values( edits ).some(\n\t\t\t( [ key, edit ] ) => edit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t)\n\t) {\n\t\tdispatch.editPost( edits );\n\t}\n};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost = ( edits, options ) => ( { select, registry } ) => {\n\tconst { id, type } = select.getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', type, id, edits, options );\n};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost = ( options = {} ) => async ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tif ( ! select.isEditedPostSaveable() ) {\n\t\treturn;\n\t}\n\n\tconst content = select.getEditedPostContent();\n\n\tif ( ! options.isAutosave ) {\n\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t}\n\n\tconst previousRecord = select.getCurrentPost();\n\tconst edits = {\n\t\tid: previousRecord.id,\n\t\t...registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t),\n\t\tcontent,\n\t};\n\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\tawait registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', previousRecord.type, edits, options );\n\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\tconst error = registry\n\t\t.select( coreStore )\n\t\t.getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t}\n\t} else {\n\t\tconst updatedRecord = select.getCurrentPost();\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice( ...args );\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t}\n\t}\n};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost = () => async ( { select, dispatch, registry } ) => {\n\tconst postTypeSlug = select.getCurrentPostType();\n\tconst postType = await registry\n\t\t.resolveSelect( coreStore )\n\t\t.getPostType( postTypeSlug );\n\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\ttry {\n\t\tconst post = select.getCurrentPost();\n\t\tawait apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tawait dispatch.savePost();\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice(\n\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t);\n\t}\n};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave = ( { local = false, ...options } = {} ) => async ( {\n\tselect,\n\tdispatch,\n} ) => {\n\tif ( local ) {\n\t\tconst post = select.getCurrentPost();\n\t\tconst isPostNew = select.isEditedPostNew();\n\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t} else {\n\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t}\n};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).redo();\n};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).undo();\n};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Action that enables the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Action that disables the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks = ( blocks, options = {} ) => ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tconst noChange =\n\t\t\tregistry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\tedits.blocks;\n\t\tif ( noChange ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\treturn;\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\n\tdispatch.editPost( edits );\n};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction = ( name ) => ( ...args ) => ( { registry } ) => {\n\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\tsince: '5.3',\n\t\talternative: \"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\tversion: '6.2',\n\t} );\n\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","coreStore","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","noticesStore","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","blockEditorStore","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","TRASH_POST_NOTICE_ID","path","rest_base","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","preferencesStore","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,CAAEC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AEEC,GAFF,CAEO,gBAFP,EAEyB,yBAFzB,EAEoD,KAFpD;AAGA,CAJM;AAMP;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASE,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN7D,IAAAA,IAAI,EAAE,kBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN7D,IAAAA,IAAI,EAAE,oBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN7D,IAAAA,IAAI,EAAE,sBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BH,QAA/B,EAA0C;AAChD,SAAO;AACN7D,IAAAA,IAAI,EAAE,wBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMtE,iBAAiB,GAAG,UAAED,MAAF;AAAA,MAAUgB,OAAV,uEAAoB,EAApB;AAAA,SAA4B,UAItD;AAAA,QAJwD;AAC9DC,MAAAA,MAD8D;AAE9DvB,MAAAA,QAF8D;AAG9DwB,MAAAA;AAH8D,KAIxD;AACN,UAAM;AAAEhB,MAAAA,+BAAF;AAAmCyE,MAAAA;AAAnC,QAA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,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor = ( post, edits, template ) => ( { dispatch } ) => {\n\tdispatch.setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.values( edits ).some(\n\t\t\t( [ key, edit ] ) => edit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t)\n\t) {\n\t\tdispatch.editPost( edits );\n\t}\n};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost = ( edits, options ) => ( { select, registry } ) => {\n\tconst { id, type } = select.getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', type, id, edits, options );\n};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost = ( options = {} ) => async ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tif ( ! select.isEditedPostSaveable() ) {\n\t\treturn;\n\t}\n\n\tconst content = select.getEditedPostContent();\n\n\tif ( ! options.isAutosave ) {\n\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t}\n\n\tconst previousRecord = select.getCurrentPost();\n\tconst edits = {\n\t\tid: previousRecord.id,\n\t\t...registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t),\n\t\tcontent,\n\t};\n\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\tawait registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', previousRecord.type, edits, options );\n\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\tconst error = registry\n\t\t.select( coreStore )\n\t\t.getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t}\n\t} else {\n\t\tconst updatedRecord = select.getCurrentPost();\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice( ...args );\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t}\n\t}\n};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost = () => async ( { select, dispatch, registry } ) => {\n\tconst postTypeSlug = select.getCurrentPostType();\n\tconst postType = await registry\n\t\t.resolveSelect( coreStore )\n\t\t.getPostType( postTypeSlug );\n\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\ttry {\n\t\tconst post = select.getCurrentPost();\n\t\tawait apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tawait dispatch.savePost();\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice(\n\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t);\n\t}\n};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave = ( { local = false, ...options } = {} ) => async ( {\n\tselect,\n\tdispatch,\n} ) => {\n\tif ( local ) {\n\t\tconst post = select.getCurrentPost();\n\t\tconst isPostNew = select.isEditedPostNew();\n\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t} else {\n\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t}\n};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).redo();\n};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).undo();\n};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Enable the publish sidebar.\n */\nexport const enablePublishSidebar = () => ( { registry } ) => {\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar = () => ( { registry } ) => {\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n};\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks = ( blocks, options = {} ) => ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tconst noChange =\n\t\t\tregistry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\tedits.blocks;\n\t\tif ( noChange ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\treturn;\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\n\tdispatch.editPost( edits );\n};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction = ( name ) => ( ...args ) => ( { registry } ) => {\n\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\tsince: '5.3',\n\t\talternative: \"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\tversion: '6.2',\n\t} );\n\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
@@ -3,18 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PREFERENCES_DEFAULTS = exports.EDITOR_SETTINGS_DEFAULTS = void 0;
6
+ exports.EDITOR_SETTINGS_DEFAULTS = void 0;
7
7
 
8
8
  var _blockEditor = require("@wordpress/block-editor");
9
9
 
10
10
  /**
11
11
  * WordPress dependencies
12
12
  */
13
- const PREFERENCES_DEFAULTS = {
14
- insertUsage: {},
15
- // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580.
16
- isPublishSidebarEnabled: true
17
- };
13
+
18
14
  /**
19
15
  * The default post editor settings.
20
16
  *
@@ -33,8 +29,6 @@ const PREFERENCES_DEFAULTS = {
33
29
  * @property {number} maxUploadFileSize Maximum upload file size
34
30
  * @property {boolean} supportsLayout Whether the editor supports layouts.
35
31
  */
36
-
37
- exports.PREFERENCES_DEFAULTS = PREFERENCES_DEFAULTS;
38
32
  const EDITOR_SETTINGS_DEFAULTS = { ..._blockEditor.SETTINGS_DEFAULTS,
39
33
  richEditingEnabled: true,
40
34
  codeEditingEnabled: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/defaults.js"],"names":["PREFERENCES_DEFAULTS","insertUsage","isPublishSidebarEnabled","EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","supportsLayout"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,oBAAoB,GAAG;AACnCC,EAAAA,WAAW,EAAE,EADsB;AAClB;AACjBC,EAAAA,uBAAuB,EAAE;AAFU,CAA7B;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,wBAAwB,GAAG,EACvC,GAAGC,8BADoC;AAGvCC,EAAAA,kBAAkB,EAAE,IAHmB;AAIvCC,EAAAA,kBAAkB,EAAE,IAJmB;AAKvCC,EAAAA,kBAAkB,EAAEC,SALmB;AAMvCC,EAAAA,cAAc,EAAE;AANuB,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\nexport const PREFERENCES_DEFAULTS = {\n\tinsertUsage: {}, // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580.\n\tisPublishSidebarEnabled: true,\n};\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n\tsupportsLayout: true,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/defaults.js"],"names":["EDITOR_SETTINGS_DEFAULTS","SETTINGS_DEFAULTS","richEditingEnabled","codeEditingEnabled","enableCustomFields","undefined","supportsLayout"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,wBAAwB,GAAG,EACvC,GAAGC,8BADoC;AAGvCC,EAAAA,kBAAkB,EAAE,IAHmB;AAIvCC,EAAAA,kBAAkB,EAAE,IAJmB;AAKvCC,EAAAA,kBAAkB,EAAEC,SALmB;AAMvCC,EAAAA,cAAc,EAAE;AANuB,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SETTINGS_DEFAULTS } from '@wordpress/block-editor';\n\n/**\n * The default post editor settings.\n *\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} richEditingEnabled Whether rich editing is enabled or not\n * @property {boolean} codeEditingEnabled Whether code editing is enabled or not\n * @property {boolean} enableCustomFields Whether the WordPress custom fields are enabled or not.\n * true = the user has opted to show the Custom Fields panel at the bottom of the editor.\n * false = the user has opted to hide the Custom Fields panel at the bottom of the editor.\n * undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.\n * @property {number} autosaveInterval How often in seconds the post will be auto-saved via the REST API.\n * @property {number} localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.\n * @property {Array?} availableTemplates The available post templates\n * @property {boolean} disablePostFormats Whether or not the post formats are disabled\n * @property {Array?} allowedMimeTypes List of allowed mime types and file extensions\n * @property {number} maxUploadFileSize Maximum upload file size\n * @property {boolean} supportsLayout Whether the editor supports layouts.\n */\nexport const EDITOR_SETTINGS_DEFAULTS = {\n\t...SETTINGS_DEFAULTS,\n\n\trichEditingEnabled: true,\n\tcodeEditingEnabled: true,\n\tenableCustomFields: undefined,\n\tsupportsLayout: true,\n};\n"]}
@@ -50,13 +50,8 @@ const storeConfig = {
50
50
  */
51
51
 
52
52
  exports.storeConfig = storeConfig;
53
- const store = (0, _data.createReduxStore)(_constants.STORE_NAME, { ...storeConfig,
54
- persist: ['preferences']
55
- }); // Once we build a more generic persistence plugin that works across types of stores
56
- // we'd be able to replace this with a register call.
57
-
58
- exports.store = store;
59
- (0, _data.registerStore)(_constants.STORE_NAME, { ...storeConfig,
60
- persist: ['preferences']
53
+ const store = (0, _data.createReduxStore)(_constants.STORE_NAME, { ...storeConfig
61
54
  });
55
+ exports.store = store;
56
+ (0, _data.register)(store);
62
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/index.js"],"names":["storeConfig","reducer","selectors","actions","store","STORE_NAME","persist"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AAC1BC,EAAAA,OAAO,EAAPA,gBAD0B;AAE1BC,EAAAA,SAF0B;AAG1BC,EAAAA;AAH0B,CAApB;AAMP;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,KAAK,GAAG,4BAAkBC,qBAAlB,EAA8B,EAClD,GAAGL,WAD+C;AAElDM,EAAAA,OAAO,EAAE,CAAE,aAAF;AAFyC,CAA9B,CAAd,C,CAKP;AACA;;;AACA,yBAAeD,qBAAf,EAA2B,EAC1B,GAAGL,WADuB;AAE1BM,EAAAA,OAAO,EAAE,CAAE,aAAF;AAFiB,CAA3B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n\tpersist: [ 'preferences' ],\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregisterStore( STORE_NAME, {\n\t...storeConfig,\n\tpersist: [ 'preferences' ],\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/index.js"],"names":["storeConfig","reducer","selectors","actions","store","STORE_NAME"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AAC1BC,EAAAA,OAAO,EAAPA,gBAD0B;AAE1BC,EAAAA,SAF0B;AAG1BC,EAAAA;AAH0B,CAApB;AAMP;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,KAAK,GAAG,4BAAkBC,qBAAlB,EAA8B,EAClD,GAAGL;AAD+C,CAA9B,CAAd;;AAIP,oBAAUI,KAAV","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n} );\n\nregister( store );\n"]}
@@ -14,7 +14,6 @@ exports.postId = postId;
14
14
  exports.postLock = postLock;
15
15
  exports.postSavingLock = postSavingLock;
16
16
  exports.postType = postType;
17
- exports.preferences = preferences;
18
17
  exports.saving = saving;
19
18
  exports.shouldOverwriteState = shouldOverwriteState;
20
19
  exports.template = template;
@@ -153,34 +152,6 @@ function template() {
153
152
 
154
153
  return state;
155
154
  }
156
- /**
157
- * Reducer returning the user preferences.
158
- *
159
- * @param {Object} state Current state.
160
- * @param {Object} action Dispatched action.
161
- *
162
- * @return {string} Updated state.
163
- */
164
-
165
-
166
- function preferences() {
167
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaults.PREFERENCES_DEFAULTS;
168
- let action = arguments.length > 1 ? arguments[1] : undefined;
169
-
170
- switch (action.type) {
171
- case 'ENABLE_PUBLISH_SIDEBAR':
172
- return { ...state,
173
- isPublishSidebarEnabled: true
174
- };
175
-
176
- case 'DISABLE_PUBLISH_SIDEBAR':
177
- return { ...state,
178
- isPublishSidebarEnabled: false
179
- };
180
- }
181
-
182
- return state;
183
- }
184
155
  /**
185
156
  * Reducer returning current network request state (whether a request to
186
157
  * the WP REST API is in progress, successful, or failed).
@@ -350,7 +321,6 @@ function editorSettings() {
350
321
  var _default = (0, _data.combineReducers)({
351
322
  postId,
352
323
  postType,
353
- preferences,
354
324
  saving,
355
325
  postLock,
356
326
  template,