@wordpress/widget-dashboard 0.1.1 → 0.3.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 (283) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +29 -16
  3. package/build/components/actions/actions.cjs +6 -23
  4. package/build/components/actions/actions.cjs.map +3 -3
  5. package/build/components/commands/commands.cjs +1 -60
  6. package/build/components/commands/commands.cjs.map +2 -2
  7. package/build/{utils/grid-model-change → components/widget-attribute-controls}/index.cjs +7 -9
  8. package/build/components/widget-attribute-controls/index.cjs.map +7 -0
  9. package/build/components/widget-attribute-controls/widget-attribute-controls.cjs +93 -0
  10. package/build/components/widget-attribute-controls/widget-attribute-controls.cjs.map +7 -0
  11. package/build/components/widget-chrome/widget-chrome.cjs +28 -69
  12. package/build/components/widget-chrome/widget-chrome.cjs.map +2 -2
  13. package/build/components/{layout-settings → widget-frame}/index.cjs +9 -7
  14. package/build/components/widget-frame/index.cjs.map +7 -0
  15. package/build/components/widget-frame/widget-frame.cjs +193 -0
  16. package/build/components/widget-frame/widget-frame.cjs.map +7 -0
  17. package/build/{utils/migrate-layout → components/widget-header}/index.cjs +7 -7
  18. package/build/components/widget-header/index.cjs.map +7 -0
  19. package/build/components/widget-header/widget-header-infotip.cjs +166 -0
  20. package/build/components/widget-header/widget-header-infotip.cjs.map +7 -0
  21. package/build/components/widget-header/widget-header.cjs +176 -0
  22. package/build/components/widget-header/widget-header.cjs.map +7 -0
  23. package/build/components/{widget-settings/utils/get-admin-menu-inset.cjs → widget-layout-controls/index.cjs} +8 -18
  24. package/build/components/widget-layout-controls/index.cjs.map +7 -0
  25. package/build/components/{widgets/widget-layout-toolbar.cjs → widget-layout-controls/widget-layout-controls.cjs} +9 -100
  26. package/build/components/widget-layout-controls/widget-layout-controls.cjs.map +7 -0
  27. package/build/components/widget-picker/widget-picker.cjs +5 -93
  28. package/build/components/widget-picker/widget-picker.cjs.map +3 -3
  29. package/build/components/widget-preview-chrome/index.cjs +31 -0
  30. package/build/components/widget-preview-chrome/index.cjs.map +7 -0
  31. package/build/components/{widget-settings/widget-settings-toolbar.cjs → widget-preview-chrome/widget-preview-chrome.cjs} +41 -23
  32. package/build/components/widget-preview-chrome/widget-preview-chrome.cjs.map +7 -0
  33. package/build/components/widget-settings/index.cjs +3 -3
  34. package/build/components/widget-settings/index.cjs.map +1 -1
  35. package/build/components/widget-settings/utils/index.cjs +0 -3
  36. package/build/components/widget-settings/utils/index.cjs.map +2 -2
  37. package/build/components/widget-settings/widget-settings-trigger.cjs +22 -28
  38. package/build/components/widget-settings/widget-settings-trigger.cjs.map +2 -2
  39. package/build/components/widget-settings/widget-settings.cjs +40 -57
  40. package/build/components/widget-settings/widget-settings.cjs.map +2 -2
  41. package/build/components/widget-toolbar/widget-toolbar.cjs +7 -4
  42. package/build/components/widget-toolbar/widget-toolbar.cjs.map +2 -2
  43. package/build/components/widgets/widget-resize-handle.cjs +4 -4
  44. package/build/components/widgets/widget-resize-handle.cjs.map +2 -2
  45. package/build/components/widgets/widgets.cjs +18 -11
  46. package/build/components/widgets/widgets.cjs.map +2 -2
  47. package/build/context/dashboard-context.cjs +31 -80
  48. package/build/context/dashboard-context.cjs.map +2 -2
  49. package/build/context/ui-context.cjs +2 -18
  50. package/build/context/ui-context.cjs.map +2 -2
  51. package/build/types.cjs.map +1 -1
  52. package/build/utils/index.cjs +2 -5
  53. package/build/utils/index.cjs.map +2 -2
  54. package/build/widget-dashboard.cjs +0 -4
  55. package/build/widget-dashboard.cjs.map +2 -2
  56. package/build-module/components/actions/actions.mjs +7 -24
  57. package/build-module/components/actions/actions.mjs.map +2 -2
  58. package/build-module/components/commands/commands.mjs +2 -67
  59. package/build-module/components/commands/commands.mjs.map +2 -2
  60. package/build-module/components/widget-attribute-controls/index.mjs +6 -0
  61. package/build-module/components/widget-attribute-controls/index.mjs.map +7 -0
  62. package/build-module/components/widget-attribute-controls/widget-attribute-controls.mjs +68 -0
  63. package/build-module/components/widget-attribute-controls/widget-attribute-controls.mjs.map +7 -0
  64. package/build-module/components/widget-chrome/widget-chrome.mjs +29 -76
  65. package/build-module/components/widget-chrome/widget-chrome.mjs.map +2 -2
  66. package/build-module/components/widget-frame/index.mjs +7 -0
  67. package/build-module/components/widget-frame/index.mjs.map +7 -0
  68. package/build-module/components/widget-frame/widget-frame.mjs +157 -0
  69. package/build-module/components/widget-frame/widget-frame.mjs.map +7 -0
  70. package/build-module/components/widget-header/index.mjs +6 -0
  71. package/build-module/components/widget-header/index.mjs.map +7 -0
  72. package/build-module/components/widget-header/widget-header-infotip.mjs +141 -0
  73. package/build-module/components/widget-header/widget-header-infotip.mjs.map +7 -0
  74. package/build-module/components/widget-header/widget-header.mjs +141 -0
  75. package/build-module/components/widget-header/widget-header.mjs.map +7 -0
  76. package/build-module/components/widget-layout-controls/index.mjs +6 -0
  77. package/build-module/components/widget-layout-controls/index.mjs.map +7 -0
  78. package/build-module/components/widget-layout-controls/widget-layout-controls.mjs +90 -0
  79. package/build-module/components/widget-layout-controls/widget-layout-controls.mjs.map +7 -0
  80. package/build-module/components/widget-picker/widget-picker.mjs +6 -94
  81. package/build-module/components/widget-picker/widget-picker.mjs.map +3 -3
  82. package/build-module/components/widget-preview-chrome/index.mjs +6 -0
  83. package/build-module/components/widget-preview-chrome/index.mjs.map +7 -0
  84. package/build-module/components/{widget-settings/widget-settings-toolbar.mjs → widget-preview-chrome/widget-preview-chrome.mjs} +37 -19
  85. package/build-module/components/widget-preview-chrome/widget-preview-chrome.mjs.map +7 -0
  86. package/build-module/components/widget-settings/index.mjs +2 -2
  87. package/build-module/components/widget-settings/index.mjs.map +1 -1
  88. package/build-module/components/widget-settings/utils/index.mjs +0 -2
  89. package/build-module/components/widget-settings/utils/index.mjs.map +2 -2
  90. package/build-module/components/widget-settings/widget-settings-trigger.mjs +23 -29
  91. package/build-module/components/widget-settings/widget-settings-trigger.mjs.map +2 -2
  92. package/build-module/components/widget-settings/widget-settings.mjs +40 -57
  93. package/build-module/components/widget-settings/widget-settings.mjs.map +2 -2
  94. package/build-module/components/widget-toolbar/widget-toolbar.mjs +7 -4
  95. package/build-module/components/widget-toolbar/widget-toolbar.mjs.map +2 -2
  96. package/build-module/components/widgets/widget-resize-handle.mjs +4 -4
  97. package/build-module/components/widgets/widget-resize-handle.mjs.map +2 -2
  98. package/build-module/components/widgets/widgets.mjs +18 -11
  99. package/build-module/components/widgets/widgets.mjs.map +2 -2
  100. package/build-module/context/dashboard-context.mjs +31 -80
  101. package/build-module/context/dashboard-context.mjs.map +2 -2
  102. package/build-module/context/ui-context.mjs +2 -18
  103. package/build-module/context/ui-context.mjs.map +2 -2
  104. package/build-module/types.mjs.map +1 -1
  105. package/build-module/utils/index.mjs +1 -3
  106. package/build-module/utils/index.mjs.map +2 -2
  107. package/build-module/widget-dashboard.mjs +0 -4
  108. package/build-module/widget-dashboard.mjs.map +2 -2
  109. package/build-types/components/actions/actions.d.ts.map +1 -1
  110. package/build-types/components/commands/commands.d.ts.map +1 -1
  111. package/build-types/components/commands/use-pending-when-edit-mode.d.ts +1 -1
  112. package/build-types/components/commands/use-pending-when-edit-mode.d.ts.map +1 -1
  113. package/build-types/components/no-widgets-state/no-widgets-state.d.ts +1 -1
  114. package/build-types/components/no-widgets-state/no-widgets-state.d.ts.map +1 -1
  115. package/build-types/components/widget-attribute-controls/index.d.ts +2 -0
  116. package/build-types/components/widget-attribute-controls/index.d.ts.map +1 -0
  117. package/build-types/components/widget-attribute-controls/widget-attribute-controls.d.ts +23 -0
  118. package/build-types/components/widget-attribute-controls/widget-attribute-controls.d.ts.map +1 -0
  119. package/build-types/components/widget-chrome/widget-chrome.d.ts +8 -8
  120. package/build-types/components/widget-chrome/widget-chrome.d.ts.map +1 -1
  121. package/build-types/components/widget-frame/index.d.ts +3 -0
  122. package/build-types/components/widget-frame/index.d.ts.map +1 -0
  123. package/build-types/components/widget-frame/widget-frame.d.ts +25 -0
  124. package/build-types/components/widget-frame/widget-frame.d.ts.map +1 -0
  125. package/build-types/components/widget-header/index.d.ts +3 -0
  126. package/build-types/components/widget-header/index.d.ts.map +1 -0
  127. package/build-types/components/widget-header/widget-header-infotip.d.ts +20 -0
  128. package/build-types/components/widget-header/widget-header-infotip.d.ts.map +1 -0
  129. package/build-types/components/widget-header/widget-header.d.ts +38 -0
  130. package/build-types/components/widget-header/widget-header.d.ts.map +1 -0
  131. package/build-types/components/widget-layout-controls/index.d.ts +3 -0
  132. package/build-types/components/widget-layout-controls/index.d.ts.map +1 -0
  133. package/build-types/components/widget-layout-controls/widget-layout-controls.d.ts +14 -0
  134. package/build-types/components/widget-layout-controls/widget-layout-controls.d.ts.map +1 -0
  135. package/build-types/components/widget-picker/widget-picker.d.ts +1 -1
  136. package/build-types/components/widget-picker/widget-picker.d.ts.map +1 -1
  137. package/build-types/components/widget-preview-chrome/index.d.ts +3 -0
  138. package/build-types/components/widget-preview-chrome/index.d.ts.map +1 -0
  139. package/build-types/components/widget-preview-chrome/widget-preview-chrome.d.ts +15 -0
  140. package/build-types/components/widget-preview-chrome/widget-preview-chrome.d.ts.map +1 -0
  141. package/build-types/components/widget-settings/index.d.ts +2 -2
  142. package/build-types/components/widget-settings/utils/index.d.ts +0 -1
  143. package/build-types/components/widget-settings/utils/index.d.ts.map +1 -1
  144. package/build-types/components/widget-settings/widget-settings-trigger.d.ts +7 -5
  145. package/build-types/components/widget-settings/widget-settings-trigger.d.ts.map +1 -1
  146. package/build-types/components/widget-settings/widget-settings.d.ts +5 -4
  147. package/build-types/components/widget-settings/widget-settings.d.ts.map +1 -1
  148. package/build-types/components/widget-toolbar/widget-toolbar.d.ts +10 -7
  149. package/build-types/components/widget-toolbar/widget-toolbar.d.ts.map +1 -1
  150. package/build-types/components/widgets/widgets.d.ts.map +1 -1
  151. package/build-types/context/dashboard-context.d.ts +23 -40
  152. package/build-types/context/dashboard-context.d.ts.map +1 -1
  153. package/build-types/context/ui-context.d.ts +0 -18
  154. package/build-types/context/ui-context.d.ts.map +1 -1
  155. package/build-types/context/widget-context.d.ts +1 -1
  156. package/build-types/context/widget-context.d.ts.map +1 -1
  157. package/build-types/types.d.ts +9 -15
  158. package/build-types/types.d.ts.map +1 -1
  159. package/build-types/utils/index.d.ts +0 -1
  160. package/build-types/utils/index.d.ts.map +1 -1
  161. package/build-types/widget-dashboard.d.ts +5 -5
  162. package/build-types/widget-dashboard.d.ts.map +1 -1
  163. package/package.json +20 -20
  164. package/src/components/actions/actions.module.css +7 -7
  165. package/src/components/actions/actions.tsx +5 -25
  166. package/src/components/commands/commands.tsx +3 -70
  167. package/src/components/widget-attribute-controls/index.ts +1 -0
  168. package/src/components/widget-attribute-controls/widget-attribute-controls.tsx +108 -0
  169. package/src/components/widget-chrome/widget-chrome.module.css +6 -71
  170. package/src/components/widget-chrome/widget-chrome.tsx +31 -136
  171. package/src/components/widget-frame/index.ts +2 -0
  172. package/src/components/widget-frame/widget-frame.module.css +17 -0
  173. package/src/components/widget-frame/widget-frame.tsx +138 -0
  174. package/src/components/widget-header/index.ts +2 -0
  175. package/src/components/widget-header/widget-header-infotip.tsx +82 -0
  176. package/src/components/widget-header/widget-header.module.css +59 -0
  177. package/src/components/widget-header/widget-header.tsx +104 -0
  178. package/src/components/widget-layout-controls/index.ts +2 -0
  179. package/src/components/{widgets/widget-layout-toolbar.tsx → widget-layout-controls/widget-layout-controls.tsx} +12 -13
  180. package/src/components/widget-picker/widget-picker.tsx +5 -10
  181. package/src/components/widget-preview-chrome/index.ts +2 -0
  182. package/src/components/widget-preview-chrome/widget-preview-chrome.module.css +22 -0
  183. package/src/components/widget-preview-chrome/widget-preview-chrome.tsx +65 -0
  184. package/src/components/widget-settings/index.ts +2 -2
  185. package/src/components/widget-settings/utils/index.ts +0 -1
  186. package/src/components/widget-settings/widget-settings-trigger.tsx +39 -44
  187. package/src/components/widget-settings/widget-settings.tsx +10 -28
  188. package/src/components/widget-toolbar/widget-toolbar.module.css +13 -10
  189. package/src/components/widget-toolbar/widget-toolbar.tsx +14 -8
  190. package/src/components/widgets/widget-resize-handle.module.css +21 -21
  191. package/src/components/widgets/widget-resize-handle.tsx +2 -2
  192. package/src/components/widgets/widgets.module.css +20 -11
  193. package/src/components/widgets/widgets.tsx +33 -10
  194. package/src/context/dashboard-context.tsx +70 -133
  195. package/src/context/ui-context.tsx +1 -39
  196. package/src/test/actions.test.tsx +7 -77
  197. package/src/test/commands.test.tsx +6 -45
  198. package/src/test/staging.test.tsx +82 -144
  199. package/src/test/widget-dashboard.test.tsx +24 -0
  200. package/src/types.ts +9 -16
  201. package/src/utils/index.ts +0 -1
  202. package/src/widget-dashboard.tsx +4 -8
  203. package/build/components/layout-settings/index.cjs.map +0 -7
  204. package/build/components/layout-settings/layout-model-edit-field/index.cjs +0 -186
  205. package/build/components/layout-settings/layout-model-edit-field/index.cjs.map +0 -7
  206. package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs +0 -53
  207. package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs.map +0 -7
  208. package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs +0 -53
  209. package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs.map +0 -7
  210. package/build/components/layout-settings/layout-settings.cjs +0 -207
  211. package/build/components/layout-settings/layout-settings.cjs.map +0 -7
  212. package/build/components/widget-settings/utils/get-admin-menu-inset.cjs.map +0 -7
  213. package/build/components/widget-settings/widget-settings-toolbar.cjs.map +0 -7
  214. package/build/components/widgets/widget-layout-toolbar.cjs.map +0 -7
  215. package/build/utils/grid-model-change/grid-model-change.cjs +0 -56
  216. package/build/utils/grid-model-change/grid-model-change.cjs.map +0 -7
  217. package/build/utils/grid-model-change/index.cjs.map +0 -7
  218. package/build/utils/migrate-layout/index.cjs.map +0 -7
  219. package/build/utils/migrate-layout/migrate-layout.cjs +0 -94
  220. package/build/utils/migrate-layout/migrate-layout.cjs.map +0 -7
  221. package/build-module/components/layout-settings/index.mjs +0 -6
  222. package/build-module/components/layout-settings/index.mjs.map +0 -7
  223. package/build-module/components/layout-settings/layout-model-edit-field/index.mjs +0 -151
  224. package/build-module/components/layout-settings/layout-model-edit-field/index.mjs.map +0 -7
  225. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs +0 -28
  226. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs.map +0 -7
  227. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs +0 -28
  228. package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs.map +0 -7
  229. package/build-module/components/layout-settings/layout-settings.mjs +0 -187
  230. package/build-module/components/layout-settings/layout-settings.mjs.map +0 -7
  231. package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs +0 -16
  232. package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs.map +0 -7
  233. package/build-module/components/widget-settings/widget-settings-toolbar.mjs.map +0 -7
  234. package/build-module/components/widgets/widget-layout-toolbar.mjs +0 -181
  235. package/build-module/components/widgets/widget-layout-toolbar.mjs.map +0 -7
  236. package/build-module/utils/grid-model-change/grid-model-change.mjs +0 -30
  237. package/build-module/utils/grid-model-change/grid-model-change.mjs.map +0 -7
  238. package/build-module/utils/grid-model-change/index.mjs +0 -7
  239. package/build-module/utils/grid-model-change/index.mjs.map +0 -7
  240. package/build-module/utils/migrate-layout/index.mjs +0 -6
  241. package/build-module/utils/migrate-layout/index.mjs.map +0 -7
  242. package/build-module/utils/migrate-layout/migrate-layout.mjs +0 -69
  243. package/build-module/utils/migrate-layout/migrate-layout.mjs.map +0 -7
  244. package/build-types/components/layout-settings/index.d.ts +0 -2
  245. package/build-types/components/layout-settings/index.d.ts.map +0 -1
  246. package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts +0 -17
  247. package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts.map +0 -1
  248. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts +0 -6
  249. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts.map +0 -1
  250. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts +0 -6
  251. package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts.map +0 -1
  252. package/build-types/components/layout-settings/layout-settings.d.ts +0 -14
  253. package/build-types/components/layout-settings/layout-settings.d.ts.map +0 -1
  254. package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts +0 -17
  255. package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts.map +0 -1
  256. package/build-types/components/widget-settings/widget-settings-toolbar.d.ts +0 -20
  257. package/build-types/components/widget-settings/widget-settings-toolbar.d.ts.map +0 -1
  258. package/build-types/components/widgets/widget-layout-toolbar.d.ts +0 -14
  259. package/build-types/components/widgets/widget-layout-toolbar.d.ts.map +0 -1
  260. package/build-types/utils/grid-model-change/grid-model-change.d.ts +0 -20
  261. package/build-types/utils/grid-model-change/grid-model-change.d.ts.map +0 -1
  262. package/build-types/utils/grid-model-change/index.d.ts +0 -2
  263. package/build-types/utils/grid-model-change/index.d.ts.map +0 -1
  264. package/build-types/utils/migrate-layout/index.d.ts +0 -2
  265. package/build-types/utils/migrate-layout/index.d.ts.map +0 -1
  266. package/build-types/utils/migrate-layout/migrate-layout.d.ts +0 -36
  267. package/build-types/utils/migrate-layout/migrate-layout.d.ts.map +0 -1
  268. package/src/components/layout-settings/index.ts +0 -1
  269. package/src/components/layout-settings/layout-model-edit-field/index.tsx +0 -98
  270. package/src/components/layout-settings/layout-model-edit-field/style.module.css +0 -34
  271. package/src/components/layout-settings/layout-model-edit-field/thumbnail-grid.tsx +0 -28
  272. package/src/components/layout-settings/layout-model-edit-field/thumbnail-masonry.tsx +0 -28
  273. package/src/components/layout-settings/layout-settings.tsx +0 -217
  274. package/src/components/widget-picker/widget-picker.module.css +0 -11
  275. package/src/components/widget-settings/utils/get-admin-menu-inset.ts +0 -30
  276. package/src/components/widget-settings/widget-settings-toolbar.module.css +0 -25
  277. package/src/components/widget-settings/widget-settings-toolbar.tsx +0 -45
  278. package/src/components/widgets/widget-layout-toolbar.module.css +0 -6
  279. package/src/utils/grid-model-change/grid-model-change.ts +0 -53
  280. package/src/utils/grid-model-change/index.ts +0 -1
  281. package/src/utils/migrate-layout/index.ts +0 -1
  282. package/src/utils/migrate-layout/migrate-layout.ts +0 -156
  283. package/src/utils/migrate-layout/test/migrate-layout.test.ts +0 -114
@@ -0,0 +1,157 @@
1
+ // packages/widget-dashboard/src/components/widget-frame/widget-frame.tsx
2
+ import clsx from "clsx";
3
+ import { Spinner } from "@wordpress/components";
4
+ import { Component, Suspense } from "@wordpress/element";
5
+ import { __ } from "@wordpress/i18n";
6
+ import { Card, Notice, Stack, VisuallyHidden } from "@wordpress/ui";
7
+ import { WidgetHeader } from "../widget-header/index.mjs";
8
+ import { WidgetRender } from "../widget-render/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/widget-frame/widget-frame.module.css
93
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
94
+ registerStyle("ca39d884d8", "._5848d9de101def77__content{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._998dd9aeb82b1f6a__bleed-content{padding:0}._605aa8383905f0a9__loading{height:100%}");
95
+ }
96
+ var widget_frame_default = { "content": "_5848d9de101def77__content", "bleed-content": "_998dd9aeb82b1f6a__bleed-content", "loading": "_605aa8383905f0a9__loading" };
97
+
98
+ // packages/widget-dashboard/src/components/widget-frame/widget-frame.tsx
99
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
100
+ var WidgetErrorBoundary = class extends Component {
101
+ state = { hasError: false };
102
+ static getDerivedStateFromError() {
103
+ return { hasError: true };
104
+ }
105
+ render() {
106
+ if (this.state.hasError) {
107
+ return /* @__PURE__ */ jsx(Notice.Root, { intent: "error", children: /* @__PURE__ */ jsx(Notice.Description, { children: __("This widget encountered an error.") }) });
108
+ }
109
+ return this.props.children;
110
+ }
111
+ };
112
+ function LoadingOverlay() {
113
+ return /* @__PURE__ */ jsx(Stack, { justify: "center", align: "center", className: widget_frame_default.loading, children: /* @__PURE__ */ jsx(Spinner, {}) });
114
+ }
115
+ function WidgetFrame({
116
+ widget,
117
+ widgetType,
118
+ titleId,
119
+ editMode = false,
120
+ headerToolbar
121
+ }) {
122
+ const { presentation } = widgetType;
123
+ const isHeaderHidden = presentation === "full-bleed";
124
+ const isBodyBleeding = presentation === "full-bleed" || presentation === "content-bleed";
125
+ const body = /* @__PURE__ */ jsx(WidgetErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingOverlay, {}), children: /* @__PURE__ */ jsx(WidgetRender, { widget, widgetType }) }) });
126
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
127
+ !isHeaderHidden && /* @__PURE__ */ jsx(
128
+ WidgetHeader,
129
+ {
130
+ showIdentity: true,
131
+ widgetType,
132
+ titleId,
133
+ editMode,
134
+ children: headerToolbar
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsxs(
138
+ Card.Content,
139
+ {
140
+ className: clsx(
141
+ widget_frame_default.content,
142
+ isBodyBleeding && widget_frame_default["bleed-content"]
143
+ ),
144
+ ...editMode ? { inert: "true" } : {},
145
+ children: [
146
+ isHeaderHidden && widgetType.title && /* @__PURE__ */ jsx(VisuallyHidden, { render: /* @__PURE__ */ jsx("h2", { id: titleId }), children: widgetType.title }),
147
+ body
148
+ ]
149
+ }
150
+ )
151
+ ] });
152
+ }
153
+ export {
154
+ LoadingOverlay,
155
+ WidgetFrame
156
+ };
157
+ //# sourceMappingURL=widget-frame.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-frame/widget-frame.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-frame/widget-frame.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Spinner } from '@wordpress/components';\nimport { Component, Suspense } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Card, Notice, Stack, VisuallyHidden } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { WidgetHeader } from '../widget-header';\nimport { WidgetRender } from '../widget-render';\nimport styles from './widget-frame.module.css';\nimport type { DashboardWidget } from '../../types';\n\ninterface ErrorBoundaryProps {\n\tchildren: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n\thasError: boolean;\n}\n\nclass WidgetErrorBoundary extends Component<\n\tErrorBoundaryProps,\n\tErrorBoundaryState\n> {\n\tstate: ErrorBoundaryState = { hasError: false };\n\n\tstatic getDerivedStateFromError(): ErrorBoundaryState {\n\t\treturn { hasError: true };\n\t}\n\n\trender() {\n\t\tif ( this.state.hasError ) {\n\t\t\treturn (\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'This widget encountered an error.' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t</Notice.Root>\n\t\t\t);\n\t\t}\n\t\treturn this.props.children;\n\t}\n}\n\n/* Centered spinner for resolving and Suspense waits. */\nexport function LoadingOverlay() {\n\treturn (\n\t\t<Stack justify=\"center\" align=\"center\" className={ styles.loading }>\n\t\t\t<Spinner />\n\t\t</Stack>\n\t);\n}\n\nexport interface WidgetFrameProps {\n\twidget: DashboardWidget< unknown >;\n\twidgetType: WidgetType;\n\ttitleId: string;\n\n\t/**\n\t * Inert the body and identity while customizing.\n\t */\n\teditMode?: boolean;\n\n\t/**\n\t * Toolbar shown beside the identity in the in-card header.\n\t */\n\theaderToolbar?: ReactNode;\n}\n\n/**\n * Shared framing: `presentation` into header + content, with the error/loading\n * boundaries. Hosts supply the `Card.Root` and their own concerns.\n *\n * @param {WidgetFrameProps} props Component props.\n */\nexport function WidgetFrame( {\n\twidget,\n\twidgetType,\n\ttitleId,\n\teditMode = false,\n\theaderToolbar,\n}: WidgetFrameProps ) {\n\t// full-bleed hides the header; full-bleed and content-bleed bleed the body.\n\tconst { presentation } = widgetType;\n\tconst isHeaderHidden = presentation === 'full-bleed';\n\tconst isBodyBleeding =\n\t\tpresentation === 'full-bleed' || presentation === 'content-bleed';\n\n\tconst body = (\n\t\t<WidgetErrorBoundary>\n\t\t\t<Suspense fallback={ <LoadingOverlay /> }>\n\t\t\t\t<WidgetRender widget={ widget } widgetType={ widgetType } />\n\t\t\t</Suspense>\n\t\t</WidgetErrorBoundary>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isHeaderHidden && (\n\t\t\t\t<WidgetHeader\n\t\t\t\t\tshowIdentity\n\t\t\t\t\twidgetType={ widgetType }\n\t\t\t\t\ttitleId={ titleId }\n\t\t\t\t\teditMode={ editMode }\n\t\t\t\t>\n\t\t\t\t\t{ headerToolbar }\n\t\t\t\t</WidgetHeader>\n\t\t\t) }\n\n\t\t\t<Card.Content\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tstyles.content,\n\t\t\t\t\tisBodyBleeding && styles[ 'bleed-content' ]\n\t\t\t\t) }\n\t\t\t\t{ ...( editMode ? { inert: 'true' } : {} ) }\n\t\t\t>\n\t\t\t\t{ isHeaderHidden && widgetType.title && (\n\t\t\t\t\t<VisuallyHidden render={ <h2 id={ titleId } /> }>\n\t\t\t\t\t\t{ widgetType.title }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t\t{ body }\n\t\t\t</Card.Content>\n\t\t</>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"ca39d884d8\", \"._5848d9de101def77__content{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._998dd9aeb82b1f6a__bleed-content{padding:0}._605aa8383905f0a9__loading{height:100%}\");\n}\nexport default {\"content\":\"_5848d9de101def77__content\",\"bleed-content\":\"_998dd9aeb82b1f6a__bleed-content\",\"loading\":\"_605aa8383905f0a9__loading\"};\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/widget-dashboard/src/components/widget-header/index.ts
2
+ import { WidgetHeader } from "./widget-header.mjs";
3
+ export {
4
+ WidgetHeader
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-header/index.ts"],
4
+ "sourcesContent": ["export { WidgetHeader } from './widget-header';\nexport type { WidgetHeaderProps } from './widget-header';\n"],
5
+ "mappings": ";AAAA,SAAS,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,141 @@
1
+ // packages/widget-dashboard/src/components/widget-header/widget-header-infotip.tsx
2
+ import { createInterpolateElement } from "@wordpress/element";
3
+ import { __ } from "@wordpress/i18n";
4
+ import { info } from "@wordpress/icons";
5
+ import { Icon, Link, Popover, Stack, VisuallyHidden } from "@wordpress/ui";
6
+
7
+ // packages/style-runtime/src/index.ts
8
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
9
+ function getRuntime() {
10
+ const globalScope = globalThis;
11
+ if (globalScope.__wpStyleRuntime) {
12
+ return globalScope.__wpStyleRuntime;
13
+ }
14
+ globalScope.__wpStyleRuntime = {
15
+ documents: /* @__PURE__ */ new Map(),
16
+ styles: /* @__PURE__ */ new Map(),
17
+ injectedStyles: /* @__PURE__ */ new WeakMap()
18
+ };
19
+ if (typeof document !== "undefined") {
20
+ registerDocument(document);
21
+ }
22
+ return globalScope.__wpStyleRuntime;
23
+ }
24
+ function documentContainsStyleHash(targetDocument, hash) {
25
+ if (!targetDocument.head) {
26
+ return false;
27
+ }
28
+ for (const style of targetDocument.head.querySelectorAll(
29
+ `style[${STYLE_HASH_ATTRIBUTE}]`
30
+ )) {
31
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
32
+ return true;
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+ function injectStyle(targetDocument, hash, css) {
38
+ if (!targetDocument.head) {
39
+ return;
40
+ }
41
+ const runtime = getRuntime();
42
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
43
+ if (!injectedStyles) {
44
+ injectedStyles = /* @__PURE__ */ new Set();
45
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
46
+ }
47
+ if (injectedStyles.has(hash)) {
48
+ return;
49
+ }
50
+ if (documentContainsStyleHash(targetDocument, hash)) {
51
+ injectedStyles.add(hash);
52
+ return;
53
+ }
54
+ const style = targetDocument.createElement("style");
55
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
56
+ style.appendChild(targetDocument.createTextNode(css));
57
+ targetDocument.head.appendChild(style);
58
+ injectedStyles.add(hash);
59
+ }
60
+ function registerDocument(targetDocument) {
61
+ const runtime = getRuntime();
62
+ runtime.documents.set(
63
+ targetDocument,
64
+ (runtime.documents.get(targetDocument) ?? 0) + 1
65
+ );
66
+ for (const [hash, css] of runtime.styles) {
67
+ injectStyle(targetDocument, hash, css);
68
+ }
69
+ return () => {
70
+ const count = runtime.documents.get(targetDocument);
71
+ if (count === void 0) {
72
+ return;
73
+ }
74
+ if (count <= 1) {
75
+ runtime.documents.delete(targetDocument);
76
+ return;
77
+ }
78
+ runtime.documents.set(targetDocument, count - 1);
79
+ };
80
+ }
81
+ function registerStyle(hash, css) {
82
+ const runtime = getRuntime();
83
+ runtime.styles.set(hash, css);
84
+ for (const targetDocument of runtime.documents.keys()) {
85
+ injectStyle(targetDocument, hash, css);
86
+ }
87
+ }
88
+
89
+ // packages/widget-dashboard/src/components/widget-header/widget-header.module.css
90
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
91
+ registerStyle("9772c69e1f", "._2e38ceadc62158ab__widget-header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._2445a9adf8f1e547__popover-popup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}");
92
+ }
93
+ var widget_header_default = { "widget-header": "_2e38ceadc62158ab__widget-header", "identity": "f41e4aad10324455__identity", "toolbar": "_967cd798e5c37202__toolbar", "icon": "_53584a4927dfbcf1__icon", "popover-popup": "_2445a9adf8f1e547__popover-popup", "help": "d6f136cf92858182__help", "link": "_9bdac6051677514a__link", "overlay": "f32f2cd669c9b4b0__overlay" };
94
+
95
+ // packages/widget-dashboard/src/components/widget-header/widget-header-infotip.tsx
96
+ import { jsx, jsxs } from "react/jsx-runtime";
97
+ function WidgetInfotip({
98
+ content,
99
+ links
100
+ }) {
101
+ return /* @__PURE__ */ jsxs(Popover.Root, { modal: "trap-focus", children: [
102
+ /* @__PURE__ */ jsx(
103
+ Popover.Trigger,
104
+ {
105
+ "aria-label": __("More information"),
106
+ className: widget_header_default.help,
107
+ children: /* @__PURE__ */ jsx(Icon, { icon: info, size: 20 })
108
+ }
109
+ ),
110
+ /* @__PURE__ */ jsxs(
111
+ Popover.Popup,
112
+ {
113
+ className: widget_header_default["popover-popup"],
114
+ positioner: /* @__PURE__ */ jsx(Popover.Positioner, { side: "top", align: "start" }),
115
+ children: [
116
+ /* @__PURE__ */ jsx(Popover.Arrow, {}),
117
+ /* @__PURE__ */ jsx(VisuallyHidden, { render: /* @__PURE__ */ jsx(Popover.Title, {}), children: __("More information") }),
118
+ /* @__PURE__ */ jsxs(Stack, { direction: "column", align: "start", gap: "sm", children: [
119
+ /* @__PURE__ */ jsx(Popover.Description, { children: createInterpolateElement(content, {
120
+ em: /* @__PURE__ */ jsx("em", {}),
121
+ strong: /* @__PURE__ */ jsx("strong", {})
122
+ }) }),
123
+ links && links.length > 0 && /* @__PURE__ */ jsx(Stack, { direction: "row", align: "start", gap: "sm", children: links.map((link) => /* @__PURE__ */ jsx(
124
+ Link,
125
+ {
126
+ href: link.href,
127
+ className: widget_header_default.link,
128
+ children: link.label
129
+ },
130
+ link.href
131
+ )) })
132
+ ] })
133
+ ]
134
+ }
135
+ )
136
+ ] });
137
+ }
138
+ export {
139
+ WidgetInfotip
140
+ };
141
+ //# sourceMappingURL=widget-header-infotip.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-header/widget-header-infotip.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-header/widget-header.module.css"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createInterpolateElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { info } from '@wordpress/icons';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Icon, Link, Popover, Stack, VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport styles from './widget-header.module.css';\n\nexport interface WidgetInfotipProps {\n\t/**\n\t * Help content to display; may carry `<em>`/`<strong>`.\n\t */\n\tcontent: string;\n\n\t/**\n\t * Links rendered after the content.\n\t */\n\tlinks?: {\n\t\tlabel: string;\n\t\thref: string;\n\t}[];\n}\n\n/**\n * Header infotip: a click-open popover holding the widget type's help note.\n *\n * @param {WidgetInfotipProps} props Component props.\n */\nexport function WidgetInfotip( {\n\tcontent,\n\tlinks,\n}: WidgetInfotipProps ): React.ReactNode {\n\treturn (\n\t\t<Popover.Root modal=\"trap-focus\">\n\t\t\t<Popover.Trigger\n\t\t\t\taria-label={ __( 'More information' ) }\n\t\t\t\tclassName={ styles.help }\n\t\t\t>\n\t\t\t\t<Icon icon={ info } size={ 20 } />\n\t\t\t</Popover.Trigger>\n\n\t\t\t<Popover.Popup\n\t\t\t\tclassName={ styles[ 'popover-popup' ] }\n\t\t\t\tpositioner={ <Popover.Positioner side=\"top\" align=\"start\" /> }\n\t\t\t>\n\t\t\t\t<Popover.Arrow />\n\t\t\t\t<VisuallyHidden render={ <Popover.Title /> }>\n\t\t\t\t\t{ __( 'More information' ) }\n\t\t\t\t</VisuallyHidden>\n\n\t\t\t\t<Stack direction=\"column\" align=\"start\" gap=\"sm\">\n\t\t\t\t\t<Popover.Description>\n\t\t\t\t\t\t{ createInterpolateElement( content, {\n\t\t\t\t\t\t\tem: <em />,\n\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</Popover.Description>\n\n\t\t\t\t\t{ links && links.length > 0 && (\n\t\t\t\t\t\t<Stack direction=\"row\" align=\"start\" gap=\"sm\">\n\t\t\t\t\t\t\t{ links.map( ( link ) => (\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tkey={ link.href }\n\t\t\t\t\t\t\t\t\thref={ link.href }\n\t\t\t\t\t\t\t\t\tclassName={ styles.link }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ link.label }\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t) }\n\t\t\t\t</Stack>\n\t\t\t</Popover.Popup>\n\t\t</Popover.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(\"9772c69e1f\", \"._2e38ceadc62158ab__widget-header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._2445a9adf8f1e547__popover-popup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}\");\n}\nexport default {\"widget-header\":\"_2e38ceadc62158ab__widget-header\",\"identity\":\"f41e4aad10324455__identity\",\"toolbar\":\"_967cd798e5c37202__toolbar\",\"icon\":\"_53584a4927dfbcf1__icon\",\"popover-popup\":\"_2445a9adf8f1e547__popover-popup\",\"help\":\"d6f136cf92858182__help\",\"link\":\"_9bdac6051677514a__link\",\"overlay\":\"f32f2cd669c9b4b0__overlay\"};\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -0,0 +1,141 @@
1
+ // packages/widget-dashboard/src/components/widget-header/widget-header.tsx
2
+ import clsx from "clsx";
3
+ import { Card, Icon, Stack } from "@wordpress/ui";
4
+ import { WidgetInfotip } from "./widget-header-infotip.mjs";
5
+
6
+ // packages/style-runtime/src/index.ts
7
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
8
+ function getRuntime() {
9
+ const globalScope = globalThis;
10
+ if (globalScope.__wpStyleRuntime) {
11
+ return globalScope.__wpStyleRuntime;
12
+ }
13
+ globalScope.__wpStyleRuntime = {
14
+ documents: /* @__PURE__ */ new Map(),
15
+ styles: /* @__PURE__ */ new Map(),
16
+ injectedStyles: /* @__PURE__ */ new WeakMap()
17
+ };
18
+ if (typeof document !== "undefined") {
19
+ registerDocument(document);
20
+ }
21
+ return globalScope.__wpStyleRuntime;
22
+ }
23
+ function documentContainsStyleHash(targetDocument, hash) {
24
+ if (!targetDocument.head) {
25
+ return false;
26
+ }
27
+ for (const style of targetDocument.head.querySelectorAll(
28
+ `style[${STYLE_HASH_ATTRIBUTE}]`
29
+ )) {
30
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
31
+ return true;
32
+ }
33
+ }
34
+ return false;
35
+ }
36
+ function injectStyle(targetDocument, hash, css) {
37
+ if (!targetDocument.head) {
38
+ return;
39
+ }
40
+ const runtime = getRuntime();
41
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
42
+ if (!injectedStyles) {
43
+ injectedStyles = /* @__PURE__ */ new Set();
44
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
45
+ }
46
+ if (injectedStyles.has(hash)) {
47
+ return;
48
+ }
49
+ if (documentContainsStyleHash(targetDocument, hash)) {
50
+ injectedStyles.add(hash);
51
+ return;
52
+ }
53
+ const style = targetDocument.createElement("style");
54
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
55
+ style.appendChild(targetDocument.createTextNode(css));
56
+ targetDocument.head.appendChild(style);
57
+ injectedStyles.add(hash);
58
+ }
59
+ function registerDocument(targetDocument) {
60
+ const runtime = getRuntime();
61
+ runtime.documents.set(
62
+ targetDocument,
63
+ (runtime.documents.get(targetDocument) ?? 0) + 1
64
+ );
65
+ for (const [hash, css] of runtime.styles) {
66
+ injectStyle(targetDocument, hash, css);
67
+ }
68
+ return () => {
69
+ const count = runtime.documents.get(targetDocument);
70
+ if (count === void 0) {
71
+ return;
72
+ }
73
+ if (count <= 1) {
74
+ runtime.documents.delete(targetDocument);
75
+ return;
76
+ }
77
+ runtime.documents.set(targetDocument, count - 1);
78
+ };
79
+ }
80
+ function registerStyle(hash, css) {
81
+ const runtime = getRuntime();
82
+ runtime.styles.set(hash, css);
83
+ for (const targetDocument of runtime.documents.keys()) {
84
+ injectStyle(targetDocument, hash, css);
85
+ }
86
+ }
87
+
88
+ // packages/widget-dashboard/src/components/widget-header/widget-header.module.css
89
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
90
+ registerStyle("9772c69e1f", "._2e38ceadc62158ab__widget-header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._2445a9adf8f1e547__popover-popup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}");
91
+ }
92
+ var widget_header_default = { "widget-header": "_2e38ceadc62158ab__widget-header", "identity": "f41e4aad10324455__identity", "toolbar": "_967cd798e5c37202__toolbar", "icon": "_53584a4927dfbcf1__icon", "popover-popup": "_2445a9adf8f1e547__popover-popup", "help": "d6f136cf92858182__help", "link": "_9bdac6051677514a__link", "overlay": "f32f2cd669c9b4b0__overlay" };
93
+
94
+ // packages/widget-dashboard/src/components/widget-header/widget-header.tsx
95
+ import { jsx, jsxs } from "react/jsx-runtime";
96
+ function WidgetHeader({
97
+ widgetType,
98
+ titleId,
99
+ showIdentity = false,
100
+ overlay = false,
101
+ editMode = false,
102
+ children
103
+ }) {
104
+ return /* @__PURE__ */ jsxs(
105
+ Card.Header,
106
+ {
107
+ className: clsx(
108
+ widget_header_default["widget-header"],
109
+ overlay && widget_header_default.overlay
110
+ ),
111
+ children: [
112
+ showIdentity && widgetType?.title && /* @__PURE__ */ jsxs(
113
+ Stack,
114
+ {
115
+ direction: "row",
116
+ align: "center",
117
+ gap: "sm",
118
+ className: widget_header_default.identity,
119
+ ...editMode ? { inert: "true" } : {},
120
+ children: [
121
+ widgetType.icon && /* @__PURE__ */ jsx("span", { className: widget_header_default.icon, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon, { icon: widgetType.icon }) }),
122
+ /* @__PURE__ */ jsx(Card.Title, { id: titleId, render: /* @__PURE__ */ jsx("h2", {}), children: widgetType.title }),
123
+ widgetType.help && /* @__PURE__ */ jsx(
124
+ WidgetInfotip,
125
+ {
126
+ content: widgetType.help.content,
127
+ links: widgetType.help.links
128
+ }
129
+ )
130
+ ]
131
+ }
132
+ ),
133
+ children && /* @__PURE__ */ jsx("div", { className: widget_header_default.toolbar, children })
134
+ ]
135
+ }
136
+ );
137
+ }
138
+ export {
139
+ WidgetHeader
140
+ };
141
+ //# sourceMappingURL=widget-header.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-header/widget-header.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-header/widget-header.module.css"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Card, Icon, Stack } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { WidgetInfotip } from './widget-header-infotip';\nimport styles from './widget-header.module.css';\n\nexport interface WidgetHeaderProps {\n\t/**\n\t * Widget type, source of the icon, title, and help note shown as\n\t * identity.\n\t */\n\twidgetType?: WidgetType;\n\n\t/**\n\t * Id linking the title to the tile's labelled region.\n\t */\n\ttitleId?: string;\n\n\t/**\n\t * Render the icon + title cluster on the leading edge.\n\t */\n\tshowIdentity?: boolean;\n\n\t/**\n\t * Float over the tile instead of sitting in the card flow.\n\t */\n\toverlay?: boolean;\n\n\t/**\n\t * Inert the identity while customizing, so it does not capture interaction.\n\t */\n\teditMode?: boolean;\n\n\t/**\n\t * Toolbar placed on the trailing edge.\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * Tile header row: identity (icon + title) and a toolbar on one line. Rendered\n * in the card flow, or as an `overlay` in the grid slot for full-bleed widgets\n * that have no in-card header.\n *\n * @param {WidgetHeaderProps} props Component props.\n */\nexport function WidgetHeader( {\n\twidgetType,\n\ttitleId,\n\tshowIdentity = false,\n\toverlay = false,\n\teditMode = false,\n\tchildren,\n}: WidgetHeaderProps ): React.ReactNode {\n\treturn (\n\t\t<Card.Header\n\t\t\tclassName={ clsx(\n\t\t\t\tstyles[ 'widget-header' ],\n\t\t\t\toverlay && styles.overlay\n\t\t\t) }\n\t\t>\n\t\t\t{ showIdentity && widgetType?.title && (\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName={ styles.identity }\n\t\t\t\t\t{ ...( editMode ? { inert: 'true' } : {} ) }\n\t\t\t\t>\n\t\t\t\t\t{ widgetType.icon && (\n\t\t\t\t\t\t<span className={ styles.icon } aria-hidden=\"true\">\n\t\t\t\t\t\t\t<Icon icon={ widgetType.icon } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<Card.Title id={ titleId } render={ <h2 /> }>\n\t\t\t\t\t\t{ widgetType.title }\n\t\t\t\t\t</Card.Title>\n\n\t\t\t\t\t{ widgetType.help && (\n\t\t\t\t\t\t<WidgetInfotip\n\t\t\t\t\t\t\tcontent={ widgetType.help.content }\n\t\t\t\t\t\t\tlinks={ widgetType.help.links }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Stack>\n\t\t\t) }\n\n\t\t\t{ children && <div className={ styles.toolbar }>{ children }</div> }\n\t\t</Card.Header>\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(\"9772c69e1f\", \"._2e38ceadc62158ab__widget-header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._2445a9adf8f1e547__popover-popup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}\");\n}\nexport default {\"widget-header\":\"_2e38ceadc62158ab__widget-header\",\"identity\":\"f41e4aad10324455__identity\",\"toolbar\":\"_967cd798e5c37202__toolbar\",\"icon\":\"_53584a4927dfbcf1__icon\",\"popover-popup\":\"_2445a9adf8f1e547__popover-popup\",\"help\":\"d6f136cf92858182__help\",\"link\":\"_9bdac6051677514a__link\",\"overlay\":\"f32f2cd669c9b4b0__overlay\"};\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/widget-dashboard/src/components/widget-layout-controls/index.ts
2
+ import { WidgetLayoutControls } from "./widget-layout-controls.mjs";
3
+ export {
4
+ WidgetLayoutControls
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/widget-layout-controls/index.ts"],
4
+ "sourcesContent": ["export { WidgetLayoutControls } from './widget-layout-controls';\nexport type { WidgetLayoutControlsProps } from './widget-layout-controls';\n"],
5
+ "mappings": ";AAAA,SAAS,4BAA4B;",
6
+ "names": []
7
+ }