@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 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","BottomSheetContext","setHeight","BottomSheetNavigationContext","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","styles","scrollableContent","paddingBottom"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAKA;;AAOA;;AACA;;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,QAM7B;AAAA,MAN+B;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA,YAHqC;AAIrCC,IAAAA,QAJqC;AAKrCC,IAAAA;AALqC,GAM/B;AACN,QAAMC,UAAU,GAAG,4BAAnB;AACA,QAAMC,SAAS,GAAG,qBAAQ;AAAEC,IAAAA,SAAS,EAAE;AAAb,GAAR,CAAlB;AACA,QAAMC,SAAS,GAAG,2BAAlB;AACA,QAAM;AACLC,IAAAA,2BADK;AAELC,IAAAA,gCAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA;AALK,MAMF,yBAAYC,8BAAZ,CANJ;AAQA,QAAM;AAAEC,IAAAA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A9B;AACAN,MAAAA,iBAAiB,CAAEM,MAAF,CAAjB;AACA;AACD,GAVD;;AAYA,SAAO,sBAAS,MAAM;AACrB,WAAOrB,YAAY,IAAIC,QAAhB,GACN,4BAAC,iBAAD;AACC,MAAA,QAAQ,EAAGkB,QADZ;AAEC,MAAA,MAAM,EAAI,qBAAqBjB,IAAM;AAFtC,OAIGJ,QAJH,CADM,GAQN,4BAAC,uBAAD,EAAiBY,SAAjB,EACC,4BAAC,+BAAD;AAAoB,MAAA,UAAU,EAAG;AAAjC,OACC,4BAAC,iBAAD;AACC,MAAA,QAAQ,EAAGS,QADZ;AAEC,MAAA,MAAM,EAAI,qBAAqBjB,IAAM;AAFtC,OAIGJ,QAJH,EAKG,CAAEG,QAAF,IACD,4BAAC,iBAAD;AACC,MAAA,KAAK,EAAG;AACPoB,QAAAA,MAAM,EACLV,mBAAmB,IACnBY,gBAAOC,iBAAP,CAAyBC;AAHnB;AADT,MANF,CADD,CADD,CARD;AA4BA,GA7BM,EA6BJ,CACF3B,QADE,EAEFQ,SAFE,EAGFK,mBAHE,EAIFD,SAJE,EAKFR,IALE,EAMFF,YANE,EAOFC,QAPE,EAQFkB,QARE,CA7BI,CAAP;AAuCA,CApHD;;eAsHetB,2B","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://reactjs.org/docs/hooks-reference.html#usememo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://git.io/JD2no\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ setHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [\n\t\tchildren,\n\t\tisFocused,\n\t\tsafeAreaBottomInset,\n\t\tlistProps,\n\t\tname,\n\t\tisScrollable,\n\t\tisNested,\n\t\tonLayout,\n\t] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","BottomSheetContext","setHeight","BottomSheetNavigationContext","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","styles","scrollableContent","paddingBottom"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAKA;;AAOA;;AACA;;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,QAM7B;AAAA,MAN+B;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA,YAHqC;AAIrCC,IAAAA,QAJqC;AAKrCC,IAAAA;AALqC,GAM/B;AACN,QAAMC,UAAU,GAAG,4BAAnB;AACA,QAAMC,SAAS,GAAG,qBAAQ;AAAEC,IAAAA,SAAS,EAAE;AAAb,GAAR,CAAlB;AACA,QAAMC,SAAS,GAAG,2BAAlB;AACA,QAAM;AACLC,IAAAA,2BADK;AAELC,IAAAA,gCAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA;AALK,MAMF,yBAAYC,8BAAZ,CANJ;AAQA,QAAM;AAAEC,IAAAA;AAAF,MAAgB,yBAAYC,0DAAZ,CAAtB;AAEA,QAAMC,iBAAiB,GAAG,0BAAa,sBAAUF,SAAV,EAAqB,EAArB,CAAb,EAAwC,CACjEA,SADiE,CAAxC,CAA1B;AAIA,8BACC,0BAAa,MAAM;AAClBN,IAAAA,2BAA2B,CAAE,MAAM;AAClC,UAAKJ,UAAU,CAACa,SAAX,EAAL,EAA8B;AAC7BR,QAAAA,gCAAgC,CAAE,IAAF,CAAhC;AACAL,QAAAA,UAAU,CAACc,MAAX;AACA,eAAO,IAAP;AACA;;AACDV,MAAAA,2BAA2B,CAAE,IAAF,CAA3B;AACA,aAAO,KAAP;AACA,KAR0B,CAA3B;AASA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG,GAxBD,EAwBG,EAxBH,CADD;AA4BA,8BACC,0BAAa,MAAM;AAClB,Q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,iBAAP,CAAyBC;AAHnB;AADT,MANF,CADD,CADD,CARD;AA4BA,GA7BM,EA6BJ,CACF3B,QADE,EAEFQ,SAFE,EAGFK,mBAHE,EAIFD,SAJE,EAKFR,IALE,EAMFF,YANE,EAOFC,QAPE,EAQFkB,QARE,CA7BI,CAAP;AAuCA,CApHD;;eAsHetB,2B","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://reactjs.org/docs/hooks-reference.html#usememo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://github.com/WordPress/gutenberg/pull/36328#discussion_r768897546\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ setHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [\n\t\tchildren,\n\t\tisFocused,\n\t\tsafeAreaBottomInset,\n\t\tlistProps,\n\t\tname,\n\t\tisScrollable,\n\t\tisNested,\n\t\tonLayout,\n\t] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
@@ -169,7 +169,7 @@ class BottomSheet extends _element.Component {
169
169
  } else {// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with
170
170
  // more nuanced `Animated` usage or replacing our custom `BottomSheet`
171
171
  // with `@gorhom/bottom-sheet`. This animation was disabled to avoid a
172
- // preexisting bug: https://git.io/JMPCV
172
+ // preexisting bug: https://github.com/WordPress/gutenberg/issues/30562
173
173
  // this.performRegularLayoutAnimation( {
174
174
  // useLastLayoutAnimation: false,
175
175
  // } );.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/index.native.js"],"names":["DEFAULT_LAYOUT_ANIMATION","LayoutAnimation","Presets","easeInEaseOut","BottomSheet","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onScroll","isScrolling","onShouldEnableScroll","onDismiss","onShouldSetBottomSheetMaxHeight","setIsFullScreen","onDimensionsChange","onHeaderLayout","onCloseBottomSheet","onHandleClosingBottomSheet","onHardwareButtonPress","onHandleHardwareButtonPress","keyboardShow","keyboardHide","headerHeight","keyboardHeight","lastLayoutAnimation","lastLayoutAnimationFinished","state","safeAreaBottomInset","safeAreaTopInset","bounces","maxHeight","scrollEnabled","handleClosingBottomSheet","handleHardwareButtonPress","isMaxHeightSet","isFullScreen","props","e","isVisible","height","endCoordinates","performKeyboardLayoutAnimation","onSetMaxHeight","onKeyboardShow","onKeyboardHide","event","duration","easing","animationConfig","type","Types","layoutAnimation","update","create","property","Properties","opacity","delete","configureNext","performRegularLayoutAnimation","useLastLayoutAnimation","Platform","OS","componentDidMount","SafeArea","getSafeAreaInsetsForRootView","then","androidModalClosedSubscription","onClose","dimensionsChangeSubscription","Dimensions","addEventListener","keyboardShowListener","Keyboard","addListener","keyboardHideListener","safeAreaEventSubscription","componentWillUnmount","remove","result","safeAreaInsets","bottom","top","setState","width","get","statusBarHeight","StatusBar","currentHeight","maxHeightWithOpenKeyboard","Math","min","nativeEvent","layout","round","isCloseToBottom","layoutMeasurement","contentOffset","contentSize","y","isCloseToTop","value","action","getContentStyle","paddingBottom","styles","scrollableContent","render","title","leftButton","rightButton","header","hideHeader","style","contentStyle","getStylesFromColorScheme","children","withHeaderSeparator","hasNavigation","rest","panResponder","PanResponder","onMoveShouldSetPanResponder","evt","gestureState","dy","backgroundStyle","background","backgroundDark","bottomSheetHeaderTitleStyle","bottomSheetHeaderTitle","bottomSheetHeaderTitleDark","listStyle","flexGrow","flexShrink","setMinHeightToMaxHeight","minHeight","listProps","disableScrollViewPanResponder","onScrollBeginDrag","onScrollEndDrag","scrollEventThrottle","contentContainerStyle","content","emptyHeader","automaticallyAdjustContentInsets","WrapperView","View","ScrollView","getHeader","bottomSheetHeader","flex","separator","showDragIndicator","allowDragIndicator","bottomModal","undefined","panHandlers","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","borderColor","marginTop","backgroundFullScreen","testID","dragIndicator","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","getWidth","maxWidth","ThemedBottomSheet","Button","Cell","SubSheet","BottomSheetSubSheet","NavBar","CyclePickerCell","PickerCell","SwitchCell","RangeCell","ColorCell","LinkCell","LinkSuggestionItemCell","RadioCell","NavigationScreen","NavigationContainer"],"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AoB;AACnB,SAAO9E,IAAI,CAACC,GAAL,CACNrB,wBAAWe,GAAX,CAAgB,QAAhB,EAA2BD,KADrB,EAENqB,gBAAOsB,UAAP,CAAkB0C,QAFZ,CAAP;AAIA;;AAED,MAAMC,iBAAiB,GAAG,uCAA0BxK,WAA1B,CAA1B;AAEAwK,iBAAiB,CAACF,QAAlB,GAA6BA,QAA7B;AACAE,iBAAiB,CAACC,MAAlB,GAA2BA,eAA3B;AACAD,iBAAiB,CAACE,IAAlB,GAAyBA,aAAzB;AACAF,iBAAiB,CAACG,QAAlB,GAA6BC,iBAA7B;AACAJ,iBAAiB,CAACK,MAAlB,GAA2BA,eAA3B;AACAL,iBAAiB,CAACM,eAAlB,GAAoCA,wBAApC;AACAN,iBAAiB,CAACO,UAAlB,GAA+BA,mBAA/B;AACAP,iBAAiB,CAACQ,UAAlB,GAA+BA,mBAA/B;AACAR,iBAAiB,CAACS,SAAlB,GAA8BA,kBAA9B;AACAT,iBAAiB,CAACU,SAAlB,GAA8BA,kBAA9B;AACAV,iBAAiB,CAACW,QAAlB,GAA6BA,iBAA7B;AACAX,iBAAiB,CAACY,sBAAlB,GAA2CA,+BAA3C;AACAZ,iBAAiB,CAACa,SAAlB,GAA8BA,kBAA9B;AACAb,iBAAiB,CAACc,gBAAlB,GAAqCA,yBAArC;AACAd,iBAAiB,CAACe,mBAAlB,GAAwCA,4BAAxC;eAEef,iB","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tDimensions,\n\tKeyboard,\n\tLayoutAnimation,\n\tPanResponder,\n\tPlatform,\n\tScrollView,\n\tStatusBar,\n\tText,\n\tTouchableHighlight,\n\tView,\n} from 'react-native';\nimport Modal from 'react-native-modal';\nimport SafeArea from 'react-native-safe-area';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { subscribeAndroidModalClosed } from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport Button from './button';\nimport Cell from './cell';\nimport CyclePickerCell from './cycle-picker-cell';\nimport PickerCell from './picker-cell';\nimport SwitchCell from './switch-cell';\nimport RangeCell from './range-cell';\nimport ColorCell from './color-cell';\nimport LinkCell from './link-cell';\nimport LinkSuggestionItemCell from './link-suggestion-item-cell';\nimport RadioCell from './radio-cell';\nimport NavigationScreen from './bottom-sheet-navigation/navigation-screen';\nimport NavigationContainer from './bottom-sheet-navigation/navigation-container';\nimport KeyboardAvoidingView from './keyboard-avoiding-view';\nimport BottomSheetSubSheet from './sub-sheet';\nimport NavBar from './nav-bar';\nimport { BottomSheetProvider } from './bottom-sheet-context';\n\nconst DEFAULT_LAYOUT_ANIMATION = LayoutAnimation.Presets.easeInEaseOut;\n\nclass BottomSheet extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onScroll = this.onScroll.bind( this );\n\t\tthis.isScrolling = this.isScrolling.bind( this );\n\t\tthis.onShouldEnableScroll = this.onShouldEnableScroll.bind( this );\n\t\tthis.onDismiss = this.onDismiss.bind( this );\n\t\tthis.onShouldSetBottomSheetMaxHeight = this.onShouldSetBottomSheetMaxHeight.bind(\n\t\t\tthis\n\t\t);\n\n\t\tthis.setIsFullScreen = this.setIsFullScreen.bind( this );\n\n\t\tthis.onDimensionsChange = this.onDimensionsChange.bind( this );\n\t\tthis.onHeaderLayout = this.onHeaderLayout.bind( this );\n\t\tthis.onCloseBottomSheet = this.onCloseBottomSheet.bind( this );\n\t\tthis.onHandleClosingBottomSheet = this.onHandleClosingBottomSheet.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.onHardwareButtonPress = this.onHardwareButtonPress.bind( this );\n\t\tthis.onHandleHardwareButtonPress = this.onHandleHardwareButtonPress.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.keyboardShow = this.keyboardShow.bind( this );\n\t\tthis.keyboardHide = this.keyboardHide.bind( this );\n\n\t\tthis.headerHeight = 0;\n\t\tthis.keyboardHeight = 0;\n\t\tthis.lastLayoutAnimation = null;\n\t\tthis.lastLayoutAnimationFinished = false;\n\n\t\tthis.state = {\n\t\t\tsafeAreaBottomInset: 0,\n\t\t\tsafeAreaTopInset: 0,\n\t\t\tbounces: false,\n\t\t\tmaxHeight: 0,\n\t\t\tscrollEnabled: true,\n\t\t\tisScrolling: false,\n\t\t\thandleClosingBottomSheet: null,\n\t\t\thandleHardwareButtonPress: null,\n\t\t\tisMaxHeightSet: true,\n\t\t\tisFullScreen: this.props.isFullScreen || false,\n\t\t};\n\t}\n\n\tkeyboardShow( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { height } = e.endCoordinates;\n\t\tthis.keyboardHeight = height;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardShow?.();\n\t}\n\n\tkeyboardHide( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyboardHeight = 0;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardHide?.();\n\t}\n\n\tperformKeyboardLayoutAnimation( event ) {\n\t\tconst { duration, easing } = event;\n\n\t\tif ( duration && easing ) {\n\t\t\t// This layout animation is the same as the React Native's KeyboardAvoidingView component.\n\t\t\t// Reference: https://github.com/facebook/react-native/blob/266b21baf35e052ff28120f79c06c4f6dddc51a9/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L119-L128.\n\t\t\tconst animationConfig = {\n\t\t\t\t// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m.\n\t\t\t\tduration: duration > 10 ? duration : 10,\n\t\t\t\ttype: LayoutAnimation.Types[ easing ] || 'keyboard',\n\t\t\t};\n\t\t\tconst layoutAnimation = {\n\t\t\t\tduration: animationConfig.duration,\n\t\t\t\tupdate: animationConfig,\n\t\t\t\tcreate: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t\tdelete: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.lastLayoutAnimationFinished = false;\n\t\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t\t} );\n\t\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t\t} else {\n\t\t\t// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with\n\t\t\t// more nuanced `Animated` usage or replacing our custom `BottomSheet`\n\t\t\t// with `@gorhom/bottom-sheet`. This animation was disabled to avoid a\n\t\t\t// preexisting bug: https://git.io/JMPCV\n\t\t\t// this.performRegularLayoutAnimation( {\n\t\t\t// \tuseLastLayoutAnimation: false,\n\t\t\t// } );.\n\t\t}\n\t}\n\n\tperformRegularLayoutAnimation( { useLastLayoutAnimation } ) {\n\t\t// On Android, we should prevent triggering multiple layout animations at the same time because it can produce visual glitches.\n\t\tif (\n\t\t\tPlatform.OS === 'android' &&\n\t\t\tthis.lastLayoutAnimation &&\n\t\t\t! this.lastLayoutAnimationFinished\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layoutAnimation = useLastLayoutAnimation\n\t\t\t? this.lastLayoutAnimation || DEFAULT_LAYOUT_ANIMATION\n\t\t\t: DEFAULT_LAYOUT_ANIMATION;\n\n\t\tthis.lastLayoutAnimationFinished = false;\n\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t} );\n\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t}\n\n\tcomponentDidMount() {\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\n\t\tif ( Platform.OS === 'android' ) {\n\t\t\tthis.androidModalClosedSubscription = subscribeAndroidModalClosed(\n\t\t\t\t() => {\n\t\t\t\t\tthis.props.onClose();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tthis.dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tthis.onDimensionsChange\n\t\t);\n\n\t\t// 'Will' keyboard events are not available on Android.\n\t\t// Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener.\n\t\tthis.keyboardShowListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow',\n\t\t\tthis.keyboardShow\n\t\t);\n\t\tthis.keyboardHideListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide',\n\t\t\tthis.keyboardHide\n\t\t);\n\n\t\tthis.safeAreaEventSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.dimensionsChangeSubscription.remove();\n\t\tthis.keyboardShowListener.remove();\n\t\tthis.keyboardHideListener.remove();\n\t\tif ( this.androidModalClosedSubscription ) {\n\t\t\tthis.androidModalClosedSubscription.remove();\n\t\t}\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.safeAreaEventSubscription.remove();\n\t\tthis.safeAreaEventSubscription = null;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaBottomInset, safeAreaTopInset } = this.state;\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { safeAreaInsets } = result;\n\t\tif (\n\t\t\tsafeAreaBottomInset !== safeAreaInsets.bottom ||\n\t\t\tsafeAreaTopInset !== safeAreaInsets.top\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tsafeAreaBottomInset: safeAreaInsets.bottom,\n\t\t\t\tsafeAreaTopInset: safeAreaInsets.top,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSetMaxHeight() {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\tconst statusBarHeight =\n\t\t\tPlatform.OS === 'android' ? StatusBar.currentHeight : 0;\n\n\t\t// `maxHeight` when modal is opened along with a keyboard.\n\t\tconst maxHeightWithOpenKeyboard =\n\t\t\t0.95 *\n\t\t\t( Dimensions.get( 'window' ).height -\n\t\t\t\tthis.keyboardHeight -\n\t\t\t\tstatusBarHeight -\n\t\t\t\tthis.headerHeight );\n\n\t\t// In landscape orientation, set `maxHeight` to ~96% of the height.\n\t\tif ( width > height ) {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\t0.96 * height - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t\t// In portrait orientation, set `maxHeight` to ~59% of the height.\n\t\t} else {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\theight * 0.59 - safeAreaBottomInset - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t}\n\n\tonDimensionsChange() {\n\t\tthis.onSetMaxHeight();\n\t\tthis.setState( { bounces: false } );\n\t}\n\n\tonHeaderLayout( { nativeEvent } ) {\n\t\tconst { height } = nativeEvent.layout;\n\t\t// The layout animation should only be triggered if the header\n\t\t// height has changed after being mounted.\n\t\tif (\n\t\t\tthis.headerHeight !== 0 &&\n\t\t\tMath.round( height ) !== Math.round( this.headerHeight )\n\t\t) {\n\t\t\tthis.performRegularLayoutAnimation( {\n\t\t\t\tuseLastLayoutAnimation: true,\n\t\t\t} );\n\t\t}\n\t\tthis.headerHeight = height;\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tisCloseToBottom( { layoutMeasurement, contentOffset, contentSize } ) {\n\t\treturn (\n\t\t\tlayoutMeasurement.height + contentOffset.y >=\n\t\t\tcontentSize.height - contentOffset.y\n\t\t);\n\t}\n\n\tisCloseToTop( { contentOffset } ) {\n\t\treturn contentOffset.y < 10;\n\t}\n\n\tonScroll( { nativeEvent } ) {\n\t\tif ( this.isCloseToTop( nativeEvent ) ) {\n\t\t\tthis.setState( { bounces: false } );\n\t\t} else {\n\t\t\tthis.setState( { bounces: true } );\n\t\t}\n\t}\n\n\tonDismiss() {\n\t\tconst { onDismiss } = this.props;\n\n\t\tif ( onDismiss ) {\n\t\t\tonDismiss();\n\t\t}\n\n\t\tthis.onCloseBottomSheet();\n\t}\n\n\tonShouldEnableScroll( value ) {\n\t\tthis.setState( { scrollEnabled: value } );\n\t}\n\n\tonShouldSetBottomSheetMaxHeight( value ) {\n\t\tthis.setState( { isMaxHeightSet: value } );\n\t}\n\n\tisScrolling( value ) {\n\t\tthis.setState( { isScrolling: value } );\n\t}\n\n\tonHandleClosingBottomSheet( action ) {\n\t\tthis.setState( { handleClosingBottomSheet: action } );\n\t}\n\n\tonHandleHardwareButtonPress( action ) {\n\t\tthis.setState( { handleHardwareButtonPress: action } );\n\t}\n\n\tonCloseBottomSheet() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleClosingBottomSheet } = this.state;\n\t\tif ( handleClosingBottomSheet ) {\n\t\t\thandleClosingBottomSheet();\n\t\t\tthis.onHandleClosingBottomSheet( null );\n\t\t}\n\t\tif ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t\tthis.onShouldSetBottomSheetMaxHeight( true );\n\t}\n\n\tsetIsFullScreen( isFullScreen ) {\n\t\tif ( isFullScreen !== this.state.isFullScreen ) {\n\t\t\tif ( isFullScreen ) {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: false } );\n\t\t\t} else {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: true } );\n\t\t\t}\n\t\t}\n\t}\n\n\tonHardwareButtonPress() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleHardwareButtonPress } = this.state;\n\t\tif ( handleHardwareButtonPress && handleHardwareButtonPress() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( onClose ) {\n\t\t\treturn onClose();\n\t\t}\n\t}\n\n\tgetContentStyle() {\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\treturn {\n\t\t\tpaddingBottom:\n\t\t\t\t( safeAreaBottomInset || 0 ) +\n\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t};\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttitle = '',\n\t\t\tisVisible,\n\t\t\tleftButton,\n\t\t\trightButton,\n\t\t\theader,\n\t\t\thideHeader,\n\t\t\tstyle = {},\n\t\t\tcontentStyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tchildren,\n\t\t\twithHeaderSeparator = false,\n\t\t\thasNavigation,\n\t\t\t...rest\n\t\t} = this.props;\n\t\tconst {\n\t\t\tmaxHeight,\n\t\t\tbounces,\n\t\t\tsafeAreaBottomInset,\n\t\t\tsafeAreaTopInset,\n\t\t\tisScrolling,\n\t\t\tscrollEnabled,\n\t\t\tisMaxHeightSet,\n\t\t\tisFullScreen,\n\t\t} = this.state;\n\n\t\tconst panResponder = PanResponder.create( {\n\t\t\tonMoveShouldSetPanResponder: ( evt, gestureState ) => {\n\t\t\t\t// 'swiping-to-close' option is temporarily and partially disabled\n\t\t\t\t// on Android ( swipe / drag is still available in the top most area - near drag indicator).\n\t\t\t\tif ( Platform.OS === 'ios' ) {\n\t\t\t\t\t// Activates swipe down over child Touchables if the swipe is long enough.\n\t\t\t\t\t// With this we can adjust sensibility on the swipe vs tap gestures.\n\t\t\t\t\tif ( gestureState.dy > 3 && ! bounces ) {\n\t\t\t\t\t\tgestureState.dy = 0;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t} );\n\n\t\tconst backgroundStyle = getStylesFromColorScheme(\n\t\t\tstyles.background,\n\t\t\tstyles.backgroundDark\n\t\t);\n\n\t\tconst bottomSheetHeaderTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.bottomSheetHeaderTitle,\n\t\t\tstyles.bottomSheetHeaderTitleDark\n\t\t);\n\n\t\tlet listStyle = {};\n\t\tif ( isFullScreen ) {\n\t\t\tlistStyle = { flexGrow: 1, flexShrink: 1 };\n\t\t} else if ( isMaxHeightSet ) {\n\t\t\tlistStyle = { maxHeight };\n\n\t\t\t// Allow setting a \"static\" height of the bottom sheet\n\t\t\t// by setting the min height to the max height.\n\t\t\tif ( this.props.setMinHeightToMaxHeight ) {\n\t\t\t\tlistStyle.minHeight = maxHeight;\n\t\t\t}\n\t\t}\n\n\t\tconst listProps = {\n\t\t\tdisableScrollViewPanResponder: true,\n\t\t\tbounces,\n\t\t\tonScroll: this.onScroll,\n\t\t\tonScrollBeginDrag: this.onScrollBeginDrag,\n\t\t\tonScrollEndDrag: this.onScrollEndDrag,\n\t\t\tscrollEventThrottle: 16,\n\t\t\tcontentContainerStyle: [\n\t\t\t\tstyles.content,\n\t\t\t\thideHeader && styles.emptyHeader,\n\t\t\t\tcontentStyle,\n\t\t\t\tisFullScreen && { flexGrow: 1 },\n\t\t\t],\n\t\t\tstyle: listStyle,\n\t\t\tsafeAreaBottomInset,\n\t\t\tscrollEnabled,\n\t\t\tautomaticallyAdjustContentInsets: false,\n\t\t};\n\n\t\tconst WrapperView = hasNavigation ? View : ScrollView;\n\n\t\tconst getHeader = () => (\n\t\t\t<>\n\t\t\t\t{ header || (\n\t\t\t\t\t<View style={ styles.bottomSheetHeader }>\n\t\t\t\t\t\t<View style={ styles.flex }>{ leftButton }</View>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={ bottomSheetHeaderTitleStyle }\n\t\t\t\t\t\t\tmaxFontSizeMultiplier={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View style={ styles.flex }>{ rightButton }</View>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t\t{ withHeaderSeparator && <View style={ styles.separator } /> }\n\t\t\t</>\n\t\t);\n\n\t\tconst showDragIndicator = () => {\n\t\t\t// If iOS or not fullscreen show the drag indicator.\n\t\t\tif ( Platform.OS === 'ios' || ! this.state.isFullScreen ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Otherwise check the allowDragIndicator.\n\t\t\treturn this.props.allowDragIndicator;\n\t\t};\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tisVisible={ isVisible }\n\t\t\t\tstyle={ styles.bottomModal }\n\t\t\t\tanimationInTiming={ 400 }\n\t\t\t\tanimationOutTiming={ 300 }\n\t\t\t\tbackdropTransitionInTiming={ 50 }\n\t\t\t\tbackdropTransitionOutTiming={ 50 }\n\t\t\t\tbackdropOpacity={ 0.2 }\n\t\t\t\tonBackdropPress={ this.onCloseBottomSheet }\n\t\t\t\tonBackButtonPress={ this.onHardwareButtonPress }\n\t\t\t\tonSwipeComplete={ this.onCloseBottomSheet }\n\t\t\t\tonDismiss={ Platform.OS === 'ios' ? this.onDismiss : undefined }\n\t\t\t\tonModalHide={\n\t\t\t\t\tPlatform.OS === 'android' ? this.onDismiss : undefined\n\t\t\t\t}\n\t\t\t\tswipeDirection=\"down\"\n\t\t\t\tonMoveShouldSetResponder={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponder\n\t\t\t\t}\n\t\t\t\tonMoveShouldSetResponderCapture={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponderCapture\n\t\t\t\t}\n\t\t\t\tonAccessibilityEscape={ this.onCloseBottomSheet }\n\t\t\t\t// We need to prevent overwriting the onDismiss prop,\n\t\t\t\t// for this reason it is excluded from the rest object.\n\t\t\t\t{ ...omit( rest, 'onDismiss' ) }\n\t\t\t>\n\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\tbehavior={ Platform.OS === 'ios' && 'padding' }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...backgroundStyle,\n\t\t\t\t\t\tborderColor: 'rgba(0, 0, 0, 0.1)',\n\t\t\t\t\t\tmarginTop:\n\t\t\t\t\t\t\tPlatform.OS === 'ios' && isFullScreen\n\t\t\t\t\t\t\t\t? safeAreaTopInset\n\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\tflex: isFullScreen ? 1 : undefined,\n\t\t\t\t\t\t...( Platform.OS === 'android' && isFullScreen\n\t\t\t\t\t\t\t? styles.backgroundFullScreen\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tkeyboardVerticalOffset={ -safeAreaBottomInset }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ styles.header }\n\t\t\t\t\t\tonLayout={ this.onHeaderLayout }\n\t\t\t\t\t\ttestID={ `${ rest.testID || 'bottom-sheet' }-header` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showDragIndicator() && (\n\t\t\t\t\t\t\t<View style={ styles.dragIndicator } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! hideHeader && getHeader() }\n\t\t\t\t\t</View>\n\t\t\t\t\t<WrapperView\n\t\t\t\t\t\t{ ...( hasNavigation\n\t\t\t\t\t\t\t? { style: listProps.style }\n\t\t\t\t\t\t\t: listProps ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BottomSheetProvider\n\t\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll: this\n\t\t\t\t\t\t\t\t\t.onShouldEnableScroll,\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetMaxHeight: this\n\t\t\t\t\t\t\t\t\t.onShouldSetBottomSheetMaxHeight,\n\t\t\t\t\t\t\t\tisBottomSheetContentScrolling: isScrolling,\n\t\t\t\t\t\t\t\tonHandleClosingBottomSheet: this\n\t\t\t\t\t\t\t\t\t.onHandleClosingBottomSheet,\n\t\t\t\t\t\t\t\tonHandleHardwareButtonPress: this\n\t\t\t\t\t\t\t\t\t.onHandleHardwareButtonPress,\n\t\t\t\t\t\t\t\tlistProps,\n\t\t\t\t\t\t\t\tsetIsFullScreen: this.setIsFullScreen,\n\t\t\t\t\t\t\t\tsafeAreaBottomInset,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasNavigation ? (\n\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t\t</TouchableHighlight>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheetProvider>\n\t\t\t\t\t\t{ ! hasNavigation && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</WrapperView>\n\t\t\t\t</KeyboardAvoidingView>\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nfunction getWidth() {\n\treturn Math.min(\n\t\tDimensions.get( 'window' ).width,\n\t\tstyles.background.maxWidth\n\t);\n}\n\nconst ThemedBottomSheet = withPreferredColorScheme( BottomSheet );\n\nThemedBottomSheet.getWidth = getWidth;\nThemedBottomSheet.Button = Button;\nThemedBottomSheet.Cell = Cell;\nThemedBottomSheet.SubSheet = BottomSheetSubSheet;\nThemedBottomSheet.NavBar = NavBar;\nThemedBottomSheet.CyclePickerCell = CyclePickerCell;\nThemedBottomSheet.PickerCell = PickerCell;\nThemedBottomSheet.SwitchCell = SwitchCell;\nThemedBottomSheet.RangeCell = RangeCell;\nThemedBottomSheet.ColorCell = ColorCell;\nThemedBottomSheet.LinkCell = LinkCell;\nThemedBottomSheet.LinkSuggestionItemCell = LinkSuggestionItemCell;\nThemedBottomSheet.RadioCell = RadioCell;\nThemedBottomSheet.NavigationScreen = NavigationScreen;\nThemedBottomSheet.NavigationContainer = NavigationContainer;\n\nexport default ThemedBottomSheet;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/index.native.js"],"names":["DEFAULT_LAYOUT_ANIMATION","LayoutAnimation","Presets","easeInEaseOut","BottomSheet","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onScroll","isScrolling","onShouldEnableScroll","onDismiss","onShouldSetBottomSheetMaxHeight","setIsFullScreen","onDimensionsChange","onHeaderLayout","onCloseBottomSheet","onHandleClosingBottomSheet","onHardwareButtonPress","onHandleHardwareButtonPress","keyboardShow","keyboardHide","headerHeight","keyboardHeight","lastLayoutAnimation","lastLayoutAnimationFinished","state","safeAreaBottomInset","safeAreaTopInset","bounces","maxHeight","scrollEnabled","handleClosingBottomSheet","handleHardwareButtonPress","isMaxHeightSet","isFullScreen","props","e","isVisible","height","endCoordinates","performKeyboardLayoutAnimation","onSetMaxHeight","onKeyboardShow","onKeyboardHide","event","duration","easing","animationConfig","type","Types","layoutAnimation","update","create","property","Properties","opacity","delete","configureNext","performRegularLayoutAnimation","useLastLayoutAnimation","Platform","OS","componentDidMount","SafeArea","getSafeAreaInsetsForRootView","then","androidModalClosedSubscription","onClose","dimensionsChangeSubscription","Dimensions","addEventListener","keyboardShowListener","Keyboard","addListener","keyboardHideListener","safeAreaEventSubscription","componentWillUnmount","remove","result","safeAreaInsets","bottom","top","setState","width","get","statusBarHeight","StatusBar","currentHeight","maxHeightWithOpenKeyboard","Math","min","nativeEvent","layout","round","isCloseToBottom","layoutMeasurement","contentOffset","contentSize","y","isCloseToTop","value","action","getContentStyle","paddingBottom","styles","scrollableContent","render","title","leftButton","rightButton","header","hideHeader","style","contentStyle","getStylesFromColorScheme","children","withHeaderSeparator","hasNavigation","rest","panResponder","PanResponder","onMoveShouldSetPanResponder","evt","gestureState","dy","backgroundStyle","background","backgroundDark","bottomSheetHeaderTitleStyle","bottomSheetHeaderTitle","bottomSheetHeaderTitleDark","listStyle","flexGrow","flexShrink","setMinHeightToMaxHeight","minHeight","listProps","disableScrollViewPanResponder","onScrollBeginDrag","onScrollEndDrag","scrollEventThrottle","contentContainerStyle","content","emptyHeader","automaticallyAdjustContentInsets","WrapperView","View","ScrollView","getHeader","bottomSheetHeader","flex","separator","showDragIndicator","allowDragIndicator","bottomModal","undefined","panHandlers","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","borderColor","marginTop","backgroundFullScreen","testID","dragIndicator","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","getWidth","maxWidth","ThemedBottomSheet","Button","Cell","SubSheet","BottomSheetSubSheet","NavBar","CyclePickerCell","PickerCell","SwitchCell","RangeCell","ColorCell","LinkCell","LinkSuggestionItemCell","RadioCell","NavigationScreen","NavigationContainer"],"mappings":";;;;;;;;;AAuBA;;;;AApBA;;AAYA;;AACA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA7CA;AACA;AACA;;AAiBA;AACA;AACA;;AAKA;AACA;AACA;AAmBA,MAAMA,wBAAwB,GAAGC,6BAAgBC,OAAhB,CAAwBC,aAAzD;;AAEA,MAAMC,WAAN,SAA0BC,kBAA1B,CAAoC;AACnCC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AACA,SAAKC,sBAAL,GAA8B,KAAKA,sBAAL,CAA4BC,IAA5B,CAAkC,IAA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A,wBAApC;AACAN,iBAAiB,CAACO,UAAlB,GAA+BA,mBAA/B;AACAP,iBAAiB,CAACQ,UAAlB,GAA+BA,mBAA/B;AACAR,iBAAiB,CAACS,SAAlB,GAA8BA,kBAA9B;AACAT,iBAAiB,CAACU,SAAlB,GAA8BA,kBAA9B;AACAV,iBAAiB,CAACW,QAAlB,GAA6BA,iBAA7B;AACAX,iBAAiB,CAACY,sBAAlB,GAA2CA,+BAA3C;AACAZ,iBAAiB,CAACa,SAAlB,GAA8BA,kBAA9B;AACAb,iBAAiB,CAACc,gBAAlB,GAAqCA,yBAArC;AACAd,iBAAiB,CAACe,mBAAlB,GAAwCA,4BAAxC;eAEef,iB","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tDimensions,\n\tKeyboard,\n\tLayoutAnimation,\n\tPanResponder,\n\tPlatform,\n\tScrollView,\n\tStatusBar,\n\tText,\n\tTouchableHighlight,\n\tView,\n} from 'react-native';\nimport Modal from 'react-native-modal';\nimport SafeArea from 'react-native-safe-area';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { subscribeAndroidModalClosed } from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport Button from './button';\nimport Cell from './cell';\nimport CyclePickerCell from './cycle-picker-cell';\nimport PickerCell from './picker-cell';\nimport SwitchCell from './switch-cell';\nimport RangeCell from './range-cell';\nimport ColorCell from './color-cell';\nimport LinkCell from './link-cell';\nimport LinkSuggestionItemCell from './link-suggestion-item-cell';\nimport RadioCell from './radio-cell';\nimport NavigationScreen from './bottom-sheet-navigation/navigation-screen';\nimport NavigationContainer from './bottom-sheet-navigation/navigation-container';\nimport KeyboardAvoidingView from './keyboard-avoiding-view';\nimport BottomSheetSubSheet from './sub-sheet';\nimport NavBar from './nav-bar';\nimport { BottomSheetProvider } from './bottom-sheet-context';\n\nconst DEFAULT_LAYOUT_ANIMATION = LayoutAnimation.Presets.easeInEaseOut;\n\nclass BottomSheet extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onScroll = this.onScroll.bind( this );\n\t\tthis.isScrolling = this.isScrolling.bind( this );\n\t\tthis.onShouldEnableScroll = this.onShouldEnableScroll.bind( this );\n\t\tthis.onDismiss = this.onDismiss.bind( this );\n\t\tthis.onShouldSetBottomSheetMaxHeight = this.onShouldSetBottomSheetMaxHeight.bind(\n\t\t\tthis\n\t\t);\n\n\t\tthis.setIsFullScreen = this.setIsFullScreen.bind( this );\n\n\t\tthis.onDimensionsChange = this.onDimensionsChange.bind( this );\n\t\tthis.onHeaderLayout = this.onHeaderLayout.bind( this );\n\t\tthis.onCloseBottomSheet = this.onCloseBottomSheet.bind( this );\n\t\tthis.onHandleClosingBottomSheet = this.onHandleClosingBottomSheet.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.onHardwareButtonPress = this.onHardwareButtonPress.bind( this );\n\t\tthis.onHandleHardwareButtonPress = this.onHandleHardwareButtonPress.bind(\n\t\t\tthis\n\t\t);\n\t\tthis.keyboardShow = this.keyboardShow.bind( this );\n\t\tthis.keyboardHide = this.keyboardHide.bind( this );\n\n\t\tthis.headerHeight = 0;\n\t\tthis.keyboardHeight = 0;\n\t\tthis.lastLayoutAnimation = null;\n\t\tthis.lastLayoutAnimationFinished = false;\n\n\t\tthis.state = {\n\t\t\tsafeAreaBottomInset: 0,\n\t\t\tsafeAreaTopInset: 0,\n\t\t\tbounces: false,\n\t\t\tmaxHeight: 0,\n\t\t\tscrollEnabled: true,\n\t\t\tisScrolling: false,\n\t\t\thandleClosingBottomSheet: null,\n\t\t\thandleHardwareButtonPress: null,\n\t\t\tisMaxHeightSet: true,\n\t\t\tisFullScreen: this.props.isFullScreen || false,\n\t\t};\n\t}\n\n\tkeyboardShow( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { height } = e.endCoordinates;\n\t\tthis.keyboardHeight = height;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardShow?.();\n\t}\n\n\tkeyboardHide( e ) {\n\t\tif ( ! this.props.isVisible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyboardHeight = 0;\n\t\tthis.performKeyboardLayoutAnimation( e );\n\t\tthis.onSetMaxHeight();\n\t\tthis.props.onKeyboardHide?.();\n\t}\n\n\tperformKeyboardLayoutAnimation( event ) {\n\t\tconst { duration, easing } = event;\n\n\t\tif ( duration && easing ) {\n\t\t\t// This layout animation is the same as the React Native's KeyboardAvoidingView component.\n\t\t\t// Reference: https://github.com/facebook/react-native/blob/266b21baf35e052ff28120f79c06c4f6dddc51a9/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L119-L128.\n\t\t\tconst animationConfig = {\n\t\t\t\t// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m.\n\t\t\t\tduration: duration > 10 ? duration : 10,\n\t\t\t\ttype: LayoutAnimation.Types[ easing ] || 'keyboard',\n\t\t\t};\n\t\t\tconst layoutAnimation = {\n\t\t\t\tduration: animationConfig.duration,\n\t\t\t\tupdate: animationConfig,\n\t\t\t\tcreate: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t\tdelete: {\n\t\t\t\t\t...animationConfig,\n\t\t\t\t\tproperty: LayoutAnimation.Properties.opacity,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.lastLayoutAnimationFinished = false;\n\t\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t\t} );\n\t\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t\t} else {\n\t\t\t// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with\n\t\t\t// more nuanced `Animated` usage or replacing our custom `BottomSheet`\n\t\t\t// with `@gorhom/bottom-sheet`. This animation was disabled to avoid a\n\t\t\t// preexisting bug: https://github.com/WordPress/gutenberg/issues/30562\n\t\t\t// this.performRegularLayoutAnimation( {\n\t\t\t// \tuseLastLayoutAnimation: false,\n\t\t\t// } );.\n\t\t}\n\t}\n\n\tperformRegularLayoutAnimation( { useLastLayoutAnimation } ) {\n\t\t// On Android, we should prevent triggering multiple layout animations at the same time because it can produce visual glitches.\n\t\tif (\n\t\t\tPlatform.OS === 'android' &&\n\t\t\tthis.lastLayoutAnimation &&\n\t\t\t! this.lastLayoutAnimationFinished\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layoutAnimation = useLastLayoutAnimation\n\t\t\t? this.lastLayoutAnimation || DEFAULT_LAYOUT_ANIMATION\n\t\t\t: DEFAULT_LAYOUT_ANIMATION;\n\n\t\tthis.lastLayoutAnimationFinished = false;\n\t\tLayoutAnimation.configureNext( layoutAnimation, () => {\n\t\t\tthis.lastLayoutAnimationFinished = true;\n\t\t} );\n\t\tthis.lastLayoutAnimation = layoutAnimation;\n\t}\n\n\tcomponentDidMount() {\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\n\t\tif ( Platform.OS === 'android' ) {\n\t\t\tthis.androidModalClosedSubscription = subscribeAndroidModalClosed(\n\t\t\t\t() => {\n\t\t\t\t\tthis.props.onClose();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tthis.dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tthis.onDimensionsChange\n\t\t);\n\n\t\t// 'Will' keyboard events are not available on Android.\n\t\t// Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener.\n\t\tthis.keyboardShowListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow',\n\t\t\tthis.keyboardShow\n\t\t);\n\t\tthis.keyboardHideListener = Keyboard.addListener(\n\t\t\tPlatform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide',\n\t\t\tthis.keyboardHide\n\t\t);\n\n\t\tthis.safeAreaEventSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.dimensionsChangeSubscription.remove();\n\t\tthis.keyboardShowListener.remove();\n\t\tthis.keyboardHideListener.remove();\n\t\tif ( this.androidModalClosedSubscription ) {\n\t\t\tthis.androidModalClosedSubscription.remove();\n\t\t}\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.safeAreaEventSubscription.remove();\n\t\tthis.safeAreaEventSubscription = null;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaBottomInset, safeAreaTopInset } = this.state;\n\t\tif ( this.safeAreaEventSubscription === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { safeAreaInsets } = result;\n\t\tif (\n\t\t\tsafeAreaBottomInset !== safeAreaInsets.bottom ||\n\t\t\tsafeAreaTopInset !== safeAreaInsets.top\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tsafeAreaBottomInset: safeAreaInsets.bottom,\n\t\t\t\tsafeAreaTopInset: safeAreaInsets.top,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSetMaxHeight() {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\tconst statusBarHeight =\n\t\t\tPlatform.OS === 'android' ? StatusBar.currentHeight : 0;\n\n\t\t// `maxHeight` when modal is opened along with a keyboard.\n\t\tconst maxHeightWithOpenKeyboard =\n\t\t\t0.95 *\n\t\t\t( Dimensions.get( 'window' ).height -\n\t\t\t\tthis.keyboardHeight -\n\t\t\t\tstatusBarHeight -\n\t\t\t\tthis.headerHeight );\n\n\t\t// In landscape orientation, set `maxHeight` to ~96% of the height.\n\t\tif ( width > height ) {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\t0.96 * height - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t\t// In portrait orientation, set `maxHeight` to ~59% of the height.\n\t\t} else {\n\t\t\tthis.setState( {\n\t\t\t\tmaxHeight: Math.min(\n\t\t\t\t\theight * 0.59 - safeAreaBottomInset - this.headerHeight,\n\t\t\t\t\tmaxHeightWithOpenKeyboard\n\t\t\t\t),\n\t\t\t} );\n\t\t}\n\t}\n\n\tonDimensionsChange() {\n\t\tthis.onSetMaxHeight();\n\t\tthis.setState( { bounces: false } );\n\t}\n\n\tonHeaderLayout( { nativeEvent } ) {\n\t\tconst { height } = nativeEvent.layout;\n\t\t// The layout animation should only be triggered if the header\n\t\t// height has changed after being mounted.\n\t\tif (\n\t\t\tthis.headerHeight !== 0 &&\n\t\t\tMath.round( height ) !== Math.round( this.headerHeight )\n\t\t) {\n\t\t\tthis.performRegularLayoutAnimation( {\n\t\t\t\tuseLastLayoutAnimation: true,\n\t\t\t} );\n\t\t}\n\t\tthis.headerHeight = height;\n\t\tthis.onSetMaxHeight();\n\t}\n\n\tisCloseToBottom( { layoutMeasurement, contentOffset, contentSize } ) {\n\t\treturn (\n\t\t\tlayoutMeasurement.height + contentOffset.y >=\n\t\t\tcontentSize.height - contentOffset.y\n\t\t);\n\t}\n\n\tisCloseToTop( { contentOffset } ) {\n\t\treturn contentOffset.y < 10;\n\t}\n\n\tonScroll( { nativeEvent } ) {\n\t\tif ( this.isCloseToTop( nativeEvent ) ) {\n\t\t\tthis.setState( { bounces: false } );\n\t\t} else {\n\t\t\tthis.setState( { bounces: true } );\n\t\t}\n\t}\n\n\tonDismiss() {\n\t\tconst { onDismiss } = this.props;\n\n\t\tif ( onDismiss ) {\n\t\t\tonDismiss();\n\t\t}\n\n\t\tthis.onCloseBottomSheet();\n\t}\n\n\tonShouldEnableScroll( value ) {\n\t\tthis.setState( { scrollEnabled: value } );\n\t}\n\n\tonShouldSetBottomSheetMaxHeight( value ) {\n\t\tthis.setState( { isMaxHeightSet: value } );\n\t}\n\n\tisScrolling( value ) {\n\t\tthis.setState( { isScrolling: value } );\n\t}\n\n\tonHandleClosingBottomSheet( action ) {\n\t\tthis.setState( { handleClosingBottomSheet: action } );\n\t}\n\n\tonHandleHardwareButtonPress( action ) {\n\t\tthis.setState( { handleHardwareButtonPress: action } );\n\t}\n\n\tonCloseBottomSheet() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleClosingBottomSheet } = this.state;\n\t\tif ( handleClosingBottomSheet ) {\n\t\t\thandleClosingBottomSheet();\n\t\t\tthis.onHandleClosingBottomSheet( null );\n\t\t}\n\t\tif ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t\tthis.onShouldSetBottomSheetMaxHeight( true );\n\t}\n\n\tsetIsFullScreen( isFullScreen ) {\n\t\tif ( isFullScreen !== this.state.isFullScreen ) {\n\t\t\tif ( isFullScreen ) {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: false } );\n\t\t\t} else {\n\t\t\t\tthis.setState( { isFullScreen, isMaxHeightSet: true } );\n\t\t\t}\n\t\t}\n\t}\n\n\tonHardwareButtonPress() {\n\t\tconst { onClose } = this.props;\n\t\tconst { handleHardwareButtonPress } = this.state;\n\t\tif ( handleHardwareButtonPress && handleHardwareButtonPress() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( onClose ) {\n\t\t\treturn onClose();\n\t\t}\n\t}\n\n\tgetContentStyle() {\n\t\tconst { safeAreaBottomInset } = this.state;\n\t\treturn {\n\t\t\tpaddingBottom:\n\t\t\t\t( safeAreaBottomInset || 0 ) +\n\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t};\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttitle = '',\n\t\t\tisVisible,\n\t\t\tleftButton,\n\t\t\trightButton,\n\t\t\theader,\n\t\t\thideHeader,\n\t\t\tstyle = {},\n\t\t\tcontentStyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tchildren,\n\t\t\twithHeaderSeparator = false,\n\t\t\thasNavigation,\n\t\t\t...rest\n\t\t} = this.props;\n\t\tconst {\n\t\t\tmaxHeight,\n\t\t\tbounces,\n\t\t\tsafeAreaBottomInset,\n\t\t\tsafeAreaTopInset,\n\t\t\tisScrolling,\n\t\t\tscrollEnabled,\n\t\t\tisMaxHeightSet,\n\t\t\tisFullScreen,\n\t\t} = this.state;\n\n\t\tconst panResponder = PanResponder.create( {\n\t\t\tonMoveShouldSetPanResponder: ( evt, gestureState ) => {\n\t\t\t\t// 'swiping-to-close' option is temporarily and partially disabled\n\t\t\t\t// on Android ( swipe / drag is still available in the top most area - near drag indicator).\n\t\t\t\tif ( Platform.OS === 'ios' ) {\n\t\t\t\t\t// Activates swipe down over child Touchables if the swipe is long enough.\n\t\t\t\t\t// With this we can adjust sensibility on the swipe vs tap gestures.\n\t\t\t\t\tif ( gestureState.dy > 3 && ! bounces ) {\n\t\t\t\t\t\tgestureState.dy = 0;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t} );\n\n\t\tconst backgroundStyle = getStylesFromColorScheme(\n\t\t\tstyles.background,\n\t\t\tstyles.backgroundDark\n\t\t);\n\n\t\tconst bottomSheetHeaderTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.bottomSheetHeaderTitle,\n\t\t\tstyles.bottomSheetHeaderTitleDark\n\t\t);\n\n\t\tlet listStyle = {};\n\t\tif ( isFullScreen ) {\n\t\t\tlistStyle = { flexGrow: 1, flexShrink: 1 };\n\t\t} else if ( isMaxHeightSet ) {\n\t\t\tlistStyle = { maxHeight };\n\n\t\t\t// Allow setting a \"static\" height of the bottom sheet\n\t\t\t// by setting the min height to the max height.\n\t\t\tif ( this.props.setMinHeightToMaxHeight ) {\n\t\t\t\tlistStyle.minHeight = maxHeight;\n\t\t\t}\n\t\t}\n\n\t\tconst listProps = {\n\t\t\tdisableScrollViewPanResponder: true,\n\t\t\tbounces,\n\t\t\tonScroll: this.onScroll,\n\t\t\tonScrollBeginDrag: this.onScrollBeginDrag,\n\t\t\tonScrollEndDrag: this.onScrollEndDrag,\n\t\t\tscrollEventThrottle: 16,\n\t\t\tcontentContainerStyle: [\n\t\t\t\tstyles.content,\n\t\t\t\thideHeader && styles.emptyHeader,\n\t\t\t\tcontentStyle,\n\t\t\t\tisFullScreen && { flexGrow: 1 },\n\t\t\t],\n\t\t\tstyle: listStyle,\n\t\t\tsafeAreaBottomInset,\n\t\t\tscrollEnabled,\n\t\t\tautomaticallyAdjustContentInsets: false,\n\t\t};\n\n\t\tconst WrapperView = hasNavigation ? View : ScrollView;\n\n\t\tconst getHeader = () => (\n\t\t\t<>\n\t\t\t\t{ header || (\n\t\t\t\t\t<View style={ styles.bottomSheetHeader }>\n\t\t\t\t\t\t<View style={ styles.flex }>{ leftButton }</View>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={ bottomSheetHeaderTitleStyle }\n\t\t\t\t\t\t\tmaxFontSizeMultiplier={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View style={ styles.flex }>{ rightButton }</View>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t\t{ withHeaderSeparator && <View style={ styles.separator } /> }\n\t\t\t</>\n\t\t);\n\n\t\tconst showDragIndicator = () => {\n\t\t\t// If iOS or not fullscreen show the drag indicator.\n\t\t\tif ( Platform.OS === 'ios' || ! this.state.isFullScreen ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Otherwise check the allowDragIndicator.\n\t\t\treturn this.props.allowDragIndicator;\n\t\t};\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tisVisible={ isVisible }\n\t\t\t\tstyle={ styles.bottomModal }\n\t\t\t\tanimationInTiming={ 400 }\n\t\t\t\tanimationOutTiming={ 300 }\n\t\t\t\tbackdropTransitionInTiming={ 50 }\n\t\t\t\tbackdropTransitionOutTiming={ 50 }\n\t\t\t\tbackdropOpacity={ 0.2 }\n\t\t\t\tonBackdropPress={ this.onCloseBottomSheet }\n\t\t\t\tonBackButtonPress={ this.onHardwareButtonPress }\n\t\t\t\tonSwipeComplete={ this.onCloseBottomSheet }\n\t\t\t\tonDismiss={ Platform.OS === 'ios' ? this.onDismiss : undefined }\n\t\t\t\tonModalHide={\n\t\t\t\t\tPlatform.OS === 'android' ? this.onDismiss : undefined\n\t\t\t\t}\n\t\t\t\tswipeDirection=\"down\"\n\t\t\t\tonMoveShouldSetResponder={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponder\n\t\t\t\t}\n\t\t\t\tonMoveShouldSetResponderCapture={\n\t\t\t\t\tscrollEnabled &&\n\t\t\t\t\tpanResponder.panHandlers.onMoveShouldSetResponderCapture\n\t\t\t\t}\n\t\t\t\tonAccessibilityEscape={ this.onCloseBottomSheet }\n\t\t\t\t// We need to prevent overwriting the onDismiss prop,\n\t\t\t\t// for this reason it is excluded from the rest object.\n\t\t\t\t{ ...omit( rest, 'onDismiss' ) }\n\t\t\t>\n\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\tbehavior={ Platform.OS === 'ios' && 'padding' }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...backgroundStyle,\n\t\t\t\t\t\tborderColor: 'rgba(0, 0, 0, 0.1)',\n\t\t\t\t\t\tmarginTop:\n\t\t\t\t\t\t\tPlatform.OS === 'ios' && isFullScreen\n\t\t\t\t\t\t\t\t? safeAreaTopInset\n\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\tflex: isFullScreen ? 1 : undefined,\n\t\t\t\t\t\t...( Platform.OS === 'android' && isFullScreen\n\t\t\t\t\t\t\t? styles.backgroundFullScreen\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tkeyboardVerticalOffset={ -safeAreaBottomInset }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ styles.header }\n\t\t\t\t\t\tonLayout={ this.onHeaderLayout }\n\t\t\t\t\t\ttestID={ `${ rest.testID || 'bottom-sheet' }-header` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showDragIndicator() && (\n\t\t\t\t\t\t\t<View style={ styles.dragIndicator } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! hideHeader && getHeader() }\n\t\t\t\t\t</View>\n\t\t\t\t\t<WrapperView\n\t\t\t\t\t\t{ ...( hasNavigation\n\t\t\t\t\t\t\t? { style: listProps.style }\n\t\t\t\t\t\t\t: listProps ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BottomSheetProvider\n\t\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetScroll: this\n\t\t\t\t\t\t\t\t\t.onShouldEnableScroll,\n\t\t\t\t\t\t\t\tshouldEnableBottomSheetMaxHeight: this\n\t\t\t\t\t\t\t\t\t.onShouldSetBottomSheetMaxHeight,\n\t\t\t\t\t\t\t\tisBottomSheetContentScrolling: isScrolling,\n\t\t\t\t\t\t\t\tonHandleClosingBottomSheet: this\n\t\t\t\t\t\t\t\t\t.onHandleClosingBottomSheet,\n\t\t\t\t\t\t\t\tonHandleHardwareButtonPress: this\n\t\t\t\t\t\t\t\t\t.onHandleHardwareButtonPress,\n\t\t\t\t\t\t\t\tlistProps,\n\t\t\t\t\t\t\t\tsetIsFullScreen: this.setIsFullScreen,\n\t\t\t\t\t\t\t\tsafeAreaBottomInset,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasNavigation ? (\n\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t\t\t\t\t<>{ children }</>\n\t\t\t\t\t\t\t\t</TouchableHighlight>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheetProvider>\n\t\t\t\t\t\t{ ! hasNavigation && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</WrapperView>\n\t\t\t\t</KeyboardAvoidingView>\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nfunction getWidth() {\n\treturn Math.min(\n\t\tDimensions.get( 'window' ).width,\n\t\tstyles.background.maxWidth\n\t);\n}\n\nconst ThemedBottomSheet = withPreferredColorScheme( BottomSheet );\n\nThemedBottomSheet.getWidth = getWidth;\nThemedBottomSheet.Button = Button;\nThemedBottomSheet.Cell = Cell;\nThemedBottomSheet.SubSheet = BottomSheetSubSheet;\nThemedBottomSheet.NavBar = NavBar;\nThemedBottomSheet.CyclePickerCell = CyclePickerCell;\nThemedBottomSheet.PickerCell = PickerCell;\nThemedBottomSheet.SwitchCell = SwitchCell;\nThemedBottomSheet.RangeCell = RangeCell;\nThemedBottomSheet.ColorCell = ColorCell;\nThemedBottomSheet.LinkCell = LinkCell;\nThemedBottomSheet.LinkSuggestionItemCell = LinkSuggestionItemCell;\nThemedBottomSheet.RadioCell = RadioCell;\nThemedBottomSheet.NavigationScreen = NavigationScreen;\nThemedBottomSheet.NavigationContainer = NavigationContainer;\n\nexport default ThemedBottomSheet;\n"]}
@@ -70,9 +70,10 @@ const BottomSheetSelectControl = _ref => {
70
70
  value: selectedOption.label,
71
71
  onPress: openSubSheet,
72
72
  accessibilityRole: 'button',
73
- accessibilityLabel: selectedOption.label,
73
+ accessibilityLabel: (0, _i18n.sprintf)( // translators: %1$s: Select control button label e.g. "Button width". %2$s: Select control option value e.g: "Auto, 25%".
74
+ (0, _i18n.__)('%1$s. Currently selected: %2$s'), label, selectedOption.label),
74
75
  accessibilityHint: (0, _i18n.sprintf)( // translators: %s: Select control button label e.g. "Button width"
75
- (0, _i18n.__)('Navigates to select %s'), selectedOption.label)
76
+ (0, _i18n.__)('Navigates to select %s'), label)
76
77
  }, (0, _element.createElement)(_icons.Icon, {
77
78
  icon: _icons.chevronRight
78
79
  })),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"names":["BottomSheetSelectControl","label","icon","options","items","onChange","value","selectedValue","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","BottomSheet","SubSheet","screenName","chevronRight","styles","selectControl","map","item","index","check"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AAIA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,wBAAwB,GAAG,QAM1B;AAAA,MAN4B;AAClCC,IAAAA,KADkC;AAElCC,IAAAA,IAFkC;AAGlCC,IAAAA,OAAO,EAAEC,KAHyB;AAIlCC,IAAAA,QAJkC;AAKlCC,IAAAA,KAAK,EAAEC;AAL2B,GAM5B;AACN,QAAM,CAAEC,YAAF,EAAgBC,eAAhB,IAAoC,uBAAU,KAAV,CAA1C;AACA,QAAMC,UAAU,GAAG,4BAAnB;;AAEA,QAAMC,aAAa,GAAKL,KAAF,IAAa;AAClC,WAAO,MAAM;AACZM,MAAAA,MAAM;AACNP,MAAAA,QAAQ,CAAEC,KAAF,CAAR;AACA,KAHD;AAIA,GALD;;AAOA,QAAMO,cAAc,GAAGT,KAAK,CAACU,IAAN,CACpBC,MAAF,IAAcA,MAAM,CAACT,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AAK,EAAGD,IAAI,CAACxB,KAHd;AAIC,IAAA,IAAI,EAAGwB,IAAI,CAACvB,IAJb;AAKC,IAAA,OAAO,EAAGS,aAAa,CAAEc,IAAI,CAACnB,KAAP,CALxB;AAMC,IAAA,SAAS,EAAG,IANb;AAOC,IAAA,GAAG,EAAGoB,KAPP;AAQC,IAAA,iBAAiB,EAAG,QARrB;AASC,IAAA,kBAAkB,EACjBD,IAAI,CAACnB,KAAL,KAAeC,aAAf,GACG,oBACA;AACA,kBAAI,cAAJ,CAFA,EAGAkB,IAAI,CAACxB,KAHL,CADH,GAMGwB,IAAI,CAACxB,KAhBV;AAkBC,IAAA,iBAAiB,EAAG,cAAI,sBAAJ;AAlBrB,KAoBGwB,IAAI,CAACnB,KAAL,KAAeC,aAAf,IACD,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGoB;AAAb,IArBF,CADC,CADH,CAPD,CArBD,CADD;AA4DA,CA3FD;;eA6Fe3B,wB","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption = items.find(\n\t\t( option ) => option.value === selectedValue\n\t);\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ selectedOption.label }\n\t\t\t\t\taccessibilityHint={ sprintf(\n\t\t\t\t\t\t// translators: %s: Select control button label e.g. \"Button width\"\n\t\t\t\t\t\t__( 'Navigates to select %s' ),\n\t\t\t\t\t\tselectedOption.label\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ chevronRight }></Icon>\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<View style={ styles.selectControl }>\n\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\tcustomActionButton\n\t\t\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\t\t\tlabel={ item.label }\n\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\tonPress={ onChangeValue( item.value ) }\n\t\t\t\t\t\t\tleftAlign={ true }\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\titem.value === selectedValue\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Selected: %s' ),\n\t\t\t\t\t\t\t\t\t\t\titem.label\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: item.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityHint={ __( 'Double tap to select' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.value === selectedValue && (\n\t\t\t\t\t\t\t\t<Icon icon={ check }></Icon>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheet.Cell>\n\t\t\t\t\t) ) }\n\t\t\t\t</View>\n\t\t\t</>\n\t\t</BottomSheet.SubSheet>\n\t);\n};\n\nexport default BottomSheetSelectControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet-select-control/index.native.js"],"names":["BottomSheetSelectControl","label","icon","options","items","onChange","value","selectedValue","showSubSheet","setShowSubSheet","navigation","onChangeValue","goBack","selectedOption","find","option","openSubSheet","navigate","BottomSheet","SubSheet","screenName","chevronRight","styles","selectControl","map","item","index","check"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AACA;;AAIA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,wBAAwB,GAAG,QAM1B;AAAA,MAN4B;AAClCC,IAAAA,KADkC;AAElCC,IAAAA,IAFkC;AAGlCC,IAAAA,OAAO,EAAEC,KAHyB;AAIlCC,IAAAA,QAJkC;AAKlCC,IAAAA,KAAK,EAAEC;AAL2B,GAM5B;AACN,QAAM,CAAEC,YAAF,EAAgBC,eAAhB,IAAoC,uBAAU,KAAV,CAA1C;AACA,QAAMC,UAAU,GAAG,4BAAnB;;AAEA,QAAMC,aAAa,GAAKL,KAAF,IAAa;AAClC,WAAO,MAAM;AACZM,MAAAA,MAAM;AACNP,MAAAA,QA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AGqB,eAAOC;AAArB,KACGnB,KAAK,CAACoB,GAAN,CAAW,CAAEC,IAAF,EAAQC,KAAR,KACZ,4BAAC,uBAAD,CAAa,IAAb;AACC,IAAA,kBAAkB,MADnB;AAEC,IAAA,aAAa,EAAC,MAFf;AAGC,IAAA,KAAK,EAAGD,IAAI,CAACxB,KAHd;AAIC,IAAA,IAAI,EAAGwB,IAAI,CAACvB,IAJb;AAKC,IAAA,OAAO,EAAGS,aAAa,CAAEc,IAAI,CAACnB,KAAP,CALxB;AAMC,IAAA,SAAS,EAAG,IANb;AAOC,IAAA,GAAG,EAAGoB,KAPP;AAQC,IAAA,iBAAiB,EAAG,QARrB;AASC,IAAA,kBAAkB,EACjBD,IAAI,CAACnB,KAAL,KAAeC,aAAf,GACG,oBACA;AACA,kBAAI,cAAJ,CAFA,EAGAkB,IAAI,CAACxB,KAHL,CADH,GAMGwB,IAAI,CAACxB,KAhBV;AAkBC,IAAA,iBAAiB,EAAG,cAAI,sBAAJ;AAlBrB,KAoBGwB,IAAI,CAACnB,KAAL,KAAeC,aAAf,IACD,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGoB;AAAb,IArBF,CADC,CADH,CAPD,CA1BD,CADD;AAiEA,CAhGD;;eAkGe3B,wB","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\nimport { useState } from '@wordpress/element';\nimport { Icon, chevronRight, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst BottomSheetSelectControl = ( {\n\tlabel,\n\ticon,\n\toptions: items,\n\tonChange,\n\tvalue: selectedValue,\n} ) => {\n\tconst [ showSubSheet, setShowSubSheet ] = useState( false );\n\tconst navigation = useNavigation();\n\n\tconst onChangeValue = ( value ) => {\n\t\treturn () => {\n\t\t\tgoBack();\n\t\t\tonChange( value );\n\t\t};\n\t};\n\n\tconst selectedOption = items.find(\n\t\t( option ) => option.value === selectedValue\n\t);\n\n\tconst goBack = () => {\n\t\tsetShowSubSheet( false );\n\t\tnavigation.goBack();\n\t};\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( BottomSheet.SubSheet.screenName );\n\t\tsetShowSubSheet( true );\n\t};\n\n\treturn (\n\t\t<BottomSheet.SubSheet\n\t\t\tnavigationButton={\n\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tvalue={ selectedOption.label }\n\t\t\t\t\tonPress={ openSubSheet }\n\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t\t// translators: %1$s: Select control button label e.g. \"Button width\". %2$s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t__( '%1$s. Currently selected: %2$s' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tselectedOption.label\n\t\t\t\t\t) }\n\t\t\t\t\taccessibilityHint={ sprintf(\n\t\t\t\t\t\t// translators: %s: Select control button label e.g. \"Button width\"\n\t\t\t\t\t\t__( 'Navigates to select %s' ),\n\t\t\t\t\t\tlabel\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ chevronRight }></Icon>\n\t\t\t\t</BottomSheet.Cell>\n\t\t\t}\n\t\t\tshowSheet={ showSubSheet }\n\t\t>\n\t\t\t<>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton onPress={ goBack } />\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<View style={ styles.selectControl }>\n\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t<BottomSheet.Cell\n\t\t\t\t\t\t\tcustomActionButton\n\t\t\t\t\t\t\tseparatorType=\"none\"\n\t\t\t\t\t\t\tlabel={ item.label }\n\t\t\t\t\t\t\ticon={ item.icon }\n\t\t\t\t\t\t\tonPress={ onChangeValue( item.value ) }\n\t\t\t\t\t\t\tleftAlign={ true }\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityLabel={\n\t\t\t\t\t\t\t\titem.value === selectedValue\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Select control option value e.g: \"Auto, 25%\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Selected: %s' ),\n\t\t\t\t\t\t\t\t\t\t\titem.label\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: item.label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibilityHint={ __( 'Double tap to select' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.value === selectedValue && (\n\t\t\t\t\t\t\t\t<Icon icon={ check }></Icon>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BottomSheet.Cell>\n\t\t\t\t\t) ) }\n\t\t\t\t</View>\n\t\t\t</>\n\t\t</BottomSheet.SubSheet>\n\t);\n};\n\nexport default BottomSheetSelectControl;\n"]}
@@ -21,7 +21,7 @@ var _hooks = require("@wordpress/hooks");
21
21
 
22
22
  var _compose = require("@wordpress/compose");
23
23
 
24
- var _container = _interopRequireDefault(require("./container"));
24
+ var _keyboardAvoidingView = _interopRequireDefault(require("../keyboard-avoiding-view"));
25
25
 
26
26
  var _style = _interopRequireDefault(require("./style.scss"));
27
27
 
@@ -86,8 +86,11 @@ class HTMLTextInput extends _element.Component {
86
86
 
87
87
  render() {
88
88
  const {
89
+ editTitle,
89
90
  getStylesFromColorScheme,
90
- style
91
+ parentHeight,
92
+ style,
93
+ title
91
94
  } = this.props;
92
95
  const titleStyle = [_style.default.htmlViewTitle, (style === null || style === void 0 ? void 0 : style.text) && {
93
96
  color: style.text
@@ -100,19 +103,23 @@ class HTMLTextInput extends _element.Component {
100
103
  color: style.text
101
104
  })
102
105
  };
103
- return (0, _element.createElement)(_container.default, {
104
- parentHeight: this.props.parentHeight
106
+ return (0, _element.createElement)(_keyboardAvoidingView.default, {
107
+ style: _style.default.keyboardAvoidingView,
108
+ parentHeight: parentHeight
109
+ }, (0, _element.createElement)(_reactNative.ScrollView, {
110
+ style: _style.default.scrollView
105
111
  }, (0, _element.createElement)(_reactNative.TextInput, {
106
112
  autoCorrect: false,
107
113
  accessibilityLabel: "html-view-title",
108
114
  textAlignVertical: "center",
109
115
  numberOfLines: 1,
110
116
  style: titleStyle,
111
- value: this.props.title,
117
+ value: title,
112
118
  placeholder: (0, _i18n.__)('Add title'),
113
119
  placeholderTextColor: placeholderStyle.color,
114
- onChangeText: this.props.editTitle
120
+ onChangeText: editTitle
115
121
  }), (0, _element.createElement)(_reactNative.TextInput, {
122
+ ref: this.contentTextInputRef,
116
123
  autoCorrect: false,
117
124
  accessibilityLabel: "html-view-content",
118
125
  textAlignVertical: "top",
@@ -123,8 +130,12 @@ class HTMLTextInput extends _element.Component {
123
130
  onBlur: this.stopEditing,
124
131
  placeholder: (0, _i18n.__)('Start writing…'),
125
132
  placeholderTextColor: placeholderStyle.color,
126
- scrollEnabled: _container.default.scrollEnabled
127
- }));
133
+ scrollEnabled: false // [Only iOS] This prop prevents the text input from
134
+ // automatically getting focused after scrolling
135
+ // content.
136
+ ,
137
+ rejectResponderTermination: false
138
+ })));
128
139
  }
129
140
 
130
141
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/html-text-input/index.native.js"],"names":["HTMLTextInput","Component","constructor","arguments","edit","bind","stopEditing","getHTMLForParent","state","getDerivedStateFromProps","props","isDirty","value","componentWillUnmount","html","onChange","setState","onPersist","render","getStylesFromColorScheme","style","titleStyle","styles","htmlViewTitle","text","color","htmlStyle","htmlView","htmlViewDark","placeholderStyle","placeholder","placeholderDark","parentHeight","title","editTitle","HTMLInputContainer","scrollEnabled","select","getEditedPostAttribute","getEditedPostContent","dispatch","editPost","resetEditorBlocks","content","blocks","withInstanceId","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AASA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAIO,MAAMA,aAAN,SAA4BC,kBAA5B,CAAsC;AAC5CC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,IAAL,GAAY,KAAKA,IAAL,CAAUC,IAAV,CAAgB,IAAhB,CAAZ;AACA,SAAKC,WAAL,GAAmB,KAAKA,WAAL,CAAiBD,IAAjB,CAAuB,IAAvB,CAAnB;AACA,SAAKE,gBAAL,GAAwB,KAAKA,gBAAL,CAAsBF,IAAtB,CAA4B,IAA5B,CAAxB;AACA,0BACC,qBADD,EAEC,iBAFD,EAGC,KAAKE,gBAHN;AAMA,SAAKC,KAAL,GAAa,EAAb;AACA;;AAE8B,SAAxBC,wBAAwB,CAAEC,KAAF,EAASF,KAAT,EAAiB;AAC/C,QAAKA,KAAK,CAACG,OAAX,EAAqB;AACpB,aAAO,IAAP;AACA;;AAED,WAAO;AACNC,MAAAA,KAAK,EAAEF,KAAK,CAACE,KADP;AAEND,MAAAA,OAAO,EAAE;AAFH,KAAP;AAIA;;AAEDE,EAAAA,oBAAoB,GAAG;AACtB,6BAAc,qBAAd,EAAqC,iBAArC,EADsB,CAEtB;;AACA,SAAKP,WAAL;AACA;;AAEDF,EAAAA,IAAI,CAAEU,IAAF,EAAS;AACZ,SAAKJ,KAAL,CAAWK,QAAX,CAAqBD,IAArB;AACA,SAAKE,QAAL,CAAe;AAAEJ,MAAAA,KAAK,EAAEE,IAAT;AAAeH,MAAAA,OAAO,EAAE;AAAxB,KAAf;AACA;;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R;AACA,KAHK;;AAINlB,IAAAA,QAAQ,CAAE4B,OAAF,EAAY;AACnBF,MAAAA,QAAQ,CAAE;AAAEE,QAAAA;AAAF,OAAF,CAAR;AACA,KANK;;AAON1B,IAAAA,SAAS,CAAE0B,OAAF,EAAY;AACpB,YAAMC,MAAM,GAAG,mBAAOD,OAAP,CAAf;AACAD,MAAAA,iBAAiB,CAAEE,MAAF,CAAjB;AACA;;AAVK,GAAP;AAYA,CAdD,CAXuB,EA0BvBC,uBA1BuB,EA2BvBC,iCA3BuB,CAAT,EA4BV9C,aA5BU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { TextInput } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\nimport {\n\twithInstanceId,\n\tcompose,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport HTMLInputContainer from './container';\nimport styles from './style.scss';\n\nexport class HTMLTextInput extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.edit = this.edit.bind( this );\n\t\tthis.stopEditing = this.stopEditing.bind( this );\n\t\tthis.getHTMLForParent = this.getHTMLForParent.bind( this );\n\t\taddFilter(\n\t\t\t'native.persist-html',\n\t\t\t'html-text-input',\n\t\t\tthis.getHTMLForParent\n\t\t);\n\n\t\tthis.state = {};\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\tif ( state.isDirty ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: props.value,\n\t\t\tisDirty: false,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tremoveFilter( 'native.persist-html', 'html-text-input' );\n\t\t// TODO: Blocking main thread.\n\t\tthis.stopEditing();\n\t}\n\n\tedit( html ) {\n\t\tthis.props.onChange( html );\n\t\tthis.setState( { value: html, isDirty: true } );\n\t}\n\n\tgetHTMLForParent() {\n\t\treturn this.state.value;\n\t}\n\n\tstopEditing() {\n\t\tif ( this.state.isDirty ) {\n\t\t\tthis.props.onPersist( this.state.value );\n\t\t\tthis.setState( { isDirty: false } );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, style } = this.props;\n\t\tconst titleStyle = [\n\t\t\tstyles.htmlViewTitle,\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst htmlStyle = [\n\t\t\tgetStylesFromColorScheme( styles.htmlView, styles.htmlViewDark ),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst placeholderStyle = {\n\t\t\t...getStylesFromColorScheme(\n\t\t\t\tstyles.placeholder,\n\t\t\t\tstyles.placeholderDark\n\t\t\t),\n\t\t\t...( style?.text && { color: style.text } ),\n\t\t};\n\t\treturn (\n\t\t\t<HTMLInputContainer parentHeight={ this.props.parentHeight }>\n\t\t\t\t<TextInput\n\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\taccessibilityLabel=\"html-view-title\"\n\t\t\t\t\ttextAlignVertical=\"center\"\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t\tvalue={ this.props.title }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\tonChangeText={ this.props.editTitle }\n\t\t\t\t/>\n\t\t\t\t<TextInput\n\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\taccessibilityLabel=\"html-view-content\"\n\t\t\t\t\ttextAlignVertical=\"top\"\n\t\t\t\t\tmultiline\n\t\t\t\t\tstyle={ htmlStyle }\n\t\t\t\t\tvalue={ this.state.value }\n\t\t\t\t\tonChangeText={ this.edit }\n\t\t\t\t\tonBlur={ this.stopEditing }\n\t\t\t\t\tplaceholder={ __( 'Start writing…' ) }\n\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\tscrollEnabled={ HTMLInputContainer.scrollEnabled }\n\t\t\t\t/>\n\t\t\t</HTMLInputContainer>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostContent } = select(\n\t\t\t'core/editor'\n\t\t);\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tvalue: getEditedPostContent(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\treturn {\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonChange( content ) {\n\t\t\t\teditPost( { content } );\n\t\t\t},\n\t\t\tonPersist( content ) {\n\t\t\t\tconst blocks = parse( content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithPreferredColorScheme,\n] )( HTMLTextInput );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/html-text-input/index.native.js"],"names":["HTMLTextInput","Component","constructor","arguments","edit","bind","stopEditing","getHTMLForParent","state","getDerivedStateFromProps","props","isDirty","value","componentWillUnmount","html","onChange","setState","onPersist","render","editTitle","getStylesFromColorScheme","parentHeight","style","title","titleStyle","styles","htmlViewTitle","text","color","htmlStyle","htmlView","htmlViewDark","placeholderStyle","placeholder","placeholderDark","keyboardAvoidingView","scrollView","contentTextInputRef","select","getEditedPostAttribute","getEditedPostContent","dispatch","editPost","resetEditorBlocks","content","blocks","withInstanceId","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AASA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAIO,MAAMA,aAAN,SAA4BC,kBAA5B,CAAsC;AAC5CC,EAAAA,WAAW,GAAG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,mBAAOD,OAAP,CAAf;AACAD,MAAAA,iBAAiB,CAAEE,MAAF,CAAjB;AACA;;AAVK,GAAP;AAYA,CAdD,CAXuB,EA0BvBC,uBA1BuB,EA2BvBC,iCA3BuB,CAAT,EA4BV/C,aA5BU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, TextInput } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\nimport {\n\twithInstanceId,\n\tcompose,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\nimport styles from './style.scss';\n\nexport class HTMLTextInput extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.edit = this.edit.bind( this );\n\t\tthis.stopEditing = this.stopEditing.bind( this );\n\t\tthis.getHTMLForParent = this.getHTMLForParent.bind( this );\n\t\taddFilter(\n\t\t\t'native.persist-html',\n\t\t\t'html-text-input',\n\t\t\tthis.getHTMLForParent\n\t\t);\n\n\t\tthis.state = {};\n\t}\n\n\tstatic getDerivedStateFromProps( props, state ) {\n\t\tif ( state.isDirty ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: props.value,\n\t\t\tisDirty: false,\n\t\t};\n\t}\n\n\tcomponentWillUnmount() {\n\t\tremoveFilter( 'native.persist-html', 'html-text-input' );\n\t\t// TODO: Blocking main thread.\n\t\tthis.stopEditing();\n\t}\n\n\tedit( html ) {\n\t\tthis.props.onChange( html );\n\t\tthis.setState( { value: html, isDirty: true } );\n\t}\n\n\tgetHTMLForParent() {\n\t\treturn this.state.value;\n\t}\n\n\tstopEditing() {\n\t\tif ( this.state.isDirty ) {\n\t\t\tthis.props.onPersist( this.state.value );\n\t\t\tthis.setState( { isDirty: false } );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tparentHeight,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst titleStyle = [\n\t\t\tstyles.htmlViewTitle,\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst htmlStyle = [\n\t\t\tgetStylesFromColorScheme( styles.htmlView, styles.htmlViewDark ),\n\t\t\tstyle?.text && { color: style.text },\n\t\t];\n\t\tconst placeholderStyle = {\n\t\t\t...getStylesFromColorScheme(\n\t\t\t\tstyles.placeholder,\n\t\t\t\tstyles.placeholderDark\n\t\t\t),\n\t\t\t...( style?.text && { color: style.text } ),\n\t\t};\n\t\treturn (\n\t\t\t<KeyboardAvoidingView\n\t\t\t\tstyle={ styles.keyboardAvoidingView }\n\t\t\t\tparentHeight={ parentHeight }\n\t\t\t>\n\t\t\t\t<ScrollView style={ styles.scrollView }>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-title\"\n\t\t\t\t\t\ttextAlignVertical=\"center\"\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tonChangeText={ editTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ this.contentTextInputRef }\n\t\t\t\t\t\tautoCorrect={ false }\n\t\t\t\t\t\taccessibilityLabel=\"html-view-content\"\n\t\t\t\t\t\ttextAlignVertical=\"top\"\n\t\t\t\t\t\tmultiline\n\t\t\t\t\t\tstyle={ htmlStyle }\n\t\t\t\t\t\tvalue={ this.state.value }\n\t\t\t\t\t\tonChangeText={ this.edit }\n\t\t\t\t\t\tonBlur={ this.stopEditing }\n\t\t\t\t\t\tplaceholder={ __( 'Start writing…' ) }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle.color }\n\t\t\t\t\t\tscrollEnabled={ false }\n\t\t\t\t\t\t// [Only iOS] This prop prevents the text input from\n\t\t\t\t\t\t// automatically getting focused after scrolling\n\t\t\t\t\t\t// content.\n\t\t\t\t\t\trejectResponderTermination={ false }\n\t\t\t\t\t/>\n\t\t\t\t</ScrollView>\n\t\t\t</KeyboardAvoidingView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostContent } = select(\n\t\t\t'core/editor'\n\t\t);\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tvalue: getEditedPostContent(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\treturn {\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonChange( content ) {\n\t\t\t\teditPost( { content } );\n\t\t\t},\n\t\t\tonPersist( content ) {\n\t\t\t\tconst blocks = parse( content );\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithPreferredColorScheme,\n] )( HTMLTextInput );\n"]}
@@ -9,10 +9,18 @@ exports.default = exports.KeyboardAwareFlatList = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _reactNative = require("react-native");
13
15
 
16
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
17
+
14
18
  var _keyboardAvoidingView = _interopRequireDefault(require("../keyboard-avoiding-view"));
15
19
 
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
16
24
  /**
17
25
  * External dependencies
18
26
  */
@@ -20,11 +28,26 @@ var _keyboardAvoidingView = _interopRequireDefault(require("../keyboard-avoiding
20
28
  /**
21
29
  * Internal dependencies
22
30
  */
23
- const KeyboardAwareFlatList = props => (0, _element.createElement)(_keyboardAvoidingView.default, {
24
- style: {
25
- flex: 1
26
- }
27
- }, (0, _element.createElement)(_reactNative.FlatList, props));
31
+ const AnimatedFlatList = _reactNativeReanimated.default.createAnimatedComponent(_reactNative.FlatList);
32
+
33
+ const KeyboardAwareFlatList = _ref => {
34
+ let {
35
+ innerRef,
36
+ onScroll,
37
+ ...props
38
+ } = _ref;
39
+ const scrollHandler = (0, _reactNativeReanimated.useAnimatedScrollHandler)({
40
+ onScroll
41
+ });
42
+ return (0, _element.createElement)(_keyboardAvoidingView.default, {
43
+ style: {
44
+ flex: 1
45
+ }
46
+ }, (0, _element.createElement)(AnimatedFlatList, (0, _extends2.default)({
47
+ ref: innerRef,
48
+ onScroll: scrollHandler
49
+ }, props)));
50
+ };
28
51
 
29
52
  exports.KeyboardAwareFlatList = KeyboardAwareFlatList;
30
53
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/keyboard-aware-flat-list/index.android.js"],"names":["KeyboardAwareFlatList","props","flex","handleCaretVerticalPositionChange"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGO,MAAMA,qBAAqB,GAAKC,KAAF,IACpC,4BAAC,6BAAD;AAAsB,EAAA,KAAK,EAAG;AAAEC,IAAAA,IAAI,EAAE;AAAR;AAA9B,GACC,4BAAC,qBAAD,EAAeD,KAAf,CADD,CADM;;;;AAMPD,qBAAqB,CAACG,iCAAtB,GAA0D,MAAM,CAC/D;AACA,CAFD;;eAIeH,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { FlatList } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\n\nexport const KeyboardAwareFlatList = ( props ) => (\n\t<KeyboardAvoidingView style={ { flex: 1 } }>\n\t\t<FlatList { ...props } />\n\t</KeyboardAvoidingView>\n);\n\nKeyboardAwareFlatList.handleCaretVerticalPositionChange = () => {\n\t// no need to handle on Android, it is system managed\n};\n\nexport default KeyboardAwareFlatList;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/keyboard-aware-flat-list/index.android.js"],"names":["AnimatedFlatList","Animated","createAnimatedComponent","FlatList","KeyboardAwareFlatList","innerRef","onScroll","props","scrollHandler","flex","handleCaretVerticalPositionChange"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;;;;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAGC,+BAASC,uBAAT,CAAkCC,qBAAlC,CAAzB;;AAEO,MAAMC,qBAAqB,GAAG,QAAwC;AAAA,MAAtC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsB,OAAGC;AAAzB,GAAsC;AAC5E,QAAMC,aAAa,GAAG,qDAA0B;AAAEF,IAAAA;AAAF,GAA1B,CAAtB;AACA,SACC,4BAAC,6BAAD;AAAsB,IAAA,KAAK,EAAG;AAAEG,MAAAA,IAAI,EAAE;AAAR;AAA9B,KACC,4BAAC,gBAAD;AACC,IAAA,GAAG,EAAGJ,QADP;AAEC,IAAA,QAAQ,EAAGG;AAFZ,KAGMD,KAHN,EADD,CADD;AASA,CAXM;;;;AAaPH,qBAAqB,CAACM,iCAAtB,GAA0D,MAAM,CAC/D;AACA,CAFD;;eAIeN,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { FlatList } from 'react-native';\nimport Animated, { useAnimatedScrollHandler } from 'react-native-reanimated';\n\n/**\n * Internal dependencies\n */\nimport KeyboardAvoidingView from '../keyboard-avoiding-view';\n\nconst AnimatedFlatList = Animated.createAnimatedComponent( FlatList );\n\nexport const KeyboardAwareFlatList = ( { innerRef, onScroll, ...props } ) => {\n\tconst scrollHandler = useAnimatedScrollHandler( { onScroll } );\n\treturn (\n\t\t<KeyboardAvoidingView style={ { flex: 1 } }>\n\t\t\t<AnimatedFlatList\n\t\t\t\tref={ innerRef }\n\t\t\t\tonScroll={ scrollHandler }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</KeyboardAvoidingView>\n\t);\n};\n\nKeyboardAwareFlatList.handleCaretVerticalPositionChange = () => {\n\t// no need to handle on Android, it is system managed\n};\n\nexport default KeyboardAwareFlatList;\n"]}
@@ -13,6 +13,12 @@ var _reactNative = require("react-native");
13
13
 
14
14
  var _lodash = require("lodash");
15
15
 
16
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
16
22
  /**
17
23
  * External dependencies
18
24
  */
@@ -22,6 +28,8 @@ var _lodash = require("lodash");
22
28
  */
23
29
  const List = (0, _element.memo)(_reactNative.FlatList, _lodash.isEqual);
24
30
 
31
+ const AnimatedKeyboardAwareScrollView = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeKeyboardAwareScrollView.KeyboardAwareScrollView);
32
+
25
33
  const KeyboardAwareFlatList = _ref => {
26
34
  let {
27
35
  extraScrollHeight,
@@ -30,9 +38,42 @@ const KeyboardAwareFlatList = _ref => {
30
38
  autoScroll,
31
39
  scrollViewStyle,
32
40
  inputAccessoryViewHeight,
41
+ onScroll,
33
42
  ...listProps
34
43
  } = _ref;
35
- return (0, _element.createElement)(_reactNativeKeyboardAwareScrollView.KeyboardAwareScrollView, {
44
+ const scrollViewRef = (0, _element.useRef)();
45
+ const keyboardWillShowIndicator = (0, _element.useRef)();
46
+ const latestContentOffsetY = (0, _reactNativeReanimated.useSharedValue)(-1);
47
+ const scrollHandler = (0, _reactNativeReanimated.useAnimatedScrollHandler)({
48
+ onScroll: event => {
49
+ const {
50
+ contentOffset
51
+ } = event;
52
+ latestContentOffsetY.value = contentOffset.y;
53
+ onScroll(event);
54
+ }
55
+ });
56
+ const getRef = (0, _element.useCallback)(ref => {
57
+ scrollViewRef.current = ref;
58
+ innerRef(ref);
59
+ }, [innerRef]);
60
+ const onKeyboardWillHide = (0, _element.useCallback)(() => {
61
+ keyboardWillShowIndicator.current = false;
62
+ }, []);
63
+ const onKeyboardDidHide = (0, _element.useCallback)(() => {
64
+ setTimeout(() => {
65
+ if (!keyboardWillShowIndicator.current && latestContentOffsetY.value !== -1 && !shouldPreventAutomaticScroll()) {
66
+ var _scrollViewRef$curren;
67
+
68
+ // Reset the content position if keyboard is still closed.
69
+ (_scrollViewRef$curren = scrollViewRef.current) === null || _scrollViewRef$curren === void 0 ? void 0 : _scrollViewRef$curren.scrollToPosition(0, latestContentOffsetY.value, true);
70
+ }
71
+ }, 50);
72
+ }, [latestContentOffsetY, shouldPreventAutomaticScroll]);
73
+ const onKeyboardWillShow = (0, _element.useCallback)(() => {
74
+ keyboardWillShowIndicator.current = true;
75
+ }, []);
76
+ return (0, _element.createElement)(AnimatedKeyboardAwareScrollView, {
36
77
  style: [{
37
78
  flex: 1
38
79
  }, scrollViewStyle],
@@ -43,30 +84,12 @@ const KeyboardAwareFlatList = _ref => {
43
84
  extraHeight: 0,
44
85
  inputAccessoryViewHeight: inputAccessoryViewHeight,
45
86
  enableAutomaticScroll: autoScroll === undefined ? false : autoScroll,
46
- ref: ref => {
47
- (void 0).scrollViewRef = ref;
48
- innerRef(ref);
49
- },
50
- onKeyboardWillHide: () => {
51
- (void 0).keyboardWillShowIndicator = false;
52
- },
53
- onKeyboardDidHide: () => {
54
- setTimeout(() => {
55
- if (!(void 0).keyboardWillShowIndicator && (void 0).latestContentOffsetY !== undefined && !shouldPreventAutomaticScroll()) {
56
- // Reset the content position if keyboard is still closed.
57
- if ((void 0).scrollViewRef) {
58
- (void 0).scrollViewRef.scrollToPosition(0, (void 0).latestContentOffsetY, true);
59
- }
60
- }
61
- }, 50);
62
- },
63
- onKeyboardWillShow: () => {
64
- (void 0).keyboardWillShowIndicator = true;
65
- },
87
+ ref: getRef,
88
+ onKeyboardWillHide: onKeyboardWillHide,
89
+ onKeyboardDidHide: onKeyboardDidHide,
90
+ onKeyboardWillShow: onKeyboardWillShow,
66
91
  scrollEnabled: listProps.scrollEnabled,
67
- onScroll: event => {
68
- (void 0).latestContentOffsetY = event.nativeEvent.contentOffset.y;
69
- }
92
+ onScroll: scrollHandler
70
93
  }, (0, _element.createElement)(List, listProps));
71
94
  };
72
95
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/keyboard-aware-flat-list/index.ios.js"],"names":["List","FlatList","isEqual","KeyboardAwareFlatList","extraScrollHeight","shouldPreventAutomaticScroll","innerRef","autoScroll","scrollViewStyle","inputAccessoryViewHeight","listProps","flex","undefined","ref","scrollViewRef","keyboardWillShowIndicator","setTimeout","latestContentOffsetY","scrollToPosition","scrollEnabled","event","nativeEvent","contentOffset","y","handleCaretVerticalPositionChange","scrollView","targetId","caretY","previousCaretY","refreshScrollForField"],"mappings":";;;;;;;AAUA;;AAPA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,mBAAMC,qBAAN,EAAgBC,eAAhB,CAAb;;AAEO,MAAMC,qBAAqB,GAAG;AAAA,MAAE;AACtCC,IAAAA,iBADsC;AAEtCC,IAAAA,4BAFsC;AAGtCC,IAAAA,QAHsC;AAItCC,IAAAA,UAJsC;AAKtCC,IAAAA,eALsC;AAMtCC,IAAAA,wBANsC;AAOtC,OAAGC;AAPmC,GAAF;AAAA,SASpC,4BAAC,2DAAD;AACC,IAAA,KAAK,EAAG,CAAE;AAAEC,MAAAA,IAAI,EAAE;AAAR,KAAF,EAAeH,eAAf,CADT;AAEC,IAAA,mBAAmB,EAAC,MAFrB;AAGC,IAAA,yBAAyB,EAAG,KAH7B;AAIC,IAAA,yBAAyB,EAAC,SAJ3B;AAKC,IAAA,iBAAiB,EAAGJ,iBALrB;AAMC,IAAA,WAAW,EAAG,CANf;AAOC,IAAA,wBAAwB,EAAGK,wBAP5B;AAQC,IAAA,qBAAqB,EAAGF,UAAU,KAAKK,SAAf,GAA2B,KAA3B,GAAmCL,UAR5D;AASC,IAAA,GAAG,EAAKM,GAAF,IAAW;AAChB,eAAKC,aAAL,GAAqBD,GAArB;AACAP,MAAAA,QAAQ,CAAEO,GAAF,CAAR;AACA,KAZF;AAaC,IAAA,kBAAkB,EAAG,MAAM;AAC1B,eAAKE,yBAAL,GAAiC,KAAjC;AACA,KAfF;AAgBC,IAAA,iBAAiB,EAAG,MAAM;AACzBC,MAAAA,UAAU,CAAE,MAAM;AACjB,YACC,CAAE,SAAKD,yBAAP,IACA,SAAKE,oBAAL,KAA8BL,SAD9B,IAEA,CAAEP,4BAA4B,EAH/B,EAIE;AACD;AACA,cAAK,SAAKS,aAAV,EAA0B;AACzB,qBAAKA,aAAL,CAAmBI,gBAAnB,CACC,CADD,EAEC,SAAKD,oBAFN,EAGC,IAHD;AAKA;AACD;AACD,OAfS,EAeP,EAfO,CAAV;AAgBA,KAjCF;AAkCC,IAAA,kBAAkB,EAAG,MAAM;AAC1B,eAAKF,yBAAL,GAAiC,IAAjC;AACA,KApCF;AAqCC,IAAA,aAAa,EAAGL,SAAS,CAACS,aArC3B;AAsCC,IAAA,QAAQ,EAAKC,KAAF,IAAa;AACvB,eAAKH,oBAAL,GAA4BG,KAAK,CAACC,WAAN,CAAkBC,aAAlB,CAAgCC,CAA5D;AACA;AAxCF,KA0CC,4BAAC,IAAD,EAAWb,SAAX,CA1CD,CAToC;AAAA,CAA9B;;;;AAuDPP,qBAAqB,CAACqB,iCAAtB,GAA0D,CACzDC,UADyD,EAEzDC,QAFyD,EAGzDC,MAHyD,EAIzDC,cAJyD,KAKrD;AACJ,MAAKA,cAAL,EAAsB;AACrB;AACAH,IAAAA,UAAU,CAACI,qBAAX,CAAkCH,QAAlC;AACA;AACD,CAVD;;eAYevB,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';\nimport { FlatList } from 'react-native';\nimport { isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n\nconst List = memo( FlatList, isEqual );\n\nexport const KeyboardAwareFlatList = ( {\n\textraScrollHeight,\n\tshouldPreventAutomaticScroll,\n\tinnerRef,\n\tautoScroll,\n\tscrollViewStyle,\n\tinputAccessoryViewHeight,\n\t...listProps\n} ) => (\n\t<KeyboardAwareScrollView\n\t\tstyle={ [ { flex: 1 }, scrollViewStyle ] }\n\t\tkeyboardDismissMode=\"none\"\n\t\tenableResetScrollToCoords={ false }\n\t\tkeyboardShouldPersistTaps=\"handled\"\n\t\textraScrollHeight={ extraScrollHeight }\n\t\textraHeight={ 0 }\n\t\tinputAccessoryViewHeight={ inputAccessoryViewHeight }\n\t\tenableAutomaticScroll={ autoScroll === undefined ? false : autoScroll }\n\t\tref={ ( ref ) => {\n\t\t\tthis.scrollViewRef = ref;\n\t\t\tinnerRef( ref );\n\t\t} }\n\t\tonKeyboardWillHide={ () => {\n\t\t\tthis.keyboardWillShowIndicator = false;\n\t\t} }\n\t\tonKeyboardDidHide={ () => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tif (\n\t\t\t\t\t! this.keyboardWillShowIndicator &&\n\t\t\t\t\tthis.latestContentOffsetY !== undefined &&\n\t\t\t\t\t! shouldPreventAutomaticScroll()\n\t\t\t\t) {\n\t\t\t\t\t// Reset the content position if keyboard is still closed.\n\t\t\t\t\tif ( this.scrollViewRef ) {\n\t\t\t\t\t\tthis.scrollViewRef.scrollToPosition(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\tthis.latestContentOffsetY,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 50 );\n\t\t} }\n\t\tonKeyboardWillShow={ () => {\n\t\t\tthis.keyboardWillShowIndicator = true;\n\t\t} }\n\t\tscrollEnabled={ listProps.scrollEnabled }\n\t\tonScroll={ ( event ) => {\n\t\t\tthis.latestContentOffsetY = event.nativeEvent.contentOffset.y;\n\t\t} }\n\t>\n\t\t<List { ...listProps } />\n\t</KeyboardAwareScrollView>\n);\n\nKeyboardAwareFlatList.handleCaretVerticalPositionChange = (\n\tscrollView,\n\ttargetId,\n\tcaretY,\n\tpreviousCaretY\n) => {\n\tif ( previousCaretY ) {\n\t\t// If this is not the first tap.\n\t\tscrollView.refreshScrollForField( targetId );\n\t}\n};\n\nexport default KeyboardAwareFlatList;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/keyboard-aware-flat-list/index.ios.js"],"names":["List","FlatList","isEqual","AnimatedKeyboardAwareScrollView","Animated","createAnimatedComponent","KeyboardAwareScrollView","KeyboardAwareFlatList","extraScrollHeight","shouldPreventAutomaticScroll","innerRef","autoScroll","scrollViewStyle","inputAccessoryViewHeight","onScroll","listProps","scrollViewRef","keyboardWillShowIndicator","latestContentOffsetY","scrollHandler","event","contentOffset","value","y","getRef","ref","current","onKeyboardWillHide","onKeyboardDidHide","setTimeout","scrollToPosition","onKeyboardWillShow","flex","undefined","scrollEnabled","handleCaretVerticalPositionChange","scrollView","targetId","caretY","previousCaretY","refreshScrollForField"],"mappings":";;;;;;;AAcA;;AAXA;;AACA;;AACA;;AACA;;;;;;AANA;AACA;AACA;;AASA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,mBAAMC,qBAAN,EAAgBC,eAAhB,CAAb;;AACA,MAAMC,+BAA+B,GAAGC,+BAASC,uBAAT,CACvCC,2DADuC,CAAxC;;AAIO,MAAMC,qBAAqB,GAAG,QAS9B;AAAA,MATgC;AACtCC,IAAAA,iBADsC;AAEtCC,IAAAA,4BAFsC;AAGtCC,IAAAA,QAHsC;AAItCC,IAAAA,UAJsC;AAKtCC,IAAAA,eALsC;AAMtCC,IAAAA,wBANsC;AAOtCC,IAAAA,QAPsC;AAQtC,OAAGC;AARmC,GAShC;AACN,QAAMC,aAAa,GAAG,sBAAtB;AACA,QAAMC,yBAAyB,GAAG,sBAAlC;AAEA,QAAMC,oBAAoB,GAAG,2CAAgB,CAAC,CAAjB,CAA7B;AAEA,QAAMC,aAAa,GAAG,qDAA0B;AAC/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AA,yBAAyB,EAAC,SAJ3B;AAKC,IAAA,iBAAiB,EAAGJ,iBALrB;AAMC,IAAA,WAAW,EAAG,CANf;AAOC,IAAA,wBAAwB,EAAGK,wBAP5B;AAQC,IAAA,qBAAqB,EACpBF,UAAU,KAAKsB,SAAf,GAA2B,KAA3B,GAAmCtB,UATrC;AAWC,IAAA,GAAG,EAAGa,MAXP;AAYC,IAAA,kBAAkB,EAAGG,kBAZtB;AAaC,IAAA,iBAAiB,EAAGC,iBAbrB;AAcC,IAAA,kBAAkB,EAAGG,kBAdtB;AAeC,IAAA,aAAa,EAAGhB,SAAS,CAACmB,aAf3B;AAgBC,IAAA,QAAQ,EAAGf;AAhBZ,KAkBC,4BAAC,IAAD,EAAWJ,SAAX,CAlBD,CADD;AAsBA,CA3EM;;;;AA6EPR,qBAAqB,CAAC4B,iCAAtB,GAA0D,CACzDC,UADyD,EAEzDC,QAFyD,EAGzDC,MAHyD,EAIzDC,cAJyD,KAKrD;AACJ,MAAKA,cAAL,EAAsB;AACrB;AACAH,IAAAA,UAAU,CAACI,qBAAX,CAAkCH,QAAlC;AACA;AACD,CAVD;;eAYe9B,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';\nimport { FlatList } from 'react-native';\nimport { isEqual } from 'lodash';\nimport Animated, {\n\tuseAnimatedScrollHandler,\n\tuseSharedValue,\n} from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useCallback, useRef } from '@wordpress/element';\n\nconst List = memo( FlatList, isEqual );\nconst AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(\n\tKeyboardAwareScrollView\n);\n\nexport const KeyboardAwareFlatList = ( {\n\textraScrollHeight,\n\tshouldPreventAutomaticScroll,\n\tinnerRef,\n\tautoScroll,\n\tscrollViewStyle,\n\tinputAccessoryViewHeight,\n\tonScroll,\n\t...listProps\n} ) => {\n\tconst scrollViewRef = useRef();\n\tconst keyboardWillShowIndicator = useRef();\n\n\tconst latestContentOffsetY = useSharedValue( -1 );\n\n\tconst scrollHandler = useAnimatedScrollHandler( {\n\t\tonScroll: ( event ) => {\n\t\t\tconst { contentOffset } = event;\n\t\t\tlatestContentOffsetY.value = contentOffset.y;\n\t\t\tonScroll( event );\n\t\t},\n\t} );\n\n\tconst getRef = useCallback(\n\t\t( ref ) => {\n\t\t\tscrollViewRef.current = ref;\n\t\t\tinnerRef( ref );\n\t\t},\n\t\t[ innerRef ]\n\t);\n\tconst onKeyboardWillHide = useCallback( () => {\n\t\tkeyboardWillShowIndicator.current = false;\n\t}, [] );\n\tconst onKeyboardDidHide = useCallback( () => {\n\t\tsetTimeout( () => {\n\t\t\tif (\n\t\t\t\t! keyboardWillShowIndicator.current &&\n\t\t\t\tlatestContentOffsetY.value !== -1 &&\n\t\t\t\t! shouldPreventAutomaticScroll()\n\t\t\t) {\n\t\t\t\t// Reset the content position if keyboard is still closed.\n\t\t\t\tscrollViewRef.current?.scrollToPosition(\n\t\t\t\t\t0,\n\t\t\t\t\tlatestContentOffsetY.value,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}, 50 );\n\t}, [ latestContentOffsetY, shouldPreventAutomaticScroll ] );\n\tconst onKeyboardWillShow = useCallback( () => {\n\t\tkeyboardWillShowIndicator.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<AnimatedKeyboardAwareScrollView\n\t\t\tstyle={ [ { flex: 1 }, scrollViewStyle ] }\n\t\t\tkeyboardDismissMode=\"none\"\n\t\t\tenableResetScrollToCoords={ false }\n\t\t\tkeyboardShouldPersistTaps=\"handled\"\n\t\t\textraScrollHeight={ extraScrollHeight }\n\t\t\textraHeight={ 0 }\n\t\t\tinputAccessoryViewHeight={ inputAccessoryViewHeight }\n\t\t\tenableAutomaticScroll={\n\t\t\t\tautoScroll === undefined ? false : autoScroll\n\t\t\t}\n\t\t\tref={ getRef }\n\t\t\tonKeyboardWillHide={ onKeyboardWillHide }\n\t\t\tonKeyboardDidHide={ onKeyboardDidHide }\n\t\t\tonKeyboardWillShow={ onKeyboardWillShow }\n\t\t\tscrollEnabled={ listProps.scrollEnabled }\n\t\t\tonScroll={ scrollHandler }\n\t\t>\n\t\t\t<List { ...listProps } />\n\t\t</AnimatedKeyboardAwareScrollView>\n\t);\n};\n\nKeyboardAwareFlatList.handleCaretVerticalPositionChange = (\n\tscrollView,\n\ttargetId,\n\tcaretY,\n\tpreviousCaretY\n) => {\n\tif ( previousCaretY ) {\n\t\t// If this is not the first tap.\n\t\tscrollView.refreshScrollForField( targetId );\n\t}\n};\n\nexport default KeyboardAwareFlatList;\n"]}