@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
@@ -0,0 +1,140 @@
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/no-widgets-state/no-widgets-state.tsx
21
+ var no_widgets_state_exports = {};
22
+ __export(no_widgets_state_exports, {
23
+ NoWidgetsState: () => NoWidgetsState
24
+ });
25
+ module.exports = __toCommonJS(no_widgets_state_exports);
26
+ var import_i18n = require("@wordpress/i18n");
27
+ var import_icons = require("@wordpress/icons");
28
+ var import_ui = require("@wordpress/ui");
29
+ var import_dashboard_context = require("../../context/dashboard-context.cjs");
30
+
31
+ // packages/style-runtime/src/index.ts
32
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
33
+ function getRuntime() {
34
+ const globalScope = globalThis;
35
+ if (globalScope.__wpStyleRuntime) {
36
+ return globalScope.__wpStyleRuntime;
37
+ }
38
+ globalScope.__wpStyleRuntime = {
39
+ documents: /* @__PURE__ */ new Map(),
40
+ styles: /* @__PURE__ */ new Map(),
41
+ injectedStyles: /* @__PURE__ */ new WeakMap()
42
+ };
43
+ if (typeof document !== "undefined") {
44
+ registerDocument(document);
45
+ }
46
+ return globalScope.__wpStyleRuntime;
47
+ }
48
+ function documentContainsStyleHash(targetDocument, hash) {
49
+ if (!targetDocument.head) {
50
+ return false;
51
+ }
52
+ for (const style of targetDocument.head.querySelectorAll(
53
+ `style[${STYLE_HASH_ATTRIBUTE}]`
54
+ )) {
55
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ }
61
+ function injectStyle(targetDocument, hash, css) {
62
+ if (!targetDocument.head) {
63
+ return;
64
+ }
65
+ const runtime = getRuntime();
66
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
67
+ if (!injectedStyles) {
68
+ injectedStyles = /* @__PURE__ */ new Set();
69
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
70
+ }
71
+ if (injectedStyles.has(hash)) {
72
+ return;
73
+ }
74
+ if (documentContainsStyleHash(targetDocument, hash)) {
75
+ injectedStyles.add(hash);
76
+ return;
77
+ }
78
+ const style = targetDocument.createElement("style");
79
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
80
+ style.appendChild(targetDocument.createTextNode(css));
81
+ targetDocument.head.appendChild(style);
82
+ injectedStyles.add(hash);
83
+ }
84
+ function registerDocument(targetDocument) {
85
+ const runtime = getRuntime();
86
+ runtime.documents.set(
87
+ targetDocument,
88
+ (runtime.documents.get(targetDocument) ?? 0) + 1
89
+ );
90
+ for (const [hash, css] of runtime.styles) {
91
+ injectStyle(targetDocument, hash, css);
92
+ }
93
+ return () => {
94
+ const count = runtime.documents.get(targetDocument);
95
+ if (count === void 0) {
96
+ return;
97
+ }
98
+ if (count <= 1) {
99
+ runtime.documents.delete(targetDocument);
100
+ return;
101
+ }
102
+ runtime.documents.set(targetDocument, count - 1);
103
+ };
104
+ }
105
+ function registerStyle(hash, css) {
106
+ const runtime = getRuntime();
107
+ runtime.styles.set(hash, css);
108
+ for (const targetDocument of runtime.documents.keys()) {
109
+ injectStyle(targetDocument, hash, css);
110
+ }
111
+ }
112
+
113
+ // packages/widget-dashboard/src/components/no-widgets-state/no-widgets-state.module.css
114
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
115
+ registerStyle("dc7dd85362", "._86b63a6f839a2e2b__root{padding-block-start:calc(var(--wpds-dimension-padding-3xl, 32px)*3.5)}");
116
+ }
117
+ var no_widgets_state_default = { "root": "_86b63a6f839a2e2b__root" };
118
+
119
+ // packages/widget-dashboard/src/components/no-widgets-state/no-widgets-state.tsx
120
+ var import_jsx_runtime = require("react/jsx-runtime");
121
+ function NoWidgetsState({
122
+ children
123
+ }) {
124
+ const { layout } = (0, import_dashboard_context.useDashboardInternalContext)();
125
+ if (layout.length > 0) {
126
+ return null;
127
+ }
128
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Stack, { justify: "center", align: "center", className: no_widgets_state_default.root, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.EmptyState.Root, { children: [
129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.EmptyState.Icon, { icon: import_icons.home }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.EmptyState.Title, { children: (0, import_i18n.__)("Your dashboard is empty") }),
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.EmptyState.Description, { children: (0, import_i18n.__)(
132
+ "Add widgets to start customizing your dashboard."
133
+ ) })
134
+ ] }) });
135
+ }
136
+ // Annotate the CommonJS export names for ESM import in node:
137
+ 0 && (module.exports = {
138
+ NoWidgetsState
139
+ });
140
+ //# sourceMappingURL=no-widgets-state.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/no-widgets-state/no-widgets-state.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/no-widgets-state/no-widgets-state.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { home } from '@wordpress/icons';\nimport { EmptyState, Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport styles from './no-widgets-state.module.css';\n\nexport interface NoWidgetsStateProps {\n\tchildren?: ReactNode;\n}\n\n/**\n * Empty-state placeholder shown while the dashboard `layout` has no widgets.\n * Pair it with `WidgetDashboard.Widgets` so it stands in for the grid until\n * widgets are added. Falls back to a built-in placeholder; pass `children` to\n * override.\n *\n * @param {NoWidgetsStateProps} props Component props.\n */\nexport function NoWidgetsState( {\n\tchildren,\n}: NoWidgetsStateProps ): React.ReactNode {\n\tconst { layout } = useDashboardInternalContext();\n\tif ( layout.length > 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack justify=\"center\" align=\"center\" className={ styles.root }>\n\t\t\t{ children ?? (\n\t\t\t\t<EmptyState.Root>\n\t\t\t\t\t<EmptyState.Icon icon={ home } />\n\t\t\t\t\t<EmptyState.Title>\n\t\t\t\t\t\t{ __( 'Your dashboard is empty' ) }\n\t\t\t\t\t</EmptyState.Title>\n\t\t\t\t\t<EmptyState.Description>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Add widgets to start customizing your dashboard.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</EmptyState.Description>\n\t\t\t\t</EmptyState.Root>\n\t\t\t) }\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(\"dc7dd85362\", \"._86b63a6f839a2e2b__root{padding-block-start:calc(var(--wpds-dimension-padding-3xl, 32px)*3.5)}\");\n}\nexport default {\"root\":\"_86b63a6f839a2e2b__root\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kBAAmB;AACnB,mBAAqB;AACrB,gBAAkC;AAKlC,+BAA4C;;;ACL5C,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,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AAQ,QAAQ,UAAU,IAAK,cAAe;AAEpD,QAAK,UAAU,QAAY;AAC1B;AAAA,IACD;AAEA,QAAK,SAAS,GAAI;AACjB,cAAQ,UAAU,OAAQ,cAAe;AACzC;AAAA,IACD;AAEA,YAAQ,UAAU,IAAK,gBAAgB,QAAQ,CAAE;AAAA,EAClD;AACD;AAaO,SAAS,cAAe,MAAc,KAAc;AAC1D,QAAM,UAAU,WAAW;AAE3B,UAAQ,OAAO,IAAK,MAAM,GAAI;AAE9B,aAAY,kBAAkB,QAAQ,UAAU,KAAK,GAAI;AACxD,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AACD;;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,iGAAiG;AAC9H;AACA,IAAO,2BAAQ,EAAC,QAAO,0BAAyB;;;AFqC5C;AAXG,SAAS,eAAgB;AAAA,EAC/B;AACD,GAA0C;AACzC,QAAM,EAAE,OAAO,QAAI,sDAA4B;AAC/C,MAAK,OAAO,SAAS,GAAI;AACxB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,mBAAM,SAAQ,UAAS,OAAM,UAAS,WAAY,yBAAO,MACvD,sBACD,6CAAC,qBAAW,MAAX,EACA;AAAA,gDAAC,qBAAW,MAAX,EAAgB,MAAO,mBAAO;AAAA,IAC/B,4CAAC,qBAAW,OAAX,EACE,8BAAI,yBAA0B,GACjC;AAAA,IACA,4CAAC,qBAAW,aAAX,EACE;AAAA,MACD;AAAA,IACD,GACD;AAAA,KACD,GAEF;AAEF;",
6
+ "names": []
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/reset-confirmation/index.ts
21
+ var reset_confirmation_exports = {};
22
+ __export(reset_confirmation_exports, {
23
+ ResetConfirmation: () => import_reset_confirmation.ResetConfirmation
24
+ });
25
+ module.exports = __toCommonJS(reset_confirmation_exports);
26
+ var import_reset_confirmation = require("./reset-confirmation.cjs");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ ResetConfirmation
30
+ });
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/reset-confirmation/index.ts"],
4
+ "sourcesContent": ["export { ResetConfirmation } from './reset-confirmation';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAkC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,62 @@
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/reset-confirmation/reset-confirmation.tsx
21
+ var reset_confirmation_exports = {};
22
+ __export(reset_confirmation_exports, {
23
+ ResetConfirmation: () => ResetConfirmation
24
+ });
25
+ module.exports = __toCommonJS(reset_confirmation_exports);
26
+ var import_i18n = require("@wordpress/i18n");
27
+ var import_ui = require("@wordpress/ui");
28
+ var import_dashboard_context = require("../../context/dashboard-context.cjs");
29
+ var import_ui_context = require("../../context/ui-context.cjs");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ function ResetConfirmation() {
32
+ const { onLayoutReset, onEditChange } = (0, import_dashboard_context.useDashboardInternalContext)();
33
+ const { resetDialogOpen, setResetDialogOpen } = (0, import_ui_context.useDashboardUIContext)();
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
+ import_ui.AlertDialog.Root,
36
+ {
37
+ open: resetDialogOpen,
38
+ onOpenChange: setResetDialogOpen,
39
+ onConfirm: async () => {
40
+ await onLayoutReset?.();
41
+ onEditChange?.(false);
42
+ setResetDialogOpen(false);
43
+ },
44
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
+ import_ui.AlertDialog.Popup,
46
+ {
47
+ intent: "irreversible",
48
+ title: (0, import_i18n.__)("Reset dashboard to default?"),
49
+ description: (0, import_i18n.__)(
50
+ "All customizations will be permanently lost."
51
+ ),
52
+ confirmButtonText: (0, import_i18n.__)("Reset")
53
+ }
54
+ )
55
+ }
56
+ );
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ ResetConfirmation
61
+ });
62
+ //# sourceMappingURL=reset-confirmation.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/reset-confirmation/reset-confirmation.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { AlertDialog } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { useDashboardUIContext } from '../../context/ui-context';\n\n/**\n * Confirmation prompt for resetting the dashboard to its default layout,\n * mounted by the engine and shown while `resetDialogOpen` is set in the\n * shared UI context. Confirming runs `onLayoutReset` and leaves customize\n * mode.\n */\nexport function ResetConfirmation(): React.ReactNode {\n\tconst { onLayoutReset, onEditChange } = useDashboardInternalContext();\n\tconst { resetDialogOpen, setResetDialogOpen } = useDashboardUIContext();\n\n\treturn (\n\t\t<AlertDialog.Root\n\t\t\topen={ resetDialogOpen }\n\t\t\tonOpenChange={ setResetDialogOpen }\n\t\t\tonConfirm={ async () => {\n\t\t\t\tawait onLayoutReset?.();\n\t\t\t\tonEditChange?.( false );\n\t\t\t\tsetResetDialogOpen( false );\n\t\t\t} }\n\t\t>\n\t\t\t<AlertDialog.Popup\n\t\t\t\tintent=\"irreversible\"\n\t\t\t\ttitle={ __( 'Reset dashboard to default?' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'All customizations will be permanently lost.'\n\t\t\t\t) }\n\t\t\t\tconfirmButtonText={ __( 'Reset' ) }\n\t\t\t/>\n\t\t</AlertDialog.Root>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAEnB,gBAA4B;AAK5B,+BAA4C;AAC5C,wBAAsC;AAsBnC;AAdI,SAAS,oBAAqC;AACpD,QAAM,EAAE,eAAe,aAAa,QAAI,sDAA4B;AACpE,QAAM,EAAE,iBAAiB,mBAAmB,QAAI,yCAAsB;AAEtE,SACC;AAAA,IAAC,sBAAY;AAAA,IAAZ;AAAA,MACA,MAAO;AAAA,MACP,cAAe;AAAA,MACf,WAAY,YAAY;AACvB,cAAM,gBAAgB;AACtB,uBAAgB,KAAM;AACtB,2BAAoB,KAAM;AAAA,MAC3B;AAAA,MAEA;AAAA,QAAC,sBAAY;AAAA,QAAZ;AAAA,UACA,QAAO;AAAA,UACP,WAAQ,gBAAI,6BAA8B;AAAA,UAC1C,iBAAc;AAAA,YACb;AAAA,UACD;AAAA,UACA,uBAAoB,gBAAI,OAAQ;AAAA;AAAA,MACjC;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
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/widget-chrome/index.ts
21
+ var widget_chrome_exports = {};
22
+ __export(widget_chrome_exports, {
23
+ WidgetChrome: () => import_widget_chrome.WidgetChrome
24
+ });
25
+ module.exports = __toCommonJS(widget_chrome_exports);
26
+ var import_widget_chrome = require("./widget-chrome.cjs");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ WidgetChrome
30
+ });
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-chrome/index.ts"],
4
+ "sourcesContent": ["export { WidgetChrome } from './widget-chrome';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA6B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/widget-dashboard/src/components/widget-chrome/widget-chrome.tsx
31
+ var widget_chrome_exports = {};
32
+ __export(widget_chrome_exports, {
33
+ WidgetChrome: () => WidgetChrome
34
+ });
35
+ module.exports = __toCommonJS(widget_chrome_exports);
36
+ var import_clsx = __toESM(require("clsx"));
37
+ var import_components = require("@wordpress/components");
38
+ var import_element = require("@wordpress/element");
39
+ var import_i18n = require("@wordpress/i18n");
40
+ var import_icons = require("@wordpress/icons");
41
+ var import_ui = require("@wordpress/ui");
42
+ var import_dashboard_context = require("../../context/dashboard-context.cjs");
43
+ var import_widget_context = require("../../context/widget-context.cjs");
44
+ var import_widget_render = require("../widget-render/index.cjs");
45
+
46
+ // packages/style-runtime/src/index.ts
47
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
48
+ function getRuntime() {
49
+ const globalScope = globalThis;
50
+ if (globalScope.__wpStyleRuntime) {
51
+ return globalScope.__wpStyleRuntime;
52
+ }
53
+ globalScope.__wpStyleRuntime = {
54
+ documents: /* @__PURE__ */ new Map(),
55
+ styles: /* @__PURE__ */ new Map(),
56
+ injectedStyles: /* @__PURE__ */ new WeakMap()
57
+ };
58
+ if (typeof document !== "undefined") {
59
+ registerDocument(document);
60
+ }
61
+ return globalScope.__wpStyleRuntime;
62
+ }
63
+ function documentContainsStyleHash(targetDocument, hash) {
64
+ if (!targetDocument.head) {
65
+ return false;
66
+ }
67
+ for (const style of targetDocument.head.querySelectorAll(
68
+ `style[${STYLE_HASH_ATTRIBUTE}]`
69
+ )) {
70
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
71
+ return true;
72
+ }
73
+ }
74
+ return false;
75
+ }
76
+ function injectStyle(targetDocument, hash, css) {
77
+ if (!targetDocument.head) {
78
+ return;
79
+ }
80
+ const runtime = getRuntime();
81
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
82
+ if (!injectedStyles) {
83
+ injectedStyles = /* @__PURE__ */ new Set();
84
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
85
+ }
86
+ if (injectedStyles.has(hash)) {
87
+ return;
88
+ }
89
+ if (documentContainsStyleHash(targetDocument, hash)) {
90
+ injectedStyles.add(hash);
91
+ return;
92
+ }
93
+ const style = targetDocument.createElement("style");
94
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
95
+ style.appendChild(targetDocument.createTextNode(css));
96
+ targetDocument.head.appendChild(style);
97
+ injectedStyles.add(hash);
98
+ }
99
+ function registerDocument(targetDocument) {
100
+ const runtime = getRuntime();
101
+ runtime.documents.set(
102
+ targetDocument,
103
+ (runtime.documents.get(targetDocument) ?? 0) + 1
104
+ );
105
+ for (const [hash, css] of runtime.styles) {
106
+ injectStyle(targetDocument, hash, css);
107
+ }
108
+ return () => {
109
+ const count = runtime.documents.get(targetDocument);
110
+ if (count === void 0) {
111
+ return;
112
+ }
113
+ if (count <= 1) {
114
+ runtime.documents.delete(targetDocument);
115
+ return;
116
+ }
117
+ runtime.documents.set(targetDocument, count - 1);
118
+ };
119
+ }
120
+ function registerStyle(hash, css) {
121
+ const runtime = getRuntime();
122
+ runtime.styles.set(hash, css);
123
+ for (const targetDocument of runtime.documents.keys()) {
124
+ injectStyle(targetDocument, hash, css);
125
+ }
126
+ }
127
+
128
+ // packages/widget-dashboard/src/components/widget-chrome/widget-chrome.module.css
129
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
130
+ registerStyle("345dedc0b8", "._79b45ce7d3422efe__widgetChrome{contain:layout;height:100%}._79b45ce7d3422efe__widgetChrome:has(._9f0be51a1b96c8d7__widgetChromeContent :focus-visible){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:2px}.d85f7657585b9203__widgetChromeHeaderIcon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._9f0be51a1b96c8d7__widgetChromeContent{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._21770471c9c2115b__widgetChromeContentBleed{padding-block:0}._229727240ac2aa18__widgetChromeBleedScroll{height:100%;margin-block-end:0;overflow-y:auto}._3c919e86d1bb80ab__loading,._9b694d63bdec1a98__unavailable{height:100%}");
131
+ }
132
+ var widget_chrome_default = { "widgetChrome": "_79b45ce7d3422efe__widgetChrome", "widgetChromeContent": "_9f0be51a1b96c8d7__widgetChromeContent", "widgetChromeHeaderIcon": "d85f7657585b9203__widgetChromeHeaderIcon", "widgetChromeContentBleed": "_21770471c9c2115b__widgetChromeContentBleed", "widgetChromeBleedScroll": "_229727240ac2aa18__widgetChromeBleedScroll", "loading": "_3c919e86d1bb80ab__loading", "unavailable": "_9b694d63bdec1a98__unavailable" };
133
+
134
+ // packages/widget-dashboard/src/components/widget-chrome/widget-chrome.tsx
135
+ var import_jsx_runtime = require("react/jsx-runtime");
136
+ var WidgetErrorBoundary = class extends import_element.Component {
137
+ state = { hasError: false };
138
+ static getDerivedStateFromError() {
139
+ return { hasError: true };
140
+ }
141
+ render() {
142
+ if (this.state.hasError) {
143
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Root, { intent: "error", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Description, { children: (0, import_i18n.__)("This widget encountered an error.") }) });
144
+ }
145
+ return this.props.children;
146
+ }
147
+ };
148
+ function LoadingOverlay() {
149
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Stack, { justify: "center", align: "center", className: widget_chrome_default.loading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {}) });
150
+ }
151
+ function UnavailableWidget({ widgetTypeName }) {
152
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
153
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Card.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
+ "span",
155
+ {
156
+ className: widget_chrome_default.widgetChromeHeaderIcon,
157
+ "aria-hidden": "true",
158
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { icon: import_icons.plugins })
159
+ }
160
+ ) }),
161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Card.Content, { className: widget_chrome_default.widgetChromeContent, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
162
+ import_ui.Stack,
163
+ {
164
+ direction: "column",
165
+ justify: "center",
166
+ align: "center",
167
+ gap: "md",
168
+ className: widget_chrome_default.unavailable,
169
+ children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Text, { children: (0, import_i18n.__)("Widget is no longer available.") }),
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Text, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {}), children: widgetTypeName })
172
+ ]
173
+ }
174
+ ) })
175
+ ] });
176
+ }
177
+ function Header({ titleId, widgetType }) {
178
+ if (!widgetType.title) {
179
+ return null;
180
+ }
181
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Card.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "row", align: "center", gap: "sm", children: [
182
+ widgetType.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
+ "span",
184
+ {
185
+ className: widget_chrome_default.widgetChromeHeaderIcon,
186
+ "aria-hidden": "true",
187
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Icon, { icon: widgetType.icon })
188
+ }
189
+ ),
190
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Card.Title, { id: titleId, render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {}), children: widgetType.title })
191
+ ] }) });
192
+ }
193
+ var WidgetChrome = (0, import_element.forwardRef)(
194
+ function WidgetChrome2({ widget, index, className }, ref) {
195
+ const { widgetTypes, isResolvingWidgetTypes, editMode } = (0, import_dashboard_context.useDashboardInternalContext)();
196
+ const widgetType = widgetTypes.find((t) => t.name === widget.type);
197
+ const titleId = (0, import_element.useId)();
198
+ const contextValue = (0, import_element.useMemo)(
199
+ () => ({
200
+ uuid: widget.uuid,
201
+ name: widget.type,
202
+ index
203
+ }),
204
+ [widget.uuid, widget.type, index]
205
+ );
206
+ if (!widgetType) {
207
+ if (isResolvingWidgetTypes) {
208
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_context.WidgetContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
209
+ import_ui.Card.Root,
210
+ {
211
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {}),
212
+ ref,
213
+ className: (0, import_clsx.default)(widget_chrome_default.widgetChrome, className),
214
+ "aria-busy": "true",
215
+ "aria-label": (0, import_i18n.__)("Loading"),
216
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
217
+ import_ui.Card.Content,
218
+ {
219
+ className: widget_chrome_default.widgetChromeContent,
220
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingOverlay, {})
221
+ }
222
+ )
223
+ }
224
+ ) });
225
+ }
226
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_context.WidgetContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
227
+ import_ui.Card.Root,
228
+ {
229
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {}),
230
+ ref,
231
+ className: (0, import_clsx.default)(widget_chrome_default.widgetChrome, className),
232
+ "aria-label": (0, import_i18n.__)("Missing widget"),
233
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnavailableWidget, { widgetTypeName: widget.type })
234
+ }
235
+ ) });
236
+ }
237
+ const { presentation } = widgetType;
238
+ const isHeaderHidden = presentation === "full-bleed";
239
+ const isBodyBleeding = presentation === "full-bleed" || presentation === "content-bleed";
240
+ const header = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Header, { titleId, widgetType });
241
+ const body = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WidgetErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingOverlay, {}), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_render.WidgetRender, { widget, widgetType }) }) });
242
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_context.WidgetContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
243
+ import_ui.Card.Root,
244
+ {
245
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {}),
246
+ ref,
247
+ className: (0, import_clsx.default)(widget_chrome_default.widgetChrome, className),
248
+ "aria-labelledby": widgetType.title ? titleId : void 0,
249
+ ...editMode ? { inert: "true" } : {},
250
+ children: [
251
+ isHeaderHidden ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { children: header }) : header,
252
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
253
+ import_ui.Card.Content,
254
+ {
255
+ className: (0, import_clsx.default)(
256
+ widget_chrome_default.widgetChromeContent,
257
+ isBodyBleeding && widget_chrome_default.widgetChromeContentBleed
258
+ ),
259
+ children: isBodyBleeding ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
260
+ import_ui.Card.FullBleed,
261
+ {
262
+ className: widget_chrome_default.widgetChromeBleedScroll,
263
+ children: body
264
+ }
265
+ ) : body
266
+ }
267
+ )
268
+ ]
269
+ }
270
+ ) });
271
+ }
272
+ );
273
+ // Annotate the CommonJS export names for ESM import in node:
274
+ 0 && (module.exports = {
275
+ WidgetChrome
276
+ });
277
+ //# sourceMappingURL=widget-chrome.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-chrome/widget-chrome.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-chrome/widget-chrome.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Spinner } from '@wordpress/components';\nimport {\n\tComponent,\n\tSuspense,\n\tforwardRef,\n\tuseId,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { plugins } from '@wordpress/icons';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Card, Icon, Stack, Notice, Text, VisuallyHidden } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { WidgetContextProvider } from '../../context/widget-context';\nimport { WidgetRender } from '../widget-render';\nimport styles from './widget-chrome.module.css';\nimport type { DashboardWidget } from '../../types';\n\ninterface ErrorBoundaryProps {\n\tchildren: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n\thasError: boolean;\n}\n\nclass WidgetErrorBoundary extends Component<\n\tErrorBoundaryProps,\n\tErrorBoundaryState\n> {\n\tstate: ErrorBoundaryState = { hasError: false };\n\n\tstatic getDerivedStateFromError(): ErrorBoundaryState {\n\t\treturn { hasError: true };\n\t}\n\n\trender() {\n\t\tif ( this.state.hasError ) {\n\t\t\treturn (\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'This widget encountered an error.' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t</Notice.Root>\n\t\t\t);\n\t\t}\n\t\treturn this.props.children;\n\t}\n}\n\nfunction LoadingOverlay() {\n\treturn (\n\t\t<Stack justify=\"center\" align=\"center\" className={ styles.loading }>\n\t\t\t<Spinner />\n\t\t</Stack>\n\t);\n}\n\ninterface UnavailableWidgetProps {\n\twidgetTypeName: string;\n}\n\nfunction UnavailableWidget( { widgetTypeName }: UnavailableWidgetProps ) {\n\treturn (\n\t\t<>\n\t\t\t<Card.Header>\n\t\t\t\t<span\n\t\t\t\t\tclassName={ styles.widgetChromeHeaderIcon }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ plugins } />\n\t\t\t\t</span>\n\t\t\t</Card.Header>\n\t\t\t<Card.Content className={ styles.widgetChromeContent }>\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName={ styles.unavailable }\n\t\t\t\t>\n\t\t\t\t\t<Text>{ __( 'Widget is no longer available.' ) }</Text>\n\t\t\t\t\t<Text render={ <code /> }>{ widgetTypeName }</Text>\n\t\t\t\t</Stack>\n\t\t\t</Card.Content>\n\t\t</>\n\t);\n}\n\ninterface HeaderProps {\n\ttitleId: string;\n\twidgetType: WidgetType;\n}\n\nfunction Header( { titleId, widgetType }: HeaderProps ) {\n\tif ( ! widgetType.title ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Card.Header>\n\t\t\t<Stack direction=\"row\" align=\"center\" gap=\"sm\">\n\t\t\t\t{ widgetType.icon && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ styles.widgetChromeHeaderIcon }\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ widgetType.icon } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<Card.Title id={ titleId } render={ <h2 /> }>\n\t\t\t\t\t{ widgetType.title }\n\t\t\t\t</Card.Title>\n\t\t\t</Stack>\n\t\t</Card.Header>\n\t);\n}\n\nexport interface WidgetChromeProps {\n\twidget: DashboardWidget< unknown >;\n\tindex: number;\n\t/**\n\t * Lifted by the surrounding `@wordpress/grid` surface into a sibling\n\t * slot of the grid item; not rendered by `WidgetChrome` itself.\n\t * Living outside `Card.Root` is what keeps these controls interactive\n\t * while edit mode applies `inert` to the chrome.\n\t */\n\tactionableArea?: ReactNode;\n\tclassName?: string;\n}\n\n/**\n * Per-instance wrapper. Owns the chrome around a widget instance: identity\n * context, header (title + icon), edit-mode `inert` attribute, and the\n * error/loading boundaries that keep neighbours mounted when one widget fails\n * or is still resolving.\n */\nexport const WidgetChrome = forwardRef< HTMLDivElement, WidgetChromeProps >(\n\tfunction WidgetChrome( { widget, index, className }, ref ) {\n\t\tconst { widgetTypes, isResolvingWidgetTypes, editMode } =\n\t\t\tuseDashboardInternalContext();\n\t\tconst widgetType = widgetTypes.find( ( t ) => t.name === widget.type );\n\t\tconst titleId = useId();\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tuuid: widget.uuid,\n\t\t\t\tname: widget.type,\n\t\t\t\tindex,\n\t\t\t} ),\n\t\t\t[ widget.uuid, widget.type, index ]\n\t\t);\n\n\t\tif ( ! widgetType ) {\n\t\t\tif ( isResolvingWidgetTypes ) {\n\t\t\t\treturn (\n\t\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t\t<Card.Root\n\t\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\t\taria-busy=\"true\"\n\t\t\t\t\t\t\taria-label={ __( 'Loading' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Card.Content\n\t\t\t\t\t\t\t\tclassName={ styles.widgetChromeContent }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<LoadingOverlay />\n\t\t\t\t\t\t\t</Card.Content>\n\t\t\t\t\t\t</Card.Root>\n\t\t\t\t\t</WidgetContextProvider>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t<Card.Root\n\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\taria-label={ __( 'Missing widget' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnavailableWidget widgetTypeName={ widget.type } />\n\t\t\t\t\t</Card.Root>\n\t\t\t\t</WidgetContextProvider>\n\t\t\t);\n\t\t}\n\n\t\t// `presentation` encodes two independent axes. `full-bleed` hides\n\t\t// the header; both `full-bleed` and `content-bleed` let the body\n\t\t// break out of the content padding.\n\t\tconst { presentation } = widgetType;\n\t\tconst isHeaderHidden = presentation === 'full-bleed';\n\t\tconst isBodyBleeding =\n\t\t\tpresentation === 'full-bleed' || presentation === 'content-bleed';\n\t\tconst header = <Header titleId={ titleId } widgetType={ widgetType } />;\n\n\t\tconst body = (\n\t\t\t<WidgetErrorBoundary>\n\t\t\t\t<Suspense fallback={ <LoadingOverlay /> }>\n\t\t\t\t\t<WidgetRender widget={ widget } widgetType={ widgetType } />\n\t\t\t\t</Suspense>\n\t\t\t</WidgetErrorBoundary>\n\t\t);\n\n\t\treturn (\n\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t<Card.Root\n\t\t\t\t\trender={ <section /> }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\taria-labelledby={ widgetType.title ? titleId : undefined }\n\t\t\t\t\t{ ...( editMode ? { inert: 'true' } : {} ) }\n\t\t\t\t>\n\t\t\t\t\t{ isHeaderHidden ? (\n\t\t\t\t\t\t<VisuallyHidden>{ header }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\theader\n\t\t\t\t\t) }\n\n\t\t\t\t\t<Card.Content\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles.widgetChromeContent,\n\t\t\t\t\t\t\tisBodyBleeding && styles.widgetChromeContentBleed\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isBodyBleeding ? (\n\t\t\t\t\t\t\t<Card.FullBleed\n\t\t\t\t\t\t\t\tclassName={ styles.widgetChromeBleedScroll }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ body }\n\t\t\t\t\t\t\t</Card.FullBleed>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tbody\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Card.Content>\n\t\t\t\t</Card.Root>\n\t\t\t</WidgetContextProvider>\n\t\t);\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(\"345dedc0b8\", \"._79b45ce7d3422efe__widgetChrome{contain:layout;height:100%}._79b45ce7d3422efe__widgetChrome:has(._9f0be51a1b96c8d7__widgetChromeContent :focus-visible){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:2px}.d85f7657585b9203__widgetChromeHeaderIcon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._9f0be51a1b96c8d7__widgetChromeContent{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._21770471c9c2115b__widgetChromeContentBleed{padding-block:0}._229727240ac2aa18__widgetChromeBleedScroll{height:100%;margin-block-end:0;overflow-y:auto}._3c919e86d1bb80ab__loading,._9b694d63bdec1a98__unavailable{height:100%}\");\n}\nexport default {\"widgetChrome\":\"_79b45ce7d3422efe__widgetChrome\",\"widgetChromeContent\":\"_9f0be51a1b96c8d7__widgetChromeContent\",\"widgetChromeHeaderIcon\":\"d85f7657585b9203__widgetChromeHeaderIcon\",\"widgetChromeContentBleed\":\"_21770471c9c2115b__widgetChromeContentBleed\",\"widgetChromeBleedScroll\":\"_229727240ac2aa18__widgetChromeBleedScroll\",\"loading\":\"_3c919e86d1bb80ab__loading\",\"unavailable\":\"_9b694d63bdec1a98__unavailable\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAMjB,wBAAwB;AACxB,qBAMO;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