@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,38 @@
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-settings/utils/get-widget-settings.ts
21
+ var get_widget_settings_exports = {};
22
+ __export(get_widget_settings_exports, {
23
+ getWidgetSettingsTitle: () => getWidgetSettingsTitle
24
+ });
25
+ module.exports = __toCommonJS(get_widget_settings_exports);
26
+ var import_i18n = require("@wordpress/i18n");
27
+ function getWidgetSettingsTitle(widgetType) {
28
+ return widgetType?.title ? (0, import_i18n.sprintf)(
29
+ /* translators: %s: Widget title. */
30
+ (0, import_i18n.__)("%s settings"),
31
+ widgetType.title
32
+ ) : (0, import_i18n.__)("Widget settings");
33
+ }
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ getWidgetSettingsTitle
37
+ });
38
+ //# sourceMappingURL=get-widget-settings.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/widget-settings/utils/get-widget-settings.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Localized \"<Widget> settings\" label, falling back to a generic title\n * when the type declares none.\n *\n * @param {WidgetType} widgetType Type backing the open instance.\n * @return {string} The drawer/trigger title.\n */\nexport function getWidgetSettingsTitle( widgetType?: WidgetType ): string {\n\treturn widgetType?.title\n\t\t? sprintf(\n\t\t\t\t/* translators: %s: Widget title. */\n\t\t\t\t__( '%s settings' ),\n\t\t\t\twidgetType.title\n\t\t )\n\t\t: __( 'Widget settings' );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAUrB,SAAS,uBAAwB,YAAkC;AACzE,SAAO,YAAY,YAChB;AAAA;AAAA,QAEA,gBAAI,aAAc;AAAA,IAClB,WAAW;AAAA,EACX,QACA,gBAAI,iBAAkB;AAC1B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
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-settings/utils/index.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ getAdminMenuInset: () => import_get_admin_menu_inset.getAdminMenuInset,
24
+ getWidgetSettingsTitle: () => import_get_widget_settings.getWidgetSettingsTitle
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ var import_get_admin_menu_inset = require("./get-admin-menu-inset.cjs");
28
+ var import_get_widget_settings = require("./get-widget-settings.cjs");
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ getAdminMenuInset,
32
+ getWidgetSettingsTitle
33
+ });
34
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/widget-settings/utils/index.ts"],
4
+ "sourcesContent": ["export { getAdminMenuInset } from './get-admin-menu-inset';\nexport { getWidgetSettingsTitle } from './get-widget-settings';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAkC;AAClC,iCAAuC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,138 @@
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-settings/widget-settings-toolbar.tsx
21
+ var widget_settings_toolbar_exports = {};
22
+ __export(widget_settings_toolbar_exports, {
23
+ WidgetSettingsToolbar: () => WidgetSettingsToolbar
24
+ });
25
+ module.exports = __toCommonJS(widget_settings_toolbar_exports);
26
+ var import_widget_toolbar = require("../widget-toolbar/index.cjs");
27
+ var import_widget_settings_trigger = require("./widget-settings-trigger.cjs");
28
+
29
+ // packages/style-runtime/src/index.ts
30
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
31
+ function getRuntime() {
32
+ const globalScope = globalThis;
33
+ if (globalScope.__wpStyleRuntime) {
34
+ return globalScope.__wpStyleRuntime;
35
+ }
36
+ globalScope.__wpStyleRuntime = {
37
+ documents: /* @__PURE__ */ new Map(),
38
+ styles: /* @__PURE__ */ new Map(),
39
+ injectedStyles: /* @__PURE__ */ new WeakMap()
40
+ };
41
+ if (typeof document !== "undefined") {
42
+ registerDocument(document);
43
+ }
44
+ return globalScope.__wpStyleRuntime;
45
+ }
46
+ function documentContainsStyleHash(targetDocument, hash) {
47
+ if (!targetDocument.head) {
48
+ return false;
49
+ }
50
+ for (const style of targetDocument.head.querySelectorAll(
51
+ `style[${STYLE_HASH_ATTRIBUTE}]`
52
+ )) {
53
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
54
+ return true;
55
+ }
56
+ }
57
+ return false;
58
+ }
59
+ function injectStyle(targetDocument, hash, css) {
60
+ if (!targetDocument.head) {
61
+ return;
62
+ }
63
+ const runtime = getRuntime();
64
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
65
+ if (!injectedStyles) {
66
+ injectedStyles = /* @__PURE__ */ new Set();
67
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
68
+ }
69
+ if (injectedStyles.has(hash)) {
70
+ return;
71
+ }
72
+ if (documentContainsStyleHash(targetDocument, hash)) {
73
+ injectedStyles.add(hash);
74
+ return;
75
+ }
76
+ const style = targetDocument.createElement("style");
77
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
78
+ style.appendChild(targetDocument.createTextNode(css));
79
+ targetDocument.head.appendChild(style);
80
+ injectedStyles.add(hash);
81
+ }
82
+ function registerDocument(targetDocument) {
83
+ const runtime = getRuntime();
84
+ runtime.documents.set(
85
+ targetDocument,
86
+ (runtime.documents.get(targetDocument) ?? 0) + 1
87
+ );
88
+ for (const [hash, css] of runtime.styles) {
89
+ injectStyle(targetDocument, hash, css);
90
+ }
91
+ return () => {
92
+ const count = runtime.documents.get(targetDocument);
93
+ if (count === void 0) {
94
+ return;
95
+ }
96
+ if (count <= 1) {
97
+ runtime.documents.delete(targetDocument);
98
+ return;
99
+ }
100
+ runtime.documents.set(targetDocument, count - 1);
101
+ };
102
+ }
103
+ function registerStyle(hash, css) {
104
+ const runtime = getRuntime();
105
+ runtime.styles.set(hash, css);
106
+ for (const targetDocument of runtime.documents.keys()) {
107
+ injectStyle(targetDocument, hash, css);
108
+ }
109
+ }
110
+
111
+ // packages/widget-dashboard/src/components/widget-settings/widget-settings-toolbar.module.css
112
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
113
+ registerStyle("76555dc7e2", "._931c420497181bdb__widgetSettingsToolbar{background:color-mix(in srgb,var(--wpds-color-background-surface-neutral,#fcfcfc) 40%,transparent);opacity:0;pointer-events:none}[data-wp-grid-item-key]:focus-within ._931c420497181bdb__widgetSettingsToolbar,[data-wp-grid-item-key]:hover ._931c420497181bdb__widgetSettingsToolbar{opacity:1;pointer-events:auto}@media not (prefers-reduced-motion){._931c420497181bdb__widgetSettingsToolbar{transition:opacity var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}");
114
+ }
115
+ var widget_settings_toolbar_default = { "widgetSettingsToolbar": "_931c420497181bdb__widgetSettingsToolbar" };
116
+
117
+ // packages/widget-dashboard/src/components/widget-settings/widget-settings-toolbar.tsx
118
+ var import_jsx_runtime = require("react/jsx-runtime");
119
+ function WidgetSettingsToolbar({
120
+ widget,
121
+ widgetType
122
+ }) {
123
+ if (!widgetType.attributes?.length) {
124
+ return null;
125
+ }
126
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_widget_toolbar.WidgetToolbar, { className: widget_settings_toolbar_default.widgetSettingsToolbar, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
127
+ import_widget_settings_trigger.WidgetSettingsTrigger,
128
+ {
129
+ widget,
130
+ widgetType
131
+ }
132
+ ) });
133
+ }
134
+ // Annotate the CommonJS export names for ESM import in node:
135
+ 0 && (module.exports = {
136
+ WidgetSettingsToolbar
137
+ });
138
+ //# sourceMappingURL=widget-settings-toolbar.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-settings/widget-settings-toolbar.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-settings/widget-settings-toolbar.module.css"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { WidgetToolbar } from '../widget-toolbar';\nimport { WidgetSettingsTrigger } from './widget-settings-trigger';\nimport styles from './widget-settings-toolbar.module.css';\nimport type { DashboardWidget } from '../../types';\n\nexport interface WidgetSettingsToolbarProps {\n\t/** The instance whose settings this toolbar configures. */\n\twidget: DashboardWidget< unknown >;\n\n\t/** The instance's widget type, for the trigger label and guard. */\n\twidgetType: WidgetType;\n}\n\n/**\n * Normal-mode per-tile toolbar: the gear that opens the settings drawer. Lives\n * in the grid's `actionableArea` slot, so it shows for every `presentation`.\n * Returns `null` when the type has no attributes.\n *\n * @param {WidgetSettingsToolbarProps} props Component props.\n */\nexport function WidgetSettingsToolbar( {\n\twidget,\n\twidgetType,\n}: WidgetSettingsToolbarProps ): React.ReactNode {\n\tif ( ! widgetType.attributes?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<WidgetToolbar className={ styles.widgetSettingsToolbar }>\n\t\t\t<WidgetSettingsTrigger\n\t\t\t\twidget={ widget }\n\t\t\t\twidgetType={ widgetType }\n\t\t\t/>\n\t\t</WidgetToolbar>\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(\"76555dc7e2\", \"._931c420497181bdb__widgetSettingsToolbar{background:color-mix(in srgb,var(--wpds-color-background-surface-neutral,#fcfcfc) 40%,transparent);opacity:0;pointer-events:none}[data-wp-grid-item-key]:focus-within ._931c420497181bdb__widgetSettingsToolbar,[data-wp-grid-item-key]:hover ._931c420497181bdb__widgetSettingsToolbar{opacity:1;pointer-events:auto}@media not (prefers-reduced-motion){._931c420497181bdb__widgetSettingsToolbar{transition:opacity var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}\");\n}\nexport default {\"widgetSettingsToolbar\":\"_931c420497181bdb__widgetSettingsToolbar\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,4BAA8B;AAC9B,qCAAsC;;;ACCtC,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,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAK,gBAAgB,cAAe;AAAA,EAC5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QAAS;AACtC,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,uCAAc,WAAY,gCAAO,uBACjC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD,GACD;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,82 @@
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-settings/widget-settings-trigger.tsx
21
+ var widget_settings_trigger_exports = {};
22
+ __export(widget_settings_trigger_exports, {
23
+ WidgetSettingsTrigger: () => WidgetSettingsTrigger
24
+ });
25
+ module.exports = __toCommonJS(widget_settings_trigger_exports);
26
+ var import_element = require("@wordpress/element");
27
+ var import_i18n = require("@wordpress/i18n");
28
+ var import_icons = require("@wordpress/icons");
29
+ var import_ui = require("@wordpress/ui");
30
+ var import_ui_context = require("../../context/ui-context.cjs");
31
+ var import_utils = require("./utils/index.cjs");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ function WidgetSettingsTrigger({
34
+ widget,
35
+ widgetType
36
+ }) {
37
+ const {
38
+ setSettingsWidgetUuid,
39
+ setSettingsDrawerSide,
40
+ setSettingsDrawerInset
41
+ } = (0, import_ui_context.useDashboardUIContext)();
42
+ const open = (0, import_element.useCallback)(
43
+ (event) => {
44
+ const adminMenuInset = (0, import_utils.getAdminMenuInset)();
45
+ const tile = event.currentTarget.closest(
46
+ "[data-wp-grid-item-key]"
47
+ );
48
+ const rect = (tile ?? event.currentTarget).getBoundingClientRect();
49
+ const widgetCenter = rect.left + rect.width / 2;
50
+ const contentCenter = (adminMenuInset + window.innerWidth) / 2;
51
+ const side = widgetCenter > contentCenter ? "left" : "right";
52
+ setSettingsDrawerSide(side);
53
+ setSettingsDrawerInset(side === "left" ? adminMenuInset : 0);
54
+ setSettingsWidgetUuid(widget.uuid);
55
+ },
56
+ [
57
+ setSettingsDrawerSide,
58
+ setSettingsDrawerInset,
59
+ setSettingsWidgetUuid,
60
+ widget.uuid
61
+ ]
62
+ );
63
+ if (!widgetType.attributes?.length) {
64
+ return null;
65
+ }
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
67
+ import_ui.IconButton,
68
+ {
69
+ icon: import_icons.cog,
70
+ label: (0, import_i18n.__)("Widget settings"),
71
+ variant: "minimal",
72
+ tone: "neutral",
73
+ size: "compact",
74
+ onClick: open
75
+ }
76
+ );
77
+ }
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ WidgetSettingsTrigger
81
+ });
82
+ //# sourceMappingURL=widget-settings-trigger.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-settings/widget-settings-trigger.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { cog } from '@wordpress/icons';\n// Dashboard is still experimental.\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { IconButton } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardUIContext } from '../../context/ui-context';\nimport { getAdminMenuInset } from './utils';\nimport type { DashboardWidget } from '../../types';\n\nexport interface WidgetSettingsTriggerProps {\n\t/**\n\t * The instance whose settings drawer this gear opens.\n\t */\n\twidget: DashboardWidget< unknown >;\n\n\t/**\n\t * The instance's widget type, used for the accessible label and the\n\t * attributes guard.\n\t */\n\twidgetType: WidgetType;\n}\n\n/**\n * Per-instance gear that opens the shared settings drawer by writing the\n * instance `uuid` to the UI context; the single `WidgetSettings` at the root\n * reacts to it. Returns `null` when the type declares no attributes, so chrome\n * can mount it unconditionally.\n *\n * @param {WidgetSettingsTriggerProps} props Component props.\n */\nexport function WidgetSettingsTrigger( {\n\twidget,\n\twidgetType,\n}: WidgetSettingsTriggerProps ): React.ReactNode {\n\tconst {\n\t\tsetSettingsWidgetUuid,\n\t\tsetSettingsDrawerSide,\n\t\tsetSettingsDrawerInset,\n\t} = useDashboardUIContext();\n\n\tconst open = useCallback(\n\t\t( event: React.MouseEvent< HTMLElement > ) => {\n\t\t\t// Open the drawer on the side away from the widget: compare the\n\t\t\t// tile's center against the midpoint of the usable content area\n\t\t\t// (which starts after the admin menu). Past it opens left.\n\t\t\tconst adminMenuInset = getAdminMenuInset();\n\t\t\t// The gear sits in the grid slot, outside the card, so reach the\n\t\t\t// tile via the grid item's data hook.\n\t\t\tconst tile = event.currentTarget.closest(\n\t\t\t\t'[data-wp-grid-item-key]'\n\t\t\t);\n\t\t\tconst rect = (\n\t\t\t\ttile ?? event.currentTarget\n\t\t\t).getBoundingClientRect();\n\t\t\tconst widgetCenter = rect.left + rect.width / 2;\n\t\t\tconst contentCenter = ( adminMenuInset + window.innerWidth ) / 2;\n\t\t\tconst side = widgetCenter > contentCenter ? 'left' : 'right';\n\n\t\t\tsetSettingsDrawerSide( side );\n\t\t\t// A left drawer would otherwise slide over the fixed admin menu;\n\t\t\t// offset it by the menu width so it lands clear of it.\n\t\t\tsetSettingsDrawerInset( side === 'left' ? adminMenuInset : 0 );\n\t\t\tsetSettingsWidgetUuid( widget.uuid );\n\t\t},\n\t\t[\n\t\t\tsetSettingsDrawerSide,\n\t\t\tsetSettingsDrawerInset,\n\t\t\tsetSettingsWidgetUuid,\n\t\t\twidget.uuid,\n\t\t]\n\t);\n\n\tif ( ! widgetType.attributes?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<IconButton\n\t\t\ticon={ cog }\n\t\t\tlabel={ __( 'Widget settings' ) }\n\t\t\tvariant=\"minimal\"\n\t\t\ttone=\"neutral\"\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ open }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA4B;AAC5B,kBAAmB;AACnB,mBAAoB;AAGpB,gBAA2B;AAM3B,wBAAsC;AACtC,mBAAkC;AAuEhC;AA/CK,SAAS,sBAAuB;AAAA,EACtC;AAAA,EACA;AACD,GAAiD;AAChD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,yCAAsB;AAE1B,QAAM,WAAO;AAAA,IACZ,CAAE,UAA4C;AAI7C,YAAM,qBAAiB,gCAAkB;AAGzC,YAAM,OAAO,MAAM,cAAc;AAAA,QAChC;AAAA,MACD;AACA,YAAM,QACL,QAAQ,MAAM,eACb,sBAAsB;AACxB,YAAM,eAAe,KAAK,OAAO,KAAK,QAAQ;AAC9C,YAAM,iBAAkB,iBAAiB,OAAO,cAAe;AAC/D,YAAM,OAAO,eAAe,gBAAgB,SAAS;AAErD,4BAAuB,IAAK;AAG5B,6BAAwB,SAAS,SAAS,iBAAiB,CAAE;AAC7D,4BAAuB,OAAO,IAAK;AAAA,IACpC;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,IACR;AAAA,EACD;AAEA,MAAK,CAAE,WAAW,YAAY,QAAS;AACtC,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO;AAAA,MACP,WAAQ,gBAAI,iBAAkB;AAAA,MAC9B,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,MAAK;AAAA,MACL,SAAU;AAAA;AAAA,EACX;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,269 @@
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-settings/widget-settings.tsx
21
+ var widget_settings_exports = {};
22
+ __export(widget_settings_exports, {
23
+ WidgetSettings: () => WidgetSettings
24
+ });
25
+ module.exports = __toCommonJS(widget_settings_exports);
26
+ var import_dataviews = require("@wordpress/dataviews");
27
+ var import_element = require("@wordpress/element");
28
+ var import_i18n = require("@wordpress/i18n");
29
+ var import_ui = require("@wordpress/ui");
30
+ var import_dashboard_context = require("../../context/dashboard-context.cjs");
31
+ var import_ui_context = require("../../context/ui-context.cjs");
32
+ var import_utils = require("./utils/index.cjs");
33
+
34
+ // packages/style-runtime/src/index.ts
35
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
36
+ function getRuntime() {
37
+ const globalScope = globalThis;
38
+ if (globalScope.__wpStyleRuntime) {
39
+ return globalScope.__wpStyleRuntime;
40
+ }
41
+ globalScope.__wpStyleRuntime = {
42
+ documents: /* @__PURE__ */ new Map(),
43
+ styles: /* @__PURE__ */ new Map(),
44
+ injectedStyles: /* @__PURE__ */ new WeakMap()
45
+ };
46
+ if (typeof document !== "undefined") {
47
+ registerDocument(document);
48
+ }
49
+ return globalScope.__wpStyleRuntime;
50
+ }
51
+ function documentContainsStyleHash(targetDocument, hash) {
52
+ if (!targetDocument.head) {
53
+ return false;
54
+ }
55
+ for (const style of targetDocument.head.querySelectorAll(
56
+ `style[${STYLE_HASH_ATTRIBUTE}]`
57
+ )) {
58
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
59
+ return true;
60
+ }
61
+ }
62
+ return false;
63
+ }
64
+ function injectStyle(targetDocument, hash, css) {
65
+ if (!targetDocument.head) {
66
+ return;
67
+ }
68
+ const runtime = getRuntime();
69
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
70
+ if (!injectedStyles) {
71
+ injectedStyles = /* @__PURE__ */ new Set();
72
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
73
+ }
74
+ if (injectedStyles.has(hash)) {
75
+ return;
76
+ }
77
+ if (documentContainsStyleHash(targetDocument, hash)) {
78
+ injectedStyles.add(hash);
79
+ return;
80
+ }
81
+ const style = targetDocument.createElement("style");
82
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
83
+ style.appendChild(targetDocument.createTextNode(css));
84
+ targetDocument.head.appendChild(style);
85
+ injectedStyles.add(hash);
86
+ }
87
+ function registerDocument(targetDocument) {
88
+ const runtime = getRuntime();
89
+ runtime.documents.set(
90
+ targetDocument,
91
+ (runtime.documents.get(targetDocument) ?? 0) + 1
92
+ );
93
+ for (const [hash, css] of runtime.styles) {
94
+ injectStyle(targetDocument, hash, css);
95
+ }
96
+ return () => {
97
+ const count = runtime.documents.get(targetDocument);
98
+ if (count === void 0) {
99
+ return;
100
+ }
101
+ if (count <= 1) {
102
+ runtime.documents.delete(targetDocument);
103
+ return;
104
+ }
105
+ runtime.documents.set(targetDocument, count - 1);
106
+ };
107
+ }
108
+ function registerStyle(hash, css) {
109
+ const runtime = getRuntime();
110
+ runtime.styles.set(hash, css);
111
+ for (const targetDocument of runtime.documents.keys()) {
112
+ injectStyle(targetDocument, hash, css);
113
+ }
114
+ }
115
+
116
+ // packages/widget-dashboard/src/components/widget-settings/widget-settings.module.css
117
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
118
+ registerStyle("809494c486", "._34828f30ba41ad89__popup{margin-block-start:var(--wp-admin--admin-bar--height,0)}");
119
+ }
120
+ var widget_settings_default = { "popup": "_34828f30ba41ad89__popup" };
121
+
122
+ // packages/widget-dashboard/src/components/widget-settings/widget-settings.tsx
123
+ var import_jsx_runtime = require("react/jsx-runtime");
124
+ function WidgetSettings() {
125
+ const {
126
+ layout,
127
+ onLayoutChange,
128
+ widgetTypes,
129
+ commit,
130
+ cancel: cancelStaging,
131
+ hasUncommittedChanges
132
+ } = (0, import_dashboard_context.useDashboardInternalContext)();
133
+ const {
134
+ settingsWidgetUuid,
135
+ setSettingsWidgetUuid,
136
+ settingsDrawerSide,
137
+ settingsDrawerInset
138
+ } = (0, import_ui_context.useDashboardUIContext)();
139
+ const open = settingsWidgetUuid !== null;
140
+ const [lastWidgetUuid, setLastWidgetUuid] = (0, import_element.useState)(
141
+ settingsWidgetUuid
142
+ );
143
+ (0, import_element.useEffect)(() => {
144
+ if (settingsWidgetUuid) {
145
+ setLastWidgetUuid(settingsWidgetUuid);
146
+ }
147
+ }, [settingsWidgetUuid]);
148
+ const activeUuid = settingsWidgetUuid ?? lastWidgetUuid;
149
+ const widget = activeUuid ? layout.find((instance) => instance.uuid === activeUuid) : void 0;
150
+ const widgetType = widget ? widgetTypes.find((type) => type.name === widget.type) : void 0;
151
+ const fields = (0, import_element.useMemo)(
152
+ () => widgetType?.attributes ?? [],
153
+ [widgetType?.attributes]
154
+ );
155
+ const form = (0, import_element.useMemo)(
156
+ () => ({
157
+ layout: { type: "regular", labelPosition: "top" },
158
+ fields: fields.map((field) => field.id)
159
+ }),
160
+ [fields]
161
+ );
162
+ const handleChange = (0, import_element.useCallback)(
163
+ (edits) => {
164
+ if (!widget) {
165
+ return;
166
+ }
167
+ onLayoutChange(
168
+ layout.map(
169
+ (instance) => instance.uuid === widget.uuid ? {
170
+ ...instance,
171
+ attributes: {
172
+ ...instance.attributes,
173
+ ...edits
174
+ }
175
+ } : instance
176
+ )
177
+ );
178
+ },
179
+ [layout, onLayoutChange, widget]
180
+ );
181
+ const close = (0, import_element.useCallback)(
182
+ () => setSettingsWidgetUuid(null),
183
+ [setSettingsWidgetUuid]
184
+ );
185
+ const handleSave = (0, import_element.useCallback)(() => {
186
+ commit();
187
+ close();
188
+ }, [commit, close]);
189
+ const handleOpenChange = (0, import_element.useCallback)(
190
+ (nextOpen) => {
191
+ if (!nextOpen) {
192
+ cancelStaging();
193
+ close();
194
+ }
195
+ },
196
+ [cancelStaging, close]
197
+ );
198
+ const popupStyle = (0, import_element.useMemo)(
199
+ () => settingsDrawerSide === "left" && settingsDrawerInset > 0 ? { marginLeft: settingsDrawerInset } : {},
200
+ [settingsDrawerSide, settingsDrawerInset]
201
+ );
202
+ const hasForm = !!widget && !!widgetType && fields.length > 0;
203
+ if (!hasForm) {
204
+ return null;
205
+ }
206
+ const title = (0, import_utils.getWidgetSettingsTitle)(widgetType);
207
+ const data = widget?.attributes ?? widgetType?.example?.attributes ?? {};
208
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
209
+ import_ui.Drawer.Root,
210
+ {
211
+ open,
212
+ onOpenChange: handleOpenChange,
213
+ swipeDirection: settingsDrawerSide,
214
+ modal: false,
215
+ disablePointerDismissal: true,
216
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
217
+ import_ui.Drawer.Popup,
218
+ {
219
+ size: "medium",
220
+ className: widget_settings_default.popup,
221
+ style: popupStyle,
222
+ children: [
223
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Drawer.Header, { children: [
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Drawer.Title, { children: title }),
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Drawer.CloseIcon, {})
226
+ ] }),
227
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Drawer.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
228
+ import_dataviews.DataForm,
229
+ {
230
+ data,
231
+ fields,
232
+ form,
233
+ onChange: handleChange
234
+ }
235
+ ) }),
236
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Drawer.Footer, { children: [
237
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
238
+ import_ui.Button,
239
+ {
240
+ variant: "minimal",
241
+ tone: "brand",
242
+ size: "compact",
243
+ onClick: () => handleOpenChange(false),
244
+ children: (0, import_i18n.__)("Cancel")
245
+ }
246
+ ),
247
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
248
+ import_ui.Button,
249
+ {
250
+ variant: "solid",
251
+ tone: "brand",
252
+ size: "compact",
253
+ onClick: handleSave,
254
+ disabled: !hasUncommittedChanges,
255
+ children: (0, import_i18n.__)("Save")
256
+ }
257
+ )
258
+ ] })
259
+ ]
260
+ }
261
+ )
262
+ }
263
+ );
264
+ }
265
+ // Annotate the CommonJS export names for ESM import in node:
266
+ 0 && (module.exports = {
267
+ WidgetSettings
268
+ });
269
+ //# sourceMappingURL=widget-settings.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-settings/widget-settings.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-settings/widget-settings.module.css"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { DataForm } from '@wordpress/dataviews';\nimport type { Field, Form } from '@wordpress/dataviews';\nimport { useCallback, useEffect, useMemo, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n// Dashboard is still experimental.\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Button, Drawer } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { useDashboardUIContext } from '../../context/ui-context';\nimport { getWidgetSettingsTitle } from './utils';\nimport styles from './widget-settings.module.css';\n\ntype WidgetAttributes = Record< string, unknown >;\n\n/**\n * Side drawer that edits one instance's attributes, mounted once at the\n * dashboard root. It resolves the active instance from `settingsWidgetUuid`\n * in the UI context (set by the per-instance gear), renders the type's\n * declarative `attributes` through `DataForm`, and enters from the edge away\n * from the widget.\n *\n * Edits write to the staging layer, so they preview live behind the drawer\n * and are published on Save or reverted on any other exit. Available in\n * normal mode only; the gear is hidden while the layout is being edited.\n */\nexport function WidgetSettings(): React.ReactNode {\n\tconst {\n\t\tlayout,\n\t\tonLayoutChange,\n\t\twidgetTypes,\n\t\tcommit,\n\t\tcancel: cancelStaging,\n\t\thasUncommittedChanges,\n\t} = useDashboardInternalContext();\n\tconst {\n\t\tsettingsWidgetUuid,\n\t\tsetSettingsWidgetUuid,\n\t\tsettingsDrawerSide,\n\t\tsettingsDrawerInset,\n\t} = useDashboardUIContext();\n\n\tconst open = settingsWidgetUuid !== null;\n\n\t// Keep the last opened instance resolved while the drawer animates\n\t// closed so its form and title don't blank out mid-transition. While\n\t// open the live `settingsWidgetUuid` wins, so opening shows no stale\n\t// frame.\n\tconst [ lastWidgetUuid, setLastWidgetUuid ] = useState< string | null >(\n\t\tsettingsWidgetUuid\n\t);\n\tuseEffect( () => {\n\t\tif ( settingsWidgetUuid ) {\n\t\t\tsetLastWidgetUuid( settingsWidgetUuid );\n\t\t}\n\t}, [ settingsWidgetUuid ] );\n\n\tconst activeUuid = settingsWidgetUuid ?? lastWidgetUuid;\n\tconst widget = activeUuid\n\t\t? layout.find( ( instance ) => instance.uuid === activeUuid )\n\t\t: undefined;\n\tconst widgetType = widget\n\t\t? widgetTypes.find( ( type ) => type.name === widget.type )\n\t\t: undefined;\n\n\tconst fields = useMemo< Field< WidgetAttributes >[] >(\n\t\t() => ( widgetType?.attributes ?? [] ) as Field< WidgetAttributes >[],\n\t\t[ widgetType?.attributes ]\n\t);\n\n\tconst form = useMemo< Form >(\n\t\t() => ( {\n\t\t\tlayout: { type: 'regular', labelPosition: 'top' },\n\t\t\tfields: fields.map( ( field ) => field.id ),\n\t\t} ),\n\t\t[ fields ]\n\t);\n\n\tconst handleChange = useCallback(\n\t\t( edits: Record< string, unknown > ) => {\n\t\t\tif ( ! widget ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonLayoutChange(\n\t\t\t\tlayout.map( ( instance ) =>\n\t\t\t\t\tinstance.uuid === widget.uuid\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t...instance,\n\t\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t\t...( instance.attributes as object ),\n\t\t\t\t\t\t\t\t\t...edits,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: instance\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\t\t[ layout, onLayoutChange, widget ]\n\t);\n\n\tconst close = useCallback(\n\t\t() => setSettingsWidgetUuid( null ),\n\t\t[ setSettingsWidgetUuid ]\n\t);\n\n\tconst handleSave = useCallback( () => {\n\t\tcommit();\n\t\tclose();\n\t}, [ commit, close ] );\n\n\tconst handleOpenChange = useCallback(\n\t\t( nextOpen: boolean ) => {\n\t\t\t// Any path out of the drawer other than Save discards the\n\t\t\t// staged edits, matching the layout-settings drawer.\n\t\t\tif ( ! nextOpen ) {\n\t\t\t\tcancelStaging();\n\t\t\t\tclose();\n\t\t\t}\n\t\t},\n\t\t[ cancelStaging, close ]\n\t);\n\n\t// For a left drawer, clear the fixed admin menu on the inline-start\n\t// edge so the drawer lands beside it. The admin bar at the top is\n\t// cleared in the CSS module.\n\tconst popupStyle = useMemo< React.CSSProperties >(\n\t\t() =>\n\t\t\tsettingsDrawerSide === 'left' && settingsDrawerInset > 0\n\t\t\t\t? { marginLeft: settingsDrawerInset }\n\t\t\t\t: {},\n\t\t[ settingsDrawerSide, settingsDrawerInset ]\n\t);\n\n\tconst hasForm = !! widget && !! widgetType && fields.length > 0;\n\n\tif ( ! hasForm ) {\n\t\treturn null;\n\t}\n\n\tconst title = getWidgetSettingsTitle( widgetType );\n\tconst data = ( widget?.attributes ??\n\t\twidgetType?.example?.attributes ??\n\t\t{} ) as WidgetAttributes;\n\n\treturn (\n\t\t<Drawer.Root\n\t\t\topen={ open }\n\t\t\tonOpenChange={ handleOpenChange }\n\t\t\tswipeDirection={ settingsDrawerSide }\n\t\t\tmodal={ false }\n\t\t\tdisablePointerDismissal\n\t\t>\n\t\t\t<Drawer.Popup\n\t\t\t\tsize=\"medium\"\n\t\t\t\tclassName={ styles.popup }\n\t\t\t\tstyle={ popupStyle }\n\t\t\t>\n\t\t\t\t<Drawer.Header>\n\t\t\t\t\t<Drawer.Title>{ title }</Drawer.Title>\n\t\t\t\t\t<Drawer.CloseIcon />\n\t\t\t\t</Drawer.Header>\n\n\t\t\t\t<Drawer.Content>\n\t\t\t\t\t<DataForm< WidgetAttributes >\n\t\t\t\t\t\tdata={ data }\n\t\t\t\t\t\tfields={ fields }\n\t\t\t\t\t\tform={ form }\n\t\t\t\t\t\tonChange={ handleChange }\n\t\t\t\t\t/>\n\t\t\t\t</Drawer.Content>\n\n\t\t\t\t<Drawer.Footer>\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={ () => handleOpenChange( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\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={ handleSave }\n\t\t\t\t\t\tdisabled={ ! hasUncommittedChanges }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</Drawer.Footer>\n\t\t\t</Drawer.Popup>\n\t\t</Drawer.Root>\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(\"809494c486\", \"._34828f30ba41ad89__popup{margin-block-start:var(--wp-admin--admin-bar--height,0)}\");\n}\nexport default {\"popup\":\"_34828f30ba41ad89__popup\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAyB;AAEzB,qBAA0D;AAC1D,kBAAmB;AAGnB,gBAA+B;AAK/B,+BAA4C;AAC5C,wBAAsC;AACtC,mBAAuC;;;ACNvC,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,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,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