@wordpress/compose 6.16.0 → 6.17.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 (207) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/higher-order/compose.js +0 -2
  3. package/build/higher-order/compose.js.map +1 -1
  4. package/build/higher-order/if-condition/index.js +2 -6
  5. package/build/higher-order/if-condition/index.js.map +1 -1
  6. package/build/higher-order/pipe.js +1 -5
  7. package/build/higher-order/pipe.js.map +1 -1
  8. package/build/higher-order/pure/index.js +2 -10
  9. package/build/higher-order/pure/index.js.map +1 -1
  10. package/build/higher-order/with-global-events/index.js +13 -32
  11. package/build/higher-order/with-global-events/index.js.map +1 -1
  12. package/build/higher-order/with-global-events/listener.js +5 -28
  13. package/build/higher-order/with-global-events/listener.js.map +1 -1
  14. package/build/higher-order/with-instance-id/index.js +4 -8
  15. package/build/higher-order/with-instance-id/index.js.map +1 -1
  16. package/build/higher-order/with-preferred-color-scheme/index.native.js +3 -6
  17. package/build/higher-order/with-preferred-color-scheme/index.native.js.map +1 -1
  18. package/build/higher-order/with-safe-timeout/index.js +4 -14
  19. package/build/higher-order/with-safe-timeout/index.js.map +1 -1
  20. package/build/higher-order/with-state/index.js +3 -11
  21. package/build/higher-order/with-state/index.js.map +1 -1
  22. package/build/hooks/use-async-list/index.js +1 -14
  23. package/build/hooks/use-async-list/index.js.map +1 -1
  24. package/build/hooks/use-constrained-tabbing/index.js +14 -30
  25. package/build/hooks/use-constrained-tabbing/index.js.map +1 -1
  26. package/build/hooks/use-constrained-tabbing/index.native.js +4 -4
  27. package/build/hooks/use-constrained-tabbing/index.native.js.map +1 -1
  28. package/build/hooks/use-copy-on-click/index.js +6 -15
  29. package/build/hooks/use-copy-on-click/index.js.map +1 -1
  30. package/build/hooks/use-copy-to-clipboard/index.js +3 -11
  31. package/build/hooks/use-copy-to-clipboard/index.js.map +1 -1
  32. package/build/hooks/use-debounce/index.js +0 -4
  33. package/build/hooks/use-debounce/index.js.map +1 -1
  34. package/build/hooks/use-dialog/index.js +2 -12
  35. package/build/hooks/use-dialog/index.js.map +1 -1
  36. package/build/hooks/use-disabled/index.js +5 -15
  37. package/build/hooks/use-disabled/index.js.map +1 -1
  38. package/build/hooks/use-dragging/index.js +4 -11
  39. package/build/hooks/use-dragging/index.js.map +1 -1
  40. package/build/hooks/use-drop-zone/index.js +27 -66
  41. package/build/hooks/use-drop-zone/index.js.map +1 -1
  42. package/build/hooks/use-fixed-window-list/index.js +8 -34
  43. package/build/hooks/use-fixed-window-list/index.js.map +1 -1
  44. package/build/hooks/use-focus-on-mount/index.js +3 -14
  45. package/build/hooks/use-focus-on-mount/index.js.map +1 -1
  46. package/build/hooks/use-focus-outside/index.js +13 -19
  47. package/build/hooks/use-focus-outside/index.js.map +1 -1
  48. package/build/hooks/use-focus-outside/index.native.js +13 -21
  49. package/build/hooks/use-focus-outside/index.native.js.map +1 -1
  50. package/build/hooks/use-focus-return/index.js +7 -15
  51. package/build/hooks/use-focus-return/index.js.map +1 -1
  52. package/build/hooks/use-focusable-iframe/index.js +1 -5
  53. package/build/hooks/use-focusable-iframe/index.js.map +1 -1
  54. package/build/hooks/use-instance-id/index.js +3 -5
  55. package/build/hooks/use-instance-id/index.js.map +1 -1
  56. package/build/hooks/use-isomorphic-layout-effect/index.js +0 -2
  57. package/build/hooks/use-isomorphic-layout-effect/index.js.map +1 -1
  58. package/build/hooks/use-keyboard-shortcut/index.js +12 -28
  59. package/build/hooks/use-keyboard-shortcut/index.js.map +1 -1
  60. package/build/hooks/use-keyboard-shortcut/index.native.js +0 -2
  61. package/build/hooks/use-keyboard-shortcut/index.native.js.map +1 -1
  62. package/build/hooks/use-media-query/index.js +1 -9
  63. package/build/hooks/use-media-query/index.js.map +1 -1
  64. package/build/hooks/use-merge-refs/index.js +18 -24
  65. package/build/hooks/use-merge-refs/index.js.map +1 -1
  66. package/build/hooks/use-preferred-color-scheme/index.android.js +0 -5
  67. package/build/hooks/use-preferred-color-scheme/index.android.js.map +1 -1
  68. package/build/hooks/use-preferred-color-scheme/index.ios.js +0 -2
  69. package/build/hooks/use-preferred-color-scheme/index.ios.js.map +1 -1
  70. package/build/hooks/use-preferred-color-scheme-style/index.native.js +2 -5
  71. package/build/hooks/use-preferred-color-scheme-style/index.native.js.map +1 -1
  72. package/build/hooks/use-previous/index.js +3 -4
  73. package/build/hooks/use-previous/index.js.map +1 -1
  74. package/build/hooks/use-reduced-motion/index.js +0 -4
  75. package/build/hooks/use-reduced-motion/index.js.map +1 -1
  76. package/build/hooks/use-ref-effect/index.js +0 -2
  77. package/build/hooks/use-ref-effect/index.js.map +1 -1
  78. package/build/hooks/use-resize-observer/index.js +23 -30
  79. package/build/hooks/use-resize-observer/index.js.map +1 -1
  80. package/build/hooks/use-resize-observer/index.native.js +0 -6
  81. package/build/hooks/use-resize-observer/index.native.js.map +1 -1
  82. package/build/hooks/use-throttle/index.js +0 -4
  83. package/build/hooks/use-throttle/index.js.map +1 -1
  84. package/build/hooks/use-viewport-match/index.js +4 -13
  85. package/build/hooks/use-viewport-match/index.js.map +1 -1
  86. package/build/hooks/use-warn-on-change/index.js +4 -14
  87. package/build/hooks/use-warn-on-change/index.js.map +1 -1
  88. package/build/index.js +0 -41
  89. package/build/index.js.map +1 -1
  90. package/build/index.native.js +0 -33
  91. package/build/index.native.js.map +1 -1
  92. package/build/utils/create-higher-order-component/index.js +1 -4
  93. package/build/utils/create-higher-order-component/index.js.map +1 -1
  94. package/build/utils/debounce/index.js +12 -37
  95. package/build/utils/debounce/index.js.map +1 -1
  96. package/build/utils/throttle/index.js +0 -5
  97. package/build/utils/throttle/index.js.map +1 -1
  98. package/build-module/higher-order/compose.js +1 -1
  99. package/build-module/higher-order/compose.js.map +1 -1
  100. package/build-module/higher-order/if-condition/index.js +3 -5
  101. package/build-module/higher-order/if-condition/index.js.map +1 -1
  102. package/build-module/higher-order/pipe.js +1 -4
  103. package/build-module/higher-order/pipe.js.map +1 -1
  104. package/build-module/higher-order/pure/index.js +4 -8
  105. package/build-module/higher-order/pure/index.js.map +1 -1
  106. package/build-module/higher-order/with-global-events/index.js +15 -29
  107. package/build-module/higher-order/with-global-events/index.js.map +1 -1
  108. package/build-module/higher-order/with-global-events/listener.js +5 -27
  109. package/build-module/higher-order/with-global-events/listener.js.map +1 -1
  110. package/build-module/higher-order/with-instance-id/index.js +5 -5
  111. package/build-module/higher-order/with-instance-id/index.js.map +1 -1
  112. package/build-module/higher-order/with-preferred-color-scheme/index.native.js +3 -3
  113. package/build-module/higher-order/with-preferred-color-scheme/index.native.js.map +1 -1
  114. package/build-module/higher-order/with-safe-timeout/index.js +6 -8
  115. package/build-module/higher-order/with-safe-timeout/index.js.map +1 -1
  116. package/build-module/higher-order/with-state/index.js +5 -9
  117. package/build-module/higher-order/with-state/index.js.map +1 -1
  118. package/build-module/hooks/use-async-list/index.js +1 -12
  119. package/build-module/hooks/use-async-list/index.js.map +1 -1
  120. package/build-module/hooks/use-constrained-tabbing/index.js +16 -27
  121. package/build-module/hooks/use-constrained-tabbing/index.js.map +1 -1
  122. package/build-module/hooks/use-constrained-tabbing/index.native.js +3 -3
  123. package/build-module/hooks/use-constrained-tabbing/index.native.js.map +1 -1
  124. package/build-module/hooks/use-copy-on-click/index.js +8 -12
  125. package/build-module/hooks/use-copy-on-click/index.js.map +1 -1
  126. package/build-module/hooks/use-copy-to-clipboard/index.js +6 -9
  127. package/build-module/hooks/use-copy-to-clipboard/index.js.map +1 -1
  128. package/build-module/hooks/use-debounce/index.js +3 -3
  129. package/build-module/hooks/use-debounce/index.js.map +1 -1
  130. package/build-module/hooks/use-dialog/index.js +3 -5
  131. package/build-module/hooks/use-dialog/index.js.map +1 -1
  132. package/build-module/hooks/use-disabled/index.js +6 -12
  133. package/build-module/hooks/use-disabled/index.js.map +1 -1
  134. package/build-module/hooks/use-dragging/index.js +6 -9
  135. package/build-module/hooks/use-dragging/index.js.map +1 -1
  136. package/build-module/hooks/use-drop-zone/index.js +29 -64
  137. package/build-module/hooks/use-drop-zone/index.js.map +1 -1
  138. package/build-module/hooks/use-fixed-window-list/index.js +8 -30
  139. package/build-module/hooks/use-fixed-window-list/index.js.map +1 -1
  140. package/build-module/hooks/use-focus-on-mount/index.js +4 -12
  141. package/build-module/hooks/use-focus-on-mount/index.js.map +1 -1
  142. package/build-module/hooks/use-focus-outside/index.js +14 -18
  143. package/build-module/hooks/use-focus-outside/index.js.map +1 -1
  144. package/build-module/hooks/use-focus-outside/index.native.js +14 -20
  145. package/build-module/hooks/use-focus-outside/index.native.js.map +1 -1
  146. package/build-module/hooks/use-focus-return/index.js +8 -14
  147. package/build-module/hooks/use-focus-return/index.js.map +1 -1
  148. package/build-module/hooks/use-focusable-iframe/index.js +2 -3
  149. package/build-module/hooks/use-focusable-iframe/index.js.map +1 -1
  150. package/build-module/hooks/use-instance-id/index.js +2 -3
  151. package/build-module/hooks/use-instance-id/index.js.map +1 -1
  152. package/build-module/hooks/use-isomorphic-layout-effect/index.js +1 -1
  153. package/build-module/hooks/use-isomorphic-layout-effect/index.js.map +1 -1
  154. package/build-module/hooks/use-keyboard-shortcut/index.js +14 -24
  155. package/build-module/hooks/use-keyboard-shortcut/index.js.map +1 -1
  156. package/build-module/hooks/use-keyboard-shortcut/index.native.js +0 -1
  157. package/build-module/hooks/use-keyboard-shortcut/index.native.js.map +1 -1
  158. package/build-module/hooks/use-media-query/index.js +2 -8
  159. package/build-module/hooks/use-media-query/index.js.map +1 -1
  160. package/build-module/hooks/use-merge-refs/index.js +19 -23
  161. package/build-module/hooks/use-merge-refs/index.js.map +1 -1
  162. package/build-module/hooks/use-preferred-color-scheme/index.android.js +1 -3
  163. package/build-module/hooks/use-preferred-color-scheme/index.android.js.map +1 -1
  164. package/build-module/hooks/use-preferred-color-scheme/index.ios.js +1 -1
  165. package/build-module/hooks/use-preferred-color-scheme/index.ios.js.map +1 -1
  166. package/build-module/hooks/use-preferred-color-scheme-style/index.native.js +3 -3
  167. package/build-module/hooks/use-preferred-color-scheme-style/index.native.js.map +1 -1
  168. package/build-module/hooks/use-previous/index.js +4 -3
  169. package/build-module/hooks/use-previous/index.js.map +1 -1
  170. package/build-module/hooks/use-reduced-motion/index.js +1 -2
  171. package/build-module/hooks/use-reduced-motion/index.js.map +1 -1
  172. package/build-module/hooks/use-ref-effect/index.js +1 -1
  173. package/build-module/hooks/use-ref-effect/index.js.map +1 -1
  174. package/build-module/hooks/use-resize-observer/index.js +22 -30
  175. package/build-module/hooks/use-resize-observer/index.js.map +1 -1
  176. package/build-module/hooks/use-resize-observer/index.native.js +1 -6
  177. package/build-module/hooks/use-resize-observer/index.native.js.map +1 -1
  178. package/build-module/hooks/use-throttle/index.js +3 -3
  179. package/build-module/hooks/use-throttle/index.js.map +1 -1
  180. package/build-module/hooks/use-viewport-match/index.js +6 -11
  181. package/build-module/hooks/use-viewport-match/index.js.map +1 -1
  182. package/build-module/hooks/use-warn-on-change/index.js +6 -12
  183. package/build-module/hooks/use-warn-on-change/index.js.map +1 -1
  184. package/build-module/index.js +10 -7
  185. package/build-module/index.js.map +1 -1
  186. package/build-module/index.native.js +10 -7
  187. package/build-module/index.native.js.map +1 -1
  188. package/build-module/utils/create-higher-order-component/index.js +1 -2
  189. package/build-module/utils/create-higher-order-component/index.js.map +1 -1
  190. package/build-module/utils/debounce/index.js +12 -35
  191. package/build-module/utils/debounce/index.js.map +1 -1
  192. package/build-module/utils/throttle/index.js +0 -3
  193. package/build-module/utils/throttle/index.js.map +1 -1
  194. package/build-types/higher-order/with-instance-id/index.d.ts +1 -1
  195. package/build-types/higher-order/with-instance-id/index.d.ts.map +1 -1
  196. package/build-types/higher-order/with-safe-timeout/index.d.ts +1 -1
  197. package/build-types/higher-order/with-safe-timeout/index.d.ts.map +1 -1
  198. package/build-types/hooks/use-disabled/index.d.ts +1 -1
  199. package/build-types/hooks/use-disabled/index.d.ts.map +1 -1
  200. package/build-types/hooks/use-isomorphic-layout-effect/index.d.ts +1 -1
  201. package/build-types/hooks/use-isomorphic-layout-effect/index.d.ts.map +1 -1
  202. package/build-types/hooks/use-viewport-match/index.d.ts +1 -1
  203. package/package.json +8 -8
  204. package/src/higher-order/with-instance-id/index.tsx +2 -2
  205. package/src/higher-order/with-safe-timeout/index.tsx +2 -2
  206. package/src/hooks/use-resize-observer/index.native.js +0 -1
  207. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/index.native.js"],"names":["default","compose","pipe","ifCondition","pure","withGlobalEvents","withInstanceId","withSafeTimeout","withState","withPreferredColorScheme","useConstrainedTabbing","__experimentalUseDragging","__experimentalUseFocusOutside","useInstanceId","useIsomorphicLayoutEffect","useKeyboardShortcut","useMediaQuery","usePrevious","useReducedMotion","useViewportMatch","usePreferredColorScheme","usePreferredColorSchemeStyle","useResizeObserver","useDebounce","useThrottle","useMergeRefs","useRefEffect"],"mappings":"AAAA;AACA,cAAc,uCAAd,C,CACA;;AACA,cAAc,kBAAd,C,CACA;;AACA,cAAc,kBAAd,C,CAEA;;AACA,SAASA,OAAO,IAAIC,OAApB,QAAmC,wBAAnC;AACA,SAASD,OAAO,IAAIE,IAApB,QAAgC,qBAAhC,C,CAEA;;AACA,SAASF,OAAO,IAAIG,WAApB,QAAuC,6BAAvC;AACA,SAASH,OAAO,IAAII,IAApB,QAAgC,qBAAhC;AACA,SAASJ,OAAO,IAAIK,gBAApB,QAA4C,mCAA5C;AACA,SAASL,OAAO,IAAIM,cAApB,QAA0C,iCAA1C;AACA,SAASN,OAAO,IAAIO,eAApB,QAA2C,kCAA3C;AACA,SAASP,OAAO,IAAIQ,SAApB,QAAqC,2BAArC;AACA,SAASR,OAAO,IAAIS,wBAApB,QAAoD,4CAApD,C,CAEA;;AACA,SAAST,OAAO,IAAIU,qBAApB,QAAiD,iCAAjD;AACA,SAASV,OAAO,IAAIW,yBAApB,QAAqD,sBAArD;AACA,SAASX,OAAO,IAAIY,6BAApB,QAAyD,2BAAzD;AACA,SAASZ,OAAO,IAAIa,aAApB,QAAyC,yBAAzC;AACA,SAASb,OAAO,IAAIc,yBAApB,QAAqD,sCAArD;AACA,SAASd,OAAO,IAAIe,mBAApB,QAA+C,+BAA/C;AACA,SAASf,OAAO,IAAIgB,aAApB,QAAyC,yBAAzC;AACA,SAAShB,OAAO,IAAIiB,WAApB,QAAuC,sBAAvC;AACA,SAASjB,OAAO,IAAIkB,gBAApB,QAA4C,4BAA5C;AACA,SAASlB,OAAO,IAAImB,gBAApB,QAA4C,4BAA5C;AACA,SAASnB,OAAO,IAAIoB,uBAApB,QAAmD,oCAAnD;AACA,SAASpB,OAAO,IAAIqB,4BAApB,QAAwD,0CAAxD;AACA,SAASrB,OAAO,IAAIsB,iBAApB,QAA6C,6BAA7C;AACA,SAAStB,OAAO,IAAIuB,WAApB,QAAuC,sBAAvC;AACA,SAASvB,OAAO,IAAIwB,WAApB,QAAuC,sBAAvC;AACA,SAASxB,OAAO,IAAIyB,YAApB,QAAwC,wBAAxC;AACA,SAASzB,OAAO,IAAI0B,YAApB,QAAwC,wBAAxC","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\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';\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 useThrottle } from './hooks/use-throttle';\nexport { default as useMergeRefs } from './hooks/use-merge-refs';\nexport { default as useRefEffect } from './hooks/use-ref-effect';\n"]}
1
+ {"version":3,"names":["default","compose","pipe","ifCondition","pure","withGlobalEvents","withInstanceId","withSafeTimeout","withState","withPreferredColorScheme","useConstrainedTabbing","__experimentalUseDragging","__experimentalUseFocusOutside","useInstanceId","useIsomorphicLayoutEffect","useKeyboardShortcut","useMediaQuery","usePrevious","useReducedMotion","useViewportMatch","usePreferredColorScheme","usePreferredColorSchemeStyle","useResizeObserver","useDebounce","useThrottle","useMergeRefs","useRefEffect"],"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\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';\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 useThrottle } from './hooks/use-throttle';\nexport { default as useMergeRefs } from './hooks/use-merge-refs';\nexport { default as useRefEffect } from './hooks/use-ref-effect';\n"],"mappings":"AAAA;AACA,cAAc,uCAAuC;AACrD;AACA,cAAc,kBAAkB;AAChC;AACA,cAAc,kBAAkB;;AAEhC;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;;AAEhG;AACA,SAAST,OAAO,IAAIU,qBAAqB,QAAQ,iCAAiC;AAClF,SAASV,OAAO,IAAIW,yBAAyB,QAAQ,sBAAsB;AAC3E,SAASX,OAAO,IAAIY,6BAA6B,QAAQ,2BAA2B;AACpF,SAASZ,OAAO,IAAIa,aAAa,QAAQ,yBAAyB;AAClE,SAASb,OAAO,IAAIc,yBAAyB,QAAQ,sCAAsC;AAC3F,SAASd,OAAO,IAAIe,mBAAmB,QAAQ,+BAA+B;AAC9E,SAASf,OAAO,IAAIgB,aAAa,QAAQ,yBAAyB;AAClE,SAAShB,OAAO,IAAIiB,WAAW,QAAQ,sBAAsB;AAC7D,SAASjB,OAAO,IAAIkB,gBAAgB,QAAQ,4BAA4B;AACxE,SAASlB,OAAO,IAAImB,gBAAgB,QAAQ,4BAA4B;AACxE,SAASnB,OAAO,IAAIoB,uBAAuB,QAAQ,oCAAoC;AACvF,SAASpB,OAAO,IAAIqB,4BAA4B,QAAQ,0CAA0C;AAClG,SAASrB,OAAO,IAAIsB,iBAAiB,QAAQ,6BAA6B;AAC1E,SAAStB,OAAO,IAAIuB,WAAW,QAAQ,sBAAsB;AAC7D,SAASvB,OAAO,IAAIwB,WAAW,QAAQ,sBAAsB;AAC7D,SAASxB,OAAO,IAAIyB,YAAY,QAAQ,wBAAwB;AAChE,SAASzB,OAAO,IAAI0B,YAAY,QAAQ,wBAAwB"}
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { pascalCase } from 'change-case';
5
-
6
5
  /**
7
6
  * Given a function mapping a component to an enhanced component and modifier
8
7
  * name, returns the enhanced component augmented with a generated displayName.
@@ -19,6 +18,7 @@ export function createHigherOrderComponent(mapComponent, modifierName) {
19
18
  return Outer;
20
19
  };
21
20
  }
21
+
22
22
  /**
23
23
  * Returns a displayName for a higher-order component, given a wrapper name.
24
24
  *
@@ -30,7 +30,6 @@ export function createHigherOrderComponent(mapComponent, modifierName) {
30
30
  * @param Inner Wrapped component inside higher-order component.
31
31
  * @return Wrapped name of higher-order component.
32
32
  */
33
-
34
33
  const hocName = (name, Inner) => {
35
34
  const inner = Inner.displayName || Inner.name || 'Component';
36
35
  const outer = pascalCase(name !== null && name !== void 0 ? name : '');
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/utils/create-higher-order-component/index.ts"],"names":["pascalCase","createHigherOrderComponent","mapComponent","modifierName","Inner","Outer","displayName","hocName","name","inner","outer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,aAA3B;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAAT,CAGJC,YAHI,EAGuCC,YAHvC,EAG8D;AACpE,SAASC,KAAF,IAAqB;AAC3B,UAAMC,KAAK,GAAGH,YAAY,CAAEE,KAAF,CAA1B;AACAC,IAAAA,KAAK,CAACC,WAAN,GAAoBC,OAAO,CAAEJ,YAAF,EAAgBC,KAAhB,CAA3B;AACA,WAAOC,KAAP;AACA,GAJD;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAME,OAAO,GAAG,CAAEC,IAAF,EAAgBJ,KAAhB,KAAiD;AAChE,QAAMK,KAAK,GAAGL,KAAK,CAACE,WAAN,IAAqBF,KAAK,CAACI,IAA3B,IAAmC,WAAjD;AACA,QAAME,KAAK,GAAGV,UAAU,CAAEQ,IAAF,aAAEA,IAAF,cAAEA,IAAF,GAAU,EAAV,CAAxB;AAEA,SAAQ,GAAGE,KAAO,IAAID,KAAO,GAA7B;AACA,CALD","sourcesContent":["/**\n * External dependencies\n */\nimport { pascalCase } from 'change-case';\nimport type { ComponentType } from 'react';\n\ntype GetProps< C > = C extends ComponentType< infer P > ? P : never;\n\nexport type WithoutInjectedProps< C, I > = Omit< GetProps< C >, keyof I >;\n\nexport type WithInjectedProps< C, I > = ComponentType<\n\tWithoutInjectedProps< C, I > & I\n>;\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n *\n * @param mapComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n *\n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent<\n\tTInner extends ComponentType< any >,\n\tTOuter extends ComponentType< any >\n>( mapComponent: ( Inner: TInner ) => TOuter, modifierName: string ) {\n\treturn ( Inner: TInner ) => {\n\t\tconst Outer = mapComponent( Inner );\n\t\tOuter.displayName = hocName( modifierName, Inner );\n\t\treturn Outer;\n\t};\n}\n\n/**\n * Returns a displayName for a higher-order component, given a wrapper name.\n *\n * @example\n * hocName( 'MyMemo', Widget ) === 'MyMemo(Widget)';\n * hocName( 'MyMemo', <div /> ) === 'MyMemo(Component)';\n *\n * @param name Name assigned to higher-order component's wrapper component.\n * @param Inner Wrapped component inside higher-order component.\n * @return Wrapped name of higher-order component.\n */\nconst hocName = ( name: string, Inner: ComponentType< any > ) => {\n\tconst inner = Inner.displayName || Inner.name || 'Component';\n\tconst outer = pascalCase( name ?? '' );\n\n\treturn `${ outer }(${ inner })`;\n};\n"]}
1
+ {"version":3,"names":["pascalCase","createHigherOrderComponent","mapComponent","modifierName","Inner","Outer","displayName","hocName","name","inner","outer"],"sources":["@wordpress/compose/src/utils/create-higher-order-component/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { pascalCase } from 'change-case';\nimport type { ComponentType } from 'react';\n\ntype GetProps< C > = C extends ComponentType< infer P > ? P : never;\n\nexport type WithoutInjectedProps< C, I > = Omit< GetProps< C >, keyof I >;\n\nexport type WithInjectedProps< C, I > = ComponentType<\n\tWithoutInjectedProps< C, I > & I\n>;\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n *\n * @param mapComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n *\n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent<\n\tTInner extends ComponentType< any >,\n\tTOuter extends ComponentType< any >\n>( mapComponent: ( Inner: TInner ) => TOuter, modifierName: string ) {\n\treturn ( Inner: TInner ) => {\n\t\tconst Outer = mapComponent( Inner );\n\t\tOuter.displayName = hocName( modifierName, Inner );\n\t\treturn Outer;\n\t};\n}\n\n/**\n * Returns a displayName for a higher-order component, given a wrapper name.\n *\n * @example\n * hocName( 'MyMemo', Widget ) === 'MyMemo(Widget)';\n * hocName( 'MyMemo', <div /> ) === 'MyMemo(Component)';\n *\n * @param name Name assigned to higher-order component's wrapper component.\n * @param Inner Wrapped component inside higher-order component.\n * @return Wrapped name of higher-order component.\n */\nconst hocName = ( name: string, Inner: ComponentType< any > ) => {\n\tconst inner = Inner.displayName || Inner.name || 'Component';\n\tconst outer = pascalCase( name ?? '' );\n\n\treturn `${ outer }(${ inner })`;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,aAAa;AAWxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAGvCC,YAAyC,EAAEC,YAAoB,EAAG;EACpE,OAASC,KAAa,IAAM;IAC3B,MAAMC,KAAK,GAAGH,YAAY,CAAEE,KAAM,CAAC;IACnCC,KAAK,CAACC,WAAW,GAAGC,OAAO,CAAEJ,YAAY,EAAEC,KAAM,CAAC;IAClD,OAAOC,KAAK;EACb,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,OAAO,GAAGA,CAAEC,IAAY,EAAEJ,KAA2B,KAAM;EAChE,MAAMK,KAAK,GAAGL,KAAK,CAACE,WAAW,IAAIF,KAAK,CAACI,IAAI,IAAI,WAAW;EAC5D,MAAME,KAAK,GAAGV,UAAU,CAAEQ,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,EAAG,CAAC;EAEtC,OAAQ,GAAGE,KAAO,IAAID,KAAO,GAAE;AAChC,CAAC"}
@@ -78,18 +78,14 @@ export const debounce = (func, wait, options) => {
78
78
  let leading = false;
79
79
  let maxing = false;
80
80
  let trailing = true;
81
-
82
81
  if (options) {
83
82
  leading = !!options.leading;
84
83
  maxing = 'maxWait' in options;
85
-
86
84
  if (options.maxWait !== undefined) {
87
85
  maxWait = Math.max(options.maxWait, wait);
88
86
  }
89
-
90
87
  trailing = 'trailing' in options ? !!options.trailing : trailing;
91
88
  }
92
-
93
89
  function invokeFunc(time) {
94
90
  const args = lastArgs;
95
91
  const thisArg = lastThis;
@@ -99,115 +95,96 @@ export const debounce = (func, wait, options) => {
99
95
  result = func.apply(thisArg, args);
100
96
  return result;
101
97
  }
102
-
103
98
  function startTimer(pendingFunc, waitTime) {
104
99
  timerId = setTimeout(pendingFunc, waitTime);
105
100
  }
106
-
107
101
  function cancelTimer() {
108
102
  if (timerId !== undefined) {
109
103
  clearTimeout(timerId);
110
104
  }
111
105
  }
112
-
113
106
  function leadingEdge(time) {
114
107
  // Reset any `maxWait` timer.
115
- lastInvokeTime = time; // Start the timer for the trailing edge.
116
-
117
- startTimer(timerExpired, wait); // Invoke the leading edge.
118
-
108
+ lastInvokeTime = time;
109
+ // Start the timer for the trailing edge.
110
+ startTimer(timerExpired, wait);
111
+ // Invoke the leading edge.
119
112
  return leading ? invokeFunc(time) : result;
120
113
  }
121
-
122
114
  function getTimeSinceLastCall(time) {
123
115
  return time - (lastCallTime || 0);
124
116
  }
125
-
126
117
  function remainingWait(time) {
127
118
  const timeSinceLastCall = getTimeSinceLastCall(time);
128
119
  const timeSinceLastInvoke = time - lastInvokeTime;
129
120
  const timeWaiting = wait - timeSinceLastCall;
130
121
  return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
131
122
  }
132
-
133
123
  function shouldInvoke(time) {
134
124
  const timeSinceLastCall = getTimeSinceLastCall(time);
135
- const timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
125
+ const timeSinceLastInvoke = time - lastInvokeTime;
126
+
127
+ // Either this is the first call, activity has stopped and we're at the
136
128
  // trailing edge, the system time has gone backwards and we're treating
137
129
  // it as the trailing edge, or we've hit the `maxWait` limit.
138
-
139
130
  return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
140
131
  }
141
-
142
132
  function timerExpired() {
143
133
  const time = Date.now();
144
-
145
134
  if (shouldInvoke(time)) {
146
135
  return trailingEdge(time);
147
- } // Restart the timer.
148
-
149
-
136
+ }
137
+ // Restart the timer.
150
138
  startTimer(timerExpired, remainingWait(time));
151
139
  return undefined;
152
140
  }
153
-
154
141
  function clearTimer() {
155
142
  timerId = undefined;
156
143
  }
157
-
158
144
  function trailingEdge(time) {
159
- clearTimer(); // Only invoke if we have `lastArgs` which means `func` has been
160
- // debounced at least once.
145
+ clearTimer();
161
146
 
147
+ // Only invoke if we have `lastArgs` which means `func` has been
148
+ // debounced at least once.
162
149
  if (trailing && lastArgs) {
163
150
  return invokeFunc(time);
164
151
  }
165
-
166
152
  lastArgs = lastThis = undefined;
167
153
  return result;
168
154
  }
169
-
170
155
  function cancel() {
171
156
  cancelTimer();
172
157
  lastInvokeTime = 0;
173
158
  clearTimer();
174
159
  lastArgs = lastCallTime = lastThis = undefined;
175
160
  }
176
-
177
161
  function flush() {
178
162
  return pending() ? trailingEdge(Date.now()) : result;
179
163
  }
180
-
181
164
  function pending() {
182
165
  return timerId !== undefined;
183
166
  }
184
-
185
167
  function debounced(...args) {
186
168
  const time = Date.now();
187
169
  const isInvoking = shouldInvoke(time);
188
170
  lastArgs = args;
189
171
  lastThis = this;
190
172
  lastCallTime = time;
191
-
192
173
  if (isInvoking) {
193
174
  if (!pending()) {
194
175
  return leadingEdge(lastCallTime);
195
176
  }
196
-
197
177
  if (maxing) {
198
178
  // Handle invocations in a tight loop.
199
179
  startTimer(timerExpired, wait);
200
180
  return invokeFunc(lastCallTime);
201
181
  }
202
182
  }
203
-
204
183
  if (!pending()) {
205
184
  startTimer(timerExpired, wait);
206
185
  }
207
-
208
186
  return result;
209
187
  }
210
-
211
188
  debounced.cancel = cancel;
212
189
  debounced.flush = flush;
213
190
  debounced.pending = pending;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/utils/debounce/index.ts"],"names":["debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","undefined","Math","max","invokeFunc","time","args","thisArg","apply","startTimer","pendingFunc","waitTime","setTimeout","cancelTimer","clearTimeout","leadingEdge","timerExpired","getTimeSinceLastCall","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","min","shouldInvoke","Date","now","trailingEdge","clearTimer","cancel","flush","pending","debounced","isInvoking"],"mappings":"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","sourcesContent":["/**\n * Parts of this source were derived and modified from lodash,\n * released under the MIT license.\n *\n * https://github.com/lodash/lodash\n *\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n *\n * Based on Underscore.js, copyright Jeremy Ashkenas,\n * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n *\n * This software consists of voluntary contributions made by many\n * individuals. For exact contribution history, see the revision history\n * available at https://github.com/lodash/lodash\n *\n * The following license applies to all parts of this software except as\n * documented below:\n *\n * ====\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nexport interface DebounceOptions {\n\tleading: boolean;\n\tmaxWait: number;\n\ttrailing: boolean;\n}\n\nexport interface DebouncedFunc< T extends ( ...args: any[] ) => any > {\n\t/**\n\t * Call the original function, but applying the debounce rules.\n\t *\n\t * If the debounced function can be run immediately, this calls it and returns its return\n\t * value.\n\t *\n\t * Otherwise, it returns the return value of the last invocation, or undefined if the debounced\n\t * function was not invoked yet.\n\t */\n\t( ...args: Parameters< T > ): ReturnType< T > | undefined;\n\n\t/**\n\t * Throw away any pending invocation of the debounced function.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * If there is a pending invocation of the debounced function, invoke it immediately and return\n\t * its return value.\n\t *\n\t * Otherwise, return the value from the last invocation, or undefined if the debounced function\n\t * was never invoked.\n\t */\n\tflush(): ReturnType< T > | undefined;\n}\n\n/**\n * A simplified and properly typed version of lodash's `debounce`, that\n * always uses timers instead of sometimes using rAF.\n *\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel delayed\n * `func` invocations and a `flush` method to immediately invoke them. Provide\n * `options` to indicate whether `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. The `func` is invoked with the last\n * arguments provided to the debounced function. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * @param {Function} func The function to debounce.\n * @param {number} wait The number of milliseconds to delay.\n * @param {Partial< DebounceOptions >} options The options object.\n * @param {boolean} options.leading Specify invoking on the leading edge of the timeout.\n * @param {number} options.maxWait The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.\n *\n * @return Returns the new debounced function.\n */\nexport const debounce = < FunctionT extends ( ...args: unknown[] ) => unknown >(\n\tfunc: FunctionT,\n\twait: number,\n\toptions?: Partial< DebounceOptions >\n) => {\n\tlet lastArgs: Parameters< FunctionT > | undefined;\n\tlet lastThis: unknown | undefined;\n\tlet maxWait = 0;\n\tlet result: ReturnType< FunctionT >;\n\tlet timerId: ReturnType< typeof setTimeout > | undefined;\n\tlet lastCallTime: number | undefined;\n\n\tlet lastInvokeTime = 0;\n\tlet leading = false;\n\tlet maxing = false;\n\tlet trailing = true;\n\n\tif ( options ) {\n\t\tleading = !! options.leading;\n\t\tmaxing = 'maxWait' in options;\n\t\tif ( options.maxWait !== undefined ) {\n\t\t\tmaxWait = Math.max( options.maxWait, wait );\n\t\t}\n\t\ttrailing = 'trailing' in options ? !! options.trailing : trailing;\n\t}\n\n\tfunction invokeFunc( time: number ) {\n\t\tconst args = lastArgs;\n\t\tconst thisArg = lastThis;\n\n\t\tlastArgs = undefined;\n\t\tlastThis = undefined;\n\t\tlastInvokeTime = time;\n\n\t\tresult = func.apply( thisArg, args! ) as ReturnType< FunctionT >;\n\t\treturn result;\n\t}\n\n\tfunction startTimer(\n\t\tpendingFunc: () => void,\n\t\twaitTime: number | undefined\n\t) {\n\t\ttimerId = setTimeout( pendingFunc, waitTime );\n\t}\n\n\tfunction cancelTimer() {\n\t\tif ( timerId !== undefined ) {\n\t\t\tclearTimeout( timerId );\n\t\t}\n\t}\n\n\tfunction leadingEdge( time: number ) {\n\t\t// Reset any `maxWait` timer.\n\t\tlastInvokeTime = time;\n\t\t// Start the timer for the trailing edge.\n\t\tstartTimer( timerExpired, wait );\n\t\t// Invoke the leading edge.\n\t\treturn leading ? invokeFunc( time ) : result;\n\t}\n\n\tfunction getTimeSinceLastCall( time: number ) {\n\t\treturn time - ( lastCallTime || 0 );\n\t}\n\n\tfunction remainingWait( time: number ) {\n\t\tconst timeSinceLastCall = getTimeSinceLastCall( time );\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime;\n\t\tconst timeWaiting = wait - timeSinceLastCall;\n\n\t\treturn maxing\n\t\t\t? Math.min( timeWaiting, maxWait - timeSinceLastInvoke )\n\t\t\t: timeWaiting;\n\t}\n\n\tfunction shouldInvoke( time: number ) {\n\t\tconst timeSinceLastCall = getTimeSinceLastCall( time );\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime;\n\n\t\t// Either this is the first call, activity has stopped and we're at the\n\t\t// trailing edge, the system time has gone backwards and we're treating\n\t\t// it as the trailing edge, or we've hit the `maxWait` limit.\n\t\treturn (\n\t\t\tlastCallTime === undefined ||\n\t\t\ttimeSinceLastCall >= wait ||\n\t\t\ttimeSinceLastCall < 0 ||\n\t\t\t( maxing && timeSinceLastInvoke >= maxWait )\n\t\t);\n\t}\n\n\tfunction timerExpired() {\n\t\tconst time = Date.now();\n\t\tif ( shouldInvoke( time ) ) {\n\t\t\treturn trailingEdge( time );\n\t\t}\n\t\t// Restart the timer.\n\t\tstartTimer( timerExpired, remainingWait( time ) );\n\t\treturn undefined;\n\t}\n\n\tfunction clearTimer() {\n\t\ttimerId = undefined;\n\t}\n\n\tfunction trailingEdge( time: number ) {\n\t\tclearTimer();\n\n\t\t// Only invoke if we have `lastArgs` which means `func` has been\n\t\t// debounced at least once.\n\t\tif ( trailing && lastArgs ) {\n\t\t\treturn invokeFunc( time );\n\t\t}\n\t\tlastArgs = lastThis = undefined;\n\t\treturn result;\n\t}\n\n\tfunction cancel() {\n\t\tcancelTimer();\n\t\tlastInvokeTime = 0;\n\t\tclearTimer();\n\t\tlastArgs = lastCallTime = lastThis = undefined;\n\t}\n\n\tfunction flush() {\n\t\treturn pending() ? trailingEdge( Date.now() ) : result;\n\t}\n\n\tfunction pending() {\n\t\treturn timerId !== undefined;\n\t}\n\n\tfunction debounced( this: unknown, ...args: Parameters< FunctionT > ) {\n\t\tconst time = Date.now();\n\t\tconst isInvoking = shouldInvoke( time );\n\n\t\tlastArgs = args;\n\t\tlastThis = this;\n\t\tlastCallTime = time;\n\n\t\tif ( isInvoking ) {\n\t\t\tif ( ! pending() ) {\n\t\t\t\treturn leadingEdge( lastCallTime );\n\t\t\t}\n\t\t\tif ( maxing ) {\n\t\t\t\t// Handle invocations in a tight loop.\n\t\t\t\tstartTimer( timerExpired, wait );\n\t\t\t\treturn invokeFunc( lastCallTime );\n\t\t\t}\n\t\t}\n\t\tif ( ! pending() ) {\n\t\t\tstartTimer( timerExpired, wait );\n\t\t}\n\t\treturn result;\n\t}\n\tdebounced.cancel = cancel;\n\tdebounced.flush = flush;\n\tdebounced.pending = pending;\n\treturn debounced;\n};\n"]}
1
+ {"version":3,"names":["debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","undefined","Math","max","invokeFunc","time","args","thisArg","apply","startTimer","pendingFunc","waitTime","setTimeout","cancelTimer","clearTimeout","leadingEdge","timerExpired","getTimeSinceLastCall","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","min","shouldInvoke","Date","now","trailingEdge","clearTimer","cancel","flush","pending","debounced","isInvoking"],"sources":["@wordpress/compose/src/utils/debounce/index.ts"],"sourcesContent":["/**\n * Parts of this source were derived and modified from lodash,\n * released under the MIT license.\n *\n * https://github.com/lodash/lodash\n *\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n *\n * Based on Underscore.js, copyright Jeremy Ashkenas,\n * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n *\n * This software consists of voluntary contributions made by many\n * individuals. For exact contribution history, see the revision history\n * available at https://github.com/lodash/lodash\n *\n * The following license applies to all parts of this software except as\n * documented below:\n *\n * ====\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nexport interface DebounceOptions {\n\tleading: boolean;\n\tmaxWait: number;\n\ttrailing: boolean;\n}\n\nexport interface DebouncedFunc< T extends ( ...args: any[] ) => any > {\n\t/**\n\t * Call the original function, but applying the debounce rules.\n\t *\n\t * If the debounced function can be run immediately, this calls it and returns its return\n\t * value.\n\t *\n\t * Otherwise, it returns the return value of the last invocation, or undefined if the debounced\n\t * function was not invoked yet.\n\t */\n\t( ...args: Parameters< T > ): ReturnType< T > | undefined;\n\n\t/**\n\t * Throw away any pending invocation of the debounced function.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * If there is a pending invocation of the debounced function, invoke it immediately and return\n\t * its return value.\n\t *\n\t * Otherwise, return the value from the last invocation, or undefined if the debounced function\n\t * was never invoked.\n\t */\n\tflush(): ReturnType< T > | undefined;\n}\n\n/**\n * A simplified and properly typed version of lodash's `debounce`, that\n * always uses timers instead of sometimes using rAF.\n *\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel delayed\n * `func` invocations and a `flush` method to immediately invoke them. Provide\n * `options` to indicate whether `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. The `func` is invoked with the last\n * arguments provided to the debounced function. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * @param {Function} func The function to debounce.\n * @param {number} wait The number of milliseconds to delay.\n * @param {Partial< DebounceOptions >} options The options object.\n * @param {boolean} options.leading Specify invoking on the leading edge of the timeout.\n * @param {number} options.maxWait The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.\n *\n * @return Returns the new debounced function.\n */\nexport const debounce = < FunctionT extends ( ...args: unknown[] ) => unknown >(\n\tfunc: FunctionT,\n\twait: number,\n\toptions?: Partial< DebounceOptions >\n) => {\n\tlet lastArgs: Parameters< FunctionT > | undefined;\n\tlet lastThis: unknown | undefined;\n\tlet maxWait = 0;\n\tlet result: ReturnType< FunctionT >;\n\tlet timerId: ReturnType< typeof setTimeout > | undefined;\n\tlet lastCallTime: number | undefined;\n\n\tlet lastInvokeTime = 0;\n\tlet leading = false;\n\tlet maxing = false;\n\tlet trailing = true;\n\n\tif ( options ) {\n\t\tleading = !! options.leading;\n\t\tmaxing = 'maxWait' in options;\n\t\tif ( options.maxWait !== undefined ) {\n\t\t\tmaxWait = Math.max( options.maxWait, wait );\n\t\t}\n\t\ttrailing = 'trailing' in options ? !! options.trailing : trailing;\n\t}\n\n\tfunction invokeFunc( time: number ) {\n\t\tconst args = lastArgs;\n\t\tconst thisArg = lastThis;\n\n\t\tlastArgs = undefined;\n\t\tlastThis = undefined;\n\t\tlastInvokeTime = time;\n\n\t\tresult = func.apply( thisArg, args! ) as ReturnType< FunctionT >;\n\t\treturn result;\n\t}\n\n\tfunction startTimer(\n\t\tpendingFunc: () => void,\n\t\twaitTime: number | undefined\n\t) {\n\t\ttimerId = setTimeout( pendingFunc, waitTime );\n\t}\n\n\tfunction cancelTimer() {\n\t\tif ( timerId !== undefined ) {\n\t\t\tclearTimeout( timerId );\n\t\t}\n\t}\n\n\tfunction leadingEdge( time: number ) {\n\t\t// Reset any `maxWait` timer.\n\t\tlastInvokeTime = time;\n\t\t// Start the timer for the trailing edge.\n\t\tstartTimer( timerExpired, wait );\n\t\t// Invoke the leading edge.\n\t\treturn leading ? invokeFunc( time ) : result;\n\t}\n\n\tfunction getTimeSinceLastCall( time: number ) {\n\t\treturn time - ( lastCallTime || 0 );\n\t}\n\n\tfunction remainingWait( time: number ) {\n\t\tconst timeSinceLastCall = getTimeSinceLastCall( time );\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime;\n\t\tconst timeWaiting = wait - timeSinceLastCall;\n\n\t\treturn maxing\n\t\t\t? Math.min( timeWaiting, maxWait - timeSinceLastInvoke )\n\t\t\t: timeWaiting;\n\t}\n\n\tfunction shouldInvoke( time: number ) {\n\t\tconst timeSinceLastCall = getTimeSinceLastCall( time );\n\t\tconst timeSinceLastInvoke = time - lastInvokeTime;\n\n\t\t// Either this is the first call, activity has stopped and we're at the\n\t\t// trailing edge, the system time has gone backwards and we're treating\n\t\t// it as the trailing edge, or we've hit the `maxWait` limit.\n\t\treturn (\n\t\t\tlastCallTime === undefined ||\n\t\t\ttimeSinceLastCall >= wait ||\n\t\t\ttimeSinceLastCall < 0 ||\n\t\t\t( maxing && timeSinceLastInvoke >= maxWait )\n\t\t);\n\t}\n\n\tfunction timerExpired() {\n\t\tconst time = Date.now();\n\t\tif ( shouldInvoke( time ) ) {\n\t\t\treturn trailingEdge( time );\n\t\t}\n\t\t// Restart the timer.\n\t\tstartTimer( timerExpired, remainingWait( time ) );\n\t\treturn undefined;\n\t}\n\n\tfunction clearTimer() {\n\t\ttimerId = undefined;\n\t}\n\n\tfunction trailingEdge( time: number ) {\n\t\tclearTimer();\n\n\t\t// Only invoke if we have `lastArgs` which means `func` has been\n\t\t// debounced at least once.\n\t\tif ( trailing && lastArgs ) {\n\t\t\treturn invokeFunc( time );\n\t\t}\n\t\tlastArgs = lastThis = undefined;\n\t\treturn result;\n\t}\n\n\tfunction cancel() {\n\t\tcancelTimer();\n\t\tlastInvokeTime = 0;\n\t\tclearTimer();\n\t\tlastArgs = lastCallTime = lastThis = undefined;\n\t}\n\n\tfunction flush() {\n\t\treturn pending() ? trailingEdge( Date.now() ) : result;\n\t}\n\n\tfunction pending() {\n\t\treturn timerId !== undefined;\n\t}\n\n\tfunction debounced( this: unknown, ...args: Parameters< FunctionT > ) {\n\t\tconst time = Date.now();\n\t\tconst isInvoking = shouldInvoke( time );\n\n\t\tlastArgs = args;\n\t\tlastThis = this;\n\t\tlastCallTime = time;\n\n\t\tif ( isInvoking ) {\n\t\t\tif ( ! pending() ) {\n\t\t\t\treturn leadingEdge( lastCallTime );\n\t\t\t}\n\t\t\tif ( maxing ) {\n\t\t\t\t// Handle invocations in a tight loop.\n\t\t\t\tstartTimer( timerExpired, wait );\n\t\t\t\treturn invokeFunc( lastCallTime );\n\t\t\t}\n\t\t}\n\t\tif ( ! pending() ) {\n\t\t\tstartTimer( timerExpired, wait );\n\t\t}\n\t\treturn result;\n\t}\n\tdebounced.cancel = cancel;\n\tdebounced.flush = flush;\n\tdebounced.pending = pending;\n\treturn debounced;\n};\n"],"mappings":"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"}
@@ -42,7 +42,6 @@
42
42
  * Internal dependencies
43
43
  */
44
44
  import { debounce } from '../debounce';
45
-
46
45
  /**
47
46
  * A simplified and properly typed version of lodash's `throttle`, that
48
47
  * always uses timers instead of sometimes using rAF.
@@ -73,12 +72,10 @@ import { debounce } from '../debounce';
73
72
  export const throttle = (func, wait, options) => {
74
73
  let leading = true;
75
74
  let trailing = true;
76
-
77
75
  if (options) {
78
76
  leading = 'leading' in options ? !!options.leading : leading;
79
77
  trailing = 'trailing' in options ? !!options.trailing : trailing;
80
78
  }
81
-
82
79
  return debounce(func, wait, {
83
80
  leading,
84
81
  trailing,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/utils/throttle/index.ts"],"names":["debounce","throttle","func","wait","options","leading","trailing","maxWait"],"mappings":"AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,aAAzB;;AAOA;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;AACA,OAAO,MAAMC,QAAQ,GAAG,CACvBC,IADuB,EAEvBC,IAFuB,EAGvBC,OAHuB,KAInB;AACJ,MAAIC,OAAO,GAAG,IAAd;AACA,MAAIC,QAAQ,GAAG,IAAf;;AAEA,MAAKF,OAAL,EAAe;AACdC,IAAAA,OAAO,GAAG,aAAaD,OAAb,GAAuB,CAAC,CAAEA,OAAO,CAACC,OAAlC,GAA4CA,OAAtD;AACAC,IAAAA,QAAQ,GAAG,cAAcF,OAAd,GAAwB,CAAC,CAAEA,OAAO,CAACE,QAAnC,GAA8CA,QAAzD;AACA;;AACD,SAAON,QAAQ,CAAEE,IAAF,EAAQC,IAAR,EAAc;AAC5BE,IAAAA,OAD4B;AAE5BC,IAAAA,QAF4B;AAG5BC,IAAAA,OAAO,EAAEJ;AAHmB,GAAd,CAAf;AAKA,CAjBM","sourcesContent":["/**\n * Parts of this source were derived and modified from lodash,\n * released under the MIT license.\n *\n * https://github.com/lodash/lodash\n *\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n *\n * Based on Underscore.js, copyright Jeremy Ashkenas,\n * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n *\n * This software consists of voluntary contributions made by many\n * individuals. For exact contribution history, see the revision history\n * available at https://github.com/lodash/lodash\n *\n * The following license applies to all parts of this software except as\n * documented below:\n *\n * ====\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/**\n * Internal dependencies\n */\nimport { debounce } from '../debounce';\n\nexport interface ThrottleOptions {\n\tleading?: boolean;\n\ttrailing?: boolean;\n}\n\n/**\n * A simplified and properly typed version of lodash's `throttle`, that\n * always uses timers instead of sometimes using rAF.\n *\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return\n * the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * @param {Function} func The function to throttle.\n * @param {number} wait The number of milliseconds to throttle invocations to.\n * @param {Partial< ThrottleOptions >} options The options object.\n * @param {boolean} options.leading Specify invoking on the leading edge of the timeout.\n * @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.\n * @return Returns the new throttled function.\n */\nexport const throttle = < FunctionT extends ( ...args: unknown[] ) => unknown >(\n\tfunc: FunctionT,\n\twait: number,\n\toptions?: ThrottleOptions\n) => {\n\tlet leading = true;\n\tlet trailing = true;\n\n\tif ( options ) {\n\t\tleading = 'leading' in options ? !! options.leading : leading;\n\t\ttrailing = 'trailing' in options ? !! options.trailing : trailing;\n\t}\n\treturn debounce( func, wait, {\n\t\tleading,\n\t\ttrailing,\n\t\tmaxWait: wait,\n\t} );\n};\n"]}
1
+ {"version":3,"names":["debounce","throttle","func","wait","options","leading","trailing","maxWait"],"sources":["@wordpress/compose/src/utils/throttle/index.ts"],"sourcesContent":["/**\n * Parts of this source were derived and modified from lodash,\n * released under the MIT license.\n *\n * https://github.com/lodash/lodash\n *\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n *\n * Based on Underscore.js, copyright Jeremy Ashkenas,\n * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n *\n * This software consists of voluntary contributions made by many\n * individuals. For exact contribution history, see the revision history\n * available at https://github.com/lodash/lodash\n *\n * The following license applies to all parts of this software except as\n * documented below:\n *\n * ====\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/**\n * Internal dependencies\n */\nimport { debounce } from '../debounce';\n\nexport interface ThrottleOptions {\n\tleading?: boolean;\n\ttrailing?: boolean;\n}\n\n/**\n * A simplified and properly typed version of lodash's `throttle`, that\n * always uses timers instead of sometimes using rAF.\n *\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return\n * the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * @param {Function} func The function to throttle.\n * @param {number} wait The number of milliseconds to throttle invocations to.\n * @param {Partial< ThrottleOptions >} options The options object.\n * @param {boolean} options.leading Specify invoking on the leading edge of the timeout.\n * @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.\n * @return Returns the new throttled function.\n */\nexport const throttle = < FunctionT extends ( ...args: unknown[] ) => unknown >(\n\tfunc: FunctionT,\n\twait: number,\n\toptions?: ThrottleOptions\n) => {\n\tlet leading = true;\n\tlet trailing = true;\n\n\tif ( options ) {\n\t\tleading = 'leading' in options ? !! options.leading : leading;\n\t\ttrailing = 'trailing' in options ? !! options.trailing : trailing;\n\t}\n\treturn debounce( func, wait, {\n\t\tleading,\n\t\ttrailing,\n\t\tmaxWait: wait,\n\t} );\n};\n"],"mappings":"AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,aAAa;AAOtC;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;AACA,OAAO,MAAMC,QAAQ,GAAGA,CACvBC,IAAe,EACfC,IAAY,EACZC,OAAyB,KACrB;EACJ,IAAIC,OAAO,GAAG,IAAI;EAClB,IAAIC,QAAQ,GAAG,IAAI;EAEnB,IAAKF,OAAO,EAAG;IACdC,OAAO,GAAG,SAAS,IAAID,OAAO,GAAG,CAAC,CAAEA,OAAO,CAACC,OAAO,GAAGA,OAAO;IAC7DC,QAAQ,GAAG,UAAU,IAAIF,OAAO,GAAG,CAAC,CAAEA,OAAO,CAACE,QAAQ,GAAGA,QAAQ;EAClE;EACA,OAAON,QAAQ,CAAEE,IAAI,EAAEC,IAAI,EAAE;IAC5BE,OAAO;IACPC,QAAQ;IACRC,OAAO,EAAEJ;EACV,CAAE,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { WithInjectedProps, WithoutInjectedProps } from '../../utils/create-higher-order-component';
4
+ import type { WithInjectedProps, WithoutInjectedProps } from '../../utils/create-higher-order-component';
5
5
  type InstanceIdProps = {
6
6
  instanceId: string | number;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/higher-order/with-instance-id/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEN,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,2CAA2C,CAAC;AAGnD,KAAK,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEvD;;;GAGG;AACH,QAAA,MAAM,cAAc,iIAWnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/higher-order/with-instance-id/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,2CAA2C,CAAC;AAInD,KAAK,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEvD;;;GAGG;AACH,QAAA,MAAM,cAAc,iIAWnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { WithInjectedProps, WithoutInjectedProps } from '../../utils/create-higher-order-component';
4
+ import type { WithInjectedProps, WithoutInjectedProps } from '../../utils/create-higher-order-component';
5
5
  /**
6
6
  * We cannot use the `Window['setTimeout']` and `Window['clearTimeout']`
7
7
  * types here because those functions include functionality that is not handled
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/higher-order/with-safe-timeout/index.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;GAOG;AACH,UAAU,YAAY;IACrB,UAAU,EAAE,CAAE,EAAE,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,KAAM,MAAM,CAAC;IACxD,YAAY,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe;;kBAMR,MAAM,EAAE;;uBAaF,MAAM,IAAI,SAAS,MAAM;yBASvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/higher-order/with-safe-timeout/index.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EACX,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,2CAA2C,CAAC;AAGnD;;;;;;;GAOG;AACH,UAAU,YAAY;IACrB,UAAU,EAAE,CAAE,EAAE,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,KAAM,MAAM,CAAC;IACxD,YAAY,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe;;kBAMR,MAAM,EAAE;;uBAaF,MAAM,IAAI,SAAS,MAAM;yBASvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -26,5 +26,5 @@
26
26
  */
27
27
  export default function useDisabled({ isDisabled: isDisabledProp, }?: {
28
28
  isDisabled?: boolean | undefined;
29
- }): (instance: Node | null) => void;
29
+ }): import("react").RefCallback<Node | null>;
30
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EACpC,UAAU,EAAE,cAAsB,GAClC;;CAAK,mCAmDL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EACpC,UAAU,EAAE,cAAsB,GAClC;;CAAK,4CAmDL"}
@@ -5,5 +5,5 @@ export default useIsomorphicLayoutEffect;
5
5
  * throws a warning when using useLayoutEffect in that environment.
6
6
  */
7
7
  declare const useIsomorphicLayoutEffect: typeof useEffect;
8
- import { useEffect } from "@wordpress/element/build-types/react";
8
+ import { useEffect } from '@wordpress/element';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-isomorphic-layout-effect/index.js"],"names":[],"mappings":";AAKA;;;;GAIG;AACH,0DAC6D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-isomorphic-layout-effect/index.js"],"names":[],"mappings":";AAKA;;;;GAIG;AACH,0DAC6D;0BARlB,oBAAoB"}
@@ -18,6 +18,6 @@ export type WPViewportOperator = ">=" | "<";
18
18
  */
19
19
  declare function useViewportMatch(breakpoint: WPBreakpoint, operator?: WPViewportOperator | undefined): boolean;
20
20
  declare namespace useViewportMatch {
21
- const __experimentalWidthProvider: import("react").Provider<number | null>;
21
+ let __experimentalWidthProvider: import("react").Provider<number | null>;
22
22
  }
23
23
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/compose",
3
- "version": "6.16.0",
3
+ "version": "6.17.0",
4
4
  "description": "WordPress higher-order components (HOCs).",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,12 +31,12 @@
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.16.0",
33
33
  "@types/mousetrap": "^1.6.8",
34
- "@wordpress/deprecated": "^3.39.0",
35
- "@wordpress/dom": "^3.39.0",
36
- "@wordpress/element": "^5.16.0",
37
- "@wordpress/is-shallow-equal": "^4.39.0",
38
- "@wordpress/keycodes": "^3.39.0",
39
- "@wordpress/priority-queue": "^2.39.0",
34
+ "@wordpress/deprecated": "^3.40.0",
35
+ "@wordpress/dom": "^3.40.0",
36
+ "@wordpress/element": "^5.17.0",
37
+ "@wordpress/is-shallow-equal": "^4.40.0",
38
+ "@wordpress/keycodes": "^3.40.0",
39
+ "@wordpress/priority-queue": "^2.40.0",
40
40
  "change-case": "^4.1.2",
41
41
  "clipboard": "^2.0.8",
42
42
  "mousetrap": "^1.6.5",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
51
+ "gitHead": "78a288d55b83a713b2f7d98d5a855c0771a2afc6"
52
52
  }
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import {
5
- createHigherOrderComponent,
4
+ import type {
6
5
  WithInjectedProps,
7
6
  WithoutInjectedProps,
8
7
  } from '../../utils/create-higher-order-component';
8
+ import { createHigherOrderComponent } from '../../utils/create-higher-order-component';
9
9
  import useInstanceId from '../../hooks/use-instance-id';
10
10
 
11
11
  type InstanceIdProps = { instanceId: string | number };
@@ -6,11 +6,11 @@ import { Component } from '@wordpress/element';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import {
10
- createHigherOrderComponent,
9
+ import type {
11
10
  WithInjectedProps,
12
11
  WithoutInjectedProps,
13
12
  } from '../../utils/create-higher-order-component';
13
+ import { createHigherOrderComponent } from '../../utils/create-higher-order-component';
14
14
 
15
15
  /**
16
16
  * We cannot use the `Window['setTimeout']` and `Window['clearTimeout']`
@@ -24,7 +24,6 @@ import { useState, useCallback } from '@wordpress/element';
24
24
  * );
25
25
  * };
26
26
  * ```
27
- *
28
27
  */
29
28
  const useResizeObserver = () => {
30
29
  const [ measurements, setMeasurements ] = useState( null );