@wordpress/compose 6.2.0 → 6.3.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.3.0 (2023-02-01)
6
+
5
7
  ## 6.2.0 (2023-01-11)
6
8
 
7
9
  ## 6.1.0 (2023-01-02)
@@ -63,20 +63,18 @@ function useAsyncList(list) {
63
63
  }
64
64
 
65
65
  setCurrent(firstItems);
66
- let nextIndex = firstItems.length;
67
66
  const asyncQueue = (0, _priorityQueue.createQueue)();
68
67
 
69
- const append = () => {
68
+ const append = nextIndex => () => {
70
69
  if (list.length <= nextIndex) {
71
70
  return;
72
71
  }
73
72
 
74
73
  setCurrent(state => [...state, ...list.slice(nextIndex, nextIndex + step)]);
75
- nextIndex += step;
76
- asyncQueue.add({}, append);
74
+ asyncQueue.add({}, append(nextIndex + step));
77
75
  };
78
76
 
79
- asyncQueue.add({}, append);
77
+ asyncQueue.add({}, append(firstItems.length));
80
78
  return () => asyncQueue.reset();
81
79
  }, [list]);
82
80
  return current;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-async-list/index.ts"],"names":["getFirstItemsPresentInState","list","state","firstItems","i","length","item","includes","push","useAsyncList","config","step","current","setCurrent","concat","slice","nextIndex","asyncQueue","append","add","reset"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,2BAAT,CAA2CC,IAA3C,EAAsDC,KAAtD,EAAwE;AACvE,QAAMC,UAAU,GAAG,EAAnB;;AAEA,OAAM,IAAIC,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGH,IAAI,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAwC;AACvC,UAAME,IAAI,GAAGL,IAAI,CAAEG,CAAF,CAAjB;;AACA,QAAK,CAAEF,KAAK,CAACK,QAAN,CAAgBD,IAAhB,CAAP,EAAgC;AAC/B;AACA;;AAEDH,IAAAA,UAAU,CAACK,IAAX,CAAiBF,IAAjB;AACA;;AAED,SAAOH,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASM,YAAT,CACCR,IADD,EAGO;AAAA,MADNS,MACM,uEADoB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GACpB;AACN,QAAM;AAAEA,IAAAA,IAAI,GAAG;AAAT,MAAeD,MAArB;AACA,QAAM,CAAEE,OAAF,EAAWC,UAAX,IAA0B,uBAAU,EAAV,CAAhC;AAEA,0BAAW,MAAM;AAChB;AACA,QAAIV,UAAU,GAAGH,2BAA2B,CAAEC,IAAF,EAAQW,OAAR,CAA5C;;AACA,QAAKT,UAAU,CAACE,MAAX,GAAoBM,IAAzB,EAAgC;AAC/BR,MAAAA,UAAU,GAAGA,UAAU,CAACW,MAAX,CACZb,IAAI,CAACc,KAAL,CAAYZ,UAAU,CAACE,MAAvB,EAA+BM,IAA/B,CADY,CAAb;AAGA;;AACDE,IAAAA,UAAU,CAAEV,UAAF,CAAV;AACA,QAAIa,SAAS,GAAGb,UAAU,CAACE,MAA3B;AAEA,UAAMY,UAAU,GAAG,iCAAnB;;AACA,UAAMC,MAAM,GAAG,MAAM;AACpB,UAAKjB,IAAI,CAACI,MAAL,IAAeW,SAApB,EAAgC;AAC/B;AACA;;AACDH,MAAAA,UAAU,CAAIX,KAAF,IAAa,CACxB,GAAGA,KADqB,EAExB,GAAGD,IAAI,CAACc,KAAL,CAAYC,SAAZ,EAAuBA,SAAS,GAAGL,IAAnC,CAFqB,CAAf,CAAV;AAIAK,MAAAA,SAAS,IAAIL,IAAb;AACAM,MAAAA,UAAU,CAACE,GAAX,CAAgB,EAAhB,EAAoBD,MAApB;AACA,KAVD;;AAWAD,IAAAA,UAAU,CAACE,GAAX,CAAgB,EAAhB,EAAoBD,MAApB;AAEA,WAAO,MAAMD,UAAU,CAACG,KAAX,EAAb;AACA,GA1BD,EA0BG,CAAEnB,IAAF,CA1BH;AA4BA,SAAOW,OAAP;AACA;;eAEcH,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { createQueue } from '@wordpress/priority-queue';\n\ntype AsyncListConfig = {\n\tstep: number;\n};\n\n/**\n * Returns the first items from list that are present on state.\n *\n * @param list New array.\n * @param state Current state.\n * @return First items present iin state.\n */\nfunction getFirstItemsPresentInState< T >( list: T[], state: T[] ): T[] {\n\tconst firstItems = [];\n\n\tfor ( let i = 0; i < list.length; i++ ) {\n\t\tconst item = list[ i ];\n\t\tif ( ! state.includes( item ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tfirstItems.push( item );\n\t}\n\n\treturn firstItems;\n}\n\n/**\n * React hook returns an array which items get asynchronously appended from a source array.\n * This behavior is useful if we want to render a list of items asynchronously for performance reasons.\n *\n * @param list Source array.\n * @param config Configuration object.\n *\n * @return Async array.\n */\nfunction useAsyncList< T >(\n\tlist: T[],\n\tconfig: AsyncListConfig = { step: 1 }\n): T[] {\n\tconst { step = 1 } = config;\n\tconst [ current, setCurrent ] = useState( [] as T[] );\n\n\tuseEffect( () => {\n\t\t// On reset, we keep the first items that were previously rendered.\n\t\tlet firstItems = getFirstItemsPresentInState( list, current );\n\t\tif ( firstItems.length < step ) {\n\t\t\tfirstItems = firstItems.concat(\n\t\t\t\tlist.slice( firstItems.length, step )\n\t\t\t);\n\t\t}\n\t\tsetCurrent( firstItems );\n\t\tlet nextIndex = firstItems.length;\n\n\t\tconst asyncQueue = createQueue();\n\t\tconst append = () => {\n\t\t\tif ( list.length <= nextIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrent( ( state ) => [\n\t\t\t\t...state,\n\t\t\t\t...list.slice( nextIndex, nextIndex + step ),\n\t\t\t] );\n\t\t\tnextIndex += step;\n\t\t\tasyncQueue.add( {}, append );\n\t\t};\n\t\tasyncQueue.add( {}, append );\n\n\t\treturn () => asyncQueue.reset();\n\t}, [ list ] );\n\n\treturn current;\n}\n\nexport default useAsyncList;\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-async-list/index.ts"],"names":["getFirstItemsPresentInState","list","state","firstItems","i","length","item","includes","push","useAsyncList","config","step","current","setCurrent","concat","slice","asyncQueue","append","nextIndex","add","reset"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,2BAAT,CAA2CC,IAA3C,EAAsDC,KAAtD,EAAwE;AACvE,QAAMC,UAAU,GAAG,EAAnB;;AAEA,OAAM,IAAIC,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGH,IAAI,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAwC;AACvC,UAAME,IAAI,GAAGL,IAAI,CAAEG,CAAF,CAAjB;;AACA,QAAK,CAAEF,KAAK,CAACK,QAAN,CAAgBD,IAAhB,CAAP,EAAgC;AAC/B;AACA;;AAEDH,IAAAA,UAAU,CAACK,IAAX,CAAiBF,IAAjB;AACA;;AAED,SAAOH,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASM,YAAT,CACCR,IADD,EAGO;AAAA,MADNS,MACM,uEADoB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GACpB;AACN,QAAM;AAAEA,IAAAA,IAAI,GAAG;AAAT,MAAeD,MAArB;AACA,QAAM,CAAEE,OAAF,EAAWC,UAAX,IAA0B,uBAAiB,EAAjB,CAAhC;AAEA,0BAAW,MAAM;AAChB;AACA,QAAIV,UAAU,GAAGH,2BAA2B,CAAEC,IAAF,EAAQW,OAAR,CAA5C;;AACA,QAAKT,UAAU,CAACE,MAAX,GAAoBM,IAAzB,EAAgC;AAC/BR,MAAAA,UAAU,GAAGA,UAAU,CAACW,MAAX,CACZb,IAAI,CAACc,KAAL,CAAYZ,UAAU,CAACE,MAAvB,EAA+BM,IAA/B,CADY,CAAb;AAGA;;AACDE,IAAAA,UAAU,CAAEV,UAAF,CAAV;AAEA,UAAMa,UAAU,GAAG,iCAAnB;;AACA,UAAMC,MAAM,GAAKC,SAAF,IAAyB,MAAM;AAC7C,UAAKjB,IAAI,CAACI,MAAL,IAAea,SAApB,EAAgC;AAC/B;AACA;;AACDL,MAAAA,UAAU,CAAIX,KAAF,IAAa,CACxB,GAAGA,KADqB,EAExB,GAAGD,IAAI,CAACc,KAAL,CAAYG,SAAZ,EAAuBA,SAAS,GAAGP,IAAnC,CAFqB,CAAf,CAAV;AAIAK,MAAAA,UAAU,CAACG,GAAX,CAAgB,EAAhB,EAAoBF,MAAM,CAAEC,SAAS,GAAGP,IAAd,CAA1B;AACA,KATD;;AAUAK,IAAAA,UAAU,CAACG,GAAX,CAAgB,EAAhB,EAAoBF,MAAM,CAAEd,UAAU,CAACE,MAAb,CAA1B;AAEA,WAAO,MAAMW,UAAU,CAACI,KAAX,EAAb;AACA,GAxBD,EAwBG,CAAEnB,IAAF,CAxBH;AA0BA,SAAOW,OAAP;AACA;;eAEcH,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { createQueue } from '@wordpress/priority-queue';\n\ntype AsyncListConfig = {\n\tstep: number;\n};\n\n/**\n * Returns the first items from list that are present on state.\n *\n * @param list New array.\n * @param state Current state.\n * @return First items present iin state.\n */\nfunction getFirstItemsPresentInState< T >( list: T[], state: T[] ): T[] {\n\tconst firstItems = [];\n\n\tfor ( let i = 0; i < list.length; i++ ) {\n\t\tconst item = list[ i ];\n\t\tif ( ! state.includes( item ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tfirstItems.push( item );\n\t}\n\n\treturn firstItems;\n}\n\n/**\n * React hook returns an array which items get asynchronously appended from a source array.\n * This behavior is useful if we want to render a list of items asynchronously for performance reasons.\n *\n * @param list Source array.\n * @param config Configuration object.\n *\n * @return Async array.\n */\nfunction useAsyncList< T >(\n\tlist: T[],\n\tconfig: AsyncListConfig = { step: 1 }\n): T[] {\n\tconst { step = 1 } = config;\n\tconst [ current, setCurrent ] = useState< T[] >( [] );\n\n\tuseEffect( () => {\n\t\t// On reset, we keep the first items that were previously rendered.\n\t\tlet firstItems = getFirstItemsPresentInState( list, current );\n\t\tif ( firstItems.length < step ) {\n\t\t\tfirstItems = firstItems.concat(\n\t\t\t\tlist.slice( firstItems.length, step )\n\t\t\t);\n\t\t}\n\t\tsetCurrent( firstItems );\n\n\t\tconst asyncQueue = createQueue();\n\t\tconst append = ( nextIndex: number ) => () => {\n\t\t\tif ( list.length <= nextIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrent( ( state ) => [\n\t\t\t\t...state,\n\t\t\t\t...list.slice( nextIndex, nextIndex + step ),\n\t\t\t] );\n\t\t\tasyncQueue.add( {}, append( nextIndex + step ) );\n\t\t};\n\t\tasyncQueue.add( {}, append( firstItems.length ) );\n\n\t\treturn () => asyncQueue.reset();\n\t}, [ list ] );\n\n\treturn current;\n}\n\nexport default useAsyncList;\n"]}
@@ -46,9 +46,17 @@ function useDisabled() {
46
46
  isDisabled: isDisabledProp = false
47
47
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
48
48
  return (0, _useRefEffect.default)(node => {
49
+ var _node$ownerDocument;
50
+
49
51
  if (isDisabledProp) {
50
52
  return;
51
53
  }
54
+
55
+ const defaultView = node === null || node === void 0 ? void 0 : (_node$ownerDocument = node.ownerDocument) === null || _node$ownerDocument === void 0 ? void 0 : _node$ownerDocument.defaultView;
56
+
57
+ if (!defaultView) {
58
+ return;
59
+ }
52
60
  /** A variable keeping track of the previous updates in order to restore them. */
53
61
 
54
62
 
@@ -56,7 +64,7 @@ function useDisabled() {
56
64
 
57
65
  const disable = () => {
58
66
  node.childNodes.forEach(child => {
59
- if (!(child instanceof HTMLElement)) {
67
+ if (!(child instanceof defaultView.HTMLElement)) {
60
68
  return;
61
69
  }
62
70
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.ts"],"names":["useDisabled","isDisabled","isDisabledProp","node","updates","disable","childNodes","forEach","child","HTMLElement","getAttribute","setAttribute","push","removeAttribute","debouncedDisable","leading","observer","window","MutationObserver","observe","childList","disconnect","cancel","update"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;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;AACe,SAASA,WAAT,GAEN;AAAA,MAF4B;AACpCC,IAAAA,UAAU,EAAEC,cAAc,GAAG;AADO,GAE5B,uEAAL,EAAK;AACR,SAAO,2BACJC,IAAF,IAAY;AACX,QAAKD,cAAL,EAAsB;AACrB;AACA;AAED;;;AACA,UAAME,OAAmB,GAAG,EAA5B;;AACA,UAAMC,OAAO,GAAG,MAAM;AACrBF,MAAAA,IAAI,CAACG,UAAL,CAAgBC,OAAhB,CAA2BC,KAAF,IAAa;AACrC,YAAK,EAAIA,KAAK,YAAYC,WAArB,CAAL,EAA0C;AACzC;AACA;;AACD,YAAK,CAAED,KAAK,CAACE,YAAN,CAAoB,OAApB,CAAP,EAAuC;AACtCF,UAAAA,KAAK,CAACG,YAAN,CAAoB,OAApB,EAA6B,MAA7B;AACAP,UAAAA,OAAO,CAACQ,IAAR,CAAc,MAAM;AACnBJ,YAAAA,KAAK,CAACK,eAAN,CAAuB,OAAvB;AACA,WAFD;AAGA;AACD,OAVD;AAWA,KAZD,CAPW,CAqBX;AACA;;;AACA,UAAMC,gBAAgB,GAAG,wBAAUT,OAAV,EAAmB,CAAnB,EAAsB;AAC9CU,MAAAA,OAAO,EAAE;AADqC,KAAtB,CAAzB;AAGAV,IAAAA,OAAO;AAEP;;AACA,UAAMW,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BJ,gBAA7B,CAAjB;AACAE,IAAAA,QAAQ,CAACG,OAAT,CAAkBhB,IAAlB,EAAwB;AACvBiB,MAAAA,SAAS,EAAE;AADY,KAAxB;AAIA,WAAO,MAAM;AACZ,UAAKJ,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACK,UAAT;AACA;;AACDP,MAAAA,gBAAgB,CAACQ,MAAjB;AACAlB,MAAAA,OAAO,CAACG,OAAR,CAAmBgB,MAAF,IAAcA,MAAM,EAArC;AACA,KAND;AAOA,GA1CK,EA2CN,CAAErB,cAAF,CA3CM,CAAP;AA6CA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.ts"],"names":["useDisabled","isDisabled","isDisabledProp","node","defaultView","ownerDocument","updates","disable","childNodes","forEach","child","HTMLElement","getAttribute","setAttribute","push","removeAttribute","debouncedDisable","leading","observer","window","MutationObserver","observe","childList","disconnect","cancel","update"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;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;AACe,SAASA,WAAT,GAEN;AAAA,MAF4B;AACpCC,IAAAA,UAAU,EAAEC,cAAc,GAAG;AADO,GAE5B,uEAAL,EAAK;AACR,SAAO,2BACJC,IAAF,IAAY;AAAA;;AACX,QAAKD,cAAL,EAAsB;AACrB;AACA;;AAED,UAAME,WAAW,GAAGD,IAAH,aAAGA,IAAH,8CAAGA,IAAI,CAAEE,aAAT,wDAAG,oBAAqBD,WAAzC;;AACA,QAAK,CAAEA,WAAP,EAAqB;AACpB;AACA;AAED;;;AACA,UAAME,OAAmB,GAAG,EAA5B;;AACA,UAAMC,OAAO,GAAG,MAAM;AACrBJ,MAAAA,IAAI,CAACK,UAAL,CAAgBC,OAAhB,CAA2BC,KAAF,IAAa;AACrC,YAAK,EAAIA,KAAK,YAAYN,WAAW,CAACO,WAAjC,CAAL,EAAsD;AACrD;AACA;;AACD,YAAK,CAAED,KAAK,CAACE,YAAN,CAAoB,OAApB,CAAP,EAAuC;AACtCF,UAAAA,KAAK,CAACG,YAAN,CAAoB,OAApB,EAA6B,MAA7B;AACAP,UAAAA,OAAO,CAACQ,IAAR,CAAc,MAAM;AACnBJ,YAAAA,KAAK,CAACK,eAAN,CAAuB,OAAvB;AACA,WAFD;AAGA;AACD,OAVD;AAWA,KAZD,CAZW,CA0BX;AACA;;;AACA,UAAMC,gBAAgB,GAAG,wBAAUT,OAAV,EAAmB,CAAnB,EAAsB;AAC9CU,MAAAA,OAAO,EAAE;AADqC,KAAtB,CAAzB;AAGAV,IAAAA,OAAO;AAEP;;AACA,UAAMW,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BJ,gBAA7B,CAAjB;AACAE,IAAAA,QAAQ,CAACG,OAAT,CAAkBlB,IAAlB,EAAwB;AACvBmB,MAAAA,SAAS,EAAE;AADY,KAAxB;AAIA,WAAO,MAAM;AACZ,UAAKJ,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACK,UAAT;AACA;;AACDP,MAAAA,gBAAgB,CAACQ,MAAjB;AACAlB,MAAAA,OAAO,CAACG,OAAR,CAAmBgB,MAAF,IAAcA,MAAM,EAArC;AACA,KAND;AAOA,GA/CK,EAgDN,CAAEvB,cAAF,CAhDM,CAAP;AAkDA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultView = node?.ownerDocument?.defaultView;\n\t\t\tif ( ! defaultView ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof defaultView.HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"]}
@@ -32,6 +32,8 @@ function createId(object) {
32
32
  * 1. When only object is given, the returned value is a number
33
33
  * 2. When object and prefix is given, the returned value is a string
34
34
  * 3. When preferredId is given, the returned value is the type of preferredId
35
+ *
36
+ * @param object Object reference to create an id for.
35
37
  */
36
38
 
37
39
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-instance-id/index.ts"],"names":["instanceMap","WeakMap","createId","object","instances","get","set","useInstanceId","prefix","preferredId","id"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,WAAW,GAAG,IAAIC,OAAJ,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAmBC,MAAnB,EAA4C;AAC3C,QAAMC,SAAS,GAAGJ,WAAW,CAACK,GAAZ,CAAiBF,MAAjB,KAA6B,CAA/C;AACAH,EAAAA,WAAW,CAACM,GAAZ,CAAiBH,MAAjB,EAAyBC,SAAS,GAAG,CAArC;AACA,SAAOA,SAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,aAAT,CACCJ,MADD,EAECK,MAFD,EAGCC,WAHD,EAImB;AAClB,SAAO,sBAAS,MAAM;AACrB,QAAKA,WAAL,EAAmB,OAAOA,WAAP;AACnB,UAAMC,EAAE,GAAGR,QAAQ,CAAEC,MAAF,CAAnB;AAEA,WAAOK,MAAM,GAAI,GAAGA,MAAQ,IAAIE,EAAI,EAAvB,GAA2BA,EAAxC;AACA,GALM,EAKJ,CAAEP,MAAF,CALI,CAAP;AAMA;;eAEcI,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\nconst instanceMap = new WeakMap< object, number >();\n\n/**\n * Creates a new id for a given object.\n *\n * @param object Object reference to create an id for.\n * @return The instance id (index).\n */\nfunction createId( object: object ): number {\n\tconst instances = instanceMap.get( object ) || 0;\n\tinstanceMap.set( object, instances + 1 );\n\treturn instances;\n}\n\n/**\n * Specify the useInstanceId *function* signatures.\n *\n * More accurately, useInstanceId distinguishes between three different\n * signatures:\n *\n * 1. When only object is given, the returned value is a number\n * 2. When object and prefix is given, the returned value is a string\n * 3. When preferredId is given, the returned value is the type of preferredId\n */\nfunction useInstanceId( object: object ): number;\nfunction useInstanceId( object: object, prefix: string ): string;\nfunction useInstanceId< T extends string | number >(\n\tobject: object,\n\tprefix: string,\n\tpreferredId?: T\n): T;\n\n/**\n * Provides a unique instance ID.\n *\n * @param object Object reference to create an id for.\n * @param [prefix] Prefix for the unique id.\n * @param [preferredId] Default ID to use.\n * @return The unique instance id.\n */\nfunction useInstanceId(\n\tobject: object,\n\tprefix?: string,\n\tpreferredId?: string | number\n): string | number {\n\treturn useMemo( () => {\n\t\tif ( preferredId ) return preferredId;\n\t\tconst id = createId( object );\n\n\t\treturn prefix ? `${ prefix }-${ id }` : id;\n\t}, [ object ] );\n}\n\nexport default useInstanceId;\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-instance-id/index.ts"],"names":["instanceMap","WeakMap","createId","object","instances","get","set","useInstanceId","prefix","preferredId","id"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,WAAW,GAAG,IAAIC,OAAJ,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAmBC,MAAnB,EAA4C;AAC3C,QAAMC,SAAS,GAAGJ,WAAW,CAACK,GAAZ,CAAiBF,MAAjB,KAA6B,CAA/C;AACAH,EAAAA,WAAW,CAACM,GAAZ,CAAiBH,MAAjB,EAAyBC,SAAS,GAAG,CAArC;AACA,SAAOA,SAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,aAAT,CACCJ,MADD,EAECK,MAFD,EAGCC,WAHD,EAImB;AAClB,SAAO,sBAAS,MAAM;AACrB,QAAKA,WAAL,EAAmB,OAAOA,WAAP;AACnB,UAAMC,EAAE,GAAGR,QAAQ,CAAEC,MAAF,CAAnB;AAEA,WAAOK,MAAM,GAAI,GAAGA,MAAQ,IAAIE,EAAI,EAAvB,GAA2BA,EAAxC;AACA,GALM,EAKJ,CAAEP,MAAF,CALI,CAAP;AAMA;;eAEcI,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\nconst instanceMap = new WeakMap< object, number >();\n\n/**\n * Creates a new id for a given object.\n *\n * @param object Object reference to create an id for.\n * @return The instance id (index).\n */\nfunction createId( object: object ): number {\n\tconst instances = instanceMap.get( object ) || 0;\n\tinstanceMap.set( object, instances + 1 );\n\treturn instances;\n}\n\n/**\n * Specify the useInstanceId *function* signatures.\n *\n * More accurately, useInstanceId distinguishes between three different\n * signatures:\n *\n * 1. When only object is given, the returned value is a number\n * 2. When object and prefix is given, the returned value is a string\n * 3. When preferredId is given, the returned value is the type of preferredId\n *\n * @param object Object reference to create an id for.\n */\nfunction useInstanceId( object: object ): number;\nfunction useInstanceId( object: object, prefix: string ): string;\nfunction useInstanceId< T extends string | number >(\n\tobject: object,\n\tprefix: string,\n\tpreferredId?: T\n): T;\n\n/**\n * Provides a unique instance ID.\n *\n * @param object Object reference to create an id for.\n * @param [prefix] Prefix for the unique id.\n * @param [preferredId] Default ID to use.\n * @return The unique instance id.\n */\nfunction useInstanceId(\n\tobject: object,\n\tprefix?: string,\n\tpreferredId?: string | number\n): string | number {\n\treturn useMemo( () => {\n\t\tif ( preferredId ) return preferredId;\n\t\tconst id = createId( object );\n\n\t\treturn prefix ? `${ prefix }-${ id }` : id;\n\t}, [ object ] );\n}\n\nexport default useInstanceId;\n"]}
@@ -54,20 +54,18 @@ function useAsyncList(list) {
54
54
  }
55
55
 
56
56
  setCurrent(firstItems);
57
- let nextIndex = firstItems.length;
58
57
  const asyncQueue = createQueue();
59
58
 
60
- const append = () => {
59
+ const append = nextIndex => () => {
61
60
  if (list.length <= nextIndex) {
62
61
  return;
63
62
  }
64
63
 
65
64
  setCurrent(state => [...state, ...list.slice(nextIndex, nextIndex + step)]);
66
- nextIndex += step;
67
- asyncQueue.add({}, append);
65
+ asyncQueue.add({}, append(nextIndex + step));
68
66
  };
69
67
 
70
- asyncQueue.add({}, append);
68
+ asyncQueue.add({}, append(firstItems.length));
71
69
  return () => asyncQueue.reset();
72
70
  }, [list]);
73
71
  return current;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-async-list/index.ts"],"names":["useEffect","useState","createQueue","getFirstItemsPresentInState","list","state","firstItems","i","length","item","includes","push","useAsyncList","config","step","current","setCurrent","concat","slice","nextIndex","asyncQueue","append","add","reset"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,WAAT,QAA4B,2BAA5B;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,2BAAT,CAA2CC,IAA3C,EAAsDC,KAAtD,EAAwE;AACvE,QAAMC,UAAU,GAAG,EAAnB;;AAEA,OAAM,IAAIC,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGH,IAAI,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAwC;AACvC,UAAME,IAAI,GAAGL,IAAI,CAAEG,CAAF,CAAjB;;AACA,QAAK,CAAEF,KAAK,CAACK,QAAN,CAAgBD,IAAhB,CAAP,EAAgC;AAC/B;AACA;;AAEDH,IAAAA,UAAU,CAACK,IAAX,CAAiBF,IAAjB;AACA;;AAED,SAAOH,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASM,YAAT,CACCR,IADD,EAGO;AAAA,MADNS,MACM,uEADoB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GACpB;AACN,QAAM;AAAEA,IAAAA,IAAI,GAAG;AAAT,MAAeD,MAArB;AACA,QAAM,CAAEE,OAAF,EAAWC,UAAX,IAA0Bf,QAAQ,CAAE,EAAF,CAAxC;AAEAD,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,QAAIM,UAAU,GAAGH,2BAA2B,CAAEC,IAAF,EAAQW,OAAR,CAA5C;;AACA,QAAKT,UAAU,CAACE,MAAX,GAAoBM,IAAzB,EAAgC;AAC/BR,MAAAA,UAAU,GAAGA,UAAU,CAACW,MAAX,CACZb,IAAI,CAACc,KAAL,CAAYZ,UAAU,CAACE,MAAvB,EAA+BM,IAA/B,CADY,CAAb;AAGA;;AACDE,IAAAA,UAAU,CAAEV,UAAF,CAAV;AACA,QAAIa,SAAS,GAAGb,UAAU,CAACE,MAA3B;AAEA,UAAMY,UAAU,GAAGlB,WAAW,EAA9B;;AACA,UAAMmB,MAAM,GAAG,MAAM;AACpB,UAAKjB,IAAI,CAACI,MAAL,IAAeW,SAApB,EAAgC;AAC/B;AACA;;AACDH,MAAAA,UAAU,CAAIX,KAAF,IAAa,CACxB,GAAGA,KADqB,EAExB,GAAGD,IAAI,CAACc,KAAL,CAAYC,SAAZ,EAAuBA,SAAS,GAAGL,IAAnC,CAFqB,CAAf,CAAV;AAIAK,MAAAA,SAAS,IAAIL,IAAb;AACAM,MAAAA,UAAU,CAACE,GAAX,CAAgB,EAAhB,EAAoBD,MAApB;AACA,KAVD;;AAWAD,IAAAA,UAAU,CAACE,GAAX,CAAgB,EAAhB,EAAoBD,MAApB;AAEA,WAAO,MAAMD,UAAU,CAACG,KAAX,EAAb;AACA,GA1BQ,EA0BN,CAAEnB,IAAF,CA1BM,CAAT;AA4BA,SAAOW,OAAP;AACA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { createQueue } from '@wordpress/priority-queue';\n\ntype AsyncListConfig = {\n\tstep: number;\n};\n\n/**\n * Returns the first items from list that are present on state.\n *\n * @param list New array.\n * @param state Current state.\n * @return First items present iin state.\n */\nfunction getFirstItemsPresentInState< T >( list: T[], state: T[] ): T[] {\n\tconst firstItems = [];\n\n\tfor ( let i = 0; i < list.length; i++ ) {\n\t\tconst item = list[ i ];\n\t\tif ( ! state.includes( item ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tfirstItems.push( item );\n\t}\n\n\treturn firstItems;\n}\n\n/**\n * React hook returns an array which items get asynchronously appended from a source array.\n * This behavior is useful if we want to render a list of items asynchronously for performance reasons.\n *\n * @param list Source array.\n * @param config Configuration object.\n *\n * @return Async array.\n */\nfunction useAsyncList< T >(\n\tlist: T[],\n\tconfig: AsyncListConfig = { step: 1 }\n): T[] {\n\tconst { step = 1 } = config;\n\tconst [ current, setCurrent ] = useState( [] as T[] );\n\n\tuseEffect( () => {\n\t\t// On reset, we keep the first items that were previously rendered.\n\t\tlet firstItems = getFirstItemsPresentInState( list, current );\n\t\tif ( firstItems.length < step ) {\n\t\t\tfirstItems = firstItems.concat(\n\t\t\t\tlist.slice( firstItems.length, step )\n\t\t\t);\n\t\t}\n\t\tsetCurrent( firstItems );\n\t\tlet nextIndex = firstItems.length;\n\n\t\tconst asyncQueue = createQueue();\n\t\tconst append = () => {\n\t\t\tif ( list.length <= nextIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrent( ( state ) => [\n\t\t\t\t...state,\n\t\t\t\t...list.slice( nextIndex, nextIndex + step ),\n\t\t\t] );\n\t\t\tnextIndex += step;\n\t\t\tasyncQueue.add( {}, append );\n\t\t};\n\t\tasyncQueue.add( {}, append );\n\n\t\treturn () => asyncQueue.reset();\n\t}, [ list ] );\n\n\treturn current;\n}\n\nexport default useAsyncList;\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-async-list/index.ts"],"names":["useEffect","useState","createQueue","getFirstItemsPresentInState","list","state","firstItems","i","length","item","includes","push","useAsyncList","config","step","current","setCurrent","concat","slice","asyncQueue","append","nextIndex","add","reset"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,WAAT,QAA4B,2BAA5B;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,2BAAT,CAA2CC,IAA3C,EAAsDC,KAAtD,EAAwE;AACvE,QAAMC,UAAU,GAAG,EAAnB;;AAEA,OAAM,IAAIC,CAAC,GAAG,CAAd,EAAiBA,CAAC,GAAGH,IAAI,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAwC;AACvC,UAAME,IAAI,GAAGL,IAAI,CAAEG,CAAF,CAAjB;;AACA,QAAK,CAAEF,KAAK,CAACK,QAAN,CAAgBD,IAAhB,CAAP,EAAgC;AAC/B;AACA;;AAEDH,IAAAA,UAAU,CAACK,IAAX,CAAiBF,IAAjB;AACA;;AAED,SAAOH,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASM,YAAT,CACCR,IADD,EAGO;AAAA,MADNS,MACM,uEADoB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GACpB;AACN,QAAM;AAAEA,IAAAA,IAAI,GAAG;AAAT,MAAeD,MAArB;AACA,QAAM,CAAEE,OAAF,EAAWC,UAAX,IAA0Bf,QAAQ,CAAS,EAAT,CAAxC;AAEAD,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA,QAAIM,UAAU,GAAGH,2BAA2B,CAAEC,IAAF,EAAQW,OAAR,CAA5C;;AACA,QAAKT,UAAU,CAACE,MAAX,GAAoBM,IAAzB,EAAgC;AAC/BR,MAAAA,UAAU,GAAGA,UAAU,CAACW,MAAX,CACZb,IAAI,CAACc,KAAL,CAAYZ,UAAU,CAACE,MAAvB,EAA+BM,IAA/B,CADY,CAAb;AAGA;;AACDE,IAAAA,UAAU,CAAEV,UAAF,CAAV;AAEA,UAAMa,UAAU,GAAGjB,WAAW,EAA9B;;AACA,UAAMkB,MAAM,GAAKC,SAAF,IAAyB,MAAM;AAC7C,UAAKjB,IAAI,CAACI,MAAL,IAAea,SAApB,EAAgC;AAC/B;AACA;;AACDL,MAAAA,UAAU,CAAIX,KAAF,IAAa,CACxB,GAAGA,KADqB,EAExB,GAAGD,IAAI,CAACc,KAAL,CAAYG,SAAZ,EAAuBA,SAAS,GAAGP,IAAnC,CAFqB,CAAf,CAAV;AAIAK,MAAAA,UAAU,CAACG,GAAX,CAAgB,EAAhB,EAAoBF,MAAM,CAAEC,SAAS,GAAGP,IAAd,CAA1B;AACA,KATD;;AAUAK,IAAAA,UAAU,CAACG,GAAX,CAAgB,EAAhB,EAAoBF,MAAM,CAAEd,UAAU,CAACE,MAAb,CAA1B;AAEA,WAAO,MAAMW,UAAU,CAACI,KAAX,EAAb;AACA,GAxBQ,EAwBN,CAAEnB,IAAF,CAxBM,CAAT;AA0BA,SAAOW,OAAP;AACA;;AAED,eAAeH,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { createQueue } from '@wordpress/priority-queue';\n\ntype AsyncListConfig = {\n\tstep: number;\n};\n\n/**\n * Returns the first items from list that are present on state.\n *\n * @param list New array.\n * @param state Current state.\n * @return First items present iin state.\n */\nfunction getFirstItemsPresentInState< T >( list: T[], state: T[] ): T[] {\n\tconst firstItems = [];\n\n\tfor ( let i = 0; i < list.length; i++ ) {\n\t\tconst item = list[ i ];\n\t\tif ( ! state.includes( item ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\tfirstItems.push( item );\n\t}\n\n\treturn firstItems;\n}\n\n/**\n * React hook returns an array which items get asynchronously appended from a source array.\n * This behavior is useful if we want to render a list of items asynchronously for performance reasons.\n *\n * @param list Source array.\n * @param config Configuration object.\n *\n * @return Async array.\n */\nfunction useAsyncList< T >(\n\tlist: T[],\n\tconfig: AsyncListConfig = { step: 1 }\n): T[] {\n\tconst { step = 1 } = config;\n\tconst [ current, setCurrent ] = useState< T[] >( [] );\n\n\tuseEffect( () => {\n\t\t// On reset, we keep the first items that were previously rendered.\n\t\tlet firstItems = getFirstItemsPresentInState( list, current );\n\t\tif ( firstItems.length < step ) {\n\t\t\tfirstItems = firstItems.concat(\n\t\t\t\tlist.slice( firstItems.length, step )\n\t\t\t);\n\t\t}\n\t\tsetCurrent( firstItems );\n\n\t\tconst asyncQueue = createQueue();\n\t\tconst append = ( nextIndex: number ) => () => {\n\t\t\tif ( list.length <= nextIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrent( ( state ) => [\n\t\t\t\t...state,\n\t\t\t\t...list.slice( nextIndex, nextIndex + step ),\n\t\t\t] );\n\t\t\tasyncQueue.add( {}, append( nextIndex + step ) );\n\t\t};\n\t\tasyncQueue.add( {}, append( firstItems.length ) );\n\n\t\treturn () => asyncQueue.reset();\n\t}, [ list ] );\n\n\treturn current;\n}\n\nexport default useAsyncList;\n"]}
@@ -35,9 +35,17 @@ export default function useDisabled() {
35
35
  isDisabled: isDisabledProp = false
36
36
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37
37
  return useRefEffect(node => {
38
+ var _node$ownerDocument;
39
+
38
40
  if (isDisabledProp) {
39
41
  return;
40
42
  }
43
+
44
+ const defaultView = node === null || node === void 0 ? void 0 : (_node$ownerDocument = node.ownerDocument) === null || _node$ownerDocument === void 0 ? void 0 : _node$ownerDocument.defaultView;
45
+
46
+ if (!defaultView) {
47
+ return;
48
+ }
41
49
  /** A variable keeping track of the previous updates in order to restore them. */
42
50
 
43
51
 
@@ -45,7 +53,7 @@ export default function useDisabled() {
45
53
 
46
54
  const disable = () => {
47
55
  node.childNodes.forEach(child => {
48
- if (!(child instanceof HTMLElement)) {
56
+ if (!(child instanceof defaultView.HTMLElement)) {
49
57
  return;
50
58
  }
51
59
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.ts"],"names":["debounce","useRefEffect","useDisabled","isDisabled","isDisabledProp","node","updates","disable","childNodes","forEach","child","HTMLElement","getAttribute","setAttribute","push","removeAttribute","debouncedDisable","leading","observer","window","MutationObserver","observe","childList","disconnect","cancel","update"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,sBAAzB;AACA,OAAOC,YAAP,MAAyB,mBAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,GAEN;AAAA,MAF4B;AACpCC,IAAAA,UAAU,EAAEC,cAAc,GAAG;AADO,GAE5B,uEAAL,EAAK;AACR,SAAOH,YAAY,CAChBI,IAAF,IAAY;AACX,QAAKD,cAAL,EAAsB;AACrB;AACA;AAED;;;AACA,UAAME,OAAmB,GAAG,EAA5B;;AACA,UAAMC,OAAO,GAAG,MAAM;AACrBF,MAAAA,IAAI,CAACG,UAAL,CAAgBC,OAAhB,CAA2BC,KAAF,IAAa;AACrC,YAAK,EAAIA,KAAK,YAAYC,WAArB,CAAL,EAA0C;AACzC;AACA;;AACD,YAAK,CAAED,KAAK,CAACE,YAAN,CAAoB,OAApB,CAAP,EAAuC;AACtCF,UAAAA,KAAK,CAACG,YAAN,CAAoB,OAApB,EAA6B,MAA7B;AACAP,UAAAA,OAAO,CAACQ,IAAR,CAAc,MAAM;AACnBJ,YAAAA,KAAK,CAACK,eAAN,CAAuB,OAAvB;AACA,WAFD;AAGA;AACD,OAVD;AAWA,KAZD,CAPW,CAqBX;AACA;;;AACA,UAAMC,gBAAgB,GAAGhB,QAAQ,CAAEO,OAAF,EAAW,CAAX,EAAc;AAC9CU,MAAAA,OAAO,EAAE;AADqC,KAAd,CAAjC;AAGAV,IAAAA,OAAO;AAEP;;AACA,UAAMW,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BJ,gBAA7B,CAAjB;AACAE,IAAAA,QAAQ,CAACG,OAAT,CAAkBhB,IAAlB,EAAwB;AACvBiB,MAAAA,SAAS,EAAE;AADY,KAAxB;AAIA,WAAO,MAAM;AACZ,UAAKJ,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACK,UAAT;AACA;;AACDP,MAAAA,gBAAgB,CAACQ,MAAjB;AACAlB,MAAAA,OAAO,CAACG,OAAR,CAAmBgB,MAAF,IAAcA,MAAM,EAArC;AACA,KAND;AAOA,GA1CiB,EA2ClB,CAAErB,cAAF,CA3CkB,CAAnB;AA6CA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.ts"],"names":["debounce","useRefEffect","useDisabled","isDisabled","isDisabledProp","node","defaultView","ownerDocument","updates","disable","childNodes","forEach","child","HTMLElement","getAttribute","setAttribute","push","removeAttribute","debouncedDisable","leading","observer","window","MutationObserver","observe","childList","disconnect","cancel","update"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,sBAAzB;AACA,OAAOC,YAAP,MAAyB,mBAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,GAEN;AAAA,MAF4B;AACpCC,IAAAA,UAAU,EAAEC,cAAc,GAAG;AADO,GAE5B,uEAAL,EAAK;AACR,SAAOH,YAAY,CAChBI,IAAF,IAAY;AAAA;;AACX,QAAKD,cAAL,EAAsB;AACrB;AACA;;AAED,UAAME,WAAW,GAAGD,IAAH,aAAGA,IAAH,8CAAGA,IAAI,CAAEE,aAAT,wDAAG,oBAAqBD,WAAzC;;AACA,QAAK,CAAEA,WAAP,EAAqB;AACpB;AACA;AAED;;;AACA,UAAME,OAAmB,GAAG,EAA5B;;AACA,UAAMC,OAAO,GAAG,MAAM;AACrBJ,MAAAA,IAAI,CAACK,UAAL,CAAgBC,OAAhB,CAA2BC,KAAF,IAAa;AACrC,YAAK,EAAIA,KAAK,YAAYN,WAAW,CAACO,WAAjC,CAAL,EAAsD;AACrD;AACA;;AACD,YAAK,CAAED,KAAK,CAACE,YAAN,CAAoB,OAApB,CAAP,EAAuC;AACtCF,UAAAA,KAAK,CAACG,YAAN,CAAoB,OAApB,EAA6B,MAA7B;AACAP,UAAAA,OAAO,CAACQ,IAAR,CAAc,MAAM;AACnBJ,YAAAA,KAAK,CAACK,eAAN,CAAuB,OAAvB;AACA,WAFD;AAGA;AACD,OAVD;AAWA,KAZD,CAZW,CA0BX;AACA;;;AACA,UAAMC,gBAAgB,GAAGlB,QAAQ,CAAES,OAAF,EAAW,CAAX,EAAc;AAC9CU,MAAAA,OAAO,EAAE;AADqC,KAAd,CAAjC;AAGAV,IAAAA,OAAO;AAEP;;AACA,UAAMW,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BJ,gBAA7B,CAAjB;AACAE,IAAAA,QAAQ,CAACG,OAAT,CAAkBlB,IAAlB,EAAwB;AACvBmB,MAAAA,SAAS,EAAE;AADY,KAAxB;AAIA,WAAO,MAAM;AACZ,UAAKJ,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACK,UAAT;AACA;;AACDP,MAAAA,gBAAgB,CAACQ,MAAjB;AACAlB,MAAAA,OAAO,CAACG,OAAR,CAAmBgB,MAAF,IAAcA,MAAM,EAArC;AACA,KAND;AAOA,GA/CiB,EAgDlB,CAAEvB,cAAF,CAhDkB,CAAnB;AAkDA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { debounce } from '../../utils/debounce';\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * In some circumstances, such as block previews, all focusable DOM elements\n * (input fields, links, buttons, etc.) need to be disabled. This hook adds the\n * behavior to disable nested DOM elements to the returned ref.\n *\n * If you can, prefer the use of the inert HTML attribute.\n *\n * @param {Object} config Configuration object.\n * @param {boolean=} config.isDisabled Whether the element should be disabled.\n * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { useDisabled } from '@wordpress/compose';\n *\n * const DisabledExample = () => {\n * \tconst disabledRef = useDisabled();\n *\treturn (\n *\t\t<div ref={ disabledRef }>\n *\t\t\t<a href=\"#\">This link will have tabindex set to -1</a>\n *\t\t\t<input placeholder=\"This input will have the disabled attribute added to it.\" type=\"text\" />\n *\t\t</div>\n *\t);\n * };\n * ```\n */\nexport default function useDisabled( {\n\tisDisabled: isDisabledProp = false,\n} = {} ) {\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isDisabledProp ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultView = node?.ownerDocument?.defaultView;\n\t\t\tif ( ! defaultView ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/** A variable keeping track of the previous updates in order to restore them. */\n\t\t\tconst updates: Function[] = [];\n\t\t\tconst disable = () => {\n\t\t\t\tnode.childNodes.forEach( ( child ) => {\n\t\t\t\t\tif ( ! ( child instanceof defaultView.HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! child.getAttribute( 'inert' ) ) {\n\t\t\t\t\t\tchild.setAttribute( 'inert', 'true' );\n\t\t\t\t\t\tupdates.push( () => {\n\t\t\t\t\t\t\tchild.removeAttribute( 'inert' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\t// Debounce re-disable since disabling process itself will incur\n\t\t\t// additional mutations which should be ignored.\n\t\t\tconst debouncedDisable = debounce( disable, 0, {\n\t\t\t\tleading: true,\n\t\t\t} );\n\t\t\tdisable();\n\n\t\t\t/** @type {MutationObserver | undefined} */\n\t\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node, {\n\t\t\t\tchildList: true,\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tif ( observer ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tdebouncedDisable.cancel();\n\t\t\t\tupdates.forEach( ( update ) => update() );\n\t\t\t};\n\t\t},\n\t\t[ isDisabledProp ]\n\t);\n}\n"]}
@@ -24,6 +24,8 @@ function createId(object) {
24
24
  * 1. When only object is given, the returned value is a number
25
25
  * 2. When object and prefix is given, the returned value is a string
26
26
  * 3. When preferredId is given, the returned value is the type of preferredId
27
+ *
28
+ * @param object Object reference to create an id for.
27
29
  */
28
30
 
29
31
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-instance-id/index.ts"],"names":["useMemo","instanceMap","WeakMap","createId","object","instances","get","set","useInstanceId","prefix","preferredId","id"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AAEA,MAAMC,WAAW,GAAG,IAAIC,OAAJ,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAmBC,MAAnB,EAA4C;AAC3C,QAAMC,SAAS,GAAGJ,WAAW,CAACK,GAAZ,CAAiBF,MAAjB,KAA6B,CAA/C;AACAH,EAAAA,WAAW,CAACM,GAAZ,CAAiBH,MAAjB,EAAyBC,SAAS,GAAG,CAArC;AACA,SAAOA,SAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,aAAT,CACCJ,MADD,EAECK,MAFD,EAGCC,WAHD,EAImB;AAClB,SAAOV,OAAO,CAAE,MAAM;AACrB,QAAKU,WAAL,EAAmB,OAAOA,WAAP;AACnB,UAAMC,EAAE,GAAGR,QAAQ,CAAEC,MAAF,CAAnB;AAEA,WAAOK,MAAM,GAAI,GAAGA,MAAQ,IAAIE,EAAI,EAAvB,GAA2BA,EAAxC;AACA,GALa,EAKX,CAAEP,MAAF,CALW,CAAd;AAMA;;AAED,eAAeI,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\nconst instanceMap = new WeakMap< object, number >();\n\n/**\n * Creates a new id for a given object.\n *\n * @param object Object reference to create an id for.\n * @return The instance id (index).\n */\nfunction createId( object: object ): number {\n\tconst instances = instanceMap.get( object ) || 0;\n\tinstanceMap.set( object, instances + 1 );\n\treturn instances;\n}\n\n/**\n * Specify the useInstanceId *function* signatures.\n *\n * More accurately, useInstanceId distinguishes between three different\n * signatures:\n *\n * 1. When only object is given, the returned value is a number\n * 2. When object and prefix is given, the returned value is a string\n * 3. When preferredId is given, the returned value is the type of preferredId\n */\nfunction useInstanceId( object: object ): number;\nfunction useInstanceId( object: object, prefix: string ): string;\nfunction useInstanceId< T extends string | number >(\n\tobject: object,\n\tprefix: string,\n\tpreferredId?: T\n): T;\n\n/**\n * Provides a unique instance ID.\n *\n * @param object Object reference to create an id for.\n * @param [prefix] Prefix for the unique id.\n * @param [preferredId] Default ID to use.\n * @return The unique instance id.\n */\nfunction useInstanceId(\n\tobject: object,\n\tprefix?: string,\n\tpreferredId?: string | number\n): string | number {\n\treturn useMemo( () => {\n\t\tif ( preferredId ) return preferredId;\n\t\tconst id = createId( object );\n\n\t\treturn prefix ? `${ prefix }-${ id }` : id;\n\t}, [ object ] );\n}\n\nexport default useInstanceId;\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-instance-id/index.ts"],"names":["useMemo","instanceMap","WeakMap","createId","object","instances","get","set","useInstanceId","prefix","preferredId","id"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AAEA,MAAMC,WAAW,GAAG,IAAIC,OAAJ,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAmBC,MAAnB,EAA4C;AAC3C,QAAMC,SAAS,GAAGJ,WAAW,CAACK,GAAZ,CAAiBF,MAAjB,KAA6B,CAA/C;AACAH,EAAAA,WAAW,CAACM,GAAZ,CAAiBH,MAAjB,EAAyBC,SAAS,GAAG,CAArC;AACA,SAAOA,SAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,aAAT,CACCJ,MADD,EAECK,MAFD,EAGCC,WAHD,EAImB;AAClB,SAAOV,OAAO,CAAE,MAAM;AACrB,QAAKU,WAAL,EAAmB,OAAOA,WAAP;AACnB,UAAMC,EAAE,GAAGR,QAAQ,CAAEC,MAAF,CAAnB;AAEA,WAAOK,MAAM,GAAI,GAAGA,MAAQ,IAAIE,EAAI,EAAvB,GAA2BA,EAAxC;AACA,GALa,EAKX,CAAEP,MAAF,CALW,CAAd;AAMA;;AAED,eAAeI,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\nconst instanceMap = new WeakMap< object, number >();\n\n/**\n * Creates a new id for a given object.\n *\n * @param object Object reference to create an id for.\n * @return The instance id (index).\n */\nfunction createId( object: object ): number {\n\tconst instances = instanceMap.get( object ) || 0;\n\tinstanceMap.set( object, instances + 1 );\n\treturn instances;\n}\n\n/**\n * Specify the useInstanceId *function* signatures.\n *\n * More accurately, useInstanceId distinguishes between three different\n * signatures:\n *\n * 1. When only object is given, the returned value is a number\n * 2. When object and prefix is given, the returned value is a string\n * 3. When preferredId is given, the returned value is the type of preferredId\n *\n * @param object Object reference to create an id for.\n */\nfunction useInstanceId( object: object ): number;\nfunction useInstanceId( object: object, prefix: string ): string;\nfunction useInstanceId< T extends string | number >(\n\tobject: object,\n\tprefix: string,\n\tpreferredId?: T\n): T;\n\n/**\n * Provides a unique instance ID.\n *\n * @param object Object reference to create an id for.\n * @param [prefix] Prefix for the unique id.\n * @param [preferredId] Default ID to use.\n * @return The unique instance id.\n */\nfunction useInstanceId(\n\tobject: object,\n\tprefix?: string,\n\tpreferredId?: string | number\n): string | number {\n\treturn useMemo( () => {\n\t\tif ( preferredId ) return preferredId;\n\t\tconst id = createId( object );\n\n\t\treturn prefix ? `${ prefix }-${ id }` : id;\n\t}, [ object ] );\n}\n\nexport default useInstanceId;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-async-list/index.ts"],"names":[],"mappings":"AAMA,aAAK,eAAe,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAwBF;;;;;;;;GAQG;AACH,iBAAS,YAAY,CAAE,CAAC,EACvB,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,GAAE,eAA6B,GACnC,CAAC,EAAE,CAiCL;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-async-list/index.ts"],"names":[],"mappings":"AAMA,aAAK,eAAe,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAwBF;;;;;;;;GAQG;AACH,iBAAS,YAAY,CAAE,CAAC,EACvB,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,GAAE,eAA6B,GACnC,CAAC,EAAE,CA+BL;AAED,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EACpC,UAAU,EAAE,cAAsB,GAClC;;CAAK,mCA8CL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EACpC,UAAU,EAAE,cAAsB,GAClC;;CAAK,mCAmDL"}
@@ -7,6 +7,8 @@
7
7
  * 1. When only object is given, the returned value is a number
8
8
  * 2. When object and prefix is given, the returned value is a string
9
9
  * 3. When preferredId is given, the returned value is the type of preferredId
10
+ *
11
+ * @param object Object reference to create an id for.
10
12
  */
11
13
  declare function useInstanceId(object: object): number;
12
14
  declare function useInstanceId(object: object, prefix: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-instance-id/index.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,iBAAS,aAAa,CAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAAC;AACjD,iBAAS,aAAa,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAAC;AACjE,iBAAS,aAAa,CAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAChD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,CAAC,GACb,CAAC,CAAC;AAuBL,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-instance-id/index.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;GAWG;AACH,iBAAS,aAAa,CAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAAC;AACjD,iBAAS,aAAa,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAAC;AACjE,iBAAS,aAAa,CAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAChD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,CAAC,GACb,CAAC,CAAC;AAuBL,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/compose",
3
- "version": "6.2.0",
3
+ "version": "6.3.1",
4
4
  "description": "WordPress higher-order components (HOCs).",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,12 +31,12 @@
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.16.0",
33
33
  "@types/mousetrap": "^1.6.8",
34
- "@wordpress/deprecated": "^3.25.0",
35
- "@wordpress/dom": "^3.25.0",
36
- "@wordpress/element": "^5.2.0",
37
- "@wordpress/is-shallow-equal": "^4.25.0",
38
- "@wordpress/keycodes": "^3.25.0",
39
- "@wordpress/priority-queue": "^2.25.0",
34
+ "@wordpress/deprecated": "^3.26.1",
35
+ "@wordpress/dom": "^3.26.1",
36
+ "@wordpress/element": "^5.3.1",
37
+ "@wordpress/is-shallow-equal": "^4.26.1",
38
+ "@wordpress/keycodes": "^3.26.1",
39
+ "@wordpress/priority-queue": "^2.26.1",
40
40
  "change-case": "^4.1.2",
41
41
  "clipboard": "^2.0.8",
42
42
  "mousetrap": "^1.6.5",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "204c880ff65295768e9695dfee6c7a9fee1fdd05"
51
+ "gitHead": "e9ff92d836928aba65dde94d9d193bc401a934d7"
52
52
  }
@@ -14,8 +14,6 @@ import { Component } from '@wordpress/element';
14
14
  */
15
15
  import pure from '../';
16
16
 
17
- jest.useFakeTimers();
18
-
19
17
  describe( 'pure', () => {
20
18
  it( 'functional component should rerender only when props change', () => {
21
19
  let i = 0;
@@ -42,9 +40,7 @@ describe( 'pure', () => {
42
40
  } );
43
41
 
44
42
  it( 'class component should rerender if the props or state change', async () => {
45
- const user = userEvent.setup( {
46
- advanceTimers: jest.advanceTimersByTime,
47
- } );
43
+ const user = userEvent.setup();
48
44
  let i = 0;
49
45
  const MyComp = pure(
50
46
  class extends Component {
@@ -9,13 +9,9 @@ import userEvent from '@testing-library/user-event';
9
9
  */
10
10
  import withState from '../';
11
11
 
12
- jest.useFakeTimers();
13
-
14
12
  describe( 'withState', () => {
15
13
  it( 'should pass initial state and allow updates', async () => {
16
- const user = userEvent.setup( {
17
- advanceTimers: jest.advanceTimersByTime,
18
- } );
14
+ const user = userEvent.setup();
19
15
  const EnhancedComponent = withState( {
20
16
  count: 0,
21
17
  } )( ( { count, setState } ) => (
@@ -44,7 +44,7 @@ function useAsyncList< T >(
44
44
  config: AsyncListConfig = { step: 1 }
45
45
  ): T[] {
46
46
  const { step = 1 } = config;
47
- const [ current, setCurrent ] = useState( [] as T[] );
47
+ const [ current, setCurrent ] = useState< T[] >( [] );
48
48
 
49
49
  useEffect( () => {
50
50
  // On reset, we keep the first items that were previously rendered.
@@ -55,10 +55,9 @@ function useAsyncList< T >(
55
55
  );
56
56
  }
57
57
  setCurrent( firstItems );
58
- let nextIndex = firstItems.length;
59
58
 
60
59
  const asyncQueue = createQueue();
61
- const append = () => {
60
+ const append = ( nextIndex: number ) => () => {
62
61
  if ( list.length <= nextIndex ) {
63
62
  return;
64
63
  }
@@ -66,10 +65,9 @@ function useAsyncList< T >(
66
65
  ...state,
67
66
  ...list.slice( nextIndex, nextIndex + step ),
68
67
  ] );
69
- nextIndex += step;
70
- asyncQueue.add( {}, append );
68
+ asyncQueue.add( {}, append( nextIndex + step ) );
71
69
  };
72
- asyncQueue.add( {}, append );
70
+ asyncQueue.add( {}, append( firstItems.length ) );
73
71
 
74
72
  return () => asyncQueue.reset();
75
73
  }, [ list ] );
@@ -39,11 +39,16 @@ export default function useDisabled( {
39
39
  return;
40
40
  }
41
41
 
42
+ const defaultView = node?.ownerDocument?.defaultView;
43
+ if ( ! defaultView ) {
44
+ return;
45
+ }
46
+
42
47
  /** A variable keeping track of the previous updates in order to restore them. */
43
48
  const updates: Function[] = [];
44
49
  const disable = () => {
45
50
  node.childNodes.forEach( ( child ) => {
46
- if ( ! ( child instanceof HTMLElement ) ) {
51
+ if ( ! ( child instanceof defaultView.HTMLElement ) ) {
47
52
  return;
48
53
  }
49
54
  if ( ! child.getAttribute( 'inert' ) ) {
@@ -9,8 +9,6 @@ import userEvent from '@testing-library/user-event';
9
9
  */
10
10
  import useFocusOutside from '../';
11
11
 
12
- jest.useFakeTimers();
13
-
14
12
  const FocusOutsideComponent = ( { onFocusOutside: callback } ) => (
15
13
  <div>
16
14
  { /* Wrapper */ }
@@ -29,9 +27,7 @@ const FocusOutsideComponent = ( { onFocusOutside: callback } ) => (
29
27
  describe( 'useFocusOutside', () => {
30
28
  it( 'should not call handler if focus shifts to element within component', async () => {
31
29
  const mockOnFocusOutside = jest.fn();
32
- const user = userEvent.setup( {
33
- advanceTimers: jest.advanceTimersByTime,
34
- } );
30
+ const user = userEvent.setup();
35
31
 
36
32
  render(
37
33
  <FocusOutsideComponent onFocusOutside={ mockOnFocusOutside } />
@@ -52,9 +48,7 @@ describe( 'useFocusOutside', () => {
52
48
 
53
49
  it( 'should not call handler if focus transitions via click to button', async () => {
54
50
  const mockOnFocusOutside = jest.fn();
55
- const user = userEvent.setup( {
56
- advanceTimers: jest.advanceTimersByTime,
57
- } );
51
+ const user = userEvent.setup();
58
52
 
59
53
  render(
60
54
  <FocusOutsideComponent onFocusOutside={ mockOnFocusOutside } />
@@ -71,9 +65,7 @@ describe( 'useFocusOutside', () => {
71
65
 
72
66
  it( 'should call handler if focus shifts to element outside component', async () => {
73
67
  const mockOnFocusOutside = jest.fn();
74
- const user = userEvent.setup( {
75
- advanceTimers: jest.advanceTimersByTime,
76
- } );
68
+ const user = userEvent.setup();
77
69
 
78
70
  render(
79
71
  <FocusOutsideComponent onFocusOutside={ mockOnFocusOutside } />
@@ -101,9 +93,7 @@ describe( 'useFocusOutside', () => {
101
93
  .spyOn( document, 'hasFocus' )
102
94
  .mockImplementation( () => false );
103
95
  const mockOnFocusOutside = jest.fn();
104
- const user = userEvent.setup( {
105
- advanceTimers: jest.advanceTimersByTime,
106
- } );
96
+ const user = userEvent.setup();
107
97
 
108
98
  render(
109
99
  <FocusOutsideComponent onFocusOutside={ mockOnFocusOutside } />
@@ -128,9 +118,7 @@ describe( 'useFocusOutside', () => {
128
118
 
129
119
  it( 'should cancel check when unmounting while queued', async () => {
130
120
  const mockOnFocusOutside = jest.fn();
131
- const user = userEvent.setup( {
132
- advanceTimers: jest.advanceTimersByTime,
133
- } );
121
+ const user = userEvent.setup();
134
122
 
135
123
  const { unmount } = render(
136
124
  <FocusOutsideComponent onFocusOutside={ mockOnFocusOutside } />
@@ -147,8 +135,6 @@ describe( 'useFocusOutside', () => {
147
135
  button.blur();
148
136
  unmount();
149
137
 
150
- jest.runAllTimers();
151
-
152
138
  expect( mockOnFocusOutside ).not.toHaveBeenCalled();
153
139
  } );
154
140
  } );
@@ -26,6 +26,8 @@ function createId( object: object ): number {
26
26
  * 1. When only object is given, the returned value is a number
27
27
  * 2. When object and prefix is given, the returned value is a string
28
28
  * 3. When preferredId is given, the returned value is the type of preferredId
29
+ *
30
+ * @param object Object reference to create an id for.
29
31
  */
30
32
  function useInstanceId( object: object ): number;
31
33
  function useInstanceId( object: object, prefix: string ): string;
@@ -5,14 +5,6 @@ import { debounce } from '../index';
5
5
 
6
6
  const identity = ( value ) => value;
7
7
 
8
- beforeAll( () => {
9
- jest.useRealTimers();
10
- } );
11
-
12
- afterAll( () => {
13
- jest.useFakeTimers();
14
- } );
15
-
16
8
  describe( 'debounce', () => {
17
9
  it( 'should debounce a function', () => {
18
10
  return new Promise( ( done ) => {
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/no-case/dist/index.d.ts","../../node_modules/pascal-case/dist/index.d.ts","../../node_modules/camel-case/dist/index.d.ts","../../node_modules/capital-case/dist/index.d.ts","../../node_modules/constant-case/dist/index.d.ts","../../node_modules/dot-case/dist/index.d.ts","../../node_modules/header-case/dist/index.d.ts","../../node_modules/param-case/dist/index.d.ts","../../node_modules/path-case/dist/index.d.ts","../../node_modules/sentence-case/dist/index.d.ts","../../node_modules/snake-case/dist/index.d.ts","../../node_modules/change-case/dist/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","./src/utils/create-higher-order-component/index.ts","./src/utils/debounce/index.ts","./src/utils/throttle/index.ts","./src/higher-order/pipe.ts","./src/higher-order/compose.ts","./src/higher-order/if-condition/index.tsx","../is-shallow-equal/build-types/objects.d.ts","../is-shallow-equal/build-types/arrays.d.ts","../is-shallow-equal/build-types/index.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/higher-order/pure/index.tsx","../../node_modules/utility-types/dist/aliases-and-guards.d.ts","../../node_modules/utility-types/dist/mapped-types.d.ts","../../node_modules/utility-types/dist/utility-types.d.ts","../../node_modules/utility-types/dist/functional-helpers.d.ts","../../node_modules/utility-types/dist/index.d.ts","../deprecated/build-types/index.d.ts","./src/higher-order/with-global-events/listener.js","./src/higher-order/with-global-events/index.js","./src/hooks/use-instance-id/index.ts","./src/higher-order/with-instance-id/index.tsx","./src/higher-order/with-safe-timeout/index.tsx","./src/higher-order/with-state/index.js","../keycodes/build-types/platform.d.ts","../keycodes/build-types/index.d.ts","../dom/build-types/dom/compute-caret-rect.d.ts","../dom/build-types/dom/document-has-text-selection.d.ts","../dom/build-types/dom/document-has-uncollapsed-selection.d.ts","../dom/build-types/dom/document-has-selection.d.ts","../dom/build-types/dom/get-rectangle-from-range.d.ts","../dom/build-types/dom/get-scroll-container.d.ts","../dom/build-types/dom/get-offset-parent.d.ts","../dom/build-types/dom/is-entirely-selected.d.ts","../dom/build-types/dom/is-form-element.d.ts","../dom/build-types/dom/is-horizontal-edge.d.ts","../dom/build-types/dom/is-number-input.d.ts","../dom/build-types/dom/is-text-field.d.ts","../dom/build-types/dom/is-vertical-edge.d.ts","../dom/build-types/dom/place-caret-at-horizontal-edge.d.ts","../dom/build-types/dom/place-caret-at-vertical-edge.d.ts","../dom/build-types/dom/replace.d.ts","../dom/build-types/dom/remove.d.ts","../dom/build-types/dom/insert-after.d.ts","../dom/build-types/dom/unwrap.d.ts","../dom/build-types/dom/replace-tag.d.ts","../dom/build-types/dom/wrap.d.ts","../dom/build-types/dom/strip-html.d.ts","../dom/build-types/dom/is-empty.d.ts","../dom/build-types/dom/clean-node-list.d.ts","../dom/build-types/dom/remove-invalid-html.d.ts","../dom/build-types/dom/is-rtl.d.ts","../dom/build-types/dom/safe-html.d.ts","../dom/build-types/dom/index.d.ts","../dom/build-types/phrasing-content.d.ts","../dom/build-types/data-transfer.d.ts","../dom/build-types/focusable.d.ts","../dom/build-types/tabbable.d.ts","../dom/build-types/index.d.ts","./src/hooks/use-ref-effect/index.ts","./src/hooks/use-constrained-tabbing/index.js","../../node_modules/clipboard/src/clipboard.d.ts","./src/hooks/use-copy-on-click/index.js","./src/hooks/use-copy-to-clipboard/index.js","./src/hooks/use-focus-on-mount/index.js","./src/hooks/use-focus-return/index.js","./src/hooks/use-focus-outside/index.ts","./src/hooks/use-merge-refs/index.js","./src/hooks/use-dialog/index.ts","./src/hooks/use-disabled/index.ts","./src/hooks/use-isomorphic-layout-effect/index.js","./src/hooks/use-dragging/index.js","../../node_modules/@types/mousetrap/index.d.ts","../../node_modules/@types/mousetrap/plugins/global-bind/mousetrap-global-bind.d.ts","./src/hooks/use-keyboard-shortcut/index.js","./src/hooks/use-media-query/index.js","./src/hooks/use-previous/index.ts","./src/hooks/use-reduced-motion/index.js","./src/hooks/use-viewport-match/index.js","./src/hooks/use-resize-observer/index.tsx","../priority-queue/build-types/index.d.ts","./src/hooks/use-async-list/index.ts","./src/hooks/use-warn-on-change/index.js","../../node_modules/use-memo-one/index.d.ts","./src/hooks/use-debounce/index.js","./src/hooks/use-throttle/index.js","./src/hooks/use-drop-zone/index.js","./src/hooks/use-focusable-iframe/index.ts","./src/hooks/use-fixed-window-list/index.js","./src/index.js","../../typings/gutenberg-env/index.d.ts","../element/node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"b4e123af1af6049685c93073a15868b50aebdad666d422edc72fa2b585fa8a37","f86c04a744ebcede96bac376f9a2c90f2bd3c422740d91dda4ca6233199d4977","6ae1bddee5c790439bd992abd063b9b46e0cadd676c2a8562268d1869213ff60","606244fc97a6a74b877f2e924ba7e55b233bc6acb57d7bf40ba84a5be2d9adb0","4a1cabac71036b8a14f5db1b753b579f0c901c7d7b9227e6872dadf6efb104e8","062959a1d825b96639d87be35fe497cbd3f89544bf06fdad577bbfb85fcf604c","4c3672dc8f4e4fdd3d18525b22b31f1b5481f5a415db96550d3ac5163a6c3dd3","f9a69ca445010b91fe08f08c06e0f86d79c0d776905f9bdb828477cb2a1eb7fc","ad7fd0e7ee457d4884b3aaecbcbd2a80b6803407c4ce2540c296170d4c7918ef","a50ef21605f41c6acad6c3ef0307e5311b94963c846ca093c764b80cdb5318d6","74b4035dd26d09a417c44ca23ab5ee69b173f8c2f6b2e47350ab0795cf2d4a17","918f86ee2b19cc38cb8b1a4cf8f223eb228aaa39df3604c42f700fac2f0b3ea1",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"a411d5c6b281a3820b7b16f4183e7b992e3afe0942d233ec9d25c641fd53476b","f0b28b3d6882f5e1d938ca97e5f33d1b3bd2d0fcf275a95a1ed6e4aae8db3d98","ec17a33de0166cd47421642635272df2893f5aca9e84bf8d08c4af617a6dbe9e","db829c3ac876762865ad7fd84ea0ed5be54823518399db1ca3af4572b6649e87","a41403e55f0a8b7d5b50dd7d1adac61caa18f69d7591c95cbe7e7d5bcaf37177","f9fd6e3ade5a1179d67ba174b2f4219ba5afa7c0b8817cd07e398f0ebccefbe7","5190f1a110a789c2f8ed8dcf2da6ce122dcb74249d0c01d19d1ed0b1c6bb02a1","3650bbe137c9c44bc6b8f44a56353b00eba9654e41a9355e6228f7f0f464c648","9c4f32d2fa2b6efeed4f9fbd98254121b17982110b48edcede96e2dc2af0894d",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","1dd3d421923d8f03af788abb7e9585e2cf2fe7365958e727928cbab8f691a9e8","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","cafd444fa9429538f39b36d19967735f4ddd68afdf595ce8d6526b9535a32967","8da8943f5709102a1a172e59ad9ef8efcfad939c3fc3ce0931cee0e74b746415","06344dc54bd683361d1265df562bf28310dee42631351cbc73ec0662067a2662","5cc991dfbc9af88d5fad5edf08593065d9eefea81cd07a8277b28198645db0b6","692845166d816acc56af6762b5a9eefc882f530b52664b4162b11a645c515365","04960fe91185fc317b9f8d2d2604b4547c8ea3ec49563062c28ae95c89e06e3a","e6523d2db6e2ae8cf35fdc53199538d6817add78536b1a986c3a08513b7202e1","ce845faff6db3eb0e1d62ff1c6337f0bb1202b312dde69efd5addd5aa0389b07","cbf4ee77c80de53d71a1d076ea25eddd23541685119a67c43bd4aeaad8533b1f","215f6d27f88aeaa56a4e0fe358a6fe3b8b5f7c76a2f83663035028b0c2595b1f","f8d84deeb6367b306c78f83111f36b14a7cb786af0c3a93168ffc97a2e0916c9","c307c0c1d2a162347fe19da27d37ee9f333617a23686649acbe4190848225970","6bcfd3b6f61aedc9734a19729a0d1a8e7de6aa02621bf519d0a1276601fb1a74","fe43e4fd566293aee946e5db5b055db1215602498d315e468c6adaf1e6917fb4","ea912b91fed2f873b87e24180399baad37c43019b6f51b210e1d9f1d1d0135ba","a1cd2b1943db96616abf3a3f939dfd0eb69fab8149725d195a8acc7f5672a1f9","ddf5e2dd1897b3271acd68a587d43996e18c63ccc51b17f9149763a7d4bbadb7","1466691ae57846e0280465b012fd01aed3c4a4e0b39fcc11276833fbfc72ade7","b3ceffa2a65a5d7a6f0d6daf429d23dd301df58718ad07e397bfa28f7d8a2688","cfa03019dd5cdd18ff1b5f00b3cb37ac762faf9eca2e86ea2c718502285cf67b","4d8d7075a3381162b4ae5147f84b4d2a2ae49398d98bef7c4437b8db0fefb194","a8b1a9f91ecb89faabb130af767e007ee28ac6ca794565d856759bb87e42feb1","1b1c43c378278f5dfea558337b0e3d57944a806eb4f55330baba592967253350","5ad070af2f7e4b7a676a63137c6a6cf670144ee5f23a9a30b21c19e70bb077f3","df060b3639c427e1c09bcf5cc14975f00b296e53192c710ea76e4a658a382aa0","4dd037aee1fed84d54490818e9a32d12e3e2f75d1dd9816d25fb9a0ecacee3b9","ca84eb7ffe779cb8812ee0a6aa151adac3dd25c4dc877767f37d079e5b62151f","f1d5239e0cdfb4ddd24a47727b88871802d3d2b3fda70229b158525753ad643e","af89d09746be737e24c50de49f035f3afea14c11be30ad5d2764d142daaa4078","5422948be7ac69dd13078af8ce2a8d9ea4d79eb510bfc54b75586573185183f9","246fc68fbf5c3ae2fded7eebcc38e6c5bb0f2cb796096916d0e65505cfbe850f","fc35e9bf454dcd7c42bab9e51bdedd4c9a5662b8d9964b1204913e268cb1fe6f","6e278ba8dbcf2617a2c5f5805e3addd1cf1c35b75b7dde3cbdabbccbf926b6fe","a2e36dad616090f5bcb99c4491b8b34bf8f2b5bf2fdcd6b5a43ddfd23f1b8433","c9d56f52ca68c2c86ec5ba05d927ef3892dca4923bd3cebe6593ebbcdd7e70c3","419dd7c5f46e04ddc2a390070fe19423200334f464bcd41a8bac56007127a13d","067b19c3d1fde05a39e5b769cbb5f44e0f6cf201f52fa2cafedc3943ea2e9052","e3ea09f9ea097b88c98df19c52694ac83daab0692e90cea9cf3faff00087899f","02e1dfd21586ad4379dc0d0ab88283694734f786ed4dcffaf5fbe25b23cd4b62","e8764e82f28e0a7acb1edf0cd502de3c667ce0597ec8deefab4bddcb2273e4c7","4a43623f49489a0e0359e905dc2eaeb88c9bc5dce62819b9c04c8c60d79d2782","82e37f3013111a0a7abf743e89b074261bb92655bea624bb07ac77c6f0a94657","cf46c72956ce0ad410066196057812424d4ce17f2c4e1436d87fd0da9ee21830","d7865f701e0b27e883babea23a4aa1d1a8f37ccc502f7834b81d117401d689f4","2290ccf854da4cabed41ff4013869e463b16772b3f16ae308e382f91d516c895","198ebdc9a229972b281bb98bc86528dbbe00a91f6fd7b1a2d987f0f3f52157d8","50c61f235257b1c9068c41a5a50baeb4274ea5dfc07d2f86c4032617e30d0732","bc4724a288bcb43fb7248fdc5dc371c3faf8fced20033e4bb75f4eb09cfdf01d","d86f9f4afbec438f732d95dcb99b67b62d9efbf2b711464b65fd2d14ba15f75f","fa277bbe15a3e2945be2608ccb159208ef50ae95b5059acc01d8c453b1683fff","2ce70b0c8a1d1babeb3e7eb19b34ed0ecd8f935c26bbd0e8d6affc3fb46b22c3","de3f48d4ddc159b324db68d27fc8fdee4d0153ac872d292ecc05af01b4302d65","98d019534dd7c963b013eed9a2a2e8a96618e70a40730f6920614be6d410ef80","774f781a28c56874e245eadff141e5e52af54e5555d7e083fca45f06348841ed","96520a873073a2f39f922d0a422498cdcc28be9066a769000cdd07ecaba7b645","135aa6d18002bfec723f8697aa80a59648cf0582752d5e089b6eb0770b63a02d","b6eb8e23f4145ddbe22639779de710af7a554c9592f69f257b7ec5c487eb0695","831d99b85c6ced631649a70014e1288d3f927fa262e4009ba1fbcd11b965ce58","38fef887c5b2cae9d244172fe72957e61c3393bacc2be3ae5e2c1bf1e8a69e71","e064325c76ef07fec4cd69a91dabe717fae011bba5e15d81a2486ce25e80a91e","914d7cdcd8c7ebff500b43e8a878164ef0f93168eea0e5246747484a160d730b",{"version":"4169be501cd57005d1c910fa24cef850c2922596632b00096063f58d649ba85a","affectsGlobalScope":true},"abb6d9adcc79c591f712e79c55f769b48690ec66a55b6f6189569a0d357c7e58","e7669752758ae96e591040a264669535d7e65a8ce01f86812211fe39dc7bef6c","8ebd5899eefab0ba9bb82ae4cdd18aca44564a25cebfa51ea5d92db4252b49dd","62540abf0bac8bf8c13c183db0457c5495a2bdad157f9eb03916c3953feb765e","7fe68b17d28662b4c1232c578a3bce0532f2628b443ad541a196b124e4d93087","89eae3e00b2fbde1af73eab56e0ca7960c2dbc02c2ef89f98104ceb75526311b","88d3d5b21760947695c7d812e5992c5a80d938cafaf8ecf687e350bd230f5d25","11fb82c3644a70cf226676762f39dc6de87ef9dc11ed83e5ca52e013425cfd89","2d78a397234d9b3325910135668cffba83af759074ceadc0afd281795ca8b9fc","22f67790611304c6726a7e333265c1b64e472e78bb661f734a4cd715402d3e9f",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[143],[61],[57,58,59,60],[46],[45],[45,46,47,48,49,50,51,52,53,54,55],[48],[50],[83,84,85,86],[83],[84],[65],[61,62],[61,62,70,81],[62,81,88,89],[62,91],[62,81],[62,81,88],[81,151],[61,96,129,130],[61,81,88,132],[61,81,130,132],[63,81,154],[61,81,96,131,135,136,137,138],[63,130],[61,81,141],[61,81,130],[61,63,81,96,129],[61,81,129],[61,81],[61,130],[81],[61,81,96,143,144],[146],[63,64,81,154],[81,146],[147],[62,63,64,65,66,67,82,90,91,92,93,94,130,131,133,134,135,136,137,138,139,140,141,142,145,146,147,148,149,150,152,153,155,156,157,158,159],[56,61],[63],[87],[97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,121,122,123],[120],[124,125,126,127,128],[72],[72,73,76,77,78,79,80],[74,75],[61,72],[58,59,60,162],[68,69],[70],[95]],"referencedMap":[[144,1],[75,2],[74,2],[61,3],[47,4],[48,5],[56,6],[49,5],[50,5],[51,7],[52,8],[46,5],[53,8],[54,5],[55,8],[87,9],[84,10],[85,11],[66,12],[67,13],[82,14],[90,15],[92,16],[93,17],[94,18],[152,19],[131,20],[133,21],[134,22],[155,23],[139,24],[140,25],[142,26],[157,27],[159,28],[135,29],[137,30],[136,30],[158,31],[91,32],[141,32],[145,33],[146,32],[138,30],[147,32],[148,34],[130,30],[150,30],[156,35],[149,36],[153,37],[160,38],[62,39],[64,40],[88,41],[124,42],[121,43],[129,44],[73,45],[81,46],[80,2],[76,47],[72,2],[79,48],[71,49],[70,50],[68,51],[96,52]],"exportedModulesMap":[[144,1],[75,2],[74,2],[61,3],[47,4],[48,5],[56,6],[49,5],[50,5],[51,7],[52,8],[46,5],[53,8],[54,5],[55,8],[87,9],[84,10],[85,11],[66,12],[67,13],[82,14],[90,15],[92,16],[93,17],[94,18],[152,19],[131,20],[133,21],[134,22],[155,23],[139,24],[140,25],[142,26],[157,27],[159,28],[135,29],[137,30],[136,30],[158,31],[91,32],[141,32],[145,33],[146,32],[138,30],[147,32],[148,34],[130,30],[150,30],[156,35],[149,36],[153,37],[160,38],[62,39],[64,40],[88,41],[124,42],[121,43],[129,44],[73,45],[81,46],[80,2],[76,47],[72,2],[79,48],[71,49],[70,50],[68,51],[96,52]],"semanticDiagnosticsPerFile":[143,144,59,75,74,57,61,60,47,48,56,132,49,58,50,51,45,52,46,53,54,55,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,154,83,86,87,84,85,66,67,65,82,90,89,92,93,94,152,131,133,134,155,139,140,142,157,159,135,137,136,158,91,141,145,146,138,147,148,130,150,156,149,153,160,62,63,64,88,126,120,97,100,98,99,103,101,102,124,114,119,104,105,106,107,122,108,109,110,111,121,113,116,112,123,118,115,117,127,129,125,128,73,81,78,80,76,72,79,77,71,69,70,68,96,95,151,161]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/no-case/dist/index.d.ts","../../node_modules/pascal-case/dist/index.d.ts","../../node_modules/camel-case/dist/index.d.ts","../../node_modules/capital-case/dist/index.d.ts","../../node_modules/constant-case/dist/index.d.ts","../../node_modules/dot-case/dist/index.d.ts","../../node_modules/header-case/dist/index.d.ts","../../node_modules/param-case/dist/index.d.ts","../../node_modules/path-case/dist/index.d.ts","../../node_modules/sentence-case/dist/index.d.ts","../../node_modules/snake-case/dist/index.d.ts","../../node_modules/change-case/dist/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","./src/utils/create-higher-order-component/index.ts","./src/utils/debounce/index.ts","./src/utils/throttle/index.ts","./src/higher-order/pipe.ts","./src/higher-order/compose.ts","./src/higher-order/if-condition/index.tsx","../is-shallow-equal/build-types/objects.d.ts","../is-shallow-equal/build-types/arrays.d.ts","../is-shallow-equal/build-types/index.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/higher-order/pure/index.tsx","../../node_modules/utility-types/dist/aliases-and-guards.d.ts","../../node_modules/utility-types/dist/mapped-types.d.ts","../../node_modules/utility-types/dist/utility-types.d.ts","../../node_modules/utility-types/dist/functional-helpers.d.ts","../../node_modules/utility-types/dist/index.d.ts","../deprecated/build-types/index.d.ts","./src/higher-order/with-global-events/listener.js","./src/higher-order/with-global-events/index.js","./src/hooks/use-instance-id/index.ts","./src/higher-order/with-instance-id/index.tsx","./src/higher-order/with-safe-timeout/index.tsx","./src/higher-order/with-state/index.js","../keycodes/build-types/platform.d.ts","../keycodes/build-types/index.d.ts","../dom/build-types/dom/compute-caret-rect.d.ts","../dom/build-types/dom/document-has-text-selection.d.ts","../dom/build-types/dom/document-has-uncollapsed-selection.d.ts","../dom/build-types/dom/document-has-selection.d.ts","../dom/build-types/dom/get-rectangle-from-range.d.ts","../dom/build-types/dom/get-scroll-container.d.ts","../dom/build-types/dom/get-offset-parent.d.ts","../dom/build-types/dom/is-entirely-selected.d.ts","../dom/build-types/dom/is-form-element.d.ts","../dom/build-types/dom/is-horizontal-edge.d.ts","../dom/build-types/dom/is-number-input.d.ts","../dom/build-types/dom/is-text-field.d.ts","../dom/build-types/dom/is-vertical-edge.d.ts","../dom/build-types/dom/place-caret-at-horizontal-edge.d.ts","../dom/build-types/dom/place-caret-at-vertical-edge.d.ts","../dom/build-types/dom/replace.d.ts","../dom/build-types/dom/remove.d.ts","../dom/build-types/dom/insert-after.d.ts","../dom/build-types/dom/unwrap.d.ts","../dom/build-types/dom/replace-tag.d.ts","../dom/build-types/dom/wrap.d.ts","../dom/build-types/dom/strip-html.d.ts","../dom/build-types/dom/is-empty.d.ts","../dom/build-types/dom/clean-node-list.d.ts","../dom/build-types/dom/remove-invalid-html.d.ts","../dom/build-types/dom/is-rtl.d.ts","../dom/build-types/dom/safe-html.d.ts","../dom/build-types/dom/index.d.ts","../dom/build-types/phrasing-content.d.ts","../dom/build-types/data-transfer.d.ts","../dom/build-types/focusable.d.ts","../dom/build-types/tabbable.d.ts","../dom/build-types/index.d.ts","./src/hooks/use-ref-effect/index.ts","./src/hooks/use-constrained-tabbing/index.js","../../node_modules/clipboard/src/clipboard.d.ts","./src/hooks/use-copy-on-click/index.js","./src/hooks/use-copy-to-clipboard/index.js","./src/hooks/use-focus-on-mount/index.js","./src/hooks/use-focus-return/index.js","./src/hooks/use-focus-outside/index.ts","./src/hooks/use-merge-refs/index.js","./src/hooks/use-dialog/index.ts","./src/hooks/use-disabled/index.ts","./src/hooks/use-isomorphic-layout-effect/index.js","./src/hooks/use-dragging/index.js","../../node_modules/@types/mousetrap/index.d.ts","../../node_modules/@types/mousetrap/plugins/global-bind/mousetrap-global-bind.d.ts","./src/hooks/use-keyboard-shortcut/index.js","./src/hooks/use-media-query/index.js","./src/hooks/use-previous/index.ts","./src/hooks/use-reduced-motion/index.js","./src/hooks/use-viewport-match/index.js","./src/hooks/use-resize-observer/index.tsx","../priority-queue/build-types/index.d.ts","./src/hooks/use-async-list/index.ts","./src/hooks/use-warn-on-change/index.js","../../node_modules/use-memo-one/index.d.ts","./src/hooks/use-debounce/index.js","./src/hooks/use-throttle/index.js","./src/hooks/use-drop-zone/index.js","./src/hooks/use-focusable-iframe/index.ts","./src/hooks/use-fixed-window-list/index.js","./src/index.js","../../typings/gutenberg-env/index.d.ts","../element/node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"b4e123af1af6049685c93073a15868b50aebdad666d422edc72fa2b585fa8a37","f86c04a744ebcede96bac376f9a2c90f2bd3c422740d91dda4ca6233199d4977","6ae1bddee5c790439bd992abd063b9b46e0cadd676c2a8562268d1869213ff60","606244fc97a6a74b877f2e924ba7e55b233bc6acb57d7bf40ba84a5be2d9adb0","4a1cabac71036b8a14f5db1b753b579f0c901c7d7b9227e6872dadf6efb104e8","062959a1d825b96639d87be35fe497cbd3f89544bf06fdad577bbfb85fcf604c","4c3672dc8f4e4fdd3d18525b22b31f1b5481f5a415db96550d3ac5163a6c3dd3","f9a69ca445010b91fe08f08c06e0f86d79c0d776905f9bdb828477cb2a1eb7fc","ad7fd0e7ee457d4884b3aaecbcbd2a80b6803407c4ce2540c296170d4c7918ef","a50ef21605f41c6acad6c3ef0307e5311b94963c846ca093c764b80cdb5318d6","74b4035dd26d09a417c44ca23ab5ee69b173f8c2f6b2e47350ab0795cf2d4a17","918f86ee2b19cc38cb8b1a4cf8f223eb228aaa39df3604c42f700fac2f0b3ea1",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"a411d5c6b281a3820b7b16f4183e7b992e3afe0942d233ec9d25c641fd53476b","f0b28b3d6882f5e1d938ca97e5f33d1b3bd2d0fcf275a95a1ed6e4aae8db3d98","ec17a33de0166cd47421642635272df2893f5aca9e84bf8d08c4af617a6dbe9e","db829c3ac876762865ad7fd84ea0ed5be54823518399db1ca3af4572b6649e87","a41403e55f0a8b7d5b50dd7d1adac61caa18f69d7591c95cbe7e7d5bcaf37177","f9fd6e3ade5a1179d67ba174b2f4219ba5afa7c0b8817cd07e398f0ebccefbe7","5190f1a110a789c2f8ed8dcf2da6ce122dcb74249d0c01d19d1ed0b1c6bb02a1","3650bbe137c9c44bc6b8f44a56353b00eba9654e41a9355e6228f7f0f464c648","9c4f32d2fa2b6efeed4f9fbd98254121b17982110b48edcede96e2dc2af0894d",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","1dd3d421923d8f03af788abb7e9585e2cf2fe7365958e727928cbab8f691a9e8","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","cafd444fa9429538f39b36d19967735f4ddd68afdf595ce8d6526b9535a32967","8da8943f5709102a1a172e59ad9ef8efcfad939c3fc3ce0931cee0e74b746415","4e5b605f1489578bdbd7c31205c1dd3b67b99a44f6eca6a9106f9c13e8d6d654","5cc991dfbc9af88d5fad5edf08593065d9eefea81cd07a8277b28198645db0b6","692845166d816acc56af6762b5a9eefc882f530b52664b4162b11a645c515365","04960fe91185fc317b9f8d2d2604b4547c8ea3ec49563062c28ae95c89e06e3a","e6523d2db6e2ae8cf35fdc53199538d6817add78536b1a986c3a08513b7202e1","ce845faff6db3eb0e1d62ff1c6337f0bb1202b312dde69efd5addd5aa0389b07","cbf4ee77c80de53d71a1d076ea25eddd23541685119a67c43bd4aeaad8533b1f","215f6d27f88aeaa56a4e0fe358a6fe3b8b5f7c76a2f83663035028b0c2595b1f","f8d84deeb6367b306c78f83111f36b14a7cb786af0c3a93168ffc97a2e0916c9","c307c0c1d2a162347fe19da27d37ee9f333617a23686649acbe4190848225970","6bcfd3b6f61aedc9734a19729a0d1a8e7de6aa02621bf519d0a1276601fb1a74","fe43e4fd566293aee946e5db5b055db1215602498d315e468c6adaf1e6917fb4","ea912b91fed2f873b87e24180399baad37c43019b6f51b210e1d9f1d1d0135ba","a1cd2b1943db96616abf3a3f939dfd0eb69fab8149725d195a8acc7f5672a1f9","ddf5e2dd1897b3271acd68a587d43996e18c63ccc51b17f9149763a7d4bbadb7","1466691ae57846e0280465b012fd01aed3c4a4e0b39fcc11276833fbfc72ade7","b3ceffa2a65a5d7a6f0d6daf429d23dd301df58718ad07e397bfa28f7d8a2688","cfa03019dd5cdd18ff1b5f00b3cb37ac762faf9eca2e86ea2c718502285cf67b","4d8d7075a3381162b4ae5147f84b4d2a2ae49398d98bef7c4437b8db0fefb194","a8b1a9f91ecb89faabb130af767e007ee28ac6ca794565d856759bb87e42feb1","1b1c43c378278f5dfea558337b0e3d57944a806eb4f55330baba592967253350","5ad070af2f7e4b7a676a63137c6a6cf670144ee5f23a9a30b21c19e70bb077f3","df060b3639c427e1c09bcf5cc14975f00b296e53192c710ea76e4a658a382aa0","4dd037aee1fed84d54490818e9a32d12e3e2f75d1dd9816d25fb9a0ecacee3b9","ca84eb7ffe779cb8812ee0a6aa151adac3dd25c4dc877767f37d079e5b62151f","f1d5239e0cdfb4ddd24a47727b88871802d3d2b3fda70229b158525753ad643e","af89d09746be737e24c50de49f035f3afea14c11be30ad5d2764d142daaa4078","5422948be7ac69dd13078af8ce2a8d9ea4d79eb510bfc54b75586573185183f9","246fc68fbf5c3ae2fded7eebcc38e6c5bb0f2cb796096916d0e65505cfbe850f","fc35e9bf454dcd7c42bab9e51bdedd4c9a5662b8d9964b1204913e268cb1fe6f","6e278ba8dbcf2617a2c5f5805e3addd1cf1c35b75b7dde3cbdabbccbf926b6fe","a2e36dad616090f5bcb99c4491b8b34bf8f2b5bf2fdcd6b5a43ddfd23f1b8433","c9d56f52ca68c2c86ec5ba05d927ef3892dca4923bd3cebe6593ebbcdd7e70c3","419dd7c5f46e04ddc2a390070fe19423200334f464bcd41a8bac56007127a13d","067b19c3d1fde05a39e5b769cbb5f44e0f6cf201f52fa2cafedc3943ea2e9052","e3ea09f9ea097b88c98df19c52694ac83daab0692e90cea9cf3faff00087899f","02e1dfd21586ad4379dc0d0ab88283694734f786ed4dcffaf5fbe25b23cd4b62","e8764e82f28e0a7acb1edf0cd502de3c667ce0597ec8deefab4bddcb2273e4c7","4a43623f49489a0e0359e905dc2eaeb88c9bc5dce62819b9c04c8c60d79d2782","82e37f3013111a0a7abf743e89b074261bb92655bea624bb07ac77c6f0a94657","cf46c72956ce0ad410066196057812424d4ce17f2c4e1436d87fd0da9ee21830","d7865f701e0b27e883babea23a4aa1d1a8f37ccc502f7834b81d117401d689f4","2290ccf854da4cabed41ff4013869e463b16772b3f16ae308e382f91d516c895","198ebdc9a229972b281bb98bc86528dbbe00a91f6fd7b1a2d987f0f3f52157d8","50c61f235257b1c9068c41a5a50baeb4274ea5dfc07d2f86c4032617e30d0732","bc4724a288bcb43fb7248fdc5dc371c3faf8fced20033e4bb75f4eb09cfdf01d","d86f9f4afbec438f732d95dcb99b67b62d9efbf2b711464b65fd2d14ba15f75f","fa277bbe15a3e2945be2608ccb159208ef50ae95b5059acc01d8c453b1683fff","2ce70b0c8a1d1babeb3e7eb19b34ed0ecd8f935c26bbd0e8d6affc3fb46b22c3","c34925abafd06d280f2387015bc79ffaee0ea30f35c0da56a7e1de57701eb1f6","98d019534dd7c963b013eed9a2a2e8a96618e70a40730f6920614be6d410ef80","774f781a28c56874e245eadff141e5e52af54e5555d7e083fca45f06348841ed","96520a873073a2f39f922d0a422498cdcc28be9066a769000cdd07ecaba7b645","135aa6d18002bfec723f8697aa80a59648cf0582752d5e089b6eb0770b63a02d","b6eb8e23f4145ddbe22639779de710af7a554c9592f69f257b7ec5c487eb0695","831d99b85c6ced631649a70014e1288d3f927fa262e4009ba1fbcd11b965ce58","38fef887c5b2cae9d244172fe72957e61c3393bacc2be3ae5e2c1bf1e8a69e71","e064325c76ef07fec4cd69a91dabe717fae011bba5e15d81a2486ce25e80a91e","914d7cdcd8c7ebff500b43e8a878164ef0f93168eea0e5246747484a160d730b",{"version":"4169be501cd57005d1c910fa24cef850c2922596632b00096063f58d649ba85a","affectsGlobalScope":true},"abb6d9adcc79c591f712e79c55f769b48690ec66a55b6f6189569a0d357c7e58","9a63420b8edfb649c55ea9ec4eefc3e9469e102960885b30e76654c08f98086e","8ebd5899eefab0ba9bb82ae4cdd18aca44564a25cebfa51ea5d92db4252b49dd","62540abf0bac8bf8c13c183db0457c5495a2bdad157f9eb03916c3953feb765e","7fe68b17d28662b4c1232c578a3bce0532f2628b443ad541a196b124e4d93087","89eae3e00b2fbde1af73eab56e0ca7960c2dbc02c2ef89f98104ceb75526311b","88d3d5b21760947695c7d812e5992c5a80d938cafaf8ecf687e350bd230f5d25","11fb82c3644a70cf226676762f39dc6de87ef9dc11ed83e5ca52e013425cfd89","2d78a397234d9b3325910135668cffba83af759074ceadc0afd281795ca8b9fc","22f67790611304c6726a7e333265c1b64e472e78bb661f734a4cd715402d3e9f",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[143],[61],[57,58,59,60],[46],[45],[45,46,47,48,49,50,51,52,53,54,55],[48],[50],[83,84,85,86],[83],[84],[65],[61,62],[61,62,70,81],[62,81,88,89],[62,91],[62,81],[62,81,88],[81,151],[61,96,129,130],[61,81,88,132],[61,81,130,132],[63,81,154],[61,81,96,131,135,136,137,138],[63,130],[61,81,141],[61,81,130],[61,63,81,96,129],[61,81,129],[61,81],[61,130],[81],[61,81,96,143,144],[146],[63,64,81,154],[81,146],[147],[62,63,64,65,66,67,82,90,91,92,93,94,130,131,133,134,135,136,137,138,139,140,141,142,145,146,147,148,149,150,152,153,155,156,157,158,159],[56,61],[63],[87],[97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,121,122,123],[120],[124,125,126,127,128],[72],[72,73,76,77,78,79,80],[74,75],[61,72],[58,59,60,162],[68,69],[70],[95]],"referencedMap":[[144,1],[75,2],[74,2],[61,3],[47,4],[48,5],[56,6],[49,5],[50,5],[51,7],[52,8],[46,5],[53,8],[54,5],[55,8],[87,9],[84,10],[85,11],[66,12],[67,13],[82,14],[90,15],[92,16],[93,17],[94,18],[152,19],[131,20],[133,21],[134,22],[155,23],[139,24],[140,25],[142,26],[157,27],[159,28],[135,29],[137,30],[136,30],[158,31],[91,32],[141,32],[145,33],[146,32],[138,30],[147,32],[148,34],[130,30],[150,30],[156,35],[149,36],[153,37],[160,38],[62,39],[64,40],[88,41],[124,42],[121,43],[129,44],[73,45],[81,46],[80,2],[76,47],[72,2],[79,48],[71,49],[70,50],[68,51],[96,52]],"exportedModulesMap":[[144,1],[75,2],[74,2],[61,3],[47,4],[48,5],[56,6],[49,5],[50,5],[51,7],[52,8],[46,5],[53,8],[54,5],[55,8],[87,9],[84,10],[85,11],[66,12],[67,13],[82,14],[90,15],[92,16],[93,17],[94,18],[152,19],[131,20],[133,21],[134,22],[155,23],[139,24],[140,25],[142,26],[157,27],[159,28],[135,29],[137,30],[136,30],[158,31],[91,32],[141,32],[145,33],[146,32],[138,30],[147,32],[148,34],[130,30],[150,30],[156,35],[149,36],[153,37],[160,38],[62,39],[64,40],[88,41],[124,42],[121,43],[129,44],[73,45],[81,46],[80,2],[76,47],[72,2],[79,48],[71,49],[70,50],[68,51],[96,52]],"semanticDiagnosticsPerFile":[143,144,59,75,74,57,61,60,47,48,56,132,49,58,50,51,45,52,46,53,54,55,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,154,83,86,87,84,85,66,67,65,82,90,89,92,93,94,152,131,133,134,155,139,140,142,157,159,135,137,136,158,91,141,145,146,138,147,148,130,150,156,149,153,160,62,63,64,88,126,120,97,100,98,99,103,101,102,124,114,119,104,105,106,107,122,108,109,110,111,121,113,116,112,123,118,115,117,127,129,125,128,73,81,78,80,76,72,79,77,71,69,70,68,96,95,151,161]},"version":"4.4.2"}