@wordpress/compose 6.32.0 → 6.33.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 (118) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/higher-order/compose.js.map +1 -1
  4. package/build/higher-order/if-condition/index.js.map +1 -1
  5. package/build/higher-order/pipe.js.map +1 -1
  6. package/build/higher-order/pure/index.js.map +1 -1
  7. package/build/higher-order/with-global-events/index.js.map +1 -1
  8. package/build/higher-order/with-global-events/listener.js.map +1 -1
  9. package/build/higher-order/with-instance-id/index.js.map +1 -1
  10. package/build/higher-order/with-network-connectivity/index.native.js.map +1 -1
  11. package/build/higher-order/with-preferred-color-scheme/index.native.js.map +1 -1
  12. package/build/higher-order/with-safe-timeout/index.js +13 -0
  13. package/build/higher-order/with-safe-timeout/index.js.map +1 -1
  14. package/build/higher-order/with-state/index.js.map +1 -1
  15. package/build/hooks/use-async-list/index.js.map +1 -1
  16. package/build/hooks/use-constrained-tabbing/index.js.map +1 -1
  17. package/build/hooks/use-constrained-tabbing/index.native.js.map +1 -1
  18. package/build/hooks/use-copy-on-click/index.js.map +1 -1
  19. package/build/hooks/use-copy-to-clipboard/index.js.map +1 -1
  20. package/build/hooks/use-debounce/index.js.map +1 -1
  21. package/build/hooks/use-debounced-input/index.js.map +1 -1
  22. package/build/hooks/use-dialog/index.js.map +1 -1
  23. package/build/hooks/use-disabled/index.js.map +1 -1
  24. package/build/hooks/use-dragging/index.js.map +1 -1
  25. package/build/hooks/use-drop-zone/index.js.map +1 -1
  26. package/build/hooks/use-fixed-window-list/index.js.map +1 -1
  27. package/build/hooks/use-focus-on-mount/index.js.map +1 -1
  28. package/build/hooks/use-focus-outside/index.js.map +1 -1
  29. package/build/hooks/use-focus-outside/index.native.js.map +1 -1
  30. package/build/hooks/use-focus-return/index.js.map +1 -1
  31. package/build/hooks/use-focusable-iframe/index.js.map +1 -1
  32. package/build/hooks/use-instance-id/index.js.map +1 -1
  33. package/build/hooks/use-isomorphic-layout-effect/index.js.map +1 -1
  34. package/build/hooks/use-keyboard-shortcut/index.js.map +1 -1
  35. package/build/hooks/use-keyboard-shortcut/index.native.js.map +1 -1
  36. package/build/hooks/use-media-query/index.js.map +1 -1
  37. package/build/hooks/use-merge-refs/index.js.map +1 -1
  38. package/build/hooks/use-network-connectivity/index.native.js.map +1 -1
  39. package/build/hooks/use-preferred-color-scheme/index.android.js.map +1 -1
  40. package/build/hooks/use-preferred-color-scheme/index.ios.js.map +1 -1
  41. package/build/hooks/use-preferred-color-scheme-style/index.native.js.map +1 -1
  42. package/build/hooks/use-previous/index.js.map +1 -1
  43. package/build/hooks/use-reduced-motion/index.js.map +1 -1
  44. package/build/hooks/use-ref-effect/index.js.map +1 -1
  45. package/build/hooks/use-resize-observer/index.js +4 -0
  46. package/build/hooks/use-resize-observer/index.js.map +1 -1
  47. package/build/hooks/use-resize-observer/index.native.js.map +1 -1
  48. package/build/hooks/use-state-with-history/index.js.map +1 -1
  49. package/build/hooks/use-throttle/index.js.map +1 -1
  50. package/build/hooks/use-viewport-match/index.js.map +1 -1
  51. package/build/hooks/use-warn-on-change/index.js.map +1 -1
  52. package/build/index.js.map +1 -1
  53. package/build/index.native.js.map +1 -1
  54. package/build/utils/create-higher-order-component/index.js.map +1 -1
  55. package/build/utils/debounce/index.js.map +1 -1
  56. package/build/utils/throttle/index.js.map +1 -1
  57. package/build-module/higher-order/compose.js.map +1 -1
  58. package/build-module/higher-order/if-condition/index.js.map +1 -1
  59. package/build-module/higher-order/pipe.js.map +1 -1
  60. package/build-module/higher-order/pure/index.js.map +1 -1
  61. package/build-module/higher-order/with-global-events/index.js.map +1 -1
  62. package/build-module/higher-order/with-global-events/listener.js.map +1 -1
  63. package/build-module/higher-order/with-instance-id/index.js.map +1 -1
  64. package/build-module/higher-order/with-network-connectivity/index.native.js.map +1 -1
  65. package/build-module/higher-order/with-preferred-color-scheme/index.native.js.map +1 -1
  66. package/build-module/higher-order/with-safe-timeout/index.js.map +1 -1
  67. package/build-module/higher-order/with-state/index.js.map +1 -1
  68. package/build-module/hooks/use-async-list/index.js.map +1 -1
  69. package/build-module/hooks/use-constrained-tabbing/index.js.map +1 -1
  70. package/build-module/hooks/use-constrained-tabbing/index.native.js.map +1 -1
  71. package/build-module/hooks/use-copy-on-click/index.js.map +1 -1
  72. package/build-module/hooks/use-copy-to-clipboard/index.js.map +1 -1
  73. package/build-module/hooks/use-debounce/index.js.map +1 -1
  74. package/build-module/hooks/use-debounced-input/index.js.map +1 -1
  75. package/build-module/hooks/use-dialog/index.js.map +1 -1
  76. package/build-module/hooks/use-disabled/index.js.map +1 -1
  77. package/build-module/hooks/use-dragging/index.js.map +1 -1
  78. package/build-module/hooks/use-drop-zone/index.js.map +1 -1
  79. package/build-module/hooks/use-fixed-window-list/index.js.map +1 -1
  80. package/build-module/hooks/use-focus-on-mount/index.js.map +1 -1
  81. package/build-module/hooks/use-focus-outside/index.js.map +1 -1
  82. package/build-module/hooks/use-focus-outside/index.native.js.map +1 -1
  83. package/build-module/hooks/use-focus-return/index.js.map +1 -1
  84. package/build-module/hooks/use-focusable-iframe/index.js.map +1 -1
  85. package/build-module/hooks/use-instance-id/index.js.map +1 -1
  86. package/build-module/hooks/use-isomorphic-layout-effect/index.js.map +1 -1
  87. package/build-module/hooks/use-keyboard-shortcut/index.js.map +1 -1
  88. package/build-module/hooks/use-keyboard-shortcut/index.native.js.map +1 -1
  89. package/build-module/hooks/use-media-query/index.js.map +1 -1
  90. package/build-module/hooks/use-merge-refs/index.js.map +1 -1
  91. package/build-module/hooks/use-network-connectivity/index.native.js.map +1 -1
  92. package/build-module/hooks/use-preferred-color-scheme/index.android.js.map +1 -1
  93. package/build-module/hooks/use-preferred-color-scheme/index.ios.js.map +1 -1
  94. package/build-module/hooks/use-preferred-color-scheme-style/index.native.js.map +1 -1
  95. package/build-module/hooks/use-previous/index.js.map +1 -1
  96. package/build-module/hooks/use-reduced-motion/index.js.map +1 -1
  97. package/build-module/hooks/use-ref-effect/index.js.map +1 -1
  98. package/build-module/hooks/use-resize-observer/index.js +4 -0
  99. package/build-module/hooks/use-resize-observer/index.js.map +1 -1
  100. package/build-module/hooks/use-resize-observer/index.native.js.map +1 -1
  101. package/build-module/hooks/use-state-with-history/index.js.map +1 -1
  102. package/build-module/hooks/use-throttle/index.js.map +1 -1
  103. package/build-module/hooks/use-viewport-match/index.js.map +1 -1
  104. package/build-module/hooks/use-warn-on-change/index.js.map +1 -1
  105. package/build-module/index.js.map +1 -1
  106. package/build-module/index.native.js.map +1 -1
  107. package/build-module/utils/create-higher-order-component/index.js.map +1 -1
  108. package/build-module/utils/debounce/index.js.map +1 -1
  109. package/build-module/utils/throttle/index.js.map +1 -1
  110. package/build-types/higher-order/with-instance-id/index.d.ts.map +1 -1
  111. package/build-types/hooks/use-dragging/index.d.ts.map +1 -1
  112. package/build-types/hooks/use-fixed-window-list/index.d.ts +1 -1
  113. package/build-types/hooks/use-fixed-window-list/index.d.ts.map +1 -1
  114. package/build-types/hooks/use-keyboard-shortcut/index.d.ts.map +1 -1
  115. package/build-types/utils/debounce/index.d.ts.map +1 -1
  116. package/build-types/utils/throttle/index.d.ts.map +1 -1
  117. package/package.json +9 -9
  118. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","usePrevious","value","ref","current"],"sources":["@wordpress/compose/src/hooks/use-previous/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Use something's value from the previous render.\n * Based on https://usehooks.com/usePrevious/.\n *\n * @param value The value to track.\n *\n * @return The value from the previous render.\n */\nexport default function usePrevious< T >( value: T ): T | undefined {\n\tconst ref = useRef< T >();\n\n\t// Store current value in ref.\n\tuseEffect( () => {\n\t\tref.current = value;\n\t}, [ value ] ); // Re-run when value changes.\n\n\t// Return previous value (happens before update in useEffect above).\n\treturn ref.current;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAOC,KAAQ,EAAkB;EACnE,MAAMC,GAAG,GAAGH,MAAM,CAAM,CAAC;;EAEzB;EACAD,SAAS,CAAE,MAAM;IAChBI,GAAG,CAACC,OAAO,GAAGF,KAAK;EACpB,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC,CAAC,CAAC;;EAEhB;EACA,OAAOC,GAAG,CAACC,OAAO;AACnB"}
1
+ {"version":3,"names":["useEffect","useRef","usePrevious","value","ref","current"],"sources":["@wordpress/compose/src/hooks/use-previous/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Use something's value from the previous render.\n * Based on https://usehooks.com/usePrevious/.\n *\n * @param value The value to track.\n *\n * @return The value from the previous render.\n */\nexport default function usePrevious< T >( value: T ): T | undefined {\n\tconst ref = useRef< T >();\n\n\t// Store current value in ref.\n\tuseEffect( () => {\n\t\tref.current = value;\n\t}, [ value ] ); // Re-run when value changes.\n\n\t// Return previous value (happens before update in useEffect above).\n\treturn ref.current;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAOC,KAAQ,EAAkB;EACnE,MAAMC,GAAG,GAAGH,MAAM,CAAM,CAAC;;EAEzB;EACAD,SAAS,CAAE,MAAM;IAChBI,GAAG,CAACC,OAAO,GAAGF,KAAK;EACpB,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC,CAAC,CAAC;;EAEhB;EACA,OAAOC,GAAG,CAACC,OAAO;AACnB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useMediaQuery","useReducedMotion"],"sources":["@wordpress/compose/src/hooks/use-reduced-motion/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport useMediaQuery from '../use-media-query';\n\n/**\n * Hook returning whether the user has a preference for reduced motion.\n *\n * @return {boolean} Reduced motion preference value.\n */\nconst useReducedMotion = () =>\n\tuseMediaQuery( '(prefers-reduced-motion: reduce)' );\n\nexport default useReducedMotion;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAA,KACxBD,aAAa,CAAE,kCAAmC,CAAC;AAEpD,eAAeC,gBAAgB"}
1
+ {"version":3,"names":["useMediaQuery","useReducedMotion"],"sources":["@wordpress/compose/src/hooks/use-reduced-motion/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport useMediaQuery from '../use-media-query';\n\n/**\n * Hook returning whether the user has a preference for reduced motion.\n *\n * @return {boolean} Reduced motion preference value.\n */\nconst useReducedMotion = () =>\n\tuseMediaQuery( '(prefers-reduced-motion: reduce)' );\n\nexport default useReducedMotion;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAA,KACxBD,aAAa,CAAE,kCAAmC,CAAC;AAEpD,eAAeC,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useRef","useRefEffect","callback","dependencies","cleanup","node","current"],"sources":["@wordpress/compose/src/hooks/use-ref-effect/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DependencyList, RefCallback } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\n\n/**\n * Effect-like ref callback. Just like with `useEffect`, this allows you to\n * return a cleanup function to be run if the ref changes or one of the\n * dependencies changes. The ref is provided as an argument to the callback\n * functions. The main difference between this and `useEffect` is that\n * the `useEffect` callback is not called when the ref changes, but this is.\n * Pass the returned ref callback as the component's ref and merge multiple refs\n * with `useMergeRefs`.\n *\n * It's worth noting that if the dependencies array is empty, there's not\n * strictly a need to clean up event handlers for example, because the node is\n * to be removed. It *is* necessary if you add dependencies because the ref\n * callback will be called multiple times for the same node.\n *\n * @param callback Callback with ref as argument.\n * @param dependencies Dependencies of the callback.\n *\n * @return Ref callback.\n */\nexport default function useRefEffect< TElement = Node >(\n\tcallback: ( node: TElement ) => ( () => void ) | void,\n\tdependencies: DependencyList\n): RefCallback< TElement | null > {\n\tconst cleanup = useRef< ( () => void ) | void >();\n\treturn useCallback( ( node: TElement | null ) => {\n\t\tif ( node ) {\n\t\t\tcleanup.current = callback( node );\n\t\t} else if ( cleanup.current ) {\n\t\t\tcleanup.current();\n\t\t}\n\t}, dependencies );\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAYA,CACnCC,QAAqD,EACrDC,YAA4B,EACK;EACjC,MAAMC,OAAO,GAAGJ,MAAM,CAA0B,CAAC;EACjD,OAAOD,WAAW,CAAIM,IAAqB,IAAM;IAChD,IAAKA,IAAI,EAAG;MACXD,OAAO,CAACE,OAAO,GAAGJ,QAAQ,CAAEG,IAAK,CAAC;IACnC,CAAC,MAAM,IAAKD,OAAO,CAACE,OAAO,EAAG;MAC7BF,OAAO,CAACE,OAAO,CAAC,CAAC;IAClB;EACD,CAAC,EAAEH,YAAa,CAAC;AAClB"}
1
+ {"version":3,"names":["useCallback","useRef","useRefEffect","callback","dependencies","cleanup","node","current"],"sources":["@wordpress/compose/src/hooks/use-ref-effect/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DependencyList, RefCallback } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\n\n/**\n * Effect-like ref callback. Just like with `useEffect`, this allows you to\n * return a cleanup function to be run if the ref changes or one of the\n * dependencies changes. The ref is provided as an argument to the callback\n * functions. The main difference between this and `useEffect` is that\n * the `useEffect` callback is not called when the ref changes, but this is.\n * Pass the returned ref callback as the component's ref and merge multiple refs\n * with `useMergeRefs`.\n *\n * It's worth noting that if the dependencies array is empty, there's not\n * strictly a need to clean up event handlers for example, because the node is\n * to be removed. It *is* necessary if you add dependencies because the ref\n * callback will be called multiple times for the same node.\n *\n * @param callback Callback with ref as argument.\n * @param dependencies Dependencies of the callback.\n *\n * @return Ref callback.\n */\nexport default function useRefEffect< TElement = Node >(\n\tcallback: ( node: TElement ) => ( () => void ) | void,\n\tdependencies: DependencyList\n): RefCallback< TElement | null > {\n\tconst cleanup = useRef< ( () => void ) | void >();\n\treturn useCallback( ( node: TElement | null ) => {\n\t\tif ( node ) {\n\t\t\tcleanup.current = callback( node );\n\t\t} else if ( cleanup.current ) {\n\t\t\tcleanup.current();\n\t\t}\n\t}, dependencies );\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAYA,CACnCC,QAAqD,EACrDC,YAA4B,EACK;EACjC,MAAMC,OAAO,GAAGJ,MAAM,CAA0B,CAAC;EACjD,OAAOD,WAAW,CAAIM,IAAqB,IAAM;IAChD,IAAKA,IAAI,EAAG;MACXD,OAAO,CAACE,OAAO,GAAGJ,QAAQ,CAAEG,IAAK,CAAC;IACnC,CAAC,MAAM,IAAKD,OAAO,CAACE,OAAO,EAAG;MAC7BF,OAAO,CAACE,OAAO,CAAC,CAAC;IAClB;EACD,CAAC,EAAEH,YAAa,CAAC;AAClB","ignoreList":[]}
@@ -59,6 +59,10 @@ function useResolvedElement(subscriber, refOrElement) {
59
59
  callSubscriber();
60
60
  }, [callSubscriber]);
61
61
  }
62
+
63
+ // Declaring my own type here instead of using the one provided by TS (available since 4.2.2), because this way I'm not
64
+ // forcing consumers to use a specific TS version.
65
+
62
66
  // We're only using the first element of the size sequences, until future versions of the spec solidify on how
63
67
  // exactly it'll be used for fragments in multi-column scenarios:
64
68
  // From the spec:
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useRef","useCallback","useEffect","useState","useResolvedElement","subscriber","refOrElement","callbackRefElement","lastReportRef","cleanupRef","callSubscriber","element","current","HTMLElement","reporter","extractSize","entry","boxProp","sizeType","contentRect","undefined","useResizeObserver","opts","onResize","onResizeRef","round","Math","resizeObserverRef","size","setSize","width","height","didUnmount","previous","refCallback","box","instance","ResizeObserver","entries","reportedWidth","reportedHeight","newWidth","newHeight","newSize","observe","unobserve","ref","useResizeAware","sizes","resizeListener","createElement","style","position","top","left","right","bottom","pointerEvents","opacity","overflow","zIndex"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, RefCallback, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\ntype SubscriberCleanup = () => void;\ntype SubscriberResponse = SubscriberCleanup | void;\n\n// This of course could've been more streamlined with internal state instead of\n// refs, but then host hooks / components could not opt out of renders.\n// This could've been exported to its own module, but the current build doesn't\n// seem to work with module imports and I had no more time to spend on this...\nfunction useResolvedElement< T extends HTMLElement >(\n\tsubscriber: ( element: T ) => SubscriberResponse,\n\trefOrElement?: T | RefObject< T > | null\n): RefCallback< T > {\n\tconst callbackRefElement = useRef< T | null >( null );\n\tconst lastReportRef = useRef< {\n\t\treporter: () => void;\n\t\telement: T | null;\n\t} | null >( null );\n\tconst cleanupRef = useRef< SubscriberResponse | null >();\n\n\tconst callSubscriber = useCallback( () => {\n\t\tlet element = null;\n\t\tif ( callbackRefElement.current ) {\n\t\t\telement = callbackRefElement.current;\n\t\t} else if ( refOrElement ) {\n\t\t\tif ( refOrElement instanceof HTMLElement ) {\n\t\t\t\telement = refOrElement;\n\t\t\t} else {\n\t\t\t\telement = refOrElement.current;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tlastReportRef.current &&\n\t\t\tlastReportRef.current.element === element &&\n\t\t\tlastReportRef.current.reporter === callSubscriber\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( cleanupRef.current ) {\n\t\t\tcleanupRef.current();\n\t\t\t// Making sure the cleanup is not called accidentally multiple times.\n\t\t\tcleanupRef.current = null;\n\t\t}\n\t\tlastReportRef.current = {\n\t\t\treporter: callSubscriber,\n\t\t\telement,\n\t\t};\n\n\t\t// Only calling the subscriber, if there's an actual element to report.\n\t\tif ( element ) {\n\t\t\tcleanupRef.current = subscriber( element );\n\t\t}\n\t}, [ refOrElement, subscriber ] );\n\n\t// On each render, we check whether a ref changed, or if we got a new raw\n\t// element.\n\tuseEffect( () => {\n\t\t// With this we're *technically* supporting cases where ref objects' current value changes, but only if there's a\n\t\t// render accompanying that change as well.\n\t\t// To guarantee we always have the right element, one must use the ref callback provided instead, but we support\n\t\t// RefObjects to make the hook API more convenient in certain cases.\n\t\tcallSubscriber();\n\t}, [ callSubscriber ] );\n\n\treturn useCallback< RefCallback< T > >(\n\t\t( element ) => {\n\t\t\tcallbackRefElement.current = element;\n\t\t\tcallSubscriber();\n\t\t},\n\t\t[ callSubscriber ]\n\t);\n}\n\ntype ObservedSize = {\n\twidth: number | undefined;\n\theight: number | undefined;\n};\n\ntype ResizeHandler = ( size: ObservedSize ) => void;\n\ntype HookResponse< T extends HTMLElement > = {\n\tref: RefCallback< T >;\n} & ObservedSize;\n\n// Declaring my own type here instead of using the one provided by TS (available since 4.2.2), because this way I'm not\n// forcing consumers to use a specific TS version.\ntype ResizeObserverBoxOptions =\n\t| 'border-box'\n\t| 'content-box'\n\t| 'device-pixel-content-box';\n\ndeclare global {\n\tinterface ResizeObserverEntry {\n\t\treadonly devicePixelContentBoxSize: ReadonlyArray< ResizeObserverSize >;\n\t}\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nconst extractSize = (\n\tentry: ResizeObserverEntry,\n\tboxProp: 'borderBoxSize' | 'contentBoxSize' | 'devicePixelContentBoxSize',\n\tsizeType: keyof ResizeObserverSize\n): number | undefined => {\n\tif ( ! entry[ boxProp ] ) {\n\t\tif ( boxProp === 'contentBoxSize' ) {\n\t\t\t// The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n\t\t\t// See the 6th step in the description for the RO algorithm:\n\t\t\t// https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n\t\t\t// > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n\t\t\t// In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n\t\t\treturn entry.contentRect[\n\t\t\t\tsizeType === 'inlineSize' ? 'width' : 'height'\n\t\t\t];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t// A couple bytes smaller than calling Array.isArray() and just as effective here.\n\treturn entry[ boxProp ][ 0 ]\n\t\t? entry[ boxProp ][ 0 ][ sizeType ]\n\t\t: // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n\t\t // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n\t\t // @ts-ignore\n\t\t entry[ boxProp ][ sizeType ];\n};\n\ntype RoundingFunction = ( n: number ) => number;\n\nfunction useResizeObserver< T extends HTMLElement >(\n\topts: {\n\t\tref?: RefObject< T > | T | null | undefined;\n\t\tonResize?: ResizeHandler;\n\t\tbox?: ResizeObserverBoxOptions;\n\t\tround?: RoundingFunction;\n\t} = {}\n): HookResponse< T > {\n\t// Saving the callback as a ref. With this, I don't need to put onResize in the\n\t// effect dep array, and just passing in an anonymous function without memoising\n\t// will not reinstantiate the hook's ResizeObserver.\n\tconst onResize = opts.onResize;\n\tconst onResizeRef = useRef< ResizeHandler | undefined >( undefined );\n\tonResizeRef.current = onResize;\n\tconst round = opts.round || Math.round;\n\n\t// Using a single instance throughout the hook's lifetime\n\tconst resizeObserverRef = useRef< {\n\t\tbox?: ResizeObserverBoxOptions;\n\t\tround?: RoundingFunction;\n\t\tinstance: ResizeObserver;\n\t} >();\n\n\tconst [ size, setSize ] = useState< {\n\t\twidth?: number;\n\t\theight?: number;\n\t} >( {\n\t\twidth: undefined,\n\t\theight: undefined,\n\t} );\n\n\t// In certain edge cases the RO might want to report a size change just after\n\t// the component unmounted.\n\tconst didUnmount = useRef( false );\n\tuseEffect( () => {\n\t\tdidUnmount.current = false;\n\t\treturn () => {\n\t\t\tdidUnmount.current = true;\n\t\t};\n\t}, [] );\n\n\t// Using a ref to track the previous width / height to avoid unnecessary renders.\n\tconst previous: {\n\t\tcurrent: {\n\t\t\twidth?: number;\n\t\t\theight?: number;\n\t\t};\n\t} = useRef( {\n\t\twidth: undefined,\n\t\theight: undefined,\n\t} );\n\n\t// This block is kinda like a useEffect, only it's called whenever a new\n\t// element could be resolved based on the ref option. It also has a cleanup\n\t// function.\n\tconst refCallback = useResolvedElement< T >(\n\t\tuseCallback(\n\t\t\t( element ) => {\n\t\t\t\t// We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n\t\t\t\t// This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n\t\t\t\tif (\n\t\t\t\t\t! resizeObserverRef.current ||\n\t\t\t\t\tresizeObserverRef.current.box !== opts.box ||\n\t\t\t\t\tresizeObserverRef.current.round !== round\n\t\t\t\t) {\n\t\t\t\t\tresizeObserverRef.current = {\n\t\t\t\t\t\tbox: opts.box,\n\t\t\t\t\t\tround,\n\t\t\t\t\t\tinstance: new ResizeObserver( ( entries ) => {\n\t\t\t\t\t\t\tconst entry = entries[ 0 ];\n\n\t\t\t\t\t\t\tlet boxProp:\n\t\t\t\t\t\t\t\t| 'borderBoxSize'\n\t\t\t\t\t\t\t\t| 'contentBoxSize'\n\t\t\t\t\t\t\t\t| 'devicePixelContentBoxSize' = 'borderBoxSize';\n\t\t\t\t\t\t\tif ( opts.box === 'border-box' ) {\n\t\t\t\t\t\t\t\tboxProp = 'borderBoxSize';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tboxProp =\n\t\t\t\t\t\t\t\t\topts.box === 'device-pixel-content-box'\n\t\t\t\t\t\t\t\t\t\t? 'devicePixelContentBoxSize'\n\t\t\t\t\t\t\t\t\t\t: 'contentBoxSize';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst reportedWidth = extractSize(\n\t\t\t\t\t\t\t\tentry,\n\t\t\t\t\t\t\t\tboxProp,\n\t\t\t\t\t\t\t\t'inlineSize'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst reportedHeight = extractSize(\n\t\t\t\t\t\t\t\tentry,\n\t\t\t\t\t\t\t\tboxProp,\n\t\t\t\t\t\t\t\t'blockSize'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst newWidth = reportedWidth\n\t\t\t\t\t\t\t\t? round( reportedWidth )\n\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst newHeight = reportedHeight\n\t\t\t\t\t\t\t\t? round( reportedHeight )\n\t\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tprevious.current.width !== newWidth ||\n\t\t\t\t\t\t\t\tprevious.current.height !== newHeight\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst newSize = {\n\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tprevious.current.width = newWidth;\n\t\t\t\t\t\t\t\tprevious.current.height = newHeight;\n\t\t\t\t\t\t\t\tif ( onResizeRef.current ) {\n\t\t\t\t\t\t\t\t\tonResizeRef.current( newSize );\n\t\t\t\t\t\t\t\t} else if ( ! didUnmount.current ) {\n\t\t\t\t\t\t\t\t\tsetSize( newSize );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tresizeObserverRef.current.instance.observe( element, {\n\t\t\t\t\tbox: opts.box,\n\t\t\t\t} );\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif ( resizeObserverRef.current ) {\n\t\t\t\t\t\tresizeObserverRef.current.instance.unobserve( element );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ opts.box, round ]\n\t\t),\n\t\topts.ref\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tref: refCallback,\n\t\t\twidth: size.width,\n\t\t\theight: size.height,\n\t\t} ),\n\t\t[ refCallback, size ? size.width : null, size ? size.height : null ]\n\t);\n}\n\n/**\n * Hook which allows to listen the resize event of any target element when it changes sizes.\n * _Note: `useResizeObserver` will report `null` until after first render.\n *\n * @example\n *\n * ```js\n * const App = () => {\n * \tconst [ resizeListener, sizes ] = useResizeObserver();\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t{ resizeListener }\n * \t\t\tYour content here\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nexport default function useResizeAware(): [\n\tReactElement,\n\t{ width: number | null; height: number | null },\n] {\n\tconst { ref, width, height } = useResizeObserver();\n\tconst sizes = useMemo( () => {\n\t\treturn { width: width ?? null, height: height ?? null };\n\t}, [ width, height ] );\n\tconst resizeListener = (\n\t\t<div\n\t\t\tstyle={ {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\tbottom: 0,\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\topacity: 0,\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tzIndex: -1,\n\t\t\t} }\n\t\t\taria-hidden=\"true\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n\treturn [ resizeListener, sizes ];\n}\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,OAAO,EACPC,MAAM,EACNC,WAAW,EACXC,SAAS,EACTC,QAAQ,QACF,oBAAoB;AAK3B;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAC1BC,UAAgD,EAChDC,YAAwC,EACrB;EACnB,MAAMC,kBAAkB,GAAGP,MAAM,CAAc,IAAK,CAAC;EACrD,MAAMQ,aAAa,GAAGR,MAAM,CAGhB,IAAK,CAAC;EAClB,MAAMS,UAAU,GAAGT,MAAM,CAA8B,CAAC;EAExD,MAAMU,cAAc,GAAGT,WAAW,CAAE,MAAM;IACzC,IA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,OAAO,CAAE,MAAM;IAC5B,OAAO;MAAE+B,KAAK,EAAEA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI;MAAEC,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI;IAAK,CAAC;EACxD,CAAC,EAAE,CAAED,KAAK,EAAEC,MAAM,CAAG,CAAC;EACtB,MAAMkB,cAAc,GACnBC,aAAA;IACCC,KAAK,EAAG;MACPC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,aAAa,EAAE,MAAM;MACrBC,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAE,QAAQ;MAClBC,MAAM,EAAE,CAAC;IACV,CAAG;IACH,eAAY,MAAM;IAClBd,GAAG,EAAGA;EAAK,CACX,CACD;EACD,OAAO,CAAEG,cAAc,EAAED,KAAK,CAAE;AACjC"}
1
+ {"version":3,"names":["useMemo","useRef","useCallback","useEffect","useState","useResolvedElement","subscriber","refOrElement","callbackRefElement","lastReportRef","cleanupRef","callSubscriber","element","current","HTMLElement","reporter","extractSize","entry","boxProp","sizeType","contentRect","undefined","useResizeObserver","opts","onResize","onResizeRef","round","Math","resizeObserverRef","size","setSize","width","height","didUnmount","previous","refCallback","box","instance","ResizeObserver","entries","reportedWidth","reportedHeight","newWidth","newHeight","newSize","observe","unobserve","ref","useResizeAware","sizes","resizeListener","createElement","style","position","top","left","right","bottom","pointerEvents","opacity","overflow","zIndex"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, RefCallback, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseMemo,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\ntype SubscriberCleanup = () => void;\ntype SubscriberResponse = SubscriberCleanup | void;\n\n// This of course could've been more streamlined with internal state instead of\n// refs, but then host hooks / components could not opt out of renders.\n// This could've been exported to its own module, but the current build doesn't\n// seem to work with module imports and I had no more time to spend on this...\nfunction useResolvedElement< T extends HTMLElement >(\n\tsubscriber: ( element: T ) => SubscriberResponse,\n\trefOrElement?: T | RefObject< T > | null\n): RefCallback< T > {\n\tconst callbackRefElement = useRef< T | null >( null );\n\tconst lastReportRef = useRef< {\n\t\treporter: () => void;\n\t\telement: T | null;\n\t} | null >( null );\n\tconst cleanupRef = useRef< SubscriberResponse | null >();\n\n\tconst callSubscriber = useCallback( () => {\n\t\tlet element = null;\n\t\tif ( callbackRefElement.current ) {\n\t\t\telement = callbackRefElement.current;\n\t\t} else if ( refOrElement ) {\n\t\t\tif ( refOrElement instanceof HTMLElement ) {\n\t\t\t\telement = refOrElement;\n\t\t\t} else {\n\t\t\t\telement = refOrElement.current;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tlastReportRef.current &&\n\t\t\tlastReportRef.current.element === element &&\n\t\t\tlastReportRef.current.reporter === callSubscriber\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( cleanupRef.current ) {\n\t\t\tcleanupRef.current();\n\t\t\t// Making sure the cleanup is not called accidentally multiple times.\n\t\t\tcleanupRef.current = null;\n\t\t}\n\t\tlastReportRef.current = {\n\t\t\treporter: callSubscriber,\n\t\t\telement,\n\t\t};\n\n\t\t// Only calling the subscriber, if there's an actual element to report.\n\t\tif ( element ) {\n\t\t\tcleanupRef.current = subscriber( element );\n\t\t}\n\t}, [ refOrElement, subscriber ] );\n\n\t// On each render, we check whether a ref changed, or if we got a new raw\n\t// element.\n\tuseEffect( () => {\n\t\t// With this we're *technically* supporting cases where ref objects' current value changes, but only if there's a\n\t\t// render accompanying that change as well.\n\t\t// To guarantee we always have the right element, one must use the ref callback provided instead, but we support\n\t\t// RefObjects to make the hook API more convenient in certain cases.\n\t\tcallSubscriber();\n\t}, [ callSubscriber ] );\n\n\treturn useCallback< RefCallback< T > >(\n\t\t( element ) => {\n\t\t\tcallbackRefElement.current = element;\n\t\t\tcallSubscriber();\n\t\t},\n\t\t[ callSubscriber ]\n\t);\n}\n\ntype ObservedSize = {\n\twidth: number | undefined;\n\theight: number | undefined;\n};\n\ntype ResizeHandler = ( size: ObservedSize ) => void;\n\ntype HookResponse< T extends HTMLElement > = {\n\tref: RefCallback< T >;\n} & ObservedSize;\n\n// Declaring my own type here instead of using the one provided by TS (available since 4.2.2), because this way I'm not\n// forcing consumers to use a specific TS version.\ntype ResizeObserverBoxOptions =\n\t| 'border-box'\n\t| 'content-box'\n\t| 'device-pixel-content-box';\n\ndeclare global {\n\tinterface ResizeObserverEntry {\n\t\treadonly devicePixelContentBoxSize: ReadonlyArray< ResizeObserverSize >;\n\t}\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nconst extractSize = (\n\tentry: ResizeObserverEntry,\n\tboxProp: 'borderBoxSize' | 'contentBoxSize' | 'devicePixelContentBoxSize',\n\tsizeType: keyof ResizeObserverSize\n): number | undefined => {\n\tif ( ! entry[ boxProp ] ) {\n\t\tif ( boxProp === 'contentBoxSize' ) {\n\t\t\t// The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n\t\t\t// See the 6th step in the description for the RO algorithm:\n\t\t\t// https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n\t\t\t// > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n\t\t\t// In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n\t\t\treturn entry.contentRect[\n\t\t\t\tsizeType === 'inlineSize' ? 'width' : 'height'\n\t\t\t];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t// A couple bytes smaller than calling Array.isArray() and just as effective here.\n\treturn entry[ boxProp ][ 0 ]\n\t\t? entry[ boxProp ][ 0 ][ sizeType ]\n\t\t: // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n\t\t // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n\t\t // @ts-ignore\n\t\t entry[ boxProp ][ sizeType ];\n};\n\ntype RoundingFunction = ( n: number ) => number;\n\nfunction useResizeObserver< T extends HTMLElement >(\n\topts: {\n\t\tref?: RefObject< T > | T | null | undefined;\n\t\tonResize?: ResizeHandler;\n\t\tbox?: ResizeObserverBoxOptions;\n\t\tround?: RoundingFunction;\n\t} = {}\n): HookResponse< T > {\n\t// Saving the callback as a ref. With this, I don't need to put onResize in the\n\t// effect dep array, and just passing in an anonymous function without memoising\n\t// will not reinstantiate the hook's ResizeObserver.\n\tconst onResize = opts.onResize;\n\tconst onResizeRef = useRef< ResizeHandler | undefined >( undefined );\n\tonResizeRef.current = onResize;\n\tconst round = opts.round || Math.round;\n\n\t// Using a single instance throughout the hook's lifetime\n\tconst resizeObserverRef = useRef< {\n\t\tbox?: ResizeObserverBoxOptions;\n\t\tround?: RoundingFunction;\n\t\tinstance: ResizeObserver;\n\t} >();\n\n\tconst [ size, setSize ] = useState< {\n\t\twidth?: number;\n\t\theight?: number;\n\t} >( {\n\t\twidth: undefined,\n\t\theight: undefined,\n\t} );\n\n\t// In certain edge cases the RO might want to report a size change just after\n\t// the component unmounted.\n\tconst didUnmount = useRef( false );\n\tuseEffect( () => {\n\t\tdidUnmount.current = false;\n\t\treturn () => {\n\t\t\tdidUnmount.current = true;\n\t\t};\n\t}, [] );\n\n\t// Using a ref to track the previous width / height to avoid unnecessary renders.\n\tconst previous: {\n\t\tcurrent: {\n\t\t\twidth?: number;\n\t\t\theight?: number;\n\t\t};\n\t} = useRef( {\n\t\twidth: undefined,\n\t\theight: undefined,\n\t} );\n\n\t// This block is kinda like a useEffect, only it's called whenever a new\n\t// element could be resolved based on the ref option. It also has a cleanup\n\t// function.\n\tconst refCallback = useResolvedElement< T >(\n\t\tuseCallback(\n\t\t\t( element ) => {\n\t\t\t\t// We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n\t\t\t\t// This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n\t\t\t\tif (\n\t\t\t\t\t! resizeObserverRef.current ||\n\t\t\t\t\tresizeObserverRef.current.box !== opts.box ||\n\t\t\t\t\tresizeObserverRef.current.round !== round\n\t\t\t\t) {\n\t\t\t\t\tresizeObserverRef.current = {\n\t\t\t\t\t\tbox: opts.box,\n\t\t\t\t\t\tround,\n\t\t\t\t\t\tinstance: new ResizeObserver( ( entries ) => {\n\t\t\t\t\t\t\tconst entry = entries[ 0 ];\n\n\t\t\t\t\t\t\tlet boxProp:\n\t\t\t\t\t\t\t\t| 'borderBoxSize'\n\t\t\t\t\t\t\t\t| 'contentBoxSize'\n\t\t\t\t\t\t\t\t| 'devicePixelContentBoxSize' = 'borderBoxSize';\n\t\t\t\t\t\t\tif ( opts.box === 'border-box' ) {\n\t\t\t\t\t\t\t\tboxProp = 'borderBoxSize';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tboxProp =\n\t\t\t\t\t\t\t\t\topts.box === 'device-pixel-content-box'\n\t\t\t\t\t\t\t\t\t\t? 'devicePixelContentBoxSize'\n\t\t\t\t\t\t\t\t\t\t: 'contentBoxSize';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst reportedWidth = extractSize(\n\t\t\t\t\t\t\t\tentry,\n\t\t\t\t\t\t\t\tboxProp,\n\t\t\t\t\t\t\t\t'inlineSize'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst reportedHeight = extractSize(\n\t\t\t\t\t\t\t\tentry,\n\t\t\t\t\t\t\t\tboxProp,\n\t\t\t\t\t\t\t\t'blockSize'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst newWidth = reportedWidth\n\t\t\t\t\t\t\t\t? round( reportedWidth )\n\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst newHeight = reportedHeight\n\t\t\t\t\t\t\t\t? round( reportedHeight )\n\t\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tprevious.current.width !== newWidth ||\n\t\t\t\t\t\t\t\tprevious.current.height !== newHeight\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst newSize = {\n\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tprevious.current.width = newWidth;\n\t\t\t\t\t\t\t\tprevious.current.height = newHeight;\n\t\t\t\t\t\t\t\tif ( onResizeRef.current ) {\n\t\t\t\t\t\t\t\t\tonResizeRef.current( newSize );\n\t\t\t\t\t\t\t\t} else if ( ! didUnmount.current ) {\n\t\t\t\t\t\t\t\t\tsetSize( newSize );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tresizeObserverRef.current.instance.observe( element, {\n\t\t\t\t\tbox: opts.box,\n\t\t\t\t} );\n\n\t\t\t\treturn () => {\n\t\t\t\t\tif ( resizeObserverRef.current ) {\n\t\t\t\t\t\tresizeObserverRef.current.instance.unobserve( element );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ opts.box, round ]\n\t\t),\n\t\topts.ref\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tref: refCallback,\n\t\t\twidth: size.width,\n\t\t\theight: size.height,\n\t\t} ),\n\t\t[ refCallback, size ? size.width : null, size ? size.height : null ]\n\t);\n}\n\n/**\n * Hook which allows to listen the resize event of any target element when it changes sizes.\n * _Note: `useResizeObserver` will report `null` until after first render.\n *\n * @example\n *\n * ```js\n * const App = () => {\n * \tconst [ resizeListener, sizes ] = useResizeObserver();\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t{ resizeListener }\n * \t\t\tYour content here\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nexport default function useResizeAware(): [\n\tReactElement,\n\t{ width: number | null; height: number | null },\n] {\n\tconst { ref, width, height } = useResizeObserver();\n\tconst sizes = useMemo( () => {\n\t\treturn { width: width ?? null, height: height ?? null };\n\t}, [ width, height ] );\n\tconst resizeListener = (\n\t\t<div\n\t\t\tstyle={ {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\tbottom: 0,\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\topacity: 0,\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tzIndex: -1,\n\t\t\t} }\n\t\t\taria-hidden=\"true\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n\treturn [ resizeListener, sizes ];\n}\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,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,WAAW,EAAEN,IAAI,GAAGA,IAAI,CAACE,KAAK,GAAG,IAAI,EAAEF,IAAI,GAAGA,IAAI,CAACG,MAAM,GAAG,IAAI,CACnE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASgB,cAAcA,CAAA,EAGpC;EACD,MAAM;IAAED,GAAG;IAAEhB,KAAK;IAAEC;EAAO,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EAClD,MAAM2B,KAAK,GAAGjD,OAAO,CAAE,MAAM;IAC5B,OAAO;MAAE+B,KAAK,EAAEA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI;MAAEC,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI;IAAK,CAAC;EACxD,CAAC,EAAE,CAAED,KAAK,EAAEC,MAAM,CAAG,CAAC;EACtB,MAAMkB,cAAc,GACnBC,aAAA;IACCC,KAAK,EAAG;MACPC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,aAAa,EAAE,MAAM;MACrBC,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAE,QAAQ;MAClBC,MAAM,EAAE,CAAC;IACV,CAAG;IACH,eAAY,MAAM;IAClBd,GAAG,EAAGA;EAAK,CACX,CACD;EACD,OAAO,CAAEG,cAAc,EAAED,KAAK,CAAE;AACjC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["View","StyleSheet","useState","useCallback","useResizeObserver","measurements","setMeasurements","onLayout","nativeEvent","width","height","layout","prevState","Math","floor","observer","createElement","testID","style","absoluteFill"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/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;AACA,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGJ,QAAQ,CAAE,IAAK,CAAC;EAE1D,MAAMK,QAAQ,GAAGJ,WAAW,CAAE,CAAE;IAAEK;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,GACbC,aAAA,CAAChB,IAAI;IACJiB,MAAM,EAAC,iBAAiB;IACxBC,KAAK,EAAGjB,UAAU,CAACkB,YAAc;IACjCZ,QAAQ,EAAGA;EAAU,CACrB,CACD;EAED,OAAO,CAAEQ,QAAQ,EAAEV,YAAY,CAAE;AAClC,CAAC;AAED,eAAeD,iBAAiB"}
1
+ {"version":3,"names":["View","StyleSheet","useState","useCallback","useResizeObserver","measurements","setMeasurements","onLayout","nativeEvent","width","height","layout","prevState","Math","floor","observer","createElement","testID","style","absoluteFill"],"sources":["@wordpress/compose/src/hooks/use-resize-observer/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;AACA,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGJ,QAAQ,CAAE,IAAK,CAAC;EAE1D,MAAMK,QAAQ,GAAGJ,WAAW,CAAE,CAAE;IAAEK;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,GACbC,aAAA,CAAChB,IAAI;IACJiB,MAAM,EAAC,iBAAiB;IACxBC,KAAK,EAAGjB,UAAU,CAACkB,YAAc;IACjCZ,QAAQ,EAAGA;EAAU,CACrB,CACD;EAED,OAAO,CAAEQ,QAAQ,EAAEV,YAAY,CAAE;AAClC,CAAC;AAED,eAAeD,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["createUndoManager","useCallback","useReducer","undoRedoReducer","state","action","type","undoRecord","manager","undo","value","changes","prop","from","redoRecord","redo","to","addRecord","id","isStaged","initReducer","useStateWithHistory","initialValue","dispatch","setValue","newValue","hasUndo","hasRedo"],"sources":["@wordpress/compose/src/hooks/use-state-with-history/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createUndoManager } from '@wordpress/undo-manager';\nimport { useCallback, useReducer } from '@wordpress/element';\nimport type { UndoManager } from '@wordpress/undo-manager';\n\ntype UndoRedoState< T > = {\n\tmanager: UndoManager;\n\tvalue: T;\n};\n\nfunction undoRedoReducer< T >(\n\tstate: UndoRedoState< T >,\n\taction:\n\t\t| { type: 'UNDO' }\n\t\t| { type: 'REDO' }\n\t\t| { type: 'RECORD'; value: T; isStaged: boolean }\n): UndoRedoState< T > {\n\tswitch ( action.type ) {\n\t\tcase 'UNDO': {\n\t\t\tconst undoRecord = state.manager.undo();\n\t\t\tif ( undoRecord ) {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tvalue: undoRecord[ 0 ].changes.prop.from,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn state;\n\t\t}\n\t\tcase 'REDO': {\n\t\t\tconst redoRecord = state.manager.redo();\n\t\t\tif ( redoRecord ) {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tvalue: redoRecord[ 0 ].changes.prop.to,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn state;\n\t\t}\n\t\tcase 'RECORD': {\n\t\t\tstate.manager.addRecord(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'object',\n\t\t\t\t\t\tchanges: {\n\t\t\t\t\t\t\tprop: { from: state.value, to: action.value },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\taction.isStaged\n\t\t\t);\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tvalue: action.value,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nfunction initReducer< T >( value: T ) {\n\treturn {\n\t\tmanager: createUndoManager(),\n\t\tvalue,\n\t};\n}\n\n/**\n * useState with undo/redo history.\n *\n * @param initialValue Initial value.\n * @return Value, setValue, hasUndo, hasRedo, undo, redo.\n */\nexport default function useStateWithHistory< T >( initialValue: T ) {\n\tconst [ state, dispatch ] = useReducer(\n\t\tundoRedoReducer,\n\t\tinitialValue,\n\t\tinitReducer\n\t);\n\n\treturn {\n\t\tvalue: state.value,\n\t\tsetValue: useCallback( ( newValue: T, isStaged: boolean ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'RECORD',\n\t\t\t\tvalue: newValue,\n\t\t\t\tisStaged,\n\t\t\t} );\n\t\t}, [] ),\n\t\thasUndo: state.manager.hasUndo(),\n\t\thasRedo: state.manager.hasRedo(),\n\t\tundo: useCallback( () => {\n\t\t\tdispatch( { type: 'UNDO' } );\n\t\t}, [] ),\n\t\tredo: useCallback( () => {\n\t\t\tdispatch( { type: 'REDO' } );\n\t\t}, [] ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,WAAW,EAAEC,UAAU,QAAQ,oBAAoB;AAQ5D,SAASC,eAAeA,CACvBC,KAAyB,EACzBC,MAGkD,EAC7B;EACrB,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,MAAM;MAAE;QACZ,MAAMC,UAAU,GAAGH,KAAK,CAACI,OAAO,CAACC,IAAI,CAAC,CAAC;QACvC,IAAKF,UAAU,EAAG;UACjB,OAAO;YACN,GAAGH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;QACfN;MACD,CAAE,CAAC;IACJ,CAAC,EAAE,EAAG,CAAC;IACPO,OAAO,EAAEtB,KAAK,CAACI,OAAO,CAACkB,OAAO,CAAC,CAAC;IAChCC,OAAO,EAAEvB,KAAK,CAACI,OAAO,CAACmB,OAAO,CAAC,CAAC;IAChClB,IAAI,EAAER,WAAW,CAAE,MAAM;MACxBsB,QAAQ,CAAE;QAAEjB,IAAI,EAAE;MAAO,CAAE,CAAC;IAC7B,CAAC,EAAE,EAAG,CAAC;IACPS,IAAI,EAAEd,WAAW,CAAE,MAAM;MACxBsB,QAAQ,CAAE;QAAEjB,IAAI,EAAE;MAAO,CAAE,CAAC;IAC7B,CAAC,EAAE,EAAG;EACP,CAAC;AACF"}
1
+ {"version":3,"names":["createUndoManager","useCallback","useReducer","undoRedoReducer","state","action","type","undoRecord","manager","undo","value","changes","prop","from","redoRecord","redo","to","addRecord","id","isStaged","initReducer","useStateWithHistory","initialValue","dispatch","setValue","newValue","hasUndo","hasRedo"],"sources":["@wordpress/compose/src/hooks/use-state-with-history/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createUndoManager } from '@wordpress/undo-manager';\nimport { useCallback, useReducer } from '@wordpress/element';\nimport type { UndoManager } from '@wordpress/undo-manager';\n\ntype UndoRedoState< T > = {\n\tmanager: UndoManager;\n\tvalue: T;\n};\n\nfunction undoRedoReducer< T >(\n\tstate: UndoRedoState< T >,\n\taction:\n\t\t| { type: 'UNDO' }\n\t\t| { type: 'REDO' }\n\t\t| { type: 'RECORD'; value: T; isStaged: boolean }\n): UndoRedoState< T > {\n\tswitch ( action.type ) {\n\t\tcase 'UNDO': {\n\t\t\tconst undoRecord = state.manager.undo();\n\t\t\tif ( undoRecord ) {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tvalue: undoRecord[ 0 ].changes.prop.from,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn state;\n\t\t}\n\t\tcase 'REDO': {\n\t\t\tconst redoRecord = state.manager.redo();\n\t\t\tif ( redoRecord ) {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tvalue: redoRecord[ 0 ].changes.prop.to,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn state;\n\t\t}\n\t\tcase 'RECORD': {\n\t\t\tstate.manager.addRecord(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'object',\n\t\t\t\t\t\tchanges: {\n\t\t\t\t\t\t\tprop: { from: state.value, to: action.value },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\taction.isStaged\n\t\t\t);\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tvalue: action.value,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nfunction initReducer< T >( value: T ) {\n\treturn {\n\t\tmanager: createUndoManager(),\n\t\tvalue,\n\t};\n}\n\n/**\n * useState with undo/redo history.\n *\n * @param initialValue Initial value.\n * @return Value, setValue, hasUndo, hasRedo, undo, redo.\n */\nexport default function useStateWithHistory< T >( initialValue: T ) {\n\tconst [ state, dispatch ] = useReducer(\n\t\tundoRedoReducer,\n\t\tinitialValue,\n\t\tinitReducer\n\t);\n\n\treturn {\n\t\tvalue: state.value,\n\t\tsetValue: useCallback( ( newValue: T, isStaged: boolean ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'RECORD',\n\t\t\t\tvalue: newValue,\n\t\t\t\tisStaged,\n\t\t\t} );\n\t\t}, [] ),\n\t\thasUndo: state.manager.hasUndo(),\n\t\thasRedo: state.manager.hasRedo(),\n\t\tundo: useCallback( () => {\n\t\t\tdispatch( { type: 'UNDO' } );\n\t\t}, [] ),\n\t\tredo: useCallback( () => {\n\t\t\tdispatch( { type: 'REDO' } );\n\t\t}, [] ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,WAAW,EAAEC,UAAU,QAAQ,oBAA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ACrCC,eAAe,EACfmB,YAAY,EACZF,WACD,CAAC;EAED,OAAO;IACNV,KAAK,EAAEN,KAAK,CAACM,KAAK;IAClBc,QAAQ,EAAEvB,WAAW,CAAE,CAAEwB,QAAW,EAAEN,QAAiB,KAAM;MAC5DI,QAAQ,CAAE;QACTjB,IAAI,EAAE,QAAQ;QACdI,KAAK,EAAEe,QAAQ;QACfN;MACD,CAAE,CAAC;IACJ,CAAC,EAAE,EAAG,CAAC;IACPO,OAAO,EAAEtB,KAAK,CAACI,OAAO,CAACkB,OAAO,CAAC,CAAC;IAChCC,OAAO,EAAEvB,KAAK,CAACI,OAAO,CAACmB,OAAO,CAAC,CAAC;IAChClB,IAAI,EAAER,WAAW,CAAE,MAAM;MACxBsB,QAAQ,CAAE;QAAEjB,IAAI,EAAE;MAAO,CAAE,CAAC;IAC7B,CAAC,EAAE,EAAG,CAAC;IACPS,IAAI,EAAEd,WAAW,CAAE,MAAM;MACxBsB,QAAQ,CAAE;QAAEjB,IAAI,EAAE;MAAO,CAAE,CAAC;IAC7B,CAAC,EAAE,EAAG;EACP,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useMemoOne","useEffect","throttle","useThrottle","fn","wait","options","throttled","cancel"],"sources":["@wordpress/compose/src/hooks/use-throttle/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useMemoOne } from 'use-memo-one';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { throttle } from '../../utils/throttle';\n\n/**\n * Throttles a function similar to Lodash's `throttle`. A new throttled function will\n * be returned and any scheduled calls cancelled if any of the arguments change,\n * including the function to throttle, so please wrap functions created on\n * render in components in `useCallback`.\n *\n * @see https://docs-lodash.com/v4/throttle/\n *\n * @template {(...args: any[]) => void} TFunc\n *\n * @param {TFunc} fn The function to throttle.\n * @param {number} [wait] The number of milliseconds to throttle invocations to.\n * @param {import('../../utils/throttle').ThrottleOptions} [options] The options object. See linked documentation for details.\n * @return {import('../../utils/debounce').DebouncedFunc<TFunc>} Throttled function.\n */\nexport default function useThrottle( fn, wait, options ) {\n\tconst throttled = useMemoOne(\n\t\t() => throttle( fn, wait ?? 0, options ),\n\t\t[ fn, wait, options ]\n\t);\n\tuseEffect( () => () => throttled.cancel(), [ throttled ] );\n\treturn throttled;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,sBAAsB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAEC,EAAE,EAAEC,IAAI,EAAEC,OAAO,EAAG;EACxD,MAAMC,SAAS,GAAGP,UAAU,CAC3B,MAAME,QAAQ,CAAEE,EAAE,EAAEC,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,CAAC,EAAEC,OAAQ,CAAC,EACxC,CAAEF,EAAE,EAAEC,IAAI,EAAEC,OAAO,CACpB,CAAC;EACDL,SAAS,CAAE,MAAM,MAAMM,SAAS,CAACC,MAAM,CAAC,CAAC,EAAE,CAAED,SAAS,CAAG,CAAC;EAC1D,OAAOA,SAAS;AACjB"}
1
+ {"version":3,"names":["useMemoOne","useEffect","throttle","useThrottle","fn","wait","options","throttled","cancel"],"sources":["@wordpress/compose/src/hooks/use-throttle/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useMemoOne } from 'use-memo-one';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { throttle } from '../../utils/throttle';\n\n/**\n * Throttles a function similar to Lodash's `throttle`. A new throttled function will\n * be returned and any scheduled calls cancelled if any of the arguments change,\n * including the function to throttle, so please wrap functions created on\n * render in components in `useCallback`.\n *\n * @see https://docs-lodash.com/v4/throttle/\n *\n * @template {(...args: any[]) => void} TFunc\n *\n * @param {TFunc} fn The function to throttle.\n * @param {number} [wait] The number of milliseconds to throttle invocations to.\n * @param {import('../../utils/throttle').ThrottleOptions} [options] The options object. See linked documentation for details.\n * @return {import('../../utils/debounce').DebouncedFunc<TFunc>} Throttled function.\n */\nexport default function useThrottle( fn, wait, options ) {\n\tconst throttled = useMemoOne(\n\t\t() => throttle( fn, wait ?? 0, options ),\n\t\t[ fn, wait, options ]\n\t);\n\tuseEffect( () => () => throttled.cancel(), [ throttled ] );\n\treturn throttled;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,sBAAsB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAEC,EAAE,EAAEC,IAAI,EAAEC,OAAO,EAAG;EACxD,MAAMC,SAAS,GAAGP,UAAU,CAC3B,MAAME,QAAQ,CAAEE,EAAE,EAAEC,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,CAAC,EAAEC,OAAQ,CAAC,EACxC,CAAEF,EAAE,EAAEC,IAAI,EAAEC,OAAO,CACpB,CAAC;EACDL,SAAS,CAAE,MAAM,MAAMM,SAAS,CAACC,MAAM,CAAC,CAAC,EAAE,CAAED,SAAS,CAAG,CAAC;EAC1D,OAAOA,SAAS;AACjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","useMediaQuery","BREAKPOINTS","huge","wide","large","medium","small","mobile","CONDITIONS","OPERATOR_EVALUATORS",">=","breakpointValue","width","<","ViewportMatchWidthContext","useViewportMatch","breakpoint","operator","simulatedWidth","mediaQuery","mediaQueryResult","undefined","__experimentalWidthProvider","Provider"],"sources":["@wordpress/compose/src/hooks/use-viewport-match/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMediaQuery from '../use-media-query';\n\n/**\n * @typedef {\"huge\" | \"wide\" | \"large\" | \"medium\" | \"small\" | \"mobile\"} WPBreakpoint\n */\n\n/**\n * Hash of breakpoint names with pixel width at which it becomes effective.\n *\n * @see _breakpoints.scss\n *\n * @type {Record<WPBreakpoint, number>}\n */\nconst BREAKPOINTS = {\n\thuge: 1440,\n\twide: 1280,\n\tlarge: 960,\n\tmedium: 782,\n\tsmall: 600,\n\tmobile: 480,\n};\n\n/**\n * @typedef {\">=\" | \"<\"} WPViewportOperator\n */\n\n/**\n * Object mapping media query operators to the condition to be used.\n *\n * @type {Record<WPViewportOperator, string>}\n */\nconst CONDITIONS = {\n\t'>=': 'min-width',\n\t'<': 'max-width',\n};\n\n/**\n * Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.\n *\n * @type {Record<WPViewportOperator, (breakpointValue: number, width: number) => boolean>}\n */\nconst OPERATOR_EVALUATORS = {\n\t'>=': ( breakpointValue, width ) => width >= breakpointValue,\n\t'<': ( breakpointValue, width ) => width < breakpointValue,\n};\n\nconst ViewportMatchWidthContext = createContext(\n\t/** @type {null | number} */ ( null )\n);\n\n/**\n * Returns true if the viewport matches the given query, or false otherwise.\n *\n * @param {WPBreakpoint} breakpoint Breakpoint size name.\n * @param {WPViewportOperator} [operator=\">=\"] Viewport operator.\n *\n * @example\n *\n * ```js\n * useViewportMatch( 'huge', '<' );\n * useViewportMatch( 'medium' );\n * ```\n *\n * @return {boolean} Whether viewport matches query.\n */\nconst useViewportMatch = ( breakpoint, operator = '>=' ) => {\n\tconst simulatedWidth = useContext( ViewportMatchWidthContext );\n\tconst mediaQuery =\n\t\t! simulatedWidth &&\n\t\t`(${ CONDITIONS[ operator ] }: ${ BREAKPOINTS[ breakpoint ] }px)`;\n\tconst mediaQueryResult = useMediaQuery( mediaQuery || undefined );\n\tif ( simulatedWidth ) {\n\t\treturn OPERATOR_EVALUATORS[ operator ](\n\t\t\tBREAKPOINTS[ breakpoint ],\n\t\t\tsimulatedWidth\n\t\t);\n\t}\n\treturn mediaQueryResult;\n};\n\nuseViewportMatch.__experimentalWidthProvider =\n\tViewportMatchWidthContext.Provider;\n\nexport default useViewportMatch;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,OAAOC,aAAa,MAAM,oBAAoB;;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG;EACnBC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE;AACT,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG;EAClB,IAAI,EAAE,WAAW;EACjB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG;EAC3B,IAAI,EAAEC,CAAEC,eAAe,EAAEC,KAAK,KAAMA,KAAK,IAAID,eAAe;EAC5D,GAAG,EAAEE,CAAEF,eAAe,EAAEC,KAAK,KAAMA,KAAK,GAAGD;AAC5C,CAAC;AAED,MAAMG,yBAAyB,GAAGhB,aAAa,EAC9C,4BAA+B,IAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,gBAAgB,GAAGA,CAAEC,UAAU,EAAEC,QAAQ,GAAG,IAAI,KAAM;EAC3D,MAAMC,cAAc,GAAGnB,UAAU,CAAEe,yBAA0B,CAAC;EAC9D,MAAMK,UAAU,GACf,CAAED,cAAc,IACf,IAAIV,UAAU,CAAES,QAAQ,CAAI,KAAKhB,WAAW,CAAEe,UAAU,CAAI,KAAI;EAClE,MAAMI,gBAAgB,GAAGpB,aAAa,CAAEmB,UAAU,IAAIE,SAAU,CAAC;EACjE,IAAKH,cAAc,EAAG;IACrB,OAAOT,mBAAmB,CAAEQ,QAAQ,CAAE,CACrChB,WAAW,CAAEe,UAAU,CAAE,EACzBE,cACD,CAAC;EACF;EACA,OAAOE,gBAAgB;AACxB,CAAC;AAEDL,gBAAgB,CAACO,2BAA2B,GAC3CR,yBAAyB,CAACS,QAAQ;AAEnC,eAAeR,gBAAgB"}
1
+ {"version":3,"names":["createContext","useContext","useMediaQuery","BREAKPOINTS","huge","wide","large","medium","small","mobile","CONDITIONS","OPERATOR_EVALUATORS",">=","breakpointValue","width","<","ViewportMatchWidthContext","useViewportMatch","breakpoint","operator","simulatedWidth","mediaQuery","mediaQueryResult","undefined","__experimentalWidthProvider","Provider"],"sources":["@wordpress/compose/src/hooks/use-viewport-match/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMediaQuery from '../use-media-query';\n\n/**\n * @typedef {\"huge\" | \"wide\" | \"large\" | \"medium\" | \"small\" | \"mobile\"} WPBreakpoint\n */\n\n/**\n * Hash of breakpoint names with pixel width at which it becomes effective.\n *\n * @see _breakpoints.scss\n *\n * @type {Record<WPBreakpoint, number>}\n */\nconst BREAKPOINTS = {\n\thuge: 1440,\n\twide: 1280,\n\tlarge: 960,\n\tmedium: 782,\n\tsmall: 600,\n\tmobile: 480,\n};\n\n/**\n * @typedef {\">=\" | \"<\"} WPViewportOperator\n */\n\n/**\n * Object mapping media query operators to the condition to be used.\n *\n * @type {Record<WPViewportOperator, string>}\n */\nconst CONDITIONS = {\n\t'>=': 'min-width',\n\t'<': 'max-width',\n};\n\n/**\n * Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.\n *\n * @type {Record<WPViewportOperator, (breakpointValue: number, width: number) => boolean>}\n */\nconst OPERATOR_EVALUATORS = {\n\t'>=': ( breakpointValue, width ) => width >= breakpointValue,\n\t'<': ( breakpointValue, width ) => width < breakpointValue,\n};\n\nconst ViewportMatchWidthContext = createContext(\n\t/** @type {null | number} */ ( null )\n);\n\n/**\n * Returns true if the viewport matches the given query, or false otherwise.\n *\n * @param {WPBreakpoint} breakpoint Breakpoint size name.\n * @param {WPViewportOperator} [operator=\">=\"] Viewport operator.\n *\n * @example\n *\n * ```js\n * useViewportMatch( 'huge', '<' );\n * useViewportMatch( 'medium' );\n * ```\n *\n * @return {boolean} Whether viewport matches query.\n */\nconst useViewportMatch = ( breakpoint, operator = '>=' ) => {\n\tconst simulatedWidth = useContext( ViewportMatchWidthContext );\n\tconst mediaQuery =\n\t\t! simulatedWidth &&\n\t\t`(${ CONDITIONS[ operator ] }: ${ BREAKPOINTS[ breakpoint ] }px)`;\n\tconst mediaQueryResult = useMediaQuery( mediaQuery || undefined );\n\tif ( simulatedWidth ) {\n\t\treturn OPERATOR_EVALUATORS[ operator ](\n\t\t\tBREAKPOINTS[ breakpoint ],\n\t\t\tsimulatedWidth\n\t\t);\n\t}\n\treturn mediaQueryResult;\n};\n\nuseViewportMatch.__experimentalWidthProvider =\n\tViewportMatchWidthContext.Provider;\n\nexport default useViewportMatch;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,OAAOC,aAAa,MAAM,oBAAoB;;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG;EACnBC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE;AACT,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG;EAClB,IAAI,EAAE,WAAW;EACjB,GAAG,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG;EAC3B,IAAI,EAAEC,CAAEC,eAAe,EAAEC,KAAK,KAAMA,KAAK,IAAID,eAAe;EAC5D,GAAG,EAAEE,CAAEF,eAAe,EAAEC,KAAK,KAAMA,KAAK,GAAGD;AAC5C,CAAC;AAED,MAAMG,yBAAyB,GAAGhB,aAAa,EAC9C,4BAA+B,IAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,gBAAgB,GAAGA,CAAEC,UAAU,EAAEC,QAAQ,GAAG,IAAI,KAAM;EAC3D,MAAMC,cAAc,GAAGnB,UAAU,CAAEe,yBAA0B,CAAC;EAC9D,MAAMK,UAAU,GACf,CAAED,cAAc,IACf,IAAIV,UAAU,CAAES,QAAQ,CAAI,KAAKhB,WAAW,CAAEe,UAAU,CAAI,KAAI;EAClE,MAAMI,gBAAgB,GAAGpB,aAAa,CAAEmB,UAAU,IAAIE,SAAU,CAAC;EACjE,IAAKH,cAAc,EAAG;IACrB,OAAOT,mBAAmB,CAAEQ,QAAQ,CAAE,CACrChB,WAAW,CAAEe,UAAU,CAAE,EACzBE,cACD,CAAC;EACF;EACA,OAAOE,gBAAgB;AACxB,CAAC;AAEDL,gBAAgB,CAACO,2BAA2B,GAC3CR,yBAAyB,CAACS,QAAQ;AAEnC,eAAeR,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["usePrevious","useWarnOnChange","object","prefix","previousValues","Object","entries","forEach","key","value","console","warn"],"sources":["@wordpress/compose/src/hooks/use-warn-on-change/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport usePrevious from '../use-previous';\n\n// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case\n// but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript\n/* eslint-disable jsdoc/check-types */\n/**\n * Hook that performs a shallow comparison between the preview value of an object\n * and the new one, if there's a difference, it prints it to the console.\n * this is useful in performance related work, to check why a component re-renders.\n *\n * @example\n *\n * ```jsx\n * function MyComponent(props) {\n * useWarnOnChange(props);\n *\n * return \"Something\";\n * }\n * ```\n *\n * @param {object} object Object which changes to compare.\n * @param {string} prefix Just a prefix to show when console logging.\n */\nfunction useWarnOnChange( object, prefix = 'Change detection' ) {\n\tconst previousValues = usePrevious( object );\n\n\tObject.entries( previousValues ?? [] ).forEach( ( [ key, value ] ) => {\n\t\tif ( value !== object[ /** @type {keyof typeof object} */ ( key ) ] ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t`${ prefix }: ${ key } key changed:`,\n\t\t\t\tvalue,\n\t\t\t\tobject[ /** @type {keyof typeof object} */ ( key ) ]\n\t\t\t\t/* eslint-enable jsdoc/check-types */\n\t\t\t);\n\t\t}\n\t} );\n}\n\nexport default useWarnOnChange;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,iBAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,MAAM,EAAEC,MAAM,GAAG,kBAAkB,EAAG;EAC/D,MAAMC,cAAc,GAAGJ,WAAW,CAAEE,MAAO,CAAC;EAE5CG,MAAM,CAACC,OAAO,CAAEF,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAG,CAAC,CAACG,OAAO,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;IACrE,IAAKA,KAAK,KAAKP,MAAM,GAAE,kCAAqCM,GAAG,EAAI,EAAG;MACrE;MACAE,OAAO,CAACC,IAAI,CACV,GAAGR,MAAQ,KAAKK,GAAK,eAAc,EACpCC,KAAK,EACLP,MAAM,GAAE,kCAAqCM,GAAG;MAChD,qCACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ;AAEA,eAAeP,eAAe"}
1
+ {"version":3,"names":["usePrevious","useWarnOnChange","object","prefix","previousValues","Object","entries","forEach","key","value","console","warn"],"sources":["@wordpress/compose/src/hooks/use-warn-on-change/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport usePrevious from '../use-previous';\n\n// Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case\n// but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript\n/* eslint-disable jsdoc/check-types */\n/**\n * Hook that performs a shallow comparison between the preview value of an object\n * and the new one, if there's a difference, it prints it to the console.\n * this is useful in performance related work, to check why a component re-renders.\n *\n * @example\n *\n * ```jsx\n * function MyComponent(props) {\n * useWarnOnChange(props);\n *\n * return \"Something\";\n * }\n * ```\n *\n * @param {object} object Object which changes to compare.\n * @param {string} prefix Just a prefix to show when console logging.\n */\nfunction useWarnOnChange( object, prefix = 'Change detection' ) {\n\tconst previousValues = usePrevious( object );\n\n\tObject.entries( previousValues ?? [] ).forEach( ( [ key, value ] ) => {\n\t\tif ( value !== object[ /** @type {keyof typeof object} */ ( key ) ] ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t`${ prefix }: ${ key } key changed:`,\n\t\t\t\tvalue,\n\t\t\t\tobject[ /** @type {keyof typeof object} */ ( key ) ]\n\t\t\t\t/* eslint-enable jsdoc/check-types */\n\t\t\t);\n\t\t}\n\t} );\n}\n\nexport default useWarnOnChange;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,iBAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,MAAM,EAAEC,MAAM,GAAG,kBAAkB,EAAG;EAC/D,MAAMC,cAAc,GAAGJ,WAAW,CAAEE,MAAO,CAAC;EAE5CG,MAAM,CAACC,OAAO,CAAEF,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAG,CAAC,CAACG,OAAO,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;IACrE,IAAKA,KAAK,KAAKP,MAAM,GAAE,kCAAqCM,GAAG,EAAI,EAAG;MACrE;MACAE,OAAO,CAACC,IAAI,CACV,GAAGR,MAAQ,KAAKK,GAAK,eAAc,EACpCC,KAAK,EACLP,MAAM,GAAE,kCAAqCM,GAAG;MAChD,qCACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ;AAEA,eAAeP,eAAe","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["default","compose","pipe","ifCondition","pure","withGlobalEvents","withInstanceId","withSafeTimeout","withState","useConstrainedTabbing","useCopyOnClick","useCopyToClipboard","__experimentalUseDialog","useDisabled","__experimentalUseDragging","useFocusOnMount","__experimentalUseFocusOutside","useFocusReturn","useInstanceId","useIsomorphicLayoutEffect","useKeyboardShortcut","useMediaQuery","usePrevious","useReducedMotion","useStateWithHistory","useViewportMatch","useResizeObserver","useAsyncList","useWarnOnChange","useDebounce","useDebouncedInput","useThrottle","useMergeRefs","useRefEffect","__experimentalUseDropZone","useFocusableIframe","__experimentalUseFixedWindowList"],"sources":["@wordpress/compose/src/index.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';\n\n// Hooks.\nexport { default as useConstrainedTabbing } from './hooks/use-constrained-tabbing';\nexport { default as useCopyOnClick } from './hooks/use-copy-on-click';\nexport { default as useCopyToClipboard } from './hooks/use-copy-to-clipboard';\nexport { default as __experimentalUseDialog } from './hooks/use-dialog';\nexport { default as useDisabled } from './hooks/use-disabled';\nexport { default as __experimentalUseDragging } from './hooks/use-dragging';\nexport { default as useFocusOnMount } from './hooks/use-focus-on-mount';\nexport { default as __experimentalUseFocusOutside } from './hooks/use-focus-outside';\nexport { default as useFocusReturn } from './hooks/use-focus-return';\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 useStateWithHistory } from './hooks/use-state-with-history';\nexport { default as useViewportMatch } from './hooks/use-viewport-match';\nexport { default as useResizeObserver } from './hooks/use-resize-observer';\nexport { default as useAsyncList } from './hooks/use-async-list';\nexport { default as useWarnOnChange } from './hooks/use-warn-on-change';\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 __experimentalUseDropZone } from './hooks/use-drop-zone';\nexport { default as useFocusableIframe } from './hooks/use-focusable-iframe';\nexport { default as __experimentalUseFixedWindowList } from './hooks/use-fixed-window-list';\n"],"mappings":"AAAA;AACA,cAAc,uCAAuC;AACrD;AACA,cAAc,kBAAkB;AAChC;AACA,cAAc,kBAAkB;;AAEhC;AACA,SAASA,OAAO,IA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xE,SAASzB,OAAO,IAAI0B,iBAAiB,QAAQ,6BAA6B;AAC1E,SAAS1B,OAAO,IAAI2B,YAAY,QAAQ,wBAAwB;AAChE,SAAS3B,OAAO,IAAI4B,eAAe,QAAQ,4BAA4B;AACvE,SAAS5B,OAAO,IAAI6B,WAAW,QAAQ,sBAAsB;AAC7D,SAAS7B,OAAO,IAAI8B,iBAAiB,QAAQ,6BAA6B;AAC1E,SAAS9B,OAAO,IAAI+B,WAAW,QAAQ,sBAAsB;AAC7D,SAAS/B,OAAO,IAAIgC,YAAY,QAAQ,wBAAwB;AAChE,SAAShC,OAAO,IAAIiC,YAAY,QAAQ,wBAAwB;AAChE,SAASjC,OAAO,IAAIkC,yBAAyB,QAAQ,uBAAuB;AAC5E,SAASlC,OAAO,IAAImC,kBAAkB,QAAQ,8BAA8B;AAC5E,SAASnC,OAAO,IAAIoC,gCAAgC,QAAQ,+BAA+B"}
1
+ {"version":3,"names":["default","compose","pipe","ifCondition","pure","withGlobalEvents","withInstanceId","withSafeTimeout","withState","useConstrainedTabbing","useCopyOnClick","useCopyToClipboard","__experimentalUseDialog","useDisabled","__experimentalUseDragging","useFocusOnMount","__experimentalUseFocusOutside","useFocusReturn","useInstanceId","useIsomorphicLayoutEffect","useKeyboardShortcut","useMediaQuery","usePrevious","useReducedMotion","useStateWithHistory","useViewportMatch","useResizeObserver","useAsyncList","useWarnOnChange","useDebounce","useDebouncedInput","useThrottle","useMergeRefs","useRefEffect","__experimentalUseDropZone","useFocusableIframe","__experimentalUseFixedWindowList"],"sources":["@wordpress/compose/src/index.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';\n\n// Hooks.\nexport { default as useConstrainedTabbing } from './hooks/use-constrained-tabbing';\nexport { default as useCopyOnClick } from './hooks/use-copy-on-click';\nexport { default as useCopyToClipboard } from './hooks/use-copy-to-clipboard';\nexport { default as __experimentalUseDialog } from './hooks/use-dialog';\nexport { default as useDisabled } from './hooks/use-disabled';\nexport { default as __experimentalUseDragging } from './hooks/use-dragging';\nexport { default as useFocusOnMount } from './hooks/use-focus-on-mount';\nexport { default as __experimentalUseFocusOutside } from './hooks/use-focus-outside';\nexport { default as useFocusReturn } from './hooks/use-focus-return';\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 useStateWithHistory } from './hooks/use-state-with-history';\nexport { default as useViewportMatch } from './hooks/use-viewport-match';\nexport { default as useResizeObserver } from './hooks/use-resize-observer';\nexport { default as useAsyncList } from './hooks/use-async-list';\nexport { default as useWarnOnChange } from './hooks/use-warn-on-change';\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 __experimentalUseDropZone } from './hooks/use-drop-zone';\nexport { default as useFocusableIframe } from './hooks/use-focusable-iframe';\nexport { default as __experimentalUseFixedWindowList } from './hooks/use-fixed-window-list';\n"],"mappings":"AAAA;AACA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OAAO,IAAIwB,mBAAmB,QAAQ,gCAAgC;AAC/E,SAASxB,OAAO,IAAIyB,gBAAgB,QAAQ,4BAA4B;AACxE,SAASzB,OAAO,IAAI0B,iBAAiB,QAAQ,6BAA6B;AAC1E,SAAS1B,OAAO,IAAI2B,YAAY,QAAQ,wBAAwB;AAChE,SAAS3B,OAAO,IAAI4B,eAAe,QAAQ,4BAA4B;AACvE,SAAS5B,OAAO,IAAI6B,WAAW,QAAQ,sBAAsB;AAC7D,SAAS7B,OAAO,IAAI8B,iBAAiB,QAAQ,6BAA6B;AAC1E,SAAS9B,OAAO,IAAI+B,WAAW,QAAQ,sBAAsB;AAC7D,SAAS/B,OAAO,IAAIgC,YAAY,QAAQ,wBAAwB;AAChE,SAAShC,OAAO,IAAIiC,YAAY,QAAQ,wBAAwB;AAChE,SAASjC,OAAO,IAAIkC,yBAAyB,QAAQ,uBAAuB;AAC5E,SAASlC,OAAO,IAAImC,kBAAkB,QAAQ,8BAA8B;AAC5E,SAASnC,OAAO,IAAIoC,gCAAgC,QAAQ,+BAA+B","ignoreList":[]}
@@ -1 +1 @@
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"],"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';\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';\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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2B,YAAY,QAAQ,wBAAwB;AAChE,SAAS3B,OAAO,IAAI4B,YAAY,QAAQ,wBAAwB;AAChE,SAAS5B,OAAO,IAAI6B,sBAAsB,QAAQ,kCAAkC"}
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"],"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';\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';\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;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","ignoreList":[]}
@@ -1 +1 @@
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"}
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","ignoreList":[]}
@@ -1 +1 @@
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":"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;;AAmCA;AACA;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ER,YAAa,CAAC;MAClC;IACD;IACA,IAAK,CAAEkC,OAAO,CAAC,CAAC,EAAG;MAClBrB,UAAU,CAAEO,YAAY,EAAE3B,IAAK,CAAC;IACjC;IACA,OAAOK,MAAM;EACd;EACAqC,SAAS,CAACH,MAAM,GAAGA,MAAM;EACzBG,SAAS,CAACF,KAAK,GAAGA,KAAK;EACvBE,SAAS,CAACD,OAAO,GAAGA,OAAO;EAC3B,OAAOC,SAAS;AACjB,CAAC"}
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":"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;;AAmCA;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,OAAO,MAAMA,QAAQ,GAAGA,CACvBC,IAAe,EACfC,IAAY,EACZC,OAAoC,KAChC;EACJ,IAAIC,QAA6C;EACjD,IAAIC,QAA6B;EACjC,IAAIC,OAAO,GAAG,CAAC;EACf,IAAIC,MAA+B;EACnC,IAAIC,OAAoD;EACxD,IAAIC,YAAgC;EAEpC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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
+ {"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","ignoreList":[]}
@@ -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,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
+ {"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,yEAIF,qBAAsB,CAAC,EAAE,eAAe,CAAE,gBAO3D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-dragging/index.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH;qBAJe,OAAO,OAAO,EAAE,UAAU,KAAK,IAAI;oBACnC,UAAU,KAAK,IAAI;oBAClB,UAAU,KAAK,IAAI;;mBAgCnB,OAAO,OAAO,EAAE,UAAU,KAAK,IAAI;kBATlC,UAAU,KAAK,IAAI;;EAkCnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-dragging/index.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH;IAJ0D,WAAW,EAA1D,CAAC,CAAC,EAAE,OAAO,OAAO,EAAE,UAAU,KAAK,IAAI;IACQ,UAAU,EAAzD,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;IACwB,SAAS,EAAxD,CAAC,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;;mBAgCnB,OAAO,OAAO,EAAE,UAAU,KAAK,IAAI;kBATlC,UAAU,KAAK,IAAI;;EAkCnC"}
@@ -22,7 +22,7 @@
22
22
  * @param { WPFixedWindowListOptions } [options] Options object
23
23
  * @return {[ WPFixedWindowList, setFixedListWindow:(nextWindow:WPFixedWindowList)=>void]} Array with the fixed window list and setter
24
24
  */
25
- export default function useFixedWindowList(elementRef: import('react').RefObject<HTMLElement>, itemHeight: number, totalItems: number, options?: WPFixedWindowListOptions | undefined): [WPFixedWindowList, (nextWindow: WPFixedWindowList) => void];
25
+ export default function useFixedWindowList(elementRef: import('react').RefObject<HTMLElement>, itemHeight: number, totalItems: number, options?: WPFixedWindowListOptions | undefined): [WPFixedWindowList, setFixedListWindow: (nextWindow: WPFixedWindowList) => void];
26
26
  export type WPFixedWindowList = {
27
27
  /**
28
28
  * Items visible in the current viewport
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-fixed-window-list/index.js"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,uDANW,OAAO,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,cACrC,MAAM,cACN,MAAM,oFAE8C,iBAAiB,KAAG,IAAI,EAsJvF;;;;;kBA3Ka,MAAM;;;;WACN,MAAM;;;;SACN,MAAM;;;;wBACC,MAAM,KAAG,OAAO;;;;;;;;;;;;;;;;;;oBASvB,GAAG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-fixed-window-list/index.js"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,uDANW,OAAO,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,cACrC,MAAM,cACN,MAAM,mDAEN,CAAE,iBAAiB,EAAE,kBAAkB,EAAC,CAAC,UAAU,EAAC,iBAAiB,KAAG,IAAI,CAAC,CAsJxF;;;;;kBA3Ka,MAAM;;;;WACN,MAAM;;;;SACN,MAAM;;;;gBACN,CAAC,KAAK,EAAC,MAAM,KAAG,OAAO;;;;;;;;;;;;;;;;;;oBASvB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-keyboard-shortcut/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;GASG;AAGH;;;;;;;;GAQG;AACH,gDAJW,MAAM,EAAE,GAAC,MAAM,gBACX,OAAO,WAAW,EAAE,qBAAqB,SAAS,MAAM,KAAK,IAAI,mDACrE,wBAAwB,QAyElC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-keyboard-shortcut/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;GASG;AAGH;;;;;;;;GAQG;AACH,gDAJW,MAAM,EAAE,GAAC,MAAM,YACf,CAAC,CAAC,EAAE,OAAO,WAAW,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,mDACrE,wBAAwB,QAyElC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/debounce/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa,CAAE,CAAC,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG;IAClE;;;;;;;;OAQG;IACH,CAAE,GAAG,IAAI,EAAE,UAAU,CAAE,CAAC,CAAE,GAAI,UAAU,CAAE,CAAC,CAAE,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;;;;;OAMG;IACH,KAAK,IAAI,UAAU,CAAE,CAAC,CAAE,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,QAAQ,+BAAkC,OAAO,EAAE,KAAM,OAAO,yBAEtE,MAAM,YACF,QAAS,eAAe,CAAE;WA+HV,OAAO;;;;CA2BjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/debounce/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa,CAAE,CAAC,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG;IAClE;;;;;;;;OAQG;IACH,CAAE,GAAG,IAAI,EAAE,UAAU,CAAE,CAAC,CAAE,GAAI,UAAU,CAAE,CAAC,CAAE,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;;;;;OAMG;IACH,KAAK,IAAI,UAAU,CAAE,CAAC,CAAE,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,QAAQ,+BAAkC,OAAO,EAAE,KAAM,OAAO,QACtE,SAAS,QACT,MAAM,YACF,QAAS,eAAe,CAAE;WA+HV,OAAO,WAAW,WAAY,SAAS,CAAE;;;;CA2BnE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/throttle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAOH,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ,+BAAkC,OAAO,EAAE,KAAM,OAAO,yBAEtE,MAAM,YACF,eAAe;;;;;CAczB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/throttle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAOH,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ,+BAAkC,OAAO,EAAE,KAAM,OAAO,QACtE,SAAS,QACT,MAAM,YACF,eAAe;;;;;CAczB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/compose",
3
- "version": "6.32.0",
3
+ "version": "6.33.0",
4
4
  "description": "WordPress higher-order components (HOCs).",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,13 +31,13 @@
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.16.0",
33
33
  "@types/mousetrap": "^1.6.8",
34
- "@wordpress/deprecated": "^3.55.0",
35
- "@wordpress/dom": "^3.55.0",
36
- "@wordpress/element": "^5.32.0",
37
- "@wordpress/is-shallow-equal": "^4.55.0",
38
- "@wordpress/keycodes": "^3.55.0",
39
- "@wordpress/priority-queue": "^2.55.0",
40
- "@wordpress/undo-manager": "^0.15.0",
34
+ "@wordpress/deprecated": "^3.56.0",
35
+ "@wordpress/dom": "^3.56.0",
36
+ "@wordpress/element": "^5.33.0",
37
+ "@wordpress/is-shallow-equal": "^4.56.0",
38
+ "@wordpress/keycodes": "^3.56.0",
39
+ "@wordpress/priority-queue": "^2.56.0",
40
+ "@wordpress/undo-manager": "^0.16.0",
41
41
  "change-case": "^4.1.2",
42
42
  "clipboard": "^2.0.11",
43
43
  "mousetrap": "^1.6.5",
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
52
+ "gitHead": "280403b4c1cf6cc2c55a6c4d56f9ef91145e4191"
53
53
  }