@wordpress/edit-widgets 6.31.1-next.f56bd8138.0 → 6.32.1-next.47f435fc9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/blocks/widget-area/block.json +26 -0
  3. package/build/blocks/widget-area/edit/index.js +94 -87
  4. package/build/blocks/widget-area/edit/index.js.map +7 -1
  5. package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
  6. package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  7. package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
  8. package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  9. package/build/blocks/widget-area/index.js +49 -52
  10. package/build/blocks/widget-area/index.js.map +7 -1
  11. package/build/components/error-boundary/index.js +49 -51
  12. package/build/components/error-boundary/index.js.map +7 -1
  13. package/build/components/header/document-tools/index.js +104 -74
  14. package/build/components/header/document-tools/index.js.map +7 -1
  15. package/build/components/header/index.js +81 -62
  16. package/build/components/header/index.js.map +7 -1
  17. package/build/components/header/undo-redo/redo.js +50 -38
  18. package/build/components/header/undo-redo/redo.js.map +7 -1
  19. package/build/components/header/undo-redo/undo.js +49 -37
  20. package/build/components/header/undo-redo/undo.js.map +7 -1
  21. package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
  22. package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  23. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
  24. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  25. package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
  26. package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  27. package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
  28. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  29. package/build/components/keyboard-shortcuts/index.js +89 -82
  30. package/build/components/keyboard-shortcuts/index.js.map +7 -1
  31. package/build/components/layout/index.js +75 -49
  32. package/build/components/layout/index.js.map +7 -1
  33. package/build/components/layout/interface.js +89 -75
  34. package/build/components/layout/interface.js.map +7 -1
  35. package/build/components/layout/unsaved-changes-warning.js +35 -42
  36. package/build/components/layout/unsaved-changes-warning.js.map +7 -1
  37. package/build/components/more-menu/index.js +189 -108
  38. package/build/components/more-menu/index.js.map +7 -1
  39. package/build/components/more-menu/tools-more-menu-group.js +29 -23
  40. package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
  41. package/build/components/notices/index.js +62 -48
  42. package/build/components/notices/index.js.map +7 -1
  43. package/build/components/save-button/index.js +55 -47
  44. package/build/components/save-button/index.js.map +7 -1
  45. package/build/components/secondary-sidebar/index.js +41 -34
  46. package/build/components/secondary-sidebar/index.js.map +7 -1
  47. package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
  48. package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  49. package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
  50. package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  51. package/build/components/sidebar/index.js +149 -138
  52. package/build/components/sidebar/index.js.map +7 -1
  53. package/build/components/sidebar/widget-areas.js +73 -57
  54. package/build/components/sidebar/widget-areas.js.map +7 -1
  55. package/build/components/welcome-guide/index.js +182 -137
  56. package/build/components/welcome-guide/index.js.map +7 -1
  57. package/build/components/widget-areas-block-editor-content/index.js +64 -43
  58. package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
  59. package/build/components/widget-areas-block-editor-provider/index.js +115 -92
  60. package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
  61. package/build/constants.js +30 -8
  62. package/build/constants.js.map +7 -1
  63. package/build/filters/index.js +3 -5
  64. package/build/filters/index.js.map +7 -1
  65. package/build/filters/move-to-widget-area.js +52 -59
  66. package/build/filters/move-to-widget-area.js.map +7 -1
  67. package/build/filters/replace-media-upload.js +9 -11
  68. package/build/filters/replace-media-upload.js.map +7 -1
  69. package/build/hooks/use-last-selected-widget-area.js +38 -44
  70. package/build/hooks/use-last-selected-widget-area.js.map +7 -1
  71. package/build/hooks/use-widget-library-insertion-point.js +60 -55
  72. package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
  73. package/build/index.js +86 -93
  74. package/build/index.js.map +7 -1
  75. package/build/lock-unlock.js +31 -15
  76. package/build/lock-unlock.js.map +7 -1
  77. package/build/store/actions.js +181 -313
  78. package/build/store/actions.js.map +7 -1
  79. package/build/store/constants.js +27 -10
  80. package/build/store/constants.js.map +7 -1
  81. package/build/store/index.js +51 -51
  82. package/build/store/index.js.map +7 -1
  83. package/build/store/private-selectors.js +28 -7
  84. package/build/store/private-selectors.js.map +7 -1
  85. package/build/store/reducer.js +65 -118
  86. package/build/store/reducer.js.map +7 -1
  87. package/build/store/resolvers.js +64 -63
  88. package/build/store/resolvers.js.map +7 -1
  89. package/build/store/selectors.js +194 -231
  90. package/build/store/selectors.js.map +7 -1
  91. package/build/store/transformers.js +47 -41
  92. package/build/store/transformers.js.map +7 -1
  93. package/build/store/utils.js +47 -70
  94. package/build/store/utils.js.map +7 -1
  95. package/build-module/blocks/widget-area/block.json +26 -0
  96. package/build-module/blocks/widget-area/edit/index.js +63 -75
  97. package/build-module/blocks/widget-area/edit/index.js.map +7 -1
  98. package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
  99. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  100. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
  101. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  102. package/build-module/blocks/widget-area/index.js +14 -46
  103. package/build-module/blocks/widget-area/index.js.map +7 -1
  104. package/build-module/components/error-boundary/index.js +30 -43
  105. package/build-module/components/error-boundary/index.js.map +7 -1
  106. package/build-module/components/header/document-tools/index.js +75 -66
  107. package/build-module/components/header/document-tools/index.js.map +7 -1
  108. package/build-module/components/header/index.js +52 -54
  109. package/build-module/components/header/index.js.map +7 -1
  110. package/build-module/components/header/undo-redo/redo.js +32 -32
  111. package/build-module/components/header/undo-redo/redo.js.map +7 -1
  112. package/build-module/components/header/undo-redo/undo.js +31 -31
  113. package/build-module/components/header/undo-redo/undo.js.map +7 -1
  114. package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
  115. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  116. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
  117. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  118. package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
  119. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  120. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
  121. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  122. package/build-module/components/keyboard-shortcuts/index.js +73 -75
  123. package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
  124. package/build-module/components/layout/index.js +46 -41
  125. package/build-module/components/layout/index.js.map +7 -1
  126. package/build-module/components/layout/interface.js +63 -66
  127. package/build-module/components/layout/interface.js.map +7 -1
  128. package/build-module/components/layout/unsaved-changes-warning.js +17 -37
  129. package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
  130. package/build-module/components/more-menu/index.js +167 -102
  131. package/build-module/components/more-menu/index.js.map +7 -1
  132. package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
  133. package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
  134. package/build-module/components/notices/index.js +43 -42
  135. package/build-module/components/notices/index.js.map +7 -1
  136. package/build-module/components/save-button/index.js +37 -41
  137. package/build-module/components/save-button/index.js.map +7 -1
  138. package/build-module/components/secondary-sidebar/index.js +14 -27
  139. package/build-module/components/secondary-sidebar/index.js.map +7 -1
  140. package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
  141. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  142. package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
  143. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  144. package/build-module/components/sidebar/index.js +129 -127
  145. package/build-module/components/sidebar/index.js.map +7 -1
  146. package/build-module/components/sidebar/widget-areas.js +53 -49
  147. package/build-module/components/sidebar/widget-areas.js.map +7 -1
  148. package/build-module/components/welcome-guide/index.js +165 -132
  149. package/build-module/components/welcome-guide/index.js.map +7 -1
  150. package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
  151. package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
  152. package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
  153. package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
  154. package/build-module/constants.js +7 -3
  155. package/build-module/constants.js.map +7 -1
  156. package/build-module/filters/index.js +3 -6
  157. package/build-module/filters/index.js.map +7 -1
  158. package/build-module/filters/move-to-widget-area.js +52 -57
  159. package/build-module/filters/move-to-widget-area.js.map +7 -1
  160. package/build-module/filters/replace-media-upload.js +8 -7
  161. package/build-module/filters/replace-media-upload.js.map +7 -1
  162. package/build-module/hooks/use-last-selected-widget-area.js +20 -39
  163. package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
  164. package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
  165. package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
  166. package/build-module/index.js +60 -72
  167. package/build-module/index.js.map +7 -1
  168. package/build-module/lock-unlock.js +8 -7
  169. package/build-module/lock-unlock.js.map +7 -1
  170. package/build-module/store/actions.js +153 -293
  171. package/build-module/store/actions.js.map +7 -1
  172. package/build-module/store/constants.js +5 -5
  173. package/build-module/store/constants.js.map +7 -1
  174. package/build-module/store/index.js +16 -40
  175. package/build-module/store/index.js.map +7 -1
  176. package/build-module/store/private-selectors.js +7 -3
  177. package/build-module/store/private-selectors.js.map +7 -1
  178. package/build-module/store/reducer.js +42 -111
  179. package/build-module/store/reducer.js.map +7 -1
  180. package/build-module/store/resolvers.js +43 -51
  181. package/build-module/store/resolvers.js.map +7 -1
  182. package/build-module/store/selectors.js +171 -224
  183. package/build-module/store/selectors.js.map +7 -1
  184. package/build-module/store/transformers.js +23 -34
  185. package/build-module/store/transformers.js.map +7 -1
  186. package/build-module/store/utils.js +22 -63
  187. package/build-module/store/utils.js.map +7 -1
  188. package/build-style/style-rtl.css +216 -88
  189. package/build-style/style.css +216 -88
  190. package/package.json +36 -29
  191. package/src/blocks/widget-area/editor.scss +3 -0
  192. package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
  193. package/src/components/error-boundary/style.scss +2 -0
  194. package/src/components/header/style.scss +5 -0
  195. package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
  196. package/src/components/layout/style.scss +3 -0
  197. package/src/components/more-menu/style.scss +2 -0
  198. package/src/components/notices/style.scss +3 -0
  199. package/src/components/secondary-sidebar/style.scss +4 -0
  200. package/src/components/sidebar/style.scss +2 -0
  201. package/src/components/welcome-guide/style.scss +2 -0
  202. package/src/components/widget-areas-block-editor-content/style.scss +2 -0
  203. package/src/style.scss +16 -13
@@ -1 +1,7 @@
1
- {"version":3,"names":["_i18n","require","_notices","_interface","_widgets","_coreData","_blockEditor","_transformers","_utils","_constants","persistStubPost","id","blocks","registry","stubPost","createStubPost","dispatch","coreStore","receiveEntityRecords","KIND","POST_TYPE","exports","saveEditedWidgetAreas","select","editedWidgetAreas","getEditedWidgetAreas","length","saveWidgetAreas","noticesStore","createSuccessNotice","__","type","e","createErrorNotice","sprintf","message","widgetAreas","widgetArea","saveWidgetArea","finishResolution","WIDGET_AREA_ENTITY_TYPE","buildWidgetAreasQuery","widgetAreaId","widgets","getWidgets","post","getEditedEntityRecord","buildWidgetAreaPostId","areaWidgets","Object","values","filter","sidebar","usedReferenceWidgets","widgetsBlocks","block","attributes","name","includes","push","deletedWidgets","widget","widgetsNewArea","getWidgetAreaForWidgetId","batchMeta","batchTasks","sidebarWidgetsIds","i","widgetId","getWidgetIdFromBlock","oldWidget","transformBlockToWidget","editEntityRecord","undoIgnore","hasEdits","hasEditsForEntityRecord","saveEditedEntityRecord","saveEntityRecord","position","clientId","deleteEntityRecord","force","records","__experimentalBatch","preservedRecords","record","hasOwnProperty","failedWidgetNames","__internalWidgetId","error","getLastEntitySaveError","Error","join","trySaveWidgetArea","undefined","throwOnError","setWidgetIdForClientId","setWidgetAreasOpenState","widgetAreasOpenState","setIsWidgetAreaOpen","isOpen","setIsInserterOpened","value","setIsListViewOpened","closeGeneralSidebar","interfaceStore","disableComplementaryArea","editWidgetsStoreName","moveBlockToWidgetArea","sourceRootClientId","blockEditorStore","getBlockRootClientId","getBlocks","destinationWidgetAreaBlock","find","destinationRootClientId","destinationInnerBlocksClientIds","getBlockOrder","destinationIndex","isDestinationWidgetAreaOpen","getIsWidgetAreaOpen","moveBlocksToPosition","unlockWidgetSaving","lockName","lockWidgetSaving"],"sources":["@wordpress/edit-widgets/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { transformBlockToWidget } from './transformers';\nimport {\n\tbuildWidgetAreaPostId,\n\tbuildWidgetAreasQuery,\n\tcreateStubPost,\n\tKIND,\n\tPOST_TYPE,\n\tWIDGET_AREA_ENTITY_TYPE,\n} from './utils';\nimport { STORE_NAME as editWidgetsStoreName } from './constants';\n\n/**\n * Persists a stub post with given ID to core data store. The post is meant to be in-memory only and\n * shouldn't be saved via the API.\n *\n * @param {string} id Post ID.\n * @param {Array} blocks Blocks the post should consist of.\n * @return {Object} The post object.\n */\nexport const persistStubPost =\n\t( id, blocks ) =>\n\t( { registry } ) => {\n\t\tconst stubPost = createStubPost( id, blocks );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tstubPost,\n\t\t\t\t{ id: stubPost.id },\n\t\t\t\tfalse\n\t\t\t);\n\t\treturn stubPost;\n\t};\n\n/**\n * Converts all the blocks from edited widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * Creates a snackbar notice on either success or error.\n *\n * @return {Function} An action creator.\n */\nexport const saveEditedWidgetAreas =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst editedWidgetAreas = select.getEditedWidgetAreas();\n\t\tif ( ! editedWidgetAreas?.length ) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait dispatch.saveWidgetAreas( editedWidgetAreas );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( __( 'Widgets saved.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice(\n\t\t\t\t/* translators: %s: The error message. */\n\t\t\t\tsprintf( __( 'There was an error. %s' ), e.message ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from specified widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {Object[]} widgetAreas Widget areas to save.\n * @return {Function} An action creator.\n */\nexport const saveWidgetAreas =\n\t( widgetAreas ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\ttry {\n\t\t\tfor ( const widgetArea of widgetAreas ) {\n\t\t\t\tawait dispatch.saveWidgetArea( widgetArea.id );\n\t\t\t}\n\t\t} finally {\n\t\t\t// saveEditedEntityRecord resets the resolution status, let's fix it manually.\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.finishResolution(\n\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\tKIND,\n\t\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\t\tbuildWidgetAreasQuery()\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from a widget area specified by ID into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {string} widgetAreaId ID of the widget area to process.\n * @return {Function} An action creator.\n */\nexport const saveWidgetArea =\n\t( widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst widgets = select.getWidgets();\n\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tbuildWidgetAreaPostId( widgetAreaId )\n\t\t\t);\n\n\t\t// Get all widgets from this area\n\t\tconst areaWidgets = Object.values( widgets ).filter(\n\t\t\t( { sidebar } ) => sidebar === widgetAreaId\n\t\t);\n\n\t\t// Remove all duplicate reference widget instances for legacy widgets.\n\t\t// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget\n\t\t// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to\n\t\t// save multiple instances of these in different sidebars you will run into undefined behaviors.\n\t\tconst usedReferenceWidgets = [];\n\t\tconst widgetsBlocks = post.blocks.filter( ( block ) => {\n\t\t\tconst { id } = block.attributes;\n\n\t\t\tif ( block.name === 'core/legacy-widget' && id ) {\n\t\t\t\tif ( usedReferenceWidgets.includes( id ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tusedReferenceWidgets.push( id );\n\t\t\t}\n\t\t\treturn true;\n\t\t} );\n\n\t\t// Determine which widgets have been deleted. We can tell if a widget is\n\t\t// deleted and not just moved to a different area by looking to see if\n\t\t// getWidgetAreaForWidgetId() finds something.\n\t\tconst deletedWidgets = [];\n\t\tfor ( const widget of areaWidgets ) {\n\t\t\tconst widgetsNewArea = select.getWidgetAreaForWidgetId( widget.id );\n\t\t\tif ( ! widgetsNewArea ) {\n\t\t\t\tdeletedWidgets.push( widget );\n\t\t\t}\n\t\t}\n\n\t\tconst batchMeta = [];\n\t\tconst batchTasks = [];\n\t\tconst sidebarWidgetsIds = [];\n\t\tfor ( let i = 0; i < widgetsBlocks.length; i++ ) {\n\t\t\tconst block = widgetsBlocks[ i ];\n\t\t\tconst widgetId = getWidgetIdFromBlock( block );\n\t\t\tconst oldWidget = widgets[ widgetId ];\n\t\t\tconst widget = transformBlockToWidget( block, oldWidget );\n\n\t\t\t// We'll replace the null widgetId after save, but we track it here\n\t\t\t// since order is important.\n\t\t\tsidebarWidgetsIds.push( widgetId );\n\n\t\t\t// Check oldWidget as widgetId might refer to an ID which has been\n\t\t\t// deleted, e.g. if a deleted block is restored via undo after saving.\n\t\t\tif ( oldWidget ) {\n\t\t\t\t// Update an existing widget.\n\t\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'widget',\n\t\t\t\t\twidgetId,\n\t\t\t\t\t{\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t},\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\n\t\t\t\tconst hasEdits = registry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.hasEditsForEntityRecord( 'root', 'widget', widgetId );\n\n\t\t\t\tif ( ! hasEdits ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbatchTasks.push( ( { saveEditedEntityRecord } ) =>\n\t\t\t\t\tsaveEditedEntityRecord( 'root', 'widget', widgetId )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Create a new widget.\n\t\t\t\tbatchTasks.push( ( { saveEntityRecord } ) =>\n\t\t\t\t\tsaveEntityRecord( 'root', 'widget', {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbatchMeta.push( {\n\t\t\t\tblock,\n\t\t\t\tposition: i,\n\t\t\t\tclientId: block.clientId,\n\t\t\t} );\n\t\t}\n\t\tfor ( const widget of deletedWidgets ) {\n\t\t\tbatchTasks.push( ( { deleteEntityRecord } ) =>\n\t\t\t\tdeleteEntityRecord( 'root', 'widget', widget.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tconst records = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.__experimentalBatch( batchTasks );\n\t\tconst preservedRecords = records.filter(\n\t\t\t( record ) => ! record.hasOwnProperty( 'deleted' )\n\t\t);\n\n\t\tconst failedWidgetNames = [];\n\n\t\tfor ( let i = 0; i < preservedRecords.length; i++ ) {\n\t\t\tconst widget = preservedRecords[ i ];\n\t\t\tconst { block, position } = batchMeta[ i ];\n\n\t\t\t// Set __internalWidgetId on the block. This will be persisted to the\n\t\t\t// store when we dispatch receiveEntityRecords( post ) below.\n\t\t\tpost.blocks[ position ].attributes.__internalWidgetId = widget.id;\n\n\t\t\tconst error = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError( 'root', 'widget', widget.id );\n\t\t\tif ( error ) {\n\t\t\t\tfailedWidgetNames.push( block.attributes?.name || block?.name );\n\t\t\t}\n\n\t\t\tif ( ! sidebarWidgetsIds[ position ] ) {\n\t\t\t\tsidebarWidgetsIds[ position ] = widget.id;\n\t\t\t}\n\t\t}\n\n\t\tif ( failedWidgetNames.length ) {\n\t\t\tthrow new Error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: List of widget names */\n\t\t\t\t\t__( 'Could not save the following widgets: %s.' ),\n\t\t\t\t\tfailedWidgetNames.join( ', ' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\tKIND,\n\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\twidgetAreaId,\n\t\t\t{\n\t\t\t\twidgets: sidebarWidgetsIds,\n\t\t\t},\n\t\t\t{ undoIgnore: true }\n\t\t);\n\n\t\tdispatch( trySaveWidgetArea( widgetAreaId ) );\n\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords( KIND, POST_TYPE, post, undefined );\n\t};\n\nconst trySaveWidgetArea =\n\t( widgetAreaId ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\twidgetAreaId,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Sets the clientId stored for a particular widgetId.\n *\n * @param {number} clientId Client id.\n * @param {number} widgetId Widget id.\n *\n * @return {Object} Action.\n */\nexport function setWidgetIdForClientId( clientId, widgetId ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_ID_FOR_CLIENT_ID',\n\t\tclientId,\n\t\twidgetId,\n\t};\n}\n\n/**\n * Sets the open state of all the widget areas.\n *\n * @param {Object} widgetAreasOpenState The open states of all the widget areas.\n *\n * @return {Object} Action.\n */\nexport function setWidgetAreasOpenState( widgetAreasOpenState ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_AREAS_OPEN_STATE',\n\t\twidgetAreasOpenState,\n\t};\n}\n\n/**\n * Sets the open state of the widget area.\n *\n * @param {string} clientId The clientId of the widget area.\n * @param {boolean} isOpen Whether the widget area should be opened.\n *\n * @return {Object} Action.\n */\nexport function setIsWidgetAreaOpen( clientId, isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_WIDGET_AREA_OPEN',\n\t\tclientId,\n\t\tisOpen,\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 *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\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 * Returns an action object signalling that the user closed the sidebar.\n *\n * @return {Object} Action creator.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editWidgetsStoreName );\n\t};\n\n/**\n * Action that handles moving a block between widget areas\n *\n * @param {string} clientId The clientId of the block to move.\n * @param {string} widgetAreaId The id of the widget area to move the block to.\n */\nexport const moveBlockToWidgetArea =\n\t( clientId, widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst sourceRootClientId = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockRootClientId( clientId );\n\n\t\t// Search the top level blocks (widget areas) for the one with the matching\n\t\t// id attribute. Makes the assumption that all top-level blocks are widget\n\t\t// areas.\n\t\tconst widgetAreas = registry.select( blockEditorStore ).getBlocks();\n\t\tconst destinationWidgetAreaBlock = widgetAreas.find(\n\t\t\t( { attributes } ) => attributes.id === widgetAreaId\n\t\t);\n\t\tconst destinationRootClientId = destinationWidgetAreaBlock.clientId;\n\n\t\t// Get the index for moving to the end of the destination widget area.\n\t\tconst destinationInnerBlocksClientIds = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockOrder( destinationRootClientId );\n\t\tconst destinationIndex = destinationInnerBlocksClientIds.length;\n\n\t\t// Reveal the widget area, if it's not open.\n\t\tconst isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(\n\t\t\tdestinationRootClientId\n\t\t);\n\n\t\tif ( ! isDestinationWidgetAreaOpen ) {\n\t\t\tdispatch.setIsWidgetAreaOpen( destinationRootClientId, true );\n\t\t}\n\n\t\t// Move the block.\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.moveBlocksToPosition(\n\t\t\t\t[ clientId ],\n\t\t\t\tsourceRootClientId,\n\t\t\t\tdestinationRootClientId,\n\t\t\t\tdestinationIndex\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used to signal that widget saving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```js\n * import { store as widgetStore } from '@wordpress/edit-widgets';\n * import { useDispatch } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * \tconst { unlockWidgetSaving } = useDispatch( widgetStore );\n * \treturn (\n * \t\t<Button onClick={ () => unlockWidgetSaving( 'lockName' ) }>\n * \t\t\t{ __( 'Unlock Widget Saving' ) }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockWidgetSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_WIDGET_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that widget saving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```js\n * import { store as widgetStore } from '@wordpress/edit-widgets';\n * import { useDispatch } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * \tconst { lockWidgetSaving } = useDispatch( widgetStore );\n * \treturn (\n * \t\t<Button onClick={ () => lockWidgetSaving( 'lockName' ) }>\n * \t\t\t{ __( 'Lock Widget Saving' ) }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockWidgetSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_WIDGET_SAVING',\n\t\tlockName,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA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E8F,kBAAiB,CAAC,CAC5BW,oBAAoB,CACpB,CAAE1C,QAAQ,CAAE,EACZ8B,kBAAkB,EAClBM,uBAAuB,EACvBG,gBACD,CAAC;AACH,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArBAjG,OAAA,CAAAuF,qBAAA,GAAAA,qBAAA;AAsBO,SAASc,kBAAkBA,CAAEC,QAAQ,EAAG;EAC9C,OAAO;IACN5F,IAAI,EAAE,sBAAsB;IAC5B4F;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAED,QAAQ,EAAG;EAC5C,OAAO;IACN5F,IAAI,EAAE,oBAAoB;IAC1B4F;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/actions.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { transformBlockToWidget } from './transformers';\nimport {\n\tbuildWidgetAreaPostId,\n\tbuildWidgetAreasQuery,\n\tcreateStubPost,\n\tKIND,\n\tPOST_TYPE,\n\tWIDGET_AREA_ENTITY_TYPE,\n} from './utils';\nimport { STORE_NAME as editWidgetsStoreName } from './constants';\n\n/**\n * Persists a stub post with given ID to core data store. The post is meant to be in-memory only and\n * shouldn't be saved via the API.\n *\n * @param {string} id Post ID.\n * @param {Array} blocks Blocks the post should consist of.\n * @return {Object} The post object.\n */\nexport const persistStubPost =\n\t( id, blocks ) =>\n\t( { registry } ) => {\n\t\tconst stubPost = createStubPost( id, blocks );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tstubPost,\n\t\t\t\t{ id: stubPost.id },\n\t\t\t\tfalse\n\t\t\t);\n\t\treturn stubPost;\n\t};\n\n/**\n * Converts all the blocks from edited widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * Creates a snackbar notice on either success or error.\n *\n * @return {Function} An action creator.\n */\nexport const saveEditedWidgetAreas =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst editedWidgetAreas = select.getEditedWidgetAreas();\n\t\tif ( ! editedWidgetAreas?.length ) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait dispatch.saveWidgetAreas( editedWidgetAreas );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( __( 'Widgets saved.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice(\n\t\t\t\t/* translators: %s: The error message. */\n\t\t\t\tsprintf( __( 'There was an error. %s' ), e.message ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from specified widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {Object[]} widgetAreas Widget areas to save.\n * @return {Function} An action creator.\n */\nexport const saveWidgetAreas =\n\t( widgetAreas ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\ttry {\n\t\t\tfor ( const widgetArea of widgetAreas ) {\n\t\t\t\tawait dispatch.saveWidgetArea( widgetArea.id );\n\t\t\t}\n\t\t} finally {\n\t\t\t// saveEditedEntityRecord resets the resolution status, let's fix it manually.\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.finishResolution(\n\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\tKIND,\n\t\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\t\tbuildWidgetAreasQuery()\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from a widget area specified by ID into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {string} widgetAreaId ID of the widget area to process.\n * @return {Function} An action creator.\n */\nexport const saveWidgetArea =\n\t( widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst widgets = select.getWidgets();\n\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tbuildWidgetAreaPostId( widgetAreaId )\n\t\t\t);\n\n\t\t// Get all widgets from this area\n\t\tconst areaWidgets = Object.values( widgets ).filter(\n\t\t\t( { sidebar } ) => sidebar === widgetAreaId\n\t\t);\n\n\t\t// Remove all duplicate reference widget instances for legacy widgets.\n\t\t// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget\n\t\t// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to\n\t\t// save multiple instances of these in different sidebars you will run into undefined behaviors.\n\t\tconst usedReferenceWidgets = [];\n\t\tconst widgetsBlocks = post.blocks.filter( ( block ) => {\n\t\t\tconst { id } = block.attributes;\n\n\t\t\tif ( block.name === 'core/legacy-widget' && id ) {\n\t\t\t\tif ( usedReferenceWidgets.includes( id ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tusedReferenceWidgets.push( id );\n\t\t\t}\n\t\t\treturn true;\n\t\t} );\n\n\t\t// Determine which widgets have been deleted. We can tell if a widget is\n\t\t// deleted and not just moved to a different area by looking to see if\n\t\t// getWidgetAreaForWidgetId() finds something.\n\t\tconst deletedWidgets = [];\n\t\tfor ( const widget of areaWidgets ) {\n\t\t\tconst widgetsNewArea = select.getWidgetAreaForWidgetId( widget.id );\n\t\t\tif ( ! widgetsNewArea ) {\n\t\t\t\tdeletedWidgets.push( widget );\n\t\t\t}\n\t\t}\n\n\t\tconst batchMeta = [];\n\t\tconst batchTasks = [];\n\t\tconst sidebarWidgetsIds = [];\n\t\tfor ( let i = 0; i < widgetsBlocks.length; i++ ) {\n\t\t\tconst block = widgetsBlocks[ i ];\n\t\t\tconst widgetId = getWidgetIdFromBlock( block );\n\t\t\tconst oldWidget = widgets[ widgetId ];\n\t\t\tconst widget = transformBlockToWidget( block, oldWidget );\n\n\t\t\t// We'll replace the null widgetId after save, but we track it here\n\t\t\t// since order is important.\n\t\t\tsidebarWidgetsIds.push( widgetId );\n\n\t\t\t// Check oldWidget as widgetId might refer to an ID which has been\n\t\t\t// deleted, e.g. if a deleted block is restored via undo after saving.\n\t\t\tif ( oldWidget ) {\n\t\t\t\t// Update an existing widget.\n\t\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'widget',\n\t\t\t\t\twidgetId,\n\t\t\t\t\t{\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t},\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\n\t\t\t\tconst hasEdits = registry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.hasEditsForEntityRecord( 'root', 'widget', widgetId );\n\n\t\t\t\tif ( ! hasEdits ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbatchTasks.push( ( { saveEditedEntityRecord } ) =>\n\t\t\t\t\tsaveEditedEntityRecord( 'root', 'widget', widgetId )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Create a new widget.\n\t\t\t\tbatchTasks.push( ( { saveEntityRecord } ) =>\n\t\t\t\t\tsaveEntityRecord( 'root', 'widget', {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbatchMeta.push( {\n\t\t\t\tblock,\n\t\t\t\tposition: i,\n\t\t\t\tclientId: block.clientId,\n\t\t\t} );\n\t\t}\n\t\tfor ( const widget of deletedWidgets ) {\n\t\t\tbatchTasks.push( ( { deleteEntityRecord } ) =>\n\t\t\t\tdeleteEntityRecord( 'root', 'widget', widget.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tconst records = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.__experimentalBatch( batchTasks );\n\t\tconst preservedRecords = records.filter(\n\t\t\t( record ) => ! record.hasOwnProperty( 'deleted' )\n\t\t);\n\n\t\tconst failedWidgetNames = [];\n\n\t\tfor ( let i = 0; i < preservedRecords.length; i++ ) {\n\t\t\tconst widget = preservedRecords[ i ];\n\t\t\tconst { block, position } = batchMeta[ i ];\n\n\t\t\t// Set __internalWidgetId on the block. This will be persisted to the\n\t\t\t// store when we dispatch receiveEntityRecords( post ) below.\n\t\t\tpost.blocks[ position ].attributes.__internalWidgetId = widget.id;\n\n\t\t\tconst error = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError( 'root', 'widget', widget.id );\n\t\t\tif ( error ) {\n\t\t\t\tfailedWidgetNames.push( block.attributes?.name || block?.name );\n\t\t\t}\n\n\t\t\tif ( ! sidebarWidgetsIds[ position ] ) {\n\t\t\t\tsidebarWidgetsIds[ position ] = widget.id;\n\t\t\t}\n\t\t}\n\n\t\tif ( failedWidgetNames.length ) {\n\t\t\tthrow new Error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: List of widget names */\n\t\t\t\t\t__( 'Could not save the following widgets: %s.' ),\n\t\t\t\t\tfailedWidgetNames.join( ', ' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\tKIND,\n\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\twidgetAreaId,\n\t\t\t{\n\t\t\t\twidgets: sidebarWidgetsIds,\n\t\t\t},\n\t\t\t{ undoIgnore: true }\n\t\t);\n\n\t\tdispatch( trySaveWidgetArea( widgetAreaId ) );\n\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords( KIND, POST_TYPE, post, undefined );\n\t};\n\nconst trySaveWidgetArea =\n\t( widgetAreaId ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\twidgetAreaId,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Sets the clientId stored for a particular widgetId.\n *\n * @param {number} clientId Client id.\n * @param {number} widgetId Widget id.\n *\n * @return {Object} Action.\n */\nexport function setWidgetIdForClientId( clientId, widgetId ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_ID_FOR_CLIENT_ID',\n\t\tclientId,\n\t\twidgetId,\n\t};\n}\n\n/**\n * Sets the open state of all the widget areas.\n *\n * @param {Object} widgetAreasOpenState The open states of all the widget areas.\n *\n * @return {Object} Action.\n */\nexport function setWidgetAreasOpenState( widgetAreasOpenState ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_AREAS_OPEN_STATE',\n\t\twidgetAreasOpenState,\n\t};\n}\n\n/**\n * Sets the open state of the widget area.\n *\n * @param {string} clientId The clientId of the widget area.\n * @param {boolean} isOpen Whether the widget area should be opened.\n *\n * @return {Object} Action.\n */\nexport function setIsWidgetAreaOpen( clientId, isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_WIDGET_AREA_OPEN',\n\t\tclientId,\n\t\tisOpen,\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 *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\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 * Returns an action object signalling that the user closed the sidebar.\n *\n * @return {Object} Action creator.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editWidgetsStoreName );\n\t};\n\n/**\n * Action that handles moving a block between widget areas\n *\n * @param {string} clientId The clientId of the block to move.\n * @param {string} widgetAreaId The id of the widget area to move the block to.\n */\nexport const moveBlockToWidgetArea =\n\t( clientId, widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst sourceRootClientId = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockRootClientId( clientId );\n\n\t\t// Search the top level blocks (widget areas) for the one with the matching\n\t\t// id attribute. Makes the assumption that all top-level blocks are widget\n\t\t// areas.\n\t\tconst widgetAreas = registry.select( blockEditorStore ).getBlocks();\n\t\tconst destinationWidgetAreaBlock = widgetAreas.find(\n\t\t\t( { attributes } ) => attributes.id === widgetAreaId\n\t\t);\n\t\tconst destinationRootClientId = destinationWidgetAreaBlock.clientId;\n\n\t\t// Get the index for moving to the end of the destination widget area.\n\t\tconst destinationInnerBlocksClientIds = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockOrder( destinationRootClientId );\n\t\tconst destinationIndex = destinationInnerBlocksClientIds.length;\n\n\t\t// Reveal the widget area, if it's not open.\n\t\tconst isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(\n\t\t\tdestinationRootClientId\n\t\t);\n\n\t\tif ( ! isDestinationWidgetAreaOpen ) {\n\t\t\tdispatch.setIsWidgetAreaOpen( destinationRootClientId, true );\n\t\t}\n\n\t\t// Move the block.\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.moveBlocksToPosition(\n\t\t\t\t[ clientId ],\n\t\t\t\tsourceRootClientId,\n\t\t\t\tdestinationRootClientId,\n\t\t\t\tdestinationIndex\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used to signal that widget saving is unlocked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```js\n * import { store as widgetStore } from '@wordpress/edit-widgets';\n * import { useDispatch } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * \tconst { unlockWidgetSaving } = useDispatch( widgetStore );\n * \treturn (\n * \t\t<Button onClick={ () => unlockWidgetSaving( 'lockName' ) }>\n * \t\t\t{ __( 'Unlock Widget Saving' ) }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockWidgetSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_WIDGET_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that widget saving is locked.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```js\n * import { store as widgetStore } from '@wordpress/edit-widgets';\n * import { useDispatch } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * \tconst { lockWidgetSaving } = useDispatch( widgetStore );\n * \treturn (\n * \t\t<Button onClick={ () => lockWidgetSaving( 'lockName' ) }>\n * \t\t\t{ __( 'Lock Widget Saving' ) }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockWidgetSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_WIDGET_SAVING',\n\t\tlockName,\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;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,UAAqB;AAClD;AAQM,MAAM,wBACZ,CAAE,UAAU,iBACZ,OAAQ,EAAE,UAAU,QAAQ,SAAS,MAAO;AAC3C,QAAM,qBAAqB,SACzB,OAAQ,oBAAAC,KAAiB,EACzB,qBAAsB,QAAS;AAKjC,QAAM,cAAc,SAAS,OAAQ,oBAAAA,KAAiB,EAAE,UAAU;AAClE,QAAM,6BAA6B,YAAY;AAAA,IAC9C,CAAE,EAAE,WAAW,MAAO,WAAW,OAAO;AAAA,EACzC;AACA,QAAM,0BAA0B,2BAA2B;AAG3D,QAAM,kCAAkC,SACtC,OAAQ,oBAAAA,KAAiB,EACzB,cAAe,uBAAwB;AACzC,QAAM,mBAAmB,gCAAgC;AAGzD,QAAM,8BAA8B,OAAO;AAAA,IAC1C;AAAA,EACD;AAEA,MAAK,CAAE,6BAA8B;AACpC,aAAS,oBAAqB,yBAAyB,IAAK;AAAA,EAC7D;AAGA,WACE,SAAU,oBAAAA,KAAiB,EAC3B;AAAA,IACA,CAAE,QAAS;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACF;AAwBM,SAAS,mBAAoB,UAAW;AAC9C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAwBO,SAAS,iBAAkB,UAAW;AAC5C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
6
+ "names": ["coreStore", "noticesStore", "interfaceStore", "editWidgetsStoreName", "blockEditorStore"]
7
+ }
@@ -1,11 +1,28 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var constants_exports = {};
19
+ __export(constants_exports, {
20
+ STORE_NAME: () => STORE_NAME
5
21
  });
6
- exports.STORE_NAME = void 0;
7
- /**
8
- * Module Constants
9
- */
10
- const STORE_NAME = exports.STORE_NAME = 'core/edit-widgets';
11
- //# sourceMappingURL=constants.js.map
22
+ module.exports = __toCommonJS(constants_exports);
23
+ const STORE_NAME = "core/edit-widgets";
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ STORE_NAME
27
+ });
28
+ //# sourceMappingURL=constants.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/edit-widgets/src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/edit-widgets';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,mBAAmB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/constants.js"],
4
+ "sourcesContent": ["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/edit-widgets';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,aAAa;",
6
+ "names": []
7
+ }
@@ -1,61 +1,61 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var store_exports = {};
29
+ __export(store_exports, {
30
+ store: () => store
6
31
  });
7
- exports.store = void 0;
8
- var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
9
- var _data = require("@wordpress/data");
10
- var _reducer = _interopRequireDefault(require("./reducer"));
11
- var resolvers = _interopRequireWildcard(require("./resolvers"));
12
- var selectors = _interopRequireWildcard(require("./selectors"));
13
- var actions = _interopRequireWildcard(require("./actions"));
14
- var privateSelectors = _interopRequireWildcard(require("./private-selectors"));
15
- var _constants = require("./constants");
16
- var _lockUnlock = require("../lock-unlock");
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
- /**
20
- * WordPress dependencies
21
- */
22
-
23
- /**
24
- * Internal dependencies
25
- */
26
-
27
- /**
28
- * Block editor data store configuration.
29
- *
30
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
31
- *
32
- * @type {Object}
33
- */
32
+ module.exports = __toCommonJS(store_exports);
33
+ var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
34
+ var import_data = require("@wordpress/data");
35
+ var import_reducer = __toESM(require("./reducer"));
36
+ var resolvers = __toESM(require("./resolvers"));
37
+ var selectors = __toESM(require("./selectors"));
38
+ var actions = __toESM(require("./actions"));
39
+ var privateSelectors = __toESM(require("./private-selectors"));
40
+ var import_constants = require("./constants");
41
+ var import_lock_unlock = require("../lock-unlock");
34
42
  const storeConfig = {
35
- reducer: _reducer.default,
43
+ reducer: import_reducer.default,
36
44
  selectors,
37
45
  resolvers,
38
46
  actions
39
47
  };
40
-
41
- /**
42
- * Store definition for the edit widgets namespace.
43
- *
44
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
45
- *
46
- * @type {Object}
47
- */
48
- const store = exports.store = (0, _data.createReduxStore)(_constants.STORE_NAME, storeConfig);
49
- (0, _data.register)(store);
50
-
51
- // This package uses a few in-memory post types as wrappers for convenience.
52
- // This middleware prevents any network requests related to these types as they are
53
- // bound to fail anyway.
54
- _apiFetch.default.use(function (options, next) {
55
- if (options.path?.indexOf('/wp/v2/types/widget-area') === 0) {
48
+ const store = (0, import_data.createReduxStore)(import_constants.STORE_NAME, storeConfig);
49
+ (0, import_data.register)(store);
50
+ import_api_fetch.default.use(function(options, next) {
51
+ if (options.path?.indexOf("/wp/v2/types/widget-area") === 0) {
56
52
  return Promise.resolve({});
57
53
  }
58
54
  return next(options);
59
55
  });
60
- (0, _lockUnlock.unlock)(store).registerPrivateSelectors(privateSelectors);
61
- //# sourceMappingURL=index.js.map
56
+ (0, import_lock_unlock.unlock)(store).registerPrivateSelectors(privateSelectors);
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ store
60
+ });
61
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_data","_reducer","resolvers","_interopRequireWildcard","selectors","actions","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","storeConfig","reducer","store","exports","createReduxStore","STORE_NAME","register","apiFetch","use","options","next","path","indexOf","Promise","resolve","unlock","registerPrivateSelectors"],"sources":["@wordpress/edit-widgets/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as resolvers from './resolvers';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tresolvers,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n\n// This package uses a few in-memory post types as wrappers for convenience.\n// This middleware prevents any network requests related to these types as they are\n// bound to fail anyway.\napiFetch.use( function ( options, next ) {\n\tif ( options.path?.indexOf( '/wp/v2/types/widget-area' ) === 0 ) {\n\t\treturn Promise.resolve( {} );\n\t}\n\n\treturn next( options );\n} );\n\nunlock( store ).registerPrivateSelectors( privateSelectors );\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,OAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAAwC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,C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3
+ "sources": ["../../src/store/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as resolvers from './resolvers';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tresolvers,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n\n// This package uses a few in-memory post types as wrappers for convenience.\n// This middleware prevents any network requests related to these types as they are\n// bound to fail anyway.\napiFetch.use( function ( options, next ) {\n\tif ( options.path?.indexOf( '/wp/v2/types/widget-area' ) === 0 ) {\n\t\treturn Promise.resolve( {} );\n\t}\n\n\treturn next( options );\n} );\n\nunlock( store ).registerPrivateSelectors( privateSelectors );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqB;AACrB,kBAA2C;AAK3C,qBAAoB;AACpB,gBAA2B;AAC3B,gBAA2B;AAC3B,cAAyB;AACzB,uBAAkC;AAClC,uBAA2B;AAC3B,yBAAuB;AASvB,MAAM,cAAc;AAAA,EACnB,wBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AASO,MAAM,YAAQ,8BAAkB,6BAAY,WAAY;AAAA,IAC/D,sBAAU,KAAM;AAKhB,iBAAAC,QAAS,IAAK,SAAW,SAAS,MAAO;AACxC,MAAK,QAAQ,MAAM,QAAS,0BAA2B,MAAM,GAAI;AAChE,WAAO,QAAQ,QAAS,CAAC,CAAE;AAAA,EAC5B;AAEA,SAAO,KAAM,OAAQ;AACtB,CAAE;AAAA,IAEF,2BAAQ,KAAM,EAAE,yBAA0B,gBAAiB;",
6
+ "names": ["reducer", "apiFetch"]
7
+ }
@@ -1,14 +1,35 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var private_selectors_exports = {};
19
+ __export(private_selectors_exports, {
20
+ getInserterSidebarToggleRef: () => getInserterSidebarToggleRef,
21
+ getListViewToggleRef: () => getListViewToggleRef
5
22
  });
6
- exports.getInserterSidebarToggleRef = getInserterSidebarToggleRef;
7
- exports.getListViewToggleRef = getListViewToggleRef;
23
+ module.exports = __toCommonJS(private_selectors_exports);
8
24
  function getListViewToggleRef(state) {
9
25
  return state.listViewToggleRef;
10
26
  }
11
27
  function getInserterSidebarToggleRef(state) {
12
28
  return state.inserterSidebarToggleRef;
13
29
  }
14
- //# sourceMappingURL=private-selectors.js.map
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ getInserterSidebarToggleRef,
33
+ getListViewToggleRef
34
+ });
35
+ //# sourceMappingURL=private-selectors.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["getListViewToggleRef","state","listViewToggleRef","getInserterSidebarToggleRef","inserterSidebarToggleRef"],"sources":["@wordpress/edit-widgets/src/store/private-selectors.js"],"sourcesContent":["export function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,oBAAoBA,CAAEC,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACC,iBAAiB;AAC/B;AAEO,SAASC,2BAA2BA,CAAEF,KAAK,EAAG;EACpD,OAAOA,KAAK,CAACG,wBAAwB;AACtC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/private-selectors.js"],
4
+ "sourcesContent": ["export function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,qBAAsB,OAAQ;AAC7C,SAAO,MAAM;AACd;AAEO,SAAS,4BAA6B,OAAQ;AACpD,SAAO,MAAM;AACd;",
6
+ "names": []
7
+ }
@@ -1,148 +1,95 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var reducer_exports = {};
19
+ __export(reducer_exports, {
20
+ blockInserterPanel: () => blockInserterPanel,
21
+ default: () => reducer_default,
22
+ inserterSidebarToggleRef: () => inserterSidebarToggleRef,
23
+ listViewPanel: () => listViewPanel,
24
+ listViewToggleRef: () => listViewToggleRef,
25
+ widgetAreasOpenState: () => widgetAreasOpenState,
26
+ widgetSavingLock: () => widgetSavingLock
5
27
  });
6
- exports.blockInserterPanel = blockInserterPanel;
7
- exports.default = void 0;
8
- exports.inserterSidebarToggleRef = inserterSidebarToggleRef;
9
- exports.listViewPanel = listViewPanel;
10
- exports.listViewToggleRef = listViewToggleRef;
11
- exports.widgetAreasOpenState = widgetAreasOpenState;
12
- exports.widgetSavingLock = widgetSavingLock;
13
- var _data = require("@wordpress/data");
14
- /**
15
- * WordPress dependencies
16
- */
17
-
18
- /**
19
- * Controls the open state of the widget areas.
20
- *
21
- * @param {Object} state Redux state.
22
- * @param {Object} action Redux action.
23
- *
24
- * @return {Array} Updated state.
25
- */
28
+ module.exports = __toCommonJS(reducer_exports);
29
+ var import_data = require("@wordpress/data");
26
30
  function widgetAreasOpenState(state = {}, action) {
27
- const {
28
- type
29
- } = action;
31
+ const { type } = action;
30
32
  switch (type) {
31
- case 'SET_WIDGET_AREAS_OPEN_STATE':
32
- {
33
- return action.widgetAreasOpenState;
34
- }
35
- case 'SET_IS_WIDGET_AREA_OPEN':
36
- {
37
- const {
38
- clientId,
39
- isOpen
40
- } = action;
41
- return {
42
- ...state,
43
- [clientId]: isOpen
44
- };
45
- }
46
- default:
47
- {
48
- return state;
49
- }
33
+ case "SET_WIDGET_AREAS_OPEN_STATE": {
34
+ return action.widgetAreasOpenState;
35
+ }
36
+ case "SET_IS_WIDGET_AREA_OPEN": {
37
+ const { clientId, isOpen } = action;
38
+ return {
39
+ ...state,
40
+ [clientId]: isOpen
41
+ };
42
+ }
43
+ default: {
44
+ return state;
45
+ }
50
46
  }
51
47
  }
52
-
53
- /**
54
- * Reducer to set the block inserter panel open or closed.
55
- *
56
- * Note: this reducer interacts with the list view panel reducer
57
- * to make sure that only one of the two panels is open at the same time.
58
- *
59
- * @param {Object} state Current state.
60
- * @param {Object} action Dispatched action.
61
- */
62
48
  function blockInserterPanel(state = false, action) {
63
49
  switch (action.type) {
64
- case 'SET_IS_LIST_VIEW_OPENED':
50
+ case "SET_IS_LIST_VIEW_OPENED":
65
51
  return action.isOpen ? false : state;
66
- case 'SET_IS_INSERTER_OPENED':
52
+ case "SET_IS_INSERTER_OPENED":
67
53
  return action.value;
68
54
  }
69
55
  return state;
70
56
  }
71
-
72
- /**
73
- * Reducer to set the list view panel open or closed.
74
- *
75
- * Note: this reducer interacts with the inserter panel reducer
76
- * to make sure that only one of the two panels is open at the same time.
77
- *
78
- * @param {Object} state Current state.
79
- * @param {Object} action Dispatched action.
80
- */
81
57
  function listViewPanel(state = false, action) {
82
58
  switch (action.type) {
83
- case 'SET_IS_INSERTER_OPENED':
59
+ case "SET_IS_INSERTER_OPENED":
84
60
  return action.value ? false : state;
85
- case 'SET_IS_LIST_VIEW_OPENED':
61
+ case "SET_IS_LIST_VIEW_OPENED":
86
62
  return action.isOpen;
87
63
  }
88
64
  return state;
89
65
  }
90
-
91
- /**
92
- * This reducer does nothing aside initializing a ref to the list view toggle.
93
- * We will have a unique ref per "editor" instance.
94
- *
95
- * @param {Object} state
96
- * @return {Object} Reference to the list view toggle button.
97
- */
98
- function listViewToggleRef(state = {
99
- current: null
100
- }) {
66
+ function listViewToggleRef(state = { current: null }) {
101
67
  return state;
102
68
  }
103
-
104
- /**
105
- * This reducer does nothing aside initializing a ref to the inserter sidebar toggle.
106
- * We will have a unique ref per "editor" instance.
107
- *
108
- * @param {Object} state
109
- * @return {Object} Reference to the inserter sidebar toggle button.
110
- */
111
- function inserterSidebarToggleRef(state = {
112
- current: null
113
- }) {
69
+ function inserterSidebarToggleRef(state = { current: null }) {
114
70
  return state;
115
71
  }
116
-
117
- /**
118
- * Widget saving lock.
119
- *
120
- * When widget saving is locked, the widget cannot be updated.
121
- *
122
- * @param {Object} state Current state.
123
- * @param {Object} action Dispatched action.
124
- *
125
- * @return {Object} Updated state.
126
- */
127
72
  function widgetSavingLock(state = {}, action) {
128
73
  switch (action.type) {
129
- case 'LOCK_WIDGET_SAVING':
130
- return {
131
- ...state,
132
- [action.lockName]: true
133
- };
134
- case 'UNLOCK_WIDGET_SAVING':
135
- {
136
- const {
137
- [action.lockName]: removedLockName,
138
- ...restState
139
- } = state;
140
- return restState;
141
- }
74
+ case "LOCK_WIDGET_SAVING":
75
+ return { ...state, [action.lockName]: true };
76
+ case "UNLOCK_WIDGET_SAVING": {
77
+ const { [action.lockName]: removedLockName, ...restState } = state;
78
+ return restState;
79
+ }
142
80
  }
143
81
  return state;
144
82
  }
145
- var _default = exports.default = (0, _data.combineReducers)({
83
+ var reducer_default = (0, import_data.combineReducers)({
84
+ blockInserterPanel,
85
+ inserterSidebarToggleRef,
86
+ listViewPanel,
87
+ listViewToggleRef,
88
+ widgetAreasOpenState,
89
+ widgetSavingLock
90
+ });
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
146
93
  blockInserterPanel,
147
94
  inserterSidebarToggleRef,
148
95
  listViewPanel,
@@ -150,4 +97,4 @@ var _default = exports.default = (0, _data.combineReducers)({
150
97
  widgetAreasOpenState,
151
98
  widgetSavingLock
152
99
  });
153
- //# sourceMappingURL=reducer.js.map
100
+ //# sourceMappingURL=reducer.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_data","require","widgetAreasOpenState","state","action","type","clientId","isOpen","blockInserterPanel","value","listViewPanel","listViewToggleRef","current","inserterSidebarToggleRef","widgetSavingLock","lockName","removedLockName","restState","_default","exports","default","combineReducers"],"sources":["@wordpress/edit-widgets/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Controls the open state of the widget areas.\n *\n * @param {Object} state Redux state.\n * @param {Object} action Redux action.\n *\n * @return {Array} Updated state.\n */\nexport function widgetAreasOpenState( state = {}, action ) {\n\tconst { type } = action;\n\tswitch ( type ) {\n\t\tcase 'SET_WIDGET_AREAS_OPEN_STATE': {\n\t\t\treturn action.widgetAreasOpenState;\n\t\t}\n\t\tcase 'SET_IS_WIDGET_AREA_OPEN': {\n\t\t\tconst { clientId, isOpen } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ clientId ]: isOpen,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the list view toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the list view toggle button.\n */\nexport function listViewToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the inserter sidebar toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the inserter sidebar toggle button.\n */\nexport function inserterSidebarToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\n/**\n * Widget saving lock.\n *\n * When widget saving is locked, the widget cannot be updated.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function widgetSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_WIDGET_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_WIDGET_SAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n\tinserterSidebarToggleRef,\n\tlistViewPanel,\n\tlistViewToggleRef,\n\twidgetAreasOpenState,\n\twidgetSavingLock,\n} );\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGD,MAAM;EACvB,QAASC,IAAI;IACZ,KAAK,6BAA6B;MAAE;QACnC,OAAOD,MAAM,CAACF,oBAAoB;MACnC;IACA,KAAK,yBAAyB;MAAE;QAC/B,MAAM;UAAEI,QAAQ;UAAEC;QAAO,CAAC,GAAGH,MAAM;QACnC,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,QAAQ,GAAIC;QACf,CAAC;MACF;IACA;MAAS;QACR,OAAOJ,KAAK;MACb;EACD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AAC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c,SAAS;MACjB;EACD;EAEA,OAAOd,KAAK;AACb;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/Bb,kBAAkB;EAClBK,wBAAwB;EACxBH,aAAa;EACbC,iBAAiB;EACjBT,oBAAoB;EACpBY;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/reducer.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Controls the open state of the widget areas.\n *\n * @param {Object} state Redux state.\n * @param {Object} action Redux action.\n *\n * @return {Array} Updated state.\n */\nexport function widgetAreasOpenState( state = {}, action ) {\n\tconst { type } = action;\n\tswitch ( type ) {\n\t\tcase 'SET_WIDGET_AREAS_OPEN_STATE': {\n\t\t\treturn action.widgetAreasOpenState;\n\t\t}\n\t\tcase 'SET_IS_WIDGET_AREA_OPEN': {\n\t\t\tconst { clientId, isOpen } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ clientId ]: isOpen,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the list view toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the list view toggle button.\n */\nexport function listViewToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the inserter sidebar toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the inserter sidebar toggle button.\n */\nexport function inserterSidebarToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\n/**\n * Widget saving lock.\n *\n * When widget saving is locked, the widget cannot be updated.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function widgetSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_WIDGET_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_WIDGET_SAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n\tinserterSidebarToggleRef,\n\tlistViewPanel,\n\tlistViewToggleRef,\n\twidgetAreasOpenState,\n\twidgetSavingLock,\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAgC;AAUzB,SAAS,qBAAsB,QAAQ,CAAC,GAAG,QAAS;AAC1D,QAAM,EAAE,KAAK,IAAI;AACjB,UAAS,MAAO;AAAA,IACf,KAAK,+BAA+B;AACnC,aAAO,OAAO;AAAA,IACf;AAAA,IACA,KAAK,2B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