@wordpress/compose 7.32.0 → 7.32.1-next.47f435fc9.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 (235) hide show
  1. package/build/higher-order/compose.js +25 -20
  2. package/build/higher-order/compose.js.map +7 -1
  3. package/build/higher-order/if-condition/index.js +35 -41
  4. package/build/higher-order/if-condition/index.js.map +7 -1
  5. package/build/higher-order/pipe.js +32 -66
  6. package/build/higher-order/pipe.js.map +7 -1
  7. package/build/higher-order/pure/index.js +44 -37
  8. package/build/higher-order/pure/index.js.map +7 -1
  9. package/build/higher-order/with-global-events/index.js +64 -73
  10. package/build/higher-order/with-global-events/index.js.map +7 -1
  11. package/build/higher-order/with-global-events/listener.js +34 -21
  12. package/build/higher-order/with-global-events/listener.js.map +7 -1
  13. package/build/higher-order/with-instance-id/index.js +45 -27
  14. package/build/higher-order/with-instance-id/index.js.map +7 -1
  15. package/build/higher-order/with-safe-timeout/index.js +70 -66
  16. package/build/higher-order/with-safe-timeout/index.js.map +7 -1
  17. package/build/higher-order/with-state/index.js +52 -40
  18. package/build/higher-order/with-state/index.js.map +7 -1
  19. package/build/hooks/use-async-list/index.js +38 -42
  20. package/build/hooks/use-async-list/index.js.map +7 -1
  21. package/build/hooks/use-constrained-tabbing/index.js +54 -75
  22. package/build/hooks/use-constrained-tabbing/index.js.map +7 -1
  23. package/build/hooks/use-copy-on-click/index.js +46 -56
  24. package/build/hooks/use-copy-on-click/index.js.map +7 -1
  25. package/build/hooks/use-copy-to-clipboard/index.js +41 -51
  26. package/build/hooks/use-copy-to-clipboard/index.js.map +7 -1
  27. package/build/hooks/use-debounce/index.js +30 -37
  28. package/build/hooks/use-debounce/index.js.map +7 -1
  29. package/build/hooks/use-debounced-input/index.js +39 -27
  30. package/build/hooks/use-debounced-input/index.js.map +7 -1
  31. package/build/hooks/use-dialog/index.js +63 -55
  32. package/build/hooks/use-dialog/index.js.map +7 -1
  33. package/build/hooks/use-disabled/index.js +74 -82
  34. package/build/hooks/use-disabled/index.js.map +7 -1
  35. package/build/hooks/use-dragging/index.js +51 -48
  36. package/build/hooks/use-dragging/index.js.map +7 -1
  37. package/build/hooks/use-drop-zone/index.js +133 -168
  38. package/build/hooks/use-drop-zone/index.js.map +7 -1
  39. package/build/hooks/use-event/index.js +33 -45
  40. package/build/hooks/use-event/index.js.map +7 -1
  41. package/build/hooks/use-fixed-window-list/index.js +109 -97
  42. package/build/hooks/use-fixed-window-list/index.js.map +7 -1
  43. package/build/hooks/use-focus-on-mount/index.js +44 -57
  44. package/build/hooks/use-focus-on-mount/index.js.map +7 -1
  45. package/build/hooks/use-focus-outside/index.js +44 -102
  46. package/build/hooks/use-focus-outside/index.js.map +7 -1
  47. package/build/hooks/use-focus-return/index.js +35 -56
  48. package/build/hooks/use-focus-return/index.js.map +7 -1
  49. package/build/hooks/use-focusable-iframe/index.js +38 -35
  50. package/build/hooks/use-focusable-iframe/index.js.map +7 -1
  51. package/build/hooks/use-instance-id/index.js +26 -42
  52. package/build/hooks/use-instance-id/index.js.map +7 -1
  53. package/build/hooks/use-isomorphic-layout-effect/index.js +25 -17
  54. package/build/hooks/use-isomorphic-layout-effect/index.js.map +7 -1
  55. package/build/hooks/use-keyboard-shortcut/index.js +72 -69
  56. package/build/hooks/use-keyboard-shortcut/index.js.map +7 -1
  57. package/build/hooks/use-media-query/index.js +39 -35
  58. package/build/hooks/use-media-query/index.js.map +7 -1
  59. package/build/hooks/use-merge-refs/index.js +34 -102
  60. package/build/hooks/use-merge-refs/index.js.map +7 -1
  61. package/build/hooks/use-observable-value/index.js +31 -28
  62. package/build/hooks/use-observable-value/index.js.map +7 -1
  63. package/build/hooks/use-preferred-color-scheme/index.android.js +31 -23
  64. package/build/hooks/use-preferred-color-scheme/index.android.js.map +7 -1
  65. package/build/hooks/use-preferred-color-scheme/index.ios.js +25 -17
  66. package/build/hooks/use-preferred-color-scheme/index.ios.js.map +7 -1
  67. package/build/hooks/use-previous/index.js +26 -25
  68. package/build/hooks/use-previous/index.js.map +7 -1
  69. package/build/hooks/use-reduced-motion/index.js +35 -18
  70. package/build/hooks/use-reduced-motion/index.js.map +7 -1
  71. package/build/hooks/use-ref-effect/index.js +25 -35
  72. package/build/hooks/use-ref-effect/index.js.map +7 -1
  73. package/build/hooks/use-resize-observer/index.js +35 -67
  74. package/build/hooks/use-resize-observer/index.js.map +7 -1
  75. package/build/hooks/use-resize-observer/legacy/index.js +47 -103
  76. package/build/hooks/use-resize-observer/legacy/index.js.map +7 -1
  77. package/build/hooks/use-resize-observer/use-resize-observer.js +44 -36
  78. package/build/hooks/use-resize-observer/use-resize-observer.js.map +7 -1
  79. package/build/hooks/use-state-with-history/index.js +68 -63
  80. package/build/hooks/use-state-with-history/index.js.map +7 -1
  81. package/build/hooks/use-throttle/index.js +30 -37
  82. package/build/hooks/use-throttle/index.js.map +7 -1
  83. package/build/hooks/use-viewport-match/index.js +51 -70
  84. package/build/hooks/use-viewport-match/index.js.map +7 -1
  85. package/build/hooks/use-warn-on-change/index.js +50 -40
  86. package/build/hooks/use-warn-on-change/index.js.map +7 -1
  87. package/build/index.js +156 -358
  88. package/build/index.js.map +7 -1
  89. package/build/utils/create-higher-order-component/index.js +30 -34
  90. package/build/utils/create-higher-order-component/index.js.map +7 -1
  91. package/build/utils/debounce/index.js +38 -99
  92. package/build/utils/debounce/index.js.map +7 -1
  93. package/build/utils/observable-map/index.js +29 -19
  94. package/build/utils/observable-map/index.js.map +7 -1
  95. package/build/utils/throttle/index.js +30 -81
  96. package/build/utils/throttle/index.js.map +7 -1
  97. package/build-module/higher-order/compose.js +6 -15
  98. package/build-module/higher-order/compose.js.map +7 -1
  99. package/build-module/higher-order/if-condition/index.js +16 -37
  100. package/build-module/higher-order/if-condition/index.js.map +7 -1
  101. package/build-module/higher-order/pipe.js +10 -62
  102. package/build-module/higher-order/pipe.js.map +7 -1
  103. package/build-module/higher-order/pure/index.js +12 -29
  104. package/build-module/higher-order/pure/index.js.map +7 -1
  105. package/build-module/higher-order/with-global-events/index.js +34 -67
  106. package/build-module/higher-order/with-global-events/index.js.map +7 -1
  107. package/build-module/higher-order/with-global-events/listener.js +16 -17
  108. package/build-module/higher-order/with-global-events/listener.js.map +7 -1
  109. package/build-module/higher-order/with-instance-id/index.js +17 -22
  110. package/build-module/higher-order/with-instance-id/index.js.map +7 -1
  111. package/build-module/higher-order/with-safe-timeout/index.js +52 -62
  112. package/build-module/higher-order/with-safe-timeout/index.js.map +7 -1
  113. package/build-module/higher-order/with-state/index.js +23 -35
  114. package/build-module/higher-order/with-state/index.js.map +7 -1
  115. package/build-module/hooks/use-async-list/index.js +16 -33
  116. package/build-module/hooks/use-async-list/index.js.map +7 -1
  117. package/build-module/hooks/use-constrained-tabbing/index.js +26 -70
  118. package/build-module/hooks/use-constrained-tabbing/index.js.map +7 -1
  119. package/build-module/hooks/use-copy-on-click/index.js +14 -47
  120. package/build-module/hooks/use-copy-on-click/index.js.map +7 -1
  121. package/build-module/hooks/use-copy-to-clipboard/index.js +11 -44
  122. package/build-module/hooks/use-copy-to-clipboard/index.js.map +7 -1
  123. package/build-module/hooks/use-debounce/index.js +12 -33
  124. package/build-module/hooks/use-debounce/index.js.map +7 -1
  125. package/build-module/hooks/use-debounced-input/index.js +7 -18
  126. package/build-module/hooks/use-debounced-input/index.js.map +7 -1
  127. package/build-module/hooks/use-dialog/index.js +29 -43
  128. package/build-module/hooks/use-dialog/index.js.map +7 -1
  129. package/build-module/hooks/use-disabled/index.js +47 -78
  130. package/build-module/hooks/use-disabled/index.js.map +7 -1
  131. package/build-module/hooks/use-dragging/index.js +19 -39
  132. package/build-module/hooks/use-dragging/index.js.map +7 -1
  133. package/build-module/hooks/use-drop-zone/index.js +100 -158
  134. package/build-module/hooks/use-drop-zone/index.js.map +7 -1
  135. package/build-module/hooks/use-event/index.js +13 -39
  136. package/build-module/hooks/use-event/index.js.map +7 -1
  137. package/build-module/hooks/use-fixed-window-list/index.js +86 -87
  138. package/build-module/hooks/use-fixed-window-list/index.js.map +7 -1
  139. package/build-module/hooks/use-focus-on-mount/index.js +12 -48
  140. package/build-module/hooks/use-focus-on-mount/index.js.map +7 -1
  141. package/build-module/hooks/use-focus-outside/index.js +21 -93
  142. package/build-module/hooks/use-focus-outside/index.js.map +7 -1
  143. package/build-module/hooks/use-focus-return/index.js +13 -48
  144. package/build-module/hooks/use-focus-return/index.js.map +7 -1
  145. package/build-module/hooks/use-focusable-iframe/index.js +11 -31
  146. package/build-module/hooks/use-focusable-iframe/index.js.map +7 -1
  147. package/build-module/hooks/use-instance-id/index.js +7 -36
  148. package/build-module/hooks/use-instance-id/index.js.map +7 -1
  149. package/build-module/hooks/use-isomorphic-layout-effect/index.js +7 -13
  150. package/build-module/hooks/use-isomorphic-layout-effect/index.js.map +7 -1
  151. package/build-module/hooks/use-keyboard-shortcut/index.js +40 -60
  152. package/build-module/hooks/use-keyboard-shortcut/index.js.map +7 -1
  153. package/build-module/hooks/use-media-query/index.js +21 -30
  154. package/build-module/hooks/use-media-query/index.js.map +7 -1
  155. package/build-module/hooks/use-merge-refs/index.js +10 -92
  156. package/build-module/hooks/use-merge-refs/index.js.map +7 -1
  157. package/build-module/hooks/use-observable-value/index.js +13 -24
  158. package/build-module/hooks/use-observable-value/index.js.map +7 -1
  159. package/build-module/hooks/use-preferred-color-scheme/index.android.js +15 -18
  160. package/build-module/hooks/use-preferred-color-scheme/index.android.js.map +7 -1
  161. package/build-module/hooks/use-preferred-color-scheme/index.ios.js +6 -12
  162. package/build-module/hooks/use-preferred-color-scheme/index.ios.js.map +7 -1
  163. package/build-module/hooks/use-previous/index.js +7 -20
  164. package/build-module/hooks/use-previous/index.js.map +7 -1
  165. package/build-module/hooks/use-reduced-motion/index.js +7 -13
  166. package/build-module/hooks/use-reduced-motion/index.js.map +7 -1
  167. package/build-module/hooks/use-ref-effect/index.js +7 -31
  168. package/build-module/hooks/use-ref-effect/index.js.map +7 -1
  169. package/build-module/hooks/use-resize-observer/index.js +7 -61
  170. package/build-module/hooks/use-resize-observer/index.js.map +7 -1
  171. package/build-module/hooks/use-resize-observer/legacy/index.js +28 -96
  172. package/build-module/hooks/use-resize-observer/legacy/index.js.map +7 -1
  173. package/build-module/hooks/use-resize-observer/use-resize-observer.js +10 -28
  174. package/build-module/hooks/use-resize-observer/use-resize-observer.js.map +7 -1
  175. package/build-module/hooks/use-state-with-history/index.js +47 -55
  176. package/build-module/hooks/use-state-with-history/index.js.map +7 -1
  177. package/build-module/hooks/use-throttle/index.js +12 -33
  178. package/build-module/hooks/use-throttle/index.js.map +7 -1
  179. package/build-module/hooks/use-viewport-match/index.js +22 -64
  180. package/build-module/hooks/use-viewport-match/index.js.map +7 -1
  181. package/build-module/hooks/use-warn-on-change/index.js +21 -34
  182. package/build-module/hooks/use-warn-on-change/index.js.map +7 -1
  183. package/build-module/index.js +83 -53
  184. package/build-module/index.js.map +7 -1
  185. package/build-module/utils/create-higher-order-component/index.js +9 -30
  186. package/build-module/utils/create-higher-order-component/index.js.map +7 -1
  187. package/build-module/utils/debounce/index.js +17 -95
  188. package/build-module/utils/debounce/index.js.map +7 -1
  189. package/build-module/utils/observable-map/index.js +8 -16
  190. package/build-module/utils/observable-map/index.js.map +7 -1
  191. package/build-module/utils/throttle/index.js +8 -75
  192. package/build-module/utils/throttle/index.js.map +7 -1
  193. package/package.json +17 -10
  194. package/src/hooks/use-debounce/index.js +1 -1
  195. package/tsconfig.tsbuildinfo +1 -1
  196. package/build/higher-order/with-network-connectivity/index.native.js +0 -27
  197. package/build/higher-order/with-network-connectivity/index.native.js.map +0 -1
  198. package/build/higher-order/with-preferred-color-scheme/index.native.js +0 -37
  199. package/build/higher-order/with-preferred-color-scheme/index.native.js.map +0 -1
  200. package/build/hooks/use-constrained-tabbing/index.native.js +0 -20
  201. package/build/hooks/use-constrained-tabbing/index.native.js.map +0 -1
  202. package/build/hooks/use-focus-outside/index.native.js +0 -175
  203. package/build/hooks/use-focus-outside/index.native.js.map +0 -1
  204. package/build/hooks/use-keyboard-shortcut/index.native.js +0 -9
  205. package/build/hooks/use-keyboard-shortcut/index.native.js.map +0 -1
  206. package/build/hooks/use-network-connectivity/index.native.js +0 -58
  207. package/build/hooks/use-network-connectivity/index.native.js.map +0 -1
  208. package/build/hooks/use-preferred-color-scheme-style/index.native.js +0 -42
  209. package/build/hooks/use-preferred-color-scheme-style/index.native.js.map +0 -1
  210. package/build/hooks/use-resize-observer/index.native.js +0 -14
  211. package/build/hooks/use-resize-observer/index.native.js.map +0 -1
  212. package/build/hooks/use-resize-observer/legacy/index.native.js +0 -62
  213. package/build/hooks/use-resize-observer/legacy/index.native.js.map +0 -1
  214. package/build/index.native.js +0 -297
  215. package/build/index.native.js.map +0 -1
  216. package/build-module/higher-order/with-network-connectivity/index.native.js +0 -19
  217. package/build-module/higher-order/with-network-connectivity/index.native.js.map +0 -1
  218. package/build-module/higher-order/with-preferred-color-scheme/index.native.js +0 -29
  219. package/build-module/higher-order/with-preferred-color-scheme/index.native.js.map +0 -1
  220. package/build-module/hooks/use-constrained-tabbing/index.native.js +0 -13
  221. package/build-module/hooks/use-constrained-tabbing/index.native.js.map +0 -1
  222. package/build-module/hooks/use-focus-outside/index.native.js +0 -169
  223. package/build-module/hooks/use-focus-outside/index.native.js.map +0 -1
  224. package/build-module/hooks/use-keyboard-shortcut/index.native.js +0 -3
  225. package/build-module/hooks/use-keyboard-shortcut/index.native.js.map +0 -1
  226. package/build-module/hooks/use-network-connectivity/index.native.js +0 -52
  227. package/build-module/hooks/use-network-connectivity/index.native.js.map +0 -1
  228. package/build-module/hooks/use-preferred-color-scheme-style/index.native.js +0 -35
  229. package/build-module/hooks/use-preferred-color-scheme-style/index.native.js.map +0 -1
  230. package/build-module/hooks/use-resize-observer/index.native.js +0 -2
  231. package/build-module/hooks/use-resize-observer/index.native.js.map +0 -1
  232. package/build-module/hooks/use-resize-observer/legacy/index.native.js +0 -56
  233. package/build-module/hooks/use-resize-observer/legacy/index.native.js.map +0 -1
  234. package/build-module/index.native.js +0 -45
  235. package/build-module/index.native.js.map +0 -1
@@ -1 +1,7 @@
1
- {"version":3,"names":["useEffect","useState","useDebounce","useDebouncedInput","defaultValue","input","setInput","debouncedInput","setDebouncedState","setDebouncedInput"],"sources":["@wordpress/compose/src/hooks/use-debounced-input/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDebounce from '../use-debounce';\n\n/**\n * Helper hook for input fields that need to debounce the value before using it.\n *\n * @param defaultValue The default value to use.\n * @return The input value, the setter and the debounced input value.\n */\nexport default function useDebouncedInput(\n\tdefaultValue = ''\n): [ string, ( value: string ) => void, string ] {\n\tconst [ input, setInput ] = useState< string >( defaultValue );\n\tconst [ debouncedInput, setDebouncedState ] = useState( defaultValue );\n\n\tconst setDebouncedInput = useDebounce( setDebouncedState, 250 );\n\n\tuseEffect( () => {\n\t\tsetDebouncedInput( input );\n\t}, [ input, setDebouncedInput ] );\n\n\treturn [ input, setInput, debouncedInput ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CACxCC,YAAY,GAAG,EAAE,EAC+B;EAChD,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAGL,QAAQ,CAAYG,YAAa,CAAC;EAC9D,MAAM,CAAEG,cAAc,EAAEC,iBAAiB,CAAE,GAAGP,QAAQ,CAAEG,YAAa,CAAC;EAEtE,MAAMK,iBAAiB,GAAGP,WAAW,CAAEM,iBAAiB,EAAE,GAAI,CAAC;EAE/DR,SAAS,CAAE,MAAM;IAChBS,iBAAiB,CAAEJ,KAAM,CAAC;EAC3B,CAAC,EAAE,CAAEA,KAAK,EAAEI,iBAAiB,CAAG,CAAC;EAEjC,OAAO,CAAEJ,KAAK,EAAEC,QAAQ,EAAEC,cAAc,CAAE;AAC3C","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-debounced-input/index.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useDebounce from '../use-debounce';\n\n/**\n * Helper hook for input fields that need to debounce the value before using it.\n *\n * @param defaultValue The default value to use.\n * @return The input value, the setter and the debounced input value.\n */\nexport default function useDebouncedInput(\n\tdefaultValue = ''\n): [ string, ( value: string ) => void, string ] {\n\tconst [ input, setInput ] = useState< string >( defaultValue );\n\tconst [ debouncedInput, setDebouncedState ] = useState( defaultValue );\n\n\tconst setDebouncedInput = useDebounce( setDebouncedState, 250 );\n\n\tuseEffect( () => {\n\t\tsetDebouncedInput( input );\n\t}, [ input, setDebouncedInput ] );\n\n\treturn [ input, setInput, debouncedInput ];\n}\n"],
5
+ "mappings": "AAGA,SAAS,WAAW,gBAAgB;AAKpC,OAAO,iBAAiB;AAQT,SAAR,kBACN,eAAe,IACiC;AAChD,QAAM,CAAE,OAAO,QAAS,IAAI,SAAoB,YAAa;AAC7D,QAAM,CAAE,gBAAgB,iBAAkB,IAAI,SAAU,YAAa;AAErE,QAAM,oBAAoB,YAAa,mBAAmB,GAAI;AAE9D,YAAW,MAAM;AAChB,sBAAmB,KAAM;AAAA,EAC1B,GAAG,CAAE,OAAO,iBAAkB,CAAE;AAEhC,SAAO,CAAE,OAAO,UAAU,cAAe;AAC1C;",
6
+ "names": []
7
+ }
@@ -1,66 +1,52 @@
1
- /**
2
- * External dependencies
3
- */
4
-
5
- /**
6
- * WordPress dependencies
7
- */
8
- import { useRef, useEffect, useCallback } from '@wordpress/element';
9
- import { ESCAPE } from '@wordpress/keycodes';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import useConstrainedTabbing from '../use-constrained-tabbing';
15
- import useFocusOnMount from '../use-focus-on-mount';
16
- import useFocusReturn from '../use-focus-return';
17
- import useFocusOutside from '../use-focus-outside';
18
- import useMergeRefs from '../use-merge-refs';
19
- /**
20
- * Returns a ref and props to apply to a dialog wrapper to enable the following behaviors:
21
- * - constrained tabbing.
22
- * - focus on mount.
23
- * - return focus on unmount.
24
- * - focus outside.
25
- *
26
- * @param options Dialog Options.
27
- */
1
+ import { useRef, useEffect, useCallback } from "@wordpress/element";
2
+ import { ESCAPE } from "@wordpress/keycodes";
3
+ import useConstrainedTabbing from "../use-constrained-tabbing";
4
+ import useFocusOnMount from "../use-focus-on-mount";
5
+ import useFocusReturn from "../use-focus-return";
6
+ import useFocusOutside from "../use-focus-outside";
7
+ import useMergeRefs from "../use-merge-refs";
28
8
  function useDialog(options) {
29
9
  const currentOptions = useRef();
30
- const {
31
- constrainTabbing = options.focusOnMount !== false
32
- } = options;
10
+ const { constrainTabbing = options.focusOnMount !== false } = options;
33
11
  useEffect(() => {
34
12
  currentOptions.current = options;
35
13
  }, Object.values(options));
36
14
  const constrainedTabbingRef = useConstrainedTabbing();
37
15
  const focusOnMountRef = useFocusOnMount(options.focusOnMount);
38
16
  const focusReturnRef = useFocusReturn();
39
- const focusOutsideProps = useFocusOutside(event => {
40
- // This unstable prop is here only to manage backward compatibility
41
- // for the Popover component otherwise, the onClose should be enough.
17
+ const focusOutsideProps = useFocusOutside((event) => {
42
18
  if (currentOptions.current?.__unstableOnClose) {
43
- currentOptions.current.__unstableOnClose('focus-outside', event);
19
+ currentOptions.current.__unstableOnClose("focus-outside", event);
44
20
  } else if (currentOptions.current?.onClose) {
45
21
  currentOptions.current.onClose();
46
22
  }
47
23
  });
48
- const closeOnEscapeRef = useCallback(node => {
24
+ const closeOnEscapeRef = useCallback((node) => {
49
25
  if (!node) {
50
26
  return;
51
27
  }
52
- node.addEventListener('keydown', event => {
53
- // Close on escape.
28
+ node.addEventListener("keydown", (event) => {
54
29
  if (event.keyCode === ESCAPE && !event.defaultPrevented && currentOptions.current?.onClose) {
55
30
  event.preventDefault();
56
31
  currentOptions.current.onClose();
57
32
  }
58
33
  });
59
34
  }, []);
60
- return [useMergeRefs([constrainTabbing ? constrainedTabbingRef : null, options.focusOnMount !== false ? focusReturnRef : null, options.focusOnMount !== false ? focusOnMountRef : null, closeOnEscapeRef]), {
61
- ...focusOutsideProps,
62
- tabIndex: -1
63
- }];
35
+ return [
36
+ useMergeRefs([
37
+ constrainTabbing ? constrainedTabbingRef : null,
38
+ options.focusOnMount !== false ? focusReturnRef : null,
39
+ options.focusOnMount !== false ? focusOnMountRef : null,
40
+ closeOnEscapeRef
41
+ ]),
42
+ {
43
+ ...focusOutsideProps,
44
+ tabIndex: -1
45
+ }
46
+ ];
64
47
  }
65
- export default useDialog;
66
- //# sourceMappingURL=index.js.map
48
+ var use_dialog_default = useDialog;
49
+ export {
50
+ use_dialog_default as default
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useRef","useEffect","useCallback","ESCAPE","useConstrainedTabbing","useFocusOnMount","useFocusReturn","useFocusOutside","useMergeRefs","useDialog","options","currentOptions","constrainTabbing","focusOnMount","current","Object","values","constrainedTabbingRef","focusOnMountRef","focusReturnRef","focusOutsideProps","event","__unstableOnClose","onClose","closeOnEscapeRef","node","addEventListener","keyCode","defaultPrevented","preventDefault","tabIndex"],"sources":["@wordpress/compose/src/hooks/use-dialog/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { RefCallback, SyntheticEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect, useCallback } from '@wordpress/element';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport useConstrainedTabbing from '../use-constrained-tabbing';\nimport useFocusOnMount from '../use-focus-on-mount';\nimport useFocusReturn from '../use-focus-return';\nimport useFocusOutside from '../use-focus-outside';\nimport useMergeRefs from '../use-merge-refs';\n\ntype DialogOptions = {\n\t/**\n\t * Determines whether focus should be automatically moved to the popover\n\t * when it mounts. `false` causes no focus shift, `true` causes the popover\n\t * itself to gain focus, and `firstElement` focuses the first focusable\n\t * element within the popover.\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: Parameters< typeof useFocusOnMount >[ 0 ];\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elsewhere, or whether the popover remains part of the\n\t * wider tab order.\n\t * If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @see focusOnMount\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\tonClose?: () => void;\n\t/**\n\t * Use the `onClose` prop instead.\n\t *\n\t * @deprecated\n\t */\n\t__unstableOnClose?: (\n\t\ttype: string | undefined,\n\t\tevent: SyntheticEvent\n\t) => void;\n};\n\ntype useDialogReturn = [\n\tRefCallback< HTMLElement >,\n\tReturnType< typeof useFocusOutside > & Pick< HTMLElement, 'tabIndex' >,\n];\n\n/**\n * Returns a ref and props to apply to a dialog wrapper to enable the following behaviors:\n * - constrained tabbing.\n * - focus on mount.\n * - return focus on unmount.\n * - focus outside.\n *\n * @param options Dialog Options.\n */\nfunction useDialog( options: DialogOptions ): useDialogReturn {\n\tconst currentOptions = useRef< DialogOptions | undefined >();\n\tconst { constrainTabbing = options.focusOnMount !== false } = options;\n\tuseEffect( () => {\n\t\tcurrentOptions.current = options;\n\t}, Object.values( options ) );\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusOnMountRef = useFocusOnMount( options.focusOnMount );\n\tconst focusReturnRef = useFocusReturn();\n\tconst focusOutsideProps = useFocusOutside( ( event ) => {\n\t\t// This unstable prop is here only to manage backward compatibility\n\t\t// for the Popover component otherwise, the onClose should be enough.\n\t\tif ( currentOptions.current?.__unstableOnClose ) {\n\t\t\tcurrentOptions.current.__unstableOnClose( 'focus-outside', event );\n\t\t} else if ( currentOptions.current?.onClose ) {\n\t\t\tcurrentOptions.current.onClose();\n\t\t}\n\t} );\n\tconst closeOnEscapeRef = useCallback( ( node: HTMLElement ) => {\n\t\tif ( ! node ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnode.addEventListener( 'keydown', ( event: KeyboardEvent ) => {\n\t\t\t// Close on escape.\n\t\t\tif (\n\t\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t\t! event.defaultPrevented &&\n\t\t\t\tcurrentOptions.current?.onClose\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcurrentOptions.current.onClose();\n\t\t\t}\n\t\t} );\n\t}, [] );\n\n\treturn [\n\t\tuseMergeRefs( [\n\t\t\tconstrainTabbing ? constrainedTabbingRef : null,\n\t\t\toptions.focusOnMount !== false ? focusReturnRef : null,\n\t\t\toptions.focusOnMount !== false ? focusOnMountRef : null,\n\t\t\tcloseOnEscapeRef,\n\t\t] ),\n\t\t{\n\t\t\t...focusOutsideProps,\n\t\t\ttabIndex: -1,\n\t\t},\n\t];\n}\n\nexport default useDialog;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AACnE,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,eAAe,MAAM,uBAAuB;AACnD,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,eAAe,MAAM,sBAAsB;AAClD,OAAOC,YAAY,MAAM,mBAAmB;AAwC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAEC,OAAsB,EAAoB;EAC7D,MAAMC,cAAc,GAAGX,MAAM,CAA8B,CAAC;EAC5D,MAAM;IAAEY,gBAAgB,GAAGF,OAAO,CAACG,YAAY,KAAK;EAAM,CAAC,GAAGH,OAAO;EACrET,SAAS,CAAE,MAAM;IAChBU,cAAc,CAACG,OAAO,GAAGJ,OAAO;EACjC,CAAC,EAAEK,MAAM,CAACC,MAAM,CAAEN,OAAQ,CAAE,CAAC;EAC7B,MAAMO,qBAAqB,GAAGb,qBAAqB,CAAC,CAAC;EACrD,MAAMc,eAAe,GAAGb,eAAe,CAAEK,OAAO,CAACG,YAAa,CAAC;EAC/D,MAAMM,cAAc,GAAGb,cAAc,CAAC,CAAC;EACvC,MAAMc,iBAAiB,GAAGb,eAAe,CAAIc,KAAK,IAAM;IACvD;IACA;IACA,IAAKV,cAAc,CAACG,OAAO,EAAEQ,iBAAiB,EAAG;MAChDX,cAAc,CAACG,OAAO,CAACQ,iBAAiB,CAAE,eAAe,EAAED,KAAM,CAAC;IACnE,CAAC,MAAM,IAAKV,cAAc,CAACG,OAAO,EAAES,OAAO,EAAG;MAC7CZ,cAAc,CAACG,OAAO,CAACS,OAAO,CAAC,CAAC;IACjC;EACD,CAAE,CAAC;EACH,MAAMC,gBAAgB,GAAGtB,WAAW,CAAIuB,IAAiB,IAAM;IAC9D,IAAK,CAAEA,IAAI,EAAG;MACb;IACD;IAEAA,IAAI,CAACC,gBAAgB,CAAE,SAAS,EAAIL,KAAoB,IAAM;MAC7D;MACA,IACCA,KAAK,CAACM,OAAO,KAAKxB,MAAM,IACxB,CAAEkB,KAAK,CAACO,gBAAgB,IACxBjB,cAAc,CAACG,OAAO,EAAES,OAAO,EAC9B;QACDF,KAAK,CAACQ,cAAc,CAAC,CAAC;QACtBlB,cAAc,CAACG,OAAO,CAACS,OAAO,CAAC,CAAC;MACjC;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEP,OAAO,CACNf,YAAY,CAAE,CACbI,gBAAgB,GAAGK,qBAAqB,GAAG,IAAI,EAC/CP,OAAO,CAACG,YAAY,KAAK,KAAK,GAAGM,cAAc,GAAG,IAAI,EACtDT,OAAO,CAACG,YAAY,KAAK,KAAK,GAAGK,eAAe,GAAG,IAAI,EACvDM,gBAAgB,CACf,CAAC,EACH;IACC,GAAGJ,iBAAiB;IACpBU,QAAQ,EAAE,CAAC;EACZ,CAAC,CACD;AACF;AAEA,eAAerB,SAAS","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-dialog/index.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport type { RefCallback, SyntheticEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect, useCallback } from '@wordpress/element';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport useConstrainedTabbing from '../use-constrained-tabbing';\nimport useFocusOnMount from '../use-focus-on-mount';\nimport useFocusReturn from '../use-focus-return';\nimport useFocusOutside from '../use-focus-outside';\nimport useMergeRefs from '../use-merge-refs';\n\ntype DialogOptions = {\n\t/**\n\t * Determines whether focus should be automatically moved to the popover\n\t * when it mounts. `false` causes no focus shift, `true` causes the popover\n\t * itself to gain focus, and `firstElement` focuses the first focusable\n\t * element within the popover.\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: Parameters< typeof useFocusOnMount >[ 0 ];\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elsewhere, or whether the popover remains part of the\n\t * wider tab order.\n\t * If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @see focusOnMount\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\tonClose?: () => void;\n\t/**\n\t * Use the `onClose` prop instead.\n\t *\n\t * @deprecated\n\t */\n\t__unstableOnClose?: (\n\t\ttype: string | undefined,\n\t\tevent: SyntheticEvent\n\t) => void;\n};\n\ntype useDialogReturn = [\n\tRefCallback< HTMLElement >,\n\tReturnType< typeof useFocusOutside > & Pick< HTMLElement, 'tabIndex' >,\n];\n\n/**\n * Returns a ref and props to apply to a dialog wrapper to enable the following behaviors:\n * - constrained tabbing.\n * - focus on mount.\n * - return focus on unmount.\n * - focus outside.\n *\n * @param options Dialog Options.\n */\nfunction useDialog( options: DialogOptions ): useDialogReturn {\n\tconst currentOptions = useRef< DialogOptions | undefined >();\n\tconst { constrainTabbing = options.focusOnMount !== false } = options;\n\tuseEffect( () => {\n\t\tcurrentOptions.current = options;\n\t}, Object.values( options ) );\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusOnMountRef = useFocusOnMount( options.focusOnMount );\n\tconst focusReturnRef = useFocusReturn();\n\tconst focusOutsideProps = useFocusOutside( ( event ) => {\n\t\t// This unstable prop is here only to manage backward compatibility\n\t\t// for the Popover component otherwise, the onClose should be enough.\n\t\tif ( currentOptions.current?.__unstableOnClose ) {\n\t\t\tcurrentOptions.current.__unstableOnClose( 'focus-outside', event );\n\t\t} else if ( currentOptions.current?.onClose ) {\n\t\t\tcurrentOptions.current.onClose();\n\t\t}\n\t} );\n\tconst closeOnEscapeRef = useCallback( ( node: HTMLElement ) => {\n\t\tif ( ! node ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnode.addEventListener( 'keydown', ( event: KeyboardEvent ) => {\n\t\t\t// Close on escape.\n\t\t\tif (\n\t\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t\t! event.defaultPrevented &&\n\t\t\t\tcurrentOptions.current?.onClose\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcurrentOptions.current.onClose();\n\t\t\t}\n\t\t} );\n\t}, [] );\n\n\treturn [\n\t\tuseMergeRefs( [\n\t\t\tconstrainTabbing ? constrainedTabbingRef : null,\n\t\t\toptions.focusOnMount !== false ? focusReturnRef : null,\n\t\t\toptions.focusOnMount !== false ? focusOnMountRef : null,\n\t\t\tcloseOnEscapeRef,\n\t\t] ),\n\t\t{\n\t\t\t...focusOutsideProps,\n\t\t\ttabIndex: -1,\n\t\t},\n\t];\n}\n\nexport default useDialog;\n"],
5
+ "mappings": "AAQA,SAAS,QAAQ,WAAW,mBAAmB;AAC/C,SAAS,cAAc;AAKvB,OAAO,2BAA2B;AAClC,OAAO,qBAAqB;AAC5B,OAAO,oBAAoB;AAC3B,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AAiDzB,SAAS,UAAW,SAA0C;AAC7D,QAAM,iBAAiB,OAAoC;AAC3D,QAAM,EAAE,mBAAmB,QAAQ,iBAAiB,MAAM,IAAI;AAC9D,YAAW,MAAM;AAChB,mBAAe,UAAU;AAAA,EAC1B,GAAG,OAAO,OAAQ,OAAQ,CAAE;AAC5B,QAAM,wBAAwB,sBAAsB;AACpD,QAAM,kBAAkB,gBAAiB,QAAQ,YAAa;AAC9D,QAAM,iBAAiB,eAAe;AACtC,QAAM,oBAAoB,gBAAiB,CAAE,UAAW;AAGvD,QAAK,eAAe,SAAS,mBAAoB;AAChD,qBAAe,QAAQ,kBAAmB,iBAAiB,KAAM;AAAA,IAClE,WAAY,eAAe,SAAS,SAAU;AAC7C,qBAAe,QAAQ,QAAQ;AAAA,IAChC;AAAA,EACD,CAAE;AACF,QAAM,mBAAmB,YAAa,CAAE,SAAuB;AAC9D,QAAK,CAAE,MAAO;AACb;AAAA,IACD;AAEA,SAAK,iBAAkB,WAAW,CAAE,UAA0B;AAE7D,UACC,MAAM,YAAY,UAClB,CAAE,MAAM,oBACR,eAAe,SAAS,SACvB;AACD,cAAM,eAAe;AACrB,uBAAe,QAAQ,QAAQ;AAAA,MAChC;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAC,CAAE;AAEN,SAAO;AAAA,IACN,aAAc;AAAA,MACb,mBAAmB,wBAAwB;AAAA,MAC3C,QAAQ,iBAAiB,QAAQ,iBAAiB;AAAA,MAClD,QAAQ,iBAAiB,QAAQ,kBAAkB;AAAA,MACnD;AAAA,IACD,CAAE;AAAA,IACF;AAAA,MACC,GAAG;AAAA,MACH,UAAU;AAAA,IACX;AAAA,EACD;AACD;AAEA,IAAO,qBAAQ;",
6
+ "names": []
7
+ }
@@ -1,82 +1,51 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { debounce } from '../../utils/debounce';
5
- import useRefEffect from '../use-ref-effect';
6
-
7
- /**
8
- * In some circumstances, such as block previews, all focusable DOM elements
9
- * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
10
- * behavior to disable nested DOM elements to the returned ref.
11
- *
12
- * If you can, prefer the use of the inert HTML attribute.
13
- *
14
- * @param {Object} config Configuration object.
15
- * @param {boolean=} config.isDisabled Whether the element should be disabled.
16
- * @return {import('react').RefCallback<HTMLElement>} Element Ref.
17
- *
18
- * @example
19
- * ```js
20
- * import { useDisabled } from '@wordpress/compose';
21
- *
22
- * const DisabledExample = () => {
23
- * const disabledRef = useDisabled();
24
- * return (
25
- * <div ref={ disabledRef }>
26
- * <a href="#">This link will have tabindex set to -1</a>
27
- * <input placeholder="This input will have the disabled attribute added to it." type="text" />
28
- * </div>
29
- * );
30
- * };
31
- * ```
32
- */
33
- export default function useDisabled({
1
+ import { debounce } from "../../utils/debounce";
2
+ import useRefEffect from "../use-ref-effect";
3
+ function useDisabled({
34
4
  isDisabled: isDisabledProp = false
35
5
  } = {}) {
36
- return useRefEffect(node => {
37
- if (isDisabledProp) {
38
- return;
39
- }
40
- const defaultView = node?.ownerDocument?.defaultView;
41
- if (!defaultView) {
42
- return;
43
- }
44
-
45
- /** A variable keeping track of the previous updates in order to restore them. */
46
- const updates = [];
47
- const disable = () => {
48
- node.childNodes.forEach(child => {
49
- if (!(child instanceof defaultView.HTMLElement)) {
50
- return;
51
- }
52
- if (!child.getAttribute('inert')) {
53
- child.setAttribute('inert', 'true');
54
- updates.push(() => {
55
- child.removeAttribute('inert');
56
- });
57
- }
58
- });
59
- };
60
-
61
- // Debounce re-disable since disabling process itself will incur
62
- // additional mutations which should be ignored.
63
- const debouncedDisable = debounce(disable, 0, {
64
- leading: true
65
- });
66
- disable();
67
-
68
- /** @type {MutationObserver | undefined} */
69
- const observer = new window.MutationObserver(debouncedDisable);
70
- observer.observe(node, {
71
- childList: true
72
- });
73
- return () => {
74
- if (observer) {
75
- observer.disconnect();
6
+ return useRefEffect(
7
+ (node) => {
8
+ if (isDisabledProp) {
9
+ return;
10
+ }
11
+ const defaultView = node?.ownerDocument?.defaultView;
12
+ if (!defaultView) {
13
+ return;
76
14
  }
77
- debouncedDisable.cancel();
78
- updates.forEach(update => update());
79
- };
80
- }, [isDisabledProp]);
15
+ const updates = [];
16
+ const disable = () => {
17
+ node.childNodes.forEach((child) => {
18
+ if (!(child instanceof defaultView.HTMLElement)) {
19
+ return;
20
+ }
21
+ if (!child.getAttribute("inert")) {
22
+ child.setAttribute("inert", "true");
23
+ updates.push(() => {
24
+ child.removeAttribute("inert");
25
+ });
26
+ }
27
+ });
28
+ };
29
+ const debouncedDisable = debounce(disable, 0, {
30
+ leading: true
31
+ });
32
+ disable();
33
+ const observer = new window.MutationObserver(debouncedDisable);
34
+ observer.observe(node, {
35
+ childList: true
36
+ });
37
+ return () => {
38
+ if (observer) {
39
+ observer.disconnect();
40
+ }
41
+ debouncedDisable.cancel();
42
+ updates.forEach((update) => update());
43
+ };
44
+ },
45
+ [isDisabledProp]
46
+ );
81
47
  }
82
- //# sourceMappingURL=index.js.map
48
+ export {
49
+ useDisabled as default
50
+ };
51
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["debounce","useRefEffect","useDisabled","isDisabled","isDisabledProp","node","defaultView","ownerDocument","updates","disable","childNodes","forEach","child","HTMLElement","getAttribute","setAttribute","push","removeAttribute","debouncedDisable","leading","observer","window","MutationObserver","observe","childList","disconnect","cancel","update"],"sources":["@wordpress/compose/src/hooks/use-disabled/index.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultView = node?.ownerDocument?.defaultView;\n\t\t\tif ( ! defaultView ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof defaultView.HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,sBAAsB;AAC/C,OAAOC,YAAY,MAAM,mBAAmB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAE;EACpCC,UAAU,EAAEC,cAAc,GAAG;AAC9B,CAAC,GAAG,CAAC,CAAC,EAAG;EACR,OAAOH,YAAY,CAChBI,IAAI,IAAM;IACX,IAAKD,cAAc,EAAG;MACrB;IACD;IAEA,MAAME,WAAW,GAAGD,IAAI,EAAEE,aAAa,EAAED,WAAW;IACpD,IAAK,CAAEA,WAAW,EAAG;MACpB;IACD;;IAEA;IACA,MAAME,OAAmB,GAAG,EAAE;IAC9B,MAAMC,OAAO,GAAGA,CAAA,KAAM;MACrBJ,IAAI,CAACK,UAAU,CAACC,OAAO,CAAIC,KAAK,IAAM;QACrC,IAAK,EAAIA,KAAK,YAAYN,WAAW,CAACO,WAAW,CAAE,EAAG;UACrD;QACD;QACA,IAAK,CAAED,KAAK,CAACE,YAAY,CAAE,OAAQ,CAAC,EAAG;UACtCF,KAAK,CAACG,YAAY,CAAE,OAAO,EAAE,MAAO,CAAC;UACrCP,OAAO,CAACQ,IAAI,CAAE,MAAM;YACnBJ,KAAK,CAACK,eAAe,CAAE,OAAQ,CAAC;UACjC,CAAE,CAAC;QACJ;MACD,CAAE,CAAC;IACJ,CAAC;;IAED;IACA;IACA,MAAMC,gBAAgB,GAAGlB,QAAQ,CAAES,OAAO,EAAE,CAAC,EAAE;MAC9CU,OAAO,EAAE;IACV,CAAE,CAAC;IACHV,OAAO,CAAC,CAAC;;IAET;IACA,MAAMW,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAgB,CAAEJ,gBAAiB,CAAC;IAChEE,QAAQ,CAACG,OAAO,CAAElB,IAAI,EAAE;MACvBmB,SAAS,EAAE;IACZ,CAAE,CAAC;IAEH,OAAO,MAAM;MACZ,IAAKJ,QAAQ,EAAG;QACfA,QAAQ,CAACK,UAAU,CAAC,CAAC;MACtB;MACAP,gBAAgB,CAACQ,MAAM,CAAC,CAAC;MACzBlB,OAAO,CAACG,OAAO,CAAIgB,MAAM,IAAMA,MAAM,CAAC,CAAE,CAAC;IAC1C,CAAC;EACF,CAAC,EACD,CAAEvB,cAAc,CACjB,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-disabled/index.ts"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultView = node?.ownerDocument?.defaultView;\n\t\t\tif ( ! defaultView ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof defaultView.HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"],
5
+ "mappings": "AAGA,SAAS,gBAAgB;AACzB,OAAO,kBAAkB;AA4BV,SAAR,YAA8B;AAAA,EACpC,YAAY,iBAAiB;AAC9B,IAAI,CAAC,GAAI;AACR,SAAO;AAAA,IACN,CAAE,SAAU;AACX,UAAK,gBAAiB;AACrB;AAAA,MACD;AAEA,YAAM,cAAc,MAAM,eAAe;AACzC,UAAK,CAAE,aAAc;AACpB;AAAA,MACD;AAGA,YAAM,UAAsB,CAAC;AAC7B,YAAM,UAAU,MAAM;AACrB,aAAK,WAAW,QAAS,CAAE,UAAW;AACrC,cAAK,EAAI,iBAAiB,YAAY,cAAgB;AACrD;AAAA,UACD;AACA,cAAK,CAAE,MAAM,aAAc,OAAQ,GAAI;AACtC,kBAAM,aAAc,SAAS,MAAO;AACpC,oBAAQ,KAAM,MAAM;AACnB,oBAAM,gBAAiB,OAAQ;AAAA,YAChC,CAAE;AAAA,UACH;AAAA,QACD,CAAE;AAAA,MACH;AAIA,YAAM,mBAAmB,SAAU,SAAS,GAAG;AAAA,QAC9C,SAAS;AAAA,MACV,CAAE;AACF,cAAQ;AAGR,YAAM,WAAW,IAAI,OAAO,iBAAkB,gBAAiB;AAC/D,eAAS,QAAS,MAAM;AAAA,QACvB,WAAW;AAAA,MACZ,CAAE;AAEF,aAAO,MAAM;AACZ,YAAK,UAAW;AACf,mBAAS,WAAW;AAAA,QACrB;AACA,yBAAiB,OAAO;AACxB,gBAAQ,QAAS,CAAE,WAAY,OAAO,CAAE;AAAA,MACzC;AAAA,IACD;AAAA,IACA,CAAE,cAAe;AAAA,EAClB;AACD;",
6
+ "names": []
7
+ }
@@ -1,26 +1,6 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import useIsomorphicLayoutEffect from '../use-isomorphic-layout-effect';
10
-
11
- // Event handlers that are triggered from `document` listeners accept a MouseEvent,
12
- // while those triggered from React listeners accept a React.MouseEvent.
13
- /**
14
- * @param {Object} props
15
- * @param {(e: import('react').MouseEvent) => void} props.onDragStart
16
- * @param {(e: MouseEvent) => void} props.onDragMove
17
- * @param {(e?: MouseEvent) => void} props.onDragEnd
18
- */
19
- export default function useDragging({
20
- onDragStart,
21
- onDragMove,
22
- onDragEnd
23
- }) {
1
+ import { useCallback, useEffect, useRef, useState } from "@wordpress/element";
2
+ import useIsomorphicLayoutEffect from "../use-isomorphic-layout-effect";
3
+ function useDragging({ onDragStart, onDragMove, onDragEnd }) {
24
4
  const [isDragging, setIsDragging] = useState(false);
25
5
  const eventsRef = useRef({
26
6
  onDragStart,
@@ -32,34 +12,31 @@ export default function useDragging({
32
12
  eventsRef.current.onDragMove = onDragMove;
33
13
  eventsRef.current.onDragEnd = onDragEnd;
34
14
  }, [onDragStart, onDragMove, onDragEnd]);
35
-
36
- /** @type {(e: MouseEvent) => void} */
37
- const onMouseMove = useCallback(event => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
38
- /** @type {(e?: MouseEvent) => void} */
39
- const endDrag = useCallback(event => {
15
+ const onMouseMove = useCallback(
16
+ (event) => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event),
17
+ []
18
+ );
19
+ const endDrag = useCallback((event) => {
40
20
  if (eventsRef.current.onDragEnd) {
41
21
  eventsRef.current.onDragEnd(event);
42
22
  }
43
- document.removeEventListener('mousemove', onMouseMove);
44
- document.removeEventListener('mouseup', endDrag);
23
+ document.removeEventListener("mousemove", onMouseMove);
24
+ document.removeEventListener("mouseup", endDrag);
45
25
  setIsDragging(false);
46
26
  }, []);
47
- /** @type {(e: import('react').MouseEvent) => void} */
48
- const startDrag = useCallback(event => {
27
+ const startDrag = useCallback((event) => {
49
28
  if (eventsRef.current.onDragStart) {
50
29
  eventsRef.current.onDragStart(event);
51
30
  }
52
- document.addEventListener('mousemove', onMouseMove);
53
- document.addEventListener('mouseup', endDrag);
31
+ document.addEventListener("mousemove", onMouseMove);
32
+ document.addEventListener("mouseup", endDrag);
54
33
  setIsDragging(true);
55
34
  }, []);
56
-
57
- // Remove the global events when unmounting if needed.
58
35
  useEffect(() => {
59
36
  return () => {
60
37
  if (isDragging) {
61
- document.removeEventListener('mousemove', onMouseMove);
62
- document.removeEventListener('mouseup', endDrag);
38
+ document.removeEventListener("mousemove", onMouseMove);
39
+ document.removeEventListener("mouseup", endDrag);
63
40
  }
64
41
  };
65
42
  }, [isDragging]);
@@ -69,4 +46,7 @@ export default function useDragging({
69
46
  isDragging
70
47
  };
71
48
  }
72
- //# sourceMappingURL=index.js.map
49
+ export {
50
+ useDragging as default
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useCallback","useEffect","useRef","useState","useIsomorphicLayoutEffect","useDragging","onDragStart","onDragMove","onDragEnd","isDragging","setIsDragging","eventsRef","current","onMouseMove","event","endDrag","document","removeEventListener","startDrag","addEventListener"],"sources":["@wordpress/compose/src/hooks/use-dragging/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsomorphicLayoutEffect from '../use-isomorphic-layout-effect';\n\n// Event handlers that are triggered from `document` listeners accept a MouseEvent,\n// while those triggered from React listeners accept a React.MouseEvent.\n/**\n * @param {Object} props\n * @param {(e: import('react').MouseEvent) => void} props.onDragStart\n * @param {(e: MouseEvent) => void} props.onDragMove\n * @param {(e?: MouseEvent) => void} props.onDragEnd\n */\nexport default function useDragging( { onDragStart, onDragMove, onDragEnd } ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tconst eventsRef = useRef( {\n\t\tonDragStart,\n\t\tonDragMove,\n\t\tonDragEnd,\n\t} );\n\tuseIsomorphicLayoutEffect( () => {\n\t\teventsRef.current.onDragStart = onDragStart;\n\t\teventsRef.current.onDragMove = onDragMove;\n\t\teventsRef.current.onDragEnd = onDragEnd;\n\t}, [ onDragStart, onDragMove, onDragEnd ] );\n\n\t/** @type {(e: MouseEvent) => void} */\n\tconst onMouseMove = useCallback(\n\t\t( event ) =>\n\t\t\teventsRef.current.onDragMove &&\n\t\t\teventsRef.current.onDragMove( event ),\n\t\t[]\n\t);\n\t/** @type {(e?: MouseEvent) => void} */\n\tconst endDrag = useCallback( ( event ) => {\n\t\tif ( eventsRef.current.onDragEnd ) {\n\t\t\teventsRef.current.onDragEnd( event );\n\t\t}\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove );\n\t\tdocument.removeEventListener( 'mouseup', endDrag );\n\t\tsetIsDragging( false );\n\t}, [] );\n\t/** @type {(e: import('react').MouseEvent) => void} */\n\tconst startDrag = useCallback( ( event ) => {\n\t\tif ( eventsRef.current.onDragStart ) {\n\t\t\teventsRef.current.onDragStart( event );\n\t\t}\n\t\tdocument.addEventListener( 'mousemove', onMouseMove );\n\t\tdocument.addEventListener( 'mouseup', endDrag );\n\t\tsetIsDragging( true );\n\t}, [] );\n\n\t// Remove the global events when unmounting if needed.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging ) {\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t\tdocument.removeEventListener( 'mouseup', endDrag );\n\t\t\t}\n\t\t};\n\t}, [ isDragging ] );\n\n\treturn {\n\t\tstartDrag,\n\t\tendDrag,\n\t\tisDragging,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;;AAE7E;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,iCAAiC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAE;EAAEC,WAAW;EAAEC,UAAU;EAAEC;AAAU,CAAC,EAAG;EAC7E,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGP,QAAQ,CAAE,KAAM,CAAC;EAEvD,MAAMQ,SAAS,GAAGT,MAAM,CAAE;IACzBI,WAAW;IACXC,UAAU;IACVC;EACD,CAAE,CAAC;EACHJ,yBAAyB,CAAE,MAAM;IAChCO,SAAS,CAACC,OAAO,CAACN,WAAW,GAAGA,WAAW;IAC3CK,SAAS,CAACC,OAAO,CAACL,UAAU,GAAGA,UAAU;IACzCI,SAAS,CAACC,OAAO,CAACJ,SAAS,GAAGA,SAAS;EACxC,CAAC,EAAE,CAAEF,WAAW,EAAEC,UAAU,EAAEC,SAAS,CAAG,CAAC;;EAE3C;EACA,MAAMK,WAAW,GAAGb,WAAW,CAC5Bc,KAAK,IACNH,SAAS,CAACC,OAAO,CAACL,UAAU,IAC5BI,SAAS,CAACC,OAAO,CAACL,UAAU,CAAEO,KAAM,CAAC,EACtC,EACD,CAAC;EACD;EACA,MAAMC,OAAO,GAAGf,WAAW,CAAIc,KAAK,IAAM;IACzC,IAAKH,SAAS,CAACC,OAAO,CAACJ,SAAS,EAAG;MAClCG,SAAS,CAACC,OAAO,CAACJ,SAAS,CAAEM,KAAM,CAAC;IACrC;IACAE,QAAQ,CAACC,mBAAmB,CAAE,WAAW,EAAEJ,WAAY,CAAC;IACxDG,QAAQ,CAACC,mBAAmB,CAAE,SAAS,EAAEF,OAAQ,CAAC;IAClDL,aAAa,CAAE,KAAM,CAAC;EACvB,CAAC,EAAE,EAAG,CAAC;EACP;EACA,MAAMQ,SAAS,GAAGlB,WAAW,CAAIc,KAAK,IAAM;IAC3C,IAAKH,SAAS,CAACC,OAAO,CAACN,WAAW,EAAG;MACpCK,SAAS,CAACC,OAAO,CAACN,WAAW,CAAEQ,KAAM,CAAC;IACvC;IACAE,QAAQ,CAACG,gBAAgB,CAAE,WAAW,EAAEN,WAAY,CAAC;IACrDG,QAAQ,CAACG,gBAAgB,CAAE,SAAS,EAAEJ,OAAQ,CAAC;IAC/CL,aAAa,CAAE,IAAK,CAAC;EACtB,CAAC,EAAE,EAAG,CAAC;;EAEP;EACAT,SAAS,CAAE,MAAM;IAChB,OAAO,MAAM;MACZ,IAAKQ,UAAU,EAAG;QACjBO,QAAQ,CAACC,mBAAmB,CAAE,WAAW,EAAEJ,WAAY,CAAC;QACxDG,QAAQ,CAACC,mBAAmB,CAAE,SAAS,EAAEF,OAAQ,CAAC;MACnD;IACD,CAAC;EACF,CAAC,EAAE,CAAEN,UAAU,CAAG,CAAC;EAEnB,OAAO;IACNS,SAAS;IACTH,OAAO;IACPN;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-dragging/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsomorphicLayoutEffect from '../use-isomorphic-layout-effect';\n\n// Event handlers that are triggered from `document` listeners accept a MouseEvent,\n// while those triggered from React listeners accept a React.MouseEvent.\n/**\n * @param {Object} props\n * @param {(e: import('react').MouseEvent) => void} props.onDragStart\n * @param {(e: MouseEvent) => void} props.onDragMove\n * @param {(e?: MouseEvent) => void} props.onDragEnd\n */\nexport default function useDragging( { onDragStart, onDragMove, onDragEnd } ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tconst eventsRef = useRef( {\n\t\tonDragStart,\n\t\tonDragMove,\n\t\tonDragEnd,\n\t} );\n\tuseIsomorphicLayoutEffect( () => {\n\t\teventsRef.current.onDragStart = onDragStart;\n\t\teventsRef.current.onDragMove = onDragMove;\n\t\teventsRef.current.onDragEnd = onDragEnd;\n\t}, [ onDragStart, onDragMove, onDragEnd ] );\n\n\t/** @type {(e: MouseEvent) => void} */\n\tconst onMouseMove = useCallback(\n\t\t( event ) =>\n\t\t\teventsRef.current.onDragMove &&\n\t\t\teventsRef.current.onDragMove( event ),\n\t\t[]\n\t);\n\t/** @type {(e?: MouseEvent) => void} */\n\tconst endDrag = useCallback( ( event ) => {\n\t\tif ( eventsRef.current.onDragEnd ) {\n\t\t\teventsRef.current.onDragEnd( event );\n\t\t}\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove );\n\t\tdocument.removeEventListener( 'mouseup', endDrag );\n\t\tsetIsDragging( false );\n\t}, [] );\n\t/** @type {(e: import('react').MouseEvent) => void} */\n\tconst startDrag = useCallback( ( event ) => {\n\t\tif ( eventsRef.current.onDragStart ) {\n\t\t\teventsRef.current.onDragStart( event );\n\t\t}\n\t\tdocument.addEventListener( 'mousemove', onMouseMove );\n\t\tdocument.addEventListener( 'mouseup', endDrag );\n\t\tsetIsDragging( true );\n\t}, [] );\n\n\t// Remove the global events when unmounting if needed.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( isDragging ) {\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t\tdocument.removeEventListener( 'mouseup', endDrag );\n\t\t\t}\n\t\t};\n\t}, [ isDragging ] );\n\n\treturn {\n\t\tstartDrag,\n\t\tendDrag,\n\t\tisDragging,\n\t};\n}\n"],
5
+ "mappings": "AAGA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAKzD,OAAO,+BAA+B;AAUvB,SAAR,YAA8B,EAAE,aAAa,YAAY,UAAU,GAAI;AAC7E,QAAM,CAAE,YAAY,aAAc,IAAI,SAAU,KAAM;AAEtD,QAAM,YAAY,OAAQ;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACF,4BAA2B,MAAM;AAChC,cAAU,QAAQ,cAAc;AAChC,cAAU,QAAQ,aAAa;AAC/B,cAAU,QAAQ,YAAY;AAAA,EAC/B,GAAG,CAAE,aAAa,YAAY,SAAU,CAAE;AAG1C,QAAM,cAAc;AAAA,IACnB,CAAE,UACD,UAAU,QAAQ,cAClB,UAAU,QAAQ,WAAY,KAAM;AAAA,IACrC,CAAC;AAAA,EACF;AAEA,QAAM,UAAU,YAAa,CAAE,UAAW;AACzC,QAAK,UAAU,QAAQ,WAAY;AAClC,gBAAU,QAAQ,UAAW,KAAM;AAAA,IACpC;AACA,aAAS,oBAAqB,aAAa,WAAY;AACvD,aAAS,oBAAqB,WAAW,OAAQ;AACjD,kBAAe,KAAM;AAAA,EACtB,GAAG,CAAC,CAAE;AAEN,QAAM,YAAY,YAAa,CAAE,UAAW;AAC3C,QAAK,UAAU,QAAQ,aAAc;AACpC,gBAAU,QAAQ,YAAa,KAAM;AAAA,IACtC;AACA,aAAS,iBAAkB,aAAa,WAAY;AACpD,aAAS,iBAAkB,WAAW,OAAQ;AAC9C,kBAAe,IAAK;AAAA,EACrB,GAAG,CAAC,CAAE;AAGN,YAAW,MAAM;AAChB,WAAO,MAAM;AACZ,UAAK,YAAa;AACjB,iBAAS,oBAAqB,aAAa,WAAY;AACvD,iBAAS,oBAAqB,WAAW,OAAQ;AAAA,MAClD;AAAA,IACD;AAAA,EACD,GAAG,CAAE,UAAW,CAAE;AAElB,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
+ "names": []
7
+ }