@wordpress/compose 5.4.0 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.6.0 (2022-05-04)
6
+
7
+ ## 5.5.0 (2022-04-21)
8
+
5
9
  ## 5.4.0 (2022-04-08)
6
10
 
7
11
  ## 5.3.0 (2022-03-23)
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -7,10 +9,10 @@ exports.default = useDisabled;
7
9
 
8
10
  var _lodash = require("lodash");
9
11
 
10
- var _element = require("@wordpress/element");
11
-
12
12
  var _dom = require("@wordpress/dom");
13
13
 
14
+ var _useRefEffect = _interopRequireDefault(require("../use-ref-effect"));
15
+
14
16
  /**
15
17
  * External dependencies
16
18
  */
@@ -19,6 +21,10 @@ var _dom = require("@wordpress/dom");
19
21
  * WordPress dependencies
20
22
  */
21
23
 
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+
22
28
  /**
23
29
  * Names of control nodes which qualify for disabled behavior.
24
30
  *
@@ -34,7 +40,7 @@ const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP',
34
40
  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
35
41
  * behavior to disable nested DOM elements to the returned ref.
36
42
  *
37
- * @return {import('react').RefObject<HTMLElement>} Element Ref.
43
+ * @return {import('react').RefCallback<HTMLElement>} Element Ref.
38
44
  *
39
45
  * @example
40
46
  * ```js
@@ -52,55 +58,52 @@ const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP',
52
58
  */
53
59
 
54
60
  function useDisabled() {
55
- /** @type {import('react').RefObject<HTMLElement>} */
56
- const node = (0, _element.useRef)(null);
61
+ return (0, _useRefEffect.default)(node => {
62
+ const disable = () => {
63
+ node.style.setProperty('user-select', 'none');
64
+ node.style.setProperty('-webkit-user-select', 'none');
57
65
 
58
- const disable = () => {
59
- if (!node.current) {
60
- return;
61
- }
66
+ _dom.focus.focusable.find(node).forEach(focusable => {
67
+ var _node$ownerDocument$d;
62
68
 
63
- _dom.focus.focusable.find(node.current).forEach(focusable => {
64
- if ((0, _lodash.includes)(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
65
- focusable.setAttribute('disabled', '');
66
- }
69
+ if ((0, _lodash.includes)(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
70
+ focusable.setAttribute('disabled', '');
71
+ }
67
72
 
68
- if (focusable.nodeName === 'A') {
69
- focusable.setAttribute('tabindex', '-1');
70
- }
73
+ if (focusable.nodeName === 'A') {
74
+ focusable.setAttribute('tabindex', '-1');
75
+ }
71
76
 
72
- const tabIndex = focusable.getAttribute('tabindex');
77
+ const tabIndex = focusable.getAttribute('tabindex');
73
78
 
74
- if (tabIndex !== null && tabIndex !== '-1') {
75
- focusable.removeAttribute('tabindex');
76
- }
79
+ if (tabIndex !== null && tabIndex !== '-1') {
80
+ focusable.removeAttribute('tabindex');
81
+ }
77
82
 
78
- if (focusable.hasAttribute('contenteditable')) {
79
- focusable.setAttribute('contenteditable', 'false');
80
- }
81
- });
82
- }; // Debounce re-disable since disabling process itself will incur
83
- // additional mutations which should be ignored.
83
+ if (focusable.hasAttribute('contenteditable')) {
84
+ focusable.setAttribute('contenteditable', 'false');
85
+ }
84
86
 
87
+ if ((_node$ownerDocument$d = node.ownerDocument.defaultView) !== null && _node$ownerDocument$d !== void 0 && _node$ownerDocument$d.HTMLElement && focusable instanceof node.ownerDocument.defaultView.HTMLElement) {
88
+ focusable.style.setProperty('pointer-events', 'none');
89
+ }
90
+ });
91
+ }; // Debounce re-disable since disabling process itself will incur
92
+ // additional mutations which should be ignored.
85
93
 
86
- const debouncedDisable = (0, _element.useCallback)((0, _lodash.debounce)(disable, undefined, {
87
- leading: true
88
- }), []);
89
- (0, _element.useLayoutEffect)(() => {
94
+
95
+ const debouncedDisable = (0, _lodash.debounce)(disable, undefined, {
96
+ leading: true
97
+ });
90
98
  disable();
91
99
  /** @type {MutationObserver | undefined} */
92
100
 
93
- let observer;
94
-
95
- if (node.current) {
96
- observer = new window.MutationObserver(debouncedDisable);
97
- observer.observe(node.current, {
98
- childList: true,
99
- attributes: true,
100
- subtree: true
101
- });
102
- }
103
-
101
+ const observer = new window.MutationObserver(debouncedDisable);
102
+ observer.observe(node, {
103
+ childList: true,
104
+ attributes: true,
105
+ subtree: true
106
+ });
104
107
  return () => {
105
108
  if (observer) {
106
109
  observer.disconnect();
@@ -109,6 +112,5 @@ function useDisabled() {
109
112
  debouncedDisable.cancel();
110
113
  };
111
114
  }, []);
112
- return node;
113
115
  }
114
116
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.js"],"names":["DISABLED_ELIGIBLE_NODE_NAMES","useDisabled","node","disable","current","focus","focusable","find","forEach","nodeName","setAttribute","tabIndex","getAttribute","removeAttribute","hasAttribute","debouncedDisable","undefined","leading","observer","window","MutationObserver","observe","childList","attributes","subtree","disconnect","cancel"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,4BAA4B,GAAG,CACpC,QADoC,EAEpC,UAFoC,EAGpC,OAHoC,EAIpC,UAJoC,EAKpC,QALoC,EAMpC,QANoC,EAOpC,UAPoC,CAArC;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC,WAAT,GAAuB;AACrC;AACA,QAAMC,IAAI,GAAG,qBAAQ,IAAR,CAAb;;AAEA,QAAMC,OAAO,GAAG,MAAM;AACrB,QAAK,CAAED,IAAI,CAACE,OAAZ,EAAsB;AACrB;AACA;;AAEDC,eAAMC,SAAN,CAAgBC,IAAhB,CAAsBL,IAAI,CAACE,OAA3B,EAAqCI,OAArC,CAAgDF,SAAF,IAAiB;AAC9D,UACC,sBAAUN,4BAAV,EAAwCM,SAAS,CAACG,QAAlD,CADD,EAEE;AACDH,QAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,EAApC;AACA;;AAED,UAAKJ,SAAS,CAACG,QAAV,KAAuB,GAA5B,EAAkC;AACjCH,QAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,IAApC;AACA;;AAED,YAAMC,QAAQ,GAAGL,SAAS,CAACM,YAAV,CAAwB,UAAxB,CAAjB;;AACA,UAAKD,QAAQ,KAAK,IAAb,IAAqBA,QAAQ,KAAK,IAAvC,EAA8C;AAC7CL,QAAAA,SAAS,CAACO,eAAV,CAA2B,UAA3B;AACA;;AAED,UAAKP,SAAS,CAACQ,YAAV,CAAwB,iBAAxB,CAAL,EAAmD;AAClDR,QAAAA,SAAS,CAACI,YAAV,CAAwB,iBAAxB,EAA2C,OAA3C;AACA;AACD,KAnBD;AAoBA,GAzBD,CAJqC,CA+BrC;AACA;;;AACA,QAAMK,gBAAgB,GAAG,0BACxB,sBAAUZ,OAAV,EAAmBa,SAAnB,EAA8B;AAAEC,IAAAA,OAAO,EAAE;AAAX,GAA9B,CADwB,EAExB,EAFwB,CAAzB;AAKA,gCAAiB,MAAM;AACtBd,IAAAA,OAAO;AAEP;;AACA,QAAIe,QAAJ;;AACA,QAAKhB,IAAI,CAACE,OAAV,EAAoB;AACnBc,MAAAA,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BL,gBAA7B,CAAX;AACAG,MAAAA,QAAQ,CAACG,OAAT,CAAkBnB,IAAI,CAACE,OAAvB,EAAgC;AAC/BkB,QAAAA,SAAS,EAAE,IADoB;AAE/BC,QAAAA,UAAU,EAAE,IAFmB;AAG/BC,QAAAA,OAAO,EAAE;AAHsB,OAAhC;AAKA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACO,UAAT;AACA;;AACDV,MAAAA,gBAAgB,CAACW,MAAjB;AACA,KALD;AAMA,GApBD,EAoBG,EApBH;AAsBA,SAAOxB,IAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useLayoutEffect, useRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Names of control nodes which qualify for disabled behavior.\n *\n * See WHATWG HTML Standard: 4.10.18.5: \"Enabling and disabling form controls: the disabled attribute\".\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n *\n * @type {string[]}\n */\nconst DISABLED_ELIGIBLE_NODE_NAMES = [\n\t'BUTTON',\n\t'FIELDSET',\n\t'INPUT',\n\t'OPTGROUP',\n\t'OPTION',\n\t'SELECT',\n\t'TEXTAREA',\n];\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 * @return {import('react').RefObject<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';\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\t/** @type {import('react').RefObject<HTMLElement>} */\n\tconst node = useRef( null );\n\n\tconst disable = () => {\n\t\tif ( ! node.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfocus.focusable.find( node.current ).forEach( ( focusable ) => {\n\t\t\tif (\n\t\t\t\tincludes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )\n\t\t\t) {\n\t\t\t\tfocusable.setAttribute( 'disabled', '' );\n\t\t\t}\n\n\t\t\tif ( focusable.nodeName === 'A' ) {\n\t\t\t\tfocusable.setAttribute( 'tabindex', '-1' );\n\t\t\t}\n\n\t\t\tconst tabIndex = focusable.getAttribute( 'tabindex' );\n\t\t\tif ( tabIndex !== null && tabIndex !== '-1' ) {\n\t\t\t\tfocusable.removeAttribute( 'tabindex' );\n\t\t\t}\n\n\t\t\tif ( focusable.hasAttribute( 'contenteditable' ) ) {\n\t\t\t\tfocusable.setAttribute( 'contenteditable', 'false' );\n\t\t\t}\n\t\t} );\n\t};\n\n\t// Debounce re-disable since disabling process itself will incur\n\t// additional mutations which should be ignored.\n\tconst debouncedDisable = useCallback(\n\t\tdebounce( disable, undefined, { leading: true } ),\n\t\t[]\n\t);\n\n\tuseLayoutEffect( () => {\n\t\tdisable();\n\n\t\t/** @type {MutationObserver | undefined} */\n\t\tlet observer;\n\t\tif ( node.current ) {\n\t\t\tobserver = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node.current, {\n\t\t\t\tchildList: true,\n\t\t\t\tattributes: true,\n\t\t\t\tsubtree: true,\n\t\t\t} );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t\tdebouncedDisable.cancel();\n\t\t};\n\t}, [] );\n\n\treturn node;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.js"],"names":["DISABLED_ELIGIBLE_NODE_NAMES","useDisabled","node","disable","style","setProperty","focus","focusable","find","forEach","nodeName","setAttribute","tabIndex","getAttribute","removeAttribute","hasAttribute","ownerDocument","defaultView","HTMLElement","debouncedDisable","undefined","leading","observer","window","MutationObserver","observe","childList","attributes","subtree","disconnect","cancel"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,4BAA4B,GAAG,CACpC,QADoC,EAEpC,UAFoC,EAGpC,OAHoC,EAIpC,UAJoC,EAKpC,QALoC,EAMpC,QANoC,EAOpC,UAPoC,CAArC;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC,WAAT,GAAuB;AACrC,SAAO,2BAAgBC,IAAF,IAAY;AAChC,UAAMC,OAAO,GAAG,MAAM;AACrBD,MAAAA,IAAI,CAACE,KAAL,CAAWC,WAAX,CAAwB,aAAxB,EAAuC,MAAvC;AACAH,MAAAA,IAAI,CAACE,KAAL,CAAWC,WAAX,CAAwB,qBAAxB,EAA+C,MAA/C;;AACAC,iBAAMC,SAAN,CAAgBC,IAAhB,CAAsBN,IAAtB,EAA6BO,OAA7B,CAAwCF,SAAF,IAAiB;AAAA;;AACtD,YACC,sBAAUP,4BAAV,EAAwCO,SAAS,CAACG,QAAlD,CADD,EAEE;AACDH,UAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,EAApC;AACA;;AAED,YAAKJ,SAAS,CAACG,QAAV,KAAuB,GAA5B,EAAkC;AACjCH,UAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,IAApC;AACA;;AAED,cAAMC,QAAQ,GAAGL,SAAS,CAACM,YAAV,CAAwB,UAAxB,CAAjB;;AACA,YAAKD,QAAQ,KAAK,IAAb,IAAqBA,QAAQ,KAAK,IAAvC,EAA8C;AAC7CL,UAAAA,SAAS,CAACO,eAAV,CAA2B,UAA3B;AACA;;AAED,YAAKP,SAAS,CAACQ,YAAV,CAAwB,iBAAxB,CAAL,EAAmD;AAClDR,UAAAA,SAAS,CAACI,YAAV,CAAwB,iBAAxB,EAA2C,OAA3C;AACA;;AAED,YACC,yBAAAT,IAAI,CAACc,aAAL,CAAmBC,WAAnB,wEAAgCC,WAAhC,IACAX,SAAS,YACRL,IAAI,CAACc,aAAL,CAAmBC,WAAnB,CAA+BC,WAHjC,EAIE;AACDX,UAAAA,SAAS,CAACH,KAAV,CAAgBC,WAAhB,CAA6B,gBAA7B,EAA+C,MAA/C;AACA;AACD,OA3BD;AA4BA,KA/BD,CADgC,CAkChC;AACA;;;AACA,UAAMc,gBAAgB,GAAG,sBAAUhB,OAAV,EAAmBiB,SAAnB,EAA8B;AACtDC,MAAAA,OAAO,EAAE;AAD6C,KAA9B,CAAzB;AAGAlB,IAAAA,OAAO;AAEP;;AACA,UAAMmB,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BL,gBAA7B,CAAjB;AACAG,IAAAA,QAAQ,CAACG,OAAT,CAAkBvB,IAAlB,EAAwB;AACvBwB,MAAAA,SAAS,EAAE,IADY;AAEvBC,MAAAA,UAAU,EAAE,IAFW;AAGvBC,MAAAA,OAAO,EAAE;AAHc,KAAxB;AAMA,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACO,UAAT;AACA;;AACDV,MAAAA,gBAAgB,CAACW,MAAjB;AACA,KALD;AAMA,GAvDM,EAuDJ,EAvDI,CAAP;AAwDA","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * Names of control nodes which qualify for disabled behavior.\n *\n * See WHATWG HTML Standard: 4.10.18.5: \"Enabling and disabling form controls: the disabled attribute\".\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n *\n * @type {string[]}\n */\nconst DISABLED_ELIGIBLE_NODE_NAMES = [\n\t'BUTTON',\n\t'FIELDSET',\n\t'INPUT',\n\t'OPTGROUP',\n\t'OPTION',\n\t'SELECT',\n\t'TEXTAREA',\n];\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 * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';\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\treturn useRefEffect( ( node ) => {\n\t\tconst disable = () => {\n\t\t\tnode.style.setProperty( 'user-select', 'none' );\n\t\t\tnode.style.setProperty( '-webkit-user-select', 'none' );\n\t\t\tfocus.focusable.find( node ).forEach( ( focusable ) => {\n\t\t\t\tif (\n\t\t\t\t\tincludes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )\n\t\t\t\t) {\n\t\t\t\t\tfocusable.setAttribute( 'disabled', '' );\n\t\t\t\t}\n\n\t\t\t\tif ( focusable.nodeName === 'A' ) {\n\t\t\t\t\tfocusable.setAttribute( 'tabindex', '-1' );\n\t\t\t\t}\n\n\t\t\t\tconst tabIndex = focusable.getAttribute( 'tabindex' );\n\t\t\t\tif ( tabIndex !== null && tabIndex !== '-1' ) {\n\t\t\t\t\tfocusable.removeAttribute( 'tabindex' );\n\t\t\t\t}\n\n\t\t\t\tif ( focusable.hasAttribute( 'contenteditable' ) ) {\n\t\t\t\t\tfocusable.setAttribute( 'contenteditable', 'false' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnode.ownerDocument.defaultView?.HTMLElement &&\n\t\t\t\t\tfocusable instanceof\n\t\t\t\t\t\tnode.ownerDocument.defaultView.HTMLElement\n\t\t\t\t) {\n\t\t\t\t\tfocusable.style.setProperty( 'pointer-events', 'none' );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\t// Debounce re-disable since disabling process itself will incur\n\t\t// additional mutations which should be ignored.\n\t\tconst debouncedDisable = debounce( disable, undefined, {\n\t\t\tleading: true,\n\t\t} );\n\t\tdisable();\n\n\t\t/** @type {MutationObserver | undefined} */\n\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\tobserver.observe( node, {\n\t\t\tchildList: true,\n\t\t\tattributes: true,\n\t\t\tsubtree: true,\n\t\t} );\n\n\t\treturn () => {\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t\tdebouncedDisable.cancel();\n\t\t};\n\t}, [] );\n}\n"]}
@@ -6,8 +6,12 @@ import { includes, debounce } from 'lodash';
6
6
  * WordPress dependencies
7
7
  */
8
8
 
9
- import { useCallback, useLayoutEffect, useRef } from '@wordpress/element';
10
9
  import { focus } from '@wordpress/dom';
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
14
+ import useRefEffect from '../use-ref-effect';
11
15
  /**
12
16
  * Names of control nodes which qualify for disabled behavior.
13
17
  *
@@ -24,7 +28,7 @@ const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP',
24
28
  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
25
29
  * behavior to disable nested DOM elements to the returned ref.
26
30
  *
27
- * @return {import('react').RefObject<HTMLElement>} Element Ref.
31
+ * @return {import('react').RefCallback<HTMLElement>} Element Ref.
28
32
  *
29
33
  * @example
30
34
  * ```js
@@ -42,55 +46,51 @@ const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP',
42
46
  */
43
47
 
44
48
  export default function useDisabled() {
45
- /** @type {import('react').RefObject<HTMLElement>} */
46
- const node = useRef(null);
49
+ return useRefEffect(node => {
50
+ const disable = () => {
51
+ node.style.setProperty('user-select', 'none');
52
+ node.style.setProperty('-webkit-user-select', 'none');
53
+ focus.focusable.find(node).forEach(focusable => {
54
+ var _node$ownerDocument$d;
47
55
 
48
- const disable = () => {
49
- if (!node.current) {
50
- return;
51
- }
56
+ if (includes(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
57
+ focusable.setAttribute('disabled', '');
58
+ }
52
59
 
53
- focus.focusable.find(node.current).forEach(focusable => {
54
- if (includes(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
55
- focusable.setAttribute('disabled', '');
56
- }
60
+ if (focusable.nodeName === 'A') {
61
+ focusable.setAttribute('tabindex', '-1');
62
+ }
57
63
 
58
- if (focusable.nodeName === 'A') {
59
- focusable.setAttribute('tabindex', '-1');
60
- }
64
+ const tabIndex = focusable.getAttribute('tabindex');
61
65
 
62
- const tabIndex = focusable.getAttribute('tabindex');
66
+ if (tabIndex !== null && tabIndex !== '-1') {
67
+ focusable.removeAttribute('tabindex');
68
+ }
63
69
 
64
- if (tabIndex !== null && tabIndex !== '-1') {
65
- focusable.removeAttribute('tabindex');
66
- }
70
+ if (focusable.hasAttribute('contenteditable')) {
71
+ focusable.setAttribute('contenteditable', 'false');
72
+ }
67
73
 
68
- if (focusable.hasAttribute('contenteditable')) {
69
- focusable.setAttribute('contenteditable', 'false');
70
- }
71
- });
72
- }; // Debounce re-disable since disabling process itself will incur
73
- // additional mutations which should be ignored.
74
+ if ((_node$ownerDocument$d = node.ownerDocument.defaultView) !== null && _node$ownerDocument$d !== void 0 && _node$ownerDocument$d.HTMLElement && focusable instanceof node.ownerDocument.defaultView.HTMLElement) {
75
+ focusable.style.setProperty('pointer-events', 'none');
76
+ }
77
+ });
78
+ }; // Debounce re-disable since disabling process itself will incur
79
+ // additional mutations which should be ignored.
74
80
 
75
81
 
76
- const debouncedDisable = useCallback(debounce(disable, undefined, {
77
- leading: true
78
- }), []);
79
- useLayoutEffect(() => {
82
+ const debouncedDisable = debounce(disable, undefined, {
83
+ leading: true
84
+ });
80
85
  disable();
81
86
  /** @type {MutationObserver | undefined} */
82
87
 
83
- let observer;
84
-
85
- if (node.current) {
86
- observer = new window.MutationObserver(debouncedDisable);
87
- observer.observe(node.current, {
88
- childList: true,
89
- attributes: true,
90
- subtree: true
91
- });
92
- }
93
-
88
+ const observer = new window.MutationObserver(debouncedDisable);
89
+ observer.observe(node, {
90
+ childList: true,
91
+ attributes: true,
92
+ subtree: true
93
+ });
94
94
  return () => {
95
95
  if (observer) {
96
96
  observer.disconnect();
@@ -99,6 +99,5 @@ export default function useDisabled() {
99
99
  debouncedDisable.cancel();
100
100
  };
101
101
  }, []);
102
- return node;
103
102
  }
104
103
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.js"],"names":["includes","debounce","useCallback","useLayoutEffect","useRef","focus","DISABLED_ELIGIBLE_NODE_NAMES","useDisabled","node","disable","current","focusable","find","forEach","nodeName","setAttribute","tabIndex","getAttribute","removeAttribute","hasAttribute","debouncedDisable","undefined","leading","observer","window","MutationObserver","observe","childList","attributes","subtree","disconnect","cancel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,QAAnB,QAAmC,QAAnC;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,eAAtB,EAAuCC,MAAvC,QAAqD,oBAArD;AACA,SAASC,KAAT,QAAsB,gBAAtB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,4BAA4B,GAAG,CACpC,QADoC,EAEpC,UAFoC,EAGpC,OAHoC,EAIpC,UAJoC,EAKpC,QALoC,EAMpC,QANoC,EAOpC,UAPoC,CAArC;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,GAAuB;AACrC;AACA,QAAMC,IAAI,GAAGJ,MAAM,CAAE,IAAF,CAAnB;;AAEA,QAAMK,OAAO,GAAG,MAAM;AACrB,QAAK,CAAED,IAAI,CAACE,OAAZ,EAAsB;AACrB;AACA;;AAEDL,IAAAA,KAAK,CAACM,SAAN,CAAgBC,IAAhB,CAAsBJ,IAAI,CAACE,OAA3B,EAAqCG,OAArC,CAAgDF,SAAF,IAAiB;AAC9D,UACCX,QAAQ,CAAEM,4BAAF,EAAgCK,SAAS,CAACG,QAA1C,CADT,EAEE;AACDH,QAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,EAApC;AACA;;AAED,UAAKJ,SAAS,CAACG,QAAV,KAAuB,GAA5B,EAAkC;AACjCH,QAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,IAApC;AACA;;AAED,YAAMC,QAAQ,GAAGL,SAAS,CAACM,YAAV,CAAwB,UAAxB,CAAjB;;AACA,UAAKD,QAAQ,KAAK,IAAb,IAAqBA,QAAQ,KAAK,IAAvC,EAA8C;AAC7CL,QAAAA,SAAS,CAACO,eAAV,CAA2B,UAA3B;AACA;;AAED,UAAKP,SAAS,CAACQ,YAAV,CAAwB,iBAAxB,CAAL,EAAmD;AAClDR,QAAAA,SAAS,CAACI,YAAV,CAAwB,iBAAxB,EAA2C,OAA3C;AACA;AACD,KAnBD;AAoBA,GAzBD,CAJqC,CA+BrC;AACA;;;AACA,QAAMK,gBAAgB,GAAGlB,WAAW,CACnCD,QAAQ,CAAEQ,OAAF,EAAWY,SAAX,EAAsB;AAAEC,IAAAA,OAAO,EAAE;AAAX,GAAtB,CAD2B,EAEnC,EAFmC,CAApC;AAKAnB,EAAAA,eAAe,CAAE,MAAM;AACtBM,IAAAA,OAAO;AAEP;;AACA,QAAIc,QAAJ;;AACA,QAAKf,IAAI,CAACE,OAAV,EAAoB;AACnBa,MAAAA,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BL,gBAA7B,CAAX;AACAG,MAAAA,QAAQ,CAACG,OAAT,CAAkBlB,IAAI,CAACE,OAAvB,EAAgC;AAC/BiB,QAAAA,SAAS,EAAE,IADoB;AAE/BC,QAAAA,UAAU,EAAE,IAFmB;AAG/BC,QAAAA,OAAO,EAAE;AAHsB,OAAhC;AAKA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACO,UAAT;AACA;;AACDV,MAAAA,gBAAgB,CAACW,MAAjB;AACA,KALD;AAMA,GApBc,EAoBZ,EApBY,CAAf;AAsBA,SAAOvB,IAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useLayoutEffect, useRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Names of control nodes which qualify for disabled behavior.\n *\n * See WHATWG HTML Standard: 4.10.18.5: \"Enabling and disabling form controls: the disabled attribute\".\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n *\n * @type {string[]}\n */\nconst DISABLED_ELIGIBLE_NODE_NAMES = [\n\t'BUTTON',\n\t'FIELDSET',\n\t'INPUT',\n\t'OPTGROUP',\n\t'OPTION',\n\t'SELECT',\n\t'TEXTAREA',\n];\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 * @return {import('react').RefObject<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';\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\t/** @type {import('react').RefObject<HTMLElement>} */\n\tconst node = useRef( null );\n\n\tconst disable = () => {\n\t\tif ( ! node.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfocus.focusable.find( node.current ).forEach( ( focusable ) => {\n\t\t\tif (\n\t\t\t\tincludes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )\n\t\t\t) {\n\t\t\t\tfocusable.setAttribute( 'disabled', '' );\n\t\t\t}\n\n\t\t\tif ( focusable.nodeName === 'A' ) {\n\t\t\t\tfocusable.setAttribute( 'tabindex', '-1' );\n\t\t\t}\n\n\t\t\tconst tabIndex = focusable.getAttribute( 'tabindex' );\n\t\t\tif ( tabIndex !== null && tabIndex !== '-1' ) {\n\t\t\t\tfocusable.removeAttribute( 'tabindex' );\n\t\t\t}\n\n\t\t\tif ( focusable.hasAttribute( 'contenteditable' ) ) {\n\t\t\t\tfocusable.setAttribute( 'contenteditable', 'false' );\n\t\t\t}\n\t\t} );\n\t};\n\n\t// Debounce re-disable since disabling process itself will incur\n\t// additional mutations which should be ignored.\n\tconst debouncedDisable = useCallback(\n\t\tdebounce( disable, undefined, { leading: true } ),\n\t\t[]\n\t);\n\n\tuseLayoutEffect( () => {\n\t\tdisable();\n\n\t\t/** @type {MutationObserver | undefined} */\n\t\tlet observer;\n\t\tif ( node.current ) {\n\t\t\tobserver = new window.MutationObserver( debouncedDisable );\n\t\t\tobserver.observe( node.current, {\n\t\t\t\tchildList: true,\n\t\t\t\tattributes: true,\n\t\t\t\tsubtree: true,\n\t\t\t} );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t\tdebouncedDisable.cancel();\n\t\t};\n\t}, [] );\n\n\treturn node;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/compose/src/hooks/use-disabled/index.js"],"names":["includes","debounce","focus","useRefEffect","DISABLED_ELIGIBLE_NODE_NAMES","useDisabled","node","disable","style","setProperty","focusable","find","forEach","nodeName","setAttribute","tabIndex","getAttribute","removeAttribute","hasAttribute","ownerDocument","defaultView","HTMLElement","debouncedDisable","undefined","leading","observer","window","MutationObserver","observe","childList","attributes","subtree","disconnect","cancel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,QAAnB,QAAmC,QAAnC;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,mBAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,4BAA4B,GAAG,CACpC,QADoC,EAEpC,UAFoC,EAGpC,OAHoC,EAIpC,UAJoC,EAKpC,QALoC,EAMpC,QANoC,EAOpC,UAPoC,CAArC;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,GAAuB;AACrC,SAAOF,YAAY,CAAIG,IAAF,IAAY;AAChC,UAAMC,OAAO,GAAG,MAAM;AACrBD,MAAAA,IAAI,CAACE,KAAL,CAAWC,WAAX,CAAwB,aAAxB,EAAuC,MAAvC;AACAH,MAAAA,IAAI,CAACE,KAAL,CAAWC,WAAX,CAAwB,qBAAxB,EAA+C,MAA/C;AACAP,MAAAA,KAAK,CAACQ,SAAN,CAAgBC,IAAhB,CAAsBL,IAAtB,EAA6BM,OAA7B,CAAwCF,SAAF,IAAiB;AAAA;;AACtD,YACCV,QAAQ,CAAEI,4BAAF,EAAgCM,SAAS,CAACG,QAA1C,CADT,EAEE;AACDH,UAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,EAApC;AACA;;AAED,YAAKJ,SAAS,CAACG,QAAV,KAAuB,GAA5B,EAAkC;AACjCH,UAAAA,SAAS,CAACI,YAAV,CAAwB,UAAxB,EAAoC,IAApC;AACA;;AAED,cAAMC,QAAQ,GAAGL,SAAS,CAACM,YAAV,CAAwB,UAAxB,CAAjB;;AACA,YAAKD,QAAQ,KAAK,IAAb,IAAqBA,QAAQ,KAAK,IAAvC,EAA8C;AAC7CL,UAAAA,SAAS,CAACO,eAAV,CAA2B,UAA3B;AACA;;AAED,YAAKP,SAAS,CAACQ,YAAV,CAAwB,iBAAxB,CAAL,EAAmD;AAClDR,UAAAA,SAAS,CAACI,YAAV,CAAwB,iBAAxB,EAA2C,OAA3C;AACA;;AAED,YACC,yBAAAR,IAAI,CAACa,aAAL,CAAmBC,WAAnB,wEAAgCC,WAAhC,IACAX,SAAS,YACRJ,IAAI,CAACa,aAAL,CAAmBC,WAAnB,CAA+BC,WAHjC,EAIE;AACDX,UAAAA,SAAS,CAACF,KAAV,CAAgBC,WAAhB,CAA6B,gBAA7B,EAA+C,MAA/C;AACA;AACD,OA3BD;AA4BA,KA/BD,CADgC,CAkChC;AACA;;;AACA,UAAMa,gBAAgB,GAAGrB,QAAQ,CAAEM,OAAF,EAAWgB,SAAX,EAAsB;AACtDC,MAAAA,OAAO,EAAE;AAD6C,KAAtB,CAAjC;AAGAjB,IAAAA,OAAO;AAEP;;AACA,UAAMkB,QAAQ,GAAG,IAAIC,MAAM,CAACC,gBAAX,CAA6BL,gBAA7B,CAAjB;AACAG,IAAAA,QAAQ,CAACG,OAAT,CAAkBtB,IAAlB,EAAwB;AACvBuB,MAAAA,SAAS,EAAE,IADY;AAEvBC,MAAAA,UAAU,EAAE,IAFW;AAGvBC,MAAAA,OAAO,EAAE;AAHc,KAAxB;AAMA,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfA,QAAAA,QAAQ,CAACO,UAAT;AACA;;AACDV,MAAAA,gBAAgB,CAACW,MAAjB;AACA,KALD;AAMA,GAvDkB,EAuDhB,EAvDgB,CAAnB;AAwDA","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport useRefEffect from '../use-ref-effect';\n\n/**\n * Names of control nodes which qualify for disabled behavior.\n *\n * See WHATWG HTML Standard: 4.10.18.5: \"Enabling and disabling form controls: the disabled attribute\".\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n *\n * @type {string[]}\n */\nconst DISABLED_ELIGIBLE_NODE_NAMES = [\n\t'BUTTON',\n\t'FIELDSET',\n\t'INPUT',\n\t'OPTGROUP',\n\t'OPTION',\n\t'SELECT',\n\t'TEXTAREA',\n];\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 * @return {import('react').RefCallback<HTMLElement>} Element Ref.\n *\n * @example\n * ```js\n * import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';\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\treturn useRefEffect( ( node ) => {\n\t\tconst disable = () => {\n\t\t\tnode.style.setProperty( 'user-select', 'none' );\n\t\t\tnode.style.setProperty( '-webkit-user-select', 'none' );\n\t\t\tfocus.focusable.find( node ).forEach( ( focusable ) => {\n\t\t\t\tif (\n\t\t\t\t\tincludes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )\n\t\t\t\t) {\n\t\t\t\t\tfocusable.setAttribute( 'disabled', '' );\n\t\t\t\t}\n\n\t\t\t\tif ( focusable.nodeName === 'A' ) {\n\t\t\t\t\tfocusable.setAttribute( 'tabindex', '-1' );\n\t\t\t\t}\n\n\t\t\t\tconst tabIndex = focusable.getAttribute( 'tabindex' );\n\t\t\t\tif ( tabIndex !== null && tabIndex !== '-1' ) {\n\t\t\t\t\tfocusable.removeAttribute( 'tabindex' );\n\t\t\t\t}\n\n\t\t\t\tif ( focusable.hasAttribute( 'contenteditable' ) ) {\n\t\t\t\t\tfocusable.setAttribute( 'contenteditable', 'false' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnode.ownerDocument.defaultView?.HTMLElement &&\n\t\t\t\t\tfocusable instanceof\n\t\t\t\t\t\tnode.ownerDocument.defaultView.HTMLElement\n\t\t\t\t) {\n\t\t\t\t\tfocusable.style.setProperty( 'pointer-events', 'none' );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\t// Debounce re-disable since disabling process itself will incur\n\t\t// additional mutations which should be ignored.\n\t\tconst debouncedDisable = debounce( disable, undefined, {\n\t\t\tleading: true,\n\t\t} );\n\t\tdisable();\n\n\t\t/** @type {MutationObserver | undefined} */\n\t\tconst observer = new window.MutationObserver( debouncedDisable );\n\t\tobserver.observe( node, {\n\t\t\tchildList: true,\n\t\t\tattributes: true,\n\t\t\tsubtree: true,\n\t\t} );\n\n\t\treturn () => {\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t\tdebouncedDisable.cancel();\n\t\t};\n\t}, [] );\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
4
4
  * behavior to disable nested DOM elements to the returned ref.
5
5
  *
6
- * @return {import('react').RefObject<HTMLElement>} Element Ref.
6
+ * @return {import('react').RefCallback<HTMLElement>} Element Ref.
7
7
  *
8
8
  * @example
9
9
  * ```js
@@ -19,5 +19,5 @@
19
19
  * };
20
20
  * ```
21
21
  */
22
- export default function useDisabled(): import('react').RefObject<HTMLElement>;
22
+ export default function useDisabled(): import('react').RefCallback<HTMLElement>;
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,uCAhBY,OAAO,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CA6EjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-disabled/index.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,uCAhBY,OAAO,OAAO,EAAE,WAAW,CAAC,WAAW,CAAC,CAyEnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/compose",
3
- "version": "5.4.0",
3
+ "version": "5.6.0",
4
4
  "description": "WordPress higher-order components (HOCs).",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,12 +32,12 @@
32
32
  "@babel/runtime": "^7.16.0",
33
33
  "@types/lodash": "^4.14.172",
34
34
  "@types/mousetrap": "^1.6.8",
35
- "@wordpress/deprecated": "^3.6.0",
36
- "@wordpress/dom": "^3.6.0",
37
- "@wordpress/element": "^4.4.0",
38
- "@wordpress/is-shallow-equal": "^4.6.0",
39
- "@wordpress/keycodes": "^3.6.0",
40
- "@wordpress/priority-queue": "^2.6.0",
35
+ "@wordpress/deprecated": "^3.8.0",
36
+ "@wordpress/dom": "^3.8.0",
37
+ "@wordpress/element": "^4.6.0",
38
+ "@wordpress/is-shallow-equal": "^4.8.0",
39
+ "@wordpress/keycodes": "^3.8.0",
40
+ "@wordpress/priority-queue": "^2.8.0",
41
41
  "clipboard": "^2.0.8",
42
42
  "lodash": "^4.17.21",
43
43
  "mousetrap": "^1.6.5",
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "11eb1241e63c9240018323551c6753f8a5fa96f9"
53
+ "gitHead": "4631d515033397fcfeda77e5755960253caef9bf"
54
54
  }
@@ -6,9 +6,13 @@ import { includes, debounce } from 'lodash';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useCallback, useLayoutEffect, useRef } from '@wordpress/element';
10
9
  import { focus } from '@wordpress/dom';
11
10
 
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import useRefEffect from '../use-ref-effect';
15
+
12
16
  /**
13
17
  * Names of control nodes which qualify for disabled behavior.
14
18
  *
@@ -33,7 +37,7 @@ const DISABLED_ELIGIBLE_NODE_NAMES = [
33
37
  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
34
38
  * behavior to disable nested DOM elements to the returned ref.
35
39
  *
36
- * @return {import('react').RefObject<HTMLElement>} Element Ref.
40
+ * @return {import('react').RefCallback<HTMLElement>} Element Ref.
37
41
  *
38
42
  * @example
39
43
  * ```js
@@ -50,56 +54,54 @@ const DISABLED_ELIGIBLE_NODE_NAMES = [
50
54
  * ```
51
55
  */
52
56
  export default function useDisabled() {
53
- /** @type {import('react').RefObject<HTMLElement>} */
54
- const node = useRef( null );
57
+ return useRefEffect( ( node ) => {
58
+ const disable = () => {
59
+ node.style.setProperty( 'user-select', 'none' );
60
+ node.style.setProperty( '-webkit-user-select', 'none' );
61
+ focus.focusable.find( node ).forEach( ( focusable ) => {
62
+ if (
63
+ includes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )
64
+ ) {
65
+ focusable.setAttribute( 'disabled', '' );
66
+ }
55
67
 
56
- const disable = () => {
57
- if ( ! node.current ) {
58
- return;
59
- }
68
+ if ( focusable.nodeName === 'A' ) {
69
+ focusable.setAttribute( 'tabindex', '-1' );
70
+ }
60
71
 
61
- focus.focusable.find( node.current ).forEach( ( focusable ) => {
62
- if (
63
- includes( DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName )
64
- ) {
65
- focusable.setAttribute( 'disabled', '' );
66
- }
72
+ const tabIndex = focusable.getAttribute( 'tabindex' );
73
+ if ( tabIndex !== null && tabIndex !== '-1' ) {
74
+ focusable.removeAttribute( 'tabindex' );
75
+ }
67
76
 
68
- if ( focusable.nodeName === 'A' ) {
69
- focusable.setAttribute( 'tabindex', '-1' );
70
- }
77
+ if ( focusable.hasAttribute( 'contenteditable' ) ) {
78
+ focusable.setAttribute( 'contenteditable', 'false' );
79
+ }
71
80
 
72
- const tabIndex = focusable.getAttribute( 'tabindex' );
73
- if ( tabIndex !== null && tabIndex !== '-1' ) {
74
- focusable.removeAttribute( 'tabindex' );
75
- }
81
+ if (
82
+ node.ownerDocument.defaultView?.HTMLElement &&
83
+ focusable instanceof
84
+ node.ownerDocument.defaultView.HTMLElement
85
+ ) {
86
+ focusable.style.setProperty( 'pointer-events', 'none' );
87
+ }
88
+ } );
89
+ };
76
90
 
77
- if ( focusable.hasAttribute( 'contenteditable' ) ) {
78
- focusable.setAttribute( 'contenteditable', 'false' );
79
- }
91
+ // Debounce re-disable since disabling process itself will incur
92
+ // additional mutations which should be ignored.
93
+ const debouncedDisable = debounce( disable, undefined, {
94
+ leading: true,
80
95
  } );
81
- };
82
-
83
- // Debounce re-disable since disabling process itself will incur
84
- // additional mutations which should be ignored.
85
- const debouncedDisable = useCallback(
86
- debounce( disable, undefined, { leading: true } ),
87
- []
88
- );
89
-
90
- useLayoutEffect( () => {
91
96
  disable();
92
97
 
93
98
  /** @type {MutationObserver | undefined} */
94
- let observer;
95
- if ( node.current ) {
96
- observer = new window.MutationObserver( debouncedDisable );
97
- observer.observe( node.current, {
98
- childList: true,
99
- attributes: true,
100
- subtree: true,
101
- } );
102
- }
99
+ const observer = new window.MutationObserver( debouncedDisable );
100
+ observer.observe( node, {
101
+ childList: true,
102
+ attributes: true,
103
+ subtree: true,
104
+ } );
103
105
 
104
106
  return () => {
105
107
  if ( observer ) {
@@ -108,6 +110,4 @@ export default function useDisabled() {
108
110
  debouncedDisable.cancel();
109
111
  };
110
112
  }, [] );
111
-
112
- return node;
113
113
  }
@@ -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/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/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/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/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.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.js","./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/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.js","./src/hooks/use-merge-refs/index.js","./src/hooks/use-dialog/index.js","./src/hooks/use-disabled/index.js","./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","../../node_modules/react-resize-aware/dist/index.d.ts","./src/hooks/use-resize-observer/index.js","../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.js","./src/hooks/use-fixed-window-list/index.js","./src/index.js","../../typings/gutenberg-env/index.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},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"e630cc9d4ff48793647b1de978ec0d4257a8a2d1c88cd0b0742dd119c128e495","69b10db64ffa3da633ed87c4287bf34639c09e9fd7e9253b865b68a778ad59a3","b86f97467ecbdc4fa41019031ba789ad562b4710ba771ac0a756d1d843e4bcc2","5190f1a110a789c2f8ed8dcf2da6ce122dcb74249d0c01d19d1ed0b1c6bb02a1","3650bbe137c9c44bc6b8f44a56353b00eba9654e41a9355e6228f7f0f464c648","9c4f32d2fa2b6efeed4f9fbd98254121b17982110b48edcede96e2dc2af0894d","e59d00012fb20e6746def2f4bc94650526aa6c574c49ad6a50a992f61a3ee675","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","64edfb2b255173bc63214290f9c3ed2306d658b5895ca482a0f20f03fd544ffc","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","d7a53306f1683ff923002add80baf6a8b54fe9bfc1eb2b2dd77b71234cfe7330","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","685c1e09dc780ec54927eb79661f631c10753d9dd36063994c35df72d97ec32c","fc6f916d76818c8fff04ca01843162618f1d3243530306d72dc61380be0df018","97d817c482aed9bfe6fa9a5d4ebf1b155b5d9435233a983d1afc66096babf7fa","4be2d89e567e49b6a24576615373f9ded22a1206c0481df3604c335e30c9c1bc","9560f634fc3eb4fa49b5fba027a555ba6170a2fc6549c66a80642affd742510e","1110671ef0c9bed54246577aea5c934bc47fa382c554a3e0a79d03da5a65a3ad","f8c1fc8d1d92c7b953cf047a994edb35ed08a0a54ab4daefa8996944689d0c9d","cbf4ee77c80de53d71a1d076ea25eddd23541685119a67c43bd4aeaad8533b1f","215f6d27f88aeaa56a4e0fe358a6fe3b8b5f7c76a2f83663035028b0c2595b1f","df917f07e5930a2ddf94e8a040fa4353bc17080e3b97e635e2c1f4bcc2b0b649","99745b3ec986ce2f5be49ce530a088df5fb327fa6958d6fab4132cc9dadb70c3","ed29e483e8f02b00928f055ff2ba529f951464fb8fd7d1c7f77ea851b4e56039","fe43e4fd566293aee946e5db5b055db1215602498d315e468c6adaf1e6917fb4","ea912b91fed2f873b87e24180399baad37c43019b6f51b210e1d9f1d1d0135ba","a1cd2b1943db96616abf3a3f939dfd0eb69fab8149725d195a8acc7f5672a1f9","ddf5e2dd1897b3271acd68a587d43996e18c63ccc51b17f9149763a7d4bbadb7","1466691ae57846e0280465b012fd01aed3c4a4e0b39fcc11276833fbfc72ade7","f36506440d1abba7d2aff62bfcda4c95402d3e81314a482ac9c83e4c87b69229","cfa03019dd5cdd18ff1b5f00b3cb37ac762faf9eca2e86ea2c718502285cf67b","4d8d7075a3381162b4ae5147f84b4d2a2ae49398d98bef7c4437b8db0fefb194","a8b1a9f91ecb89faabb130af767e007ee28ac6ca794565d856759bb87e42feb1","1b1c43c378278f5dfea558337b0e3d57944a806eb4f55330baba592967253350","5ad070af2f7e4b7a676a63137c6a6cf670144ee5f23a9a30b21c19e70bb077f3","df060b3639c427e1c09bcf5cc14975f00b296e53192c710ea76e4a658a382aa0","4dd037aee1fed84d54490818e9a32d12e3e2f75d1dd9816d25fb9a0ecacee3b9","ca84eb7ffe779cb8812ee0a6aa151adac3dd25c4dc877767f37d079e5b62151f","f1d5239e0cdfb4ddd24a47727b88871802d3d2b3fda70229b158525753ad643e","af89d09746be737e24c50de49f035f3afea14c11be30ad5d2764d142daaa4078","5422948be7ac69dd13078af8ce2a8d9ea4d79eb510bfc54b75586573185183f9","246fc68fbf5c3ae2fded7eebcc38e6c5bb0f2cb796096916d0e65505cfbe850f","fc35e9bf454dcd7c42bab9e51bdedd4c9a5662b8d9964b1204913e268cb1fe6f","6e278ba8dbcf2617a2c5f5805e3addd1cf1c35b75b7dde3cbdabbccbf926b6fe","a2e36dad616090f5bcb99c4491b8b34bf8f2b5bf2fdcd6b5a43ddfd23f1b8433","c9d56f52ca68c2c86ec5ba05d927ef3892dca4923bd3cebe6593ebbcdd7e70c3","419dd7c5f46e04ddc2a390070fe19423200334f464bcd41a8bac56007127a13d","067b19c3d1fde05a39e5b769cbb5f44e0f6cf201f52fa2cafedc3943ea2e9052","e3ea09f9ea097b88c98df19c52694ac83daab0692e90cea9cf3faff00087899f","02e1dfd21586ad4379dc0d0ab88283694734f786ed4dcffaf5fbe25b23cd4b62","544b4da7754bbf07f95644d0bf4fdc791e5a60836dda88a317127a083dee9205","4a43623f49489a0e0359e905dc2eaeb88c9bc5dce62819b9c04c8c60d79d2782","edaded6955047309d9a87d329134b94d98651434117da62c6943cbfa723b1283","0529cc464f3dcf6322b23f37cb2a35bcc52baccb9afe128b38485cda9ea5db7d","d7865f701e0b27e883babea23a4aa1d1a8f37ccc502f7834b81d117401d689f4","2290ccf854da4cabed41ff4013869e463b16772b3f16ae308e382f91d516c895","af2cdede165faf7ea5de8e750f2f453f5bd43e2cdc4c40a94920ae6ece3c24cb","612f95d4d34eb1ed0f12cfb2bb732920103691a730e56021d392523045d885a8","b2f5779995addb268ede0af28f431d3496b482f1f41debf05b89e063e55ff366","5e34bcdfc35d0c41091a22fe4c3ff84d219cc6b34d2af52c17a3ab9ddf6c757d","be8b993a2eebe3915c6aa0216c1c33ffc768f76ac12347ed3ba4c012c595b64c","07dc58e23bdf7b870e57039c95ad2b841772034d247b469d1db6d062b225e658","4922e74a2348b7d8ab2df3938da4da210aa8805eec96489cbfc818c6646fbe19","98d019534dd7c963b013eed9a2a2e8a96618e70a40730f6920614be6d410ef80","314f946c60be58c8783f62d7e635ed6a84200f49944818594e349e405b6c69c5","96520a873073a2f39f922d0a422498cdcc28be9066a769000cdd07ecaba7b645","135aa6d18002bfec723f8697aa80a59648cf0582752d5e089b6eb0770b63a02d","bf6d3e315df1b10ee43c4862ea3db487ededb25246ab428e8ed1fb048ef719f6","831d99b85c6ced631649a70014e1288d3f927fa262e4009ba1fbcd11b965ce58","38fef887c5b2cae9d244172fe72957e61c3393bacc2be3ae5e2c1bf1e8a69e71","e064325c76ef07fec4cd69a91dabe717fae011bba5e15d81a2486ce25e80a91e","914d7cdcd8c7ebff500b43e8a878164ef0f93168eea0e5246747484a160d730b","86d2b7c95a540a2e9c1b35a41e0657adbdcce0e49f7c14c4162d594119ebb565","1e9c747baab36c95f28b88da102d5b2f60e047dcb315fbaf61b14b9448313806","8428253b010d7a2ef74156e763b59c11beb86ef4b8088b01837951633f955c11","e7669752758ae96e591040a264669535d7e65a8ce01f86812211fe39dc7bef6c","8ebd5899eefab0ba9bb82ae4cdd18aca44564a25cebfa51ea5d92db4252b49dd","62540abf0bac8bf8c13c183db0457c5495a2bdad157f9eb03916c3953feb765e","8a126a8c4817c6365ffb7445acec8149af98848f032a9cfcabcfdb4265378617","87ac7ab11dcc72117e09c35493e19a0bdcf75ca611e48e3a81beebca9f3f04b5","99a0244daefbc026e6822c18165c0e63855bb038daca05d506442fc35a04227a","6dd661da9a47bde2190abb41b215af59eb3f5161ea91d827dc7192bb8d071273","10dd593394a526fe1cb261d8bff72357a05fd774d6a1552559e547fb52ab7cea","8dc19e61040b3ee42f28e40f53f992a5bbe0c74f5aef70a2c13d1677901cfe36",{"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":[[45,47,48,49,50,51,52,53,54,55,56,57],[45,46,48,49,50,51,52,53,54,55,56,57],[46,47,48,49,50,51,52,53,54,55,56,57],[45,46,47,49,50,51,52,53,54,55,56,57],[45,46,47,48,50,51,52,53,54,55,56,57],[45,46,47,48,49,51,52,53,54,55,56,57],[45,46,47,48,49,50,52,53,54,55,56,57],[45,46,47,48,49,50,51,53,54,55,56,57],[45,46,47,48,49,50,51,52,54,55,56,57],[45,46,47,48,49,50,51,52,53,55,56,57],[45,46,47,48,49,50,51,52,53,54,56,57],[45,46,47,48,49,50,51,52,53,54,55,57],[45,46,47,48,49,50,51,52,53,54,55,56],[138],[62],[58,59,60,61],[79,80,81,82],[79],[80],[57],[63],[62,63,68,77],[57,63,77,84,85],[63,87],[57,62,63,77],[63,77,84],[77,147],[62,91,124,125],[62,77,84,127],[62,77,125,127],[57,77,150],[62,77,91,126,130,131,132,133],[57,62,77,124],[77,136],[62,77,125],[57,62,77,91,124],[62,77,124],[57,62,77],[62,77],[125],[77],[57,62,77,138,139],[141],[145],[77,141],[142],[63,64,65,78,86,87,88,89,90,125,126,128,129,130,131,132,133,134,135,136,137,140,141,142,143,144,146,148,149,151,152,153,154,155],[57,62],[83],[92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,116,117,118],[115],[119,120,121,122,123],[69],[69,70,72,73,74,75,76],[71],[62,69],[66,67],[68]],"referencedMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[139,14],[71,15],[62,16],[145,15],[83,17],[80,18],[81,19],[64,20],[65,21],[78,22],[86,23],[85,20],[88,24],[89,25],[90,26],[148,27],[126,28],[128,29],[129,30],[151,31],[134,32],[135,33],[137,34],[153,35],[155,36],[130,37],[132,38],[131,39],[154,40],[87,41],[136,41],[140,42],[141,41],[133,39],[142,41],[143,43],[125,39],[146,44],[152,31],[144,45],[149,46],[156,47],[63,48],[84,49],[119,50],[116,51],[124,52],[70,53],[77,54],[76,15],[72,55],[69,15],[75,56],[68,57],[66,58]],"exportedModulesMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[139,14],[71,15],[62,16],[145,15],[83,17],[80,18],[81,19],[64,20],[65,21],[78,22],[86,23],[85,20],[88,24],[89,25],[90,26],[148,27],[126,28],[128,29],[129,30],[151,31],[134,32],[135,33],[137,34],[153,35],[155,36],[130,37],[132,38],[131,39],[154,40],[87,41],[136,41],[140,42],[141,41],[133,39],[142,41],[143,43],[125,39],[146,44],[152,31],[144,45],[149,46],[156,47],[63,48],[84,49],[119,50],[116,51],[124,52],[70,53],[77,54],[76,15],[72,55],[69,15],[75,56],[68,57],[66,58]],"semanticDiagnosticsPerFile":[46,47,45,48,49,50,51,52,53,54,55,56,57,138,139,60,71,58,62,59,61,127,145,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,150,79,82,83,80,81,64,65,78,86,85,88,89,90,148,126,128,129,151,134,135,137,153,155,130,132,131,154,87,136,140,141,133,142,143,125,146,152,144,149,156,63,84,121,115,92,95,93,94,98,96,97,119,109,114,99,100,101,102,117,103,104,105,106,116,108,111,107,118,113,110,112,122,124,120,123,70,77,74,76,72,69,75,73,67,68,66,91,147,157]},"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/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/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/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/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.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.js","./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/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.js","./src/hooks/use-merge-refs/index.js","./src/hooks/use-dialog/index.js","./src/hooks/use-disabled/index.js","./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","../../node_modules/react-resize-aware/dist/index.d.ts","./src/hooks/use-resize-observer/index.js","../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.js","./src/hooks/use-fixed-window-list/index.js","./src/index.js","../../typings/gutenberg-env/index.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},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"e630cc9d4ff48793647b1de978ec0d4257a8a2d1c88cd0b0742dd119c128e495","69b10db64ffa3da633ed87c4287bf34639c09e9fd7e9253b865b68a778ad59a3","b86f97467ecbdc4fa41019031ba789ad562b4710ba771ac0a756d1d843e4bcc2","5190f1a110a789c2f8ed8dcf2da6ce122dcb74249d0c01d19d1ed0b1c6bb02a1","3650bbe137c9c44bc6b8f44a56353b00eba9654e41a9355e6228f7f0f464c648","9c4f32d2fa2b6efeed4f9fbd98254121b17982110b48edcede96e2dc2af0894d","e59d00012fb20e6746def2f4bc94650526aa6c574c49ad6a50a992f61a3ee675","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","5d7018910750d9cb4a912577ad2951fc3fad83c30d637689b69ffc6bbb0c9f5a","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","d7a53306f1683ff923002add80baf6a8b54fe9bfc1eb2b2dd77b71234cfe7330","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","685c1e09dc780ec54927eb79661f631c10753d9dd36063994c35df72d97ec32c","fc6f916d76818c8fff04ca01843162618f1d3243530306d72dc61380be0df018","97d817c482aed9bfe6fa9a5d4ebf1b155b5d9435233a983d1afc66096babf7fa","4be2d89e567e49b6a24576615373f9ded22a1206c0481df3604c335e30c9c1bc","9560f634fc3eb4fa49b5fba027a555ba6170a2fc6549c66a80642affd742510e","1110671ef0c9bed54246577aea5c934bc47fa382c554a3e0a79d03da5a65a3ad","f8c1fc8d1d92c7b953cf047a994edb35ed08a0a54ab4daefa8996944689d0c9d","cbf4ee77c80de53d71a1d076ea25eddd23541685119a67c43bd4aeaad8533b1f","215f6d27f88aeaa56a4e0fe358a6fe3b8b5f7c76a2f83663035028b0c2595b1f","df917f07e5930a2ddf94e8a040fa4353bc17080e3b97e635e2c1f4bcc2b0b649","99745b3ec986ce2f5be49ce530a088df5fb327fa6958d6fab4132cc9dadb70c3","ed29e483e8f02b00928f055ff2ba529f951464fb8fd7d1c7f77ea851b4e56039","fe43e4fd566293aee946e5db5b055db1215602498d315e468c6adaf1e6917fb4","ea912b91fed2f873b87e24180399baad37c43019b6f51b210e1d9f1d1d0135ba","a1cd2b1943db96616abf3a3f939dfd0eb69fab8149725d195a8acc7f5672a1f9","ddf5e2dd1897b3271acd68a587d43996e18c63ccc51b17f9149763a7d4bbadb7","1466691ae57846e0280465b012fd01aed3c4a4e0b39fcc11276833fbfc72ade7","f36506440d1abba7d2aff62bfcda4c95402d3e81314a482ac9c83e4c87b69229","cfa03019dd5cdd18ff1b5f00b3cb37ac762faf9eca2e86ea2c718502285cf67b","4d8d7075a3381162b4ae5147f84b4d2a2ae49398d98bef7c4437b8db0fefb194","a8b1a9f91ecb89faabb130af767e007ee28ac6ca794565d856759bb87e42feb1","1b1c43c378278f5dfea558337b0e3d57944a806eb4f55330baba592967253350","5ad070af2f7e4b7a676a63137c6a6cf670144ee5f23a9a30b21c19e70bb077f3","df060b3639c427e1c09bcf5cc14975f00b296e53192c710ea76e4a658a382aa0","4dd037aee1fed84d54490818e9a32d12e3e2f75d1dd9816d25fb9a0ecacee3b9","ca84eb7ffe779cb8812ee0a6aa151adac3dd25c4dc877767f37d079e5b62151f","f1d5239e0cdfb4ddd24a47727b88871802d3d2b3fda70229b158525753ad643e","af89d09746be737e24c50de49f035f3afea14c11be30ad5d2764d142daaa4078","5422948be7ac69dd13078af8ce2a8d9ea4d79eb510bfc54b75586573185183f9","246fc68fbf5c3ae2fded7eebcc38e6c5bb0f2cb796096916d0e65505cfbe850f","fc35e9bf454dcd7c42bab9e51bdedd4c9a5662b8d9964b1204913e268cb1fe6f","6e278ba8dbcf2617a2c5f5805e3addd1cf1c35b75b7dde3cbdabbccbf926b6fe","a2e36dad616090f5bcb99c4491b8b34bf8f2b5bf2fdcd6b5a43ddfd23f1b8433","c9d56f52ca68c2c86ec5ba05d927ef3892dca4923bd3cebe6593ebbcdd7e70c3","419dd7c5f46e04ddc2a390070fe19423200334f464bcd41a8bac56007127a13d","067b19c3d1fde05a39e5b769cbb5f44e0f6cf201f52fa2cafedc3943ea2e9052","e3ea09f9ea097b88c98df19c52694ac83daab0692e90cea9cf3faff00087899f","02e1dfd21586ad4379dc0d0ab88283694734f786ed4dcffaf5fbe25b23cd4b62","544b4da7754bbf07f95644d0bf4fdc791e5a60836dda88a317127a083dee9205","4a43623f49489a0e0359e905dc2eaeb88c9bc5dce62819b9c04c8c60d79d2782","edaded6955047309d9a87d329134b94d98651434117da62c6943cbfa723b1283","0529cc464f3dcf6322b23f37cb2a35bcc52baccb9afe128b38485cda9ea5db7d","d7865f701e0b27e883babea23a4aa1d1a8f37ccc502f7834b81d117401d689f4","2290ccf854da4cabed41ff4013869e463b16772b3f16ae308e382f91d516c895","af2cdede165faf7ea5de8e750f2f453f5bd43e2cdc4c40a94920ae6ece3c24cb","612f95d4d34eb1ed0f12cfb2bb732920103691a730e56021d392523045d885a8","b2f5779995addb268ede0af28f431d3496b482f1f41debf05b89e063e55ff366","5e34bcdfc35d0c41091a22fe4c3ff84d219cc6b34d2af52c17a3ab9ddf6c757d","be8b993a2eebe3915c6aa0216c1c33ffc768f76ac12347ed3ba4c012c595b64c","07dc58e23bdf7b870e57039c95ad2b841772034d247b469d1db6d062b225e658","db8e95261fff9aded0e9409daaa2f3c29a12d8cc2277708a48af17538688e8b0","98d019534dd7c963b013eed9a2a2e8a96618e70a40730f6920614be6d410ef80","314f946c60be58c8783f62d7e635ed6a84200f49944818594e349e405b6c69c5","96520a873073a2f39f922d0a422498cdcc28be9066a769000cdd07ecaba7b645","135aa6d18002bfec723f8697aa80a59648cf0582752d5e089b6eb0770b63a02d","bf6d3e315df1b10ee43c4862ea3db487ededb25246ab428e8ed1fb048ef719f6","831d99b85c6ced631649a70014e1288d3f927fa262e4009ba1fbcd11b965ce58","38fef887c5b2cae9d244172fe72957e61c3393bacc2be3ae5e2c1bf1e8a69e71","e064325c76ef07fec4cd69a91dabe717fae011bba5e15d81a2486ce25e80a91e","914d7cdcd8c7ebff500b43e8a878164ef0f93168eea0e5246747484a160d730b","86d2b7c95a540a2e9c1b35a41e0657adbdcce0e49f7c14c4162d594119ebb565","1e9c747baab36c95f28b88da102d5b2f60e047dcb315fbaf61b14b9448313806","abb6d9adcc79c591f712e79c55f769b48690ec66a55b6f6189569a0d357c7e58","e7669752758ae96e591040a264669535d7e65a8ce01f86812211fe39dc7bef6c","8ebd5899eefab0ba9bb82ae4cdd18aca44564a25cebfa51ea5d92db4252b49dd","62540abf0bac8bf8c13c183db0457c5495a2bdad157f9eb03916c3953feb765e","8a126a8c4817c6365ffb7445acec8149af98848f032a9cfcabcfdb4265378617","87ac7ab11dcc72117e09c35493e19a0bdcf75ca611e48e3a81beebca9f3f04b5","99a0244daefbc026e6822c18165c0e63855bb038daca05d506442fc35a04227a","6dd661da9a47bde2190abb41b215af59eb3f5161ea91d827dc7192bb8d071273","10dd593394a526fe1cb261d8bff72357a05fd774d6a1552559e547fb52ab7cea","8dc19e61040b3ee42f28e40f53f992a5bbe0c74f5aef70a2c13d1677901cfe36",{"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":[[45,47,48,49,50,51,52,53,54,55,56,57],[45,46,48,49,50,51,52,53,54,55,56,57],[46,47,48,49,50,51,52,53,54,55,56,57],[45,46,47,49,50,51,52,53,54,55,56,57],[45,46,47,48,50,51,52,53,54,55,56,57],[45,46,47,48,49,51,52,53,54,55,56,57],[45,46,47,48,49,50,52,53,54,55,56,57],[45,46,47,48,49,50,51,53,54,55,56,57],[45,46,47,48,49,50,51,52,54,55,56,57],[45,46,47,48,49,50,51,52,53,55,56,57],[45,46,47,48,49,50,51,52,53,54,56,57],[45,46,47,48,49,50,51,52,53,54,55,57],[45,46,47,48,49,50,51,52,53,54,55,56],[138],[62],[58,59,60,61],[79,80,81,82],[79],[80],[57],[63],[62,63,68,77],[57,63,77,84,85],[63,87],[57,62,63,77],[63,77,84],[77,147],[62,91,124,125],[62,77,84,127],[62,77,125,127],[57,77,150],[62,77,91,126,130,131,132,133],[57,62,124,125],[77,136],[62,77,125],[57,62,77,91,124],[62,77,124],[57,62,77],[62,77],[125],[77],[57,62,77,138,139],[141],[145],[77,141],[142],[63,64,65,78,86,87,88,89,90,125,126,128,129,130,131,132,133,134,135,136,137,140,141,142,143,144,146,148,149,151,152,153,154,155],[57,62],[83],[92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,116,117,118],[115],[119,120,121,122,123],[69],[69,70,72,73,74,75,76],[71],[62,69],[66,67],[68]],"referencedMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[139,14],[71,15],[62,16],[145,15],[83,17],[80,18],[81,19],[64,20],[65,21],[78,22],[86,23],[85,20],[88,24],[89,25],[90,26],[148,27],[126,28],[128,29],[129,30],[151,31],[134,32],[135,33],[137,34],[153,35],[155,36],[130,37],[132,38],[131,39],[154,40],[87,41],[136,41],[140,42],[141,41],[133,39],[142,41],[143,43],[125,39],[146,44],[152,31],[144,45],[149,46],[156,47],[63,48],[84,49],[119,50],[116,51],[124,52],[70,53],[77,54],[76,15],[72,55],[69,15],[75,56],[68,57],[66,58]],"exportedModulesMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[139,14],[71,15],[62,16],[145,15],[83,17],[80,18],[81,19],[64,20],[65,21],[78,22],[86,23],[85,20],[88,24],[89,25],[90,26],[148,27],[126,28],[128,29],[129,30],[151,31],[134,32],[135,33],[137,34],[153,35],[155,36],[130,37],[132,38],[131,39],[154,40],[87,41],[136,41],[140,42],[141,41],[133,39],[142,41],[143,43],[125,39],[146,44],[152,31],[144,45],[149,46],[156,47],[63,48],[84,49],[119,50],[116,51],[124,52],[70,53],[77,54],[76,15],[72,55],[69,15],[75,56],[68,57],[66,58]],"semanticDiagnosticsPerFile":[46,47,45,48,49,50,51,52,53,54,55,56,57,138,139,60,71,58,62,59,61,127,145,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,150,79,82,83,80,81,64,65,78,86,85,88,89,90,148,126,128,129,151,134,135,137,153,155,130,132,131,154,87,136,140,141,133,142,143,125,146,152,144,149,156,63,84,121,115,92,95,93,94,98,96,97,119,109,114,99,100,101,102,117,103,104,105,106,116,108,111,107,118,113,110,112,122,124,120,123,70,77,74,76,72,69,75,73,67,68,66,91,147,157]},"version":"4.4.2"}