@wordpress/compose 7.32.0 → 7.32.1-next.ff1cebbba.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,169 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useCallback, useEffect, useRef } from '@wordpress/element';
5
-
6
- /**
7
- * Input types which are classified as button types, for use in considering
8
- * whether element is a (focus-normalized) button.
9
- *
10
- * @type {string[]}
11
- */
12
- const INPUT_BUTTON_TYPES = ['button', 'submit'];
13
-
14
- /**
15
- * @typedef {HTMLButtonElement | HTMLLinkElement | HTMLInputElement} FocusNormalizedButton
16
- */
17
-
18
- // Disable reason: Rule doesn't support predicate return types.
19
- /* eslint-disable jsdoc/valid-types */
20
- /**
21
- * Returns true if the given element is a button element subject to focus
22
- * normalization, or false otherwise.
23
- *
24
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
25
- *
26
- * @param {EventTarget} eventTarget The target from a mouse or touch event.
27
- *
28
- * @return {eventTarget is FocusNormalizedButton} Whether element is a button.
29
- */
30
- function isFocusNormalizedButton(eventTarget) {
31
- switch (eventTarget.nodeName) {
32
- case 'A':
33
- case 'BUTTON':
34
- return true;
35
- case 'INPUT':
36
- return INPUT_BUTTON_TYPES.includes(/** @type {HTMLInputElement} */eventTarget.type);
37
- }
38
- return false;
39
- }
40
- /* eslint-enable jsdoc/valid-types */
41
-
42
- /**
43
- * @typedef {import('react').SyntheticEvent} SyntheticEvent
44
- */
45
-
46
- /**
47
- * @callback EventCallback
48
- * @param {SyntheticEvent} event input related event.
49
- */
50
-
51
- /**
52
- * @typedef FocusOutsideReactElement
53
- * @property {EventCallback} handleFocusOutside callback for a focus outside event.
54
- */
55
-
56
- /**
57
- * @typedef {import('react').MutableRefObject<FocusOutsideReactElement | undefined>} FocusOutsideRef
58
- */
59
-
60
- /**
61
- * @typedef {Object} FocusOutsideReturnValue
62
- * @property {EventCallback} onFocus An event handler for focus events.
63
- * @property {EventCallback} onBlur An event handler for blur events.
64
- * @property {EventCallback} onMouseDown An event handler for mouse down events.
65
- * @property {EventCallback} onMouseUp An event handler for mouse up events.
66
- * @property {EventCallback} onTouchStart An event handler for touch start events.
67
- * @property {EventCallback} onTouchEnd An event handler for touch end events.
68
- */
69
-
70
- /**
71
- * A react hook that can be used to check whether focus has moved outside the
72
- * element the event handlers are bound to.
73
- *
74
- * @param {EventCallback} onFocusOutside A callback triggered when focus moves outside
75
- * the element the event handlers are bound to.
76
- *
77
- * @return {FocusOutsideReturnValue} An object containing event handlers. Bind the event handlers
78
- * to a wrapping element element to capture when focus moves
79
- * outside that element.
80
- */
81
- export default function useFocusOutside(onFocusOutside) {
82
- const currentOnFocusOutside = useRef(onFocusOutside);
83
- useEffect(() => {
84
- currentOnFocusOutside.current = onFocusOutside;
85
- }, [onFocusOutside]);
86
- const preventBlurCheck = useRef(false);
87
-
88
- /**
89
- * @type {import('react').MutableRefObject<number | undefined>}
90
- */
91
- const blurCheckTimeoutId = useRef();
92
-
93
- /**
94
- * Cancel a blur check timeout.
95
- */
96
- const cancelBlurCheck = useCallback(() => {
97
- clearTimeout(blurCheckTimeoutId.current);
98
- }, []);
99
-
100
- // Cancel blur checks on unmount.
101
- useEffect(() => {
102
- return () => cancelBlurCheck();
103
- }, []);
104
-
105
- // Cancel a blur check if the callback or ref is no longer provided.
106
- useEffect(() => {
107
- if (!onFocusOutside) {
108
- cancelBlurCheck();
109
- }
110
- }, [onFocusOutside, cancelBlurCheck]);
111
-
112
- /**
113
- * Handles a mousedown or mouseup event to respectively assign and
114
- * unassign a flag for preventing blur check on button elements. Some
115
- * browsers, namely Firefox and Safari, do not emit a focus event on
116
- * button elements when clicked, while others do. The logic here
117
- * intends to normalize this as treating click on buttons as focus.
118
- *
119
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
120
- *
121
- * @param {SyntheticEvent} event Event for mousedown or mouseup.
122
- */
123
- const normalizeButtonFocus = useCallback(event => {
124
- const {
125
- type,
126
- target
127
- } = event;
128
- const isInteractionEnd = ['mouseup', 'touchend'].includes(type);
129
- if (isInteractionEnd) {
130
- preventBlurCheck.current = false;
131
- } else if (isFocusNormalizedButton(target)) {
132
- preventBlurCheck.current = true;
133
- }
134
- }, []);
135
-
136
- /**
137
- * A callback triggered when a blur event occurs on the element the handler
138
- * is bound to.
139
- *
140
- * Calls the `onFocusOutside` callback in an immediate timeout if focus has
141
- * move outside the bound element and is still within the document.
142
- *
143
- * @param {SyntheticEvent} event Blur event.
144
- */
145
- const queueBlurCheck = useCallback(event => {
146
- // React does not allow using an event reference asynchronously
147
- // due to recycling behavior, except when explicitly persisted.
148
- event.persist();
149
-
150
- // Skip blur check if clicking button. See `normalizeButtonFocus`.
151
- if (preventBlurCheck.current) {
152
- return;
153
- }
154
- blurCheckTimeoutId.current = setTimeout(() => {
155
- if ('function' === typeof currentOnFocusOutside.current) {
156
- currentOnFocusOutside.current(event);
157
- }
158
- }, 0);
159
- }, []);
160
- return {
161
- onFocus: cancelBlurCheck,
162
- onMouseDown: normalizeButtonFocus,
163
- onMouseUp: normalizeButtonFocus,
164
- onTouchStart: normalizeButtonFocus,
165
- onTouchEnd: normalizeButtonFocus,
166
- onBlur: queueBlurCheck
167
- };
168
- }
169
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useEffect","useRef","INPUT_BUTTON_TYPES","isFocusNormalizedButton","eventTarget","nodeName","includes","type","useFocusOutside","onFocusOutside","currentOnFocusOutside","current","preventBlurCheck","blurCheckTimeoutId","cancelBlurCheck","clearTimeout","normalizeButtonFocus","event","target","isInteractionEnd","queueBlurCheck","persist","setTimeout","onFocus","onMouseDown","onMouseUp","onTouchStart","onTouchEnd","onBlur"],"sources":["@wordpress/compose/src/hooks/use-focus-outside/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Input types which are classified as button types, for use in considering\n * whether element is a (focus-normalized) button.\n *\n * @type {string[]}\n */\nconst INPUT_BUTTON_TYPES = [ 'button', 'submit' ];\n\n/**\n * @typedef {HTMLButtonElement | HTMLLinkElement | HTMLInputElement} FocusNormalizedButton\n */\n\n// Disable reason: Rule doesn't support predicate return types.\n/* eslint-disable jsdoc/valid-types */\n/**\n * Returns true if the given element is a button element subject to focus\n * normalization, or false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n *\n * @param {EventTarget} eventTarget The target from a mouse or touch event.\n *\n * @return {eventTarget is FocusNormalizedButton} Whether element is a button.\n */\nfunction isFocusNormalizedButton( eventTarget ) {\n\tswitch ( eventTarget.nodeName ) {\n\t\tcase 'A':\n\t\tcase 'BUTTON':\n\t\t\treturn true;\n\n\t\tcase 'INPUT':\n\t\t\treturn INPUT_BUTTON_TYPES.includes(\n\t\t\t\t/** @type {HTMLInputElement} */ ( eventTarget ).type\n\t\t\t);\n\t}\n\n\treturn false;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * @typedef {import('react').SyntheticEvent} SyntheticEvent\n */\n\n/**\n * @callback EventCallback\n * @param {SyntheticEvent} event input related event.\n */\n\n/**\n * @typedef FocusOutsideReactElement\n * @property {EventCallback} handleFocusOutside callback for a focus outside event.\n */\n\n/**\n * @typedef {import('react').MutableRefObject<FocusOutsideReactElement | undefined>} FocusOutsideRef\n */\n\n/**\n * @typedef {Object} FocusOutsideReturnValue\n * @property {EventCallback} onFocus An event handler for focus events.\n * @property {EventCallback} onBlur An event handler for blur events.\n * @property {EventCallback} onMouseDown An event handler for mouse down events.\n * @property {EventCallback} onMouseUp An event handler for mouse up events.\n * @property {EventCallback} onTouchStart An event handler for touch start events.\n * @property {EventCallback} onTouchEnd An event handler for touch end events.\n */\n\n/**\n * A react hook that can be used to check whether focus has moved outside the\n * element the event handlers are bound to.\n *\n * @param {EventCallback} onFocusOutside A callback triggered when focus moves outside\n * the element the event handlers are bound to.\n *\n * @return {FocusOutsideReturnValue} An object containing event handlers. Bind the event handlers\n * to a wrapping element element to capture when focus moves\n * outside that element.\n */\nexport default function useFocusOutside( onFocusOutside ) {\n\tconst currentOnFocusOutside = useRef( onFocusOutside );\n\tuseEffect( () => {\n\t\tcurrentOnFocusOutside.current = onFocusOutside;\n\t}, [ onFocusOutside ] );\n\n\tconst preventBlurCheck = useRef( false );\n\n\t/**\n\t * @type {import('react').MutableRefObject<number | undefined>}\n\t */\n\tconst blurCheckTimeoutId = useRef();\n\n\t/**\n\t * Cancel a blur check timeout.\n\t */\n\tconst cancelBlurCheck = useCallback( () => {\n\t\tclearTimeout( blurCheckTimeoutId.current );\n\t}, [] );\n\n\t// Cancel blur checks on unmount.\n\tuseEffect( () => {\n\t\treturn () => cancelBlurCheck();\n\t}, [] );\n\n\t// Cancel a blur check if the callback or ref is no longer provided.\n\tuseEffect( () => {\n\t\tif ( ! onFocusOutside ) {\n\t\t\tcancelBlurCheck();\n\t\t}\n\t}, [ onFocusOutside, cancelBlurCheck ] );\n\n\t/**\n\t * Handles a mousedown or mouseup event to respectively assign and\n\t * unassign a flag for preventing blur check on button elements. Some\n\t * browsers, namely Firefox and Safari, do not emit a focus event on\n\t * button elements when clicked, while others do. The logic here\n\t * intends to normalize this as treating click on buttons as focus.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t *\n\t * @param {SyntheticEvent} event Event for mousedown or mouseup.\n\t */\n\tconst normalizeButtonFocus = useCallback( ( event ) => {\n\t\tconst { type, target } = event;\n\t\tconst isInteractionEnd = [ 'mouseup', 'touchend' ].includes( type );\n\n\t\tif ( isInteractionEnd ) {\n\t\t\tpreventBlurCheck.current = false;\n\t\t} else if ( isFocusNormalizedButton( target ) ) {\n\t\t\tpreventBlurCheck.current = true;\n\t\t}\n\t}, [] );\n\n\t/**\n\t * A callback triggered when a blur event occurs on the element the handler\n\t * is bound to.\n\t *\n\t * Calls the `onFocusOutside` callback in an immediate timeout if focus has\n\t * move outside the bound element and is still within the document.\n\t *\n\t * @param {SyntheticEvent} event Blur event.\n\t */\n\tconst queueBlurCheck = useCallback( ( event ) => {\n\t\t// React does not allow using an event reference asynchronously\n\t\t// due to recycling behavior, except when explicitly persisted.\n\t\tevent.persist();\n\n\t\t// Skip blur check if clicking button. See `normalizeButtonFocus`.\n\t\tif ( preventBlurCheck.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblurCheckTimeoutId.current = setTimeout( () => {\n\t\t\tif ( 'function' === typeof currentOnFocusOutside.current ) {\n\t\t\t\tcurrentOnFocusOutside.current( event );\n\t\t\t}\n\t\t}, 0 );\n\t}, [] );\n\n\treturn {\n\t\tonFocus: cancelBlurCheck,\n\t\tonMouseDown: normalizeButtonFocus,\n\t\tonMouseUp: normalizeButtonFocus,\n\t\tonTouchStart: normalizeButtonFocus,\n\t\tonTouchEnd: normalizeButtonFocus,\n\t\tonBlur: queueBlurCheck,\n\t};\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- const useKeyboardShortcut = () => null;
2
- export default useKeyboardShortcut;
3
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useKeyboardShortcut"],"sources":["@wordpress/compose/src/hooks/use-keyboard-shortcut/index.native.js"],"sourcesContent":["const useKeyboardShortcut = () => null;\nexport default useKeyboardShortcut;\n"],"mappings":"AAAA,MAAMA,mBAAmB,GAAGA,CAAA,KAAM,IAAI;AACtC,eAAeA,mBAAmB","ignoreList":[]}
@@ -1,52 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useEffect, useState } from '@wordpress/element';
5
- import { requestConnectionStatus, subscribeConnectionStatus } from '@wordpress/react-native-bridge';
6
-
7
- /**
8
- * @typedef {Object} NetworkInformation
9
- *
10
- * @property {boolean} [isConnected] Whether the device is connected to a network.
11
- */
12
-
13
- /**
14
- * Returns the current network connectivity status provided by the native bridge.
15
- *
16
- * @example
17
- *
18
- * ```jsx
19
- * const { isConnected } = useNetworkConnectivity();
20
- * ```
21
- *
22
- * @return {NetworkInformation} Network information.
23
- */
24
- export default function useNetworkConnectivity() {
25
- const [isConnected, setIsConnected] = useState(true);
26
- useEffect(() => {
27
- let isCurrent = true;
28
- requestConnectionStatus(isBridgeConnected => {
29
- if (!isCurrent) {
30
- return;
31
- }
32
- setIsConnected(isBridgeConnected);
33
- });
34
- return () => {
35
- isCurrent = false;
36
- };
37
- }, []);
38
- useEffect(() => {
39
- const subscription = subscribeConnectionStatus(({
40
- isConnected: isBridgeConnected
41
- }) => {
42
- setIsConnected(isBridgeConnected);
43
- });
44
- return () => {
45
- subscription.remove();
46
- };
47
- }, []);
48
- return {
49
- isConnected
50
- };
51
- }
52
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useState","requestConnectionStatus","subscribeConnectionStatus","useNetworkConnectivity","isConnected","setIsConnected","isCurrent","isBridgeConnected","subscription","remove"],"sources":["@wordpress/compose/src/hooks/use-network-connectivity/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport {\n\trequestConnectionStatus,\n\tsubscribeConnectionStatus,\n} from '@wordpress/react-native-bridge';\n\n/**\n * @typedef {Object} NetworkInformation\n *\n * @property {boolean} [isConnected] Whether the device is connected to a network.\n */\n\n/**\n * Returns the current network connectivity status provided by the native bridge.\n *\n * @example\n *\n * ```jsx\n * const { isConnected } = useNetworkConnectivity();\n * ```\n *\n * @return {NetworkInformation} Network information.\n */\nexport default function useNetworkConnectivity() {\n\tconst [ isConnected, setIsConnected ] = useState( true );\n\n\tuseEffect( () => {\n\t\tlet isCurrent = true;\n\n\t\trequestConnectionStatus( ( isBridgeConnected ) => {\n\t\t\tif ( ! isCurrent ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetIsConnected( isBridgeConnected );\n\t\t} );\n\n\t\treturn () => {\n\t\t\tisCurrent = false;\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tconst subscription = subscribeConnectionStatus(\n\t\t\t( { isConnected: isBridgeConnected } ) => {\n\t\t\t\tsetIsConnected( isBridgeConnected );\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tsubscription.remove();\n\t\t};\n\t}, [] );\n\n\treturn { isConnected };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACxD,SACCC,uBAAuB,EACvBC,yBAAyB,QACnB,gCAAgC;;AAEvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAA,EAAG;EAChD,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGL,QAAQ,CAAE,IAAK,CAAC;EAExDD,SAAS,CAAE,MAAM;IAChB,IAAIO,SAAS,GAAG,IAAI;IAEpBL,uBAAuB,CAAIM,iBAAiB,IAAM;MACjD,IAAK,CAAED,SAAS,EAAG;QAClB;MACD;MAEAD,cAAc,CAAEE,iBAAkB,CAAC;IACpC,CAAE,CAAC;IAEH,OAAO,MAAM;MACZD,SAAS,GAAG,KAAK;IAClB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEPP,SAAS,CAAE,MAAM;IAChB,MAAMS,YAAY,GAAGN,yBAAyB,CAC7C,CAAE;MAAEE,WAAW,EAAEG;IAAkB,CAAC,KAAM;MACzCF,cAAc,CAAEE,iBAAkB,CAAC;IACpC,CACD,CAAC;IAED,OAAO,MAAM;MACZC,YAAY,CAACC,MAAM,CAAC,CAAC;IACtB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OAAO;IAAEL;EAAY,CAAC;AACvB","ignoreList":[]}
@@ -1,35 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import usePreferredColorScheme from '../use-preferred-color-scheme';
5
-
6
- /**
7
- * Selects which of the passed style objects should be applied depending on the
8
- * user's preferred color scheme.
9
- *
10
- * The "light" color schemed is assumed to be the default, and its styles are
11
- * always applied. The "dark" styles will always extend those defined for the
12
- * light case.
13
- *
14
- * @example
15
- * const light = { padding: 10, backgroundColor: 'white' };
16
- * const dark = { backgroundColor: 'black' };
17
- * usePreferredColorSchemeStyle( light, dark);
18
- * // On light mode:
19
- * // => { padding: 10, backgroundColor: 'white' }
20
- * // On dark mode:
21
- * // => { padding: 10, backgroundColor: 'black' }
22
- * @param {Object} lightStyle
23
- * @param {Object} darkStyle
24
- * @return {Object} the combined styles depending on the current color scheme
25
- */
26
- const usePreferredColorSchemeStyle = (lightStyle, darkStyle) => {
27
- const colorScheme = usePreferredColorScheme();
28
- const isDarkMode = colorScheme === 'dark';
29
- return isDarkMode ? {
30
- ...lightStyle,
31
- ...darkStyle
32
- } : lightStyle;
33
- };
34
- export default usePreferredColorSchemeStyle;
35
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["usePreferredColorScheme","usePreferredColorSchemeStyle","lightStyle","darkStyle","colorScheme","isDarkMode"],"sources":["@wordpress/compose/src/hooks/use-preferred-color-scheme-style/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport usePreferredColorScheme from '../use-preferred-color-scheme';\n\n/**\n * Selects which of the passed style objects should be applied depending on the\n * user's preferred color scheme.\n *\n * The \"light\" color schemed is assumed to be the default, and its styles are\n * always applied. The \"dark\" styles will always extend those defined for the\n * light case.\n *\n * @example\n * const light = { padding: 10, backgroundColor: 'white' };\n * const dark = { backgroundColor: 'black' };\n * usePreferredColorSchemeStyle( light, dark);\n * // On light mode:\n * // => { padding: 10, backgroundColor: 'white' }\n * // On dark mode:\n * // => { padding: 10, backgroundColor: 'black' }\n * @param {Object} lightStyle\n * @param {Object} darkStyle\n * @return {Object} the combined styles depending on the current color scheme\n */\nconst usePreferredColorSchemeStyle = ( lightStyle, darkStyle ) => {\n\tconst colorScheme = usePreferredColorScheme();\n\tconst isDarkMode = colorScheme === 'dark';\n\n\treturn isDarkMode ? { ...lightStyle, ...darkStyle } : lightStyle;\n};\n\nexport default usePreferredColorSchemeStyle;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,uBAAuB,MAAM,+BAA+B;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,4BAA4B,GAAGA,CAAEC,UAAU,EAAEC,SAAS,KAAM;EACjE,MAAMC,WAAW,GAAGJ,uBAAuB,CAAC,CAAC;EAC7C,MAAMK,UAAU,GAAGD,WAAW,KAAK,MAAM;EAEzC,OAAOC,UAAU,GAAG;IAAE,GAAGH,UAAU;IAAE,GAAGC;EAAU,CAAC,GAAGD,UAAU;AACjE,CAAC;AAED,eAAeD,4BAA4B","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export { default } from './legacy/index.native';
2
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["default"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/index.native.js"],"sourcesContent":["export { default } from './legacy/index.native';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,uBAAuB","ignoreList":[]}
@@ -1,56 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { View, StyleSheet } from 'react-native';
5
- /**
6
- * WordPress dependencies
7
- */
8
- import { useState, useCallback } from '@wordpress/element';
9
-
10
- /**
11
- * Hook which allows to listen the resize event of any target element when it changes sizes.
12
- *
13
- * @example
14
- *
15
- * ```js
16
- * const App = () => {
17
- * const [ resizeListener, sizes ] = useResizeObserver();
18
- *
19
- * return (
20
- * <View>
21
- * { resizeListener }
22
- * Your content here
23
- * </View>
24
- * );
25
- * };
26
- * ```
27
- */
28
- import { jsx as _jsx } from "react/jsx-runtime";
29
- const useResizeObserver = () => {
30
- const [measurements, setMeasurements] = useState(null);
31
- const onLayout = useCallback(({
32
- nativeEvent
33
- }) => {
34
- const {
35
- width,
36
- height
37
- } = nativeEvent.layout;
38
- setMeasurements(prevState => {
39
- if (!prevState || prevState.width !== width || prevState.height !== height) {
40
- return {
41
- width: Math.floor(width),
42
- height: Math.floor(height)
43
- };
44
- }
45
- return prevState;
46
- });
47
- }, []);
48
- const observer = /*#__PURE__*/_jsx(View, {
49
- testID: "resize-observer",
50
- style: StyleSheet.absoluteFill,
51
- onLayout: onLayout
52
- });
53
- return [observer, measurements];
54
- };
55
- export default useResizeObserver;
56
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["View","StyleSheet","useState","useCallback","jsx","_jsx","useResizeObserver","measurements","setMeasurements","onLayout","nativeEvent","width","height","layout","prevState","Math","floor","observer","testID","style","absoluteFill"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/legacy/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, StyleSheet } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Hook which allows to listen the resize event of any target element when it changes sizes.\n *\n * @example\n *\n * ```js\n * const App = () => {\n * \tconst [ resizeListener, sizes ] = useResizeObserver();\n *\n * \treturn (\n * \t\t<View>\n * \t\t\t{ resizeListener }\n * \t\t\tYour content here\n * \t\t</View>\n * \t);\n * };\n * ```\n */\nconst useResizeObserver = () => {\n\tconst [ measurements, setMeasurements ] = useState( null );\n\n\tconst onLayout = useCallback( ( { nativeEvent } ) => {\n\t\tconst { width, height } = nativeEvent.layout;\n\t\tsetMeasurements( ( prevState ) => {\n\t\t\tif (\n\t\t\t\t! prevState ||\n\t\t\t\tprevState.width !== width ||\n\t\t\t\tprevState.height !== height\n\t\t\t) {\n\t\t\t\treturn {\n\t\t\t\t\twidth: Math.floor( width ),\n\t\t\t\t\theight: Math.floor( height ),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn prevState;\n\t\t} );\n\t}, [] );\n\n\tconst observer = (\n\t\t<View\n\t\t\ttestID=\"resize-observer\"\n\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\tonLayout={ onLayout }\n\t\t/>\n\t);\n\n\treturn [ observer, measurements ];\n};\n\nexport default useResizeObserver;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBA,SAAAC,GAAA,IAAAC,IAAA;AAkBA,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGN,QAAQ,CAAE,IAAK,CAAC;EAE1D,MAAMO,QAAQ,GAAGN,WAAW,CAAE,CAAE;IAAEO;EAAY,CAAC,KAAM;IACpD,MAAM;MAAEC,KAAK;MAAEC;IAAO,CAAC,GAAGF,WAAW,CAACG,MAAM;IAC5CL,eAAe,CAAIM,SAAS,IAAM;MACjC,IACC,CAAEA,SAAS,IACXA,SAAS,CAACH,KAAK,KAAKA,KAAK,IACzBG,SAAS,CAACF,MAAM,KAAKA,MAAM,EAC1B;QACD,OAAO;UACND,KAAK,EAAEI,IAAI,CAACC,KAAK,CAAEL,KAAM,CAAC;UAC1BC,MAAM,EAAEG,IAAI,CAACC,KAAK,CAAEJ,MAAO;QAC5B,CAAC;MACF;MACA,OAAOE,SAAS;IACjB,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMG,QAAQ,gBACbZ,IAAA,CAACL,IAAI;IACJkB,MAAM,EAAC,iBAAiB;IACxBC,KAAK,EAAGlB,UAAU,CAACmB,YAAc;IACjCX,QAAQ,EAAGA;EAAU,CACrB,CACD;EAED,OAAO,CAAEQ,QAAQ,EAAEV,YAAY,CAAE;AAClC,CAAC;AAED,eAAeD,iBAAiB","ignoreList":[]}
@@ -1,45 +0,0 @@
1
- // The `createHigherOrderComponent` helper and helper types.
2
- export * from './utils/create-higher-order-component';
3
- // The `debounce` helper and its types.
4
- export * from './utils/debounce';
5
- // The `throttle` helper and its types.
6
- export * from './utils/throttle';
7
- // The `ObservableMap` data structure
8
- export * from './utils/observable-map';
9
-
10
- // The `compose` and `pipe` helpers (inspired by `flowRight` and `flow` from Lodash).
11
- export { default as compose } from './higher-order/compose';
12
- export { default as pipe } from './higher-order/pipe';
13
-
14
- // Higher-order components.
15
- export { default as ifCondition } from './higher-order/if-condition';
16
- export { default as pure } from './higher-order/pure';
17
- export { default as withGlobalEvents } from './higher-order/with-global-events';
18
- export { default as withInstanceId } from './higher-order/with-instance-id';
19
- export { default as withSafeTimeout } from './higher-order/with-safe-timeout';
20
- export { default as withState } from './higher-order/with-state';
21
- export { default as withPreferredColorScheme } from './higher-order/with-preferred-color-scheme';
22
- export { default as withNetworkConnectivity } from './higher-order/with-network-connectivity';
23
-
24
- // Hooks.
25
- export { default as useConstrainedTabbing } from './hooks/use-constrained-tabbing';
26
- export { default as __experimentalUseDragging } from './hooks/use-dragging';
27
- export { default as __experimentalUseFocusOutside } from './hooks/use-focus-outside';
28
- export { default as useInstanceId } from './hooks/use-instance-id';
29
- export { default as useIsomorphicLayoutEffect } from './hooks/use-isomorphic-layout-effect';
30
- export { default as useKeyboardShortcut } from './hooks/use-keyboard-shortcut';
31
- export { default as useMediaQuery } from './hooks/use-media-query';
32
- export { default as usePrevious } from './hooks/use-previous';
33
- export { default as useReducedMotion } from './hooks/use-reduced-motion';
34
- export { default as useViewportMatch } from './hooks/use-viewport-match';
35
- export { default as usePreferredColorScheme } from './hooks/use-preferred-color-scheme';
36
- export { default as usePreferredColorSchemeStyle } from './hooks/use-preferred-color-scheme-style';
37
- export { default as useResizeObserver } from './hooks/use-resize-observer';
38
- export { default as useDebounce } from './hooks/use-debounce';
39
- export { default as useDebouncedInput } from './hooks/use-debounced-input';
40
- export { default as useThrottle } from './hooks/use-throttle';
41
- export { default as useMergeRefs } from './hooks/use-merge-refs';
42
- export { default as useRefEffect } from './hooks/use-ref-effect';
43
- export { default as useNetworkConnectivity } from './hooks/use-network-connectivity';
44
- export { default as useObservableValue } from './hooks/use-observable-value';
45
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["default","compose","pipe","ifCondition","pure","withGlobalEvents","withInstanceId","withSafeTimeout","withState","withPreferredColorScheme","withNetworkConnectivity","useConstrainedTabbing","__experimentalUseDragging","__experimentalUseFocusOutside","useInstanceId","useIsomorphicLayoutEffect","useKeyboardShortcut","useMediaQuery","usePrevious","useReducedMotion","useViewportMatch","usePreferredColorScheme","usePreferredColorSchemeStyle","useResizeObserver","useDebounce","useDebouncedInput","useThrottle","useMergeRefs","useRefEffect","useNetworkConnectivity","useObservableValue"],"sources":["@wordpress/compose/src/index.native.js"],"sourcesContent":["// The `createHigherOrderComponent` helper and helper types.\nexport * from './utils/create-higher-order-component';\n// The `debounce` helper and its types.\nexport * from './utils/debounce';\n// The `throttle` helper and its types.\nexport * from './utils/throttle';\n// The `ObservableMap` data structure\nexport * from './utils/observable-map';\n\n// The `compose` and `pipe` helpers (inspired by `flowRight` and `flow` from Lodash).\nexport { default as compose } from './higher-order/compose';\nexport { default as pipe } from './higher-order/pipe';\n\n// Higher-order components.\nexport { default as ifCondition } from './higher-order/if-condition';\nexport { default as pure } from './higher-order/pure';\nexport { default as withGlobalEvents } from './higher-order/with-global-events';\nexport { default as withInstanceId } from './higher-order/with-instance-id';\nexport { default as withSafeTimeout } from './higher-order/with-safe-timeout';\nexport { default as withState } from './higher-order/with-state';\nexport { default as withPreferredColorScheme } from './higher-order/with-preferred-color-scheme';\nexport { default as withNetworkConnectivity } from './higher-order/with-network-connectivity';\n\n// Hooks.\nexport { default as useConstrainedTabbing } from './hooks/use-constrained-tabbing';\nexport { default as __experimentalUseDragging } from './hooks/use-dragging';\nexport { default as __experimentalUseFocusOutside } from './hooks/use-focus-outside';\nexport { default as useInstanceId } from './hooks/use-instance-id';\nexport { default as useIsomorphicLayoutEffect } from './hooks/use-isomorphic-layout-effect';\nexport { default as useKeyboardShortcut } from './hooks/use-keyboard-shortcut';\nexport { default as useMediaQuery } from './hooks/use-media-query';\nexport { default as usePrevious } from './hooks/use-previous';\nexport { default as useReducedMotion } from './hooks/use-reduced-motion';\nexport { default as useViewportMatch } from './hooks/use-viewport-match';\nexport { default as usePreferredColorScheme } from './hooks/use-preferred-color-scheme';\nexport { default as usePreferredColorSchemeStyle } from './hooks/use-preferred-color-scheme-style';\nexport { default as useResizeObserver } from './hooks/use-resize-observer';\nexport { default as useDebounce } from './hooks/use-debounce';\nexport { default as useDebouncedInput } from './hooks/use-debounced-input';\nexport { default as useThrottle } from './hooks/use-throttle';\nexport { default as useMergeRefs } from './hooks/use-merge-refs';\nexport { default as useRefEffect } from './hooks/use-ref-effect';\nexport { default as useNetworkConnectivity } from './hooks/use-network-connectivity';\nexport { default as useObservableValue } from './hooks/use-observable-value';\n"],"mappings":"AAAA;AACA,cAAc,uCAAuC;AACrD;AACA,cAAc,kBAAkB;AAChC;AACA,cAAc,kBAAkB;AAChC;AACA,cAAc,wBAAwB;;AAEtC;AACA,SAASA,OAAO,IAAIC,OAAO,QAAQ,wBAAwB;AAC3D,SAASD,OAAO,IAAIE,IAAI,QAAQ,qBAAqB;;AAErD;AACA,SAASF,OAAO,IAAIG,WAAW,QAAQ,6BAA6B;AACpE,SAASH,OAAO,IAAII,IAAI,QAAQ,qBAAqB;AACrD,SAASJ,OAAO,IAAIK,gBAAgB,QAAQ,mCAAmC;AAC/E,SAASL,OAAO,IAAIM,cAAc,QAAQ,iCAAiC;AAC3E,SAASN,OAAO,IAAIO,eAAe,QAAQ,kCAAkC;AAC7E,SAASP,OAAO,IAAIQ,SAAS,QAAQ,2BAA2B;AAChE,SAASR,OAAO,IAAIS,wBAAwB,QAAQ,4CAA4C;AAChG,SAAST,OAAO,IAAIU,uBAAuB,QAAQ,0CAA0C;;AAE7F;AACA,SAASV,OAAO,IAAIW,qBAAqB,QAAQ,iCAAiC;AAClF,SAASX,OAAO,IAAIY,yBAAyB,QAAQ,sBAAsB;AAC3E,SAASZ,OAAO,IAAIa,6BAA6B,QAAQ,2BAA2B;AACpF,SAASb,OAAO,IAAIc,aAAa,QAAQ,yBAAyB;AAClE,SAASd,OAAO,IAAIe,yBAAyB,QAAQ,sCAAsC;AAC3F,SAASf,OAAO,IAAIgB,mBAAmB,QAAQ,+BAA+B;AAC9E,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,yBAAyB;AAClE,SAASjB,OAAO,IAAIkB,WAAW,QAAQ,sBAAsB;AAC7D,SAASlB,OAAO,IAAImB,gBAAgB,QAAQ,4BAA4B;AACxE,SAASnB,OAAO,IAAIoB,gBAAgB,QAAQ,4BAA4B;AACxE,SAASpB,OAAO,IAAIqB,uBAAuB,QAAQ,oCAAoC;AACvF,SAASrB,OAAO,IAAIsB,4BAA4B,QAAQ,0CAA0C;AAClG,SAAStB,OAAO,IAAIuB,iBAAiB,QAAQ,6BAA6B;AAC1E,SAASvB,OAAO,IAAIwB,WAAW,QAAQ,sBAAsB;AAC7D,SAASxB,OAAO,IAAIyB,iBAAiB,QAAQ,6BAA6B;AAC1E,SAASzB,OAAO,IAAI0B,WAAW,QAAQ,sBAAsB;AAC7D,SAAS1B,OAAO,IAAI2B,YAAY,QAAQ,wBAAwB;AAChE,SAAS3B,OAAO,IAAI4B,YAAY,QAAQ,wBAAwB;AAChE,SAAS5B,OAAO,IAAI6B,sBAAsB,QAAQ,kCAAkC;AACpF,SAAS7B,OAAO,IAAI8B,kBAAkB,QAAQ,8BAA8B","ignoreList":[]}