@wordpress/components 19.10.0 → 19.11.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 (420) hide show
  1. package/CHANGELOG.md +24 -6
  2. package/build/border-box-control/border-box-control/component.js +22 -7
  3. package/build/border-box-control/border-box-control/component.js.map +1 -1
  4. package/build/border-box-control/border-box-control-linked-button/hook.js +3 -2
  5. package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  6. package/build/border-box-control/border-box-control-split-controls/component.js +21 -8
  7. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  8. package/build/border-box-control/border-box-control-visualizer/hook.js +3 -2
  9. package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  10. package/build/border-box-control/styles.js +11 -15
  11. package/build/border-box-control/styles.js.map +1 -1
  12. package/build/border-control/border-control/component.js +5 -3
  13. package/build/border-control/border-control/component.js.map +1 -1
  14. package/build/border-control/border-control/hook.js +6 -3
  15. package/build/border-control/border-control/hook.js.map +1 -1
  16. package/build/border-control/border-control-dropdown/component.js +6 -2
  17. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  18. package/build/border-control/border-control-dropdown/hook.js +5 -5
  19. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  20. package/build/border-control/styles.js +58 -29
  21. package/build/border-control/styles.js.map +1 -1
  22. package/build/button/index.native.js +16 -2
  23. package/build/button/index.native.js.map +1 -1
  24. package/build/button-group/index.js +24 -7
  25. package/build/button-group/index.js.map +1 -1
  26. package/build/{flyout → button-group}/types.js +0 -0
  27. package/build/button-group/types.js.map +1 -0
  28. package/build/checkbox-control/index.js +34 -7
  29. package/build/checkbox-control/index.js.map +1 -1
  30. package/build/checkbox-control/types.js +6 -0
  31. package/build/checkbox-control/types.js.map +1 -0
  32. package/build/color-palette/index.js +5 -12
  33. package/build/color-palette/index.js.map +1 -1
  34. package/build/date-time/date.js +43 -19
  35. package/build/date-time/date.js.map +1 -1
  36. package/build/date-time/index.js +28 -3
  37. package/build/date-time/index.js.map +1 -1
  38. package/build/date-time/time.js +42 -40
  39. package/build/date-time/time.js.map +1 -1
  40. package/build/date-time/timezone.js +4 -3
  41. package/build/date-time/timezone.js.map +1 -1
  42. package/build/date-time/types.js +6 -0
  43. package/build/date-time/types.js.map +1 -0
  44. package/build/date-time/utils.js +6 -4
  45. package/build/date-time/utils.js.map +1 -1
  46. package/build/disabled/index.js +1 -1
  47. package/build/disabled/index.js.map +1 -1
  48. package/build/draggable/index.native.js +223 -0
  49. package/build/draggable/index.native.js.map +1 -0
  50. package/build/dropdown/index.js +7 -5
  51. package/build/dropdown/index.js.map +1 -1
  52. package/build/focal-point-picker/index.native.js +3 -3
  53. package/build/focal-point-picker/index.native.js.map +1 -1
  54. package/build/index.js +0 -8
  55. package/build/index.js.map +1 -1
  56. package/build/index.native.js +16 -0
  57. package/build/index.native.js.map +1 -1
  58. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  59. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  60. package/build/mobile/bottom-sheet/index.native.js +1 -1
  61. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  62. package/build/mobile/bottom-sheet-select-control/index.native.js +3 -2
  63. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  64. package/build/mobile/html-text-input/index.native.js +19 -8
  65. package/build/mobile/html-text-input/index.native.js.map +1 -1
  66. package/build/mobile/keyboard-aware-flat-list/index.android.js +28 -5
  67. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  68. package/build/mobile/keyboard-aware-flat-list/index.ios.js +47 -24
  69. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  70. package/build/palette-edit/index.js +38 -7
  71. package/build/palette-edit/index.js.map +1 -1
  72. package/build/popover/index.js +223 -277
  73. package/build/popover/index.js.map +1 -1
  74. package/build/resizable-box/resize-tooltip/utils.js +5 -8
  75. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  76. package/build/sandbox/index.native.js +1 -1
  77. package/build/sandbox/index.native.js.map +1 -1
  78. package/build/select-control/styles/select-control-styles.js +14 -11
  79. package/build/select-control/styles/select-control-styles.js.map +1 -1
  80. package/build/toggle-group-control/toggle-group-control/component.js +1 -3
  81. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  82. package/build/tooltip/index.js +2 -2
  83. package/build/tooltip/index.js.map +1 -1
  84. package/build-module/border-box-control/border-box-control/component.js +22 -7
  85. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  86. package/build-module/border-box-control/border-box-control-linked-button/hook.js +3 -2
  87. package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  88. package/build-module/border-box-control/border-box-control-split-controls/component.js +21 -8
  89. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  90. package/build-module/border-box-control/border-box-control-visualizer/hook.js +3 -2
  91. package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  92. package/build-module/border-box-control/styles.js +9 -15
  93. package/build-module/border-box-control/styles.js.map +1 -1
  94. package/build-module/border-control/border-control/component.js +5 -3
  95. package/build-module/border-control/border-control/component.js.map +1 -1
  96. package/build-module/border-control/border-control/hook.js +6 -3
  97. package/build-module/border-control/border-control/hook.js.map +1 -1
  98. package/build-module/border-control/border-control-dropdown/component.js +6 -2
  99. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  100. package/build-module/border-control/border-control-dropdown/hook.js +5 -5
  101. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  102. package/build-module/border-control/styles.js +56 -29
  103. package/build-module/border-control/styles.js.map +1 -1
  104. package/build-module/button/index.native.js +16 -3
  105. package/build-module/button/index.native.js.map +1 -1
  106. package/build-module/button-group/index.js +27 -7
  107. package/build-module/button-group/index.js.map +1 -1
  108. package/build-module/{flyout → button-group}/types.js +0 -0
  109. package/build-module/{flyout → button-group}/types.js.map +0 -0
  110. package/build-module/checkbox-control/index.js +31 -7
  111. package/build-module/checkbox-control/index.js.map +1 -1
  112. package/build-module/checkbox-control/types.js +2 -0
  113. package/{build/flyout → build-module/checkbox-control}/types.js.map +0 -0
  114. package/build-module/color-palette/index.js +5 -11
  115. package/build-module/color-palette/index.js.map +1 -1
  116. package/build-module/date-time/date.js +44 -19
  117. package/build-module/date-time/date.js.map +1 -1
  118. package/build-module/date-time/index.js +28 -4
  119. package/build-module/date-time/index.js.map +1 -1
  120. package/build-module/date-time/time.js +43 -41
  121. package/build-module/date-time/time.js.map +1 -1
  122. package/build-module/date-time/timezone.js +4 -3
  123. package/build-module/date-time/timezone.js.map +1 -1
  124. package/build-module/date-time/types.js +2 -0
  125. package/build-module/date-time/types.js.map +1 -0
  126. package/build-module/date-time/utils.js +6 -4
  127. package/build-module/date-time/utils.js.map +1 -1
  128. package/build-module/disabled/index.js +1 -1
  129. package/build-module/disabled/index.js.map +1 -1
  130. package/build-module/draggable/index.native.js +206 -0
  131. package/build-module/draggable/index.native.js.map +1 -0
  132. package/build-module/dropdown/index.js +7 -5
  133. package/build-module/dropdown/index.js.map +1 -1
  134. package/build-module/focal-point-picker/index.native.js +3 -3
  135. package/build-module/focal-point-picker/index.native.js.map +1 -1
  136. package/build-module/index.js +0 -1
  137. package/build-module/index.js.map +1 -1
  138. package/build-module/index.native.js +2 -1
  139. package/build-module/index.native.js.map +1 -1
  140. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  141. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  142. package/build-module/mobile/bottom-sheet/index.native.js +1 -1
  143. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  144. package/build-module/mobile/bottom-sheet-select-control/index.native.js +3 -2
  145. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  146. package/build-module/mobile/html-text-input/index.native.js +20 -9
  147. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  148. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +21 -5
  149. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  150. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +42 -25
  151. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  152. package/build-module/palette-edit/index.js +37 -7
  153. package/build-module/palette-edit/index.js.map +1 -1
  154. package/build-module/popover/index.js +225 -279
  155. package/build-module/popover/index.js.map +1 -1
  156. package/build-module/resizable-box/resize-tooltip/utils.js +4 -5
  157. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  158. package/build-module/sandbox/index.native.js +1 -1
  159. package/build-module/sandbox/index.native.js.map +1 -1
  160. package/build-module/select-control/styles/select-control-styles.js +14 -11
  161. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  162. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -3
  163. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  164. package/build-module/tooltip/index.js +2 -2
  165. package/build-module/tooltip/index.js.map +1 -1
  166. package/build-style/style-rtl.css +31 -170
  167. package/build-style/style.css +27 -170
  168. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  169. package/build-types/border-box-control/border-box-control/hook.d.ts +3 -1
  170. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  171. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  172. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  173. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +3 -1
  174. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  175. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  176. package/build-types/border-box-control/styles.d.ts +2 -2
  177. package/build-types/border-box-control/styles.d.ts.map +1 -1
  178. package/build-types/border-box-control/types.d.ts +40 -13
  179. package/build-types/border-box-control/types.d.ts.map +1 -1
  180. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  181. package/build-types/border-control/border-control/hook.d.ts +2 -1
  182. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  183. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  184. package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
  185. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  186. package/build-types/border-control/styles.d.ts +2 -1
  187. package/build-types/border-control/styles.d.ts.map +1 -1
  188. package/build-types/border-control/types.d.ts +18 -6
  189. package/build-types/border-control/types.d.ts.map +1 -1
  190. package/build-types/button-group/index.d.ts +25 -0
  191. package/build-types/button-group/index.d.ts.map +1 -0
  192. package/build-types/button-group/stories/index.d.ts +12 -0
  193. package/build-types/button-group/stories/index.d.ts.map +1 -0
  194. package/build-types/button-group/types.d.ts +11 -0
  195. package/build-types/button-group/types.d.ts.map +1 -0
  196. package/build-types/checkbox-control/index.d.ts +26 -0
  197. package/build-types/checkbox-control/index.d.ts.map +1 -0
  198. package/build-types/checkbox-control/stories/index.d.ts +13 -0
  199. package/build-types/checkbox-control/stories/index.d.ts.map +1 -0
  200. package/build-types/checkbox-control/types.d.ts +35 -0
  201. package/build-types/checkbox-control/types.d.ts.map +1 -0
  202. package/build-types/color-palette/index.d.ts.map +1 -1
  203. package/build-types/color-picker/styles.d.ts +1 -1
  204. package/build-types/date-time/date.d.ts +24 -0
  205. package/build-types/date-time/date.d.ts.map +1 -0
  206. package/build-types/date-time/index.d.ts +35 -0
  207. package/build-types/date-time/index.d.ts.map +1 -0
  208. package/build-types/date-time/stories/date.d.ts +14 -0
  209. package/build-types/date-time/stories/date.d.ts.map +1 -0
  210. package/build-types/date-time/stories/index.d.ts +14 -0
  211. package/build-types/date-time/stories/index.d.ts.map +1 -0
  212. package/build-types/date-time/stories/time.d.ts +12 -0
  213. package/build-types/date-time/stories/time.d.ts.map +1 -0
  214. package/build-types/date-time/stories/utils.d.ts +3 -0
  215. package/build-types/date-time/stories/utils.d.ts.map +1 -0
  216. package/build-types/date-time/test/date.d.ts +2 -0
  217. package/build-types/date-time/test/date.d.ts.map +1 -0
  218. package/build-types/date-time/test/time.d.ts +2 -0
  219. package/build-types/date-time/test/time.d.ts.map +1 -0
  220. package/build-types/date-time/test/utils.d.ts +2 -0
  221. package/build-types/date-time/test/utils.d.ts.map +1 -0
  222. package/build-types/date-time/time.d.ts +25 -0
  223. package/build-types/date-time/time.d.ts.map +1 -0
  224. package/build-types/date-time/timezone.d.ts +8 -0
  225. package/build-types/date-time/timezone.d.ts.map +1 -0
  226. package/build-types/date-time/types.d.ts +91 -0
  227. package/build-types/date-time/types.d.ts.map +1 -0
  228. package/build-types/date-time/utils.d.ts +15 -0
  229. package/build-types/date-time/utils.d.ts.map +1 -0
  230. package/build-types/dropdown/index.d.ts.map +1 -1
  231. package/build-types/input-control/index.d.ts +1 -1
  232. package/build-types/input-control/stories/index.d.ts +5 -5
  233. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  234. package/build-types/popover/index.d.ts +5 -7
  235. package/build-types/popover/index.d.ts.map +1 -1
  236. package/build-types/resizable-box/index.d.ts +1 -1
  237. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  238. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  239. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  240. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  241. package/build-types/tooltip/index.d.ts.map +1 -1
  242. package/package.json +19 -19
  243. package/src/autocomplete/style.scss +1 -1
  244. package/src/border-box-control/border-box-control/README.md +10 -14
  245. package/src/border-box-control/border-box-control/component.tsx +21 -4
  246. package/src/border-box-control/border-box-control-linked-button/hook.ts +10 -6
  247. package/src/border-box-control/border-box-control-split-controls/component.tsx +24 -7
  248. package/src/border-box-control/border-box-control-visualizer/hook.ts +11 -6
  249. package/src/border-box-control/stories/index.js +1 -0
  250. package/src/border-box-control/styles.ts +15 -8
  251. package/src/border-box-control/types.ts +40 -14
  252. package/src/border-control/border-control/README.md +0 -7
  253. package/src/border-control/border-control/component.tsx +4 -2
  254. package/src/border-control/border-control/hook.ts +5 -2
  255. package/src/border-control/border-control-dropdown/component.tsx +18 -11
  256. package/src/border-control/border-control-dropdown/hook.ts +7 -5
  257. package/src/border-control/stories/index.js +1 -0
  258. package/src/border-control/styles.ts +82 -22
  259. package/src/border-control/types.ts +18 -6
  260. package/src/button/index.native.js +33 -18
  261. package/src/button-group/index.tsx +47 -0
  262. package/src/button-group/stories/index.tsx +41 -0
  263. package/src/button-group/types.ts +11 -0
  264. package/src/checkbox-control/README.md +10 -8
  265. package/src/checkbox-control/{index.js → index.tsx} +49 -14
  266. package/src/checkbox-control/stories/{index.js → index.tsx} +49 -27
  267. package/src/checkbox-control/types.ts +36 -0
  268. package/src/circular-option-picker/style.scss +1 -0
  269. package/src/color-palette/index.js +6 -13
  270. package/src/color-palette/style.scss +3 -18
  271. package/src/date-time/README.md +13 -10
  272. package/src/date-time/{date.js → date.tsx} +49 -20
  273. package/src/date-time/{index.js → index.tsx} +31 -5
  274. package/src/date-time/stories/date.tsx +73 -0
  275. package/src/date-time/stories/index.tsx +75 -0
  276. package/src/date-time/stories/time.tsx +51 -0
  277. package/src/date-time/stories/utils.ts +9 -0
  278. package/src/date-time/test/{date.js → date.tsx} +3 -2
  279. package/src/date-time/test/{time.js → time.tsx} +34 -19
  280. package/src/date-time/test/{utils.js → utils.ts} +1 -1
  281. package/src/date-time/{time.js → time.tsx} +57 -46
  282. package/src/date-time/{timezone.js → timezone.tsx} +4 -3
  283. package/src/date-time/types.ts +106 -0
  284. package/src/date-time/utils.ts +20 -0
  285. package/src/disabled/index.js +1 -1
  286. package/src/draggable/index.native.js +215 -0
  287. package/src/draggable/style.native.scss +3 -0
  288. package/src/dropdown/index.js +9 -4
  289. package/src/dropdown/style.scss +1 -1
  290. package/src/focal-point-picker/index.native.js +3 -3
  291. package/src/form-file-upload/test/index.js +8 -4
  292. package/src/index.js +0 -1
  293. package/src/index.native.js +1 -0
  294. package/src/item-group/stories/index.js +22 -18
  295. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  296. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +1 -1
  297. package/src/mobile/bottom-sheet/index.native.js +1 -1
  298. package/src/mobile/bottom-sheet-select-control/index.native.js +7 -2
  299. package/src/mobile/html-text-input/index.native.js +45 -29
  300. package/src/mobile/html-text-input/style.android.scss +1 -15
  301. package/src/mobile/html-text-input/style.ios.scss +1 -15
  302. package/src/mobile/html-text-input/{style-common.native.scss → style.scss} +16 -0
  303. package/src/mobile/keyboard-aware-flat-list/index.android.js +15 -5
  304. package/src/mobile/keyboard-aware-flat-list/index.ios.js +75 -46
  305. package/src/navigator/stories/index.js +16 -10
  306. package/src/palette-edit/index.js +37 -9
  307. package/src/palette-edit/style.scss +0 -7
  308. package/src/palette-edit/test/index.js +63 -0
  309. package/src/panel/README.md +1 -1
  310. package/src/placeholder/test/index.js +7 -0
  311. package/src/popover/README.md +7 -9
  312. package/src/popover/index.js +242 -371
  313. package/src/popover/style.scss +20 -190
  314. package/src/popover/test/__snapshots__/index.js.snap +6 -18
  315. package/src/resizable-box/resize-tooltip/utils.ts +4 -5
  316. package/src/sandbox/index.native.js +1 -1
  317. package/src/select-control/styles/select-control-styles.ts +6 -3
  318. package/src/tab-panel/style.scss +1 -1
  319. package/src/toggle-group-control/test/__snapshots__/index.js.snap +4 -10
  320. package/src/toggle-group-control/toggle-group-control/component.tsx +7 -3
  321. package/src/tooltip/index.js +8 -2
  322. package/src/tooltip/style.scss +2 -4
  323. package/src/tooltip/test/index.native.js +1 -1
  324. package/src/unit-control/test/index.tsx +84 -4
  325. package/tsconfig.json +6 -2
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/flyout/context.js +0 -23
  328. package/build/flyout/context.js.map +0 -1
  329. package/build/flyout/flyout/component.js +0 -106
  330. package/build/flyout/flyout/component.js.map +0 -1
  331. package/build/flyout/flyout/hook.js +0 -53
  332. package/build/flyout/flyout/hook.js.map +0 -1
  333. package/build/flyout/flyout/index.js +0 -24
  334. package/build/flyout/flyout/index.js.map +0 -1
  335. package/build/flyout/flyout-content/component.js +0 -65
  336. package/build/flyout/flyout-content/component.js.map +0 -1
  337. package/build/flyout/flyout-content/index.js +0 -16
  338. package/build/flyout/flyout-content/index.js.map +0 -1
  339. package/build/flyout/index.js +0 -16
  340. package/build/flyout/index.js.map +0 -1
  341. package/build/flyout/styles.js +0 -46
  342. package/build/flyout/styles.js.map +0 -1
  343. package/build/flyout/utils.js +0 -36
  344. package/build/flyout/utils.js.map +0 -1
  345. package/build/mobile/html-text-input/container.android.js +0 -41
  346. package/build/mobile/html-text-input/container.android.js.map +0 -1
  347. package/build/mobile/html-text-input/container.ios.js +0 -60
  348. package/build/mobile/html-text-input/container.ios.js.map +0 -1
  349. package/build/popover/utils.js +0 -322
  350. package/build/popover/utils.js.map +0 -1
  351. package/build-module/flyout/context.js +0 -11
  352. package/build-module/flyout/context.js.map +0 -1
  353. package/build-module/flyout/flyout/component.js +0 -89
  354. package/build-module/flyout/flyout/component.js.map +0 -1
  355. package/build-module/flyout/flyout/hook.js +0 -44
  356. package/build-module/flyout/flyout/hook.js.map +0 -1
  357. package/build-module/flyout/flyout/index.js +0 -3
  358. package/build-module/flyout/flyout/index.js.map +0 -1
  359. package/build-module/flyout/flyout-content/component.js +0 -51
  360. package/build-module/flyout/flyout-content/component.js.map +0 -1
  361. package/build-module/flyout/flyout-content/index.js +0 -2
  362. package/build-module/flyout/flyout-content/index.js.map +0 -1
  363. package/build-module/flyout/index.js +0 -2
  364. package/build-module/flyout/index.js.map +0 -1
  365. package/build-module/flyout/styles.js +0 -27
  366. package/build-module/flyout/styles.js.map +0 -1
  367. package/build-module/flyout/utils.js +0 -25
  368. package/build-module/flyout/utils.js.map +0 -1
  369. package/build-module/mobile/html-text-input/container.android.js +0 -29
  370. package/build-module/mobile/html-text-input/container.android.js.map +0 -1
  371. package/build-module/mobile/html-text-input/container.ios.js +0 -48
  372. package/build-module/mobile/html-text-input/container.ios.js.map +0 -1
  373. package/build-module/popover/utils.js +0 -308
  374. package/build-module/popover/utils.js.map +0 -1
  375. package/build-types/flyout/context.d.ts +0 -6
  376. package/build-types/flyout/context.d.ts.map +0 -1
  377. package/build-types/flyout/flyout/component.d.ts +0 -21
  378. package/build-types/flyout/flyout/component.d.ts.map +0 -1
  379. package/build-types/flyout/flyout/hook.d.ts +0 -270
  380. package/build-types/flyout/flyout/hook.d.ts.map +0 -1
  381. package/build-types/flyout/flyout/index.d.ts +0 -3
  382. package/build-types/flyout/flyout/index.d.ts.map +0 -1
  383. package/build-types/flyout/flyout-content/component.d.ts +0 -3
  384. package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
  385. package/build-types/flyout/flyout-content/index.d.ts +0 -2
  386. package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
  387. package/build-types/flyout/index.d.ts +0 -2
  388. package/build-types/flyout/index.d.ts.map +0 -1
  389. package/build-types/flyout/styles.d.ts +0 -22
  390. package/build-types/flyout/styles.d.ts.map +0 -1
  391. package/build-types/flyout/types.d.ts +0 -80
  392. package/build-types/flyout/types.d.ts.map +0 -1
  393. package/build-types/flyout/utils.d.ts +0 -8
  394. package/build-types/flyout/utils.d.ts.map +0 -1
  395. package/build-types/popover/utils.d.ts +0 -70
  396. package/build-types/popover/utils.d.ts.map +0 -1
  397. package/src/button-group/index.js +0 -17
  398. package/src/button-group/stories/index.js +0 -21
  399. package/src/date-time/stories/date.js +0 -17
  400. package/src/date-time/stories/index.js +0 -91
  401. package/src/date-time/stories/time.js +0 -32
  402. package/src/date-time/utils.js +0 -18
  403. package/src/flyout/context.js +0 -10
  404. package/src/flyout/flyout/README.md +0 -98
  405. package/src/flyout/flyout/component.js +0 -111
  406. package/src/flyout/flyout/hook.js +0 -45
  407. package/src/flyout/flyout/index.js +0 -2
  408. package/src/flyout/flyout-content/component.js +0 -53
  409. package/src/flyout/flyout-content/index.js +0 -1
  410. package/src/flyout/index.js +0 -1
  411. package/src/flyout/stories/index.js +0 -24
  412. package/src/flyout/styles.ts +0 -41
  413. package/src/flyout/test/__snapshots__/index.js.snap +0 -186
  414. package/src/flyout/test/index.js +0 -103
  415. package/src/flyout/types.ts +0 -84
  416. package/src/flyout/utils.js +0 -23
  417. package/src/mobile/html-text-input/container.android.js +0 -23
  418. package/src/mobile/html-text-input/container.ios.js +0 -50
  419. package/src/popover/test/utils.js +0 -304
  420. package/src/popover/utils.js +0 -396
@@ -1,322 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.computePopoverPosition = computePopoverPosition;
7
- exports.computePopoverXAxisPosition = computePopoverXAxisPosition;
8
- exports.computePopoverYAxisPosition = computePopoverYAxisPosition;
9
- exports.offsetIframe = offsetIframe;
10
-
11
- var _i18n = require("@wordpress/i18n");
12
-
13
- // @ts-nocheck
14
-
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Module constants
21
- */
22
- const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.
23
-
24
- /**
25
- * Utility used to compute the popover position over the xAxis
26
- *
27
- * @param {Object} anchorRect Anchor Rect.
28
- * @param {Object} contentSize Content Size.
29
- * @param {string} xAxis Desired xAxis.
30
- * @param {string} corner Desired corner.
31
- * @param {boolean} stickyBoundaryElement The boundary element to use when
32
- * switching between sticky and normal
33
- * position.
34
- * @param {string} chosenYAxis yAxis to be used.
35
- * @param {Element} boundaryElement Boundary element.
36
- * @param {boolean} forcePosition Don't adjust position based on anchor.
37
- * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
38
- *
39
- * @return {Object} Popover xAxis position and constraints.
40
- */
41
-
42
- function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
43
- const {
44
- width
45
- } = contentSize; // Correct xAxis for RTL support.
46
-
47
- if (xAxis === 'left' && (0, _i18n.isRTL)()) {
48
- xAxis = 'right';
49
- } else if (xAxis === 'right' && (0, _i18n.isRTL)()) {
50
- xAxis = 'left';
51
- }
52
-
53
- if (corner === 'left' && (0, _i18n.isRTL)()) {
54
- corner = 'right';
55
- } else if (corner === 'right' && (0, _i18n.isRTL)()) {
56
- corner = 'left';
57
- } // X axis alignment choices.
58
-
59
-
60
- const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
61
- const centerAlignment = {
62
- popoverLeft: anchorMidPoint,
63
- contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
64
- };
65
- let leftAlignmentX = anchorRect.left;
66
-
67
- if (corner === 'right') {
68
- leftAlignmentX = anchorRect.right;
69
- } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
70
- leftAlignmentX = anchorMidPoint;
71
- }
72
-
73
- let rightAlignmentX = anchorRect.right;
74
-
75
- if (corner === 'left') {
76
- rightAlignmentX = anchorRect.left;
77
- } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
78
- rightAlignmentX = anchorMidPoint;
79
- }
80
-
81
- const leftAlignment = {
82
- popoverLeft: leftAlignmentX,
83
- contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
84
- };
85
- const rightAlignment = {
86
- popoverLeft: rightAlignmentX,
87
- contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
88
- }; // Choosing the x axis.
89
-
90
- let chosenXAxis = xAxis;
91
- let contentWidth = null;
92
-
93
- if (!stickyBoundaryElement && !forcePosition) {
94
- if (xAxis === 'center' && centerAlignment.contentWidth === width) {
95
- chosenXAxis = 'center';
96
- } else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
97
- chosenXAxis = 'left';
98
- } else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
99
- chosenXAxis = 'right';
100
- } else {
101
- chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
102
- const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width
103
-
104
- if (width > window.innerWidth) {
105
- contentWidth = window.innerWidth;
106
- } // If we can't find any alignment options that could fit
107
- // our content, then let's fallback to the center of the viewport.
108
-
109
-
110
- if (chosenWidth !== width) {
111
- chosenXAxis = 'center';
112
- centerAlignment.popoverLeft = window.innerWidth / 2;
113
- }
114
- }
115
- }
116
-
117
- let popoverLeft;
118
-
119
- if (chosenXAxis === 'center') {
120
- popoverLeft = centerAlignment.popoverLeft;
121
- } else if (chosenXAxis === 'left') {
122
- popoverLeft = leftAlignment.popoverLeft;
123
- } else {
124
- popoverLeft = rightAlignment.popoverLeft;
125
- }
126
-
127
- if (boundaryElement) {
128
- popoverLeft = Math.min(popoverLeft, boundaryElement.offsetLeft + boundaryElement.offsetWidth - width); // Avoid the popover being position beyond the left boundary if the
129
- // direction is left to right.
130
-
131
- if (!(0, _i18n.isRTL)()) {
132
- popoverLeft = Math.max(popoverLeft, 0);
133
- }
134
- }
135
-
136
- return {
137
- xAxis: chosenXAxis,
138
- popoverLeft,
139
- contentWidth
140
- };
141
- }
142
- /**
143
- * Utility used to compute the popover position over the yAxis
144
- *
145
- * @param {Object} anchorRect Anchor Rect.
146
- * @param {Object} contentSize Content Size.
147
- * @param {string} yAxis Desired yAxis.
148
- * @param {string} corner Desired corner.
149
- * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky
150
- * and normal position.
151
- * @param {Element} anchorRef The anchor element.
152
- * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned
153
- * parent container.
154
- * @param {boolean} forcePosition Don't adjust position based on anchor.
155
- * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
156
- * scroll position to determine sticky behavior.
157
- * @return {Object} Popover xAxis position and constraints.
158
- */
159
-
160
-
161
- function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper) {
162
- const {
163
- height
164
- } = contentSize;
165
-
166
- if (stickyBoundaryElement) {
167
- const stickyRect = stickyBoundaryElement.getBoundingClientRect();
168
- const stickyPositionTop = stickyRect.top + height - relativeOffsetTop;
169
- const stickyPositionBottom = stickyRect.bottom - height - relativeOffsetTop;
170
-
171
- if (anchorRect.top <= stickyPositionTop) {
172
- if (editorWrapper) {
173
- // If a popover cannot be positioned above the anchor, even after scrolling, we must
174
- // ensure we use the bottom position instead of the popover slot. This prevents the
175
- // popover from always restricting block content and interaction while selected if the
176
- // block is near the top of the site editor.
177
- const isRoomAboveInCanvas = height + HEIGHT_OFFSET < editorWrapper.scrollTop + anchorRect.top;
178
-
179
- if (!isRoomAboveInCanvas) {
180
- return {
181
- yAxis: 'bottom',
182
- // If the bottom of the block is also below the bottom sticky position (ex -
183
- // block is also taller than the editor window), return the bottom sticky
184
- // position instead. We do this instead of the top sticky position both to
185
- // allow a smooth transition and more importantly to ensure every section of
186
- // the block can be free from popover obscuration at some point in the
187
- // scroll position.
188
- popoverTop: Math.min(anchorRect.bottom, stickyPositionBottom)
189
- };
190
- }
191
- } // Default sticky behavior.
192
-
193
-
194
- return {
195
- yAxis,
196
- popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
197
- };
198
- }
199
- } // Y axis alignment choices.
200
-
201
-
202
- let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
203
-
204
- if (corner === 'bottom') {
205
- anchorMidPoint = anchorRect.bottom;
206
- } else if (corner === 'top') {
207
- anchorMidPoint = anchorRect.top;
208
- }
209
-
210
- const middleAlignment = {
211
- popoverTop: anchorMidPoint,
212
- contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
213
- };
214
- const topAlignment = {
215
- popoverTop: anchorRect.top,
216
- contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
217
- };
218
- const bottomAlignment = {
219
- popoverTop: anchorRect.bottom,
220
- contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
221
- }; // Choosing the y axis.
222
-
223
- let chosenYAxis = yAxis;
224
- let contentHeight = null;
225
-
226
- if (!stickyBoundaryElement && !forcePosition) {
227
- if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
228
- chosenYAxis = 'middle';
229
- } else if (yAxis === 'top' && topAlignment.contentHeight === height) {
230
- chosenYAxis = 'top';
231
- } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
232
- chosenYAxis = 'bottom';
233
- } else {
234
- chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
235
- const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
236
- contentHeight = chosenHeight !== height ? chosenHeight : null;
237
- }
238
- }
239
-
240
- let popoverTop;
241
-
242
- if (chosenYAxis === 'middle') {
243
- popoverTop = middleAlignment.popoverTop;
244
- } else if (chosenYAxis === 'top') {
245
- popoverTop = topAlignment.popoverTop;
246
- } else {
247
- popoverTop = bottomAlignment.popoverTop;
248
- }
249
-
250
- return {
251
- yAxis: chosenYAxis,
252
- popoverTop,
253
- contentHeight
254
- };
255
- }
256
- /**
257
- * Utility used to compute the popover position and the content max width/height for a popover given
258
- * its anchor rect and its content size.
259
- *
260
- * @param {Object} anchorRect Anchor Rect.
261
- * @param {Object} contentSize Content Size.
262
- * @param {string} position Position.
263
- * @param {boolean} stickyBoundaryElement The boundary element to use when switching between
264
- * sticky and normal position.
265
- * @param {Element} anchorRef The anchor element.
266
- * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned
267
- * parent container.
268
- * @param {Element} boundaryElement Boundary element.
269
- * @param {boolean} forcePosition Don't adjust position based on anchor.
270
- * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
271
- * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
272
- * scroll position to determine sticky behavior.
273
- * @return {Object} Popover position and constraints.
274
- */
275
-
276
-
277
- function computePopoverPosition(anchorRect, contentSize) {
278
- let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
279
- let stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined;
280
- let anchorRef = arguments.length > 4 ? arguments[4] : undefined;
281
- let relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
282
- let boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
283
- let forcePosition = arguments.length > 7 ? arguments[7] : undefined;
284
- let forceXAlignment = arguments.length > 8 ? arguments[8] : undefined;
285
- let editorWrapper = arguments.length > 9 ? arguments[9] : undefined;
286
- const [yAxis, xAxis = 'center', corner] = position.split(' ');
287
- const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper);
288
- const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment);
289
- return { ...xAxisPosition,
290
- ...yAxisPosition
291
- };
292
- }
293
- /**
294
- * Offsets the given rect by the position of the iframe that contains the
295
- * element. If the owner document is not in an iframe then it returns with the
296
- * original rect. If the popover container document and the anchor document are
297
- * the same, the original rect will also be returned.
298
- *
299
- * @param {DOMRect} rect bounds of the element
300
- * @param {Document} ownerDocument document of the element
301
- * @param {Element} container The popover container to position.
302
- *
303
- * @return {DOMRect} offsetted bounds
304
- */
305
-
306
-
307
- function offsetIframe(rect, ownerDocument, container) {
308
- const {
309
- defaultView
310
- } = ownerDocument;
311
- const {
312
- frameElement
313
- } = defaultView;
314
-
315
- if (!frameElement || ownerDocument === container.ownerDocument) {
316
- return rect;
317
- }
318
-
319
- const iframeRect = frameElement.getBoundingClientRect();
320
- return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height);
321
- }
322
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["HEIGHT_OFFSET","computePopoverXAxisPosition","anchorRect","contentSize","xAxis","corner","stickyBoundaryElement","chosenYAxis","boundaryElement","forcePosition","forceXAlignment","width","anchorMidPoint","Math","round","left","centerAlignment","popoverLeft","contentWidth","window","innerWidth","leftAlignmentX","right","rightAlignmentX","leftAlignment","rightAlignment","chosenXAxis","chosenWidth","min","offsetLeft","offsetWidth","max","computePopoverYAxisPosition","yAxis","anchorRef","relativeOffsetTop","editorWrapper","height","stickyRect","getBoundingClientRect","stickyPositionTop","top","stickyPositionBottom","bottom","isRoomAboveInCanvas","scrollTop","popoverTop","middleAlignment","contentHeight","innerHeight","topAlignment","bottomAlignment","chosenHeight","computePopoverPosition","position","split","yAxisPosition","xAxisPosition","offsetIframe","rect","ownerDocument","container","defaultView","frameElement","iframeRect","DOMRect"],"mappings":";;;;;;;;;;AAIA;;AAJA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,2BAAT,CACNC,UADM,EAENC,WAFM,EAGNC,KAHM,EAINC,MAJM,EAKNC,qBALM,EAMNC,WANM,EAONC,eAPM,EAQNC,aARM,EASNC,eATM,EAUL;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAYR,WAAlB,CADC,CAGD;;AACA,MAAKC,KAAK,KAAK,MAAV,IAAoB,kBAAzB,EAAmC;AAClCA,IAAAA,KAAK,GAAG,OAAR;AACA,GAFD,MAEO,IAAKA,KAAK,KAAK,OAAV,IAAqB,kBAA1B,EAAoC;AAC1CA,IAAAA,KAAK,GAAG,MAAR;AACA;;AAED,MAAKC,MAAM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eATgD,CAAjD;AAYA,SAAO,EACN,GAAG+C,aADG;AAEN,OAAGD;AAFG,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,YAAT,CAAuBC,IAAvB,EAA6BC,aAA7B,EAA4CC,SAA5C,EAAwD;AAC9D,QAAM;AAAEC,IAAAA;AAAF,MAAkBF,aAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAmBD,WAAzB;;AAEA,MAAK,CAAEC,YAAF,IAAkBH,aAAa,KAAKC,SAAS,CAACD,aAAnD,EAAmE;AAClE,WAAOD,IAAP;AACA;;AAED,QAAMK,UAAU,GAAGD,YAAY,CAACxB,qBAAb,EAAnB;AACA,SAAO,IAAIuB,WAAW,CAACG,OAAhB,CACNN,IAAI,CAAC5C,IAAL,GAAYiD,UAAU,CAACjD,IADjB,EAEN4C,IAAI,CAAClB,GAAL,GAAWuB,UAAU,CAACvB,GAFhB,EAGNkB,IAAI,CAAChD,KAHC,EAINgD,IAAI,CAACtB,MAJC,CAAP;AAMA","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Module constants\n */\nconst HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.\n\n/**\n * Utility used to compute the popover position over the xAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} xAxis Desired xAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when\n * switching between sticky and normal\n * position.\n * @param {string} chosenYAxis yAxis to be used.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n *\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverXAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\txAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tchosenYAxis,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment\n) {\n\tconst { width } = contentSize;\n\n\t// Correct xAxis for RTL support.\n\tif ( xAxis === 'left' && isRTL() ) {\n\t\txAxis = 'right';\n\t} else if ( xAxis === 'right' && isRTL() ) {\n\t\txAxis = 'left';\n\t}\n\n\tif ( corner === 'left' && isRTL() ) {\n\t\tcorner = 'right';\n\t} else if ( corner === 'right' && isRTL() ) {\n\t\tcorner = 'left';\n\t}\n\n\t// X axis alignment choices.\n\tconst anchorMidPoint = Math.round( anchorRect.left + anchorRect.width / 2 );\n\tconst centerAlignment = {\n\t\tpopoverLeft: anchorMidPoint,\n\t\tcontentWidth:\n\t\t\t( anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + width / 2 > window.innerWidth\n\t\t\t\t? window.innerWidth - anchorMidPoint\n\t\t\t\t: width / 2 ),\n\t};\n\n\tlet leftAlignmentX = anchorRect.left;\n\n\tif ( corner === 'right' ) {\n\t\tleftAlignmentX = anchorRect.right;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\tleftAlignmentX = anchorMidPoint;\n\t}\n\n\tlet rightAlignmentX = anchorRect.right;\n\n\tif ( corner === 'left' ) {\n\t\trightAlignmentX = anchorRect.left;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\trightAlignmentX = anchorMidPoint;\n\t}\n\n\tconst leftAlignment = {\n\t\tpopoverLeft: leftAlignmentX,\n\t\tcontentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX,\n\t};\n\tconst rightAlignment = {\n\t\tpopoverLeft: rightAlignmentX,\n\t\tcontentWidth:\n\t\t\trightAlignmentX + width > window.innerWidth\n\t\t\t\t? window.innerWidth - rightAlignmentX\n\t\t\t\t: width,\n\t};\n\n\t// Choosing the x axis.\n\tlet chosenXAxis = xAxis;\n\tlet contentWidth = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( xAxis === 'center' && centerAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'center';\n\t\t} else if ( xAxis === 'left' && leftAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'left';\n\t\t} else if (\n\t\t\txAxis === 'right' &&\n\t\t\trightAlignment.contentWidth === width\n\t\t) {\n\t\t\tchosenXAxis = 'right';\n\t\t} else {\n\t\t\tchosenXAxis =\n\t\t\t\tleftAlignment.contentWidth > rightAlignment.contentWidth\n\t\t\t\t\t? 'left'\n\t\t\t\t\t: 'right';\n\t\t\tconst chosenWidth =\n\t\t\t\tchosenXAxis === 'left'\n\t\t\t\t\t? leftAlignment.contentWidth\n\t\t\t\t\t: rightAlignment.contentWidth;\n\n\t\t\t// Limit width of the content to the viewport width\n\t\t\tif ( width > window.innerWidth ) {\n\t\t\t\tcontentWidth = window.innerWidth;\n\t\t\t}\n\n\t\t\t// If we can't find any alignment options that could fit\n\t\t\t// our content, then let's fallback to the center of the viewport.\n\t\t\tif ( chosenWidth !== width ) {\n\t\t\t\tchosenXAxis = 'center';\n\t\t\t\tcenterAlignment.popoverLeft = window.innerWidth / 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tlet popoverLeft;\n\tif ( chosenXAxis === 'center' ) {\n\t\tpopoverLeft = centerAlignment.popoverLeft;\n\t} else if ( chosenXAxis === 'left' ) {\n\t\tpopoverLeft = leftAlignment.popoverLeft;\n\t} else {\n\t\tpopoverLeft = rightAlignment.popoverLeft;\n\t}\n\n\tif ( boundaryElement ) {\n\t\tpopoverLeft = Math.min(\n\t\t\tpopoverLeft,\n\t\t\tboundaryElement.offsetLeft + boundaryElement.offsetWidth - width\n\t\t);\n\n\t\t// Avoid the popover being position beyond the left boundary if the\n\t\t// direction is left to right.\n\t\tif ( ! isRTL() ) {\n\t\t\tpopoverLeft = Math.max( popoverLeft, 0 );\n\t\t}\n\t}\n\n\treturn {\n\t\txAxis: chosenXAxis,\n\t\tpopoverLeft,\n\t\tcontentWidth,\n\t};\n}\n\n/**\n * Utility used to compute the popover position over the yAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} yAxis Desired yAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky\n * and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverYAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\tyAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tforcePosition,\n\teditorWrapper\n) {\n\tconst { height } = contentSize;\n\n\tif ( stickyBoundaryElement ) {\n\t\tconst stickyRect = stickyBoundaryElement.getBoundingClientRect();\n\t\tconst stickyPositionTop = stickyRect.top + height - relativeOffsetTop;\n\t\tconst stickyPositionBottom =\n\t\t\tstickyRect.bottom - height - relativeOffsetTop;\n\n\t\tif ( anchorRect.top <= stickyPositionTop ) {\n\t\t\tif ( editorWrapper ) {\n\t\t\t\t// If a popover cannot be positioned above the anchor, even after scrolling, we must\n\t\t\t\t// ensure we use the bottom position instead of the popover slot. This prevents the\n\t\t\t\t// popover from always restricting block content and interaction while selected if the\n\t\t\t\t// block is near the top of the site editor.\n\n\t\t\t\tconst isRoomAboveInCanvas =\n\t\t\t\t\theight + HEIGHT_OFFSET <\n\t\t\t\t\teditorWrapper.scrollTop + anchorRect.top;\n\t\t\t\tif ( ! isRoomAboveInCanvas ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tyAxis: 'bottom',\n\t\t\t\t\t\t// If the bottom of the block is also below the bottom sticky position (ex -\n\t\t\t\t\t\t// block is also taller than the editor window), return the bottom sticky\n\t\t\t\t\t\t// position instead. We do this instead of the top sticky position both to\n\t\t\t\t\t\t// allow a smooth transition and more importantly to ensure every section of\n\t\t\t\t\t\t// the block can be free from popover obscuration at some point in the\n\t\t\t\t\t\t// scroll position.\n\t\t\t\t\t\tpopoverTop: Math.min(\n\t\t\t\t\t\t\tanchorRect.bottom,\n\t\t\t\t\t\t\tstickyPositionBottom\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Default sticky behavior.\n\t\t\treturn {\n\t\t\t\tyAxis,\n\t\t\t\tpopoverTop: Math.min( anchorRect.bottom, stickyPositionTop ),\n\t\t\t};\n\t\t}\n\t}\n\n\t// Y axis alignment choices.\n\tlet anchorMidPoint = anchorRect.top + anchorRect.height / 2;\n\n\tif ( corner === 'bottom' ) {\n\t\tanchorMidPoint = anchorRect.bottom;\n\t} else if ( corner === 'top' ) {\n\t\tanchorMidPoint = anchorRect.top;\n\t}\n\n\tconst middleAlignment = {\n\t\tpopoverTop: anchorMidPoint,\n\t\tcontentHeight:\n\t\t\t( anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + height / 2 > window.innerHeight\n\t\t\t\t? window.innerHeight - anchorMidPoint\n\t\t\t\t: height / 2 ),\n\t};\n\n\tconst topAlignment = {\n\t\tpopoverTop: anchorRect.top,\n\t\tcontentHeight:\n\t\t\tanchorRect.top - HEIGHT_OFFSET - height > 0\n\t\t\t\t? height\n\t\t\t\t: anchorRect.top - HEIGHT_OFFSET,\n\t};\n\tconst bottomAlignment = {\n\t\tpopoverTop: anchorRect.bottom,\n\t\tcontentHeight:\n\t\t\tanchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight\n\t\t\t\t? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom\n\t\t\t\t: height,\n\t};\n\n\t// Choosing the y axis.\n\tlet chosenYAxis = yAxis;\n\tlet contentHeight = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( yAxis === 'middle' && middleAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'middle';\n\t\t} else if ( yAxis === 'top' && topAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'top';\n\t\t} else if (\n\t\t\tyAxis === 'bottom' &&\n\t\t\tbottomAlignment.contentHeight === height\n\t\t) {\n\t\t\tchosenYAxis = 'bottom';\n\t\t} else {\n\t\t\tchosenYAxis =\n\t\t\t\ttopAlignment.contentHeight > bottomAlignment.contentHeight\n\t\t\t\t\t? 'top'\n\t\t\t\t\t: 'bottom';\n\t\t\tconst chosenHeight =\n\t\t\t\tchosenYAxis === 'top'\n\t\t\t\t\t? topAlignment.contentHeight\n\t\t\t\t\t: bottomAlignment.contentHeight;\n\t\t\tcontentHeight = chosenHeight !== height ? chosenHeight : null;\n\t\t}\n\t}\n\n\tlet popoverTop;\n\tif ( chosenYAxis === 'middle' ) {\n\t\tpopoverTop = middleAlignment.popoverTop;\n\t} else if ( chosenYAxis === 'top' ) {\n\t\tpopoverTop = topAlignment.popoverTop;\n\t} else {\n\t\tpopoverTop = bottomAlignment.popoverTop;\n\t}\n\n\treturn {\n\t\tyAxis: chosenYAxis,\n\t\tpopoverTop,\n\t\tcontentHeight,\n\t};\n}\n\n/**\n * Utility used to compute the popover position and the content max width/height for a popover given\n * its anchor rect and its content size.\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} position Position.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between\n * sticky and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover position and constraints.\n */\nexport function computePopoverPosition(\n\tanchorRect,\n\tcontentSize,\n\tposition = 'top',\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment,\n\teditorWrapper\n) {\n\tconst [ yAxis, xAxis = 'center', corner ] = position.split( ' ' );\n\n\tconst yAxisPosition = computePopoverYAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\tyAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tanchorRef,\n\t\trelativeOffsetTop,\n\t\tforcePosition,\n\t\teditorWrapper\n\t);\n\tconst xAxisPosition = computePopoverXAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\txAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tyAxisPosition.yAxis,\n\t\tboundaryElement,\n\t\tforcePosition,\n\t\tforceXAlignment\n\t);\n\n\treturn {\n\t\t...xAxisPosition,\n\t\t...yAxisPosition,\n\t};\n}\n\n/**\n * Offsets the given rect by the position of the iframe that contains the\n * element. If the owner document is not in an iframe then it returns with the\n * original rect. If the popover container document and the anchor document are\n * the same, the original rect will also be returned.\n *\n * @param {DOMRect} rect bounds of the element\n * @param {Document} ownerDocument document of the element\n * @param {Element} container The popover container to position.\n *\n * @return {DOMRect} offsetted bounds\n */\nexport function offsetIframe( rect, ownerDocument, container ) {\n\tconst { defaultView } = ownerDocument;\n\tconst { frameElement } = defaultView;\n\n\tif ( ! frameElement || ownerDocument === container.ownerDocument ) {\n\t\treturn rect;\n\t}\n\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn new defaultView.DOMRect(\n\t\trect.left + iframeRect.left,\n\t\trect.top + iframeRect.top,\n\t\trect.width,\n\t\trect.height\n\t);\n}\n"]}
@@ -1,11 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createContext, useContext } from '@wordpress/element';
5
- /**
6
- * @type {import('react').Context<import('./types').Context>}
7
- */
8
-
9
- export const FlyoutContext = createContext({});
10
- export const useFlyoutContext = () => useContext(FlyoutContext);
11
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/context.js"],"names":["createContext","useContext","FlyoutContext","useFlyoutContext"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,UAAxB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAGF,aAAa,CAAE,EAAF,CAAnC;AACP,OAAO,MAAMG,gBAAgB,GAAG,MAAMF,UAAU,CAAEC,aAAF,CAAzC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * @type {import('react').Context<import('./types').Context>}\n */\nexport const FlyoutContext = createContext( {} );\nexport const useFlyoutContext = () => useContext( FlyoutContext );\n"]}
@@ -1,89 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement } from "@wordpress/element";
3
-
4
- /**
5
- * External dependencies
6
- */
7
- // eslint-disable-next-line no-restricted-imports
8
- import { PopoverDisclosure, Portal } from 'reakit';
9
- /**
10
- * WordPress dependencies
11
- */
12
-
13
- import { useCallback, useMemo, cloneElement } from '@wordpress/element';
14
- /**
15
- * Internal dependencies
16
- */
17
-
18
- import { contextConnect } from '../../ui/context';
19
- import { FlyoutContext } from '../context';
20
- import { useFlyoutResizeUpdater } from '../utils';
21
- import FlyoutContent from '../flyout-content';
22
- import { useUpdateEffect } from '../../utils/hooks';
23
- import { useFlyout } from './hook';
24
- /**
25
- *
26
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div', false>} props
27
- * @param {import('react').ForwardedRef<any>} forwardedRef
28
- */
29
-
30
- function Flyout(props, forwardedRef) {
31
- const {
32
- children,
33
- elevation,
34
- label,
35
- maxWidth,
36
- onVisibleChange,
37
- trigger,
38
- flyoutState,
39
- ...otherProps
40
- } = useFlyout(props);
41
- const resizeListener = useFlyoutResizeUpdater({
42
- onResize: flyoutState.unstable_update
43
- });
44
- const uniqueId = `flyout-${flyoutState.baseId}`;
45
- const labelId = label || uniqueId;
46
- const contextProps = useMemo(() => ({
47
- label: labelId,
48
- flyoutState
49
- }), [labelId, flyoutState]);
50
- const triggerContent = useCallback(triggerProps => {
51
- return cloneElement(trigger, triggerProps);
52
- }, [trigger]);
53
- useUpdateEffect(() => {
54
- onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(flyoutState.visible);
55
- }, [flyoutState.visible]);
56
- return createElement(FlyoutContext.Provider, {
57
- value: contextProps
58
- }, trigger && createElement(PopoverDisclosure, _extends({}, flyoutState, {
59
- ref: trigger.ref
60
- }, trigger.props), triggerContent), createElement(Portal, null, createElement(FlyoutContent, _extends({
61
- ref: forwardedRef
62
- }, otherProps, {
63
- elevation: elevation,
64
- maxWidth: maxWidth
65
- }), resizeListener, children)));
66
- }
67
- /**
68
- * `Flyout` is a component to render a floating content modal.
69
- * It is similar in purpose to a tooltip, but renders content of any sort,
70
- * not only simple text.
71
- *
72
- * @example
73
- * ```jsx
74
- * import { Button, __experimentalFlyout as Flyout, __experimentalText as } from '@wordpress/components';
75
- *
76
- * function Example() {
77
- * return (
78
- * <Flyout trigger={ <Button>Show/Hide content</Button> }>
79
- * <Text>Code is Poetry</Text>
80
- * </Flyout>
81
- * );
82
- * }
83
- * ```
84
- */
85
-
86
-
87
- const ConnectedFlyout = contextConnect(Flyout, 'Flyout');
88
- export default ConnectedFlyout;
89
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/flyout/component.js"],"names":["PopoverDisclosure","Portal","useCallback","useMemo","cloneElement","contextConnect","FlyoutContext","useFlyoutResizeUpdater","FlyoutContent","useUpdateEffect","useFlyout","Flyout","props","forwardedRef","children","elevation","label","maxWidth","onVisibleChange","trigger","flyoutState","otherProps","resizeListener","onResize","unstable_update","uniqueId","baseId","labelId","contextProps","triggerContent","triggerProps","visible","ref","ConnectedFlyout"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA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,CAAIE,WAAW,CAACW,OAAhB,CAAf;AACA,GAFc,EAEZ,CAAEX,WAAW,CAACW,OAAd,CAFY,CAAf;AAIA,SACC,cAAC,aAAD,CAAe,QAAf;AAAwB,IAAA,KAAK,EAAGH;AAAhC,KACGT,OAAO,IACR,cAAC,iBAAD,eACMC,WADN;AAEC,IAAA,GAAG,EAAGD,OAAO,CAACa;AAFf,KAGMb,OAAO,CAACP,KAHd,GAKGiB,cALH,CAFF,EAUC,cAAC,MAAD,QACC,cAAC,aAAD;AACC,IAAA,GAAG,EAAGhB;AADP,KAEMQ,UAFN;AAGC,IAAA,SAAS,EAAGN,SAHb;AAIC,IAAA,QAAQ,EAAGE;AAJZ,MAMGK,cANH,EAOGR,QAPH,CADD,CAVD,CADD;AAwBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMmB,eAAe,GAAG5B,cAAc,CAAEM,MAAF,EAAU,QAAV,CAAtC;AAEA,eAAesB,eAAf","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport { PopoverDisclosure, Portal } from 'reakit';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, cloneElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { FlyoutContext } from '../context';\nimport { useFlyoutResizeUpdater } from '../utils';\nimport FlyoutContent from '../flyout-content';\nimport { useUpdateEffect } from '../../utils/hooks';\nimport { useFlyout } from './hook';\n\n/**\n *\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div', false>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Flyout( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tlabel,\n\t\tmaxWidth,\n\t\tonVisibleChange,\n\t\ttrigger,\n\t\tflyoutState,\n\t\t...otherProps\n\t} = useFlyout( props );\n\n\tconst resizeListener = useFlyoutResizeUpdater( {\n\t\tonResize: flyoutState.unstable_update,\n\t} );\n\n\tconst uniqueId = `flyout-${ flyoutState.baseId }`;\n\tconst labelId = label || uniqueId;\n\n\tconst contextProps = useMemo(\n\t\t() => ( {\n\t\t\tlabel: labelId,\n\t\t\tflyoutState,\n\t\t} ),\n\t\t[ labelId, flyoutState ]\n\t);\n\n\tconst triggerContent = useCallback(\n\t\t( triggerProps ) => {\n\t\t\treturn cloneElement( trigger, triggerProps );\n\t\t},\n\t\t[ trigger ]\n\t);\n\n\tuseUpdateEffect( () => {\n\t\tonVisibleChange?.( flyoutState.visible );\n\t}, [ flyoutState.visible ] );\n\n\treturn (\n\t\t<FlyoutContext.Provider value={ contextProps }>\n\t\t\t{ trigger && (\n\t\t\t\t<PopoverDisclosure\n\t\t\t\t\t{ ...flyoutState }\n\t\t\t\t\tref={ trigger.ref }\n\t\t\t\t\t{ ...trigger.props }\n\t\t\t\t>\n\t\t\t\t\t{ triggerContent }\n\t\t\t\t</PopoverDisclosure>\n\t\t\t) }\n\t\t\t<Portal>\n\t\t\t\t<FlyoutContent\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\televation={ elevation }\n\t\t\t\t\tmaxWidth={ maxWidth }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t{ children }\n\t\t\t\t</FlyoutContent>\n\t\t\t</Portal>\n\t\t</FlyoutContext.Provider>\n\t);\n}\n\n/**\n * `Flyout` is a component to render a floating content modal.\n * It is similar in purpose to a tooltip, but renders content of any sort,\n * not only simple text.\n *\n * @example\n * ```jsx\n * import { Button, __experimentalFlyout as Flyout, __experimentalText as } from '@wordpress/components';\n *\n * function Example() {\n * \treturn (\n * \t\t<Flyout trigger={ <Button>Show/Hide content</Button> }>\n *\t\t\t<Text>Code is Poetry</Text>\n * \t\t</Flyout>\n * \t);\n * }\n * ```\n */\nconst ConnectedFlyout = contextConnect( Flyout, 'Flyout' );\n\nexport default ConnectedFlyout;\n"]}
@@ -1,44 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- // eslint-disable-next-line no-restricted-imports
5
- import { usePopoverState } from 'reakit';
6
- /**
7
- * Internal dependencies
8
- */
9
-
10
- import { useContextSystem } from '../../ui/context';
11
- /**
12
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div', false>} props
13
- */
14
-
15
- export function useFlyout(props) {
16
- const {
17
- animated = true,
18
- animationDuration = 160,
19
- baseId,
20
- elevation = 5,
21
- id,
22
- maxWidth = 360,
23
- placement,
24
- state,
25
- visible,
26
- ...otherProps
27
- } = useContextSystem(props, 'Flyout');
28
-
29
- const _flyoutState = usePopoverState({
30
- animated: animated ? animationDuration : undefined,
31
- baseId: baseId || id,
32
- placement,
33
- visible,
34
- ...otherProps
35
- });
36
-
37
- const flyoutState = state || _flyoutState;
38
- return { ...otherProps,
39
- elevation,
40
- maxWidth,
41
- flyoutState
42
- };
43
- }
44
- //# sourceMappingURL=hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/flyout/hook.js"],"names":["usePopoverState","useContextSystem","useFlyout","props","animated","animationDuration","baseId","elevation","id","maxWidth","placement","state","visible","otherProps","_flyoutState","undefined","flyoutState"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,QAAhC;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,kBAAjC;AAEA;AACA;AACA;;AACA,OAAO,SAASC,SAAT,CAAoBC,KAApB,EAA4B;AAClC,QAAM;AACLC,IAAAA,QAAQ,GAAG,IADN;AAELC,IAAAA,iBAAiB,GAAG,GAFf;AAGLC,IAAAA,MAHK;AAILC,IAAAA,SAAS,GAAG,CAJP;AAKLC,IAAAA,EALK;AAMLC,IAAAA,QAAQ,GAAG,GANN;AAOLC,IAAAA,SAPK;AAQLC,IAAAA,KARK;AASLC,IAAAA,OATK;AAUL,OAAGC;AAVE,MAWFZ,gBAAgB,CAAEE,KAAF,EAAS,QAAT,CAXpB;;AAaA,QAAMW,YAAY,GAAGd,eAAe,CAAE;AACrCI,IAAAA,QAAQ,EAAEA,QAAQ,GAAGC,iBAAH,GAAuBU,SADJ;AAErCT,IAAAA,MAAM,EAAEA,MAAM,IAAIE,EAFmB;AAGrCE,IAAAA,SAHqC;AAIrCE,IAAAA,OAJqC;AAKrC,OAAGC;AALkC,GAAF,CAApC;;AAQA,QAAMG,WAAW,GAAGL,KAAK,IAAIG,YAA7B;AAEA,SAAO,EACN,GAAGD,UADG;AAENN,IAAAA,SAFM;AAGNE,IAAAA,QAHM;AAINO,IAAAA;AAJM,GAAP;AAMA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport { usePopoverState } from 'reakit';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem } from '../../ui/context';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div', false>} props\n */\nexport function useFlyout( props ) {\n\tconst {\n\t\tanimated = true,\n\t\tanimationDuration = 160,\n\t\tbaseId,\n\t\televation = 5,\n\t\tid,\n\t\tmaxWidth = 360,\n\t\tplacement,\n\t\tstate,\n\t\tvisible,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Flyout' );\n\n\tconst _flyoutState = usePopoverState( {\n\t\tanimated: animated ? animationDuration : undefined,\n\t\tbaseId: baseId || id,\n\t\tplacement,\n\t\tvisible,\n\t\t...otherProps,\n\t} );\n\n\tconst flyoutState = state || _flyoutState;\n\n\treturn {\n\t\t...otherProps,\n\t\televation,\n\t\tmaxWidth,\n\t\tflyoutState,\n\t};\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { default } from './component';
2
- export { useFlyout } from './hook';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/flyout/index.js"],"names":["default","useFlyout"],"mappings":"AAAA,SAASA,OAAT,QAAwB,aAAxB;AACA,SAASC,SAAT,QAA0B,QAA1B","sourcesContent":["export { default } from './component';\nexport { useFlyout } from './hook';\n"]}
@@ -1,51 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement } from "@wordpress/element";
3
-
4
- /**
5
- * Internal dependencies
6
- */
7
- import { useFlyoutContext } from '../context';
8
- import { FlyoutContentView, CardView } from '../styles';
9
- import { contextConnect, useContextSystem } from '../../ui/context';
10
- /**
11
- *
12
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').ContentProps, 'div', false>} props
13
- * @param {import('react').ForwardedRef<any>} forwardedRef forwardedRef
14
- */
15
-
16
- function FlyoutContent(props, forwardedRef) {
17
- const {
18
- children,
19
- elevation,
20
- maxWidth,
21
- style = {},
22
- ...otherProps
23
- } = useContextSystem(props, 'FlyoutContent');
24
- const {
25
- label,
26
- flyoutState
27
- } = useFlyoutContext();
28
-
29
- if (!flyoutState) {
30
- throw new Error('`FlyoutContent` must only be used inside a `Flyout`.');
31
- }
32
-
33
- const showContent = flyoutState.visible || flyoutState.animating;
34
- return createElement(FlyoutContentView, _extends({
35
- "aria-label": label // maxWidth is applied via inline styles in order to avoid the `React does
36
- // not recognize the maxWidth prop on a DOM element` error that comes from
37
- // passing `maxWidth` as a prop to `FlyoutContentView`
38
- ,
39
- style: {
40
- maxWidth,
41
- ...style
42
- }
43
- }, otherProps, flyoutState), showContent && createElement(CardView, {
44
- elevation: elevation,
45
- ref: forwardedRef
46
- }, children));
47
- }
48
-
49
- const ConnectedFlyoutContent = contextConnect(FlyoutContent, 'FlyoutContent');
50
- export default ConnectedFlyoutContent;
51
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/flyout-content/component.js"],"names":["useFlyoutContext","FlyoutContentView","CardView","contextConnect","useContextSystem","FlyoutContent","props","forwardedRef","children","elevation","maxWidth","style","otherProps","label","flyoutState","Error","showContent","visible","animating","ConnectedFlyoutContent"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,gBAAT,QAAiC,YAAjC;AACA,SAASC,iBAAT,EAA4BC,QAA5B,QAA4C,WAA5C;AACA,SAASC,cAAT,EAAyBC,gBAAzB,QAAiD,kBAAjD;AAEA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT,CAAwBC,KAAxB,EAA+BC,YAA/B,EAA8C;AAC7C,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,KAAK,GAAG,EAJH;AAKL,OAAGC;AALE,MAMFR,gBAAgB,CAAEE,KAAF,EAAS,eAAT,CANpB;AAQA,QAAM;AAAEO,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyBd,gBAAgB,EAA/C;;AAEA,MAAK,CAAEc,WAAP,EAAqB;AACpB,UAAM,IAAIC,KAAJ,CACL,sDADK,CAAN;AAGA;;AAED,QAAMC,WAAW,GAAGF,WAAW,CAACG,OAAZ,IAAuBH,WAAW,CAACI,SAAvD;AAEA,SACC,cAAC,iBAAD;AACC,kBAAaL,KADd,CAEC;AACA;AACA;AAJD;AAKC,IAAA,KAAK,EAAG;AAAEH,MAAAA,QAAF;AAAY,SAAGC;AAAf;AALT,KAMMC,UANN,EAOME,WAPN,GASGE,WAAW,IACZ,cAAC,QAAD;AAAU,IAAA,SAAS,EAAGP,SAAtB;AAAkC,IAAA,GAAG,EAAGF;AAAxC,KACGC,QADH,CAVF,CADD;AAiBA;;AAED,MAAMW,sBAAsB,GAAGhB,cAAc,CAAEE,aAAF,EAAiB,eAAjB,CAA7C;AAEA,eAAec,sBAAf","sourcesContent":["/**\n * Internal dependencies\n */\nimport { useFlyoutContext } from '../context';\nimport { FlyoutContentView, CardView } from '../styles';\nimport { contextConnect, useContextSystem } from '../../ui/context';\n\n/**\n *\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').ContentProps, 'div', false>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef forwardedRef\n */\nfunction FlyoutContent( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tmaxWidth,\n\t\tstyle = {},\n\t\t...otherProps\n\t} = useContextSystem( props, 'FlyoutContent' );\n\n\tconst { label, flyoutState } = useFlyoutContext();\n\n\tif ( ! flyoutState ) {\n\t\tthrow new Error(\n\t\t\t'`FlyoutContent` must only be used inside a `Flyout`.'\n\t\t);\n\t}\n\n\tconst showContent = flyoutState.visible || flyoutState.animating;\n\n\treturn (\n\t\t<FlyoutContentView\n\t\t\taria-label={ label }\n\t\t\t// maxWidth is applied via inline styles in order to avoid the `React does\n\t\t\t// not recognize the maxWidth prop on a DOM element` error that comes from\n\t\t\t// passing `maxWidth` as a prop to `FlyoutContentView`\n\t\t\tstyle={ { maxWidth, ...style } }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...flyoutState }\n\t\t>\n\t\t\t{ showContent && (\n\t\t\t\t<CardView elevation={ elevation } ref={ forwardedRef }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CardView>\n\t\t\t) }\n\t\t</FlyoutContentView>\n\t);\n}\n\nconst ConnectedFlyoutContent = contextConnect( FlyoutContent, 'FlyoutContent' );\n\nexport default ConnectedFlyoutContent;\n"]}
@@ -1,2 +0,0 @@
1
- export { default } from './component';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/flyout-content/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,aAAxB","sourcesContent":["export { default } from './component';\n"]}
@@ -1,2 +0,0 @@
1
- export { default as Flyout } from './flyout';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/components/src/flyout/index.js"],"names":["default","Flyout"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAApB,QAAkC,UAAlC","sourcesContent":["export { default as Flyout } from './flyout';\n"]}