@wordpress/widget-dashboard 0.1.1-next.v.202606191442.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 +226 -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,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": ";AAGA,SAAS,gBAAgB;AAEzB,SAAS,aAAa,WAAW,SAAS,gBAAgB;AAC1D,SAAS,UAAU;AAGnB,SAAS,QAAQ,cAAc;AAK/B,SAAS,mCAAmC;AAC5C,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;;;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,EA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AA,kCAAC,OAAO,OAAP,EAAe,iBAAO;AAAA,cACvB,oBAAC,OAAO,WAAP,EAAiB;AAAA,eACnB;AAAA,YAEA,oBAAC,OAAO,SAAP,EACA;AAAA,cAAC;AAAA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,UAAW;AAAA;AAAA,YACZ,GACD;AAAA,YAEA,qBAAC,OAAO,QAAP,EACA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,MAAK;AAAA,kBACL,SAAU,MAAM,iBAAkB,KAAM;AAAA,kBAEtC,aAAI,QAAS;AAAA;AAAA,cAChB;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,MAAK;AAAA,kBACL,SAAU;AAAA,kBACV,UAAW,CAAE;AAAA,kBAEX,aAAI,MAAO;AAAA;AAAA,cACd;AAAA,eACD;AAAA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/widget-dashboard/src/components/widget-toolbar/index.ts
2
+ import { WidgetToolbar } from "./widget-toolbar.mjs";
3
+ export {
4
+ WidgetToolbar
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-toolbar/index.ts"],
4
+ "sourcesContent": ["export { WidgetToolbar } from './widget-toolbar';\nexport type { WidgetToolbarProps } from './widget-toolbar';\n"],
5
+ "mappings": ";AAAA,SAAS,qBAAqB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,113 @@
1
+ // packages/widget-dashboard/src/components/widget-toolbar/widget-toolbar.tsx
2
+ import clsx from "clsx";
3
+ import { Stack } from "@wordpress/ui";
4
+
5
+ // packages/style-runtime/src/index.ts
6
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
7
+ function getRuntime() {
8
+ const globalScope = globalThis;
9
+ if (globalScope.__wpStyleRuntime) {
10
+ return globalScope.__wpStyleRuntime;
11
+ }
12
+ globalScope.__wpStyleRuntime = {
13
+ documents: /* @__PURE__ */ new Map(),
14
+ styles: /* @__PURE__ */ new Map(),
15
+ injectedStyles: /* @__PURE__ */ new WeakMap()
16
+ };
17
+ if (typeof document !== "undefined") {
18
+ registerDocument(document);
19
+ }
20
+ return globalScope.__wpStyleRuntime;
21
+ }
22
+ function documentContainsStyleHash(targetDocument, hash) {
23
+ if (!targetDocument.head) {
24
+ return false;
25
+ }
26
+ for (const style of targetDocument.head.querySelectorAll(
27
+ `style[${STYLE_HASH_ATTRIBUTE}]`
28
+ )) {
29
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
30
+ return true;
31
+ }
32
+ }
33
+ return false;
34
+ }
35
+ function injectStyle(targetDocument, hash, css) {
36
+ if (!targetDocument.head) {
37
+ return;
38
+ }
39
+ const runtime = getRuntime();
40
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
41
+ if (!injectedStyles) {
42
+ injectedStyles = /* @__PURE__ */ new Set();
43
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
44
+ }
45
+ if (injectedStyles.has(hash)) {
46
+ return;
47
+ }
48
+ if (documentContainsStyleHash(targetDocument, hash)) {
49
+ injectedStyles.add(hash);
50
+ return;
51
+ }
52
+ const style = targetDocument.createElement("style");
53
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
54
+ style.appendChild(targetDocument.createTextNode(css));
55
+ targetDocument.head.appendChild(style);
56
+ injectedStyles.add(hash);
57
+ }
58
+ function registerDocument(targetDocument) {
59
+ const runtime = getRuntime();
60
+ runtime.documents.set(
61
+ targetDocument,
62
+ (runtime.documents.get(targetDocument) ?? 0) + 1
63
+ );
64
+ for (const [hash, css] of runtime.styles) {
65
+ injectStyle(targetDocument, hash, css);
66
+ }
67
+ return () => {
68
+ const count = runtime.documents.get(targetDocument);
69
+ if (count === void 0) {
70
+ return;
71
+ }
72
+ if (count <= 1) {
73
+ runtime.documents.delete(targetDocument);
74
+ return;
75
+ }
76
+ runtime.documents.set(targetDocument, count - 1);
77
+ };
78
+ }
79
+ function registerStyle(hash, css) {
80
+ const runtime = getRuntime();
81
+ runtime.styles.set(hash, css);
82
+ for (const targetDocument of runtime.documents.keys()) {
83
+ injectStyle(targetDocument, hash, css);
84
+ }
85
+ }
86
+
87
+ // packages/widget-dashboard/src/components/widget-toolbar/widget-toolbar.module.css
88
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
89
+ registerStyle("c8afc26222", "._4a01b99834540429__widgetToolbar{border-radius:var(--wpds-border-radius-md,4px);inset-block-start:var(--wpds-dimension-padding-sm,8px);inset-inline-end:var(--wpds-dimension-padding-sm,8px);padding:var(--wpds-dimension-padding-xs,4px);position:absolute;z-index:1}");
90
+ }
91
+ var widget_toolbar_default = { "widgetToolbar": "_4a01b99834540429__widgetToolbar" };
92
+
93
+ // packages/widget-dashboard/src/components/widget-toolbar/widget-toolbar.tsx
94
+ import { jsx } from "react/jsx-runtime";
95
+ function WidgetToolbar({
96
+ children,
97
+ className
98
+ }) {
99
+ return /* @__PURE__ */ jsx(
100
+ Stack,
101
+ {
102
+ direction: "row",
103
+ align: "center",
104
+ gap: "xs",
105
+ className: clsx(widget_toolbar_default.widgetToolbar, className),
106
+ children
107
+ }
108
+ );
109
+ }
110
+ export {
111
+ WidgetToolbar
112
+ };
113
+ //# sourceMappingURL=widget-toolbar.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-toolbar/widget-toolbar.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-toolbar/widget-toolbar.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport styles from './widget-toolbar.module.css';\n\nexport interface WidgetToolbarProps {\n\t/** Toolbar controls, laid out in one row. */\n\tchildren: ReactNode;\n\n\t/** Variant surface class (background, reveal). */\n\tclassName?: string;\n}\n\n/**\n * Shared shell for the per-tile action toolbars. Anchors to the tile's\n * top-right corner and lays controls out in the row the header also uses, so\n * a toolbar lines up with the title when they overlap.\n *\n * @param {WidgetToolbarProps} props Component props.\n */\nexport function WidgetToolbar( {\n\tchildren,\n\tclassName,\n}: WidgetToolbarProps ): React.ReactNode {\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"row\"\n\t\t\talign=\"center\"\n\t\t\tgap=\"xs\"\n\t\t\tclassName={ clsx( styles.widgetToolbar, className ) }\n\t\t>\n\t\t\t{ children }\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(\"c8afc26222\", \"._4a01b99834540429__widgetToolbar{border-radius:var(--wpds-border-radius-md,4px);inset-block-start:var(--wpds-dimension-padding-sm,8px);inset-inline-end:var(--wpds-dimension-padding-sm,8px);padding:var(--wpds-dimension-padding-xs,4px);position:absolute;z-index:1}\");\n}\nexport default {\"widgetToolbar\":\"_4a01b99834540429__widgetToolbar\"};\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAMjB,SAAS,aAAa;;;ACCtB,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,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AAM,QAAQ,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,yQAAyQ;AACtS;AACA,IAAO,yBAAQ,EAAC,iBAAgB,mCAAkC;;;AFgChE;AALK,SAAS,cAAe;AAAA,EAC9B;AAAA,EACA;AACD,GAAyC;AACxC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAM;AAAA,MACN,KAAI;AAAA,MACJ,WAAY,KAAM,uBAAO,eAAe,SAAU;AAAA,MAEhD;AAAA;AAAA,EACH;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/widget-dashboard/src/components/widgets/index.ts
2
+ import { Widgets } from "./widgets.mjs";
3
+ export {
4
+ Widgets
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widgets/index.ts"],
4
+ "sourcesContent": ["export { Widgets } from './widgets';\n"],
5
+ "mappings": ";AAAA,SAAS,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,181 @@
1
+ // packages/widget-dashboard/src/components/widgets/widget-layout-toolbar.tsx
2
+ import { privateApis as componentsPrivateApis } from "@wordpress/components";
3
+ import { __ } from "@wordpress/i18n";
4
+ import { moreVertical, trash } from "@wordpress/icons";
5
+ import { IconButton } from "@wordpress/ui";
6
+ import { unlock } from "../../lock-unlock.mjs";
7
+ import { useDashboardInternalContext } from "../../context/dashboard-context.mjs";
8
+ import { WidgetToolbar } from "../widget-toolbar/index.mjs";
9
+
10
+ // packages/style-runtime/src/index.ts
11
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
12
+ function getRuntime() {
13
+ const globalScope = globalThis;
14
+ if (globalScope.__wpStyleRuntime) {
15
+ return globalScope.__wpStyleRuntime;
16
+ }
17
+ globalScope.__wpStyleRuntime = {
18
+ documents: /* @__PURE__ */ new Map(),
19
+ styles: /* @__PURE__ */ new Map(),
20
+ injectedStyles: /* @__PURE__ */ new WeakMap()
21
+ };
22
+ if (typeof document !== "undefined") {
23
+ registerDocument(document);
24
+ }
25
+ return globalScope.__wpStyleRuntime;
26
+ }
27
+ function documentContainsStyleHash(targetDocument, hash) {
28
+ if (!targetDocument.head) {
29
+ return false;
30
+ }
31
+ for (const style of targetDocument.head.querySelectorAll(
32
+ `style[${STYLE_HASH_ATTRIBUTE}]`
33
+ )) {
34
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
35
+ return true;
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ function injectStyle(targetDocument, hash, css) {
41
+ if (!targetDocument.head) {
42
+ return;
43
+ }
44
+ const runtime = getRuntime();
45
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
46
+ if (!injectedStyles) {
47
+ injectedStyles = /* @__PURE__ */ new Set();
48
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
49
+ }
50
+ if (injectedStyles.has(hash)) {
51
+ return;
52
+ }
53
+ if (documentContainsStyleHash(targetDocument, hash)) {
54
+ injectedStyles.add(hash);
55
+ return;
56
+ }
57
+ const style = targetDocument.createElement("style");
58
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
59
+ style.appendChild(targetDocument.createTextNode(css));
60
+ targetDocument.head.appendChild(style);
61
+ injectedStyles.add(hash);
62
+ }
63
+ function registerDocument(targetDocument) {
64
+ const runtime = getRuntime();
65
+ runtime.documents.set(
66
+ targetDocument,
67
+ (runtime.documents.get(targetDocument) ?? 0) + 1
68
+ );
69
+ for (const [hash, css] of runtime.styles) {
70
+ injectStyle(targetDocument, hash, css);
71
+ }
72
+ return () => {
73
+ const count = runtime.documents.get(targetDocument);
74
+ if (count === void 0) {
75
+ return;
76
+ }
77
+ if (count <= 1) {
78
+ runtime.documents.delete(targetDocument);
79
+ return;
80
+ }
81
+ runtime.documents.set(targetDocument, count - 1);
82
+ };
83
+ }
84
+ function registerStyle(hash, css) {
85
+ const runtime = getRuntime();
86
+ runtime.styles.set(hash, css);
87
+ for (const targetDocument of runtime.documents.keys()) {
88
+ injectStyle(targetDocument, hash, css);
89
+ }
90
+ }
91
+
92
+ // packages/widget-dashboard/src/components/widgets/widget-layout-toolbar.module.css
93
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
94
+ registerStyle("2696f7462d", "._6f7360b4588de00a__widgetLayoutToolbar{background:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);box-shadow:var(--wpds-elevation-xs,0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003)}");
95
+ }
96
+ var widget_layout_toolbar_default = { "widgetLayoutToolbar": "_6f7360b4588de00a__widgetLayoutToolbar" };
97
+
98
+ // packages/widget-dashboard/src/components/widgets/widget-layout-toolbar.tsx
99
+ import { jsx, jsxs } from "react/jsx-runtime";
100
+ var { Menu } = unlock(componentsPrivateApis);
101
+ function WidgetLayoutToolbar({
102
+ widget
103
+ }) {
104
+ const { layout, onLayoutChange } = useDashboardInternalContext();
105
+ const width = widget.placement?.width;
106
+ const updateWidth = (nextWidth) => {
107
+ const nextLayout = layout.map(
108
+ (currentWidget) => currentWidget.uuid === widget.uuid ? {
109
+ ...currentWidget,
110
+ placement: {
111
+ ...currentWidget.placement,
112
+ width: nextWidth
113
+ }
114
+ } : currentWidget
115
+ );
116
+ onLayoutChange(nextLayout);
117
+ };
118
+ const onNamedWidthChange = (nextWidth) => {
119
+ updateWidth(nextWidth);
120
+ };
121
+ const onRemove = () => {
122
+ onLayoutChange(
123
+ layout.filter(
124
+ (currentWidget) => currentWidget.uuid !== widget.uuid
125
+ )
126
+ );
127
+ };
128
+ return /* @__PURE__ */ jsxs(WidgetToolbar, { className: widget_layout_toolbar_default.widgetLayoutToolbar, children: [
129
+ /* @__PURE__ */ jsxs(Menu, { children: [
130
+ /* @__PURE__ */ jsx(
131
+ Menu.TriggerButton,
132
+ {
133
+ render: /* @__PURE__ */ jsx(
134
+ IconButton,
135
+ {
136
+ icon: moreVertical,
137
+ label: __("Widget options"),
138
+ size: "compact",
139
+ variant: "minimal",
140
+ tone: "neutral"
141
+ }
142
+ )
143
+ }
144
+ ),
145
+ /* @__PURE__ */ jsx(Menu.Popover, { children: /* @__PURE__ */ jsxs(Menu.Group, { children: [
146
+ /* @__PURE__ */ jsx(Menu.GroupLabel, { children: __("Width") }),
147
+ /* @__PURE__ */ jsx(
148
+ Menu.Item,
149
+ {
150
+ disabled: width === "fill",
151
+ onClick: () => onNamedWidthChange("fill"),
152
+ children: /* @__PURE__ */ jsx(Menu.ItemLabel, { children: __("Use available width") })
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsx(
156
+ Menu.Item,
157
+ {
158
+ disabled: width === "full",
159
+ onClick: () => onNamedWidthChange("full"),
160
+ children: /* @__PURE__ */ jsx(Menu.ItemLabel, { children: __("Make full width") })
161
+ }
162
+ )
163
+ ] }) })
164
+ ] }),
165
+ /* @__PURE__ */ jsx(
166
+ IconButton,
167
+ {
168
+ icon: trash,
169
+ label: __("Remove"),
170
+ size: "compact",
171
+ variant: "minimal",
172
+ tone: "neutral",
173
+ onClick: onRemove
174
+ }
175
+ )
176
+ ] });
177
+ }
178
+ export {
179
+ WidgetLayoutToolbar
180
+ };
181
+ //# sourceMappingURL=widget-layout-toolbar.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widgets/widget-layout-toolbar.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widgets/widget-layout-toolbar.module.css"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical, trash } from '@wordpress/icons';\n// Dashboard is still experimental.\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { IconButton } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { WidgetToolbar } from '../widget-toolbar';\nimport styles from './widget-layout-toolbar.module.css';\nimport type { DashboardWidget, GridTilePlacement } from '../../types';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\ntype NamedGridWidth = Exclude<\n\tNonNullable< GridTilePlacement[ 'width' ] >,\n\tnumber\n>;\n\nexport interface WidgetLayoutToolbarProps {\n\t/** The instance this toolbar manages within the layout. */\n\twidget: DashboardWidget< unknown >;\n}\n\n/**\n * Customize-mode per-tile toolbar: a width menu and removal, editing the\n * widget's place in the layout. Lives in the grid's `actionableArea` slot, so\n * it stays interactive while the card is `inert`.\n *\n * @param {WidgetLayoutToolbarProps} props Component props.\n */\nexport function WidgetLayoutToolbar( {\n\twidget,\n}: WidgetLayoutToolbarProps ): React.ReactNode {\n\tconst { layout, onLayoutChange } = useDashboardInternalContext();\n\tconst width = widget.placement?.width;\n\n\tconst updateWidth = ( nextWidth: GridTilePlacement[ 'width' ] ) => {\n\t\tconst nextLayout = layout.map( ( currentWidget ) =>\n\t\t\tcurrentWidget.uuid === widget.uuid\n\t\t\t\t? {\n\t\t\t\t\t\t...currentWidget,\n\t\t\t\t\t\tplacement: {\n\t\t\t\t\t\t\t...currentWidget.placement,\n\t\t\t\t\t\t\twidth: nextWidth,\n\t\t\t\t\t\t},\n\t\t\t\t }\n\t\t\t\t: currentWidget\n\t\t);\n\t\tonLayoutChange( nextLayout );\n\t};\n\n\tconst onNamedWidthChange = ( nextWidth: NamedGridWidth ) => {\n\t\tupdateWidth( nextWidth );\n\t};\n\n\tconst onRemove = () => {\n\t\tonLayoutChange(\n\t\t\tlayout.filter(\n\t\t\t\t( currentWidget ) => currentWidget.uuid !== widget.uuid\n\t\t\t)\n\t\t);\n\t};\n\n\treturn (\n\t\t<WidgetToolbar className={ styles.widgetLayoutToolbar }>\n\t\t\t<Menu>\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Widget options' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<Menu.Group>\n\t\t\t\t\t\t<Menu.GroupLabel>{ __( 'Width' ) }</Menu.GroupLabel>\n\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\tdisabled={ width === 'fill' }\n\t\t\t\t\t\t\tonClick={ () => onNamedWidthChange( 'fill' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t{ __( 'Use available width' ) }\n\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\tdisabled={ width === 'full' }\n\t\t\t\t\t\t\tonClick={ () => onNamedWidthChange( 'full' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t{ __( 'Make full width' ) }\n\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t</Menu.Group>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t<IconButton\n\t\t\t\ticon={ trash }\n\t\t\t\tlabel={ __( 'Remove' ) }\n\t\t\t\tsize=\"compact\"\n\t\t\t\tvariant=\"minimal\"\n\t\t\t\ttone=\"neutral\"\n\t\t\t\tonClick={ onRemove }\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(\"2696f7462d\", \"._6f7360b4588de00a__widgetLayoutToolbar{background:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);box-shadow:var(--wpds-elevation-xs,0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003)}\");\n}\nexport default {\"widgetLayoutToolbar\":\"_6f7360b4588de00a__widgetLayoutToolbar\"};\n"],
5
+ "mappings": ";AAGA,SAAS,eAAe,6BAA6B;AACrD,SAAS,UAAU;AACnB,SAAS,cAAc,aAAa;AAGpC,SAAS,kBAAkB;AAK3B,SAAS,cAAc;AACvB,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB;;;ACL9B,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,IACh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yBAAC,QACA;AAAA;AAAA,QAAC,KAAK;AAAA,QAAL;AAAA,UACA,QACC;AAAA,YAAC;AAAA;AAAA,cACA,MAAO;AAAA,cACP,OAAQ,GAAI,gBAAiB;AAAA,cAC7B,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,MAAK;AAAA;AAAA,UACN;AAAA;AAAA,MAEF;AAAA,MACA,oBAAC,KAAK,SAAL,EACA,+BAAC,KAAK,OAAL,EACA;AAAA,4BAAC,KAAK,YAAL,EAAkB,aAAI,OAAQ,GAAG;AAAA,QAClC;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACA,UAAW,UAAU;AAAA,YACrB,SAAU,MAAM,mBAAoB,MAAO;AAAA,YAE3C,8BAAC,KAAK,WAAL,EACE,aAAI,qBAAsB,GAC7B;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACA,UAAW,UAAU;AAAA,YACrB,SAAU,MAAM,mBAAoB,MAAO;AAAA,YAE3C,8BAAC,KAAK,WAAL,EACE,aAAI,iBAAkB,GACzB;AAAA;AAAA,QACD;AAAA,SACD,GACD;AAAA,OACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP,OAAQ,GAAI,QAAS;AAAA,QACrB,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,SAAU;AAAA;AAAA,IACX;AAAA,KACD;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,128 @@
1
+ // packages/widget-dashboard/src/components/widgets/widget-resize-handle.tsx
2
+ import clsx from "clsx";
3
+ import { forwardRef } from "@wordpress/element";
4
+
5
+ // packages/style-runtime/src/index.ts
6
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
7
+ function getRuntime() {
8
+ const globalScope = globalThis;
9
+ if (globalScope.__wpStyleRuntime) {
10
+ return globalScope.__wpStyleRuntime;
11
+ }
12
+ globalScope.__wpStyleRuntime = {
13
+ documents: /* @__PURE__ */ new Map(),
14
+ styles: /* @__PURE__ */ new Map(),
15
+ injectedStyles: /* @__PURE__ */ new WeakMap()
16
+ };
17
+ if (typeof document !== "undefined") {
18
+ registerDocument(document);
19
+ }
20
+ return globalScope.__wpStyleRuntime;
21
+ }
22
+ function documentContainsStyleHash(targetDocument, hash) {
23
+ if (!targetDocument.head) {
24
+ return false;
25
+ }
26
+ for (const style of targetDocument.head.querySelectorAll(
27
+ `style[${STYLE_HASH_ATTRIBUTE}]`
28
+ )) {
29
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
30
+ return true;
31
+ }
32
+ }
33
+ return false;
34
+ }
35
+ function injectStyle(targetDocument, hash, css) {
36
+ if (!targetDocument.head) {
37
+ return;
38
+ }
39
+ const runtime = getRuntime();
40
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
41
+ if (!injectedStyles) {
42
+ injectedStyles = /* @__PURE__ */ new Set();
43
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
44
+ }
45
+ if (injectedStyles.has(hash)) {
46
+ return;
47
+ }
48
+ if (documentContainsStyleHash(targetDocument, hash)) {
49
+ injectedStyles.add(hash);
50
+ return;
51
+ }
52
+ const style = targetDocument.createElement("style");
53
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
54
+ style.appendChild(targetDocument.createTextNode(css));
55
+ targetDocument.head.appendChild(style);
56
+ injectedStyles.add(hash);
57
+ }
58
+ function registerDocument(targetDocument) {
59
+ const runtime = getRuntime();
60
+ runtime.documents.set(
61
+ targetDocument,
62
+ (runtime.documents.get(targetDocument) ?? 0) + 1
63
+ );
64
+ for (const [hash, css] of runtime.styles) {
65
+ injectStyle(targetDocument, hash, css);
66
+ }
67
+ return () => {
68
+ const count = runtime.documents.get(targetDocument);
69
+ if (count === void 0) {
70
+ return;
71
+ }
72
+ if (count <= 1) {
73
+ runtime.documents.delete(targetDocument);
74
+ return;
75
+ }
76
+ runtime.documents.set(targetDocument, count - 1);
77
+ };
78
+ }
79
+ function registerStyle(hash, css) {
80
+ const runtime = getRuntime();
81
+ runtime.styles.set(hash, css);
82
+ for (const targetDocument of runtime.documents.keys()) {
83
+ injectStyle(targetDocument, hash, css);
84
+ }
85
+ }
86
+
87
+ // packages/widget-dashboard/src/components/widgets/widget-resize-handle.module.css
88
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
89
+ registerStyle("426d5d3a15", '.a70c7d5347a2f54b__handle{--widget-resize-handle-visual-inset:var(--wpds-dimension-padding-xs,4px);--widget-resize-handle-hover-scale:1.18;background:transparent;bottom:0;box-sizing:border-box;inset-inline-end:0;padding:0;position:absolute;z-index:1}.a70c7d5347a2f54b__handle:focus-visible{border-radius:var(--wpds-border-radius-sm,2px);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:calc(var(--wpds-dimension-base, 4px)*.5)}.aa1d4aafe4d24e03__resizing{opacity:.72}._61d861c3afc33ad5__handleCorner{cursor:nwse-resize;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px)}._61d861c3afc33ad5__handleCorner:after{border-block-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-block-start:none;border-end-end-radius:var(--wpds-border-radius-md,4px);border-inline-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-inline-start:none;bottom:var(--widget-resize-handle-visual-inset);box-sizing:border-box;content:"";height:var(--wpds-dimension-size-4xs,8px);inset-inline-end:var(--widget-resize-handle-visual-inset);position:absolute;transform:scale(1);transform-origin:100% 100%;width:var(--wpds-dimension-size-4xs,8px)}[dir=rtl] ._61d861c3afc33ad5__handleCorner:after{transform-origin:0 100%}._61d861c3afc33ad5__handleCorner.aa1d4aafe4d24e03__resizing:after,._61d861c3afc33ad5__handleCorner:focus-visible:after,._61d861c3afc33ad5__handleCorner:hover:after{border-block-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));border-inline-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));transform:scale(var(--widget-resize-handle-hover-scale))}._86ab3a6eb52bc222__handleHorizontal{align-items:center;border:none;cursor:ew-resize;display:flex;height:var(--wpds-dimension-size-lg,40px);justify-content:center;padding-inline-end:var(--widget-resize-handle-visual-inset);width:var(--wpds-dimension-size-sm,24px)}@media not (prefers-reduced-motion){._61d861c3afc33ad5__handleCorner:after{transition:transform var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),border-block-end-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),border-inline-end-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}._86ab3a6eb52bc222__handleHorizontal:after{transition:transform var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),background-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}}._86ab3a6eb52bc222__handleHorizontal:after{background-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));content:"";height:var(--wpds-dimension-size-3xs,12px);transform:scale(1);transform-origin:50% 100%;width:var(--wpds-border-width-sm,2px)}._86ab3a6eb52bc222__handleHorizontal.aa1d4aafe4d24e03__resizing:after,._86ab3a6eb52bc222__handleHorizontal:focus-visible:after,._86ab3a6eb52bc222__handleHorizontal:hover:after{background-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));transform:scale(var(--widget-resize-handle-hover-scale))}@media (forced-colors:active){._61d861c3afc33ad5__handleCorner.aa1d4aafe4d24e03__resizing:after,._61d861c3afc33ad5__handleCorner:after,._61d861c3afc33ad5__handleCorner:focus-visible:after,._61d861c3afc33ad5__handleCorner:hover:after{border-block-end-color:Highlight;border-inline-end-color:Highlight}._86ab3a6eb52bc222__handleHorizontal.aa1d4aafe4d24e03__resizing:after,._86ab3a6eb52bc222__handleHorizontal:after,._86ab3a6eb52bc222__handleHorizontal:focus-visible:after,._86ab3a6eb52bc222__handleHorizontal:hover:after{background-color:Highlight}}');
90
+ }
91
+ var widget_resize_handle_default = { "handle": "a70c7d5347a2f54b__handle", "resizing": "aa1d4aafe4d24e03__resizing", "handleCorner": "_61d861c3afc33ad5__handleCorner", "handleHorizontal": "_86ab3a6eb52bc222__handleHorizontal" };
92
+
93
+ // packages/widget-dashboard/src/components/widgets/widget-resize-handle.tsx
94
+ import { jsx } from "react/jsx-runtime";
95
+ var WidgetResizeHandle = forwardRef(function WidgetResizeHandle2({ listeners, attributes, verticalResizable, isResizing }, ref) {
96
+ if (!verticalResizable) {
97
+ return /* @__PURE__ */ jsx(
98
+ "div",
99
+ {
100
+ ref,
101
+ className: clsx(
102
+ widget_resize_handle_default.handle,
103
+ widget_resize_handle_default.handleHorizontal,
104
+ isResizing && widget_resize_handle_default.resizing
105
+ ),
106
+ ...listeners,
107
+ ...attributes
108
+ }
109
+ );
110
+ }
111
+ return /* @__PURE__ */ jsx(
112
+ "div",
113
+ {
114
+ ref,
115
+ className: clsx(
116
+ widget_resize_handle_default.handle,
117
+ widget_resize_handle_default.handleCorner,
118
+ isResizing && widget_resize_handle_default.resizing
119
+ ),
120
+ ...listeners,
121
+ ...attributes
122
+ }
123
+ );
124
+ });
125
+ export {
126
+ WidgetResizeHandle
127
+ };
128
+ //# sourceMappingURL=widget-resize-handle.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widgets/widget-resize-handle.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widgets/widget-resize-handle.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport type { ResizeHandleRenderProps } from '@wordpress/grid';\n\n/**\n * Internal dependencies\n */\nimport styles from './widget-resize-handle.module.css';\n\ntype WidgetResizeHandleProps = Omit< ResizeHandleRenderProps, 'ref' >;\n\n/**\n * Rounded L-shaped resize affordance for the widget dashboard. Passed to\n * `DashboardGrid` via `renderResizeHandle` so the grid keeps gesture wiring.\n *\n * Uses `forwardRef` because the grid attaches dnd-kit's merged node ref via\n * the JSX `ref` attribute, not as a regular prop.\n */\nexport const WidgetResizeHandle = forwardRef<\n\tHTMLDivElement,\n\tWidgetResizeHandleProps\n>( function WidgetResizeHandle(\n\t{ listeners, attributes, verticalResizable, isResizing },\n\tref\n) {\n\tif ( ! verticalResizable ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tstyles.handle,\n\t\t\t\t\tstyles.handleHorizontal,\n\t\t\t\t\tisResizing && styles.resizing\n\t\t\t\t) }\n\t\t\t\t{ ...listeners }\n\t\t\t\t{ ...attributes }\n\t\t\t></div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx(\n\t\t\t\tstyles.handle,\n\t\t\t\tstyles.handleCorner,\n\t\t\t\tisResizing && styles.resizing\n\t\t\t) }\n\t\t\t{ ...listeners }\n\t\t\t{ ...attributes }\n\t\t></div>\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(\"426d5d3a15\", \".a70c7d5347a2f54b__handle{--widget-resize-handle-visual-inset:var(--wpds-dimension-padding-xs,4px);--widget-resize-handle-hover-scale:1.18;background:transparent;bottom:0;box-sizing:border-box;inset-inline-end:0;padding:0;position:absolute;z-index:1}.a70c7d5347a2f54b__handle:focus-visible{border-radius:var(--wpds-border-radius-sm,2px);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:calc(var(--wpds-dimension-base, 4px)*.5)}.aa1d4aafe4d24e03__resizing{opacity:.72}._61d861c3afc33ad5__handleCorner{cursor:nwse-resize;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px)}._61d861c3afc33ad5__handleCorner:after{border-block-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-block-start:none;border-end-end-radius:var(--wpds-border-radius-md,4px);border-inline-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-inline-start:none;bottom:var(--widget-resize-handle-visual-inset);box-sizing:border-box;content:\\\"\\\";height:var(--wpds-dimension-size-4xs,8px);inset-inline-end:var(--widget-resize-handle-visual-inset);position:absolute;transform:scale(1);transform-origin:100% 100%;width:var(--wpds-dimension-size-4xs,8px)}[dir=rtl] ._61d861c3afc33ad5__handleCorner:after{transform-origin:0 100%}._61d861c3afc33ad5__handleCorner.aa1d4aafe4d24e03__resizing:after,._61d861c3afc33ad5__handleCorner:focus-visible:after,._61d861c3afc33ad5__handleCorner:hover:after{border-block-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));border-inline-end:var(--wpds-border-width-sm,2px) solid var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));transform:scale(var(--widget-resize-handle-hover-scale))}._86ab3a6eb52bc222__handleHorizontal{align-items:center;border:none;cursor:ew-resize;display:flex;height:var(--wpds-dimension-size-lg,40px);justify-content:center;padding-inline-end:var(--widget-resize-handle-visual-inset);width:var(--wpds-dimension-size-sm,24px)}@media not (prefers-reduced-motion){._61d861c3afc33ad5__handleCorner:after{transition:transform var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),border-block-end-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),border-inline-end-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}._86ab3a6eb52bc222__handleHorizontal:after{transition:transform var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)),background-color var(--wpds-motion-duration-xs,50ms) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}}._86ab3a6eb52bc222__handleHorizontal:after{background-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));content:\\\"\\\";height:var(--wpds-dimension-size-3xs,12px);transform:scale(1);transform-origin:50% 100%;width:var(--wpds-border-width-sm,2px)}._86ab3a6eb52bc222__handleHorizontal.aa1d4aafe4d24e03__resizing:after,._86ab3a6eb52bc222__handleHorizontal:focus-visible:after,._86ab3a6eb52bc222__handleHorizontal:hover:after{background-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));transform:scale(var(--widget-resize-handle-hover-scale))}@media (forced-colors:active){._61d861c3afc33ad5__handleCorner.aa1d4aafe4d24e03__resizing:after,._61d861c3afc33ad5__handleCorner:after,._61d861c3afc33ad5__handleCorner:focus-visible:after,._61d861c3afc33ad5__handleCorner:hover:after{border-block-end-color:Highlight;border-inline-end-color:Highlight}._86ab3a6eb52bc222__handleHorizontal.aa1d4aafe4d24e03__resizing:after,._86ab3a6eb52bc222__handleHorizontal:after,._86ab3a6eb52bc222__handleHorizontal:focus-visible:after,._86ab3a6eb52bc222__handleHorizontal:hover:after{background-color:Highlight}}\");\n}\nexport default {\"handle\":\"a70c7d5347a2f54b__handle\",\"resizing\":\"aa1d4aafe4d24e03__resizing\",\"handleCorner\":\"_61d861c3afc33ad5__handleCorner\",\"handleHorizontal\":\"_86ab3a6eb52bc222__handleHorizontal\"};\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB;;;ACE3B,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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