@wordpress/widget-dashboard 0.1.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 (443) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE.md +788 -0
  3. package/README.md +241 -0
  4. package/build/components/actions/actions.cjs +265 -0
  5. package/build/components/actions/actions.cjs.map +7 -0
  6. package/build/components/actions/index.cjs +31 -0
  7. package/build/components/actions/index.cjs.map +7 -0
  8. package/build/components/actions-menu/actions-menu.cjs +92 -0
  9. package/build/components/actions-menu/actions-menu.cjs.map +7 -0
  10. package/build/components/actions-menu/index.cjs +31 -0
  11. package/build/components/actions-menu/index.cjs.map +7 -0
  12. package/build/components/commands/commands.cjs +177 -0
  13. package/build/components/commands/commands.cjs.map +7 -0
  14. package/build/components/commands/index.cjs +33 -0
  15. package/build/components/commands/index.cjs.map +7 -0
  16. package/build/components/commands/use-pending-when-edit-mode.cjs +57 -0
  17. package/build/components/commands/use-pending-when-edit-mode.cjs.map +7 -0
  18. package/build/components/layout-settings/index.cjs +31 -0
  19. package/build/components/layout-settings/index.cjs.map +7 -0
  20. package/build/components/layout-settings/layout-model-edit-field/index.cjs +186 -0
  21. package/build/components/layout-settings/layout-model-edit-field/index.cjs.map +7 -0
  22. package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs +53 -0
  23. package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs.map +7 -0
  24. package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs +53 -0
  25. package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs.map +7 -0
  26. package/build/components/layout-settings/layout-settings.cjs +207 -0
  27. package/build/components/layout-settings/layout-settings.cjs.map +7 -0
  28. package/build/components/no-widgets-state/index.cjs +31 -0
  29. package/build/components/no-widgets-state/index.cjs.map +7 -0
  30. package/build/components/no-widgets-state/no-widgets-state.cjs +140 -0
  31. package/build/components/no-widgets-state/no-widgets-state.cjs.map +7 -0
  32. package/build/components/reset-confirmation/index.cjs +31 -0
  33. package/build/components/reset-confirmation/index.cjs.map +7 -0
  34. package/build/components/reset-confirmation/reset-confirmation.cjs +62 -0
  35. package/build/components/reset-confirmation/reset-confirmation.cjs.map +7 -0
  36. package/build/components/widget-chrome/index.cjs +31 -0
  37. package/build/components/widget-chrome/index.cjs.map +7 -0
  38. package/build/components/widget-chrome/widget-chrome.cjs +277 -0
  39. package/build/components/widget-chrome/widget-chrome.cjs.map +7 -0
  40. package/build/components/widget-inserter/index.cjs +31 -0
  41. package/build/components/widget-inserter/index.cjs.map +7 -0
  42. package/build/components/widget-inserter/widget-inserter.cjs +78 -0
  43. package/build/components/widget-inserter/widget-inserter.cjs.map +7 -0
  44. package/build/components/widget-picker/index.cjs +31 -0
  45. package/build/components/widget-picker/index.cjs.map +7 -0
  46. package/build/components/widget-picker/widget-picker.cjs +209 -0
  47. package/build/components/widget-picker/widget-picker.cjs.map +7 -0
  48. package/build/components/widget-render/index.cjs +31 -0
  49. package/build/components/widget-render/index.cjs.map +7 -0
  50. package/build/components/widget-render/widget-render.cjs +62 -0
  51. package/build/components/widget-render/widget-render.cjs.map +7 -0
  52. package/build/components/widget-settings/index.cjs +37 -0
  53. package/build/components/widget-settings/index.cjs.map +7 -0
  54. package/build/components/widget-settings/utils/get-admin-menu-inset.cjs +41 -0
  55. package/build/components/widget-settings/utils/get-admin-menu-inset.cjs.map +7 -0
  56. package/build/components/widget-settings/utils/get-widget-settings.cjs +38 -0
  57. package/build/components/widget-settings/utils/get-widget-settings.cjs.map +7 -0
  58. package/build/components/widget-settings/utils/index.cjs +34 -0
  59. package/build/components/widget-settings/utils/index.cjs.map +7 -0
  60. package/build/components/widget-settings/widget-settings-toolbar.cjs +138 -0
  61. package/build/components/widget-settings/widget-settings-toolbar.cjs.map +7 -0
  62. package/build/components/widget-settings/widget-settings-trigger.cjs +82 -0
  63. package/build/components/widget-settings/widget-settings-trigger.cjs.map +7 -0
  64. package/build/components/widget-settings/widget-settings.cjs +269 -0
  65. package/build/components/widget-settings/widget-settings.cjs.map +7 -0
  66. package/build/components/widget-toolbar/index.cjs +31 -0
  67. package/build/components/widget-toolbar/index.cjs.map +7 -0
  68. package/build/components/widget-toolbar/widget-toolbar.cjs +148 -0
  69. package/build/components/widget-toolbar/widget-toolbar.cjs.map +7 -0
  70. package/build/components/widgets/index.cjs +31 -0
  71. package/build/components/widgets/index.cjs.map +7 -0
  72. package/build/components/widgets/widget-layout-toolbar.cjs +206 -0
  73. package/build/components/widgets/widget-layout-toolbar.cjs.map +7 -0
  74. package/build/components/widgets/widget-resize-handle.cjs +163 -0
  75. package/build/components/widgets/widget-resize-handle.cjs.map +7 -0
  76. package/build/components/widgets/widgets.cjs +277 -0
  77. package/build/components/widgets/widgets.cjs.map +7 -0
  78. package/build/context/dashboard-context.cjs +234 -0
  79. package/build/context/dashboard-context.cjs.map +7 -0
  80. package/build/context/ui-context.cjs +77 -0
  81. package/build/context/ui-context.cjs.map +7 -0
  82. package/build/context/widget-context.cjs +44 -0
  83. package/build/context/widget-context.cjs.map +7 -0
  84. package/build/hooks/use-dashboard-container-column-count.cjs +61 -0
  85. package/build/hooks/use-dashboard-container-column-count.cjs.map +7 -0
  86. package/build/index.cjs +45 -0
  87. package/build/index.cjs.map +7 -0
  88. package/build/lock-unlock.cjs +37 -0
  89. package/build/lock-unlock.cjs.map +7 -0
  90. package/build/types.cjs +31 -0
  91. package/build/types.cjs.map +7 -0
  92. package/build/utils/create-dashboard-widget/create-dashboard-widget.cjs +44 -0
  93. package/build/utils/create-dashboard-widget/create-dashboard-widget.cjs.map +7 -0
  94. package/build/utils/create-dashboard-widget/index.cjs +31 -0
  95. package/build/utils/create-dashboard-widget/index.cjs.map +7 -0
  96. package/build/utils/default-grid/default-grid.cjs +37 -0
  97. package/build/utils/default-grid/default-grid.cjs.map +7 -0
  98. package/build/utils/default-grid/index.cjs +31 -0
  99. package/build/utils/default-grid/index.cjs.map +7 -0
  100. package/build/utils/grid-model-change/grid-model-change.cjs +56 -0
  101. package/build/utils/grid-model-change/grid-model-change.cjs.map +7 -0
  102. package/build/utils/grid-model-change/index.cjs +33 -0
  103. package/build/utils/grid-model-change/index.cjs.map +7 -0
  104. package/build/utils/index.cjs +34 -0
  105. package/build/utils/index.cjs.map +7 -0
  106. package/build/utils/migrate-layout/index.cjs +31 -0
  107. package/build/utils/migrate-layout/index.cjs.map +7 -0
  108. package/build/utils/migrate-layout/migrate-layout.cjs +94 -0
  109. package/build/utils/migrate-layout/migrate-layout.cjs.map +7 -0
  110. package/build/utils/normalize-grid-settings/index.cjs +31 -0
  111. package/build/utils/normalize-grid-settings/index.cjs.map +7 -0
  112. package/build/utils/normalize-grid-settings/normalize-grid-settings.cjs +46 -0
  113. package/build/utils/normalize-grid-settings/normalize-grid-settings.cjs.map +7 -0
  114. package/build/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.cjs +49 -0
  115. package/build/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.cjs.map +7 -0
  116. package/build/utils/row-height-presets/index.cjs +39 -0
  117. package/build/utils/row-height-presets/index.cjs.map +7 -0
  118. package/build/utils/row-height-presets/row-height-presets.cjs +63 -0
  119. package/build/utils/row-height-presets/row-height-presets.cjs.map +7 -0
  120. package/build/widget-dashboard.cjs +86 -0
  121. package/build/widget-dashboard.cjs.map +7 -0
  122. package/build/wordpress-commands.d.cjs +2 -0
  123. package/build/wordpress-commands.d.cjs.map +7 -0
  124. package/build-module/components/actions/actions.mjs +240 -0
  125. package/build-module/components/actions/actions.mjs.map +7 -0
  126. package/build-module/components/actions/index.mjs +6 -0
  127. package/build-module/components/actions/index.mjs.map +7 -0
  128. package/build-module/components/actions-menu/actions-menu.mjs +67 -0
  129. package/build-module/components/actions-menu/actions-menu.mjs.map +7 -0
  130. package/build-module/components/actions-menu/index.mjs +6 -0
  131. package/build-module/components/actions-menu/index.mjs.map +7 -0
  132. package/build-module/components/commands/commands.mjs +160 -0
  133. package/build-module/components/commands/commands.mjs.map +7 -0
  134. package/build-module/components/commands/index.mjs +7 -0
  135. package/build-module/components/commands/index.mjs.map +7 -0
  136. package/build-module/components/commands/use-pending-when-edit-mode.mjs +32 -0
  137. package/build-module/components/commands/use-pending-when-edit-mode.mjs.map +7 -0
  138. package/build-module/components/layout-settings/index.mjs +6 -0
  139. package/build-module/components/layout-settings/index.mjs.map +7 -0
  140. package/build-module/components/layout-settings/layout-model-edit-field/index.mjs +151 -0
  141. package/build-module/components/layout-settings/layout-model-edit-field/index.mjs.map +7 -0
  142. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs +28 -0
  143. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs.map +7 -0
  144. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs +28 -0
  145. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs.map +7 -0
  146. package/build-module/components/layout-settings/layout-settings.mjs +187 -0
  147. package/build-module/components/layout-settings/layout-settings.mjs.map +7 -0
  148. package/build-module/components/no-widgets-state/index.mjs +6 -0
  149. package/build-module/components/no-widgets-state/index.mjs.map +7 -0
  150. package/build-module/components/no-widgets-state/no-widgets-state.mjs +115 -0
  151. package/build-module/components/no-widgets-state/no-widgets-state.mjs.map +7 -0
  152. package/build-module/components/reset-confirmation/index.mjs +6 -0
  153. package/build-module/components/reset-confirmation/index.mjs.map +7 -0
  154. package/build-module/components/reset-confirmation/reset-confirmation.mjs +37 -0
  155. package/build-module/components/reset-confirmation/reset-confirmation.mjs.map +7 -0
  156. package/build-module/components/widget-chrome/index.mjs +6 -0
  157. package/build-module/components/widget-chrome/index.mjs.map +7 -0
  158. package/build-module/components/widget-chrome/widget-chrome.mjs +248 -0
  159. package/build-module/components/widget-chrome/widget-chrome.mjs.map +7 -0
  160. package/build-module/components/widget-inserter/index.mjs +6 -0
  161. package/build-module/components/widget-inserter/index.mjs.map +7 -0
  162. package/build-module/components/widget-inserter/widget-inserter.mjs +53 -0
  163. package/build-module/components/widget-inserter/widget-inserter.mjs.map +7 -0
  164. package/build-module/components/widget-picker/index.mjs +6 -0
  165. package/build-module/components/widget-picker/index.mjs.map +7 -0
  166. package/build-module/components/widget-picker/widget-picker.mjs +184 -0
  167. package/build-module/components/widget-picker/widget-picker.mjs.map +7 -0
  168. package/build-module/components/widget-render/index.mjs +6 -0
  169. package/build-module/components/widget-render/index.mjs.map +7 -0
  170. package/build-module/components/widget-render/widget-render.mjs +37 -0
  171. package/build-module/components/widget-render/widget-render.mjs.map +7 -0
  172. package/build-module/components/widget-settings/index.mjs +10 -0
  173. package/build-module/components/widget-settings/index.mjs.map +7 -0
  174. package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs +16 -0
  175. package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs.map +7 -0
  176. package/build-module/components/widget-settings/utils/get-widget-settings.mjs +13 -0
  177. package/build-module/components/widget-settings/utils/get-widget-settings.mjs.map +7 -0
  178. package/build-module/components/widget-settings/utils/index.mjs +8 -0
  179. package/build-module/components/widget-settings/utils/index.mjs.map +7 -0
  180. package/build-module/components/widget-settings/widget-settings-toolbar.mjs +113 -0
  181. package/build-module/components/widget-settings/widget-settings-toolbar.mjs.map +7 -0
  182. package/build-module/components/widget-settings/widget-settings-trigger.mjs +57 -0
  183. package/build-module/components/widget-settings/widget-settings-trigger.mjs.map +7 -0
  184. package/build-module/components/widget-settings/widget-settings.mjs +244 -0
  185. package/build-module/components/widget-settings/widget-settings.mjs.map +7 -0
  186. package/build-module/components/widget-toolbar/index.mjs +6 -0
  187. package/build-module/components/widget-toolbar/index.mjs.map +7 -0
  188. package/build-module/components/widget-toolbar/widget-toolbar.mjs +113 -0
  189. package/build-module/components/widget-toolbar/widget-toolbar.mjs.map +7 -0
  190. package/build-module/components/widgets/index.mjs +6 -0
  191. package/build-module/components/widgets/index.mjs.map +7 -0
  192. package/build-module/components/widgets/widget-layout-toolbar.mjs +181 -0
  193. package/build-module/components/widgets/widget-layout-toolbar.mjs.map +7 -0
  194. package/build-module/components/widgets/widget-resize-handle.mjs +128 -0
  195. package/build-module/components/widgets/widget-resize-handle.mjs.map +7 -0
  196. package/build-module/components/widgets/widgets.mjs +242 -0
  197. package/build-module/components/widgets/widgets.mjs.map +7 -0
  198. package/build-module/context/dashboard-context.mjs +205 -0
  199. package/build-module/context/dashboard-context.mjs.map +7 -0
  200. package/build-module/context/ui-context.mjs +56 -0
  201. package/build-module/context/ui-context.mjs.map +7 -0
  202. package/build-module/context/widget-context.mjs +18 -0
  203. package/build-module/context/widget-context.mjs.map +7 -0
  204. package/build-module/hooks/use-dashboard-container-column-count.mjs +40 -0
  205. package/build-module/hooks/use-dashboard-container-column-count.mjs.map +7 -0
  206. package/build-module/index.mjs +18 -0
  207. package/build-module/index.mjs.map +7 -0
  208. package/build-module/lock-unlock.mjs +11 -0
  209. package/build-module/lock-unlock.mjs.map +7 -0
  210. package/build-module/types.mjs +6 -0
  211. package/build-module/types.mjs.map +7 -0
  212. package/build-module/utils/create-dashboard-widget/create-dashboard-widget.mjs +19 -0
  213. package/build-module/utils/create-dashboard-widget/create-dashboard-widget.mjs.map +7 -0
  214. package/build-module/utils/create-dashboard-widget/index.mjs +6 -0
  215. package/build-module/utils/create-dashboard-widget/index.mjs.map +7 -0
  216. package/build-module/utils/default-grid/default-grid.mjs +12 -0
  217. package/build-module/utils/default-grid/default-grid.mjs.map +7 -0
  218. package/build-module/utils/default-grid/index.mjs +6 -0
  219. package/build-module/utils/default-grid/index.mjs.map +7 -0
  220. package/build-module/utils/grid-model-change/grid-model-change.mjs +30 -0
  221. package/build-module/utils/grid-model-change/grid-model-change.mjs.map +7 -0
  222. package/build-module/utils/grid-model-change/index.mjs +7 -0
  223. package/build-module/utils/grid-model-change/index.mjs.map +7 -0
  224. package/build-module/utils/index.mjs +8 -0
  225. package/build-module/utils/index.mjs.map +7 -0
  226. package/build-module/utils/migrate-layout/index.mjs +6 -0
  227. package/build-module/utils/migrate-layout/index.mjs.map +7 -0
  228. package/build-module/utils/migrate-layout/migrate-layout.mjs +69 -0
  229. package/build-module/utils/migrate-layout/migrate-layout.mjs.map +7 -0
  230. package/build-module/utils/normalize-grid-settings/index.mjs +6 -0
  231. package/build-module/utils/normalize-grid-settings/index.mjs.map +7 -0
  232. package/build-module/utils/normalize-grid-settings/normalize-grid-settings.mjs +21 -0
  233. package/build-module/utils/normalize-grid-settings/normalize-grid-settings.mjs.map +7 -0
  234. package/build-module/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.mjs +22 -0
  235. package/build-module/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.mjs.map +7 -0
  236. package/build-module/utils/row-height-presets/index.mjs +16 -0
  237. package/build-module/utils/row-height-presets/index.mjs.map +7 -0
  238. package/build-module/utils/row-height-presets/row-height-presets.mjs +34 -0
  239. package/build-module/utils/row-height-presets/row-height-presets.mjs.map +7 -0
  240. package/build-module/widget-dashboard.mjs +61 -0
  241. package/build-module/widget-dashboard.mjs.map +7 -0
  242. package/build-module/wordpress-commands.d.mjs +1 -0
  243. package/build-module/wordpress-commands.d.mjs.map +7 -0
  244. package/build-types/components/actions/actions.d.ts +11 -0
  245. package/build-types/components/actions/actions.d.ts.map +1 -0
  246. package/build-types/components/actions/index.d.ts +2 -0
  247. package/build-types/components/actions/index.d.ts.map +1 -0
  248. package/build-types/components/actions-menu/actions-menu.d.ts +22 -0
  249. package/build-types/components/actions-menu/actions-menu.d.ts.map +1 -0
  250. package/build-types/components/actions-menu/index.d.ts +3 -0
  251. package/build-types/components/actions-menu/index.d.ts.map +1 -0
  252. package/build-types/components/commands/commands.d.ts +7 -0
  253. package/build-types/components/commands/commands.d.ts.map +1 -0
  254. package/build-types/components/commands/index.d.ts +2 -0
  255. package/build-types/components/commands/index.d.ts.map +1 -0
  256. package/build-types/components/commands/use-pending-when-edit-mode.d.ts +15 -0
  257. package/build-types/components/commands/use-pending-when-edit-mode.d.ts.map +1 -0
  258. package/build-types/components/layout-settings/index.d.ts +2 -0
  259. package/build-types/components/layout-settings/index.d.ts.map +1 -0
  260. package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts +17 -0
  261. package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts.map +1 -0
  262. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts +6 -0
  263. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts.map +1 -0
  264. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts +6 -0
  265. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts.map +1 -0
  266. package/build-types/components/layout-settings/layout-settings.d.ts +14 -0
  267. package/build-types/components/layout-settings/layout-settings.d.ts.map +1 -0
  268. package/build-types/components/no-widgets-state/index.d.ts +2 -0
  269. package/build-types/components/no-widgets-state/index.d.ts.map +1 -0
  270. package/build-types/components/no-widgets-state/no-widgets-state.d.ts +17 -0
  271. package/build-types/components/no-widgets-state/no-widgets-state.d.ts.map +1 -0
  272. package/build-types/components/reset-confirmation/index.d.ts +2 -0
  273. package/build-types/components/reset-confirmation/index.d.ts.map +1 -0
  274. package/build-types/components/reset-confirmation/reset-confirmation.d.ts +8 -0
  275. package/build-types/components/reset-confirmation/reset-confirmation.d.ts.map +1 -0
  276. package/build-types/components/widget-chrome/index.d.ts +2 -0
  277. package/build-types/components/widget-chrome/index.d.ts.map +1 -0
  278. package/build-types/components/widget-chrome/widget-chrome.d.ts +22 -0
  279. package/build-types/components/widget-chrome/widget-chrome.d.ts.map +1 -0
  280. package/build-types/components/widget-inserter/index.d.ts +2 -0
  281. package/build-types/components/widget-inserter/index.d.ts.map +1 -0
  282. package/build-types/components/widget-inserter/widget-inserter.d.ts +7 -0
  283. package/build-types/components/widget-inserter/widget-inserter.d.ts.map +1 -0
  284. package/build-types/components/widget-picker/index.d.ts +2 -0
  285. package/build-types/components/widget-picker/index.d.ts.map +1 -0
  286. package/build-types/components/widget-picker/widget-picker.d.ts +26 -0
  287. package/build-types/components/widget-picker/widget-picker.d.ts.map +1 -0
  288. package/build-types/components/widget-render/index.d.ts +2 -0
  289. package/build-types/components/widget-render/index.d.ts.map +1 -0
  290. package/build-types/components/widget-render/widget-render.d.ts +17 -0
  291. package/build-types/components/widget-render/widget-render.d.ts.map +1 -0
  292. package/build-types/components/widget-settings/index.d.ts +5 -0
  293. package/build-types/components/widget-settings/index.d.ts.map +1 -0
  294. package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts +17 -0
  295. package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts.map +1 -0
  296. package/build-types/components/widget-settings/utils/get-widget-settings.d.ts +10 -0
  297. package/build-types/components/widget-settings/utils/get-widget-settings.d.ts.map +1 -0
  298. package/build-types/components/widget-settings/utils/index.d.ts +3 -0
  299. package/build-types/components/widget-settings/utils/index.d.ts.map +1 -0
  300. package/build-types/components/widget-settings/widget-settings-toolbar.d.ts +20 -0
  301. package/build-types/components/widget-settings/widget-settings-toolbar.d.ts.map +1 -0
  302. package/build-types/components/widget-settings/widget-settings-trigger.d.ts +23 -0
  303. package/build-types/components/widget-settings/widget-settings-trigger.d.ts.map +1 -0
  304. package/build-types/components/widget-settings/widget-settings.d.ts +13 -0
  305. package/build-types/components/widget-settings/widget-settings.d.ts.map +1 -0
  306. package/build-types/components/widget-toolbar/index.d.ts +3 -0
  307. package/build-types/components/widget-toolbar/index.d.ts.map +1 -0
  308. package/build-types/components/widget-toolbar/widget-toolbar.d.ts +16 -0
  309. package/build-types/components/widget-toolbar/widget-toolbar.d.ts.map +1 -0
  310. package/build-types/components/widgets/index.d.ts +2 -0
  311. package/build-types/components/widgets/index.d.ts.map +1 -0
  312. package/build-types/components/widgets/widget-layout-toolbar.d.ts +14 -0
  313. package/build-types/components/widgets/widget-layout-toolbar.d.ts.map +1 -0
  314. package/build-types/components/widgets/widget-resize-handle.d.ts +12 -0
  315. package/build-types/components/widgets/widget-resize-handle.d.ts.map +1 -0
  316. package/build-types/components/widgets/widgets.d.ts +10 -0
  317. package/build-types/components/widgets/widgets.d.ts.map +1 -0
  318. package/build-types/context/dashboard-context.d.ts +111 -0
  319. package/build-types/context/dashboard-context.d.ts.map +1 -0
  320. package/build-types/context/ui-context.d.ts +54 -0
  321. package/build-types/context/ui-context.d.ts.map +1 -0
  322. package/build-types/context/widget-context.d.ts +25 -0
  323. package/build-types/context/widget-context.d.ts.map +1 -0
  324. package/build-types/hooks/use-dashboard-container-column-count.d.ts +15 -0
  325. package/build-types/hooks/use-dashboard-container-column-count.d.ts.map +1 -0
  326. package/build-types/index.d.ts +7 -0
  327. package/build-types/index.d.ts.map +1 -0
  328. package/build-types/lock-unlock.d.ts +2 -0
  329. package/build-types/lock-unlock.d.ts.map +1 -0
  330. package/build-types/types.d.ts +222 -0
  331. package/build-types/types.d.ts.map +1 -0
  332. package/build-types/utils/create-dashboard-widget/create-dashboard-widget.d.ts +20 -0
  333. package/build-types/utils/create-dashboard-widget/create-dashboard-widget.d.ts.map +1 -0
  334. package/build-types/utils/create-dashboard-widget/index.d.ts +2 -0
  335. package/build-types/utils/create-dashboard-widget/index.d.ts.map +1 -0
  336. package/build-types/utils/default-grid/default-grid.d.ts +11 -0
  337. package/build-types/utils/default-grid/default-grid.d.ts.map +1 -0
  338. package/build-types/utils/default-grid/index.d.ts +2 -0
  339. package/build-types/utils/default-grid/index.d.ts.map +1 -0
  340. package/build-types/utils/grid-model-change/grid-model-change.d.ts +20 -0
  341. package/build-types/utils/grid-model-change/grid-model-change.d.ts.map +1 -0
  342. package/build-types/utils/grid-model-change/index.d.ts +2 -0
  343. package/build-types/utils/grid-model-change/index.d.ts.map +1 -0
  344. package/build-types/utils/index.d.ts +3 -0
  345. package/build-types/utils/index.d.ts.map +1 -0
  346. package/build-types/utils/migrate-layout/index.d.ts +2 -0
  347. package/build-types/utils/migrate-layout/index.d.ts.map +1 -0
  348. package/build-types/utils/migrate-layout/migrate-layout.d.ts +36 -0
  349. package/build-types/utils/migrate-layout/migrate-layout.d.ts.map +1 -0
  350. package/build-types/utils/normalize-grid-settings/index.d.ts +2 -0
  351. package/build-types/utils/normalize-grid-settings/index.d.ts.map +1 -0
  352. package/build-types/utils/normalize-grid-settings/normalize-grid-settings.d.ts +11 -0
  353. package/build-types/utils/normalize-grid-settings/normalize-grid-settings.d.ts.map +1 -0
  354. package/build-types/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.d.ts +21 -0
  355. package/build-types/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.d.ts.map +1 -0
  356. package/build-types/utils/row-height-presets/index.d.ts +3 -0
  357. package/build-types/utils/row-height-presets/index.d.ts.map +1 -0
  358. package/build-types/utils/row-height-presets/row-height-presets.d.ts +17 -0
  359. package/build-types/utils/row-height-presets/row-height-presets.d.ts.map +1 -0
  360. package/build-types/widget-dashboard.d.ts +51 -0
  361. package/build-types/widget-dashboard.d.ts.map +1 -0
  362. package/package.json +90 -0
  363. package/src/components/actions/actions.module.css +54 -0
  364. package/src/components/actions/actions.tsx +180 -0
  365. package/src/components/actions/index.ts +1 -0
  366. package/src/components/actions-menu/actions-menu.tsx +104 -0
  367. package/src/components/actions-menu/index.ts +2 -0
  368. package/src/components/commands/commands.tsx +182 -0
  369. package/src/components/commands/index.ts +1 -0
  370. package/src/components/commands/use-pending-when-edit-mode.ts +48 -0
  371. package/src/components/layout-settings/index.ts +1 -0
  372. package/src/components/layout-settings/layout-model-edit-field/index.tsx +98 -0
  373. package/src/components/layout-settings/layout-model-edit-field/style.module.css +34 -0
  374. package/src/components/layout-settings/layout-model-edit-field/thumbnail-grid.tsx +28 -0
  375. package/src/components/layout-settings/layout-model-edit-field/thumbnail-masonry.tsx +28 -0
  376. package/src/components/layout-settings/layout-settings.tsx +217 -0
  377. package/src/components/no-widgets-state/index.ts +1 -0
  378. package/src/components/no-widgets-state/no-widgets-state.module.css +3 -0
  379. package/src/components/no-widgets-state/no-widgets-state.tsx +56 -0
  380. package/src/components/reset-confirmation/index.ts +1 -0
  381. package/src/components/reset-confirmation/reset-confirmation.tsx +44 -0
  382. package/src/components/widget-chrome/index.ts +1 -0
  383. package/src/components/widget-chrome/widget-chrome.module.css +87 -0
  384. package/src/components/widget-chrome/widget-chrome.tsx +255 -0
  385. package/src/components/widget-inserter/index.ts +1 -0
  386. package/src/components/widget-inserter/widget-inserter.tsx +70 -0
  387. package/src/components/widget-picker/index.ts +1 -0
  388. package/src/components/widget-picker/widget-picker.module.css +11 -0
  389. package/src/components/widget-picker/widget-picker.tsx +137 -0
  390. package/src/components/widget-render/index.ts +1 -0
  391. package/src/components/widget-render/widget-render.tsx +58 -0
  392. package/src/components/widget-settings/index.ts +4 -0
  393. package/src/components/widget-settings/utils/get-admin-menu-inset.ts +30 -0
  394. package/src/components/widget-settings/utils/get-widget-settings.ts +22 -0
  395. package/src/components/widget-settings/utils/index.ts +2 -0
  396. package/src/components/widget-settings/widget-settings-toolbar.module.css +25 -0
  397. package/src/components/widget-settings/widget-settings-toolbar.tsx +45 -0
  398. package/src/components/widget-settings/widget-settings-trigger.tsx +96 -0
  399. package/src/components/widget-settings/widget-settings.module.css +8 -0
  400. package/src/components/widget-settings/widget-settings.tsx +200 -0
  401. package/src/components/widget-toolbar/index.ts +2 -0
  402. package/src/components/widget-toolbar/widget-toolbar.module.css +12 -0
  403. package/src/components/widget-toolbar/widget-toolbar.tsx +46 -0
  404. package/src/components/widgets/index.ts +1 -0
  405. package/src/components/widgets/widget-layout-toolbar.module.css +6 -0
  406. package/src/components/widgets/widget-layout-toolbar.tsx +118 -0
  407. package/src/components/widgets/widget-resize-handle.module.css +135 -0
  408. package/src/components/widgets/widget-resize-handle.tsx +60 -0
  409. package/src/components/widgets/widgets.module.css +43 -0
  410. package/src/components/widgets/widgets.tsx +208 -0
  411. package/src/context/dashboard-context.tsx +386 -0
  412. package/src/context/ui-context.tsx +118 -0
  413. package/src/context/widget-context.tsx +45 -0
  414. package/src/hooks/use-dashboard-container-column-count.ts +63 -0
  415. package/src/index.ts +9 -0
  416. package/src/lock-unlock.ts +10 -0
  417. package/src/test/actions.test.tsx +228 -0
  418. package/src/test/commands.test.tsx +176 -0
  419. package/src/test/create-dashboard-widget.test.ts +59 -0
  420. package/src/test/dashboard-context.test.tsx +26 -0
  421. package/src/test/staging.test.tsx +476 -0
  422. package/src/test/widget-dashboard.test.tsx +204 -0
  423. package/src/test/widget-inserter.test.tsx +210 -0
  424. package/src/test/widget-settings.test.tsx +199 -0
  425. package/src/types.ts +260 -0
  426. package/src/utils/create-dashboard-widget/create-dashboard-widget.ts +43 -0
  427. package/src/utils/create-dashboard-widget/index.ts +1 -0
  428. package/src/utils/default-grid/default-grid.ts +17 -0
  429. package/src/utils/default-grid/index.ts +1 -0
  430. package/src/utils/grid-model-change/grid-model-change.ts +53 -0
  431. package/src/utils/grid-model-change/index.ts +1 -0
  432. package/src/utils/index.ts +2 -0
  433. package/src/utils/migrate-layout/index.ts +1 -0
  434. package/src/utils/migrate-layout/migrate-layout.ts +156 -0
  435. package/src/utils/migrate-layout/test/migrate-layout.test.ts +114 -0
  436. package/src/utils/normalize-grid-settings/index.ts +1 -0
  437. package/src/utils/normalize-grid-settings/normalize-grid-settings.ts +38 -0
  438. package/src/utils/resolve-dashboard-column-count/resolve-dashboard-column-count.ts +41 -0
  439. package/src/utils/resolve-dashboard-column-count/test/resolve-dashboard-column-count.test.ts +44 -0
  440. package/src/utils/row-height-presets/index.ts +8 -0
  441. package/src/utils/row-height-presets/row-height-presets.ts +43 -0
  442. package/src/widget-dashboard.tsx +102 -0
  443. package/src/wordpress-commands.d.ts +12 -0
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # Widget Dashboard
2
+
3
+ <div class="callout callout-alert">
4
+ This package is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes. While it is published as 0.x, breaking changes may ship in minor releases.
5
+
6
+ This prerelease depends on WordPress core-private APIs and is built to run inside WordPress core. It is not yet safe to install and run as a standalone npm dependency from an external plugin.
7
+ </div>
8
+
9
+ Stateless rendering engine for widget dashboards. `WidgetDashboard` renders an editable grid of widget instances behind a consumer-controlled edit mode: drag-to-reorder, resize, a modal inserter, per-widget and grid-level settings, and command-palette integration.
10
+
11
+ The engine owns no data. Widget types flow in through the `widgetTypes` prop (see [`@wordpress/widget-primitives`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/widget-primitives)), the consumer owns the committed `layout` array, and in-progress edits accumulate in an internal staging layer until the user commits them, at which point `onLayoutChange` fires with the updated array. Grid placement renders through [`@wordpress/grid`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/grid).
12
+
13
+ For how the widget system fits together (authoring, build, server registry, hosts), see the [dashboard widget system architecture document](https://github.com/WordPress/gutenberg/blob/HEAD/docs/explanations/architecture/dashboard-widgets.md).
14
+
15
+ ## Installation
16
+
17
+ Install the module:
18
+
19
+ ```bash
20
+ npm install @wordpress/widget-dashboard --save
21
+ ```
22
+
23
+ _This package assumes that your code will run in an **ES2015+** environment.
24
+ If you're using an environment that has limited or no support for such
25
+ language features and APIs, you should include [the polyfill shipped in
26
+ `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill)
27
+ in your code._
28
+
29
+ ## Setup
30
+
31
+ Component styles are CSS Modules injected at runtime when a component mounts; there is no stylesheet to enqueue or import.
32
+
33
+ Visual defaults read the design tokens that `@wordpress/theme` publishes as `--wpds-*` CSS custom properties. In WordPress screens managed by Gutenberg the tokens stylesheet is loaded centrally and no setup is needed. Elsewhere, install and load it in your application:
34
+
35
+ ```bash
36
+ npm install @wordpress/theme
37
+ ```
38
+
39
+ ```js
40
+ import '@wordpress/theme/design-tokens.css';
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ ```tsx
46
+ import { useState } from '@wordpress/element';
47
+ import { WidgetDashboard } from '@wordpress/widget-dashboard';
48
+
49
+ function Dashboard() {
50
+ const [ layout, setLayout ] = useState( defaultLayout );
51
+
52
+ return (
53
+ <WidgetDashboard
54
+ layout={ layout }
55
+ onLayoutChange={ setLayout }
56
+ widgetTypes={ widgetTypes }
57
+ />
58
+ );
59
+ }
60
+ ```
61
+
62
+ `<WidgetDashboard>` renders `<WidgetDashboard.Widgets />` by default. Pass `children` to compose the dashboard — header, empty state, footer — around the grid:
63
+
64
+ ```tsx
65
+ <WidgetDashboard
66
+ layout={ layout }
67
+ onLayoutChange={ setLayout }
68
+ widgetTypes={ widgetTypes }
69
+ >
70
+ <WidgetDashboard.NoWidgetsState>
71
+ <p>{ __( 'No widgets yet.' ) }</p>
72
+ </WidgetDashboard.NoWidgetsState>
73
+ <WidgetDashboard.Widgets />
74
+ </WidgetDashboard>
75
+ ```
76
+
77
+ ## Composition
78
+
79
+ The dashboard is built from two kinds of parts:
80
+
81
+ - **Triggers and chrome you arrange.** `Actions`, `Widgets`, `WidgetChrome`, `NoWidgetsState`, and `Commands` are compound components; compose them as `children` to place them in your layout.
82
+ - **Overlays the engine mounts.** The widget inserter, the layout-settings and per-widget-settings editors, and the reset confirmation are mounted by the engine and driven by shared UI state. Triggers open them only through that state — the "Add widget" button and the command palette both open the inserter — so there is no overlay to place in the tree.
83
+
84
+ Omitting `children` renders the default arrangement. When you pass `children`, the overlays mount regardless of what you compose.
85
+
86
+ ## Properties
87
+
88
+ #### `layout`: `DashboardWidget[]`
89
+
90
+ Widget instances to render. Each instance carries a stable `uuid`, a `type` reference, optional `attributes`, and a `placement` describing its slot in the grid. The consumer owns this state.
91
+
92
+ #### `onLayoutChange`: `( layout: DashboardWidget[] ) => void`
93
+
94
+ Called when the user commits in-progress edits via the Done action. Receives the full layout array as it should be persisted. In-progress mutations (reorder, resize, add, remove, attribute edits) accumulate in the dashboard's internal staging layer and do not fire this callback until commit.
95
+
96
+ #### `onLayoutReset`: `() => void`
97
+
98
+ Optional. Reset action surfaced by `<WidgetDashboard.Actions />` and the command palette. When omitted, the reset entry points are disabled.
99
+
100
+ #### `widgetTypes`: `WidgetType[]`
101
+
102
+ The widget types available to the dashboard. The dashboard never queries a store directly — consumers scope and filter via this prop.
103
+
104
+ #### `isResolvingWidgetTypes`: `boolean`
105
+
106
+ Optional. When `true`, widget types are still loading: instances whose type is not yet in `widgetTypes` show a loading state instead of a missing state.
107
+
108
+ #### `editMode`: `boolean`
109
+
110
+ When `true`, the grid enables drag and resize. Defaults to `false`.
111
+
112
+ #### `onEditChange`: `( next: boolean ) => void`
113
+
114
+ Optional. Called when edit mode toggles via `WidgetDashboard.Actions` (or any consumer-built toggle). When omitted, `WidgetDashboard.Actions` renders nothing.
115
+
116
+ #### `resolveWidgetModule`: `( moduleId: string ) => Promise< { default: ComponentType } >`
117
+
118
+ Optional. Maps a `WidgetType.renderModule` id to the React component that renders the widget. Defaults to a dynamic `import( /* webpackIgnore */ moduleId )`. Override for tests, Storybook, or remote-URL loading.
119
+
120
+ #### `gridSettings`: `WidgetGridSettings`
121
+
122
+ Optional. Grid model configuration; see [Grid settings](#grid-settings). Defaults to `DEFAULT_GRID`.
123
+
124
+ #### `onGridSettingsChange`: `( gridSettings: WidgetGridSettings ) => void`
125
+
126
+ Optional. Called when the user commits grid-settings edits. When omitted, the layout-settings entry points are hidden, since there is nowhere to persist the change.
127
+
128
+ #### `children`: `ReactNode`
129
+
130
+ Optional. Composition slot for the dashboard's triggers and chrome. When omitted, the engine renders the default arrangement: the empty state, the actions, the widgets grid, and the command palette integration. The engine-mounted overlays are present either way.
131
+
132
+ ## Compound components
133
+
134
+ #### `<WidgetDashboard.Widgets />`
135
+
136
+ Iterates `layout`, renders each entry through `<WidgetDashboard.WidgetChrome />`, and feeds the resulting tree into the underlying grid (`@wordpress/grid`).
137
+
138
+ #### `<WidgetDashboard.WidgetChrome />`
139
+
140
+ Per-instance wrapper. Provides widget identity to the render tree via context and hosts the widget's render module under a `Suspense` boundary and an error boundary. The instance is read from `layout`; consumers don't pass it manually.
141
+
142
+ #### `<WidgetDashboard.NoWidgetsState>`
143
+
144
+ Renders its children only when `layout` is empty. Pair it with `<WidgetDashboard.Widgets />` so the empty state shows up in place of the grid until widgets are added.
145
+
146
+ #### `<WidgetDashboard.Actions />`
147
+
148
+ Edit-mode toggle: a "Customize" button while `editMode` is off, and "Add widget", "Layout settings" (when `onGridSettingsChange` is provided), "Cancel", "Done" while it is on. The buttons and the more-actions menu are triggers: "Customize" and "Done" fire `onEditChange`, "Add widget" opens the inserter, "Layout settings" opens the layout-settings editor, and "Reset to default" opens the reset confirmation. Returns `null` when the dashboard is mounted without `onEditChange`, so surfaces that don't expose edit mode can keep `Actions` in their tree unconditionally.
149
+
150
+ #### `<WidgetDashboard.Commands />`
151
+
152
+ Command palette integration. It registers the dashboard's commands through `@wordpress/commands` (customize, add widgets, switch layout model, reset to default) and sets the active command context. It renders nothing, and surfaces wherever the host application mounts the command palette. Ships in the default arrangement; when passing custom children, compose it to keep the integration.
153
+
154
+ `<Page>` from `@wordpress/admin-ui` exposes an `actions` slot used across admin screens (DataViews, WidgetDashboard, …). Plug `Actions` straight into it:
155
+
156
+ ```tsx
157
+ import { Page } from '@wordpress/admin-ui';
158
+
159
+ <WidgetDashboard
160
+ layout={ layout }
161
+ onLayoutChange={ setLayout }
162
+ widgetTypes={ widgetTypes }
163
+ editMode={ editMode }
164
+ onEditChange={ setEditMode }
165
+ >
166
+ <Page
167
+ title={ __( 'My Dashboard' ) }
168
+ actions={ <WidgetDashboard.Actions /> }
169
+ >
170
+ <WidgetDashboard.Widgets />
171
+ </Page>
172
+ <WidgetDashboard.Commands />
173
+ </WidgetDashboard>;
174
+ ```
175
+
176
+ `<Page>` is optional. The compound renders inside any container, so a bare `<header>` or custom chrome works just as well.
177
+
178
+ ## Inserting widgets
179
+
180
+ The "Add widget" button in `<WidgetDashboard.Actions />` opens a modal inserter. It lists every entry in the `widgetTypes` prop as a grid of live previews (each preview renders the type's `example` attributes through its own render module), supports search, and exposes a "Select" action with bulk support so users can insert one or several widgets in a single layout change.
181
+
182
+ On confirmation, the inserter creates instances (using each type's `example.attributes` as the initial values) and appends them to the staged layout. The dialog closes after a successful insertion or when the user dismisses it.
183
+
184
+ ## Grid settings
185
+
186
+ The dashboard supports two grid models, configured through the `gridSettings` prop: the 2D packed `grid` model, where tiles declare explicit spans over uniform rows, and the content-driven `masonry` model, where heights follow content and resize is horizontal-only. The package owns the definition and editing of these settings (the layout-settings editor in customize mode, the model-switch commands); the consumer owns persistence.
187
+
188
+ The exported kit for building that persistence:
189
+
190
+ - `WidgetGridSettings` — discriminated union of the per-model settings shapes.
191
+ - `DEFAULT_GRID` — canonical default settings, applied when `gridSettings` is omitted.
192
+ - `normalizeGridSettings( settings, defaultRowHeight )` — coerces legacy freeform row heights to the nearest preset. Run it over stored payloads before passing them in.
193
+ - `ROW_HEIGHT_PRESETS` / `DEFAULT_ROW_HEIGHT` — the row-height presets (`small`, `medium`, `large`) the layout-settings editor offers.
194
+ - `WIDGET_DASHBOARD_COLUMN_COUNT` — maximum column count on wide containers. The effective count steps down from container width; persisted `columns` values are ignored.
195
+
196
+ ```tsx
197
+ const [ gridSettings, setGridSettings ] = useState( DEFAULT_GRID );
198
+
199
+ <WidgetDashboard
200
+ layout={ layout }
201
+ onLayoutChange={ setLayout }
202
+ widgetTypes={ widgetTypes }
203
+ gridSettings={ gridSettings }
204
+ onGridSettingsChange={ setGridSettings }
205
+ />;
206
+ ```
207
+
208
+ ## Authoring widgets
209
+
210
+ Widget render modules receive only what they need to render and edit:
211
+
212
+ ```ts
213
+ interface WidgetRenderProps< Item = unknown > {
214
+ attributes: Item;
215
+ setAttributes?: ( next: Partial< Item > ) => void;
216
+ }
217
+ ```
218
+
219
+ `setAttributes` flows back through the staging layer and reaches `onLayoutChange` on commit. Removal, badges, and error chrome are not part of this contract — those belong to the consumer.
220
+
221
+ ## Types
222
+
223
+ - `DashboardWidget` — a placement of a widget on the dashboard. Carries `uuid`, `type`, `attributes`, `placement`.
224
+ - `WidgetGridSettings` — grid model configuration; see [Grid settings](#grid-settings).
225
+
226
+ The widget contract types (`WidgetName`, `WidgetType`, `WidgetRenderProps`, `ResolveWidgetModule`) are defined in `@wordpress/widget-primitives` and imported from there directly; this engine does not re-export them.
227
+
228
+ ## Contributing to this package
229
+
230
+ This is an individual package that's part of the Gutenberg project.
231
+ The project is organized as a monorepo. It's made up of multiple
232
+ self-contained software packages, each with a specific purpose. The
233
+ packages in this monorepo are published to [npm](https://www.npmjs.com/)
234
+ and used by [WordPress](https://make.wordpress.org/core/) as well as
235
+ other software projects.
236
+
237
+ To find out more about contributing to this package or Gutenberg as a
238
+ whole, please read the project's main
239
+ [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
240
+
241
+ <br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/widget-dashboard/src/components/actions/actions.tsx
21
+ var actions_exports = {};
22
+ __export(actions_exports, {
23
+ Actions: () => Actions
24
+ });
25
+ module.exports = __toCommonJS(actions_exports);
26
+ var import_data = require("@wordpress/data");
27
+ var import_element = require("@wordpress/element");
28
+ var import_i18n = require("@wordpress/i18n");
29
+ var import_icons = require("@wordpress/icons");
30
+ var import_viewport = require("@wordpress/viewport");
31
+ var import_ui = require("@wordpress/ui");
32
+ var import_dashboard_context = require("../../context/dashboard-context.cjs");
33
+ var import_ui_context = require("../../context/ui-context.cjs");
34
+ var import_actions_menu = require("../actions-menu/index.cjs");
35
+
36
+ // packages/style-runtime/src/index.ts
37
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
38
+ function getRuntime() {
39
+ const globalScope = globalThis;
40
+ if (globalScope.__wpStyleRuntime) {
41
+ return globalScope.__wpStyleRuntime;
42
+ }
43
+ globalScope.__wpStyleRuntime = {
44
+ documents: /* @__PURE__ */ new Map(),
45
+ styles: /* @__PURE__ */ new Map(),
46
+ injectedStyles: /* @__PURE__ */ new WeakMap()
47
+ };
48
+ if (typeof document !== "undefined") {
49
+ registerDocument(document);
50
+ }
51
+ return globalScope.__wpStyleRuntime;
52
+ }
53
+ function documentContainsStyleHash(targetDocument, hash) {
54
+ if (!targetDocument.head) {
55
+ return false;
56
+ }
57
+ for (const style of targetDocument.head.querySelectorAll(
58
+ `style[${STYLE_HASH_ATTRIBUTE}]`
59
+ )) {
60
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
61
+ return true;
62
+ }
63
+ }
64
+ return false;
65
+ }
66
+ function injectStyle(targetDocument, hash, css) {
67
+ if (!targetDocument.head) {
68
+ return;
69
+ }
70
+ const runtime = getRuntime();
71
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
72
+ if (!injectedStyles) {
73
+ injectedStyles = /* @__PURE__ */ new Set();
74
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
75
+ }
76
+ if (injectedStyles.has(hash)) {
77
+ return;
78
+ }
79
+ if (documentContainsStyleHash(targetDocument, hash)) {
80
+ injectedStyles.add(hash);
81
+ return;
82
+ }
83
+ const style = targetDocument.createElement("style");
84
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
85
+ style.appendChild(targetDocument.createTextNode(css));
86
+ targetDocument.head.appendChild(style);
87
+ injectedStyles.add(hash);
88
+ }
89
+ function registerDocument(targetDocument) {
90
+ const runtime = getRuntime();
91
+ runtime.documents.set(
92
+ targetDocument,
93
+ (runtime.documents.get(targetDocument) ?? 0) + 1
94
+ );
95
+ for (const [hash, css] of runtime.styles) {
96
+ injectStyle(targetDocument, hash, css);
97
+ }
98
+ return () => {
99
+ const count = runtime.documents.get(targetDocument);
100
+ if (count === void 0) {
101
+ return;
102
+ }
103
+ if (count <= 1) {
104
+ runtime.documents.delete(targetDocument);
105
+ return;
106
+ }
107
+ runtime.documents.set(targetDocument, count - 1);
108
+ };
109
+ }
110
+ function registerStyle(hash, css) {
111
+ const runtime = getRuntime();
112
+ runtime.styles.set(hash, css);
113
+ for (const targetDocument of runtime.documents.keys()) {
114
+ injectStyle(targetDocument, hash, css);
115
+ }
116
+ }
117
+
118
+ // packages/widget-dashboard/src/components/actions/actions.module.css
119
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
120
+ registerStyle("207feb9ccc", "._273463df7651817f__editActionsEnter,._3cd6628039136a20__editActionsExit{align-items:center;display:inline-flex;gap:var(--wp--preset--spacing--20);transform-origin:right center}._572540719be6c8a3__editActionsDivider{align-self:center;background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);flex-shrink:0;height:var(--wpds-dimension-size-2xs,16px);width:1px}@media not (prefers-reduced-motion){._273463df7651817f__editActionsEnter,._3cd6628039136a20__editActionsExit{will-change:opacity,transform}._273463df7651817f__editActionsEnter{animation:_332d3153b716aa20__actions-slide-in var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1)) forwards}._3cd6628039136a20__editActionsExit{animation:_4dff70702a4b0f40__actions-fold-out var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}@keyframes _332d3153b716aa20__actions-slide-in{0%{opacity:0;transform:translateX(12px) scaleX(.92)}to{opacity:1;transform:translateX(0) scaleX(1)}}@keyframes _4dff70702a4b0f40__actions-fold-out{0%{opacity:1;transform:translateX(0) scaleX(1)}to{opacity:0;transform:translateX(12px) scaleX(.92)}}}");
121
+ }
122
+ var actions_default = { "editActionsEnter": "_273463df7651817f__editActionsEnter", "editActionsExit": "_3cd6628039136a20__editActionsExit", "editActionsDivider": "_572540719be6c8a3__editActionsDivider", "actions-slide-in": "_332d3153b716aa20__actions-slide-in", "actions-fold-out": "_4dff70702a4b0f40__actions-fold-out" };
123
+
124
+ // packages/widget-dashboard/src/components/actions/actions.tsx
125
+ var import_jsx_runtime = require("react/jsx-runtime");
126
+ function Actions() {
127
+ const {
128
+ editMode,
129
+ onEditChange,
130
+ onLayoutReset,
131
+ commit,
132
+ cancel: cancelStaging,
133
+ hasUncommittedChanges,
134
+ canEditGridSettings
135
+ } = (0, import_dashboard_context.useDashboardInternalContext)();
136
+ const [isEditActionsMounted, setIsEditActionsMounted] = (0, import_element.useState)(editMode);
137
+ const [isExitingEditActions, setIsExitingEditActions] = (0, import_element.useState)(false);
138
+ (0, import_element.useEffect)(() => {
139
+ if (editMode) {
140
+ setIsEditActionsMounted(true);
141
+ setIsExitingEditActions(false);
142
+ return;
143
+ }
144
+ if (!isEditActionsMounted) {
145
+ return;
146
+ }
147
+ setIsExitingEditActions(true);
148
+ const exitTimeout = setTimeout(() => {
149
+ setIsEditActionsMounted(false);
150
+ setIsExitingEditActions(false);
151
+ }, 220);
152
+ return () => clearTimeout(exitTimeout);
153
+ }, [editMode, isEditActionsMounted]);
154
+ const { setInserterOpen, setLayoutSettingsOpen, setResetDialogOpen } = (0, import_ui_context.useDashboardUIContext)();
155
+ const isMobileViewport = (0, import_data.useSelect)(
156
+ (select) => select(import_viewport.store).isViewportMatch("< small"),
157
+ []
158
+ );
159
+ const handleEditMode = (0, import_element.useCallback)(() => {
160
+ onEditChange?.(!editMode);
161
+ }, [editMode, onEditChange]);
162
+ const insert = (0, import_element.useCallback)(() => {
163
+ setInserterOpen(true);
164
+ }, [setInserterOpen]);
165
+ const cancel = (0, import_element.useCallback)(() => {
166
+ cancelStaging();
167
+ }, [cancelStaging]);
168
+ const done = (0, import_element.useCallback)(() => {
169
+ commit();
170
+ }, [commit]);
171
+ const openLayoutSettings = (0, import_element.useCallback)(() => {
172
+ setLayoutSettingsOpen(true);
173
+ }, [setLayoutSettingsOpen]);
174
+ const menuItems = [
175
+ {
176
+ label: (0, import_i18n.__)("Reset to default"),
177
+ onClick: () => setResetDialogOpen(true),
178
+ disabled: !onLayoutReset
179
+ }
180
+ ];
181
+ if (!onEditChange) {
182
+ return null;
183
+ }
184
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "row", gap: "sm", children: [
185
+ isEditActionsMounted ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
186
+ import_ui.Stack,
187
+ {
188
+ direction: "row",
189
+ gap: "sm",
190
+ className: isExitingEditActions ? actions_default.editActionsExit : actions_default.editActionsEnter,
191
+ children: [
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
193
+ import_ui.Button,
194
+ {
195
+ variant: "minimal",
196
+ tone: "brand",
197
+ size: "compact",
198
+ onClick: insert,
199
+ children: [
200
+ !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Button.Icon, { icon: import_icons.plus }),
201
+ (0, import_i18n.__)("Add widget")
202
+ ]
203
+ }
204
+ ),
205
+ canEditGridSettings && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
206
+ import_ui.Button,
207
+ {
208
+ variant: "minimal",
209
+ tone: "brand",
210
+ size: "compact",
211
+ onClick: openLayoutSettings,
212
+ children: [
213
+ !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Button.Icon, { icon: import_icons.layout }),
214
+ (0, import_i18n.__)("Layout settings")
215
+ ]
216
+ }
217
+ ),
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
219
+ "div",
220
+ {
221
+ className: actions_default.editActionsDivider,
222
+ "aria-hidden": "true"
223
+ }
224
+ ),
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
226
+ import_ui.Button,
227
+ {
228
+ variant: "minimal",
229
+ tone: "brand",
230
+ size: "compact",
231
+ onClick: cancel,
232
+ children: (0, import_i18n.__)("Cancel")
233
+ }
234
+ ),
235
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
236
+ import_ui.Button,
237
+ {
238
+ variant: "solid",
239
+ tone: "brand",
240
+ size: "compact",
241
+ onClick: done,
242
+ disabled: !hasUncommittedChanges,
243
+ children: (0, import_i18n.__)("Done")
244
+ }
245
+ )
246
+ ]
247
+ }
248
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
249
+ import_ui.Button,
250
+ {
251
+ variant: "minimal",
252
+ tone: "brand",
253
+ size: "compact",
254
+ onClick: handleEditMode,
255
+ children: (0, import_i18n.__)("Customize")
256
+ }
257
+ ),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_actions_menu.ActionsMenu, { items: menuItems })
259
+ ] });
260
+ }
261
+ // Annotate the CommonJS export names for ESM import in node:
262
+ 0 && (module.exports = {
263
+ Actions
264
+ });
265
+ //# sourceMappingURL=actions.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/actions/actions.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/actions/actions.module.css"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { layout as layoutIcon, plus } from '@wordpress/icons';\nimport { store as viewportStore } from '@wordpress/viewport';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Button, Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { useDashboardUIContext } from '../../context/ui-context';\nimport { ActionsMenu } from '../actions-menu';\nimport type { ActionsMenuItem } from '../actions-menu';\nimport styles from './actions.module.css';\n\n/**\n * Edit toolbar for the dashboard. In customize mode it surfaces Add widget,\n * Layout settings (when grid settings are editable), Cancel, and Done;\n * otherwise a single Customize button. Buttons and the overflow menu are\n * triggers that flip the shared UI state the overlays react to.\n *\n * Returns `null` when mounted without `onEditChange`, so hosts that don't\n * expose edit mode can keep `Actions` in their tree unconditionally.\n */\nexport function Actions(): React.ReactNode {\n\tconst {\n\t\teditMode,\n\t\tonEditChange,\n\t\tonLayoutReset,\n\t\tcommit,\n\t\tcancel: cancelStaging,\n\t\thasUncommittedChanges,\n\t\tcanEditGridSettings,\n\t} = useDashboardInternalContext();\n\n\tconst [ isEditActionsMounted, setIsEditActionsMounted ] =\n\t\tuseState( editMode );\n\tconst [ isExitingEditActions, setIsExitingEditActions ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( editMode ) {\n\t\t\tsetIsEditActionsMounted( true );\n\t\t\tsetIsExitingEditActions( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isEditActionsMounted ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsExitingEditActions( true );\n\t\tconst exitTimeout = setTimeout( () => {\n\t\t\tsetIsEditActionsMounted( false );\n\t\t\tsetIsExitingEditActions( false );\n\t\t}, 220 );\n\n\t\treturn () => clearTimeout( exitTimeout );\n\t}, [ editMode, isEditActionsMounted ] );\n\n\tconst { setInserterOpen, setLayoutSettingsOpen, setResetDialogOpen } =\n\t\tuseDashboardUIContext();\n\t// @TODO: switch to using Admin UI declaratively for mobile viewport support once available.\n\t// https://github.com/WordPress/gutenberg/issues/77628\n\tconst isMobileViewport = useSelect(\n\t\t( select ) => select( viewportStore ).isViewportMatch( '< small' ),\n\t\t[]\n\t);\n\n\tconst handleEditMode = useCallback( () => {\n\t\tonEditChange?.( ! editMode );\n\t}, [ editMode, onEditChange ] );\n\n\tconst insert = useCallback( () => {\n\t\tsetInserterOpen( true );\n\t}, [ setInserterOpen ] );\n\n\tconst cancel = useCallback( () => {\n\t\tcancelStaging();\n\t}, [ cancelStaging ] );\n\n\tconst done = useCallback( () => {\n\t\tcommit();\n\t}, [ commit ] );\n\n\tconst openLayoutSettings = useCallback( () => {\n\t\tsetLayoutSettingsOpen( true );\n\t}, [ setLayoutSettingsOpen ] );\n\n\tconst menuItems: ActionsMenuItem[] = [\n\t\t{\n\t\t\tlabel: __( 'Reset to default' ),\n\t\t\tonClick: () => setResetDialogOpen( true ),\n\t\t\tdisabled: ! onLayoutReset,\n\t\t},\n\t];\n\n\tif ( ! onEditChange ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack direction=\"row\" gap=\"sm\">\n\t\t\t{ isEditActionsMounted ? (\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tisExitingEditActions\n\t\t\t\t\t\t\t? styles.editActionsExit\n\t\t\t\t\t\t\t: styles.editActionsEnter\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\t\ttone=\"brand\"\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ insert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isMobileViewport && <Button.Icon icon={ plus } /> }\n\t\t\t\t\t\t{ __( 'Add widget' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t{ canEditGridSettings && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\t\t\ttone=\"brand\"\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ openLayoutSettings }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<Button.Icon icon={ layoutIcon } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ __( 'Layout settings' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ styles.editActionsDivider }\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\t\ttone=\"brand\"\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ cancel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\ttone=\"brand\"\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ done }\n\t\t\t\t\t\tdisabled={ ! hasUncommittedChanges }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Done' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\ttone=\"brand\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ handleEditMode }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Customize' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\n\t\t\t<ActionsMenu items={ menuItems } />\n\t\t</Stack>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"207feb9ccc\", \"._273463df7651817f__editActionsEnter,._3cd6628039136a20__editActionsExit{align-items:center;display:inline-flex;gap:var(--wp--preset--spacing--20);transform-origin:right center}._572540719be6c8a3__editActionsDivider{align-self:center;background-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);flex-shrink:0;height:var(--wpds-dimension-size-2xs,16px);width:1px}@media not (prefers-reduced-motion){._273463df7651817f__editActionsEnter,._3cd6628039136a20__editActionsExit{will-change:opacity,transform}._273463df7651817f__editActionsEnter{animation:_332d3153b716aa20__actions-slide-in var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-expressive,cubic-bezier(.25,0,0,1)) forwards}._3cd6628039136a20__editActionsExit{animation:_4dff70702a4b0f40__actions-fold-out var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}@keyframes _332d3153b716aa20__actions-slide-in{0%{opacity:0;transform:translateX(12px) scaleX(.92)}to{opacity:1;transform:translateX(0) scaleX(1)}}@keyframes _4dff70702a4b0f40__actions-fold-out{0%{opacity:1;transform:translateX(0) scaleX(1)}to{opacity:0;transform:translateX(12px) scaleX(.92)}}}\");\n}\nexport default {\"editActionsEnter\":\"_273463df7651817f__editActionsEnter\",\"editActionsExit\":\"_3cd6628039136a20__editActionsExit\",\"editActionsDivider\":\"_572540719be6c8a3__editActionsDivider\",\"actions-slide-in\":\"_332d3153b716aa20__actions-slide-in\",\"actions-fold-out\":\"_4dff70702a4b0f40__actions-fold-out\"};\n"],
5
+ "mappings": "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",
6
+ "names": ["viewportStore", "layoutIcon"]
7
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/widget-dashboard/src/components/actions/index.ts
21
+ var actions_exports = {};
22
+ __export(actions_exports, {
23
+ Actions: () => import_actions.Actions
24
+ });
25
+ module.exports = __toCommonJS(actions_exports);
26
+ var import_actions = require("./actions.cjs");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ Actions
30
+ });
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/actions/index.ts"],
4
+ "sourcesContent": ["export { Actions } from './actions';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;",
6
+ "names": []
7
+ }