@wordpress/editor 14.33.5 → 14.33.6

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 (86) hide show
  1. package/build/components/collab-sidebar/add-comment.js +9 -11
  2. package/build/components/collab-sidebar/add-comment.js.map +2 -2
  3. package/build/components/collab-sidebar/comments.js +36 -29
  4. package/build/components/collab-sidebar/comments.js.map +2 -2
  5. package/build/components/collab-sidebar/index.js +15 -15
  6. package/build/components/collab-sidebar/index.js.map +2 -2
  7. package/build/components/collab-sidebar/utils.js +2 -5
  8. package/build/components/collab-sidebar/utils.js.map +2 -2
  9. package/build/components/post-excerpt/panel.js +1 -6
  10. package/build/components/post-excerpt/panel.js.map +2 -2
  11. package/build/components/post-template/block-theme.js +4 -32
  12. package/build/components/post-template/block-theme.js.map +3 -3
  13. package/build/components/post-template/create-new-template-modal.js +1 -2
  14. package/build/components/post-template/create-new-template-modal.js.map +2 -2
  15. package/build/components/post-template/hooks.js +1 -3
  16. package/build/components/post-template/hooks.js.map +2 -2
  17. package/build/components/preferences-modal/index.js +1 -1
  18. package/build/components/preferences-modal/index.js.map +1 -1
  19. package/build/components/provider/index.js +2 -3
  20. package/build/components/provider/index.js.map +2 -2
  21. package/build/components/start-page-options/index.js +4 -5
  22. package/build/components/start-page-options/index.js.map +2 -2
  23. package/build/dataviews/store/private-actions.js +3 -9
  24. package/build/dataviews/store/private-actions.js.map +2 -2
  25. package/build/store/actions.js +2 -67
  26. package/build/store/actions.js.map +2 -2
  27. package/build-module/components/collab-sidebar/add-comment.js +9 -11
  28. package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
  29. package/build-module/components/collab-sidebar/comments.js +36 -29
  30. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  31. package/build-module/components/collab-sidebar/index.js +15 -15
  32. package/build-module/components/collab-sidebar/index.js.map +2 -2
  33. package/build-module/components/collab-sidebar/utils.js +2 -5
  34. package/build-module/components/collab-sidebar/utils.js.map +2 -2
  35. package/build-module/components/post-excerpt/panel.js +1 -6
  36. package/build-module/components/post-excerpt/panel.js.map +2 -2
  37. package/build-module/components/post-template/block-theme.js +4 -32
  38. package/build-module/components/post-template/block-theme.js.map +2 -2
  39. package/build-module/components/post-template/create-new-template-modal.js +1 -2
  40. package/build-module/components/post-template/create-new-template-modal.js.map +2 -2
  41. package/build-module/components/post-template/hooks.js +1 -3
  42. package/build-module/components/post-template/hooks.js.map +2 -2
  43. package/build-module/components/preferences-modal/index.js +1 -1
  44. package/build-module/components/preferences-modal/index.js.map +1 -1
  45. package/build-module/components/provider/index.js +2 -3
  46. package/build-module/components/provider/index.js.map +2 -2
  47. package/build-module/components/start-page-options/index.js +5 -6
  48. package/build-module/components/start-page-options/index.js.map +2 -2
  49. package/build-module/dataviews/store/private-actions.js +3 -9
  50. package/build-module/dataviews/store/private-actions.js.map +2 -2
  51. package/build-module/store/actions.js +3 -68
  52. package/build-module/store/actions.js.map +2 -2
  53. package/build-style/style-rtl.css +14 -2
  54. package/build-style/style.css +14 -2
  55. package/build-types/components/collab-sidebar/add-comment.d.ts +3 -3
  56. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  57. package/build-types/components/collab-sidebar/comments.d.ts +3 -3
  58. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  59. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  60. package/build-types/components/collab-sidebar/utils.d.ts +2 -2
  61. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  62. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  63. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  64. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  65. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  66. package/build-types/components/provider/index.d.ts.map +1 -1
  67. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  68. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  69. package/build-types/store/actions.d.ts.map +1 -1
  70. package/package.json +14 -14
  71. package/src/components/collab-sidebar/add-comment.js +9 -11
  72. package/src/components/collab-sidebar/comments.js +45 -37
  73. package/src/components/collab-sidebar/index.js +17 -15
  74. package/src/components/collab-sidebar/style.scss +16 -0
  75. package/src/components/collab-sidebar/utils.js +3 -12
  76. package/src/components/post-excerpt/panel.js +1 -11
  77. package/src/components/post-template/block-theme.js +3 -45
  78. package/src/components/post-template/create-new-template-modal.js +0 -1
  79. package/src/components/post-template/hooks.js +1 -3
  80. package/src/components/preferences-modal/index.js +1 -1
  81. package/src/components/provider/index.js +2 -5
  82. package/src/components/start-page-options/index.js +5 -6
  83. package/src/components/start-page-options/style.scss +1 -1
  84. package/src/dataviews/store/private-actions.ts +7 -16
  85. package/src/store/actions.js +3 -100
  86. package/tsconfig.tsbuildinfo +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Flex, FlexItem, Modal, ToggleControl } from "@wordpress/components";
2
+ import { Flex, FlexItem, Modal, CheckboxControl } from "@wordpress/components";
3
3
  import { __ } from "@wordpress/i18n";
4
4
  import { useState, useMemo, useEffect } from "@wordpress/element";
5
5
  import {
@@ -92,16 +92,15 @@ function StartPageOptionsModal({ onClose }) {
92
92
  Flex,
93
93
  {
94
94
  className: "editor-start-page-options__modal__actions",
95
- justify: "flex-end",
95
+ justify: "flex-start",
96
96
  expanded: false,
97
97
  children: /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
98
- ToggleControl,
98
+ CheckboxControl,
99
99
  {
100
100
  __nextHasNoMarginBottom: true,
101
101
  checked: showStartPatterns,
102
- label: __("Show starter patterns"),
103
- help: __(
104
- "Shows starter patterns when creating a new page."
102
+ label: __(
103
+ "Always show starter patterns for new pages"
105
104
  ),
106
105
  onChange: (newValue) => {
107
106
  setShowStartPatterns(newValue);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/start-page-options/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Flex, FlexItem, Modal, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nexport function useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\tif ( ! blockPatternsWithPostContentBlockType?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t/*\n\t\t * Filter patterns without postTypes declared if the current postType is page\n\t\t * or patterns that declare the current postType in its post type array.\n\t\t */\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t} );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst [ showStartPatterns, setShowStartPatterns ] = useState( true );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\tfunction handleClose() {\n\t\tonClose();\n\t\tsetPreference( 'core', 'enableChoosePatternModal', showStartPatterns );\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ handleClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ handleClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"editor-start-page-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tchecked={ showStartPatterns }\n\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Shows starter patterns when creating a new page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetShowStartPatterns( newValue );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { isModalActive } = useSelect( interfaceStore );\n\tconst { enabled, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\tTEMPLATE_POST_TYPE !== getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\tuseEffect( () => {\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\t// Prevents immediately opening when features is enabled via preferences modal.\n\t\tconst isPreferencesModalActive = isModalActive( 'editor/preferences' );\n\t\tif ( ! enabled || ! isFreshPage || isPreferencesModalActive ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Open the modal after the initial render for a new page.\n\t\tsetIsOpen( true );\n\t}, [\n\t\tenabled,\n\t\tpostId,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t\tisModalActive,\n\t] );\n\n\tif ( ! isOpen ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsOpen( false ) } />;\n}\n"],
5
- "mappings": "AA6EE,cA8BA,YA9BA;AA1EF,SAAS,MAAM,UAAU,OAAO,qBAAqB;AACrD,SAAS,UAAU;AACnB,SAAS,UAAU,SAAS,iBAAiB;AAC7C;AAAA,EACC,SAAS;AAAA,EACT,mCAAmC;AAAA,OAC7B;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,iBAAiB;AACnC,SAAS,mCAAmC;AAC5C,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,sBAAsB;AAKxC,SAAS,0BAA0B;AACnC,SAAS,SAAS,mBAAmB;AAE9B,SAAS,mBAAmB;AAIlC,QAAM,EAAE,uCAAuC,SAAS,IAAI;AAAA,IAC3D,CAAE,WAAY;AACb,YAAM,EAAE,yBAAyB,gBAAgB,IAChD,OAAQ,gBAAiB;AAC1B,YAAM,EAAE,oBAAoB,iBAAiB,IAC5C,OAAQ,WAAY;AACrB,YAAM,eACL,iBAAiB,MAAM,cACpB,KACA,gBAAiB,mBAAoB,IAAK,CAAE;AAChD,aAAO;AAAA,QACN,uCAAuC;AAAA,UACtC;AAAA,UACA;AAAA,QACD;AAAA,QACA,UAAU,mBAAmB;AAAA,MAC9B;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,SAAO,QAAS,MAAM;AACrB,QAAK,CAAE,uCAAuC,QAAS;AACtD,aAAO,CAAC;AAAA,IACT;AAMA,WAAO,sCAAsC,OAAQ,CAAE,YAAa;AACnE,aACG,aAAa,UAAU,CAAE,QAAQ,aACjC,MAAM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AAU,MAAM,UAAW,KAAM,GAAI;AACpE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Flex, FlexItem, Modal, CheckboxControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nexport function useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\tif ( ! blockPatternsWithPostContentBlockType?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t/*\n\t\t * Filter patterns without postTypes declared if the current postType is page\n\t\t * or patterns that declare the current postType in its post type array.\n\t\t */\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t} );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst [ showStartPatterns, setShowStartPatterns ] = useState( true );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\tfunction handleClose() {\n\t\tonClose();\n\t\tsetPreference( 'core', 'enableChoosePatternModal', showStartPatterns );\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ handleClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ handleClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"editor-start-page-options__modal__actions\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tchecked={ showStartPatterns }\n\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t'Always show starter patterns for new pages'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetShowStartPatterns( newValue );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );\n\tconst { isModalActive } = useSelect( interfaceStore );\n\tconst { enabled, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst choosePatternModalEnabled = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'enableChoosePatternModal'\n\t\t);\n\t\treturn {\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tenabled:\n\t\t\t\tchoosePatternModalEnabled &&\n\t\t\t\tTEMPLATE_POST_TYPE !== getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\t// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.\n\t// Examples: changing pages in the List View, creating a new page via Command Palette.\n\tuseEffect( () => {\n\t\tconst isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();\n\t\t// Prevents immediately opening when features is enabled via preferences modal.\n\t\tconst isPreferencesModalActive = isModalActive( 'editor/preferences' );\n\t\tif ( ! enabled || ! isFreshPage || isPreferencesModalActive ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Open the modal after the initial render for a new page.\n\t\tsetIsOpen( true );\n\t}, [\n\t\tenabled,\n\t\tpostId,\n\t\tisEditedPostDirty,\n\t\tisEditedPostEmpty,\n\t\tisModalActive,\n\t] );\n\n\tif ( ! isOpen ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsOpen( false ) } />;\n}\n"],
5
+ "mappings": "AA6EE,cA8BA,YA9BA;AA1EF,SAAS,MAAM,UAAU,OAAO,uBAAuB;AACvD,SAAS,UAAU;AACnB,SAAS,UAAU,SAAS,iBAAiB;AAC7C;AAAA,EACC,SAAS;AAAA,EACT,mCAAmC;AAAA,OAC7B;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,iBAAiB;AACnC,SAAS,mCAAmC;AAC5C,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,sBAAsB;AAKxC,SAAS,0BAA0B;AACnC,SAAS,SAAS,mBAAmB;AAE9B,SAAS,mBAAmB;AAIlC,QAAM,EAAE,uCAAuC,SAAS,IAAI;AAAA,IAC3D,CAAE,WAAY;AACb,YAAM,EAAE,yBAAyB,gBAAgB,IAChD,OAAQ,gBAAiB;AAC1B,YAAM,EAAE,oBAAoB,iBAAiB,IAC5C,OAAQ,WAAY;AACrB,YAAM,eACL,iBAAiB,MAAM,cACpB,KACA,gBAAiB,mBAAoB,IAAK,CAAE;AAChD,aAAO;AAAA,QACN,uCAAuC;AAAA,UACtC;AAAA,UACA;AAAA,QACD;AAAA,QACA,UAAU,mBAAmB;AAAA,MAC9B;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,SAAO,QAAS,MAAM;AACrB,QAAK,CAAE,uCAAuC,QAAS;AACtD,aAAO,CAAC;AAAA,IACT;AAMA,WAAO,sCAAsC,OAAQ,CAAE,YAAa;AACnE,aACG,aAAa,UAAU,CAAE,QAAQ,a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AAI;AACpE;",
6
6
  "names": []
7
7
  }
@@ -90,19 +90,13 @@ const registerPostTypeSchema = (postType) => async ({ registry }) => {
90
90
  name: postType
91
91
  });
92
92
  const currentTheme = await registry.resolveSelect(coreStore).getCurrentTheme();
93
- let canDuplicate = !["wp_block", "wp_template_part"].includes(
94
- postTypeConfig.slug
95
- ) && canCreate && duplicatePost;
96
- if (!globalThis.IS_GUTENBERG_PLUGIN) {
97
- if ("wp_template" !== postTypeConfig.slug) {
98
- canDuplicate = void 0;
99
- }
100
- }
101
93
  const actions = [
102
94
  postTypeConfig.viewable ? viewPost : void 0,
103
95
  !!postTypeConfig.supports?.revisions ? viewPostRevisions : void 0,
104
96
  // @ts-ignore
105
- canDuplicate,
97
+ globalThis.IS_GUTENBERG_PLUGIN ? !["wp_template", "wp_block", "wp_template_part"].includes(
98
+ postTypeConfig.slug
99
+ ) && canCreate && duplicatePost : void 0,
106
100
  postTypeConfig.slug === "wp_template_part" && canCreate && currentTheme?.is_block_theme ? duplicateTemplatePart : void 0,
107
101
  canCreate && postTypeConfig.slug === "wp_block" ? duplicatePattern : void 0,
108
102
  postTypeConfig.supports?.title ? renamePost : void 0,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/dataviews/store/private-actions.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n} from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tlet canDuplicate =\n\t\t\t! [ 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\tpostTypeConfig.slug\n\t\t\t) &&\n\t\t\tcanCreate &&\n\t\t\tduplicatePost;\n\n\t\t// @ts-ignore\n\t\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t// Outside Gutenberg, disable duplication except for wp_template.\n\t\t\tif ( 'wp_template' !== postTypeConfig.slug ) {\n\t\t\t\tcanDuplicate = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tcanDuplicate,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\tconst fields = [\n\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\tfeaturedImageField,\n\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\tstatusField,\n\t\t\tdateField,\n\t\t\tslugField,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\tdiscussionField,\n\t\t\ttemplateField,\n\t\t\tpasswordField,\n\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\tpostPreviewField,\n\t\t].filter( Boolean );\n\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\tlet _titleField;\n\t\t\tif ( postType === 'page' ) {\n\t\t\t\t_titleField = pageTitleField;\n\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t_titleField = templateTitleField;\n\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t_titleField = patternTitleField;\n\t\t\t} else {\n\t\t\t\t_titleField = titleField;\n\t\t\t}\n\t\t\tfields.push( _titleField );\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
5
- "mappings": "AAGA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,gBAAgB;AAEzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AA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C,oBAAc;AAAA,IACf,WAAY,aAAa,YAAa;AACrC,oBAAc;AAAA,IACf,OAAO;AACN,oBAAc;AAAA,IACf;AACA,WAAO,KAAM,WAAY;AAAA,EAC1B;AAEA,WAAS,MAAO,MAAM;AACrB,YAAQ,QAAS,CAAE,WAAY;AAC9B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AACF,WAAO,QAAS,CAAE,UAAW;AAC5B,aAAQ,SAAS,SAAU,WAAY,CAAE,EAAE;AAAA,QAC1C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,WAAU,+BAA+B,QAAS;AACnD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\nimport type { PostType } from '@wordpress/fields';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tduplicateTemplatePart,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tpingStatusField,\n\tdiscussionField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n\ttemplateField,\n\ttemplateTitleField,\n\tpageTitleField,\n\tpatternTitleField,\n} from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport postPreviewField from '../fields/content-preview';\nimport { unlock } from '../../lock-unlock';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tglobalThis.IS_GUTENBERG_PLUGIN\n\t\t\t\t? ! [ 'wp_template', 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\t\t\tpostTypeConfig.slug\n\t\t\t\t ) &&\n\t\t\t\t canCreate &&\n\t\t\t\t duplicatePost\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t].filter( Boolean );\n\n\t\tconst fields = [\n\t\t\tpostTypeConfig.supports?.thumbnail &&\n\t\t\t\tcurrentTheme?.theme_supports?.[ 'post-thumbnails' ] &&\n\t\t\t\tfeaturedImageField,\n\t\t\tpostTypeConfig.supports?.author && authorField,\n\t\t\tstatusField,\n\t\t\tdateField,\n\t\t\tslugField,\n\t\t\tpostTypeConfig.supports?.[ 'page-attributes' ] && parentField,\n\t\t\tpostTypeConfig.supports?.comments && commentStatusField,\n\t\t\tpostTypeConfig.supports?.trackbacks && pingStatusField,\n\t\t\t( postTypeConfig.supports?.comments ||\n\t\t\t\tpostTypeConfig.supports?.trackbacks ) &&\n\t\t\t\tdiscussionField,\n\t\t\ttemplateField,\n\t\t\tpasswordField,\n\t\t\tpostTypeConfig.supports?.editor &&\n\t\t\t\tpostTypeConfig.viewable &&\n\t\t\t\tpostPreviewField,\n\t\t].filter( Boolean );\n\t\tif ( postTypeConfig.supports?.title ) {\n\t\t\tlet _titleField;\n\t\t\tif ( postType === 'page' ) {\n\t\t\t\t_titleField = pageTitleField;\n\t\t\t} else if ( postType === 'wp_template' ) {\n\t\t\t\t_titleField = templateTitleField;\n\t\t\t} else if ( postType === 'wp_block' ) {\n\t\t\t\t_titleField = patternTitleField;\n\t\t\t} else {\n\t\t\t\t_titleField = titleField;\n\t\t\t}\n\t\t\tfields.push( _titleField );\n\t\t}\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],
5
+ "mappings": "AAGA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,gBAAgB;AAEzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,SAAS,mBAAmB;AACrC,OAAO,sBAAsB;AAC7B,SAAS,cAAc;AAEhB,SAAS,qBACf,MACA,MACA,QACC;AACD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,uBAC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as preferencesStore } from "@wordpress/preferences";
18
- import { __, sprintf } from "@wordpress/i18n";
18
+ import { __ } from "@wordpress/i18n";
19
19
  import { localAutosaveSet } from "./local-autosave";
20
20
  import {
21
21
  getNotificationArgumentsForSaveSuccess,
@@ -152,7 +152,7 @@ const savePost = (options = {}) => async ({ select, dispatch, registry }) => {
152
152
  try {
153
153
  await doActionAsync(
154
154
  "editor.savePost",
155
- { id: previousRecord.id, type: previousRecord.type },
155
+ { id: previousRecord.id },
156
156
  options
157
157
  );
158
158
  } catch (err) {
@@ -160,9 +160,6 @@ const savePost = (options = {}) => async ({ select, dispatch, registry }) => {
160
160
  }
161
161
  }
162
162
  dispatch({ type: "REQUEST_POST_UPDATE_FINISH", options });
163
- if (!options.isAutosave && previousRecord.type === "wp_template" && (typeof previousRecord.id === "number" || /^\d+$/.test(previousRecord.id))) {
164
- templateActivationNotice({ select, dispatch, registry });
165
- }
166
163
  if (error) {
167
164
  const args = getNotificationArgumentsForSaveFail({
168
165
  post: previousRecord,
@@ -188,68 +185,6 @@ const savePost = (options = {}) => async ({ select, dispatch, registry }) => {
188
185
  }
189
186
  }
190
187
  };
191
- async function templateActivationNotice({ select, registry }) {
192
- const editorSettings = select.getEditorSettings();
193
- if (editorSettings.onNavigateToPreviousEntityRecord) {
194
- return;
195
- }
196
- const { id, slug } = select.getCurrentPost();
197
- const site = await registry.select(coreStore).getEntityRecord("root", "site");
198
- if (site.active_templates[slug] === id) {
199
- return;
200
- }
201
- const currentTheme = await registry.resolveSelect(coreStore).getCurrentTheme();
202
- const templateType = currentTheme?.default_template_types.find(
203
- (type) => type.slug === slug
204
- );
205
- await registry.dispatch(noticesStore).createNotice(
206
- "info",
207
- sprintf(
208
- // translators: %s: The name (or slug) of the type of template.
209
- __('Do you want to activate this "%s" template?'),
210
- templateType?.title ?? slug
211
- ),
212
- {
213
- id: "template-activate-notice",
214
- actions: [
215
- {
216
- label: __("Activate"),
217
- onClick: async () => {
218
- await registry.dispatch(noticesStore).createNotice(
219
- "info",
220
- __("Activating template\u2026"),
221
- { id: "template-activate-notice" }
222
- );
223
- try {
224
- const currentSite = await registry.select(coreStore).getEntityRecord("root", "site");
225
- await registry.dispatch(coreStore).saveEntityRecord(
226
- "root",
227
- "site",
228
- {
229
- active_templates: {
230
- ...currentSite.active_templates,
231
- [slug]: id
232
- }
233
- },
234
- { throwOnError: true }
235
- );
236
- await registry.dispatch(noticesStore).createSuccessNotice(
237
- __("Template activated."),
238
- { id: "template-activate-notice" }
239
- );
240
- } catch (error) {
241
- await registry.dispatch(noticesStore).createErrorNotice(
242
- __("Template activation failed."),
243
- { id: "template-activate-notice" }
244
- );
245
- throw error;
246
- }
247
- }
248
- }
249
- ]
250
- }
251
- );
252
- }
253
188
  function refreshPost() {
254
189
  deprecated("wp.data.dispatch( 'core/editor' ).refreshPost", {
255
190
  since: "6.0",
@@ -376,7 +311,7 @@ function updateEditorSettings(settings) {
376
311
  };
377
312
  }
378
313
  const setRenderingMode = (mode) => ({ dispatch, registry, select }) => {
379
- if (select.__unstableIsEditorReady() && !select.getEditorSettings().isPreviewMode) {
314
+ if (select.__unstableIsEditorReady()) {
380
315
  registry.dispatch(blockEditorStore).clearSelectedBlock();
381
316
  dispatch.editPost({ selection: void 0 }, { undoIgnore: true });
382
317
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/actions.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\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 {\n\tapplyFilters,\n\tapplyFiltersAsync,\n\tdoActionAsync,\n} from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\nimport { unlock } from '../lock-unlock';\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 =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setEditedPost( post.type, post.id );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\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 * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t}\n\t);\n\treturn { type: 'DO_NOTHING' };\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 * Setup the editor state.\n *\n * @deprecated\n *\n * @param {Object} post Post object.\n */\nexport function setupEditorState( post ) {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).setupEditorState\", {\n\t\tsince: '6.5',\n\t\talternative: \"wp.data.dispatch( 'core/editor' ).setEditedPost\",\n\t} );\n\treturn setEditedPost( post.type, post.id );\n}\n\n/**\n * Returns an action that sets the current post Type and post ID.\n *\n * @param {string} postType Post Type.\n * @param {string} postId Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPost( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tpostId,\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 *\n * @example\n * ```js\n * // Update the post title\n * wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );\n * ```\n *\n * @return {Object} Action object\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} [options]\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tlet edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\n\t\tlet error = false;\n\t\ttry {\n\t\t\tedits = await applyFiltersAsync(\n\t\t\t\t'editor.preSavePost',\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\t\t} catch ( err ) {\n\t\t\terror = err;\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.saveEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\t\tedits,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror =\n\t\t\t\t\terr.message && err.code !== 'unknown_error'\n\t\t\t\t\t\t? err.message\n\t\t\t\t\t\t: __( 'An error occurred while updating.' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\terror = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t);\n\t\t}\n\n\t\t// Run the hook with legacy unstable name for backward compatibility\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait applyFilters(\n\t\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\t\tPromise.resolve(),\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror = err;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait doActionAsync(\n\t\t\t\t\t'editor.savePost',\n\t\t\t\t\t{ id: previousRecord.id, type: previousRecord.type },\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror = err;\n\t\t\t}\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif (\n\t\t\t! options.isAutosave &&\n\t\t\tpreviousRecord.type === 'wp_template' &&\n\t\t\t( typeof previousRecord.id === 'number' ||\n\t\t\t\t/^\\d+$/.test( previousRecord.id ) )\n\t\t) {\n\t\t\ttemplateActivationNotice( { select, dispatch, registry } );\n\t\t}\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\nasync function templateActivationNotice( { select, registry } ) {\n\tconst editorSettings = select.getEditorSettings();\n\n\t// Don't open for focused entity.\n\tif ( editorSettings.onNavigateToPreviousEntityRecord ) {\n\t\treturn;\n\t}\n\n\tconst { id, slug } = select.getCurrentPost();\n\tconst site = await registry\n\t\t.select( coreStore )\n\t\t.getEntityRecord( 'root', 'site' );\n\n\t// Already active.\n\tif ( site.active_templates[ slug ] === id ) {\n\t\treturn;\n\t}\n\n\tconst currentTheme = await registry\n\t\t.resolveSelect( coreStore )\n\t\t.getCurrentTheme();\n\tconst templateType = currentTheme?.default_template_types.find(\n\t\t( type ) => type.slug === slug\n\t);\n\n\tawait registry.dispatch( noticesStore ).createNotice(\n\t\t'info',\n\t\tsprintf(\n\t\t\t// translators: %s: The name (or slug) of the type of template.\n\t\t\t__( 'Do you want to activate this \"%s\" template?' ),\n\t\t\ttemplateType?.title ?? slug\n\t\t),\n\t\t{\n\t\t\tid: 'template-activate-notice',\n\t\t\tactions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Activate' ),\n\t\t\t\t\tonClick: async () => {\n\t\t\t\t\t\tawait registry\n\t\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t\t.createNotice(\n\t\t\t\t\t\t\t\t'info',\n\t\t\t\t\t\t\t\t__( 'Activating template\u2026' ),\n\t\t\t\t\t\t\t\t{ id: 'template-activate-notice' }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst currentSite = await registry\n\t\t\t\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t\t\t\t.getEntityRecord( 'root', 'site' );\n\t\t\t\t\t\t\tawait registry\n\t\t\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t\t\t.saveEntityRecord(\n\t\t\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t\t\t'site',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tactive_templates: {\n\t\t\t\t\t\t\t\t\t\t\t...currentSite.active_templates,\n\t\t\t\t\t\t\t\t\t\t\t[ slug ]: id,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tawait registry\n\t\t\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t\t\t.createSuccessNotice(\n\t\t\t\t\t\t\t\t\t__( 'Template activated.' ),\n\t\t\t\t\t\t\t\t\t{ id: 'template-activate-notice' }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} catch ( error ) {\n\t\t\t\t\t\t\tawait registry\n\t\t\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t\t\t\t__( 'Template activation failed.' ),\n\t\t\t\t\t\t\t\t\t{ id: 'template-activate-notice' }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Rethrow for debugging.\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\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 =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\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 * @param {boolean} [options.local] Whether to perform a local autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tconst post = select.getCurrentPost();\n\n\t\t// Currently template autosaving is not supported.\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( local ) {\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\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 =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', false );\n\t};\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 =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\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 * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'post-only' or 'template-locked').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry, select } ) => {\n\t\tif (\n\t\t\tselect.__unstableIsEditorReady() &&\n\t\t\t! select.getEditorSettings().isPreviewMode\n\t\t) {\n\t\t\t// We clear the block selection but we also need to clear the selection from the core store.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\tdispatch.editPost( { selection: undefined }, { undoIgnore: true } );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function setDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst openPanels =\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'openPanels' ) ??\n\t\t\t[];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n * @param {string} value.filterValue A query to filter the inserter results.\n * @param {Function} value.onSelect A callback when an item is selected.\n * @param {string} value.tab The tab to open in the inserter.\n * @param {string} value.category The category to initialize in the inserter.\n *\n * @return {Object} Action object.\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { dispatch, registry } ) => {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue.hasOwnProperty( 'rootClientId' ) &&\n\t\t\tvalue.hasOwnProperty( 'insertionIndex' )\n\t\t) {\n\t\t\tunlock( registry.dispatch( blockEditorStore ) ).setInsertionPoint( {\n\t\t\t\trootClientId: value.rootClientId,\n\t\t\t\tindex: value.insertionIndex,\n\t\t\t} );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\t\tvalue,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @param {Object} [options={}] Optional configuration object\n * @param {boolean} [options.createNotice=true] Whether to create a notice\n */\nexport const toggleDistractionFree =\n\t( { createNotice = true } = {} ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'fixedToolbar', false );\n\t\t}\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tunlock(\n\t\t\t\t\tregistry.dispatch( blockEditorStore )\n\t\t\t\t).resetZoomLevel();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\n\t\t\tif ( createNotice ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createInfoNotice(\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? __( 'Distraction free mode deactivated.' )\n\t\t\t\t\t\t\t: __( 'Distraction free mode activated.' ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'core/editor/distraction-free-mode/notice',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t\t.set(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'distractionFree'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t};\n\n/**\n * Action that toggles the Spotlight Mode view option.\n */\nexport const toggleSpotlightMode =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).toggle( 'core', 'focusMode' );\n\n\t\tconst isFocusMode = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'focusMode' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisFocusMode\n\t\t\t\t\t? __( 'Spotlight mode activated.' )\n\t\t\t\t\t: __( 'Spotlight mode deactivated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Action that toggles the Top Toolbar view option.\n */\nexport const toggleTopToolbar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).toggle( 'core', 'fixedToolbar' );\n\n\t\tconst isTopToolbar = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'fixedToolbar' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar activated.' )\n\t\t\t\t\t: __( 'Top toolbar deactivated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\tif ( mode !== 'visual' ) {\n\t\t\t// Unselect blocks when we switch to a non visual mode.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\t// Exit zoom out state when switching to a non visual mode.\n\t\t\tunlock( registry.dispatch( blockEditorStore ) ).resetZoomLevel();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\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"],
5
- "mappings": "AAGA,SAAS,aAAa;AACtB,OAAO,cAAc;AACrB,OAAO,gBAAgB;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,wBAAwB;AAC1C,SAAS,IAAI,eAAe;AAK5B,SAAS,wBAAwB;AACjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AAShB,MAAM,cACZ,CAAE,MAAM,OAAO,aACf,CAAE,EAAE,SAAS,MAAO;AACnB,WAAS,cAAe,KAAK,MAAM,KAAK,EAAG;AAE3C,QAAM,YAAY,KAAK,WAAW;AAClC,MAAK,aAAa,UAAW;AAI5B,QAAI;AACJ,QAAK,aAAa,OAAQ;AACzB,gBAAU,MAAM;AAAA,IACjB,OAAO;AACN,gBAAU,KAAK,QAAQ;AAAA,IACxB;AACA,QAAI,SAAS,MAAO,OAAQ;AAC5B,aAAS,8BAA+B,QAAQ,QAAS;AACzD,aAAS,kBAAmB,QAAQ;AAAA,MACnC,iCAAiC;AAAA,IAClC,CAAE;AAAA,EACH;AACA,MACC,SACA,OAAO,OAAQ,KAAM,EAAE;AAAA,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qBAAsB,YAAa;AAKtD,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,oBAAoB,qBAAsB,mBAAoB;AAKpE,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,0BAA0B;AAAA,EACtC;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\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 {\n\tapplyFilters,\n\tapplyFiltersAsync,\n\tdoActionAsync,\n} from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\nimport { unlock } from '../lock-unlock';\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 =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setEditedPost( post.type, post.id );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\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 * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t}\n\t);\n\treturn { type: 'DO_NOTHING' };\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 * Setup the editor state.\n *\n * @deprecated\n *\n * @param {Object} post Post object.\n */\nexport function setupEditorState( post ) {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).setupEditorState\", {\n\t\tsince: '6.5',\n\t\talternative: \"wp.data.dispatch( 'core/editor' ).setEditedPost\",\n\t} );\n\treturn setEditedPost( post.type, post.id );\n}\n\n/**\n * Returns an action that sets the current post Type and post ID.\n *\n * @param {string} postType Post Type.\n * @param {string} postId Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPost( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tpostId,\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 *\n * @example\n * ```js\n * // Update the post title\n * wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );\n * ```\n *\n * @return {Object} Action object\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} [options]\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tlet edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\n\t\tlet error = false;\n\t\ttry {\n\t\t\tedits = await applyFiltersAsync(\n\t\t\t\t'editor.preSavePost',\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\t\t} catch ( err ) {\n\t\t\terror = err;\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.saveEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\t\tedits,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror =\n\t\t\t\t\terr.message && err.code !== 'unknown_error'\n\t\t\t\t\t\t? err.message\n\t\t\t\t\t\t: __( 'An error occurred while updating.' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\terror = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t);\n\t\t}\n\n\t\t// Run the hook with legacy unstable name for backward compatibility\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait applyFilters(\n\t\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\t\tPromise.resolve(),\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror = err;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! error ) {\n\t\t\ttry {\n\t\t\t\tawait doActionAsync(\n\t\t\t\t\t'editor.savePost',\n\t\t\t\t\t{ id: previousRecord.id },\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t} catch ( err ) {\n\t\t\t\terror = err;\n\t\t\t}\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\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 =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\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 * @param {boolean} [options.local] Whether to perform a local autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tconst post = select.getCurrentPost();\n\n\t\t// Currently template autosaving is not supported.\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( local ) {\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\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 =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', false );\n\t};\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 =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\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 * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'post-only' or 'template-locked').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry, select } ) => {\n\t\tif ( select.__unstableIsEditorReady() ) {\n\t\t\t// We clear the block selection but we also need to clear the selection from the core store.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\tdispatch.editPost( { selection: undefined }, { undoIgnore: true } );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function setDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tconst openPanels =\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'openPanels' ) ??\n\t\t\t[];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n * @param {string} value.filterValue A query to filter the inserter results.\n * @param {Function} value.onSelect A callback when an item is selected.\n * @param {string} value.tab The tab to open in the inserter.\n * @param {string} value.category The category to initialize in the inserter.\n *\n * @return {Object} Action object.\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { dispatch, registry } ) => {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue.hasOwnProperty( 'rootClientId' ) &&\n\t\t\tvalue.hasOwnProperty( 'insertionIndex' )\n\t\t) {\n\t\t\tunlock( registry.dispatch( blockEditorStore ) ).setInsertionPoint( {\n\t\t\t\trootClientId: value.rootClientId,\n\t\t\t\tindex: value.insertionIndex,\n\t\t\t} );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\t\tvalue,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @param {Object} [options={}] Optional configuration object\n * @param {boolean} [options.createNotice=true] Whether to create a notice\n */\nexport const toggleDistractionFree =\n\t( { createNotice = true } = {} ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'fixedToolbar', false );\n\t\t}\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tunlock(\n\t\t\t\t\tregistry.dispatch( blockEditorStore )\n\t\t\t\t).resetZoomLevel();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\n\t\t\tif ( createNotice ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createInfoNotice(\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? __( 'Distraction free mode deactivated.' )\n\t\t\t\t\t\t\t: __( 'Distraction free mode activated.' ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'core/editor/distraction-free-mode/notice',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t\t.set(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'distractionFree'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t};\n\n/**\n * Action that toggles the Spotlight Mode view option.\n */\nexport const toggleSpotlightMode =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).toggle( 'core', 'focusMode' );\n\n\t\tconst isFocusMode = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'focusMode' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisFocusMode\n\t\t\t\t\t? __( 'Spotlight mode activated.' )\n\t\t\t\t\t: __( 'Spotlight mode deactivated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Action that toggles the Top Toolbar view option.\n */\nexport const toggleTopToolbar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).toggle( 'core', 'fixedToolbar' );\n\n\t\tconst isTopToolbar = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'fixedToolbar' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar activated.' )\n\t\t\t\t\t: __( 'Top toolbar deactivated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\tif ( mode !== 'visual' ) {\n\t\t\t// Unselect blocks when we switch to a non visual mode.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\t// Exit zoom out state when switching to a non visual mode.\n\t\t\tunlock( registry.dispatch( blockEditorStore ) ).resetZoomLevel();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\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"],
5
+ "mappings": "AAGA,SAAS,aAAa;AACtB,OAAO,cAAc;AACrB,OAAO,gBAAgB;A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,eAAe,qBAAsB,cAAe;AAK1D,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,sBAAsB;AAAA,EAClC;AACD;AAKO,MAAM,sBAAsB;AAAA,EAClC;AACD;AAKO,MAAM,cAAc,qBAAsB,aAAc;AAKxD,MAAM,eAAe,qBAAsB,cAAe;AAK1D,MAAM,cAAc,qBAAsB,aAAc;AAKxD,MAAM,kBAAkB,qBAAsB,iBAAkB;AAKhE,MAAM,cAAc,qBAAsB,aAAc;AAKxD,MAAM,aAAa,qBAAsB,YAAa;AAKtD,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,oBAAoB,qBAAsB,mBAAoB;AAKpE,MAAM,qBAAqB,qBAAsB,oBAAqB;AAKtE,MAAM,0BAA0B;AAAA,EACtC;AACD;",
6
6
  "names": []
7
7
  }
@@ -905,11 +905,23 @@ body.is-fullscreen-mode .interface-interface-skeleton {
905
905
  border-style: solid;
906
906
  padding: var(--wp-admin-border-width-focus);
907
907
  background: #fff;
908
+ box-sizing: border-box;
908
909
  }
909
910
  .comment-avatar:first-child {
910
911
  margin-right: 0;
911
912
  }
912
913
 
914
+ .show-icon-labels .comment-avatar-indicator {
915
+ width: auto;
916
+ }
917
+ .show-icon-labels .comment-avatar-indicator div {
918
+ display: none;
919
+ }
920
+ .show-icon-labels .comment-avatar-indicator::after {
921
+ content: attr(aria-label);
922
+ font-size: 12px;
923
+ }
924
+
913
925
  .editor-collapsible-block-toolbar {
914
926
  overflow: hidden;
915
927
  display: flex;
@@ -2674,7 +2686,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2674
2686
  position: absolute;
2675
2687
  bottom: 0;
2676
2688
  width: 100%;
2677
- height: 92px;
2689
+ height: 72px;
2678
2690
  background-color: #fff;
2679
2691
  margin-right: -32px;
2680
2692
  margin-left: -32px;
@@ -2684,7 +2696,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2684
2696
  z-index: 1;
2685
2697
  }
2686
2698
  .editor-start-page-options__modal .block-editor-block-patterns-list {
2687
- padding-bottom: 92px;
2699
+ padding-bottom: 72px;
2688
2700
  }
2689
2701
 
2690
2702
  .editor-start-page-options__modal-content .block-editor-block-patterns-list {
@@ -905,11 +905,23 @@ body.is-fullscreen-mode .interface-interface-skeleton {
905
905
  border-style: solid;
906
906
  padding: var(--wp-admin-border-width-focus);
907
907
  background: #fff;
908
+ box-sizing: border-box;
908
909
  }
909
910
  .comment-avatar:first-child {
910
911
  margin-left: 0;
911
912
  }
912
913
 
914
+ .show-icon-labels .comment-avatar-indicator {
915
+ width: auto;
916
+ }
917
+ .show-icon-labels .comment-avatar-indicator div {
918
+ display: none;
919
+ }
920
+ .show-icon-labels .comment-avatar-indicator::after {
921
+ content: attr(aria-label);
922
+ font-size: 12px;
923
+ }
924
+
913
925
  .editor-collapsible-block-toolbar {
914
926
  overflow: hidden;
915
927
  display: flex;
@@ -2678,7 +2690,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2678
2690
  position: absolute;
2679
2691
  bottom: 0;
2680
2692
  width: 100%;
2681
- height: 92px;
2693
+ height: 72px;
2682
2694
  background-color: #fff;
2683
2695
  margin-left: -32px;
2684
2696
  margin-right: -32px;
@@ -2688,7 +2700,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2688
2700
  z-index: 1;
2689
2701
  }
2690
2702
  .editor-start-page-options__modal .block-editor-block-patterns-list {
2691
- padding-bottom: 92px;
2703
+ padding-bottom: 72px;
2692
2704
  }
2693
2705
 
2694
2706
  .editor-start-page-options__modal-content .block-editor-block-patterns-list {
@@ -1,7 +1,7 @@
1
- export function AddComment({ onSubmit, showCommentBoard, setShowCommentBoard, commentSidebarRef, reflowComments, isFloating, y, refs, }: {
1
+ export function AddComment({ onSubmit, newNoteFormState, setNewNoteFormState, commentSidebarRef, reflowComments, isFloating, y, refs, }: {
2
2
  onSubmit: any;
3
- showCommentBoard: any;
4
- setShowCommentBoard: any;
3
+ newNoteFormState: any;
4
+ setNewNoteFormState: any;
5
5
  commentSidebarRef: any;
6
6
  reflowComments?: typeof noop | undefined;
7
7
  isFloating?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"add-comment.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/add-comment.js"],"names":[],"mappings":"AA4BA;;;;;;;;;uCA0EC;qBA9EwC,SAAS"}
1
+ {"version":3,"file":"add-comment.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/add-comment.js"],"names":[],"mappings":"AA4BA;;;;;;;;;uCAwEC;qBA5EwC,SAAS"}
@@ -1,10 +1,10 @@
1
- export function Comments({ threads: noteThreads, onEditComment, onAddReply, onCommentDelete, showCommentBoard, setShowCommentBoard, commentSidebarRef, reflowComments, isFloating, commentLastUpdated, }: {
1
+ export function Comments({ threads: noteThreads, onEditComment, onAddReply, onCommentDelete, newNoteFormState, setNewNoteFormState, commentSidebarRef, reflowComments, isFloating, commentLastUpdated, }: {
2
2
  threads: any;
3
3
  onEditComment: any;
4
4
  onAddReply: any;
5
5
  onCommentDelete: any;
6
- showCommentBoard: any;
7
- setShowCommentBoard: any;
6
+ newNoteFormState: any;
7
+ setNewNoteFormState: any;
8
8
  commentSidebarRef: any;
9
9
  reflowComments: any;
10
10
  isFloating?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/comments.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;uCA4SC"}
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/components/collab-sidebar/comments.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;uCA6SC"}